@commandgarden/cli 2.1.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,255 +0,0 @@
1
- function oh(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const r in s)if(r!=="default"&&!(r in e)){const i=Object.getOwnPropertyDescriptor(s,r);i&&Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:()=>s[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();function ah(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vu={exports:{}},$i={},Gu={exports:{}},U={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its 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 dr=Symbol.for("react.element"),ch=Symbol.for("react.portal"),uh=Symbol.for("react.fragment"),dh=Symbol.for("react.strict_mode"),fh=Symbol.for("react.profiler"),ph=Symbol.for("react.provider"),hh=Symbol.for("react.context"),mh=Symbol.for("react.forward_ref"),gh=Symbol.for("react.suspense"),yh=Symbol.for("react.memo"),xh=Symbol.for("react.lazy"),cc=Symbol.iterator;function vh(e){return e===null||typeof e!="object"?null:(e=cc&&e[cc]||e["@@iterator"],typeof e=="function"?e:null)}var Yu={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},qu=Object.assign,Qu={};function ls(e,t,n){this.props=e,this.context=t,this.refs=Qu,this.updater=n||Yu}ls.prototype.isReactComponent={};ls.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ls.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ju(){}Ju.prototype=ls.prototype;function Xo(e,t,n){this.props=e,this.context=t,this.refs=Qu,this.updater=n||Yu}var Zo=Xo.prototype=new Ju;Zo.constructor=Xo;qu(Zo,ls.prototype);Zo.isPureReactComponent=!0;var uc=Array.isArray,Xu=Object.prototype.hasOwnProperty,ea={current:null},Zu={key:!0,ref:!0,__self:!0,__source:!0};function ed(e,t,n){var s,r={},i=null,o=null;if(t!=null)for(s in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)Xu.call(t,s)&&!Zu.hasOwnProperty(s)&&(r[s]=t[s]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var c=Array(a),u=0;u<a;u++)c[u]=arguments[u+2];r.children=c}if(e&&e.defaultProps)for(s in a=e.defaultProps,a)r[s]===void 0&&(r[s]=a[s]);return{$$typeof:dr,type:e,key:i,ref:o,props:r,_owner:ea.current}}function wh(e,t){return{$$typeof:dr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ta(e){return typeof e=="object"&&e!==null&&e.$$typeof===dr}function bh(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var dc=/\/+/g;function pl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?bh(""+e.key):t.toString(36)}function Yr(e,t,n,s,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case dr:case ch:o=!0}}if(o)return o=e,r=r(o),e=s===""?"."+pl(o,0):s,uc(r)?(n="",e!=null&&(n=e.replace(dc,"$&/")+"/"),Yr(r,t,n,"",function(u){return u})):r!=null&&(ta(r)&&(r=wh(r,n+(!r.key||o&&o.key===r.key?"":(""+r.key).replace(dc,"$&/")+"/")+e)),t.push(r)),1;if(o=0,s=s===""?".":s+":",uc(e))for(var a=0;a<e.length;a++){i=e[a];var c=s+pl(i,a);o+=Yr(i,t,n,c,r)}else if(c=vh(e),typeof c=="function")for(e=c.call(e),a=0;!(i=e.next()).done;)i=i.value,c=s+pl(i,a++),o+=Yr(i,t,n,c,r);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Nr(e,t,n){if(e==null)return e;var s=[],r=0;return Yr(e,s,"","",function(i){return t.call(n,i,r++)}),s}function jh(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ee={current:null},qr={transition:null},kh={ReactCurrentDispatcher:Ee,ReactCurrentBatchConfig:qr,ReactCurrentOwner:ea};function td(){throw Error("act(...) is not supported in production builds of React.")}U.Children={map:Nr,forEach:function(e,t,n){Nr(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Nr(e,function(){t++}),t},toArray:function(e){return Nr(e,function(t){return t})||[]},only:function(e){if(!ta(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};U.Component=ls;U.Fragment=uh;U.Profiler=fh;U.PureComponent=Xo;U.StrictMode=dh;U.Suspense=gh;U.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=kh;U.act=td;U.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var s=qu({},e.props),r=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=ea.current),t.key!==void 0&&(r=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(c in t)Xu.call(t,c)&&!Zu.hasOwnProperty(c)&&(s[c]=t[c]===void 0&&a!==void 0?a[c]:t[c])}var c=arguments.length-2;if(c===1)s.children=n;else if(1<c){a=Array(c);for(var u=0;u<c;u++)a[u]=arguments[u+2];s.children=a}return{$$typeof:dr,type:e.type,key:r,ref:i,props:s,_owner:o}};U.createContext=function(e){return e={$$typeof:hh,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:ph,_context:e},e.Consumer=e};U.createElement=ed;U.createFactory=function(e){var t=ed.bind(null,e);return t.type=e,t};U.createRef=function(){return{current:null}};U.forwardRef=function(e){return{$$typeof:mh,render:e}};U.isValidElement=ta;U.lazy=function(e){return{$$typeof:xh,_payload:{_status:-1,_result:e},_init:jh}};U.memo=function(e,t){return{$$typeof:yh,type:e,compare:t===void 0?null:t}};U.startTransition=function(e){var t=qr.transition;qr.transition={};try{e()}finally{qr.transition=t}};U.unstable_act=td;U.useCallback=function(e,t){return Ee.current.useCallback(e,t)};U.useContext=function(e){return Ee.current.useContext(e)};U.useDebugValue=function(){};U.useDeferredValue=function(e){return Ee.current.useDeferredValue(e)};U.useEffect=function(e,t){return Ee.current.useEffect(e,t)};U.useId=function(){return Ee.current.useId()};U.useImperativeHandle=function(e,t,n){return Ee.current.useImperativeHandle(e,t,n)};U.useInsertionEffect=function(e,t){return Ee.current.useInsertionEffect(e,t)};U.useLayoutEffect=function(e,t){return Ee.current.useLayoutEffect(e,t)};U.useMemo=function(e,t){return Ee.current.useMemo(e,t)};U.useReducer=function(e,t,n){return Ee.current.useReducer(e,t,n)};U.useRef=function(e){return Ee.current.useRef(e)};U.useState=function(e){return Ee.current.useState(e)};U.useSyncExternalStore=function(e,t,n){return Ee.current.useSyncExternalStore(e,t,n)};U.useTransition=function(){return Ee.current.useTransition()};U.version="18.3.1";Gu.exports=U;var w=Gu.exports;const Nh=ah(w),Sh=oh({__proto__:null,default:Nh},[w]);/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its 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 Ch=w,Eh=Symbol.for("react.element"),Th=Symbol.for("react.fragment"),Lh=Object.prototype.hasOwnProperty,Ph=Ch.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ih={key:!0,ref:!0,__self:!0,__source:!0};function nd(e,t,n){var s,r={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(s in t)Lh.call(t,s)&&!Ih.hasOwnProperty(s)&&(r[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)r[s]===void 0&&(r[s]=t[s]);return{$$typeof:Eh,type:e,key:i,ref:o,props:r,_owner:Ph.current}}$i.Fragment=Th;$i.jsx=nd;$i.jsxs=nd;Vu.exports=$i;var l=Vu.exports,sd={exports:{}},ze={},rd={exports:{}},id={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(L,_){var R=L.length;L.push(_);e:for(;0<R;){var $=R-1>>>1,Q=L[$];if(0<r(Q,_))L[$]=_,L[R]=Q,R=$;else break e}}function n(L){return L.length===0?null:L[0]}function s(L){if(L.length===0)return null;var _=L[0],R=L.pop();if(R!==_){L[0]=R;e:for(var $=0,Q=L.length,De=Q>>>1;$<De;){var Je=2*($+1)-1,gs=L[Je],en=Je+1,kr=L[en];if(0>r(gs,R))en<Q&&0>r(kr,gs)?(L[$]=kr,L[en]=R,$=en):(L[$]=gs,L[Je]=R,$=Je);else if(en<Q&&0>r(kr,R))L[$]=kr,L[en]=R,$=en;else break e}}return _}function r(L,_){var R=L.sortIndex-_.sortIndex;return R!==0?R:L.id-_.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var c=[],u=[],p=1,d=null,f=3,y=!1,b=!1,x=!1,v=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function h(L){for(var _=n(u);_!==null;){if(_.callback===null)s(u);else if(_.startTime<=L)s(u),_.sortIndex=_.expirationTime,t(c,_);else break;_=n(u)}}function j(L){if(x=!1,h(L),!b)if(n(c)!==null)b=!0,O(k);else{var _=n(u);_!==null&&M(j,_.startTime-L)}}function k(L,_){b=!1,x&&(x=!1,g(S),S=-1),y=!0;var R=f;try{for(h(_),d=n(c);d!==null&&(!(d.expirationTime>_)||L&&!B());){var $=d.callback;if(typeof $=="function"){d.callback=null,f=d.priorityLevel;var Q=$(d.expirationTime<=_);_=e.unstable_now(),typeof Q=="function"?d.callback=Q:d===n(c)&&s(c),h(_)}else s(c);d=n(c)}if(d!==null)var De=!0;else{var Je=n(u);Je!==null&&M(j,Je.startTime-_),De=!1}return De}finally{d=null,f=R,y=!1}}var E=!1,N=null,S=-1,T=5,P=-1;function B(){return!(e.unstable_now()-P<T)}function G(){if(N!==null){var L=e.unstable_now();P=L;var _=!0;try{_=N(!0,L)}finally{_?K():(E=!1,N=null)}}else E=!1}var K;if(typeof m=="function")K=function(){m(G)};else if(typeof MessageChannel<"u"){var C=new MessageChannel,D=C.port2;C.port1.onmessage=G,K=function(){D.postMessage(null)}}else K=function(){v(G,0)};function O(L){N=L,E||(E=!0,K())}function M(L,_){S=v(function(){L(e.unstable_now())},_)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_continueExecution=function(){b||y||(b=!0,O(k))},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(L){switch(f){case 1:case 2:case 3:var _=3;break;default:_=f}var R=f;f=_;try{return L()}finally{f=R}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(L,_){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var R=f;f=L;try{return _()}finally{f=R}},e.unstable_scheduleCallback=function(L,_,R){var $=e.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?$+R:$):R=$,L){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=R+Q,L={id:p++,callback:_,priorityLevel:L,startTime:R,expirationTime:Q,sortIndex:-1},R>$?(L.sortIndex=R,t(u,L),n(c)===null&&L===n(u)&&(x?(g(S),S=-1):x=!0,M(j,R-$))):(L.sortIndex=Q,t(c,L),b||y||(b=!0,O(k))),L},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(L){var _=f;return function(){var R=f;f=_;try{return L.apply(this,arguments)}finally{f=R}}}})(id);rd.exports=id;var Oh=rd.exports;/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its 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 _h=w,Fe=Oh;function I(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var ld=new Set,Hs={};function vn(e,t){Qn(e,t),Qn(e+"Capture",t)}function Qn(e,t){for(Hs[e]=t,e=0;e<t.length;e++)ld.add(t[e])}var kt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ql=Object.prototype.hasOwnProperty,Ah=/^[: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]*$/,fc={},pc={};function Dh(e){return ql.call(pc,e)?!0:ql.call(fc,e)?!1:Ah.test(e)?pc[e]=!0:(fc[e]=!0,!1)}function Rh(e,t,n,s){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Mh(e,t,n,s){if(t===null||typeof t>"u"||Rh(e,t,n,s))return!0;if(s)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Te(e,t,n,s,r,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var ye={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ye[e]=new Te(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ye[t]=new Te(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ye[e]=new Te(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ye[e]=new Te(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ye[e]=new Te(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ye[e]=new Te(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ye[e]=new Te(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ye[e]=new Te(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ye[e]=new Te(e,5,!1,e.toLowerCase(),null,!1,!1)});var na=/[\-:]([a-z])/g;function sa(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(na,sa);ye[t]=new Te(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(na,sa);ye[t]=new Te(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(na,sa);ye[t]=new Te(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ye[e]=new Te(e,1,!1,e.toLowerCase(),null,!1,!1)});ye.xlinkHref=new Te("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ye[e]=new Te(e,1,!1,e.toLowerCase(),null,!0,!0)});function ra(e,t,n,s){var r=ye.hasOwnProperty(t)?ye[t]:null;(r!==null?r.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Mh(t,n,r,s)&&(n=null),s||r===null?Dh(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):r.mustUseProperty?e[r.propertyName]=n===null?r.type===3?!1:"":n:(t=r.attributeName,s=r.attributeNamespace,n===null?e.removeAttribute(t):(r=r.type,n=r===3||r===4&&n===!0?"":""+n,s?e.setAttributeNS(s,t,n):e.setAttribute(t,n))))}var Et=_h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Sr=Symbol.for("react.element"),En=Symbol.for("react.portal"),Tn=Symbol.for("react.fragment"),ia=Symbol.for("react.strict_mode"),Ql=Symbol.for("react.profiler"),od=Symbol.for("react.provider"),ad=Symbol.for("react.context"),la=Symbol.for("react.forward_ref"),Jl=Symbol.for("react.suspense"),Xl=Symbol.for("react.suspense_list"),oa=Symbol.for("react.memo"),Pt=Symbol.for("react.lazy"),cd=Symbol.for("react.offscreen"),hc=Symbol.iterator;function ys(e){return e===null||typeof e!="object"?null:(e=hc&&e[hc]||e["@@iterator"],typeof e=="function"?e:null)}var ne=Object.assign,hl;function Cs(e){if(hl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);hl=t&&t[1]||""}return`
34
- `+hl+e}var ml=!1;function gl(e,t){if(!e||ml)return"";ml=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var s=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){s=u}e.call(t.prototype)}else{try{throw Error()}catch(u){s=u}e()}}catch(u){if(u&&s&&typeof u.stack=="string"){for(var r=u.stack.split(`
35
- `),i=s.stack.split(`
36
- `),o=r.length-1,a=i.length-1;1<=o&&0<=a&&r[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(r[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||r[o]!==i[a]){var c=`
37
- `+r[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=a);break}}}finally{ml=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Cs(e):""}function $h(e){switch(e.tag){case 5:return Cs(e.type);case 16:return Cs("Lazy");case 13:return Cs("Suspense");case 19:return Cs("SuspenseList");case 0:case 2:case 15:return e=gl(e.type,!1),e;case 11:return e=gl(e.type.render,!1),e;case 1:return e=gl(e.type,!0),e;default:return""}}function Zl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Tn:return"Fragment";case En:return"Portal";case Ql:return"Profiler";case ia:return"StrictMode";case Jl:return"Suspense";case Xl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ad:return(e.displayName||"Context")+".Consumer";case od:return(e._context.displayName||"Context")+".Provider";case la:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case oa:return t=e.displayName||null,t!==null?t:Zl(e.type)||"Memo";case Pt:t=e._payload,e=e._init;try{return Zl(e(t))}catch{}}return null}function Fh(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Zl(t);case 8:return t===ia?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Yt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ud(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function zh(e){var t=ud(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(o){s=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(o){s=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Cr(e){e._valueTracker||(e._valueTracker=zh(e))}function dd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=ud(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function ci(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}}function eo(e,t){var n=t.checked;return ne({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function mc(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=Yt(t.value!=null?t.value:n),e._wrapperState={initialChecked:s,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function fd(e,t){t=t.checked,t!=null&&ra(e,"checked",t,!1)}function to(e,t){fd(e,t);var n=Yt(t.value),s=t.type;if(n!=null)s==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?no(e,t.type,n):t.hasOwnProperty("defaultValue")&&no(e,t.type,Yt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function gc(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function no(e,t,n){(t!=="number"||ci(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Es=Array.isArray;function Un(e,t,n,s){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&s&&(e[n].defaultSelected=!0)}else{for(n=""+Yt(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,s&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function so(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(I(91));return ne({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function yc(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(I(92));if(Es(n)){if(1<n.length)throw Error(I(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Yt(n)}}function pd(e,t){var n=Yt(t.value),s=Yt(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),s!=null&&(e.defaultValue=""+s)}function xc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function hd(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ro(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?hd(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Er,md=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,s,r){MSApp.execUnsafeLocalFunction(function(){return e(t,n,s,r)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Er=Er||document.createElement("div"),Er.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Er.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ws(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Os={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Bh=["Webkit","ms","Moz","O"];Object.keys(Os).forEach(function(e){Bh.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Os[t]=Os[e]})});function gd(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Os.hasOwnProperty(e)&&Os[e]?(""+t).trim():t+"px"}function yd(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,r=gd(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,r):e[n]=r}}var Uh=ne({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function io(e,t){if(t){if(Uh[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(I(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(I(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(I(61))}if(t.style!=null&&typeof t.style!="object")throw Error(I(62))}}function lo(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 oo=null;function aa(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ao=null,Hn=null,Wn=null;function vc(e){if(e=hr(e)){if(typeof ao!="function")throw Error(I(280));var t=e.stateNode;t&&(t=Hi(t),ao(e.stateNode,e.type,t))}}function xd(e){Hn?Wn?Wn.push(e):Wn=[e]:Hn=e}function vd(){if(Hn){var e=Hn,t=Wn;if(Wn=Hn=null,vc(e),t)for(e=0;e<t.length;e++)vc(t[e])}}function wd(e,t){return e(t)}function bd(){}var yl=!1;function jd(e,t,n){if(yl)return e(t,n);yl=!0;try{return wd(e,t,n)}finally{yl=!1,(Hn!==null||Wn!==null)&&(bd(),vd())}}function Ks(e,t){var n=e.stateNode;if(n===null)return null;var s=Hi(n);if(s===null)return null;n=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(I(231,t,typeof n));return n}var co=!1;if(kt)try{var xs={};Object.defineProperty(xs,"passive",{get:function(){co=!0}}),window.addEventListener("test",xs,xs),window.removeEventListener("test",xs,xs)}catch{co=!1}function Hh(e,t,n,s,r,i,o,a,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(p){this.onError(p)}}var _s=!1,ui=null,di=!1,uo=null,Wh={onError:function(e){_s=!0,ui=e}};function Kh(e,t,n,s,r,i,o,a,c){_s=!1,ui=null,Hh.apply(Wh,arguments)}function Vh(e,t,n,s,r,i,o,a,c){if(Kh.apply(this,arguments),_s){if(_s){var u=ui;_s=!1,ui=null}else throw Error(I(198));di||(di=!0,uo=u)}}function wn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function kd(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 wc(e){if(wn(e)!==e)throw Error(I(188))}function Gh(e){var t=e.alternate;if(!t){if(t=wn(e),t===null)throw Error(I(188));return t!==e?null:e}for(var n=e,s=t;;){var r=n.return;if(r===null)break;var i=r.alternate;if(i===null){if(s=r.return,s!==null){n=s;continue}break}if(r.child===i.child){for(i=r.child;i;){if(i===n)return wc(r),e;if(i===s)return wc(r),t;i=i.sibling}throw Error(I(188))}if(n.return!==s.return)n=r,s=i;else{for(var o=!1,a=r.child;a;){if(a===n){o=!0,n=r,s=i;break}if(a===s){o=!0,s=r,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,s=r;break}if(a===s){o=!0,s=i,n=r;break}a=a.sibling}if(!o)throw Error(I(189))}}if(n.alternate!==s)throw Error(I(190))}if(n.tag!==3)throw Error(I(188));return n.stateNode.current===n?e:t}function Nd(e){return e=Gh(e),e!==null?Sd(e):null}function Sd(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Sd(e);if(t!==null)return t;e=e.sibling}return null}var Cd=Fe.unstable_scheduleCallback,bc=Fe.unstable_cancelCallback,Yh=Fe.unstable_shouldYield,qh=Fe.unstable_requestPaint,le=Fe.unstable_now,Qh=Fe.unstable_getCurrentPriorityLevel,ca=Fe.unstable_ImmediatePriority,Ed=Fe.unstable_UserBlockingPriority,fi=Fe.unstable_NormalPriority,Jh=Fe.unstable_LowPriority,Td=Fe.unstable_IdlePriority,Fi=null,ft=null;function Xh(e){if(ft&&typeof ft.onCommitFiberRoot=="function")try{ft.onCommitFiberRoot(Fi,e,void 0,(e.current.flags&128)===128)}catch{}}var st=Math.clz32?Math.clz32:tm,Zh=Math.log,em=Math.LN2;function tm(e){return e>>>=0,e===0?32:31-(Zh(e)/em|0)|0}var Tr=64,Lr=4194304;function Ts(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function pi(e,t){var n=e.pendingLanes;if(n===0)return 0;var s=0,r=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~r;a!==0?s=Ts(a):(i&=o,i!==0&&(s=Ts(i)))}else o=n&~r,o!==0?s=Ts(o):i!==0&&(s=Ts(i));if(s===0)return 0;if(t!==0&&t!==s&&!(t&r)&&(r=s&-s,i=t&-t,r>=i||r===16&&(i&4194240)!==0))return t;if(s&4&&(s|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)n=31-st(t),r=1<<n,s|=e[n],t&=~r;return s}function nm(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function sm(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-st(i),a=1<<o,c=r[o];c===-1?(!(a&n)||a&s)&&(r[o]=nm(a,t)):c<=t&&(e.expiredLanes|=a),i&=~a}}function fo(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ld(){var e=Tr;return Tr<<=1,!(Tr&4194240)&&(Tr=64),e}function xl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function fr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-st(t),e[t]=n}function rm(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0<n;){var r=31-st(n),i=1<<r;t[r]=0,s[r]=-1,e[r]=-1,n&=~i}}function ua(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-st(n),r=1<<s;r&t|e[s]&t&&(e[s]|=t),n&=~r}}var V=0;function Pd(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Id,da,Od,_d,Ad,po=!1,Pr=[],$t=null,Ft=null,zt=null,Vs=new Map,Gs=new Map,_t=[],im="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 submit".split(" ");function jc(e,t){switch(e){case"focusin":case"focusout":$t=null;break;case"dragenter":case"dragleave":Ft=null;break;case"mouseover":case"mouseout":zt=null;break;case"pointerover":case"pointerout":Vs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gs.delete(t.pointerId)}}function vs(e,t,n,s,r,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:i,targetContainers:[r]},t!==null&&(t=hr(t),t!==null&&da(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function lm(e,t,n,s,r){switch(t){case"focusin":return $t=vs($t,e,t,n,s,r),!0;case"dragenter":return Ft=vs(Ft,e,t,n,s,r),!0;case"mouseover":return zt=vs(zt,e,t,n,s,r),!0;case"pointerover":var i=r.pointerId;return Vs.set(i,vs(Vs.get(i)||null,e,t,n,s,r)),!0;case"gotpointercapture":return i=r.pointerId,Gs.set(i,vs(Gs.get(i)||null,e,t,n,s,r)),!0}return!1}function Dd(e){var t=rn(e.target);if(t!==null){var n=wn(t);if(n!==null){if(t=n.tag,t===13){if(t=kd(n),t!==null){e.blockedOn=t,Ad(e.priority,function(){Od(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Qr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ho(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);oo=s,n.target.dispatchEvent(s),oo=null}else return t=hr(n),t!==null&&da(t),e.blockedOn=n,!1;t.shift()}return!0}function kc(e,t,n){Qr(e)&&n.delete(t)}function om(){po=!1,$t!==null&&Qr($t)&&($t=null),Ft!==null&&Qr(Ft)&&(Ft=null),zt!==null&&Qr(zt)&&(zt=null),Vs.forEach(kc),Gs.forEach(kc)}function ws(e,t){e.blockedOn===t&&(e.blockedOn=null,po||(po=!0,Fe.unstable_scheduleCallback(Fe.unstable_NormalPriority,om)))}function Ys(e){function t(r){return ws(r,e)}if(0<Pr.length){ws(Pr[0],e);for(var n=1;n<Pr.length;n++){var s=Pr[n];s.blockedOn===e&&(s.blockedOn=null)}}for($t!==null&&ws($t,e),Ft!==null&&ws(Ft,e),zt!==null&&ws(zt,e),Vs.forEach(t),Gs.forEach(t),n=0;n<_t.length;n++)s=_t[n],s.blockedOn===e&&(s.blockedOn=null);for(;0<_t.length&&(n=_t[0],n.blockedOn===null);)Dd(n),n.blockedOn===null&&_t.shift()}var Kn=Et.ReactCurrentBatchConfig,hi=!0;function am(e,t,n,s){var r=V,i=Kn.transition;Kn.transition=null;try{V=1,fa(e,t,n,s)}finally{V=r,Kn.transition=i}}function cm(e,t,n,s){var r=V,i=Kn.transition;Kn.transition=null;try{V=4,fa(e,t,n,s)}finally{V=r,Kn.transition=i}}function fa(e,t,n,s){if(hi){var r=ho(e,t,n,s);if(r===null)Tl(e,t,s,mi,n),jc(e,s);else if(lm(r,e,t,n,s))s.stopPropagation();else if(jc(e,s),t&4&&-1<im.indexOf(e)){for(;r!==null;){var i=hr(r);if(i!==null&&Id(i),i=ho(e,t,n,s),i===null&&Tl(e,t,s,mi,n),i===r)break;r=i}r!==null&&s.stopPropagation()}else Tl(e,t,s,null,n)}}var mi=null;function ho(e,t,n,s){if(mi=null,e=aa(s),e=rn(e),e!==null)if(t=wn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=kd(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return mi=e,null}function Rd(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Qh()){case ca:return 1;case Ed:return 4;case fi:case Jh:return 16;case Td:return 536870912;default:return 16}default:return 16}}var Dt=null,pa=null,Jr=null;function Md(){if(Jr)return Jr;var e,t=pa,n=t.length,s,r="value"in Dt?Dt.value:Dt.textContent,i=r.length;for(e=0;e<n&&t[e]===r[e];e++);var o=n-e;for(s=1;s<=o&&t[n-s]===r[i-s];s++);return Jr=r.slice(e,1<s?1-s:void 0)}function Xr(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 Ir(){return!0}function Nc(){return!1}function Be(e){function t(n,s,r,i,o){this._reactName=n,this._targetInst=r,this.type=s,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Ir:Nc,this.isPropagationStopped=Nc,this}return ne(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ir)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ir)},persist:function(){},isPersistent:Ir}),t}var os={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ha=Be(os),pr=ne({},os,{view:0,detail:0}),um=Be(pr),vl,wl,bs,zi=ne({},pr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ma,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!==bs&&(bs&&e.type==="mousemove"?(vl=e.screenX-bs.screenX,wl=e.screenY-bs.screenY):wl=vl=0,bs=e),vl)},movementY:function(e){return"movementY"in e?e.movementY:wl}}),Sc=Be(zi),dm=ne({},zi,{dataTransfer:0}),fm=Be(dm),pm=ne({},pr,{relatedTarget:0}),bl=Be(pm),hm=ne({},os,{animationName:0,elapsedTime:0,pseudoElement:0}),mm=Be(hm),gm=ne({},os,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ym=Be(gm),xm=ne({},os,{data:0}),Cc=Be(xm),vm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wm={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"},bm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=bm[e])?!!t[e]:!1}function ma(){return jm}var km=ne({},pr,{key:function(e){if(e.key){var t=vm[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Xr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?wm[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ma,charCode:function(e){return e.type==="keypress"?Xr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Xr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Nm=Be(km),Sm=ne({},zi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ec=Be(Sm),Cm=ne({},pr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ma}),Em=Be(Cm),Tm=ne({},os,{propertyName:0,elapsedTime:0,pseudoElement:0}),Lm=Be(Tm),Pm=ne({},zi,{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}),Im=Be(Pm),Om=[9,13,27,32],ga=kt&&"CompositionEvent"in window,As=null;kt&&"documentMode"in document&&(As=document.documentMode);var _m=kt&&"TextEvent"in window&&!As,$d=kt&&(!ga||As&&8<As&&11>=As),Tc=" ",Lc=!1;function Fd(e,t){switch(e){case"keyup":return Om.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ln=!1;function Am(e,t){switch(e){case"compositionend":return zd(t);case"keypress":return t.which!==32?null:(Lc=!0,Tc);case"textInput":return e=t.data,e===Tc&&Lc?null:e;default:return null}}function Dm(e,t){if(Ln)return e==="compositionend"||!ga&&Fd(e,t)?(e=Md(),Jr=pa=Dt=null,Ln=!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 $d&&t.locale!=="ko"?null:t.data;default:return null}}var Rm={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 Pc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Rm[e.type]:t==="textarea"}function Bd(e,t,n,s){xd(s),t=gi(t,"onChange"),0<t.length&&(n=new ha("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var Ds=null,qs=null;function Mm(e){Xd(e,0)}function Bi(e){var t=On(e);if(dd(t))return e}function $m(e,t){if(e==="change")return t}var Ud=!1;if(kt){var jl;if(kt){var kl="oninput"in document;if(!kl){var Ic=document.createElement("div");Ic.setAttribute("oninput","return;"),kl=typeof Ic.oninput=="function"}jl=kl}else jl=!1;Ud=jl&&(!document.documentMode||9<document.documentMode)}function Oc(){Ds&&(Ds.detachEvent("onpropertychange",Hd),qs=Ds=null)}function Hd(e){if(e.propertyName==="value"&&Bi(qs)){var t=[];Bd(t,qs,e,aa(e)),jd(Mm,t)}}function Fm(e,t,n){e==="focusin"?(Oc(),Ds=t,qs=n,Ds.attachEvent("onpropertychange",Hd)):e==="focusout"&&Oc()}function zm(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Bi(qs)}function Bm(e,t){if(e==="click")return Bi(t)}function Um(e,t){if(e==="input"||e==="change")return Bi(t)}function Hm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var it=typeof Object.is=="function"?Object.is:Hm;function Qs(e,t){if(it(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var r=n[s];if(!ql.call(t,r)||!it(e[r],t[r]))return!1}return!0}function _c(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ac(e,t){var n=_c(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=_c(n)}}function Wd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Wd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Kd(){for(var e=window,t=ci();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ci(e.document)}return t}function ya(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")}function Wm(e){var t=Kd(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Wd(n.ownerDocument.documentElement,n)){if(s!==null&&ya(n)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var r=n.textContent.length,i=Math.min(s.start,r);s=s.end===void 0?i:Math.min(s.end,r),!e.extend&&i>s&&(r=s,s=i,i=r),r=Ac(n,i);var o=Ac(n,s);r&&o&&(e.rangeCount!==1||e.anchorNode!==r.node||e.anchorOffset!==r.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(r.node,r.offset),e.removeAllRanges(),i>s?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Km=kt&&"documentMode"in document&&11>=document.documentMode,Pn=null,mo=null,Rs=null,go=!1;function Dc(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;go||Pn==null||Pn!==ci(s)||(s=Pn,"selectionStart"in s&&ya(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Rs&&Qs(Rs,s)||(Rs=s,s=gi(mo,"onSelect"),0<s.length&&(t=new ha("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=Pn)))}function Or(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var In={animationend:Or("Animation","AnimationEnd"),animationiteration:Or("Animation","AnimationIteration"),animationstart:Or("Animation","AnimationStart"),transitionend:Or("Transition","TransitionEnd")},Nl={},Vd={};kt&&(Vd=document.createElement("div").style,"AnimationEvent"in window||(delete In.animationend.animation,delete In.animationiteration.animation,delete In.animationstart.animation),"TransitionEvent"in window||delete In.transitionend.transition);function Ui(e){if(Nl[e])return Nl[e];if(!In[e])return e;var t=In[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Vd)return Nl[e]=t[n];return e}var Gd=Ui("animationend"),Yd=Ui("animationiteration"),qd=Ui("animationstart"),Qd=Ui("transitionend"),Jd=new Map,Rc="abort auxClick 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(" ");function Qt(e,t){Jd.set(e,t),vn(t,[e])}for(var Sl=0;Sl<Rc.length;Sl++){var Cl=Rc[Sl],Vm=Cl.toLowerCase(),Gm=Cl[0].toUpperCase()+Cl.slice(1);Qt(Vm,"on"+Gm)}Qt(Gd,"onAnimationEnd");Qt(Yd,"onAnimationIteration");Qt(qd,"onAnimationStart");Qt("dblclick","onDoubleClick");Qt("focusin","onFocus");Qt("focusout","onBlur");Qt(Qd,"onTransitionEnd");Qn("onMouseEnter",["mouseout","mouseover"]);Qn("onMouseLeave",["mouseout","mouseover"]);Qn("onPointerEnter",["pointerout","pointerover"]);Qn("onPointerLeave",["pointerout","pointerover"]);vn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));vn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));vn("onBeforeInput",["compositionend","keypress","textInput","paste"]);vn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));vn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));vn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ls="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(" "),Ym=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ls));function Mc(e,t,n){var s=e.type||"unknown-event";e.currentTarget=n,Vh(s,t,void 0,e),e.currentTarget=null}function Xd(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],r=s.event;s=s.listeners;e:{var i=void 0;if(t)for(var o=s.length-1;0<=o;o--){var a=s[o],c=a.instance,u=a.currentTarget;if(a=a.listener,c!==i&&r.isPropagationStopped())break e;Mc(r,a,u),i=c}else for(o=0;o<s.length;o++){if(a=s[o],c=a.instance,u=a.currentTarget,a=a.listener,c!==i&&r.isPropagationStopped())break e;Mc(r,a,u),i=c}}}if(di)throw e=uo,di=!1,uo=null,e}function J(e,t){var n=t[bo];n===void 0&&(n=t[bo]=new Set);var s=e+"__bubble";n.has(s)||(Zd(t,e,2,!1),n.add(s))}function El(e,t,n){var s=0;t&&(s|=4),Zd(n,e,s,t)}var _r="_reactListening"+Math.random().toString(36).slice(2);function Js(e){if(!e[_r]){e[_r]=!0,ld.forEach(function(n){n!=="selectionchange"&&(Ym.has(n)||El(n,!1,e),El(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[_r]||(t[_r]=!0,El("selectionchange",!1,t))}}function Zd(e,t,n,s){switch(Rd(t)){case 1:var r=am;break;case 4:r=cm;break;default:r=fa}n=r.bind(null,t,n,e),r=void 0,!co||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),s?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function Tl(e,t,n,s,r){var i=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var o=s.tag;if(o===3||o===4){var a=s.stateNode.containerInfo;if(a===r||a.nodeType===8&&a.parentNode===r)break;if(o===4)for(o=s.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===r||c.nodeType===8&&c.parentNode===r))return;o=o.return}for(;a!==null;){if(o=rn(a),o===null)return;if(c=o.tag,c===5||c===6){s=i=o;continue e}a=a.parentNode}}s=s.return}jd(function(){var u=i,p=aa(n),d=[];e:{var f=Jd.get(e);if(f!==void 0){var y=ha,b=e;switch(e){case"keypress":if(Xr(n)===0)break e;case"keydown":case"keyup":y=Nm;break;case"focusin":b="focus",y=bl;break;case"focusout":b="blur",y=bl;break;case"beforeblur":case"afterblur":y=bl;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":y=Sc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=fm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=Em;break;case Gd:case Yd:case qd:y=mm;break;case Qd:y=Lm;break;case"scroll":y=um;break;case"wheel":y=Im;break;case"copy":case"cut":case"paste":y=ym;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=Ec}var x=(t&4)!==0,v=!x&&e==="scroll",g=x?f!==null?f+"Capture":null:f;x=[];for(var m=u,h;m!==null;){h=m;var j=h.stateNode;if(h.tag===5&&j!==null&&(h=j,g!==null&&(j=Ks(m,g),j!=null&&x.push(Xs(m,j,h)))),v)break;m=m.return}0<x.length&&(f=new y(f,b,null,n,p),d.push({event:f,listeners:x}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",f&&n!==oo&&(b=n.relatedTarget||n.fromElement)&&(rn(b)||b[Nt]))break e;if((y||f)&&(f=p.window===p?p:(f=p.ownerDocument)?f.defaultView||f.parentWindow:window,y?(b=n.relatedTarget||n.toElement,y=u,b=b?rn(b):null,b!==null&&(v=wn(b),b!==v||b.tag!==5&&b.tag!==6)&&(b=null)):(y=null,b=u),y!==b)){if(x=Sc,j="onMouseLeave",g="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(x=Ec,j="onPointerLeave",g="onPointerEnter",m="pointer"),v=y==null?f:On(y),h=b==null?f:On(b),f=new x(j,m+"leave",y,n,p),f.target=v,f.relatedTarget=h,j=null,rn(p)===u&&(x=new x(g,m+"enter",b,n,p),x.target=h,x.relatedTarget=v,j=x),v=j,y&&b)t:{for(x=y,g=b,m=0,h=x;h;h=jn(h))m++;for(h=0,j=g;j;j=jn(j))h++;for(;0<m-h;)x=jn(x),m--;for(;0<h-m;)g=jn(g),h--;for(;m--;){if(x===g||g!==null&&x===g.alternate)break t;x=jn(x),g=jn(g)}x=null}else x=null;y!==null&&$c(d,f,y,x,!1),b!==null&&v!==null&&$c(d,v,b,x,!0)}}e:{if(f=u?On(u):window,y=f.nodeName&&f.nodeName.toLowerCase(),y==="select"||y==="input"&&f.type==="file")var k=$m;else if(Pc(f))if(Ud)k=Um;else{k=zm;var E=Fm}else(y=f.nodeName)&&y.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(k=Bm);if(k&&(k=k(e,u))){Bd(d,k,n,p);break e}E&&E(e,f,u),e==="focusout"&&(E=f._wrapperState)&&E.controlled&&f.type==="number"&&no(f,"number",f.value)}switch(E=u?On(u):window,e){case"focusin":(Pc(E)||E.contentEditable==="true")&&(Pn=E,mo=u,Rs=null);break;case"focusout":Rs=mo=Pn=null;break;case"mousedown":go=!0;break;case"contextmenu":case"mouseup":case"dragend":go=!1,Dc(d,n,p);break;case"selectionchange":if(Km)break;case"keydown":case"keyup":Dc(d,n,p)}var N;if(ga)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else Ln?Fd(e,n)&&(S="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(S="onCompositionStart");S&&($d&&n.locale!=="ko"&&(Ln||S!=="onCompositionStart"?S==="onCompositionEnd"&&Ln&&(N=Md()):(Dt=p,pa="value"in Dt?Dt.value:Dt.textContent,Ln=!0)),E=gi(u,S),0<E.length&&(S=new Cc(S,e,null,n,p),d.push({event:S,listeners:E}),N?S.data=N:(N=zd(n),N!==null&&(S.data=N)))),(N=_m?Am(e,n):Dm(e,n))&&(u=gi(u,"onBeforeInput"),0<u.length&&(p=new Cc("onBeforeInput","beforeinput",null,n,p),d.push({event:p,listeners:u}),p.data=N))}Xd(d,t)})}function Xs(e,t,n){return{instance:e,listener:t,currentTarget:n}}function gi(e,t){for(var n=t+"Capture",s=[];e!==null;){var r=e,i=r.stateNode;r.tag===5&&i!==null&&(r=i,i=Ks(e,n),i!=null&&s.unshift(Xs(e,i,r)),i=Ks(e,t),i!=null&&s.push(Xs(e,i,r))),e=e.return}return s}function jn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function $c(e,t,n,s,r){for(var i=t._reactName,o=[];n!==null&&n!==s;){var a=n,c=a.alternate,u=a.stateNode;if(c!==null&&c===s)break;a.tag===5&&u!==null&&(a=u,r?(c=Ks(n,i),c!=null&&o.unshift(Xs(n,c,a))):r||(c=Ks(n,i),c!=null&&o.push(Xs(n,c,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var qm=/\r\n?/g,Qm=/\u0000|\uFFFD/g;function Fc(e){return(typeof e=="string"?e:""+e).replace(qm,`
38
- `).replace(Qm,"")}function Ar(e,t,n){if(t=Fc(t),Fc(e)!==t&&n)throw Error(I(425))}function yi(){}var yo=null,xo=null;function vo(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var wo=typeof setTimeout=="function"?setTimeout:void 0,Jm=typeof clearTimeout=="function"?clearTimeout:void 0,zc=typeof Promise=="function"?Promise:void 0,Xm=typeof queueMicrotask=="function"?queueMicrotask:typeof zc<"u"?function(e){return zc.resolve(null).then(e).catch(Zm)}:wo;function Zm(e){setTimeout(function(){throw e})}function Ll(e,t){var n=t,s=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(s===0){e.removeChild(r),Ys(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=r}while(n);Ys(t)}function Bt(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==="$?")break;if(t==="/$")return null}}return e}function Bc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var as=Math.random().toString(36).slice(2),dt="__reactFiber$"+as,Zs="__reactProps$"+as,Nt="__reactContainer$"+as,bo="__reactEvents$"+as,eg="__reactListeners$"+as,tg="__reactHandles$"+as;function rn(e){var t=e[dt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Nt]||n[dt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Bc(e);e!==null;){if(n=e[dt])return n;e=Bc(e)}return t}e=n,n=e.parentNode}return null}function hr(e){return e=e[dt]||e[Nt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function On(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(I(33))}function Hi(e){return e[Zs]||null}var jo=[],_n=-1;function Jt(e){return{current:e}}function X(e){0>_n||(e.current=jo[_n],jo[_n]=null,_n--)}function Y(e,t){_n++,jo[_n]=e.current,e.current=t}var qt={},je=Jt(qt),Oe=Jt(!1),fn=qt;function Jn(e,t){var n=e.type.contextTypes;if(!n)return qt;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var r={},i;for(i in n)r[i]=t[i];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=r),r}function _e(e){return e=e.childContextTypes,e!=null}function xi(){X(Oe),X(je)}function Uc(e,t,n){if(je.current!==qt)throw Error(I(168));Y(je,t),Y(Oe,n)}function ef(e,t,n){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var r in s)if(!(r in t))throw Error(I(108,Fh(e)||"Unknown",r));return ne({},n,s)}function vi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||qt,fn=je.current,Y(je,e),Y(Oe,Oe.current),!0}function Hc(e,t,n){var s=e.stateNode;if(!s)throw Error(I(169));n?(e=ef(e,t,fn),s.__reactInternalMemoizedMergedChildContext=e,X(Oe),X(je),Y(je,e)):X(Oe),Y(Oe,n)}var yt=null,Wi=!1,Pl=!1;function tf(e){yt===null?yt=[e]:yt.push(e)}function ng(e){Wi=!0,tf(e)}function Xt(){if(!Pl&&yt!==null){Pl=!0;var e=0,t=V;try{var n=yt;for(V=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}yt=null,Wi=!1}catch(r){throw yt!==null&&(yt=yt.slice(e+1)),Cd(ca,Xt),r}finally{V=t,Pl=!1}}return null}var An=[],Dn=0,wi=null,bi=0,Ue=[],He=0,pn=null,xt=1,vt="";function tn(e,t){An[Dn++]=bi,An[Dn++]=wi,wi=e,bi=t}function nf(e,t,n){Ue[He++]=xt,Ue[He++]=vt,Ue[He++]=pn,pn=e;var s=xt;e=vt;var r=32-st(s)-1;s&=~(1<<r),n+=1;var i=32-st(t)+r;if(30<i){var o=r-r%5;i=(s&(1<<o)-1).toString(32),s>>=o,r-=o,xt=1<<32-st(t)+r|n<<r|s,vt=i+e}else xt=1<<i|n<<r|s,vt=e}function xa(e){e.return!==null&&(tn(e,1),nf(e,1,0))}function va(e){for(;e===wi;)wi=An[--Dn],An[Dn]=null,bi=An[--Dn],An[Dn]=null;for(;e===pn;)pn=Ue[--He],Ue[He]=null,vt=Ue[--He],Ue[He]=null,xt=Ue[--He],Ue[He]=null}var $e=null,Me=null,Z=!1,nt=null;function sf(e,t){var n=Ke(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Wc(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,$e=e,Me=Bt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,$e=e,Me=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=pn!==null?{id:xt,overflow:vt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ke(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,$e=e,Me=null,!0):!1;default:return!1}}function ko(e){return(e.mode&1)!==0&&(e.flags&128)===0}function No(e){if(Z){var t=Me;if(t){var n=t;if(!Wc(e,t)){if(ko(e))throw Error(I(418));t=Bt(n.nextSibling);var s=$e;t&&Wc(e,t)?sf(s,n):(e.flags=e.flags&-4097|2,Z=!1,$e=e)}}else{if(ko(e))throw Error(I(418));e.flags=e.flags&-4097|2,Z=!1,$e=e}}}function Kc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;$e=e}function Dr(e){if(e!==$e)return!1;if(!Z)return Kc(e),Z=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!vo(e.type,e.memoizedProps)),t&&(t=Me)){if(ko(e))throw rf(),Error(I(418));for(;t;)sf(e,t),t=Bt(t.nextSibling)}if(Kc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(I(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Me=Bt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Me=null}}else Me=$e?Bt(e.stateNode.nextSibling):null;return!0}function rf(){for(var e=Me;e;)e=Bt(e.nextSibling)}function Xn(){Me=$e=null,Z=!1}function wa(e){nt===null?nt=[e]:nt.push(e)}var sg=Et.ReactCurrentBatchConfig;function js(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(I(309));var s=n.stateNode}if(!s)throw Error(I(147,e));var r=s,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var a=r.refs;o===null?delete a[i]:a[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(I(284));if(!n._owner)throw Error(I(290,e))}return e}function Rr(e,t){throw e=Object.prototype.toString.call(t),Error(I(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Vc(e){var t=e._init;return t(e._payload)}function lf(e){function t(g,m){if(e){var h=g.deletions;h===null?(g.deletions=[m],g.flags|=16):h.push(m)}}function n(g,m){if(!e)return null;for(;m!==null;)t(g,m),m=m.sibling;return null}function s(g,m){for(g=new Map;m!==null;)m.key!==null?g.set(m.key,m):g.set(m.index,m),m=m.sibling;return g}function r(g,m){return g=Kt(g,m),g.index=0,g.sibling=null,g}function i(g,m,h){return g.index=h,e?(h=g.alternate,h!==null?(h=h.index,h<m?(g.flags|=2,m):h):(g.flags|=2,m)):(g.flags|=1048576,m)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,m,h,j){return m===null||m.tag!==6?(m=Ml(h,g.mode,j),m.return=g,m):(m=r(m,h),m.return=g,m)}function c(g,m,h,j){var k=h.type;return k===Tn?p(g,m,h.props.children,j,h.key):m!==null&&(m.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Pt&&Vc(k)===m.type)?(j=r(m,h.props),j.ref=js(g,m,h),j.return=g,j):(j=ii(h.type,h.key,h.props,null,g.mode,j),j.ref=js(g,m,h),j.return=g,j)}function u(g,m,h,j){return m===null||m.tag!==4||m.stateNode.containerInfo!==h.containerInfo||m.stateNode.implementation!==h.implementation?(m=$l(h,g.mode,j),m.return=g,m):(m=r(m,h.children||[]),m.return=g,m)}function p(g,m,h,j,k){return m===null||m.tag!==7?(m=dn(h,g.mode,j,k),m.return=g,m):(m=r(m,h),m.return=g,m)}function d(g,m,h){if(typeof m=="string"&&m!==""||typeof m=="number")return m=Ml(""+m,g.mode,h),m.return=g,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Sr:return h=ii(m.type,m.key,m.props,null,g.mode,h),h.ref=js(g,null,m),h.return=g,h;case En:return m=$l(m,g.mode,h),m.return=g,m;case Pt:var j=m._init;return d(g,j(m._payload),h)}if(Es(m)||ys(m))return m=dn(m,g.mode,h,null),m.return=g,m;Rr(g,m)}return null}function f(g,m,h,j){var k=m!==null?m.key:null;if(typeof h=="string"&&h!==""||typeof h=="number")return k!==null?null:a(g,m,""+h,j);if(typeof h=="object"&&h!==null){switch(h.$$typeof){case Sr:return h.key===k?c(g,m,h,j):null;case En:return h.key===k?u(g,m,h,j):null;case Pt:return k=h._init,f(g,m,k(h._payload),j)}if(Es(h)||ys(h))return k!==null?null:p(g,m,h,j,null);Rr(g,h)}return null}function y(g,m,h,j,k){if(typeof j=="string"&&j!==""||typeof j=="number")return g=g.get(h)||null,a(m,g,""+j,k);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Sr:return g=g.get(j.key===null?h:j.key)||null,c(m,g,j,k);case En:return g=g.get(j.key===null?h:j.key)||null,u(m,g,j,k);case Pt:var E=j._init;return y(g,m,h,E(j._payload),k)}if(Es(j)||ys(j))return g=g.get(h)||null,p(m,g,j,k,null);Rr(m,j)}return null}function b(g,m,h,j){for(var k=null,E=null,N=m,S=m=0,T=null;N!==null&&S<h.length;S++){N.index>S?(T=N,N=null):T=N.sibling;var P=f(g,N,h[S],j);if(P===null){N===null&&(N=T);break}e&&N&&P.alternate===null&&t(g,N),m=i(P,m,S),E===null?k=P:E.sibling=P,E=P,N=T}if(S===h.length)return n(g,N),Z&&tn(g,S),k;if(N===null){for(;S<h.length;S++)N=d(g,h[S],j),N!==null&&(m=i(N,m,S),E===null?k=N:E.sibling=N,E=N);return Z&&tn(g,S),k}for(N=s(g,N);S<h.length;S++)T=y(N,g,S,h[S],j),T!==null&&(e&&T.alternate!==null&&N.delete(T.key===null?S:T.key),m=i(T,m,S),E===null?k=T:E.sibling=T,E=T);return e&&N.forEach(function(B){return t(g,B)}),Z&&tn(g,S),k}function x(g,m,h,j){var k=ys(h);if(typeof k!="function")throw Error(I(150));if(h=k.call(h),h==null)throw Error(I(151));for(var E=k=null,N=m,S=m=0,T=null,P=h.next();N!==null&&!P.done;S++,P=h.next()){N.index>S?(T=N,N=null):T=N.sibling;var B=f(g,N,P.value,j);if(B===null){N===null&&(N=T);break}e&&N&&B.alternate===null&&t(g,N),m=i(B,m,S),E===null?k=B:E.sibling=B,E=B,N=T}if(P.done)return n(g,N),Z&&tn(g,S),k;if(N===null){for(;!P.done;S++,P=h.next())P=d(g,P.value,j),P!==null&&(m=i(P,m,S),E===null?k=P:E.sibling=P,E=P);return Z&&tn(g,S),k}for(N=s(g,N);!P.done;S++,P=h.next())P=y(N,g,S,P.value,j),P!==null&&(e&&P.alternate!==null&&N.delete(P.key===null?S:P.key),m=i(P,m,S),E===null?k=P:E.sibling=P,E=P);return e&&N.forEach(function(G){return t(g,G)}),Z&&tn(g,S),k}function v(g,m,h,j){if(typeof h=="object"&&h!==null&&h.type===Tn&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case Sr:e:{for(var k=h.key,E=m;E!==null;){if(E.key===k){if(k=h.type,k===Tn){if(E.tag===7){n(g,E.sibling),m=r(E,h.props.children),m.return=g,g=m;break e}}else if(E.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Pt&&Vc(k)===E.type){n(g,E.sibling),m=r(E,h.props),m.ref=js(g,E,h),m.return=g,g=m;break e}n(g,E);break}else t(g,E);E=E.sibling}h.type===Tn?(m=dn(h.props.children,g.mode,j,h.key),m.return=g,g=m):(j=ii(h.type,h.key,h.props,null,g.mode,j),j.ref=js(g,m,h),j.return=g,g=j)}return o(g);case En:e:{for(E=h.key;m!==null;){if(m.key===E)if(m.tag===4&&m.stateNode.containerInfo===h.containerInfo&&m.stateNode.implementation===h.implementation){n(g,m.sibling),m=r(m,h.children||[]),m.return=g,g=m;break e}else{n(g,m);break}else t(g,m);m=m.sibling}m=$l(h,g.mode,j),m.return=g,g=m}return o(g);case Pt:return E=h._init,v(g,m,E(h._payload),j)}if(Es(h))return b(g,m,h,j);if(ys(h))return x(g,m,h,j);Rr(g,h)}return typeof h=="string"&&h!==""||typeof h=="number"?(h=""+h,m!==null&&m.tag===6?(n(g,m.sibling),m=r(m,h),m.return=g,g=m):(n(g,m),m=Ml(h,g.mode,j),m.return=g,g=m),o(g)):n(g,m)}return v}var Zn=lf(!0),of=lf(!1),ji=Jt(null),ki=null,Rn=null,ba=null;function ja(){ba=Rn=ki=null}function ka(e){var t=ji.current;X(ji),e._currentValue=t}function So(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function Vn(e,t){ki=e,ba=Rn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Pe=!0),e.firstContext=null)}function Ye(e){var t=e._currentValue;if(ba!==e)if(e={context:e,memoizedValue:t,next:null},Rn===null){if(ki===null)throw Error(I(308));Rn=e,ki.dependencies={lanes:0,firstContext:e}}else Rn=Rn.next=e;return t}var ln=null;function Na(e){ln===null?ln=[e]:ln.push(e)}function af(e,t,n,s){var r=t.interleaved;return r===null?(n.next=n,Na(t)):(n.next=r.next,r.next=n),t.interleaved=n,St(e,s)}function St(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var It=!1;function Sa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function cf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function bt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ut(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,H&2){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,St(e,n)}return r=s.interleaved,r===null?(t.next=t,Na(s)):(t.next=r.next,r.next=t),s.interleaved=t,St(e,n)}function Zr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,ua(e,n)}}function Gc(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var r=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?r=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?r=i=t:i=i.next=t}else r=i=t;n={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:i,shared:s.shared,effects:s.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ni(e,t,n,s){var r=e.updateQueue;It=!1;var i=r.firstBaseUpdate,o=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var c=a,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var p=e.alternate;p!==null&&(p=p.updateQueue,a=p.lastBaseUpdate,a!==o&&(a===null?p.firstBaseUpdate=u:a.next=u,p.lastBaseUpdate=c))}if(i!==null){var d=r.baseState;o=0,p=u=c=null,a=i;do{var f=a.lane,y=a.eventTime;if((s&f)===f){p!==null&&(p=p.next={eventTime:y,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var b=e,x=a;switch(f=t,y=n,x.tag){case 1:if(b=x.payload,typeof b=="function"){d=b.call(y,d,f);break e}d=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=x.payload,f=typeof b=="function"?b.call(y,d,f):b,f==null)break e;d=ne({},d,f);break e;case 2:It=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=r.effects,f===null?r.effects=[a]:f.push(a))}else y={eventTime:y,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},p===null?(u=p=y,c=d):p=p.next=y,o|=f;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;f=a,a=f.next,f.next=null,r.lastBaseUpdate=f,r.shared.pending=null}}while(!0);if(p===null&&(c=d),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=p,t=r.shared.interleaved,t!==null){r=t;do o|=r.lane,r=r.next;while(r!==t)}else i===null&&(r.shared.lanes=0);mn|=o,e.lanes=o,e.memoizedState=d}}function Yc(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],r=s.callback;if(r!==null){if(s.callback=null,s=n,typeof r!="function")throw Error(I(191,r));r.call(s)}}}var mr={},pt=Jt(mr),er=Jt(mr),tr=Jt(mr);function on(e){if(e===mr)throw Error(I(174));return e}function Ca(e,t){switch(Y(tr,t),Y(er,e),Y(pt,mr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ro(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ro(t,e)}X(pt),Y(pt,t)}function es(){X(pt),X(er),X(tr)}function uf(e){on(tr.current);var t=on(pt.current),n=ro(t,e.type);t!==n&&(Y(er,e),Y(pt,n))}function Ea(e){er.current===e&&(X(pt),X(er))}var ee=Jt(0);function Si(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Il=[];function Ta(){for(var e=0;e<Il.length;e++)Il[e]._workInProgressVersionPrimary=null;Il.length=0}var ei=Et.ReactCurrentDispatcher,Ol=Et.ReactCurrentBatchConfig,hn=0,te=null,de=null,pe=null,Ci=!1,Ms=!1,nr=0,rg=0;function xe(){throw Error(I(321))}function La(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!it(e[n],t[n]))return!1;return!0}function Pa(e,t,n,s,r,i){if(hn=i,te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ei.current=e===null||e.memoizedState===null?ag:cg,e=n(s,r),Ms){i=0;do{if(Ms=!1,nr=0,25<=i)throw Error(I(301));i+=1,pe=de=null,t.updateQueue=null,ei.current=ug,e=n(s,r)}while(Ms)}if(ei.current=Ei,t=de!==null&&de.next!==null,hn=0,pe=de=te=null,Ci=!1,t)throw Error(I(300));return e}function Ia(){var e=nr!==0;return nr=0,e}function ut(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pe===null?te.memoizedState=pe=e:pe=pe.next=e,pe}function qe(){if(de===null){var e=te.alternate;e=e!==null?e.memoizedState:null}else e=de.next;var t=pe===null?te.memoizedState:pe.next;if(t!==null)pe=t,de=e;else{if(e===null)throw Error(I(310));de=e,e={memoizedState:de.memoizedState,baseState:de.baseState,baseQueue:de.baseQueue,queue:de.queue,next:null},pe===null?te.memoizedState=pe=e:pe=pe.next=e}return pe}function sr(e,t){return typeof t=="function"?t(e):t}function _l(e){var t=qe(),n=t.queue;if(n===null)throw Error(I(311));n.lastRenderedReducer=e;var s=de,r=s.baseQueue,i=n.pending;if(i!==null){if(r!==null){var o=r.next;r.next=i.next,i.next=o}s.baseQueue=r=i,n.pending=null}if(r!==null){i=r.next,s=s.baseState;var a=o=null,c=null,u=i;do{var p=u.lane;if((hn&p)===p)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),s=u.hasEagerState?u.eagerState:e(s,u.action);else{var d={lane:p,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(a=c=d,o=s):c=c.next=d,te.lanes|=p,mn|=p}u=u.next}while(u!==null&&u!==i);c===null?o=s:c.next=a,it(s,t.memoizedState)||(Pe=!0),t.memoizedState=s,t.baseState=o,t.baseQueue=c,n.lastRenderedState=s}if(e=n.interleaved,e!==null){r=e;do i=r.lane,te.lanes|=i,mn|=i,r=r.next;while(r!==e)}else r===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Al(e){var t=qe(),n=t.queue;if(n===null)throw Error(I(311));n.lastRenderedReducer=e;var s=n.dispatch,r=n.pending,i=t.memoizedState;if(r!==null){n.pending=null;var o=r=r.next;do i=e(i,o.action),o=o.next;while(o!==r);it(i,t.memoizedState)||(Pe=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,s]}function df(){}function ff(e,t){var n=te,s=qe(),r=t(),i=!it(s.memoizedState,r);if(i&&(s.memoizedState=r,Pe=!0),s=s.queue,Oa(mf.bind(null,n,s,e),[e]),s.getSnapshot!==t||i||pe!==null&&pe.memoizedState.tag&1){if(n.flags|=2048,rr(9,hf.bind(null,n,s,r,t),void 0,null),he===null)throw Error(I(349));hn&30||pf(n,t,r)}return r}function pf(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=te.updateQueue,t===null?(t={lastEffect:null,stores:null},te.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function hf(e,t,n,s){t.value=n,t.getSnapshot=s,gf(t)&&yf(e)}function mf(e,t,n){return n(function(){gf(t)&&yf(e)})}function gf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!it(e,n)}catch{return!0}}function yf(e){var t=St(e,1);t!==null&&rt(t,e,1,-1)}function qc(e){var t=ut();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:sr,lastRenderedState:e},t.queue=e,e=e.dispatch=og.bind(null,te,e),[t.memoizedState,e]}function rr(e,t,n,s){return e={tag:e,create:t,destroy:n,deps:s,next:null},t=te.updateQueue,t===null?(t={lastEffect:null,stores:null},te.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e)),e}function xf(){return qe().memoizedState}function ti(e,t,n,s){var r=ut();te.flags|=e,r.memoizedState=rr(1|t,n,void 0,s===void 0?null:s)}function Ki(e,t,n,s){var r=qe();s=s===void 0?null:s;var i=void 0;if(de!==null){var o=de.memoizedState;if(i=o.destroy,s!==null&&La(s,o.deps)){r.memoizedState=rr(t,n,i,s);return}}te.flags|=e,r.memoizedState=rr(1|t,n,i,s)}function Qc(e,t){return ti(8390656,8,e,t)}function Oa(e,t){return Ki(2048,8,e,t)}function vf(e,t){return Ki(4,2,e,t)}function wf(e,t){return Ki(4,4,e,t)}function bf(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function jf(e,t,n){return n=n!=null?n.concat([e]):null,Ki(4,4,bf.bind(null,t,e),n)}function _a(){}function kf(e,t){var n=qe();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&La(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function Nf(e,t){var n=qe();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&La(t,s[1])?s[0]:(e=e(),n.memoizedState=[e,t],e)}function Sf(e,t,n){return hn&21?(it(n,t)||(n=Ld(),te.lanes|=n,mn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Pe=!0),e.memoizedState=n)}function ig(e,t){var n=V;V=n!==0&&4>n?n:4,e(!0);var s=Ol.transition;Ol.transition={};try{e(!1),t()}finally{V=n,Ol.transition=s}}function Cf(){return qe().memoizedState}function lg(e,t,n){var s=Wt(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},Ef(e))Tf(t,n);else if(n=af(e,t,n,s),n!==null){var r=Se();rt(n,e,s,r),Lf(n,t,s)}}function og(e,t,n){var s=Wt(e),r={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ef(e))Tf(t,r);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,n);if(r.hasEagerState=!0,r.eagerState=a,it(a,o)){var c=t.interleaved;c===null?(r.next=r,Na(t)):(r.next=c.next,c.next=r),t.interleaved=r;return}}catch{}finally{}n=af(e,t,r,s),n!==null&&(r=Se(),rt(n,e,s,r),Lf(n,t,s))}}function Ef(e){var t=e.alternate;return e===te||t!==null&&t===te}function Tf(e,t){Ms=Ci=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Lf(e,t,n){if(n&4194240){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,ua(e,n)}}var Ei={readContext:Ye,useCallback:xe,useContext:xe,useEffect:xe,useImperativeHandle:xe,useInsertionEffect:xe,useLayoutEffect:xe,useMemo:xe,useReducer:xe,useRef:xe,useState:xe,useDebugValue:xe,useDeferredValue:xe,useTransition:xe,useMutableSource:xe,useSyncExternalStore:xe,useId:xe,unstable_isNewReconciler:!1},ag={readContext:Ye,useCallback:function(e,t){return ut().memoizedState=[e,t===void 0?null:t],e},useContext:Ye,useEffect:Qc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ti(4194308,4,bf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ti(4194308,4,e,t)},useInsertionEffect:function(e,t){return ti(4,2,e,t)},useMemo:function(e,t){var n=ut();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=ut();return t=n!==void 0?n(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=lg.bind(null,te,e),[s.memoizedState,e]},useRef:function(e){var t=ut();return e={current:e},t.memoizedState=e},useState:qc,useDebugValue:_a,useDeferredValue:function(e){return ut().memoizedState=e},useTransition:function(){var e=qc(!1),t=e[0];return e=ig.bind(null,e[1]),ut().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=te,r=ut();if(Z){if(n===void 0)throw Error(I(407));n=n()}else{if(n=t(),he===null)throw Error(I(349));hn&30||pf(s,t,n)}r.memoizedState=n;var i={value:n,getSnapshot:t};return r.queue=i,Qc(mf.bind(null,s,i,e),[e]),s.flags|=2048,rr(9,hf.bind(null,s,i,n,t),void 0,null),n},useId:function(){var e=ut(),t=he.identifierPrefix;if(Z){var n=vt,s=xt;n=(s&~(1<<32-st(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=nr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=rg++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},cg={readContext:Ye,useCallback:kf,useContext:Ye,useEffect:Oa,useImperativeHandle:jf,useInsertionEffect:vf,useLayoutEffect:wf,useMemo:Nf,useReducer:_l,useRef:xf,useState:function(){return _l(sr)},useDebugValue:_a,useDeferredValue:function(e){var t=qe();return Sf(t,de.memoizedState,e)},useTransition:function(){var e=_l(sr)[0],t=qe().memoizedState;return[e,t]},useMutableSource:df,useSyncExternalStore:ff,useId:Cf,unstable_isNewReconciler:!1},ug={readContext:Ye,useCallback:kf,useContext:Ye,useEffect:Oa,useImperativeHandle:jf,useInsertionEffect:vf,useLayoutEffect:wf,useMemo:Nf,useReducer:Al,useRef:xf,useState:function(){return Al(sr)},useDebugValue:_a,useDeferredValue:function(e){var t=qe();return de===null?t.memoizedState=e:Sf(t,de.memoizedState,e)},useTransition:function(){var e=Al(sr)[0],t=qe().memoizedState;return[e,t]},useMutableSource:df,useSyncExternalStore:ff,useId:Cf,unstable_isNewReconciler:!1};function et(e,t){if(e&&e.defaultProps){t=ne({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Co(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:ne({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Vi={isMounted:function(e){return(e=e._reactInternals)?wn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var s=Se(),r=Wt(e),i=bt(s,r);i.payload=t,n!=null&&(i.callback=n),t=Ut(e,i,r),t!==null&&(rt(t,e,r,s),Zr(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=Se(),r=Wt(e),i=bt(s,r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ut(e,i,r),t!==null&&(rt(t,e,r,s),Zr(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Se(),s=Wt(e),r=bt(n,s);r.tag=2,t!=null&&(r.callback=t),t=Ut(e,r,s),t!==null&&(rt(t,e,s,n),Zr(t,e,s))}};function Jc(e,t,n,s,r,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,i,o):t.prototype&&t.prototype.isPureReactComponent?!Qs(n,s)||!Qs(r,i):!0}function Pf(e,t,n){var s=!1,r=qt,i=t.contextType;return typeof i=="object"&&i!==null?i=Ye(i):(r=_e(t)?fn:je.current,s=t.contextTypes,i=(s=s!=null)?Jn(e,r):qt),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Vi,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=i),t}function Xc(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&Vi.enqueueReplaceState(t,t.state,null)}function Eo(e,t,n,s){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs={},Sa(e);var i=t.contextType;typeof i=="object"&&i!==null?r.context=Ye(i):(i=_e(t)?fn:je.current,r.context=Jn(e,i)),r.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Co(e,t,i,n),r.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(t=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),t!==r.state&&Vi.enqueueReplaceState(r,r.state,null),Ni(e,n,r,s),r.state=e.memoizedState),typeof r.componentDidMount=="function"&&(e.flags|=4194308)}function ts(e,t){try{var n="",s=t;do n+=$h(s),s=s.return;while(s);var r=n}catch(i){r=`
39
- Error generating stack: `+i.message+`
40
- `+i.stack}return{value:e,source:t,stack:r,digest:null}}function Dl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function To(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var dg=typeof WeakMap=="function"?WeakMap:Map;function If(e,t,n){n=bt(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){Li||(Li=!0,$o=s),To(e,t)},n}function Of(e,t,n){n=bt(-1,n),n.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var r=t.value;n.payload=function(){return s(r)},n.callback=function(){To(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){To(e,t),typeof s!="function"&&(Ht===null?Ht=new Set([this]):Ht.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Zc(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new dg;var r=new Set;s.set(t,r)}else r=s.get(t),r===void 0&&(r=new Set,s.set(t,r));r.has(n)||(r.add(n),e=Sg.bind(null,e,t,n),t.then(e,e))}function eu(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function tu(e,t,n,s,r){return e.mode&1?(e.flags|=65536,e.lanes=r,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=bt(-1,1),t.tag=2,Ut(n,t,1))),n.lanes|=1),e)}var fg=Et.ReactCurrentOwner,Pe=!1;function ke(e,t,n,s){t.child=e===null?of(t,null,n,s):Zn(t,e.child,n,s)}function nu(e,t,n,s,r){n=n.render;var i=t.ref;return Vn(t,r),s=Pa(e,t,n,s,i,r),n=Ia(),e!==null&&!Pe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Ct(e,t,r)):(Z&&n&&xa(t),t.flags|=1,ke(e,t,s,r),t.child)}function su(e,t,n,s,r){if(e===null){var i=n.type;return typeof i=="function"&&!Ba(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,_f(e,t,i,s,r)):(e=ii(n.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&r)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Qs,n(o,s)&&e.ref===t.ref)return Ct(e,t,r)}return t.flags|=1,e=Kt(i,s),e.ref=t.ref,e.return=t,t.child=e}function _f(e,t,n,s,r){if(e!==null){var i=e.memoizedProps;if(Qs(i,s)&&e.ref===t.ref)if(Pe=!1,t.pendingProps=s=i,(e.lanes&r)!==0)e.flags&131072&&(Pe=!0);else return t.lanes=e.lanes,Ct(e,t,r)}return Lo(e,t,n,s,r)}function Af(e,t,n){var s=t.pendingProps,r=s.children,i=e!==null?e.memoizedState:null;if(s.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Y($n,Re),Re|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Y($n,Re),Re|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=i!==null?i.baseLanes:n,Y($n,Re),Re|=s}else i!==null?(s=i.baseLanes|n,t.memoizedState=null):s=n,Y($n,Re),Re|=s;return ke(e,t,r,n),t.child}function Df(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Lo(e,t,n,s,r){var i=_e(n)?fn:je.current;return i=Jn(t,i),Vn(t,r),n=Pa(e,t,n,s,i,r),s=Ia(),e!==null&&!Pe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Ct(e,t,r)):(Z&&s&&xa(t),t.flags|=1,ke(e,t,n,r),t.child)}function ru(e,t,n,s,r){if(_e(n)){var i=!0;vi(t)}else i=!1;if(Vn(t,r),t.stateNode===null)ni(e,t),Pf(t,n,s),Eo(t,n,s,r),s=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=Ye(u):(u=_e(n)?fn:je.current,u=Jn(t,u));var p=n.getDerivedStateFromProps,d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==s||c!==u)&&Xc(t,o,s,u),It=!1;var f=t.memoizedState;o.state=f,Ni(t,s,o,r),c=t.memoizedState,a!==s||f!==c||Oe.current||It?(typeof p=="function"&&(Co(t,n,p,s),c=t.memoizedState),(a=It||Jc(t,n,a,s,f,c,u))?(d||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=s,t.memoizedState=c),o.props=s,o.state=c,o.context=u,s=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{o=t.stateNode,cf(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:et(t.type,a),o.props=u,d=t.pendingProps,f=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=Ye(c):(c=_e(n)?fn:je.current,c=Jn(t,c));var y=n.getDerivedStateFromProps;(p=typeof y=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||f!==c)&&Xc(t,o,s,c),It=!1,f=t.memoizedState,o.state=f,Ni(t,s,o,r);var b=t.memoizedState;a!==d||f!==b||Oe.current||It?(typeof y=="function"&&(Co(t,n,y,s),b=t.memoizedState),(u=It||Jc(t,n,u,s,f,b,c)||!1)?(p||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(s,b,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(s,b,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=b),o.props=s,o.state=b,o.context=c,s=u):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),s=!1)}return Po(e,t,n,s,i,r)}function Po(e,t,n,s,r,i){Df(e,t);var o=(t.flags&128)!==0;if(!s&&!o)return r&&Hc(t,n,!1),Ct(e,t,i);s=t.stateNode,fg.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&o?(t.child=Zn(t,e.child,null,i),t.child=Zn(t,null,a,i)):ke(e,t,a,i),t.memoizedState=s.state,r&&Hc(t,n,!0),t.child}function Rf(e){var t=e.stateNode;t.pendingContext?Uc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Uc(e,t.context,!1),Ca(e,t.containerInfo)}function iu(e,t,n,s,r){return Xn(),wa(r),t.flags|=256,ke(e,t,n,s),t.child}var Io={dehydrated:null,treeContext:null,retryLane:0};function Oo(e){return{baseLanes:e,cachePool:null,transitions:null}}function Mf(e,t,n){var s=t.pendingProps,r=ee.current,i=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(r&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(r|=1),Y(ee,r&1),e===null)return No(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=s.children,e=s.fallback,i?(s=t.mode,i=t.child,o={mode:"hidden",children:o},!(s&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=qi(o,s,0,null),e=dn(e,s,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Oo(n),t.memoizedState=Io,e):Aa(t,o));if(r=e.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return pg(e,t,o,s,a,r,n);if(i){i=s.fallback,o=t.mode,r=e.child,a=r.sibling;var c={mode:"hidden",children:s.children};return!(o&1)&&t.child!==r?(s=t.child,s.childLanes=0,s.pendingProps=c,t.deletions=null):(s=Kt(r,c),s.subtreeFlags=r.subtreeFlags&14680064),a!==null?i=Kt(a,i):(i=dn(i,o,n,null),i.flags|=2),i.return=t,s.return=t,s.sibling=i,t.child=s,s=i,i=t.child,o=e.child.memoizedState,o=o===null?Oo(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=Io,s}return i=e.child,e=i.sibling,s=Kt(i,{mode:"visible",children:s.children}),!(t.mode&1)&&(s.lanes=n),s.return=t,s.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=s,t.memoizedState=null,s}function Aa(e,t){return t=qi({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Mr(e,t,n,s){return s!==null&&wa(s),Zn(t,e.child,null,n),e=Aa(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function pg(e,t,n,s,r,i,o){if(n)return t.flags&256?(t.flags&=-257,s=Dl(Error(I(422))),Mr(e,t,o,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=s.fallback,r=t.mode,s=qi({mode:"visible",children:s.children},r,0,null),i=dn(i,r,o,null),i.flags|=2,s.return=t,i.return=t,s.sibling=i,t.child=s,t.mode&1&&Zn(t,e.child,null,o),t.child.memoizedState=Oo(o),t.memoizedState=Io,i);if(!(t.mode&1))return Mr(e,t,o,null);if(r.data==="$!"){if(s=r.nextSibling&&r.nextSibling.dataset,s)var a=s.dgst;return s=a,i=Error(I(419)),s=Dl(i,s,void 0),Mr(e,t,o,s)}if(a=(o&e.childLanes)!==0,Pe||a){if(s=he,s!==null){switch(o&-o){case 4:r=2;break;case 16:r=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(s.suspendedLanes|o)?0:r,r!==0&&r!==i.retryLane&&(i.retryLane=r,St(e,r),rt(s,e,r,-1))}return za(),s=Dl(Error(I(421))),Mr(e,t,o,s)}return r.data==="$?"?(t.flags|=128,t.child=e.child,t=Cg.bind(null,e),r._reactRetry=t,null):(e=i.treeContext,Me=Bt(r.nextSibling),$e=t,Z=!0,nt=null,e!==null&&(Ue[He++]=xt,Ue[He++]=vt,Ue[He++]=pn,xt=e.id,vt=e.overflow,pn=t),t=Aa(t,s.children),t.flags|=4096,t)}function lu(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),So(e.return,t,n)}function Rl(e,t,n,s,r){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:r}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=s,i.tail=n,i.tailMode=r)}function $f(e,t,n){var s=t.pendingProps,r=s.revealOrder,i=s.tail;if(ke(e,t,s.children,n),s=ee.current,s&2)s=s&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&lu(e,n,t);else if(e.tag===19)lu(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}s&=1}if(Y(ee,s),!(t.mode&1))t.memoizedState=null;else switch(r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&Si(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),Rl(t,!1,r,n,i);break;case"backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&Si(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}Rl(t,!0,n,null,i);break;case"together":Rl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ni(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ct(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),mn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(I(153));if(t.child!==null){for(e=t.child,n=Kt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Kt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function hg(e,t,n){switch(t.tag){case 3:Rf(t),Xn();break;case 5:uf(t);break;case 1:_e(t.type)&&vi(t);break;case 4:Ca(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,r=t.memoizedProps.value;Y(ji,s._currentValue),s._currentValue=r;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(Y(ee,ee.current&1),t.flags|=128,null):n&t.child.childLanes?Mf(e,t,n):(Y(ee,ee.current&1),e=Ct(e,t,n),e!==null?e.sibling:null);Y(ee,ee.current&1);break;case 19:if(s=(n&t.childLanes)!==0,e.flags&128){if(s)return $f(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Y(ee,ee.current),s)break;return null;case 22:case 23:return t.lanes=0,Af(e,t,n)}return Ct(e,t,n)}var Ff,_o,zf,Bf;Ff=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};_o=function(){};zf=function(e,t,n,s){var r=e.memoizedProps;if(r!==s){e=t.stateNode,on(pt.current);var i=null;switch(n){case"input":r=eo(e,r),s=eo(e,s),i=[];break;case"select":r=ne({},r,{value:void 0}),s=ne({},s,{value:void 0}),i=[];break;case"textarea":r=so(e,r),s=so(e,s),i=[];break;default:typeof r.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=yi)}io(n,s);var o;n=null;for(u in r)if(!s.hasOwnProperty(u)&&r.hasOwnProperty(u)&&r[u]!=null)if(u==="style"){var a=r[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Hs.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in s){var c=s[u];if(a=r!=null?r[u]:void 0,s.hasOwnProperty(u)&&c!==a&&(c!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&a[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(i||(i=[]),i.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Hs.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&J("scroll",e),i||a===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};Bf=function(e,t,n,s){n!==s&&(t.flags|=4)};function ks(e,t){if(!Z)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function ve(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags&14680064,s|=r.flags&14680064,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function mg(e,t,n){var s=t.pendingProps;switch(va(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ve(t),null;case 1:return _e(t.type)&&xi(),ve(t),null;case 3:return s=t.stateNode,es(),X(Oe),X(je),Ta(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Dr(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,nt!==null&&(Bo(nt),nt=null))),_o(e,t),ve(t),null;case 5:Ea(t);var r=on(tr.current);if(n=t.type,e!==null&&t.stateNode!=null)zf(e,t,n,s,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(I(166));return ve(t),null}if(e=on(pt.current),Dr(t)){s=t.stateNode,n=t.type;var i=t.memoizedProps;switch(s[dt]=t,s[Zs]=i,e=(t.mode&1)!==0,n){case"dialog":J("cancel",s),J("close",s);break;case"iframe":case"object":case"embed":J("load",s);break;case"video":case"audio":for(r=0;r<Ls.length;r++)J(Ls[r],s);break;case"source":J("error",s);break;case"img":case"image":case"link":J("error",s),J("load",s);break;case"details":J("toggle",s);break;case"input":mc(s,i),J("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!i.multiple},J("invalid",s);break;case"textarea":yc(s,i),J("invalid",s)}io(n,i),r=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="children"?typeof a=="string"?s.textContent!==a&&(i.suppressHydrationWarning!==!0&&Ar(s.textContent,a,e),r=["children",a]):typeof a=="number"&&s.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Ar(s.textContent,a,e),r=["children",""+a]):Hs.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&J("scroll",s)}switch(n){case"input":Cr(s),gc(s,i,!0);break;case"textarea":Cr(s),xc(s);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(s.onclick=yi)}s=r,t.updateQueue=s,s!==null&&(t.flags|=4)}else{o=r.nodeType===9?r:r.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=hd(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=o.createElement(n,{is:s.is}):(e=o.createElement(n),n==="select"&&(o=e,s.multiple?o.multiple=!0:s.size&&(o.size=s.size))):e=o.createElementNS(e,n),e[dt]=t,e[Zs]=s,Ff(e,t,!1,!1),t.stateNode=e;e:{switch(o=lo(n,s),n){case"dialog":J("cancel",e),J("close",e),r=s;break;case"iframe":case"object":case"embed":J("load",e),r=s;break;case"video":case"audio":for(r=0;r<Ls.length;r++)J(Ls[r],e);r=s;break;case"source":J("error",e),r=s;break;case"img":case"image":case"link":J("error",e),J("load",e),r=s;break;case"details":J("toggle",e),r=s;break;case"input":mc(e,s),r=eo(e,s),J("invalid",e);break;case"option":r=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},r=ne({},s,{value:void 0}),J("invalid",e);break;case"textarea":yc(e,s),r=so(e,s),J("invalid",e);break;default:r=s}io(n,r),a=r;for(i in a)if(a.hasOwnProperty(i)){var c=a[i];i==="style"?yd(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&md(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Ws(e,c):typeof c=="number"&&Ws(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Hs.hasOwnProperty(i)?c!=null&&i==="onScroll"&&J("scroll",e):c!=null&&ra(e,i,c,o))}switch(n){case"input":Cr(e),gc(e,s,!1);break;case"textarea":Cr(e),xc(e);break;case"option":s.value!=null&&e.setAttribute("value",""+Yt(s.value));break;case"select":e.multiple=!!s.multiple,i=s.value,i!=null?Un(e,!!s.multiple,i,!1):s.defaultValue!=null&&Un(e,!!s.multiple,s.defaultValue,!0);break;default:typeof r.onClick=="function"&&(e.onclick=yi)}switch(n){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ve(t),null;case 6:if(e&&t.stateNode!=null)Bf(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(I(166));if(n=on(tr.current),on(pt.current),Dr(t)){if(s=t.stateNode,n=t.memoizedProps,s[dt]=t,(i=s.nodeValue!==n)&&(e=$e,e!==null))switch(e.tag){case 3:Ar(s.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ar(s.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[dt]=t,t.stateNode=s}return ve(t),null;case 13:if(X(ee),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Z&&Me!==null&&t.mode&1&&!(t.flags&128))rf(),Xn(),t.flags|=98560,i=!1;else if(i=Dr(t),s!==null&&s.dehydrated!==null){if(e===null){if(!i)throw Error(I(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(I(317));i[dt]=t}else Xn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ve(t),i=!1}else nt!==null&&(Bo(nt),nt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,t.mode&1&&(e===null||ee.current&1?fe===0&&(fe=3):za())),t.updateQueue!==null&&(t.flags|=4),ve(t),null);case 4:return es(),_o(e,t),e===null&&Js(t.stateNode.containerInfo),ve(t),null;case 10:return ka(t.type._context),ve(t),null;case 17:return _e(t.type)&&xi(),ve(t),null;case 19:if(X(ee),i=t.memoizedState,i===null)return ve(t),null;if(s=(t.flags&128)!==0,o=i.rendering,o===null)if(s)ks(i,!1);else{if(fe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Si(e),o!==null){for(t.flags|=128,ks(i,!1),s=o.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=n,n=t.child;n!==null;)i=n,e=s,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Y(ee,ee.current&1|2),t.child}e=e.sibling}i.tail!==null&&le()>ns&&(t.flags|=128,s=!0,ks(i,!1),t.lanes=4194304)}else{if(!s)if(e=Si(o),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ks(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Z)return ve(t),null}else 2*le()-i.renderingStartTime>ns&&n!==1073741824&&(t.flags|=128,s=!0,ks(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=le(),t.sibling=null,n=ee.current,Y(ee,s?n&1|2:n&1),t):(ve(t),null);case 22:case 23:return Fa(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?Re&1073741824&&(ve(t),t.subtreeFlags&6&&(t.flags|=8192)):ve(t),null;case 24:return null;case 25:return null}throw Error(I(156,t.tag))}function gg(e,t){switch(va(t),t.tag){case 1:return _e(t.type)&&xi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return es(),X(Oe),X(je),Ta(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ea(t),null;case 13:if(X(ee),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(I(340));Xn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return X(ee),null;case 4:return es(),null;case 10:return ka(t.type._context),null;case 22:case 23:return Fa(),null;case 24:return null;default:return null}}var $r=!1,be=!1,yg=typeof WeakSet=="function"?WeakSet:Set,A=null;function Mn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){re(e,t,s)}else n.current=null}function Ao(e,t,n){try{n()}catch(s){re(e,t,s)}}var ou=!1;function xg(e,t){if(yo=hi,e=Kd(),ya(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var r=s.anchorOffset,i=s.focusNode;s=s.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,c=-1,u=0,p=0,d=e,f=null;t:for(;;){for(var y;d!==n||r!==0&&d.nodeType!==3||(a=o+r),d!==i||s!==0&&d.nodeType!==3||(c=o+s),d.nodeType===3&&(o+=d.nodeValue.length),(y=d.firstChild)!==null;)f=d,d=y;for(;;){if(d===e)break t;if(f===n&&++u===r&&(a=o),f===i&&++p===s&&(c=o),(y=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=y}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(xo={focusedElem:e,selectionRange:n},hi=!1,A=t;A!==null;)if(t=A,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,A=e;else for(;A!==null;){t=A;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var x=b.memoizedProps,v=b.memoizedState,g=t.stateNode,m=g.getSnapshotBeforeUpdate(t.elementType===t.type?x:et(t.type,x),v);g.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var h=t.stateNode.containerInfo;h.nodeType===1?h.textContent="":h.nodeType===9&&h.documentElement&&h.removeChild(h.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(I(163))}}catch(j){re(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,A=e;break}A=t.return}return b=ou,ou=!1,b}function $s(e,t,n){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var r=s=s.next;do{if((r.tag&e)===e){var i=r.destroy;r.destroy=void 0,i!==void 0&&Ao(t,n,i)}r=r.next}while(r!==s)}}function Gi(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var s=n.create;n.destroy=s()}n=n.next}while(n!==t)}}function Do(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Uf(e){var t=e.alternate;t!==null&&(e.alternate=null,Uf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[dt],delete t[Zs],delete t[bo],delete t[eg],delete t[tg])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Hf(e){return e.tag===5||e.tag===3||e.tag===4}function au(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Hf(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.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 Ro(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=yi));else if(s!==4&&(e=e.child,e!==null))for(Ro(e,t,n),e=e.sibling;e!==null;)Ro(e,t,n),e=e.sibling}function Mo(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(Mo(e,t,n),e=e.sibling;e!==null;)Mo(e,t,n),e=e.sibling}var me=null,tt=!1;function Lt(e,t,n){for(n=n.child;n!==null;)Wf(e,t,n),n=n.sibling}function Wf(e,t,n){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(Fi,n)}catch{}switch(n.tag){case 5:be||Mn(n,t);case 6:var s=me,r=tt;me=null,Lt(e,t,n),me=s,tt=r,me!==null&&(tt?(e=me,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):me.removeChild(n.stateNode));break;case 18:me!==null&&(tt?(e=me,n=n.stateNode,e.nodeType===8?Ll(e.parentNode,n):e.nodeType===1&&Ll(e,n),Ys(e)):Ll(me,n.stateNode));break;case 4:s=me,r=tt,me=n.stateNode.containerInfo,tt=!0,Lt(e,t,n),me=s,tt=r;break;case 0:case 11:case 14:case 15:if(!be&&(s=n.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){r=s=s.next;do{var i=r,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Ao(n,t,o),r=r.next}while(r!==s)}Lt(e,t,n);break;case 1:if(!be&&(Mn(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(a){re(n,t,a)}Lt(e,t,n);break;case 21:Lt(e,t,n);break;case 22:n.mode&1?(be=(s=be)||n.memoizedState!==null,Lt(e,t,n),be=s):Lt(e,t,n);break;default:Lt(e,t,n)}}function cu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new yg),t.forEach(function(s){var r=Eg.bind(null,e,s);n.has(s)||(n.add(s),s.then(r,r))})}}function Xe(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var r=n[s];try{var i=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:me=a.stateNode,tt=!1;break e;case 3:me=a.stateNode.containerInfo,tt=!0;break e;case 4:me=a.stateNode.containerInfo,tt=!0;break e}a=a.return}if(me===null)throw Error(I(160));Wf(i,o,r),me=null,tt=!1;var c=r.alternate;c!==null&&(c.return=null),r.return=null}catch(u){re(r,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Kf(t,e),t=t.sibling}function Kf(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Xe(t,e),ot(e),s&4){try{$s(3,e,e.return),Gi(3,e)}catch(x){re(e,e.return,x)}try{$s(5,e,e.return)}catch(x){re(e,e.return,x)}}break;case 1:Xe(t,e),ot(e),s&512&&n!==null&&Mn(n,n.return);break;case 5:if(Xe(t,e),ot(e),s&512&&n!==null&&Mn(n,n.return),e.flags&32){var r=e.stateNode;try{Ws(r,"")}catch(x){re(e,e.return,x)}}if(s&4&&(r=e.stateNode,r!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,a=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&fd(r,i),lo(a,o);var u=lo(a,i);for(o=0;o<c.length;o+=2){var p=c[o],d=c[o+1];p==="style"?yd(r,d):p==="dangerouslySetInnerHTML"?md(r,d):p==="children"?Ws(r,d):ra(r,p,d,u)}switch(a){case"input":to(r,i);break;case"textarea":pd(r,i);break;case"select":var f=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!i.multiple;var y=i.value;y!=null?Un(r,!!i.multiple,y,!1):f!==!!i.multiple&&(i.defaultValue!=null?Un(r,!!i.multiple,i.defaultValue,!0):Un(r,!!i.multiple,i.multiple?[]:"",!1))}r[Zs]=i}catch(x){re(e,e.return,x)}}break;case 6:if(Xe(t,e),ot(e),s&4){if(e.stateNode===null)throw Error(I(162));r=e.stateNode,i=e.memoizedProps;try{r.nodeValue=i}catch(x){re(e,e.return,x)}}break;case 3:if(Xe(t,e),ot(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{Ys(t.containerInfo)}catch(x){re(e,e.return,x)}break;case 4:Xe(t,e),ot(e);break;case 13:Xe(t,e),ot(e),r=e.child,r.flags&8192&&(i=r.memoizedState!==null,r.stateNode.isHidden=i,!i||r.alternate!==null&&r.alternate.memoizedState!==null||(Ma=le())),s&4&&cu(e);break;case 22:if(p=n!==null&&n.memoizedState!==null,e.mode&1?(be=(u=be)||p,Xe(t,e),be=u):Xe(t,e),ot(e),s&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!p&&e.mode&1)for(A=e,p=e.child;p!==null;){for(d=A=p;A!==null;){switch(f=A,y=f.child,f.tag){case 0:case 11:case 14:case 15:$s(4,f,f.return);break;case 1:Mn(f,f.return);var b=f.stateNode;if(typeof b.componentWillUnmount=="function"){s=f,n=f.return;try{t=s,b.props=t.memoizedProps,b.state=t.memoizedState,b.componentWillUnmount()}catch(x){re(s,n,x)}}break;case 5:Mn(f,f.return);break;case 22:if(f.memoizedState!==null){du(d);continue}}y!==null?(y.return=f,A=y):du(d)}p=p.sibling}e:for(p=null,d=e;;){if(d.tag===5){if(p===null){p=d;try{r=d.stateNode,u?(i=r.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,c=d.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=gd("display",o))}catch(x){re(e,e.return,x)}}}else if(d.tag===6){if(p===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(x){re(e,e.return,x)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;p===d&&(p=null),d=d.return}p===d&&(p=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Xe(t,e),ot(e),s&4&&cu(e);break;case 21:break;default:Xe(t,e),ot(e)}}function ot(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Hf(n)){var s=n;break e}n=n.return}throw Error(I(160))}switch(s.tag){case 5:var r=s.stateNode;s.flags&32&&(Ws(r,""),s.flags&=-33);var i=au(e);Mo(e,i,r);break;case 3:case 4:var o=s.stateNode.containerInfo,a=au(e);Ro(e,a,o);break;default:throw Error(I(161))}}catch(c){re(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vg(e,t,n){A=e,Vf(e)}function Vf(e,t,n){for(var s=(e.mode&1)!==0;A!==null;){var r=A,i=r.child;if(r.tag===22&&s){var o=r.memoizedState!==null||$r;if(!o){var a=r.alternate,c=a!==null&&a.memoizedState!==null||be;a=$r;var u=be;if($r=o,(be=c)&&!u)for(A=r;A!==null;)o=A,c=o.child,o.tag===22&&o.memoizedState!==null?fu(r):c!==null?(c.return=o,A=c):fu(r);for(;i!==null;)A=i,Vf(i),i=i.sibling;A=r,$r=a,be=u}uu(e)}else r.subtreeFlags&8772&&i!==null?(i.return=r,A=i):uu(e)}}function uu(e){for(;A!==null;){var t=A;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:be||Gi(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!be)if(n===null)s.componentDidMount();else{var r=t.elementType===t.type?n.memoizedProps:et(t.type,n.memoizedProps);s.componentDidUpdate(r,n.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Yc(t,i,s);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Yc(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var p=u.memoizedState;if(p!==null){var d=p.dehydrated;d!==null&&Ys(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(I(163))}be||t.flags&512&&Do(t)}catch(f){re(t,t.return,f)}}if(t===e){A=null;break}if(n=t.sibling,n!==null){n.return=t.return,A=n;break}A=t.return}}function du(e){for(;A!==null;){var t=A;if(t===e){A=null;break}var n=t.sibling;if(n!==null){n.return=t.return,A=n;break}A=t.return}}function fu(e){for(;A!==null;){var t=A;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Gi(4,t)}catch(c){re(t,n,c)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var r=t.return;try{s.componentDidMount()}catch(c){re(t,r,c)}}var i=t.return;try{Do(t)}catch(c){re(t,i,c)}break;case 5:var o=t.return;try{Do(t)}catch(c){re(t,o,c)}}}catch(c){re(t,t.return,c)}if(t===e){A=null;break}var a=t.sibling;if(a!==null){a.return=t.return,A=a;break}A=t.return}}var wg=Math.ceil,Ti=Et.ReactCurrentDispatcher,Da=Et.ReactCurrentOwner,Ve=Et.ReactCurrentBatchConfig,H=0,he=null,ue=null,ge=0,Re=0,$n=Jt(0),fe=0,ir=null,mn=0,Yi=0,Ra=0,Fs=null,Le=null,Ma=0,ns=1/0,gt=null,Li=!1,$o=null,Ht=null,Fr=!1,Rt=null,Pi=0,zs=0,Fo=null,si=-1,ri=0;function Se(){return H&6?le():si!==-1?si:si=le()}function Wt(e){return e.mode&1?H&2&&ge!==0?ge&-ge:sg.transition!==null?(ri===0&&(ri=Ld()),ri):(e=V,e!==0||(e=window.event,e=e===void 0?16:Rd(e.type)),e):1}function rt(e,t,n,s){if(50<zs)throw zs=0,Fo=null,Error(I(185));fr(e,n,s),(!(H&2)||e!==he)&&(e===he&&(!(H&2)&&(Yi|=n),fe===4&&At(e,ge)),Ae(e,s),n===1&&H===0&&!(t.mode&1)&&(ns=le()+500,Wi&&Xt()))}function Ae(e,t){var n=e.callbackNode;sm(e,t);var s=pi(e,e===he?ge:0);if(s===0)n!==null&&bc(n),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(n!=null&&bc(n),t===1)e.tag===0?ng(pu.bind(null,e)):tf(pu.bind(null,e)),Xm(function(){!(H&6)&&Xt()}),n=null;else{switch(Pd(s)){case 1:n=ca;break;case 4:n=Ed;break;case 16:n=fi;break;case 536870912:n=Td;break;default:n=fi}n=ep(n,Gf.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Gf(e,t){if(si=-1,ri=0,H&6)throw Error(I(327));var n=e.callbackNode;if(Gn()&&e.callbackNode!==n)return null;var s=pi(e,e===he?ge:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=Ii(e,s);else{t=s;var r=H;H|=2;var i=qf();(he!==e||ge!==t)&&(gt=null,ns=le()+500,un(e,t));do try{kg();break}catch(a){Yf(e,a)}while(!0);ja(),Ti.current=i,H=r,ue!==null?t=0:(he=null,ge=0,t=fe)}if(t!==0){if(t===2&&(r=fo(e),r!==0&&(s=r,t=zo(e,r))),t===1)throw n=ir,un(e,0),At(e,s),Ae(e,le()),n;if(t===6)At(e,s);else{if(r=e.current.alternate,!(s&30)&&!bg(r)&&(t=Ii(e,s),t===2&&(i=fo(e),i!==0&&(s=i,t=zo(e,i))),t===1))throw n=ir,un(e,0),At(e,s),Ae(e,le()),n;switch(e.finishedWork=r,e.finishedLanes=s,t){case 0:case 1:throw Error(I(345));case 2:nn(e,Le,gt);break;case 3:if(At(e,s),(s&130023424)===s&&(t=Ma+500-le(),10<t)){if(pi(e,0)!==0)break;if(r=e.suspendedLanes,(r&s)!==s){Se(),e.pingedLanes|=e.suspendedLanes&r;break}e.timeoutHandle=wo(nn.bind(null,e,Le,gt),t);break}nn(e,Le,gt);break;case 4:if(At(e,s),(s&4194240)===s)break;for(t=e.eventTimes,r=-1;0<s;){var o=31-st(s);i=1<<o,o=t[o],o>r&&(r=o),s&=~i}if(s=r,s=le()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*wg(s/1960))-s,10<s){e.timeoutHandle=wo(nn.bind(null,e,Le,gt),s);break}nn(e,Le,gt);break;case 5:nn(e,Le,gt);break;default:throw Error(I(329))}}}return Ae(e,le()),e.callbackNode===n?Gf.bind(null,e):null}function zo(e,t){var n=Fs;return e.current.memoizedState.isDehydrated&&(un(e,t).flags|=256),e=Ii(e,t),e!==2&&(t=Le,Le=n,t!==null&&Bo(t)),e}function Bo(e){Le===null?Le=e:Le.push.apply(Le,e)}function bg(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var s=0;s<n.length;s++){var r=n[s],i=r.getSnapshot;r=r.value;try{if(!it(i(),r))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function At(e,t){for(t&=~Ra,t&=~Yi,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-st(t),s=1<<n;e[n]=-1,t&=~s}}function pu(e){if(H&6)throw Error(I(327));Gn();var t=pi(e,0);if(!(t&1))return Ae(e,le()),null;var n=Ii(e,t);if(e.tag!==0&&n===2){var s=fo(e);s!==0&&(t=s,n=zo(e,s))}if(n===1)throw n=ir,un(e,0),At(e,t),Ae(e,le()),n;if(n===6)throw Error(I(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,nn(e,Le,gt),Ae(e,le()),null}function $a(e,t){var n=H;H|=1;try{return e(t)}finally{H=n,H===0&&(ns=le()+500,Wi&&Xt())}}function gn(e){Rt!==null&&Rt.tag===0&&!(H&6)&&Gn();var t=H;H|=1;var n=Ve.transition,s=V;try{if(Ve.transition=null,V=1,e)return e()}finally{V=s,Ve.transition=n,H=t,!(H&6)&&Xt()}}function Fa(){Re=$n.current,X($n)}function un(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Jm(n)),ue!==null)for(n=ue.return;n!==null;){var s=n;switch(va(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&xi();break;case 3:es(),X(Oe),X(je),Ta();break;case 5:Ea(s);break;case 4:es();break;case 13:X(ee);break;case 19:X(ee);break;case 10:ka(s.type._context);break;case 22:case 23:Fa()}n=n.return}if(he=e,ue=e=Kt(e.current,null),ge=Re=t,fe=0,ir=null,Ra=Yi=mn=0,Le=Fs=null,ln!==null){for(t=0;t<ln.length;t++)if(n=ln[t],s=n.interleaved,s!==null){n.interleaved=null;var r=s.next,i=n.pending;if(i!==null){var o=i.next;i.next=r,s.next=o}n.pending=s}ln=null}return e}function Yf(e,t){do{var n=ue;try{if(ja(),ei.current=Ei,Ci){for(var s=te.memoizedState;s!==null;){var r=s.queue;r!==null&&(r.pending=null),s=s.next}Ci=!1}if(hn=0,pe=de=te=null,Ms=!1,nr=0,Da.current=null,n===null||n.return===null){fe=1,ir=t,ue=null;break}e:{var i=e,o=n.return,a=n,c=t;if(t=ge,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,p=a,d=p.tag;if(!(p.mode&1)&&(d===0||d===11||d===15)){var f=p.alternate;f?(p.updateQueue=f.updateQueue,p.memoizedState=f.memoizedState,p.lanes=f.lanes):(p.updateQueue=null,p.memoizedState=null)}var y=eu(o);if(y!==null){y.flags&=-257,tu(y,o,a,i,t),y.mode&1&&Zc(i,u,t),t=y,c=u;var b=t.updateQueue;if(b===null){var x=new Set;x.add(c),t.updateQueue=x}else b.add(c);break e}else{if(!(t&1)){Zc(i,u,t),za();break e}c=Error(I(426))}}else if(Z&&a.mode&1){var v=eu(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),tu(v,o,a,i,t),wa(ts(c,a));break e}}i=c=ts(c,a),fe!==4&&(fe=2),Fs===null?Fs=[i]:Fs.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=If(i,c,t);Gc(i,g);break e;case 1:a=c;var m=i.type,h=i.stateNode;if(!(i.flags&128)&&(typeof m.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Ht===null||!Ht.has(h)))){i.flags|=65536,t&=-t,i.lanes|=t;var j=Of(i,a,t);Gc(i,j);break e}}i=i.return}while(i!==null)}Jf(n)}catch(k){t=k,ue===n&&n!==null&&(ue=n=n.return);continue}break}while(!0)}function qf(){var e=Ti.current;return Ti.current=Ei,e===null?Ei:e}function za(){(fe===0||fe===3||fe===2)&&(fe=4),he===null||!(mn&268435455)&&!(Yi&268435455)||At(he,ge)}function Ii(e,t){var n=H;H|=2;var s=qf();(he!==e||ge!==t)&&(gt=null,un(e,t));do try{jg();break}catch(r){Yf(e,r)}while(!0);if(ja(),H=n,Ti.current=s,ue!==null)throw Error(I(261));return he=null,ge=0,fe}function jg(){for(;ue!==null;)Qf(ue)}function kg(){for(;ue!==null&&!Yh();)Qf(ue)}function Qf(e){var t=Zf(e.alternate,e,Re);e.memoizedProps=e.pendingProps,t===null?Jf(e):ue=t,Da.current=null}function Jf(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=gg(n,t),n!==null){n.flags&=32767,ue=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{fe=6,ue=null;return}}else if(n=mg(n,t,Re),n!==null){ue=n;return}if(t=t.sibling,t!==null){ue=t;return}ue=t=e}while(t!==null);fe===0&&(fe=5)}function nn(e,t,n){var s=V,r=Ve.transition;try{Ve.transition=null,V=1,Ng(e,t,n,s)}finally{Ve.transition=r,V=s}return null}function Ng(e,t,n,s){do Gn();while(Rt!==null);if(H&6)throw Error(I(327));n=e.finishedWork;var r=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(I(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(rm(e,i),e===he&&(ue=he=null,ge=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Fr||(Fr=!0,ep(fi,function(){return Gn(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Ve.transition,Ve.transition=null;var o=V;V=1;var a=H;H|=4,Da.current=null,xg(e,n),Kf(n,e),Wm(xo),hi=!!yo,xo=yo=null,e.current=n,vg(n),qh(),H=a,V=o,Ve.transition=i}else e.current=n;if(Fr&&(Fr=!1,Rt=e,Pi=r),i=e.pendingLanes,i===0&&(Ht=null),Xh(n.stateNode),Ae(e,le()),t!==null)for(s=e.onRecoverableError,n=0;n<t.length;n++)r=t[n],s(r.value,{componentStack:r.stack,digest:r.digest});if(Li)throw Li=!1,e=$o,$o=null,e;return Pi&1&&e.tag!==0&&Gn(),i=e.pendingLanes,i&1?e===Fo?zs++:(zs=0,Fo=e):zs=0,Xt(),null}function Gn(){if(Rt!==null){var e=Pd(Pi),t=Ve.transition,n=V;try{if(Ve.transition=null,V=16>e?16:e,Rt===null)var s=!1;else{if(e=Rt,Rt=null,Pi=0,H&6)throw Error(I(331));var r=H;for(H|=4,A=e.current;A!==null;){var i=A,o=i.child;if(A.flags&16){var a=i.deletions;if(a!==null){for(var c=0;c<a.length;c++){var u=a[c];for(A=u;A!==null;){var p=A;switch(p.tag){case 0:case 11:case 15:$s(8,p,i)}var d=p.child;if(d!==null)d.return=p,A=d;else for(;A!==null;){p=A;var f=p.sibling,y=p.return;if(Uf(p),p===u){A=null;break}if(f!==null){f.return=y,A=f;break}A=y}}}var b=i.alternate;if(b!==null){var x=b.child;if(x!==null){b.child=null;do{var v=x.sibling;x.sibling=null,x=v}while(x!==null)}}A=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,A=o;else e:for(;A!==null;){if(i=A,i.flags&2048)switch(i.tag){case 0:case 11:case 15:$s(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,A=g;break e}A=i.return}}var m=e.current;for(A=m;A!==null;){o=A;var h=o.child;if(o.subtreeFlags&2064&&h!==null)h.return=o,A=h;else e:for(o=m;A!==null;){if(a=A,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Gi(9,a)}}catch(k){re(a,a.return,k)}if(a===o){A=null;break e}var j=a.sibling;if(j!==null){j.return=a.return,A=j;break e}A=a.return}}if(H=r,Xt(),ft&&typeof ft.onPostCommitFiberRoot=="function")try{ft.onPostCommitFiberRoot(Fi,e)}catch{}s=!0}return s}finally{V=n,Ve.transition=t}}return!1}function hu(e,t,n){t=ts(n,t),t=If(e,t,1),e=Ut(e,t,1),t=Se(),e!==null&&(fr(e,1,t),Ae(e,t))}function re(e,t,n){if(e.tag===3)hu(e,e,n);else for(;t!==null;){if(t.tag===3){hu(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Ht===null||!Ht.has(s))){e=ts(n,e),e=Of(t,e,1),t=Ut(t,e,1),e=Se(),t!==null&&(fr(t,1,e),Ae(t,e));break}}t=t.return}}function Sg(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),t=Se(),e.pingedLanes|=e.suspendedLanes&n,he===e&&(ge&n)===n&&(fe===4||fe===3&&(ge&130023424)===ge&&500>le()-Ma?un(e,0):Ra|=n),Ae(e,t)}function Xf(e,t){t===0&&(e.mode&1?(t=Lr,Lr<<=1,!(Lr&130023424)&&(Lr=4194304)):t=1);var n=Se();e=St(e,t),e!==null&&(fr(e,t,n),Ae(e,n))}function Cg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xf(e,n)}function Eg(e,t){var n=0;switch(e.tag){case 13:var s=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(I(314))}s!==null&&s.delete(t),Xf(e,n)}var Zf;Zf=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Oe.current)Pe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Pe=!1,hg(e,t,n);Pe=!!(e.flags&131072)}else Pe=!1,Z&&t.flags&1048576&&nf(t,bi,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;ni(e,t),e=t.pendingProps;var r=Jn(t,je.current);Vn(t,n),r=Pa(null,t,s,e,r,n);var i=Ia();return t.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,_e(s)?(i=!0,vi(t)):i=!1,t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Sa(t),r.updater=Vi,t.stateNode=r,r._reactInternals=t,Eo(t,s,e,n),t=Po(null,t,s,!0,i,n)):(t.tag=0,Z&&i&&xa(t),ke(null,t,r,n),t=t.child),t;case 16:s=t.elementType;e:{switch(ni(e,t),e=t.pendingProps,r=s._init,s=r(s._payload),t.type=s,r=t.tag=Lg(s),e=et(s,e),r){case 0:t=Lo(null,t,s,e,n);break e;case 1:t=ru(null,t,s,e,n);break e;case 11:t=nu(null,t,s,e,n);break e;case 14:t=su(null,t,s,et(s.type,e),n);break e}throw Error(I(306,s,""))}return t;case 0:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:et(s,r),Lo(e,t,s,r,n);case 1:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:et(s,r),ru(e,t,s,r,n);case 3:e:{if(Rf(t),e===null)throw Error(I(387));s=t.pendingProps,i=t.memoizedState,r=i.element,cf(e,t),Ni(t,s,null,n);var o=t.memoizedState;if(s=o.element,i.isDehydrated)if(i={element:s,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){r=ts(Error(I(423)),t),t=iu(e,t,s,n,r);break e}else if(s!==r){r=ts(Error(I(424)),t),t=iu(e,t,s,n,r);break e}else for(Me=Bt(t.stateNode.containerInfo.firstChild),$e=t,Z=!0,nt=null,n=of(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Xn(),s===r){t=Ct(e,t,n);break e}ke(e,t,s,n)}t=t.child}return t;case 5:return uf(t),e===null&&No(t),s=t.type,r=t.pendingProps,i=e!==null?e.memoizedProps:null,o=r.children,vo(s,r)?o=null:i!==null&&vo(s,i)&&(t.flags|=32),Df(e,t),ke(e,t,o,n),t.child;case 6:return e===null&&No(t),null;case 13:return Mf(e,t,n);case 4:return Ca(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Zn(t,null,s,n):ke(e,t,s,n),t.child;case 11:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:et(s,r),nu(e,t,s,r,n);case 7:return ke(e,t,t.pendingProps,n),t.child;case 8:return ke(e,t,t.pendingProps.children,n),t.child;case 12:return ke(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(s=t.type._context,r=t.pendingProps,i=t.memoizedProps,o=r.value,Y(ji,s._currentValue),s._currentValue=o,i!==null)if(it(i.value,o)){if(i.children===r.children&&!Oe.current){t=Ct(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var c=a.firstContext;c!==null;){if(c.context===s){if(i.tag===1){c=bt(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var p=u.pending;p===null?c.next=c:(c.next=p.next,p.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),So(i.return,n,t),a.lanes|=n;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(I(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),So(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}ke(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,s=t.pendingProps.children,Vn(t,n),r=Ye(r),s=s(r),t.flags|=1,ke(e,t,s,n),t.child;case 14:return s=t.type,r=et(s,t.pendingProps),r=et(s.type,r),su(e,t,s,r,n);case 15:return _f(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:et(s,r),ni(e,t),t.tag=1,_e(s)?(e=!0,vi(t)):e=!1,Vn(t,n),Pf(t,s,r),Eo(t,s,r,n),Po(null,t,s,!0,e,n);case 19:return $f(e,t,n);case 22:return Af(e,t,n)}throw Error(I(156,t.tag))};function ep(e,t){return Cd(e,t)}function Tg(e,t,n,s){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ke(e,t,n,s){return new Tg(e,t,n,s)}function Ba(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Lg(e){if(typeof e=="function")return Ba(e)?1:0;if(e!=null){if(e=e.$$typeof,e===la)return 11;if(e===oa)return 14}return 2}function Kt(e,t){var n=e.alternate;return n===null?(n=Ke(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ii(e,t,n,s,r,i){var o=2;if(s=e,typeof e=="function")Ba(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Tn:return dn(n.children,r,i,t);case ia:o=8,r|=8;break;case Ql:return e=Ke(12,n,t,r|2),e.elementType=Ql,e.lanes=i,e;case Jl:return e=Ke(13,n,t,r),e.elementType=Jl,e.lanes=i,e;case Xl:return e=Ke(19,n,t,r),e.elementType=Xl,e.lanes=i,e;case cd:return qi(n,r,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case od:o=10;break e;case ad:o=9;break e;case la:o=11;break e;case oa:o=14;break e;case Pt:o=16,s=null;break e}throw Error(I(130,e==null?e:typeof e,""))}return t=Ke(o,n,t,r),t.elementType=e,t.type=s,t.lanes=i,t}function dn(e,t,n,s){return e=Ke(7,e,s,t),e.lanes=n,e}function qi(e,t,n,s){return e=Ke(22,e,s,t),e.elementType=cd,e.lanes=n,e.stateNode={isHidden:!1},e}function Ml(e,t,n){return e=Ke(6,e,null,t),e.lanes=n,e}function $l(e,t,n){return t=Ke(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Pg(e,t,n,s,r){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=xl(0),this.expirationTimes=xl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xl(0),this.identifierPrefix=s,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function Ua(e,t,n,s,r,i,o,a,c){return e=new Pg(e,t,n,a,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Ke(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sa(i),e}function Ig(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:En,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}function tp(e){if(!e)return qt;e=e._reactInternals;e:{if(wn(e)!==e||e.tag!==1)throw Error(I(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(_e(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(I(171))}if(e.tag===1){var n=e.type;if(_e(n))return ef(e,n,t)}return t}function np(e,t,n,s,r,i,o,a,c){return e=Ua(n,s,!0,e,r,i,o,a,c),e.context=tp(null),n=e.current,s=Se(),r=Wt(n),i=bt(s,r),i.callback=t??null,Ut(n,i,r),e.current.lanes=r,fr(e,r,s),Ae(e,s),e}function Qi(e,t,n,s){var r=t.current,i=Se(),o=Wt(r);return n=tp(n),t.context===null?t.context=n:t.pendingContext=n,t=bt(i,o),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=Ut(r,t,o),e!==null&&(rt(e,r,o,i),Zr(e,r,o)),o}function Oi(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function mu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ha(e,t){mu(e,t),(e=e.alternate)&&mu(e,t)}function Og(){return null}var sp=typeof reportError=="function"?reportError:function(e){console.error(e)};function Wa(e){this._internalRoot=e}Ji.prototype.render=Wa.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(I(409));Qi(e,t,null,null)};Ji.prototype.unmount=Wa.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gn(function(){Qi(null,e,null,null)}),t[Nt]=null}};function Ji(e){this._internalRoot=e}Ji.prototype.unstable_scheduleHydration=function(e){if(e){var t=_d();e={blockedOn:null,target:e,priority:t};for(var n=0;n<_t.length&&t!==0&&t<_t[n].priority;n++);_t.splice(n,0,e),n===0&&Dd(e)}};function Ka(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Xi(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function gu(){}function _g(e,t,n,s,r){if(r){if(typeof s=="function"){var i=s;s=function(){var u=Oi(o);i.call(u)}}var o=np(t,s,e,0,null,!1,!1,"",gu);return e._reactRootContainer=o,e[Nt]=o.current,Js(e.nodeType===8?e.parentNode:e),gn(),o}for(;r=e.lastChild;)e.removeChild(r);if(typeof s=="function"){var a=s;s=function(){var u=Oi(c);a.call(u)}}var c=Ua(e,0,!1,null,null,!1,!1,"",gu);return e._reactRootContainer=c,e[Nt]=c.current,Js(e.nodeType===8?e.parentNode:e),gn(function(){Qi(t,c,n,s)}),c}function Zi(e,t,n,s,r){var i=n._reactRootContainer;if(i){var o=i;if(typeof r=="function"){var a=r;r=function(){var c=Oi(o);a.call(c)}}Qi(t,o,e,r)}else o=_g(n,t,e,r,s);return Oi(o)}Id=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ts(t.pendingLanes);n!==0&&(ua(t,n|1),Ae(t,le()),!(H&6)&&(ns=le()+500,Xt()))}break;case 13:gn(function(){var s=St(e,1);if(s!==null){var r=Se();rt(s,e,1,r)}}),Ha(e,1)}};da=function(e){if(e.tag===13){var t=St(e,134217728);if(t!==null){var n=Se();rt(t,e,134217728,n)}Ha(e,134217728)}};Od=function(e){if(e.tag===13){var t=Wt(e),n=St(e,t);if(n!==null){var s=Se();rt(n,e,t,s)}Ha(e,t)}};_d=function(){return V};Ad=function(e,t){var n=V;try{return V=e,t()}finally{V=n}};ao=function(e,t,n){switch(t){case"input":if(to(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var r=Hi(s);if(!r)throw Error(I(90));dd(s),to(s,r)}}}break;case"textarea":pd(e,n);break;case"select":t=n.value,t!=null&&Un(e,!!n.multiple,t,!1)}};wd=$a;bd=gn;var Ag={usingClientEntryPoint:!1,Events:[hr,On,Hi,xd,vd,$a]},Ns={findFiberByHostInstance:rn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Dg={bundleType:Ns.bundleType,version:Ns.version,rendererPackageName:Ns.rendererPackageName,rendererConfig:Ns.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Et.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Nd(e),e===null?null:e.stateNode},findFiberByHostInstance:Ns.findFiberByHostInstance||Og,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zr.isDisabled&&zr.supportsFiber)try{Fi=zr.inject(Dg),ft=zr}catch{}}ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ag;ze.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ka(t))throw Error(I(200));return Ig(e,t,null,n)};ze.createRoot=function(e,t){if(!Ka(e))throw Error(I(299));var n=!1,s="",r=sp;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=Ua(e,1,!1,null,null,n,!1,s,r),e[Nt]=t.current,Js(e.nodeType===8?e.parentNode:e),new Wa(t)};ze.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(I(188)):(e=Object.keys(e).join(","),Error(I(268,e)));return e=Nd(t),e=e===null?null:e.stateNode,e};ze.flushSync=function(e){return gn(e)};ze.hydrate=function(e,t,n){if(!Xi(t))throw Error(I(200));return Zi(null,e,t,!0,n)};ze.hydrateRoot=function(e,t,n){if(!Ka(e))throw Error(I(405));var s=n!=null&&n.hydratedSources||null,r=!1,i="",o=sp;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=np(t,null,e,1,n??null,r,!1,i,o),e[Nt]=t.current,Js(e),s)for(e=0;e<s.length;e++)n=s[e],r=n._getVersion,r=r(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,r]:t.mutableSourceEagerHydrationData.push(n,r);return new Ji(t)};ze.render=function(e,t,n){if(!Xi(t))throw Error(I(200));return Zi(null,e,t,!1,n)};ze.unmountComponentAtNode=function(e){if(!Xi(e))throw Error(I(40));return e._reactRootContainer?(gn(function(){Zi(null,null,e,!1,function(){e._reactRootContainer=null,e[Nt]=null})}),!0):!1};ze.unstable_batchedUpdates=$a;ze.unstable_renderSubtreeIntoContainer=function(e,t,n,s){if(!Xi(n))throw Error(I(200));if(e==null||e._reactInternals===void 0)throw Error(I(38));return Zi(e,t,n,!1,s)};ze.version="18.3.1-next-f1338f8080-20240426";function rp(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(rp)}catch(e){console.error(e)}}rp(),sd.exports=ze;var Rg=sd.exports,ip,yu=Rg;ip=yu.createRoot,yu.hydrateRoot;/**
41
- * @remix-run/router v1.23.3
42
- *
43
- * Copyright (c) Remix Software Inc.
44
- *
45
- * This source code is licensed under the MIT license found in the
46
- * LICENSE.md file in the root directory of this source tree.
47
- *
48
- * @license MIT
49
- */function lr(){return lr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},lr.apply(null,arguments)}var Mt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Mt||(Mt={}));const xu="popstate";function Mg(e){e===void 0&&(e={});function t(s,r){let{pathname:i,search:o,hash:a}=s.location;return Uo("",{pathname:i,search:o,hash:a},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function n(s,r){return typeof r=="string"?r:_i(r)}return Fg(t,n,null,e)}function ie(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Va(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function $g(){return Math.random().toString(36).substr(2,8)}function vu(e,t){return{usr:e.state,key:e.key,idx:t}}function Uo(e,t,n,s){return n===void 0&&(n=null),lr({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?cs(t):t,{state:n,key:t&&t.key||s||$g()})}function _i(e){let{pathname:t="/",search:n="",hash:s=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function cs(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substr(s),e=e.substr(0,s)),e&&(t.pathname=e)}return t}function Fg(e,t,n,s){s===void 0&&(s={});let{window:r=document.defaultView,v5Compat:i=!1}=s,o=r.history,a=Mt.Pop,c=null,u=p();u==null&&(u=0,o.replaceState(lr({},o.state,{idx:u}),""));function p(){return(o.state||{idx:null}).idx}function d(){a=Mt.Pop;let v=p(),g=v==null?null:v-u;u=v,c&&c({action:a,location:x.location,delta:g})}function f(v,g){a=Mt.Push;let m=Uo(x.location,v,g);u=p()+1;let h=vu(m,u),j=x.createHref(m);try{o.pushState(h,"",j)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;r.location.assign(j)}i&&c&&c({action:a,location:x.location,delta:1})}function y(v,g){a=Mt.Replace;let m=Uo(x.location,v,g);u=p();let h=vu(m,u),j=x.createHref(m);o.replaceState(h,"",j),i&&c&&c({action:a,location:x.location,delta:0})}function b(v){let g=r.location.origin!=="null"?r.location.origin:r.location.href,m=typeof v=="string"?v:_i(v);return m=m.replace(/ $/,"%20"),ie(g,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,g)}let x={get action(){return a},get location(){return e(r,o)},listen(v){if(c)throw new Error("A history only accepts one active listener");return r.addEventListener(xu,d),c=v,()=>{r.removeEventListener(xu,d),c=null}},createHref(v){return t(r,v)},createURL:b,encodeLocation(v){let g=b(v);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:f,replace:y,go(v){return o.go(v)}};return x}var wu;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(wu||(wu={}));function zg(e,t,n){return n===void 0&&(n="/"),Bg(e,t,n)}function Bg(e,t,n,s){let r=typeof t=="string"?cs(t):t,i=ss(r.pathname||"/",n);if(i==null)return null;let o=lp(e);Ug(o);let a=null,c=Zg(i);for(let u=0;a==null&&u<o.length;++u)a=Jg(o[u],c);return a}function lp(e,t,n,s){t===void 0&&(t=[]),n===void 0&&(n=[]),s===void 0&&(s="");let r=(i,o,a)=>{let c={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(ie(c.relativePath.startsWith(s),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(s.length));let u=Vt([s,c.relativePath]),p=n.concat(c);i.children&&i.children.length>0&&(ie(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),lp(i.children,t,p,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:qg(u,i.index),routesMeta:p})};return e.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))r(i,o);else for(let c of op(i.path))r(i,o,c)}),t}function op(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,r=n.endsWith("?"),i=n.replace(/\?$/,"");if(s.length===0)return r?[i,""]:[i];let o=op(s.join("/")),a=[];return a.push(...o.map(c=>c===""?i:[i,c].join("/"))),r&&a.push(...o),a.map(c=>e.startsWith("/")&&c===""?"/":c)}function Ug(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Qg(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}const Hg=/^:[\w-]+$/,Wg=3,Kg=2,Vg=1,Gg=10,Yg=-2,bu=e=>e==="*";function qg(e,t){let n=e.split("/"),s=n.length;return n.some(bu)&&(s+=Yg),t&&(s+=Kg),n.filter(r=>!bu(r)).reduce((r,i)=>r+(Hg.test(i)?Wg:i===""?Vg:Gg),s)}function Qg(e,t){return e.length===t.length&&e.slice(0,-1).every((s,r)=>s===t[r])?e[e.length-1]-t[t.length-1]:0}function Jg(e,t,n){let{routesMeta:s}=e,r={},i="/",o=[];for(let a=0;a<s.length;++a){let c=s[a],u=a===s.length-1,p=i==="/"?t:t.slice(i.length)||"/",d=Ho({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},p),f=c.route;if(!d)return null;Object.assign(r,d.params),o.push({params:r,pathname:Vt([i,d.pathname]),pathnameBase:ry(Vt([i,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(i=Vt([i,d.pathnameBase]))}return o}function Ho(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=Xg(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let i=r[0],o=i.replace(/(.)\/+$/,"$1"),a=r.slice(1);return{params:s.reduce((u,p,d)=>{let{paramName:f,isOptional:y}=p;if(f==="*"){let x=a[d]||"";o=i.slice(0,i.length-x.length).replace(/(.)\/+$/,"$1")}const b=a[d];return y&&!b?u[f]=void 0:u[f]=(b||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:e}}function Xg(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Va(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let s=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,c)=>(s.push({paramName:a,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(s.push({paramName:"*"}),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),s]}function Zg(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Va(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function ss(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}const ey=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ty=e=>ey.test(e);function ny(e,t){t===void 0&&(t="/");let{pathname:n,search:s="",hash:r=""}=typeof e=="string"?cs(e):e,i;if(n)if(ty(n))i=n;else{if(n.includes("//")){let o=n;n=up(n),Va(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=ju(n.substring(1),"/"):i=ju(n,t)}else i=t;return{pathname:i,search:iy(s),hash:ly(r)}}function ju(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function Fl(e,t,n,s){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(s)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function sy(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ap(e,t){let n=sy(e);return t?n.map((s,r)=>r===n.length-1?s.pathname:s.pathnameBase):n.map(s=>s.pathnameBase)}function cp(e,t,n,s){s===void 0&&(s=!1);let r;typeof e=="string"?r=cs(e):(r=lr({},e),ie(!r.pathname||!r.pathname.includes("?"),Fl("?","pathname","search",r)),ie(!r.pathname||!r.pathname.includes("#"),Fl("#","pathname","hash",r)),ie(!r.search||!r.search.includes("#"),Fl("#","search","hash",r)));let i=e===""||r.pathname==="",o=i?"/":r.pathname,a;if(o==null)a=n;else{let d=t.length-1;if(!s&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;r.pathname=f.join("/")}a=d>=0?t[d]:"/"}let c=ny(r,a),u=o&&o!=="/"&&o.endsWith("/"),p=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||p)&&(c.pathname+="/"),c}const up=e=>e.replace(/\/\/+/g,"/"),Vt=e=>up(e.join("/")),ry=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),iy=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ly=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function oy(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const dp=["post","put","patch","delete"];new Set(dp);const ay=["get",...dp];new Set(ay);/**
50
- * React Router v6.30.4
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
- */function or(){return or=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},or.apply(null,arguments)}const el=w.createContext(null),fp=w.createContext(null),Zt=w.createContext(null),tl=w.createContext(null),Tt=w.createContext({outlet:null,matches:[],isDataRoute:!1}),pp=w.createContext(null);function cy(e,t){let{relative:n}=t===void 0?{}:t;gr()||ie(!1);let{basename:s,navigator:r}=w.useContext(Zt),{hash:i,pathname:o,search:a}=nl(e,{relative:n}),c=o;return s!=="/"&&(c=o==="/"?s:Vt([s,o])),r.createHref({pathname:c,search:a,hash:i})}function gr(){return w.useContext(tl)!=null}function bn(){return gr()||ie(!1),w.useContext(tl).location}function hp(e){w.useContext(Zt).static||w.useLayoutEffect(e)}function uy(){let{isDataRoute:e}=w.useContext(Tt);return e?Cy():dy()}function dy(){gr()||ie(!1);let e=w.useContext(el),{basename:t,future:n,navigator:s}=w.useContext(Zt),{matches:r}=w.useContext(Tt),{pathname:i}=bn(),o=JSON.stringify(ap(r,n.v7_relativeSplatPath)),a=w.useRef(!1);return hp(()=>{a.current=!0}),w.useCallback(function(u,p){if(p===void 0&&(p={}),!a.current)return;if(typeof u=="number"){s.go(u);return}let d=cp(u,JSON.parse(o),i,p.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Vt([t,d.pathname])),(p.replace?s.replace:s.push)(d,p.state,p)},[t,s,o,i,e])}const fy=w.createContext(null);function py(e){let t=w.useContext(Tt).outlet;return t&&w.createElement(fy.Provider,{value:e},t)}function hy(){let{matches:e}=w.useContext(Tt),t=e[e.length-1];return t?t.params:{}}function nl(e,t){let{relative:n}=t===void 0?{}:t,{future:s}=w.useContext(Zt),{matches:r}=w.useContext(Tt),{pathname:i}=bn(),o=JSON.stringify(ap(r,s.v7_relativeSplatPath));return w.useMemo(()=>cp(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function my(e,t){return gy(e,t)}function gy(e,t,n,s){gr()||ie(!1);let{navigator:r}=w.useContext(Zt),{matches:i}=w.useContext(Tt),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=bn(),p;if(t){var d;let v=typeof t=="string"?cs(t):t;c==="/"||(d=v.pathname)!=null&&d.startsWith(c)||ie(!1),p=v}else p=u;let f=p.pathname||"/",y=f;if(c!=="/"){let v=c.replace(/^\//,"").split("/");y="/"+f.replace(/^\//,"").split("/").slice(v.length).join("/")}let b=zg(e,{pathname:y}),x=by(b&&b.map(v=>Object.assign({},v,{params:Object.assign({},a,v.params),pathname:Vt([c,r.encodeLocation?r.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:Vt([c,r.encodeLocation?r.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),i,n,s);return t&&x?w.createElement(tl.Provider,{value:{location:or({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:Mt.Pop}},x):x}function yy(){let e=Sy(),t=oy(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),n?w.createElement("pre",{style:r},n):null,null)}const xy=w.createElement(yy,null);class vy extends w.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?w.createElement(Tt.Provider,{value:this.props.routeContext},w.createElement(pp.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function wy(e){let{routeContext:t,match:n,children:s}=e,r=w.useContext(el);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),w.createElement(Tt.Provider,{value:t},s)}function by(e,t,n,s){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),s===void 0&&(s=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=s)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(r=n)==null?void 0:r.errors;if(a!=null){let p=o.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);p>=0||ie(!1),o=o.slice(0,Math.min(o.length,p+1))}let c=!1,u=-1;if(n&&s&&s.v7_partialHydration)for(let p=0;p<o.length;p++){let d=o[p];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=p),d.route.id){let{loaderData:f,errors:y}=n,b=d.route.loader&&f[d.route.id]===void 0&&(!y||y[d.route.id]===void 0);if(d.route.lazy||b){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((p,d,f)=>{let y,b=!1,x=null,v=null;n&&(y=a&&d.route.id?a[d.route.id]:void 0,x=d.route.errorElement||xy,c&&(u<0&&f===0?(Ey("route-fallback"),b=!0,v=null):u===f&&(b=!0,v=d.route.hydrateFallbackElement||null)));let g=t.concat(o.slice(0,f+1)),m=()=>{let h;return y?h=x:b?h=v:d.route.Component?h=w.createElement(d.route.Component,null):d.route.element?h=d.route.element:h=p,w.createElement(wy,{match:d,routeContext:{outlet:p,matches:g,isDataRoute:n!=null},children:h})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?w.createElement(vy,{location:n.location,revalidation:n.revalidation,component:x,error:y,children:m(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):m()},null)}var mp=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(mp||{}),gp=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(gp||{});function jy(e){let t=w.useContext(el);return t||ie(!1),t}function ky(e){let t=w.useContext(fp);return t||ie(!1),t}function Ny(e){let t=w.useContext(Tt);return t||ie(!1),t}function yp(e){let t=Ny(),n=t.matches[t.matches.length-1];return n.route.id||ie(!1),n.route.id}function Sy(){var e;let t=w.useContext(pp),n=ky(),s=yp();return t!==void 0?t:(e=n.errors)==null?void 0:e[s]}function Cy(){let{router:e}=jy(mp.UseNavigateStable),t=yp(gp.UseNavigateStable),n=w.useRef(!1);return hp(()=>{n.current=!0}),w.useCallback(function(r,i){i===void 0&&(i={}),n.current&&(typeof r=="number"?e.navigate(r):e.navigate(r,or({fromRouteId:t},i)))},[e,t])}const ku={};function Ey(e,t,n){ku[e]||(ku[e]=!0)}function Ty(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Ly(e){return py(e.context)}function we(e){ie(!1)}function Py(e){let{basename:t="/",children:n=null,location:s,navigationType:r=Mt.Pop,navigator:i,static:o=!1,future:a}=e;gr()&&ie(!1);let c=t.replace(/^\/*/,"/"),u=w.useMemo(()=>({basename:c,navigator:i,static:o,future:or({v7_relativeSplatPath:!1},a)}),[c,a,i,o]);typeof s=="string"&&(s=cs(s));let{pathname:p="/",search:d="",hash:f="",state:y=null,key:b="default"}=s,x=w.useMemo(()=>{let v=ss(p,c);return v==null?null:{location:{pathname:v,search:d,hash:f,state:y,key:b},navigationType:r}},[c,p,d,f,y,b,r]);return x==null?null:w.createElement(Zt.Provider,{value:u},w.createElement(tl.Provider,{children:n,value:x}))}function Iy(e){let{children:t,location:n}=e;return my(Wo(t),n)}new Promise(()=>{});function Wo(e,t){t===void 0&&(t=[]);let n=[];return w.Children.forEach(e,(s,r)=>{if(!w.isValidElement(s))return;let i=[...t,r];if(s.type===w.Fragment){n.push.apply(n,Wo(s.props.children,i));return}s.type!==we&&ie(!1),!s.props.index||!s.props.children||ie(!1);let o={id:s.props.id||i.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(o.children=Wo(s.props.children,i)),n.push(o)}),n}/**
59
- * React Router DOM v6.30.4
60
- *
61
- * Copyright (c) Remix Software Inc.
62
- *
63
- * This source code is licensed under the MIT license found in the
64
- * LICENSE.md file in the root directory of this source tree.
65
- *
66
- * @license MIT
67
- */function Ai(){return Ai=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Ai.apply(null,arguments)}function xp(e,t){if(e==null)return{};var n={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(t.indexOf(s)!==-1)continue;n[s]=e[s]}return n}function Oy(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function _y(e,t){return e.button===0&&(!t||t==="_self")&&!Oy(e)}const Ay=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Dy=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Ry="6";try{window.__reactRouterVersion=Ry}catch{}const My=w.createContext({isTransitioning:!1}),$y="startTransition",Nu=Sh[$y];function Fy(e){let{basename:t,children:n,future:s,window:r}=e,i=w.useRef();i.current==null&&(i.current=Mg({window:r,v5Compat:!0}));let o=i.current,[a,c]=w.useState({action:o.action,location:o.location}),{v7_startTransition:u}=s||{},p=w.useCallback(d=>{u&&Nu?Nu(()=>c(d)):c(d)},[c,u]);return w.useLayoutEffect(()=>o.listen(p),[o,p]),w.useEffect(()=>Ty(s),[s]),w.createElement(Py,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o,future:s})}const zy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",By=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yn=w.forwardRef(function(t,n){let{onClick:s,relative:r,reloadDocument:i,replace:o,state:a,target:c,to:u,preventScrollReset:p,viewTransition:d}=t,f=xp(t,Ay),{basename:y}=w.useContext(Zt),b,x=!1;if(typeof u=="string"&&By.test(u)&&(b=u,zy))try{let h=new URL(window.location.href),j=u.startsWith("//")?new URL(h.protocol+u):new URL(u),k=ss(j.pathname,y);j.origin===h.origin&&k!=null?u=k+j.search+j.hash:x=!0}catch{}let v=cy(u,{relative:r}),g=Hy(u,{replace:o,state:a,target:c,preventScrollReset:p,relative:r,viewTransition:d});function m(h){s&&s(h),h.defaultPrevented||g(h)}return w.createElement("a",Ai({},f,{href:b||v,onClick:x||i?s:m,ref:n,target:c}))}),at=w.forwardRef(function(t,n){let{"aria-current":s="page",caseSensitive:r=!1,className:i="",end:o=!1,style:a,to:c,viewTransition:u,children:p}=t,d=xp(t,Dy),f=nl(c,{relative:d.relative}),y=bn(),b=w.useContext(fp),{navigator:x,basename:v}=w.useContext(Zt),g=b!=null&&Wy(f)&&u===!0,m=x.encodeLocation?x.encodeLocation(f).pathname:f.pathname,h=y.pathname,j=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;r||(h=h.toLowerCase(),j=j?j.toLowerCase():null,m=m.toLowerCase()),j&&v&&(j=ss(j,v)||j);const k=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let E=h===m||!o&&h.startsWith(m)&&h.charAt(k)==="/",N=j!=null&&(j===m||!o&&j.startsWith(m)&&j.charAt(m.length)==="/"),S={isActive:E,isPending:N,isTransitioning:g},T=E?s:void 0,P;typeof i=="function"?P=i(S):P=[i,E?"active":null,N?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let B=typeof a=="function"?a(S):a;return w.createElement(yn,Ai({},d,{"aria-current":T,className:P,ref:n,style:B,to:c,viewTransition:u}),typeof p=="function"?p(S):p)});var Ko;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ko||(Ko={}));var Su;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Su||(Su={}));function Uy(e){let t=w.useContext(el);return t||ie(!1),t}function Hy(e,t){let{target:n,replace:s,state:r,preventScrollReset:i,relative:o,viewTransition:a}=t===void 0?{}:t,c=uy(),u=bn(),p=nl(e,{relative:o});return w.useCallback(d=>{if(_y(d,n)){d.preventDefault();let f=s!==void 0?s:_i(u)===_i(p);c(e,{replace:f,state:r,preventScrollReset:i,relative:o,viewTransition:a})}},[u,c,p,s,r,n,e,i,o,a])}function Wy(e,t){t===void 0&&(t={});let n=w.useContext(My);n==null&&ie(!1);let{basename:s}=Uy(Ko.useViewTransitionState),r=nl(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=ss(n.currentLocation.pathname,s)||n.currentLocation.pathname,o=ss(n.nextLocation.pathname,s)||n.nextLocation.pathname;return Ho(r.pathname,o)!=null||Ho(r.pathname,i)!=null}function Ky(e){const[t,n]=w.useState(null),s=w.useRef(0),r=w.useCallback(()=>{if(e.length===0){n(null);return}let i=e[0];for(const o of e){const a=document.getElementById(o);a&&a.getBoundingClientRect().top<=100&&(i=o)}n(i)},[e]);return w.useEffect(()=>{if(e.length===0)return;r();const i=()=>{cancelAnimationFrame(s.current),s.current=requestAnimationFrame(r)};return window.addEventListener("scroll",i,{passive:!0}),()=>{window.removeEventListener("scroll",i),cancelAnimationFrame(s.current)}},[r,e]),t}async function se(e,t,n){const s={method:e};n&&(s.headers={"Content-Type":"application/json"},s.body=JSON.stringify(n));const r=await fetch(t,s),i=await r.json();if(!r.ok)throw new Error(i.error??`HTTP ${r.status}`);return i}const F={getStatus:()=>se("GET","/api/status"),getConnectors:()=>se("GET","/api/connectors"),getConnector:(e,t)=>se("GET",`/api/connectors/${e}/${t}`),run:(e,t)=>se("POST","/api/run",{connector:e,args:t}),approve:(e,t)=>se("POST","/api/approval",{approvalId:e,approved:t}),getAudit:e=>{const t=new URLSearchParams(e).toString();return se("GET",`/api/audit${t?`?${t}`:""}`)},getAuditEvent:e=>se("GET",`/api/audit/${e}`),getConfig:()=>se("GET","/api/config"),setConfig:(e,t)=>se("POST","/api/config",{key:e,value:t}),getPreferences:()=>se("GET","/api/preferences"),setPreference:(e,t)=>se("PUT","/api/preferences",{key:e,value:t}),getGoals:e=>se("GET",`/api/goals?month=${e}`),upsertGoal:e=>se("POST","/api/goals",e),deleteGoal:e=>se("DELETE",`/api/goals/${e}`),getCachedReport:e=>se("GET",`/api/timetracking/cache?month=${e}`),cacheReport:(e,t)=>se("POST","/api/timetracking/cache",{month:e,data:t}),getCachedProjects:()=>se("GET","/api/timetracking/projects"),cacheProjects:e=>se("POST","/api/timetracking/projects",{data:e}),generateJournal:e=>se("POST","/api/journal/generate",e),getCachedSecurityNews:()=>se("GET","/api/security-news/cache"),cacheSecurityNews:e=>se("POST","/api/security-news/cache",{data:e}),getSkills:()=>se("GET","/api/skills")};function sl(e){const t=new Map;for(const n of e){const s=n.key.split("/")[0],r=t.get(s)??[];r.push(n),t.set(s,r)}return[...t.entries()]}const vp={"command.success":"success","command.error":"error","command.denied":"error","command.start":"neutral","auth.failed":"warning","approval.granted":"success","approval.rejected":"error","config.changed":"neutral"},Vy={success:"border-emerald-500 text-emerald-600 dark:text-emerald-400",error:"border-red-500 text-red-600 dark:text-red-400",warning:"border-amber-500 text-amber-600 dark:text-amber-400",info:"border-sky-500 text-sky-600 dark:text-sky-400",secondary:"border-violet-500 text-violet-600 dark:text-violet-400",neutral:"border-base-300 text-base-content/60"},Gy={sm:"px-2 py-0.5 text-xs",xs:"px-1.5 py-px text-[0.65rem]"};function W({variant:e="neutral",size:t="sm",className:n="",children:s}){return l.jsx("span",{className:`inline-flex items-center font-mono font-medium border ${Gy[t]} ${Vy[e]} ${n}`,children:s})}function Yy(){const[e,t]=w.useState(null),[n,s]=w.useState([]),r=w.useCallback(()=>{F.getStatus().then(t).catch(()=>t(null)),F.getAudit({limit:"10"}).then(o=>s(o.events)).catch(()=>{})},[]);w.useEffect(()=>{r();const o=setInterval(r,3e4);return()=>clearInterval(o)},[r]);function i(o){const a=Date.now()-new Date(o).getTime(),c=Math.floor(a/6e4);if(c<1)return"just now";if(c<60)return`${c} min ago`;const u=Math.floor(c/60);return u<24?`${u} hr ago`:`${Math.floor(u/24)}d ago`}return l.jsxs("div",{className:"max-w-4xl mx-auto",children:[l.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Dashboard"}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 border border-base-300 mb-8",children:[l.jsxs("div",{className:"p-3 sm:border-r sm:border-r-base-300",children:[l.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Daemon"}),l.jsx("div",{className:`font-display font-semibold text-sm ${e!=null&&e.ok?"text-success":"text-error"}`,children:e!=null&&e.ok?"Running":"Offline"})]}),l.jsxs("div",{className:"p-3 border-t border-t-base-300 sm:border-t-0 sm:border-r sm:border-r-base-300",children:[l.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Extension"}),l.jsx("div",{className:`font-display font-semibold text-sm ${e!=null&&e.extensionConnected?"text-success":"text-error"}`,children:e!=null&&e.extensionConnected?"Connected":"Disconnected"})]}),l.jsxs("div",{className:"p-3 border-t border-t-base-300 sm:border-t-0",children:[l.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Connectors"}),l.jsxs("div",{className:"font-display font-semibold text-sm",children:[(e==null?void 0:e.connectorCount)??0," loaded"]})]})]}),l.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Recent activity"}),n.length===0?l.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[l.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No recent activity"}),l.jsx("p",{className:"font-mono text-xs opacity-30",children:"Run a connector to see events here."})]}):l.jsx("div",{className:"overflow-x-auto border border-base-300",children:l.jsxs("table",{className:"table table-sm w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"bg-base-200",children:[l.jsx("th",{children:"Time"}),l.jsx("th",{children:"Connector"}),l.jsx("th",{children:"Type"}),l.jsx("th",{children:"Duration"})]})}),l.jsx("tbody",{children:n.map(o=>l.jsxs("tr",{className:"hover:bg-base-200",children:[l.jsx("td",{className:"opacity-50 text-sm font-mono",children:i(o.timestamp)}),l.jsx("td",{className:"font-mono text-sm",children:o.connector}),l.jsx("td",{children:l.jsx(W,{variant:vp[o.type]??"neutral",children:o.type})}),l.jsx("td",{className:"text-sm font-mono",children:o.durationMs?`${(o.durationMs/1e3).toFixed(1)}s`:"—"})]},o.id))})]})})]})}function ht({label:e}){return l.jsxs("div",{className:"flex items-center gap-3 py-4",children:[l.jsx("span",{className:"loading loading-spinner loading-md"}),e&&l.jsx("span",{className:"text-sm opacity-60",children:e})]})}function qy({c:e,approvingKey:t,onApprove:n}){const[s,r]=e.key.split("/");return l.jsxs("div",{className:"border border-base-300/50 p-3 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2",children:[l.jsxs("div",{className:"flex-1",children:[l.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[l.jsx("span",{className:"font-mono font-semibold text-sm",children:r}),l.jsx(W,{size:"sm",children:e.access}),e.capabilities.map(i=>l.jsx(W,{size:"sm",children:i},i)),e.isHighRisk&&e.isApproved&&l.jsx(W,{variant:"success",size:"sm",children:"Approved"}),e.isHighRisk&&!e.isApproved&&l.jsx(W,{variant:"warning",size:"sm",children:"Blocked — requires approval"})]}),l.jsx("p",{className:"text-sm opacity-60 mt-1",children:e.description}),e.domains.length>0&&l.jsxs("div",{className:"text-xs opacity-40 mt-1",children:["Domains: ",e.domains.join(", ")]})]}),l.jsxs("div",{className:"flex gap-2 ml-4 shrink-0",children:[e.isHighRisk&&!e.isApproved&&l.jsx("button",{className:"btn btn-sm btn-warning btn-outline",disabled:t===e.key,onClick:()=>n(e.key),children:t===e.key?"Approving...":"Approve"}),e.hasAppPage&&e.appRoute&&l.jsx(yn,{to:e.appRoute,className:"btn btn-sm btn-primary",children:"Open App"}),l.jsx(yn,{to:`/connectors/${s}/${r}`,className:"btn btn-sm btn-ghost",children:"Run"})]})]})}function Qy({site:e,connectors:t,approvingKey:n,onApprove:s}){const[r,i]=w.useState(!1);return l.jsxs("div",{id:`conn-${e}`,className:"border border-base-300 p-4 scroll-mt-4",children:[l.jsxs("button",{className:"flex items-center gap-2 w-full text-left",onClick:()=>i(!r),children:[l.jsx("span",{className:"text-xs opacity-50",children:r?"▸":"▾"}),l.jsx("span",{className:"font-mono font-semibold",children:e}),l.jsxs("span",{className:"text-xs opacity-40",children:[t.length," ",t.length===1?"connector":"connectors"]})]}),!r&&l.jsx("div",{className:"space-y-2 mt-3",children:t.map(o=>l.jsx(qy,{c:o,approvingKey:n,onApprove:s},o.key))})]})}function Jy(){const[e,t]=w.useState([]),[n,s]=w.useState([]),[r,i]=w.useState(!0),[o,a]=w.useState(null),c=w.useCallback(()=>{const d=F.getConnectors(),f=F.getConfig().catch(()=>({ok:!1,config:{}}));Promise.all([d,f]).then(([y,b])=>{t(y.connectors);const x=b.config.security??{};s(x.approvedHighRisk??[])}).catch(()=>{}).finally(()=>i(!1))},[]);w.useEffect(()=>{c()},[c]);const u=w.useCallback(async d=>{a(d);try{const f=[...n,d];await F.setConfig("security.approvedHighRisk",JSON.stringify(f)),c()}catch{}finally{a(null)}},[n,c]),p=w.useMemo(()=>sl(e),[e]);return r?l.jsx(ht,{label:"Loading connectors..."}):l.jsxs("div",{className:"max-w-4xl mx-auto",children:[l.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Connectors"}),e.length===0?l.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[l.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No connectors loaded"}),l.jsx("p",{className:"font-mono text-xs opacity-30",children:"Check the daemon is running and connectors are installed in ~/.commandgarden/connectors/"})]}):l.jsx("div",{className:"space-y-3",children:p.map(([d,f])=>l.jsx(Qy,{site:d,connectors:f,approvingKey:o,onApprove:u},d))})]})}function Ga(){const[e,t]=w.useState(!1),[n,s]=w.useState(null),[r,i]=w.useState(null),[o,a]=w.useState(!1),[c,u]=w.useState(null),p=w.useCallback(()=>{t(!1),s(null),i(null),a(!1),u(null)},[]),d=w.useCallback(async(y,b)=>{t(!0),i(null),s(null),a(!1),u(null);try{const x=await F.run(y,b);if(x.requiresApproval&&x.requestId){a(!0);const v=new EventSource(`/api/run/events/${x.requestId}`);v.addEventListener("approval",g=>{const m=JSON.parse(g.data);u(m.approvalId)}),v.addEventListener("result",g=>{const m=JSON.parse(g.data);!m.ok&&m.error?i(m.error):s(m),a(!1),t(!1),v.close()}),v.onerror=()=>{i("SSE connection lost"),a(!1),t(!1),v.close()}}else!x.ok&&x.error?(i(x.error),t(!1)):(s(x),t(!1))}catch(x){i(x instanceof Error?x.message:"Unknown error"),t(!1)}},[]),f=w.useCallback(async y=>{if(c)try{await F.approve(c,y),y||(a(!1),t(!1),i("Approval rejected"))}catch(b){i(b instanceof Error?b.message:"Approval failed")}},[c]);return{running:e,result:n,error:r,approvalPending:o,approvalId:c,run:d,handleApproval:f,reset:p}}function Xy(){const{site:e,name:t}=hy(),n=`${e}/${t}`,[s,r]=w.useState(null),[i,o]=w.useState(!0),[a,c]=w.useState({}),[u,p]=w.useState(null),{running:d,result:f,error:y,approvalPending:b,approvalId:x,run:v,handleApproval:g}=Ga();w.useEffect(()=>{!e||!t||F.getConnector(e,t).then(h=>{r(h.connector);const j={};for(const k of h.connector.args??[])j[k.name]="";c(j)}).catch(h=>p(h.message)).finally(()=>o(!1))},[e,t]);const m=w.useCallback(async()=>{const h={};for(const[j,k]of Object.entries(a))k&&(h[j]=k);await v(n,h)},[a,n,v]);return i?l.jsx(ht,{label:"Loading connector..."}):s?l.jsxs("div",{className:"max-w-4xl mx-auto",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(yn,{to:"/connectors",className:"text-sm opacity-50 hover:opacity-80",children:"Connectors"}),l.jsx("span",{className:"text-sm opacity-30",children:"/"})]}),l.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-2",children:n}),l.jsx("p",{className:"text-sm opacity-50 mb-5",children:s.description}),l.jsxs("div",{className:"border border-base-300 p-5 mb-6",children:[l.jsx("h3",{className:"font-display font-semibold mb-4",children:"Arguments"}),l.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[(s.args??[]).map(h=>l.jsxs("label",{className:"form-control",children:[l.jsxs("span",{className:"label-text mb-1 text-sm",children:[h.name,!h.required&&l.jsx("span",{className:"opacity-40",children:" (optional)"})]}),l.jsx("input",{type:"text",className:"input input-bordered input-sm w-40",placeholder:h.help,value:a[h.name]??"",onChange:j=>c(k=>({...k,[h.name]:j.target.value})),pattern:h.pattern}),h.help&&l.jsx("span",{className:"text-xs opacity-40 mt-1",children:h.help})]},h.name)),l.jsx("button",{className:"btn btn-primary btn-sm",onClick:m,disabled:d,children:d?"Running...":"Run connector"})]})]}),d&&!b&&l.jsx(ht,{label:`Running ${n} — this drives your browser and may take up to a minute.`}),b&&l.jsxs("div",{className:"alert alert-warning mb-4",children:[l.jsx("span",{children:"This connector requires approval before proceeding."}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>g(!0),disabled:!x,children:"Approve"}),l.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>g(!1),disabled:!x,children:"Reject"})]})]}),y&&l.jsx("div",{className:"alert alert-error mb-4",children:l.jsx("span",{children:y})}),f&&l.jsxs("div",{className:"border border-base-300 p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsx("h3",{className:"font-semibold",children:"Results"}),l.jsxs("div",{className:"text-xs opacity-40",children:[f.rowCount??f.data.length," rows",f.durationMs?` · ${(f.durationMs/1e3).toFixed(1)}s`:""]})]}),f.data.length===0?l.jsx("p",{className:"text-sm opacity-50",children:"No results returned."}):l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"table table-sm",children:[l.jsx("thead",{children:l.jsx("tr",{children:(f.columns??Object.keys(f.data[0])).map(h=>l.jsx("th",{children:h},h))})}),l.jsx("tbody",{children:f.data.map((h,j)=>l.jsx("tr",{children:(f.columns??Object.keys(h)).map(k=>l.jsx("td",{className:"text-sm",children:String(h[k]??"")},k))},j))})]})})]})]}):l.jsx("div",{className:"text-error",children:u??`Connector not found: ${n}`})}const Zy=[{label:"Last 24 hours",hours:24},{label:"Last 7 days",hours:168},{label:"Last 30 days",hours:720},{label:"Last 90 days",hours:2160}],e0=["command.start","command.success","command.error","command.denied","auth.failed","approval.granted","approval.rejected","config.changed"],kn=20;function t0(){const[e,t]=w.useState([]),[n,s]=w.useState([]),[r,i]=w.useState(!0),[o,a]=w.useState(168),[c,u]=w.useState(""),[p,d]=w.useState(""),[f,y]=w.useState(null),[b,x]=w.useState(0);w.useEffect(()=>{F.getConnectors().then(h=>s(h.connectors)).catch(()=>{})},[]);const v=w.useCallback(()=>{i(!0);const h={since:new Date(Date.now()-o*36e5).toISOString(),limit:String(kn+b+1)};c&&(h.type=c),p&&(h.connector=p),F.getAudit(h).then(j=>t(j.events)).catch(()=>{}).finally(()=>i(!1))},[o,c,p,b]);w.useEffect(()=>{v();const h=setInterval(v,6e4);return()=>clearInterval(h)},[v]);const g=e.slice(b,b+kn),m=e.length>b+kn;return l.jsxs("div",{className:"max-w-5xl mx-auto",children:[l.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Audit Log"}),l.jsxs("div",{className:"flex flex-wrap items-end gap-3 mb-6",children:[l.jsxs("label",{className:"form-control",children:[l.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Time range"}),l.jsx("select",{className:"select select-bordered select-sm",value:o,onChange:h=>{a(Number(h.target.value)),x(0)},children:Zy.map(h=>l.jsx("option",{value:h.hours,children:h.label},h.hours))})]}),l.jsxs("label",{className:"form-control",children:[l.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Event type"}),l.jsxs("select",{className:"select select-bordered select-sm",value:c,onChange:h=>{u(h.target.value),x(0)},children:[l.jsx("option",{value:"",children:"All types"}),e0.map(h=>l.jsx("option",{value:h,children:h},h))]})]}),l.jsxs("label",{className:"form-control",children:[l.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Connector"}),l.jsxs("select",{className:"select select-bordered select-sm",value:p,onChange:h=>{d(h.target.value),x(0)},children:[l.jsx("option",{value:"",children:"All connectors"}),n.map(h=>l.jsx("option",{value:h.key,children:h.key},h.key))]})]})]}),r&&e.length===0?l.jsx(ht,{label:"Loading audit events..."}):l.jsxs(l.Fragment,{children:[g.length===0?l.jsx("p",{className:"text-sm opacity-50",children:"No events match the current filters."}):l.jsx("div",{className:"overflow-x-auto border border-base-300",children:l.jsxs("table",{className:"table table-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Time"}),l.jsx("th",{children:"Type"}),l.jsx("th",{children:"Connector"}),l.jsx("th",{children:"User"}),l.jsx("th",{children:"Duration"}),l.jsx("th",{})]})}),l.jsx("tbody",{children:g.map(h=>l.jsxs(w.Fragment,{children:[l.jsxs("tr",{className:"cursor-pointer hover:bg-base-200",onClick:()=>y(f===h.id?null:h.id),role:"button","aria-expanded":f===h.id,tabIndex:0,onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),y(f===h.id?null:h.id))},children:[l.jsx("td",{className:"text-sm font-mono",children:new Date(h.timestamp).toLocaleString()}),l.jsx("td",{children:l.jsx(W,{variant:vp[h.type]??"neutral",children:h.type})}),l.jsx("td",{className:"font-mono text-sm",children:h.connector||"—"}),l.jsx("td",{className:"text-sm",children:h.user}),l.jsx("td",{className:"text-sm font-mono",children:h.durationMs?`${(h.durationMs/1e3).toFixed(1)}s`:"—"}),l.jsx("td",{className:"text-xs opacity-40","aria-hidden":"true",children:f===h.id?"▲":"▼"})]},h.id),f===h.id&&l.jsx("tr",{children:l.jsxs("td",{colSpan:6,className:"bg-base-200/50 p-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm mb-3",children:[l.jsxs("div",{children:[l.jsx("span",{className:"opacity-50",children:"ID:"})," ",l.jsx("span",{className:"font-mono text-xs",children:h.id})]}),l.jsxs("div",{children:[l.jsx("span",{className:"opacity-50",children:"Correlation:"})," ",l.jsx("span",{className:"font-mono text-xs",children:h.correlationId??"—"})]}),h.connectorHash&&l.jsxs("div",{children:[l.jsx("span",{className:"opacity-50",children:"Connector hash:"})," ",l.jsx("span",{className:"font-mono text-xs",children:h.connectorHash})]}),h.error&&l.jsxs("div",{className:"col-span-2",children:[l.jsx("span",{className:"opacity-50",children:"Error:"})," ",l.jsx("span",{className:"text-error",children:h.error})]}),h.args&&l.jsxs("div",{className:"col-span-2",children:[l.jsx("span",{className:"opacity-50",children:"Args:"})," ",l.jsx("span",{className:"font-mono text-xs",children:JSON.stringify(h.args)})]}),h.domains&&h.domains.length>0&&l.jsxs("div",{children:[l.jsx("span",{className:"opacity-50",children:"Domains:"})," ",h.domains.join(", ")]}),h.capabilities&&h.capabilities.length>0&&l.jsxs("div",{children:[l.jsx("span",{className:"opacity-50",children:"Capabilities:"})," ",h.capabilities.join(", ")]})]}),h.steps&&h.steps.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("h4",{className:"font-semibold text-sm mb-2",children:"Pipeline steps"}),l.jsxs("table",{className:"table table-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"#"}),l.jsx("th",{children:"Step"}),l.jsx("th",{children:"Capability"}),l.jsx("th",{children:"Duration"}),l.jsx("th",{children:"Error"})]})}),l.jsx("tbody",{children:h.steps.map((j,k)=>l.jsxs("tr",{children:[l.jsx("td",{children:k+1}),l.jsx("td",{children:j.step}),l.jsx("td",{children:j.capability}),l.jsxs("td",{children:[(j.durationMs/1e3).toFixed(2),"s"]}),l.jsx("td",{className:"text-error",children:j.error??""})]},k))})]})]})]})},`${h.id}-detail`)]},h.id))})]})}),l.jsxs("div",{className:"flex justify-between items-center mt-4",children:[l.jsx("button",{className:"btn btn-sm btn-ghost",disabled:b===0,onClick:()=>x(Math.max(0,b-kn)),children:"Previous"}),l.jsxs("span",{className:"text-sm opacity-50",children:["Showing ",b+1,"–",Math.min(b+kn,e.length),m?"":` of ${e.length}`]}),l.jsx("button",{className:"btn btn-sm btn-ghost",disabled:!m,onClick:()=>x(b+kn),children:"Next"})]})]})]})}const Ya=Symbol.for("yaml.alias"),Vo=Symbol.for("yaml.document"),Gt=Symbol.for("yaml.map"),wp=Symbol.for("yaml.pair"),mt=Symbol.for("yaml.scalar"),us=Symbol.for("yaml.seq"),Qe=Symbol.for("yaml.node.type"),ds=e=>!!e&&typeof e=="object"&&e[Qe]===Ya,yr=e=>!!e&&typeof e=="object"&&e[Qe]===Vo,xr=e=>!!e&&typeof e=="object"&&e[Qe]===Gt,ce=e=>!!e&&typeof e=="object"&&e[Qe]===wp,q=e=>!!e&&typeof e=="object"&&e[Qe]===mt,vr=e=>!!e&&typeof e=="object"&&e[Qe]===us;function oe(e){if(e&&typeof e=="object")switch(e[Qe]){case Gt:case us:return!0}return!1}function ae(e){if(e&&typeof e=="object")switch(e[Qe]){case Ya:case Gt:case mt:case us:return!0}return!1}const bp=e=>(q(e)||oe(e))&&!!e.anchor,sn=Symbol("break visit"),n0=Symbol("skip children"),Bs=Symbol("remove node");function fs(e,t){const n=s0(t);yr(e)?Fn(null,e.contents,n,Object.freeze([e]))===Bs&&(e.contents=null):Fn(null,e,n,Object.freeze([]))}fs.BREAK=sn;fs.SKIP=n0;fs.REMOVE=Bs;function Fn(e,t,n,s){const r=r0(e,t,n,s);if(ae(r)||ce(r))return i0(e,s,r),Fn(e,r,n,s);if(typeof r!="symbol"){if(oe(t)){s=Object.freeze(s.concat(t));for(let i=0;i<t.items.length;++i){const o=Fn(i,t.items[i],n,s);if(typeof o=="number")i=o-1;else{if(o===sn)return sn;o===Bs&&(t.items.splice(i,1),i-=1)}}}else if(ce(t)){s=Object.freeze(s.concat(t));const i=Fn("key",t.key,n,s);if(i===sn)return sn;i===Bs&&(t.key=null);const o=Fn("value",t.value,n,s);if(o===sn)return sn;o===Bs&&(t.value=null)}}return r}function s0(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function r0(e,t,n,s){var r,i,o,a,c;if(typeof n=="function")return n(e,t,s);if(xr(t))return(r=n.Map)==null?void 0:r.call(n,e,t,s);if(vr(t))return(i=n.Seq)==null?void 0:i.call(n,e,t,s);if(ce(t))return(o=n.Pair)==null?void 0:o.call(n,e,t,s);if(q(t))return(a=n.Scalar)==null?void 0:a.call(n,e,t,s);if(ds(t))return(c=n.Alias)==null?void 0:c.call(n,e,t,s)}function i0(e,t,n){const s=t[t.length-1];if(oe(s))s.items[e]=n;else if(ce(s))e==="key"?s.key=n:s.value=n;else if(yr(s))s.contents=n;else{const r=ds(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const l0={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},o0=e=>e.replace(/[!,[\]{}]/g,t=>l0[t]);class Ne{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Ne.defaultYaml,t),this.tags=Object.assign({},Ne.defaultTags,n)}clone(){const t=new Ne(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Ne(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Ne.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Ne.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Ne.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Ne.defaultTags),this.atNextDocument=!1);const s=t.trim().split(/[ \t]+/),r=s.shift();switch(r){case"%TAG":{if(s.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[i,o]=s;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[i]=s;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{const o=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,s,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);const i=this.tags[s];if(i)try{return i+decodeURIComponent(r)}catch(o){return n(String(o)),null}return s==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,s]of Object.entries(this.tags))if(t.startsWith(s))return n+o0(t.substring(s.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let r;if(t&&s.length>0&&ae(t.contents)){const i={};fs(t.contents,(o,a)=>{ae(a)&&a.tag&&(i[a.tag]=!0)}),r=Object.keys(i)}else r=[];for(const[i,o]of s)i==="!!"&&o==="tag:yaml.org,2002:"||(!t||r.some(a=>a.startsWith(o)))&&n.push(`%TAG ${i} ${o}`);return n.join(`
68
- `)}}Ne.defaultYaml={explicit:!1,version:"1.2"};Ne.defaultTags={"!!":"tag:yaml.org,2002:"};function jp(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function kp(e){const t=new Set;return fs(e,{Value(n,s){s.anchor&&t.add(s.anchor)}}),t}function Np(e,t){for(let n=1;;++n){const s=`${e}${n}`;if(!t.has(s))return s}}function a0(e,t){const n=[],s=new Map;let r=null;return{onAnchor:i=>{n.push(i),r??(r=kp(e));const o=Np(t,r);return r.add(o),o},setAnchors:()=>{for(const i of n){const o=s.get(i);if(typeof o=="object"&&o.anchor&&(q(o.node)||oe(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},sourceObjects:s}}function zn(e,t,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let r=0,i=s.length;r<i;++r){const o=s[r],a=zn(e,s,String(r),o);a===void 0?delete s[r]:a!==o&&(s[r]=a)}else if(s instanceof Map)for(const r of Array.from(s.keys())){const i=s.get(r),o=zn(e,s,r,i);o===void 0?s.delete(r):o!==i&&s.set(r,o)}else if(s instanceof Set)for(const r of Array.from(s)){const i=zn(e,s,r,r);i===void 0?s.delete(r):i!==r&&(s.delete(r),s.add(i))}else for(const[r,i]of Object.entries(s)){const o=zn(e,s,r,i);o===void 0?delete s[r]:o!==i&&(s[r]=o)}return e.call(t,n,s)}function Ge(e,t,n){if(Array.isArray(e))return e.map((s,r)=>Ge(s,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!bp(e))return e.toJSON(t,n);const s={aliasCount:0,count:1,res:void 0};n.anchors.set(e,s),n.onCreate=i=>{s.res=i,delete n.onCreate};const r=e.toJSON(t,n);return n.onCreate&&n.onCreate(r),r}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class qa{constructor(t){Object.defineProperty(this,Qe,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:s,onAnchor:r,reviver:i}={}){if(!yr(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},a=Ge(this,"",o);if(typeof r=="function")for(const{count:c,res:u}of o.anchors.values())r(u,c);return typeof i=="function"?zn(i,{"":a},"",a):a}}class Qa extends qa{constructor(t){super(Ya),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let s;n!=null&&n.aliasResolveCache?s=n.aliasResolveCache:(s=[],fs(t,{Node:(i,o)=>{(ds(o)||bp(o))&&s.push(o)}}),n&&(n.aliasResolveCache=s));let r;for(const i of s){if(i===this)break;i.anchor===this.source&&(r=i)}return r}toJSON(t,n){if(!n)return{source:this.source};const{anchors:s,doc:r,maxAliasCount:i}=n,o=this.resolve(r,n);if(!o){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=s.get(o);if(a||(Ge(o,null,n),a=s.get(o)),(a==null?void 0:a.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=li(r,o,s)),a.count*a.aliasCount>i)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(t,n,s){const r=`*${this.source}`;if(t){if(jp(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(t.implicitKey)return`${r} `}return r}}function li(e,t,n){if(ds(t)){const s=t.resolve(e),r=n&&s&&n.get(s);return r?r.count*r.aliasCount:0}else if(oe(t)){let s=0;for(const r of t.items){const i=li(e,r,n);i>s&&(s=i)}return s}else if(ce(t)){const s=li(e,t.key,n),r=li(e,t.value,n);return Math.max(s,r)}return 1}const Sp=e=>!e||typeof e!="function"&&typeof e!="object";class z extends qa{constructor(t){super(mt),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Ge(this.value,t,n)}toString(){return String(this.value)}}z.BLOCK_FOLDED="BLOCK_FOLDED";z.BLOCK_LITERAL="BLOCK_LITERAL";z.PLAIN="PLAIN";z.QUOTE_DOUBLE="QUOTE_DOUBLE";z.QUOTE_SINGLE="QUOTE_SINGLE";const c0="tag:yaml.org,2002:";function u0(e,t,n){if(t){const s=n.filter(i=>i.tag===t),r=s.find(i=>!i.format)??s[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(s=>{var r;return((r=s.identify)==null?void 0:r.call(s,e))&&!s.format})}function ar(e,t,n){var d,f,y;if(yr(e)&&(e=e.contents),ae(e))return e;if(ce(e)){const b=(f=(d=n.schema[Gt]).createNode)==null?void 0:f.call(d,n.schema,null,n);return b.items.push(e),b}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:s,onAnchor:r,onTagObj:i,schema:o,sourceObjects:a}=n;let c;if(s&&e&&typeof e=="object"){if(c=a.get(e),c)return c.anchor??(c.anchor=r(e)),new Qa(c.anchor);c={anchor:null,node:null},a.set(e,c)}t!=null&&t.startsWith("!!")&&(t=c0+t.slice(2));let u=u0(e,t,o.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const b=new z(e);return c&&(c.node=b),b}u=e instanceof Map?o[Gt]:Symbol.iterator in Object(e)?o[us]:o[Gt]}i&&(i(u),delete n.onTagObj);const p=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((y=u==null?void 0:u.nodeClass)==null?void 0:y.from)=="function"?u.nodeClass.from(n.schema,e,n):new z(e);return t?p.tag=t:u.default||(p.tag=u.tag),c&&(c.node=p),p}function Di(e,t,n){let s=n;for(let r=t.length-1;r>=0;--r){const i=t[r];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){const o=[];o[i]=s,s=o}else s=new Map([[i,s]])}return ar(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Ps=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class Cp extends qa{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(s=>ae(s)||ce(s)?s.clone(t):s),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Ps(t))this.add(n);else{const[s,...r]=t,i=this.get(s,!0);if(oe(i))i.addIn(r,n);else if(i===void 0&&this.schema)this.set(s,Di(this.schema,r,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}deleteIn(t){const[n,...s]=t;if(s.length===0)return this.delete(n);const r=this.get(n,!0);if(oe(r))return r.deleteIn(s);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}getIn(t,n){const[s,...r]=t,i=this.get(s,!0);return r.length===0?!n&&q(i)?i.value:i:oe(i)?i.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!ce(n))return!1;const s=n.value;return s==null||t&&q(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(t){const[n,...s]=t;if(s.length===0)return this.has(n);const r=this.get(n,!0);return oe(r)?r.hasIn(s):!1}setIn(t,n){const[s,...r]=t;if(r.length===0)this.set(s,n);else{const i=this.get(s,!0);if(oe(i))i.setIn(r,n);else if(i===void 0&&this.schema)this.set(s,Di(this.schema,r,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}}const d0=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function wt(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const an=(e,t,n)=>e.endsWith(`
69
- `)?wt(n,t):n.includes(`
70
- `)?`
71
- `+wt(n,t):(e.endsWith(" ")?"":" ")+n,Ep="flow",Go="block",oi="quoted";function rl(e,t,n="flow",{indentAtStart:s,lineWidth:r=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!r||r<0)return e;r<i&&(i=0);const c=Math.max(1+i,1+r-t.length);if(e.length<=c)return e;const u=[],p={};let d=r-t.length;typeof s=="number"&&(s>r-Math.max(2,i)?u.push(0):d=r-s);let f,y,b=!1,x=-1,v=-1,g=-1;n===Go&&(x=Cu(e,x,t.length),x!==-1&&(d=x+c));for(let h;h=e[x+=1];){if(n===oi&&h==="\\"){switch(v=x,e[x+1]){case"x":x+=3;break;case"u":x+=5;break;case"U":x+=9;break;default:x+=1}g=x}if(h===`
72
- `)n===Go&&(x=Cu(e,x,t.length)),d=x+t.length+c,f=void 0;else{if(h===" "&&y&&y!==" "&&y!==`
73
- `&&y!==" "){const j=e[x+1];j&&j!==" "&&j!==`
74
- `&&j!==" "&&(f=x)}if(x>=d)if(f)u.push(f),d=f+c,f=void 0;else if(n===oi){for(;y===" "||y===" ";)y=h,h=e[x+=1],b=!0;const j=x>g+1?x-2:v-1;if(p[j])return e;u.push(j),p[j]=!0,d=j+c,f=void 0}else b=!0}y=h}if(b&&a&&a(),u.length===0)return e;o&&o();let m=e.slice(0,u[0]);for(let h=0;h<u.length;++h){const j=u[h],k=u[h+1]||e.length;j===0?m=`
75
- ${t}${e.slice(0,k)}`:(n===oi&&p[j]&&(m+=`${e[j]}\\`),m+=`
76
- ${t}${e.slice(j+1,k)}`)}return m}function Cu(e,t,n){let s=t,r=t+1,i=e[r];for(;i===" "||i===" ";)if(t<r+n)i=e[++t];else{do i=e[++t];while(i&&i!==`
77
- `);s=t,r=t+1,i=e[r]}return s}const il=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ll=e=>/^(%|---|\.\.\.)/m.test(e);function f0(e,t,n){if(!t||t<0)return!1;const s=t-n,r=e.length;if(r<=s)return!1;for(let i=0,o=0;i<r;++i)if(e[i]===`
78
- `){if(i-o>s)return!0;if(o=i+1,r-o<=s)return!1}return!0}function Us(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:s}=t,r=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(ll(e)?" ":"");let o="",a=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(a,c)+"\\ ",c+=1,a=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{o+=n.slice(a,c);const p=n.substr(c+2,4);switch(p){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:p.substr(0,2)==="00"?o+="\\x"+p.substr(2):o+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(s||n[c+2]==='"'||n.length<r)c+=1;else{for(o+=n.slice(a,c)+`
79
-
80
- `;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)o+=`
81
- `,c+=2;o+=i,n[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+n.slice(a):n,s?o:rl(o,i,oi,il(t,!1))}function Yo(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
82
- `)||/[ \t]\n|\n[ \t]/.test(e))return Us(e,t);const n=t.indent||(ll(e)?" ":""),s="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
83
- ${n}`)+"'";return t.implicitKey?s:rl(s,n,Ep,il(t,!1))}function Bn(e,t){const{singleQuote:n}=t.options;let s;if(n===!1)s=Us;else{const r=e.includes('"'),i=e.includes("'");r&&!i?s=Yo:i&&!r?s=Us:s=n?Yo:Us}return s(e,t)}let qo;try{qo=new RegExp(`(^|(?<!
84
- ))
85
- +(?!
86
- |$)`,"g")}catch{qo=/\n+(?!\n|$)/g}function ai({comment:e,type:t,value:n},s,r,i){const{blockQuote:o,commentString:a,lineWidth:c}=s.options;if(!o||/\n[\t ]+$/.test(n))return Bn(n,s);const u=s.indent||(s.forceBlockIndent||ll(n)?" ":""),p=o==="literal"?!0:o==="folded"||t===z.BLOCK_FOLDED?!1:t===z.BLOCK_LITERAL?!0:!f0(n,c,u.length);if(!n)return p?`|
87
- `:`>
88
- `;let d,f;for(f=n.length;f>0;--f){const k=n[f-1];if(k!==`
89
- `&&k!==" "&&k!==" ")break}let y=n.substring(f);const b=y.indexOf(`
90
- `);b===-1?d="-":n===y||b!==y.length-1?(d="+",i&&i()):d="",y&&(n=n.slice(0,-y.length),y[y.length-1]===`
91
- `&&(y=y.slice(0,-1)),y=y.replace(qo,`$&${u}`));let x=!1,v,g=-1;for(v=0;v<n.length;++v){const k=n[v];if(k===" ")x=!0;else if(k===`
92
- `)g=v;else break}let m=n.substring(0,g<v?g+1:v);m&&(n=n.substring(m.length),m=m.replace(/\n+/g,`$&${u}`));let j=(x?u?"2":"1":"")+d;if(e&&(j+=" "+a(e.replace(/ ?[\r\n]+/g," ")),r&&r()),!p){const k=n.replace(/\n+/g,`
93
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`);let E=!1;const N=il(s,!0);o!=="folded"&&t!==z.BLOCK_FOLDED&&(N.onOverflow=()=>{E=!0});const S=rl(`${m}${k}${y}`,u,Go,N);if(!E)return`>${j}
94
- ${u}${S}`}return n=n.replace(/\n+/g,`$&${u}`),`|${j}
95
- ${u}${m}${n}${y}`}function p0(e,t,n,s){const{type:r,value:i}=e,{actualString:o,implicitKey:a,indent:c,indentStep:u,inFlow:p}=t;if(a&&i.includes(`
96
- `)||p&&/[[\]{},]/.test(i))return Bn(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||p||!i.includes(`
97
- `)?Bn(i,t):ai(e,t,n,s);if(!a&&!p&&r!==z.PLAIN&&i.includes(`
98
- `))return ai(e,t,n,s);if(ll(i)){if(c==="")return t.forceBlockIndent=!0,ai(e,t,n,s);if(a&&c===u)return Bn(i,t)}const d=i.replace(/\n+/g,`$&
99
- ${c}`);if(o){const f=x=>{var v;return x.default&&x.tag!=="tag:yaml.org,2002:str"&&((v=x.test)==null?void 0:v.test(d))},{compat:y,tags:b}=t.doc.schema;if(b.some(f)||y!=null&&y.some(f))return Bn(i,t)}return a?d:rl(d,c,Ep,il(t,!1))}function Ja(e,t,n,s){const{implicitKey:r,inFlow:i}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==z.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=z.QUOTE_DOUBLE);const c=p=>{switch(p){case z.BLOCK_FOLDED:case z.BLOCK_LITERAL:return r||i?Bn(o.value,t):ai(o,t,n,s);case z.QUOTE_DOUBLE:return Us(o.value,t);case z.QUOTE_SINGLE:return Yo(o.value,t);case z.PLAIN:return p0(o,t,n,s);default:return null}};let u=c(a);if(u===null){const{defaultKeyType:p,defaultStringType:d}=t.options,f=r&&p||d;if(u=c(f),u===null)throw new Error(`Unsupported default string type ${f}`)}return u}function Tp(e,t){const n=Object.assign({blockQuote:!0,commentString:d0,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:s,options:n}}function h0(e,t){var r;if(t.tag){const i=e.filter(o=>o.tag===t.tag);if(i.length>0)return i.find(o=>o.format===t.format)??i[0]}let n,s;if(q(t)){s=t.value;let i=e.filter(o=>{var a;return(a=o.identify)==null?void 0:a.call(o,s)});if(i.length>1){const o=i.filter(a=>a.test);o.length>0&&(i=o)}n=i.find(o=>o.format===t.format)??i.find(o=>!o.format)}else s=t,n=e.find(i=>i.nodeClass&&s instanceof i.nodeClass);if(!n){const i=((r=s==null?void 0:s.constructor)==null?void 0:r.name)??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${i} value`)}return n}function m0(e,t,{anchors:n,doc:s}){if(!s.directives)return"";const r=[],i=(q(e)||oe(e))&&e.anchor;i&&jp(i)&&(n.add(i),r.push(`&${i}`));const o=e.tag??(t.default?null:t.tag);return o&&r.push(s.directives.tagString(o)),r.join(" ")}function rs(e,t,n,s){var c;if(ce(e))return e.toString(t,n,s);if(ds(e)){if(t.doc.directives)return e.toString(t);if((c=t.resolvedAliases)!=null&&c.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r;const i=ae(e)?e:t.doc.createNode(e,{onTagObj:u=>r=u});r??(r=h0(t.doc.schema.tags,i));const o=m0(i,r,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const a=typeof r.stringify=="function"?r.stringify(i,t,n,s):q(i)?Ja(i,t,n,s):i.toString(t,n,s);return o?q(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
100
- ${t.indent}${a}`:a}function g0({key:e,value:t},n,s,r){const{allNullValues:i,doc:o,indent:a,indentStep:c,options:{commentString:u,indentSeq:p,simpleKeys:d}}=n;let f=ae(e)&&e.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(oe(e)||!ae(e)&&typeof e=="object"){const N="With simple keys, collection cannot be used as a key value";throw new Error(N)}}let y=!d&&(!e||f&&t==null&&!n.inFlow||oe(e)||(q(e)?e.type===z.BLOCK_FOLDED||e.type===z.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!y&&(d||!i),indent:a+c});let b=!1,x=!1,v=rs(e,n,()=>b=!0,()=>x=!0);if(!y&&!n.inFlow&&v.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");y=!0}if(n.inFlow){if(i||t==null)return b&&s&&s(),v===""?"?":y?`? ${v}`:v}else if(i&&!d||t==null&&y)return v=`? ${v}`,f&&!b?v+=an(v,n.indent,u(f)):x&&r&&r(),v;b&&(f=null),y?(f&&(v+=an(v,n.indent,u(f))),v=`? ${v}
101
- ${a}:`):(v=`${v}:`,f&&(v+=an(v,n.indent,u(f))));let g,m,h;ae(t)?(g=!!t.spaceBefore,m=t.commentBefore,h=t.comment):(g=!1,m=null,h=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!y&&!f&&q(t)&&(n.indentAtStart=v.length+1),x=!1,!p&&c.length>=2&&!n.inFlow&&!y&&vr(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let j=!1;const k=rs(t,n,()=>j=!0,()=>x=!0);let E=" ";if(f||g||m){if(E=g?`
102
- `:"",m){const N=u(m);E+=`
103
- ${wt(N,n.indent)}`}k===""&&!n.inFlow?E===`
104
- `&&h&&(E=`
105
-
106
- `):E+=`
107
- ${n.indent}`}else if(!y&&oe(t)){const N=k[0],S=k.indexOf(`
108
- `),T=S!==-1,P=n.inFlow??t.flow??t.items.length===0;if(T||!P){let B=!1;if(T&&(N==="&"||N==="!")){let G=k.indexOf(" ");N==="&"&&G!==-1&&G<S&&k[G+1]==="!"&&(G=k.indexOf(" ",G+1)),(G===-1||S<G)&&(B=!0)}B||(E=`
109
- ${n.indent}`)}}else(k===""||k[0]===`
110
- `)&&(E="");return v+=E+k,n.inFlow?j&&s&&s():h&&!j?v+=an(v,n.indent,u(h)):x&&r&&r(),v}function Lp(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Br="<<",jt={identify:e=>e===Br||typeof e=="symbol"&&e.description===Br,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new z(Symbol(Br)),{addToJSMap:Pp}),stringify:()=>Br},y0=(e,t)=>(jt.identify(t)||q(t)&&(!t.type||t.type===z.PLAIN)&&jt.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===jt.tag&&n.default));function Pp(e,t,n){const s=Ip(e,n);if(vr(s))for(const r of s.items)zl(e,t,r);else if(Array.isArray(s))for(const r of s)zl(e,t,r);else zl(e,t,s)}function zl(e,t,n){const s=Ip(e,n);if(!xr(s))throw new Error("Merge sources must be maps or map aliases");const r=s.toJSON(null,e,Map);for(const[i,o]of r)t instanceof Map?t.has(i)||t.set(i,o):t instanceof Set?t.add(i):Object.prototype.hasOwnProperty.call(t,i)||Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function Ip(e,t){return e&&ds(t)?t.resolve(e.doc,e):t}function Op(e,t,{key:n,value:s}){if(ae(n)&&n.addToJSMap)n.addToJSMap(e,t,s);else if(y0(e,n))Pp(e,t,s);else{const r=Ge(n,"",e);if(t instanceof Map)t.set(r,Ge(s,r,e));else if(t instanceof Set)t.add(r);else{const i=x0(n,r,e),o=Ge(s,i,e);i in t?Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[i]=o}}return t}function x0(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(ae(e)&&(n!=null&&n.doc)){const s=Tp(n.doc,{});s.anchors=new Set;for(const i of n.anchors.keys())s.anchors.add(i.anchor);s.inFlow=!0,s.inStringifyKey=!0;const r=e.toString(s);if(!n.mapKeyWarned){let i=JSON.stringify(r);i.length>40&&(i=i.substring(0,36)+'..."'),Lp(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Xa(e,t,n){const s=ar(e,void 0,n),r=ar(t,void 0,n);return new Ce(s,r)}class Ce{constructor(t,n=null){Object.defineProperty(this,Qe,{value:wp}),this.key=t,this.value=n}clone(t){let{key:n,value:s}=this;return ae(n)&&(n=n.clone(t)),ae(s)&&(s=s.clone(t)),new Ce(n,s)}toJSON(t,n){const s=n!=null&&n.mapAsMap?new Map:{};return Op(n,s,this)}toString(t,n,s){return t!=null&&t.doc?g0(this,t,n,s):JSON.stringify(this)}}function _p(e,t,n){return(t.inFlow??e.flow?w0:v0)(e,t,n)}function v0({comment:e,items:t},n,{blockItemPrefix:s,flowChars:r,itemIndent:i,onChompKeep:o,onComment:a}){const{indent:c,options:{commentString:u}}=n,p=Object.assign({},n,{indent:i,type:null});let d=!1;const f=[];for(let b=0;b<t.length;++b){const x=t[b];let v=null;if(ae(x))!d&&x.spaceBefore&&f.push(""),Ri(n,f,x.commentBefore,d),x.comment&&(v=x.comment);else if(ce(x)){const m=ae(x.key)?x.key:null;m&&(!d&&m.spaceBefore&&f.push(""),Ri(n,f,m.commentBefore,d))}d=!1;let g=rs(x,p,()=>v=null,()=>d=!0);v&&(g+=an(g,i,u(v))),d&&v&&(d=!1),f.push(s+g)}let y;if(f.length===0)y=r.start+r.end;else{y=f[0];for(let b=1;b<f.length;++b){const x=f[b];y+=x?`
111
- ${c}${x}`:`
112
- `}}return e?(y+=`
113
- `+wt(u(e),c),a&&a()):d&&o&&o(),y}function w0({items:e},t,{flowChars:n,itemIndent:s}){const{indent:r,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=t;s+=i;const c=Object.assign({},t,{indent:s,inFlow:!0,type:null});let u=!1,p=0;const d=[];for(let b=0;b<e.length;++b){const x=e[b];let v=null;if(ae(x))x.spaceBefore&&d.push(""),Ri(t,d,x.commentBefore,!1),x.comment&&(v=x.comment);else if(ce(x)){const m=ae(x.key)?x.key:null;m&&(m.spaceBefore&&d.push(""),Ri(t,d,m.commentBefore,!1),m.comment&&(u=!0));const h=ae(x.value)?x.value:null;h?(h.comment&&(v=h.comment),h.commentBefore&&(u=!0)):x.value==null&&(m!=null&&m.comment)&&(v=m.comment)}v&&(u=!0);let g=rs(x,c,()=>v=null);u||(u=d.length>p||g.includes(`
114
- `)),b<e.length-1?g+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(u||(u=d.reduce((m,h)=>m+h.length+2,2)+(g.length+2)>t.options.lineWidth)),u&&(g+=",")),v&&(g+=an(g,s,a(v))),d.push(g),p=d.length}const{start:f,end:y}=n;if(d.length===0)return f+y;if(!u){const b=d.reduce((x,v)=>x+v.length+2,2);u=t.options.lineWidth>0&&b>t.options.lineWidth}if(u){let b=f;for(const x of d)b+=x?`
115
- ${i}${r}${x}`:`
116
- `;return`${b}
117
- ${r}${y}`}else return`${f}${o}${d.join(" ")}${o}${y}`}function Ri({indent:e,options:{commentString:t}},n,s,r){if(s&&r&&(s=s.replace(/^\n+/,"")),s){const i=wt(t(s),e);n.push(i.trimStart())}}function cn(e,t){const n=q(t)?t.value:t;for(const s of e)if(ce(s)&&(s.key===t||s.key===n||q(s.key)&&s.key.value===n))return s}class We extends Cp{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Gt,t),this.items=[]}static from(t,n,s){const{keepUndefined:r,replacer:i}=s,o=new this(t),a=(c,u)=>{if(typeof i=="function")u=i.call(n,c,u);else if(Array.isArray(i)&&!i.includes(c))return;(u!==void 0||r)&&o.items.push(Xa(c,u,s))};if(n instanceof Map)for(const[c,u]of n)a(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))a(c,n[c]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){var o;let s;ce(t)?s=t:!t||typeof t!="object"||!("key"in t)?s=new Ce(t,t==null?void 0:t.value):s=new Ce(t.key,t.value);const r=cn(this.items,s.key),i=(o=this.schema)==null?void 0:o.sortMapEntries;if(r){if(!n)throw new Error(`Key ${s.key} already set`);q(r.value)&&Sp(s.value)?r.value.value=s.value:r.value=s.value}else if(i){const a=this.items.findIndex(c=>i(s,c)<0);a===-1?this.items.push(s):this.items.splice(a,0,s)}else this.items.push(s)}delete(t){const n=cn(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const s=cn(this.items,t),r=s==null?void 0:s.value;return(!n&&q(r)?r.value:r)??void 0}has(t){return!!cn(this.items,t)}set(t,n){this.add(new Ce(t,n),!0)}toJSON(t,n,s){const r=s?new s:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(r);for(const i of this.items)Op(n,r,i);return r}toString(t,n,s){if(!t)return JSON.stringify(this);for(const r of this.items)if(!ce(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),_p(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}}const ps={collection:"map",default:!0,nodeClass:We,tag:"tag:yaml.org,2002:map",resolve(e,t){return xr(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>We.from(e,t,n)};class xn extends Cp{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(us,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Ur(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const s=Ur(t);if(typeof s!="number")return;const r=this.items[s];return!n&&q(r)?r.value:r}has(t){const n=Ur(t);return typeof n=="number"&&n<this.items.length}set(t,n){const s=Ur(t);if(typeof s!="number")throw new Error(`Expected a valid index, not ${t}.`);const r=this.items[s];q(r)&&Sp(n)?r.value=n:this.items[s]=n}toJSON(t,n){const s=[];n!=null&&n.onCreate&&n.onCreate(s);let r=0;for(const i of this.items)s.push(Ge(i,String(r++),n));return s}toString(t,n,s){return t?_p(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:s,onComment:n}):JSON.stringify(this)}static from(t,n,s){const{replacer:r}=s,i=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof r=="function"){const c=n instanceof Set?a:String(o++);a=r.call(n,c,a)}i.items.push(ar(a,void 0,s))}}return i}}function Ur(e){let t=q(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const hs={collection:"seq",default:!0,nodeClass:xn,tag:"tag:yaml.org,2002:seq",resolve(e,t){return vr(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>xn.from(e,t,n)},ol={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,s){return t=Object.assign({actualString:!0},t),Ja(e,t,n,s)}},al={identify:e=>e==null,createNode:()=>new z(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new z(null),stringify:({source:e},t)=>typeof e=="string"&&al.test.test(e)?e:t.options.nullStr},Za={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new z(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Za.test.test(e)){const s=e[0]==="t"||e[0]==="T";if(t===s)return e}return t?n.options.trueStr:n.options.falseStr}};function lt({format:e,minFractionDigits:t,tag:n,value:s}){if(typeof s=="bigint")return String(s);const r=typeof s=="number"?s:Number(s);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let i=Object.is(s,-0)?"-0":JSON.stringify(s);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=t-(i.length-o-1);for(;a-- >0;)i+="0"}return i}const Ap={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:lt},Dp={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():lt(e)}},Rp={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new z(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:lt},cl=e=>typeof e=="bigint"||Number.isInteger(e),ec=(e,t,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),n);function Mp(e,t,n){const{value:s}=e;return cl(s)&&s>=0?n+s.toString(t):lt(e)}const $p={identify:e=>cl(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>ec(e,2,8,n),stringify:e=>Mp(e,8,"0o")},Fp={identify:cl,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>ec(e,0,10,n),stringify:lt},zp={identify:e=>cl(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>ec(e,2,16,n),stringify:e=>Mp(e,16,"0x")},b0=[ps,hs,ol,al,Za,$p,Fp,zp,Ap,Dp,Rp];function Eu(e){return typeof e=="bigint"||Number.isInteger(e)}const Hr=({value:e})=>JSON.stringify(e),j0=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Hr},{identify:e=>e==null,createNode:()=>new z(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Hr},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Hr},{identify:Eu,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Eu(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Hr}],k0={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},N0=[ps,hs].concat(j0,k0),tc={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),s=new Uint8Array(n.length);for(let r=0;r<n.length;++r)s[r]=n.charCodeAt(r);return s}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},s,r,i){if(!n)return"";const o=n;let a;if(typeof btoa=="function"){let c="";for(let u=0;u<o.length;++u)c+=String.fromCharCode(o[u]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=z.BLOCK_LITERAL),t!==z.QUOTE_DOUBLE){const c=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),u=Math.ceil(a.length/c),p=new Array(u);for(let d=0,f=0;d<u;++d,f+=c)p[d]=a.substr(f,c);a=p.join(t===z.BLOCK_LITERAL?`
118
- `:" ")}return Ja({comment:e,type:t,value:a},s,r,i)}};function Bp(e,t){if(vr(e))for(let n=0;n<e.items.length;++n){let s=e.items[n];if(!ce(s)){if(xr(s)){s.items.length>1&&t("Each pair must have its own sequence indicator");const r=s.items[0]||new Ce(new z(null));if(s.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${s.commentBefore}
119
- ${r.key.commentBefore}`:s.commentBefore),s.comment){const i=r.value??r.key;i.comment=i.comment?`${s.comment}
120
- ${i.comment}`:s.comment}s=r}e.items[n]=ce(s)?s:new Ce(s)}}else t("Expected a sequence for this tag");return e}function Up(e,t,n){const{replacer:s}=n,r=new xn(e);r.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof s=="function"&&(o=s.call(t,String(i++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const u=Object.keys(o);if(u.length===1)a=u[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else a=o;r.items.push(Xa(a,c,n))}return r}const nc={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Bp,createNode:Up};class Yn extends xn{constructor(){super(),this.add=We.prototype.add.bind(this),this.delete=We.prototype.delete.bind(this),this.get=We.prototype.get.bind(this),this.has=We.prototype.has.bind(this),this.set=We.prototype.set.bind(this),this.tag=Yn.tag}toJSON(t,n){if(!n)return super.toJSON(t);const s=new Map;n!=null&&n.onCreate&&n.onCreate(s);for(const r of this.items){let i,o;if(ce(r)?(i=Ge(r.key,"",n),o=Ge(r.value,i,n)):i=Ge(r,"",n),s.has(i))throw new Error("Ordered maps must not include duplicate keys");s.set(i,o)}return s}static from(t,n,s){const r=Up(t,n,s),i=new this;return i.items=r.items,i}}Yn.tag="tag:yaml.org,2002:omap";const sc={collection:"seq",identify:e=>e instanceof Map,nodeClass:Yn,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=Bp(e,t),s=[];for(const{key:r}of n.items)q(r)&&(s.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):s.push(r.value));return Object.assign(new Yn,n)},createNode:(e,t,n)=>Yn.from(e,t,n)};function Hp({value:e,source:t},n){return t&&(e?Wp:Kp).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const Wp={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new z(!0),stringify:Hp},Kp={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new z(!1),stringify:Hp},S0={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:lt},C0={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():lt(e)}},E0={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new z(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const s=e.substring(n+1).replace(/_/g,"");s[s.length-1]==="0"&&(t.minFractionDigits=s.length)}return t},stringify:lt},wr=e=>typeof e=="bigint"||Number.isInteger(e);function ul(e,t,n,{intAsBigInt:s}){const r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),s){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return r==="-"?BigInt(-1)*o:o}const i=parseInt(e,n);return r==="-"?-1*i:i}function rc(e,t,n){const{value:s}=e;if(wr(s)){const r=s.toString(t);return s<0?"-"+n+r.substr(1):n+r}return lt(e)}const T0={identify:wr,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>ul(e,2,2,n),stringify:e=>rc(e,2,"0b")},L0={identify:wr,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>ul(e,1,8,n),stringify:e=>rc(e,8,"0")},P0={identify:wr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>ul(e,0,10,n),stringify:lt},I0={identify:wr,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>ul(e,2,16,n),stringify:e=>rc(e,16,"0x")};class qn extends We{constructor(t){super(t),this.tag=qn.tag}add(t){let n;ce(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Ce(t.key,null):n=new Ce(t,null),cn(this.items,n.key)||this.items.push(n)}get(t,n){const s=cn(this.items,t);return!n&&ce(s)?q(s.key)?s.key.value:s.key:s}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const s=cn(this.items,t);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new Ce(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,s){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,s);throw new Error("Set items must all have null values")}static from(t,n,s){const{replacer:r}=s,i=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),i.items.push(Xa(o,null,s));return i}}qn.tag="tag:yaml.org,2002:set";const ic={collection:"map",identify:e=>e instanceof Set,nodeClass:qn,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>qn.from(e,t,n),resolve(e,t){if(xr(e)){if(e.hasAllNullValues(!0))return Object.assign(new qn,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function lc(e,t){const n=e[0],s=n==="-"||n==="+"?e.substring(1):e,r=o=>t?BigInt(o):Number(o),i=s.replace(/_/g,"").split(":").reduce((o,a)=>o*r(60)+r(a),r(0));return n==="-"?r(-1)*i:i}function Vp(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return lt(e);let s="";t<0&&(s="-",t*=n(-1));const r=n(60),i=[t%r];return t<60?i.unshift(0):(t=(t-i[0])/r,i.unshift(t%r),t>=60&&(t=(t-i[0])/r,i.unshift(t))),s+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Gp={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>lc(e,n),stringify:Vp},Yp={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>lc(e,!1),stringify:Vp},dl={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(dl.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,s,r,i,o,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,s-1,r,i||0,o||0,a||0,c);const p=t[8];if(p&&p!=="Z"){let d=lc(p,!1);Math.abs(d)<30&&(d*=60),u-=6e4*d}return new Date(u)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},Tu=[ps,hs,ol,al,Wp,Kp,T0,L0,P0,I0,S0,C0,E0,tc,jt,sc,nc,ic,Gp,Yp,dl],Lu=new Map([["core",b0],["failsafe",[ps,hs,ol]],["json",N0],["yaml11",Tu],["yaml-1.1",Tu]]),Pu={binary:tc,bool:Za,float:Rp,floatExp:Dp,floatNaN:Ap,floatTime:Yp,int:Fp,intHex:zp,intOct:$p,intTime:Gp,map:ps,merge:jt,null:al,omap:sc,pairs:nc,seq:hs,set:ic,timestamp:dl},O0={"tag:yaml.org,2002:binary":tc,"tag:yaml.org,2002:merge":jt,"tag:yaml.org,2002:omap":sc,"tag:yaml.org,2002:pairs":nc,"tag:yaml.org,2002:set":ic,"tag:yaml.org,2002:timestamp":dl};function Bl(e,t,n){const s=Lu.get(t);if(s&&!e)return n&&!s.includes(jt)?s.concat(jt):s.slice();let r=s;if(!r)if(Array.isArray(e))r=[];else{const i=Array.from(Lu.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${i} or define customTags array`)}if(Array.isArray(e))for(const i of e)r=r.concat(i);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(jt)),r.reduce((i,o)=>{const a=typeof o=="string"?Pu[o]:o;if(!a){const c=JSON.stringify(o),u=Object.keys(Pu).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return i.includes(a)||i.push(a),i},[])}const _0=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class oc{constructor({compat:t,customTags:n,merge:s,resolveKnownTags:r,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(t)?Bl(t,"compat"):t?Bl(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=r?O0:{},this.tags=Bl(n,this.name,s),this.toStringOptions=a??null,Object.defineProperty(this,Gt,{value:ps}),Object.defineProperty(this,mt,{value:ol}),Object.defineProperty(this,us,{value:hs}),this.sortMapEntries=typeof o=="function"?o:o===!0?_0:null}clone(){const t=Object.create(oc.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function A0(e,t){var c;const n=[];let s=t.directives===!0;if(t.directives!==!1&&e.directives){const u=e.directives.toString(e);u?(n.push(u),s=!0):e.directives.docStart&&(s=!0)}s&&n.push("---");const r=Tp(e,t),{commentString:i}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=i(e.commentBefore);n.unshift(wt(u,""))}let o=!1,a=null;if(e.contents){if(ae(e.contents)){if(e.contents.spaceBefore&&s&&n.push(""),e.contents.commentBefore){const d=i(e.contents.commentBefore);n.push(wt(d,""))}r.forceBlockIndent=!!e.comment,a=e.contents.comment}const u=a?void 0:()=>o=!0;let p=rs(e.contents,r,()=>a=null,u);a&&(p+=an(p,"",i(a))),(p[0]==="|"||p[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${p}`:n.push(p)}else n.push(rs(e.contents,r));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=i(e.comment);u.includes(`
121
- `)?(n.push("..."),n.push(wt(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&o&&(u=u.replace(/^\n+/,"")),u&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(wt(i(u),"")))}return n.join(`
122
- `)+`
123
- `}class br{constructor(t,n,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Qe,{value:Vo});let r=null;typeof n=="function"||Array.isArray(n)?r=n:s===void 0&&n&&(s=n,n=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=i;let{version:o}=i;s!=null&&s._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Ne({version:o}),this.setSchema(o,s),this.contents=t===void 0?null:this.createNode(t,r,s)}clone(){const t=Object.create(br.prototype,{[Qe]:{value:Vo}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=ae(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Nn(this.contents)&&this.contents.add(t)}addIn(t,n){Nn(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const s=kp(this);t.anchor=!n||s.has(n)?Np(n||"a",s):n}return new Qa(t.anchor)}createNode(t,n,s){let r;if(typeof n=="function")t=n.call({"":t},"",t),r=n;else if(Array.isArray(n)){const v=m=>typeof m=="number"||m instanceof String||m instanceof Number,g=n.filter(v).map(String);g.length>0&&(n=n.concat(g)),r=n}else s===void 0&&n&&(s=n,n=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:u,tag:p}=s??{},{onAnchor:d,setAnchors:f,sourceObjects:y}=a0(this,o||"a"),b={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:y},x=ar(t,p,b);return a&&oe(x)&&(x.flow=!0),f(),x}createPair(t,n,s={}){const r=this.createNode(t,null,s),i=this.createNode(n,null,s);return new Ce(r,i)}delete(t){return Nn(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Ps(t)?this.contents==null?!1:(this.contents=null,!0):Nn(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return oe(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Ps(t)?!n&&q(this.contents)?this.contents.value:this.contents:oe(this.contents)?this.contents.getIn(t,n):void 0}has(t){return oe(this.contents)?this.contents.has(t):!1}hasIn(t){return Ps(t)?this.contents!==void 0:oe(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Di(this.schema,[t],n):Nn(this.contents)&&this.contents.set(t,n)}setIn(t,n){Ps(t)?this.contents=n:this.contents==null?this.contents=Di(this.schema,Array.from(t),n):Nn(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let s;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Ne({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Ne({version:t}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(s)this.schema=new oc(Object.assign(s,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:s,maxAliasCount:r,onAnchor:i,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!t,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=Ge(this.contents,n??"",a);if(typeof i=="function")for(const{count:u,res:p}of a.anchors.values())i(p,u);return typeof o=="function"?zn(o,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return A0(this,t)}}function Nn(e){if(oe(e))return!0;throw new Error("Expected a YAML collection as document contents")}class qp extends Error{constructor(t,n,s,r){super(),this.name=t,this.code=s,this.message=r,this.pos=n}}class Is extends qp{constructor(t,n,s){super("YAMLParseError",t,n,s)}}class D0 extends qp{constructor(t,n,s){super("YAMLWarning",t,n,s)}}const Iu=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>t.linePos(a));const{line:s,col:r}=n.linePos[0];n.message+=` at line ${s}, column ${r}`;let i=r-1,o=e.substring(t.lineStarts[s-1],t.lineStarts[s]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){const a=Math.min(i-39,o.length-79);o="…"+o.substring(a),i-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),s>1&&/^ *$/.test(o.substring(0,i))){let a=e.substring(t.lineStarts[s-2],t.lineStarts[s-1]);a.length>80&&(a=a.substring(0,79)+`…
124
- `),o=a+o}if(/[^ ]/.test(o)){let a=1;const c=n.linePos[1];(c==null?void 0:c.line)===s&&c.col>r&&(a=Math.max(1,Math.min(c.col-r,80-i)));const u=" ".repeat(i)+"^".repeat(a);n.message+=`:
125
-
126
- ${o}
127
- ${u}
128
- `}};function is(e,{flow:t,indicator:n,next:s,offset:r,onError:i,parentIndent:o,startOnNewline:a}){let c=!1,u=a,p=a,d="",f="",y=!1,b=!1,x=null,v=null,g=null,m=null,h=null,j=null,k=null;for(const S of e)switch(b&&(S.type!=="space"&&S.type!=="newline"&&S.type!=="comma"&&i(S.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b=!1),x&&(u&&S.type!=="comment"&&S.type!=="newline"&&i(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),x=null),S.type){case"space":!t&&(n!=="doc-start"||(s==null?void 0:s.type)!=="flow-collection")&&S.source.includes(" ")&&(x=S),p=!0;break;case"comment":{p||i(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const T=S.source.substring(1)||" ";d?d+=f+T:d=T,f="",u=!1;break}case"newline":u?d?d+=S.source:(!j||n!=="seq-item-ind")&&(c=!0):f+=S.source,u=!0,y=!0,(v||g)&&(m=S),p=!0;break;case"anchor":v&&i(S,"MULTIPLE_ANCHORS","A node can have at most one anchor"),S.source.endsWith(":")&&i(S.offset+S.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),v=S,k??(k=S.offset),u=!1,p=!1,b=!0;break;case"tag":{g&&i(S,"MULTIPLE_TAGS","A node can have at most one tag"),g=S,k??(k=S.offset),u=!1,p=!1,b=!0;break}case n:(v||g)&&i(S,"BAD_PROP_ORDER",`Anchors and tags must be after the ${S.source} indicator`),j&&i(S,"UNEXPECTED_TOKEN",`Unexpected ${S.source} in ${t??"collection"}`),j=S,u=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){h&&i(S,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),h=S,u=!1,p=!1;break}default:i(S,"UNEXPECTED_TOKEN",`Unexpected ${S.type} token`),u=!1,p=!1}const E=e[e.length-1],N=E?E.offset+E.source.length:r;return b&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&i(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),x&&(u&&x.indent<=o||(s==null?void 0:s.type)==="block-map"||(s==null?void 0:s.type)==="block-seq")&&i(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:h,found:j,spaceBefore:c,comment:d,hasNewline:y,anchor:v,tag:g,newlineAfterProp:m,end:N,start:k??N}}function cr(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
129
- `))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(cr(t.key)||cr(t.value))return!0}return!1;default:return!0}}function Qo(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const s=t.end[0];s.indent===e&&(s.source==="]"||s.source==="}")&&cr(t)&&n(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Qp(e,t,n){const{uniqueKeys:s}=e.options;if(s===!1)return!1;const r=typeof s=="function"?s:(i,o)=>i===o||q(i)&&q(o)&&i.value===o.value;return t.some(i=>r(i.key,n))}const Ou="All mapping items must start at the same column";function R0({composeNode:e,composeEmptyNode:t},n,s,r,i){var p;const o=(i==null?void 0:i.nodeClass)??We,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=s.offset,u=null;for(const d of s.items){const{start:f,key:y,sep:b,value:x}=d,v=is(f,{indicator:"explicit-key-ind",next:y??(b==null?void 0:b[0]),offset:c,onError:r,parentIndent:s.indent,startOnNewline:!0}),g=!v.found;if(g){if(y&&(y.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==s.indent&&r(c,"BAD_INDENT",Ou)),!v.anchor&&!v.tag&&!b){u=v.end,v.comment&&(a.comment?a.comment+=`
130
- `+v.comment:a.comment=v.comment);continue}(v.newlineAfterProp||cr(y))&&r(y??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((p=v.found)==null?void 0:p.indent)!==s.indent&&r(c,"BAD_INDENT",Ou);n.atKey=!0;const m=v.end,h=y?e(n,y,v,r):t(n,m,f,null,v,r);n.schema.compat&&Qo(s.indent,y,r),n.atKey=!1,Qp(n,a.items,h)&&r(m,"DUPLICATE_KEY","Map keys must be unique");const j=is(b??[],{indicator:"map-value-ind",next:x,offset:h.range[2],onError:r,parentIndent:s.indent,startOnNewline:!y||y.type==="block-scalar"});if(c=j.end,j.found){g&&((x==null?void 0:x.type)==="block-map"&&!j.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&v.start<j.found.offset-1024&&r(h.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const k=x?e(n,x,j,r):t(n,c,b,null,j,r);n.schema.compat&&Qo(s.indent,x,r),c=k.range[2];const E=new Ce(h,k);n.options.keepSourceTokens&&(E.srcToken=d),a.items.push(E)}else{g&&r(h.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),j.comment&&(h.comment?h.comment+=`
131
- `+j.comment:h.comment=j.comment);const k=new Ce(h);n.options.keepSourceTokens&&(k.srcToken=d),a.items.push(k)}}return u&&u<c&&r(u,"IMPOSSIBLE","Map comment with trailing content"),a.range=[s.offset,c,u??c],a}function M0({composeNode:e,composeEmptyNode:t},n,s,r,i){const o=(i==null?void 0:i.nodeClass)??xn,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=s.offset,u=null;for(const{start:p,value:d}of s.items){const f=is(p,{indicator:"seq-item-ind",next:d,offset:c,onError:r,parentIndent:s.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)(d==null?void 0:d.type)==="block-seq"?r(f.end,"BAD_INDENT","All sequence items must start at the same column"):r(c,"MISSING_CHAR","Sequence item without - indicator");else{u=f.end,f.comment&&(a.comment=f.comment);continue}const y=d?e(n,d,f,r):t(n,f.end,p,null,f,r);n.schema.compat&&Qo(s.indent,d,r),c=y.range[2],a.items.push(y)}return a.range=[s.offset,c,u??c],a}function jr(e,t,n,s){let r="";if(e){let i=!1,o="";for(const a of e){const{source:c,type:u}=a;switch(u){case"space":i=!0;break;case"comment":{n&&!i&&s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=c.substring(1)||" ";r?r+=o+p:r=p,o="";break}case"newline":r&&(o+=c),i=!0;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}t+=c.length}}return{comment:r,offset:t}}const Ul="Block collections are not allowed within flow collections",Hl=e=>e&&(e.type==="block-map"||e.type==="block-seq");function $0({composeNode:e,composeEmptyNode:t},n,s,r,i){var v;const o=s.start.source==="{",a=o?"flow map":"flow sequence",c=(i==null?void 0:i.nodeClass)??(o?We:xn),u=new c(n.schema);u.flow=!0;const p=n.atRoot;p&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=s.offset+s.start.source.length;for(let g=0;g<s.items.length;++g){const m=s.items[g],{start:h,key:j,sep:k,value:E}=m,N=is(h,{flow:a,indicator:"explicit-key-ind",next:j??(k==null?void 0:k[0]),offset:d,onError:r,parentIndent:s.indent,startOnNewline:!1});if(!N.found){if(!N.anchor&&!N.tag&&!k&&!E){g===0&&N.comma?r(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):g<s.items.length-1&&r(N.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),N.comment&&(u.comment?u.comment+=`
132
- `+N.comment:u.comment=N.comment),d=N.end;continue}!o&&n.options.strict&&cr(j)&&r(j,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)N.comma&&r(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(N.comma||r(N.start,"MISSING_CHAR",`Missing , between ${a} items`),N.comment){let S="";e:for(const T of h)switch(T.type){case"comma":case"space":break;case"comment":S=T.source.substring(1);break e;default:break e}if(S){let T=u.items[u.items.length-1];ce(T)&&(T=T.value??T.key),T.comment?T.comment+=`
133
- `+S:T.comment=S,N.comment=N.comment.substring(S.length+1)}}if(!o&&!k&&!N.found){const S=E?e(n,E,N,r):t(n,N.end,k,null,N,r);u.items.push(S),d=S.range[2],Hl(E)&&r(S.range,"BLOCK_IN_FLOW",Ul)}else{n.atKey=!0;const S=N.end,T=j?e(n,j,N,r):t(n,S,h,null,N,r);Hl(j)&&r(T.range,"BLOCK_IN_FLOW",Ul),n.atKey=!1;const P=is(k??[],{flow:a,indicator:"map-value-ind",next:E,offset:T.range[2],onError:r,parentIndent:s.indent,startOnNewline:!1});if(P.found){if(!o&&!N.found&&n.options.strict){if(k)for(const K of k){if(K===P.found)break;if(K.type==="newline"){r(K,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}N.start<P.found.offset-1024&&r(P.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else E&&("source"in E&&((v=E.source)==null?void 0:v[0])===":"?r(E,"MISSING_CHAR",`Missing space after : in ${a}`):r(P.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const B=E?e(n,E,P,r):P.found?t(n,P.end,k,null,P,r):null;B?Hl(E)&&r(B.range,"BLOCK_IN_FLOW",Ul):P.comment&&(T.comment?T.comment+=`
134
- `+P.comment:T.comment=P.comment);const G=new Ce(T,B);if(n.options.keepSourceTokens&&(G.srcToken=m),o){const K=u;Qp(n,K.items,T)&&r(S,"DUPLICATE_KEY","Map keys must be unique"),K.items.push(G)}else{const K=new We(n.schema);K.flow=!0,K.items.push(G);const C=(B??T).range;K.range=[T.range[0],C[1],C[2]],u.items.push(K)}d=B?B.range[2]:P.end}}const f=o?"}":"]",[y,...b]=s.end;let x=d;if((y==null?void 0:y.source)===f)x=y.offset+y.source.length;else{const g=a[0].toUpperCase()+a.substring(1),m=p?`${g} must end with a ${f}`:`${g} in block collection must be sufficiently indented and end with a ${f}`;r(d,p?"MISSING_CHAR":"BAD_INDENT",m),y&&y.source.length!==1&&b.unshift(y)}if(b.length>0){const g=jr(b,x,n.options.strict,r);g.comment&&(u.comment?u.comment+=`
135
- `+g.comment:u.comment=g.comment),u.range=[s.offset,x,g.offset]}else u.range=[s.offset,x,x];return u}function Wl(e,t,n,s,r,i){const o=n.type==="block-map"?R0(e,t,n,s,i):n.type==="block-seq"?M0(e,t,n,s,i):$0(e,t,n,s,i),a=o.constructor;return r==="!"||r===a.tagName?(o.tag=a.tagName,o):(r&&(o.tag=r),o)}function F0(e,t,n,s,r){var f;const i=s.tag,o=i?t.directives.tagName(i.source,y=>r(i,"TAG_RESOLVE_FAILED",y)):null;if(n.type==="block-seq"){const{anchor:y,newlineAfterProp:b}=s,x=y&&i?y.offset>i.offset?y:i:y??i;x&&(!b||b.offset<x.offset)&&r(x,"MISSING_CHAR","Missing newline after block sequence props")}const a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!i||!o||o==="!"||o===We.tagName&&a==="map"||o===xn.tagName&&a==="seq")return Wl(e,t,n,r,o);let c=t.schema.tags.find(y=>y.tag===o&&y.collection===a);if(!c){const y=t.schema.knownTags[o];if((y==null?void 0:y.collection)===a)t.schema.tags.push(Object.assign({},y,{default:!1})),c=y;else return y?r(i,"BAD_COLLECTION_TYPE",`${y.tag} used for ${a} collection, but expects ${y.collection??"scalar"}`,!0):r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Wl(e,t,n,r,o)}const u=Wl(e,t,n,r,o,c),p=((f=c.resolve)==null?void 0:f.call(c,u,y=>r(i,"TAG_RESOLVE_FAILED",y),t.options))??u,d=ae(p)?p:new z(p);return d.range=u.range,d.tag=o,c!=null&&c.format&&(d.format=c.format),d}function z0(e,t,n){const s=t.offset,r=B0(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[s,s,s]};const i=r.mode===">"?z.BLOCK_FOLDED:z.BLOCK_LITERAL,o=t.source?U0(t.source):[];let a=o.length;for(let x=o.length-1;x>=0;--x){const v=o[x][1];if(v===""||v==="\r")a=x;else break}if(a===0){const x=r.chomp==="+"&&o.length>0?`
136
- `.repeat(Math.max(1,o.length-1)):"";let v=s+r.length;return t.source&&(v+=t.source.length),{value:x,type:i,comment:r.comment,range:[s,v,v]}}let c=t.indent+r.indent,u=t.offset+r.length,p=0;for(let x=0;x<a;++x){const[v,g]=o[x];if(g===""||g==="\r")r.indent===0&&v.length>c&&(c=v.length);else{v.length<c&&n(u+v.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(c=v.length),p=x,c===0&&!e.atRoot&&n(u,"BAD_INDENT","Block scalar values in collections must be indented");break}u+=v.length+g.length+1}for(let x=o.length-1;x>=a;--x)o[x][0].length>c&&(a=x+1);let d="",f="",y=!1;for(let x=0;x<p;++x)d+=o[x][0].slice(c)+`
137
- `;for(let x=p;x<a;++x){let[v,g]=o[x];u+=v.length+g.length+1;const m=g[g.length-1]==="\r";if(m&&(g=g.slice(0,-1)),g&&v.length<c){const j=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(u-g.length-(m?2:1),"BAD_INDENT",j),v=""}i===z.BLOCK_LITERAL?(d+=f+v.slice(c)+g,f=`
138
- `):v.length>c||g[0]===" "?(f===" "?f=`
139
- `:!y&&f===`
140
- `&&(f=`
141
-
142
- `),d+=f+v.slice(c)+g,f=`
143
- `,y=!0):g===""?f===`
144
- `?d+=`
145
- `:f=`
146
- `:(d+=f+g,f=" ",y=!1)}switch(r.chomp){case"-":break;case"+":for(let x=a;x<o.length;++x)d+=`
147
- `+o[x][0].slice(c);d[d.length-1]!==`
148
- `&&(d+=`
149
- `);break;default:d+=`
150
- `}const b=s+r.length+t.source.length;return{value:d,type:i,comment:r.comment,range:[s,b,b]}}function B0({offset:e,props:t},n,s){if(t[0].type!=="block-scalar-header")return s(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=t[0],i=r[0];let o=0,a="",c=-1;for(let f=1;f<r.length;++f){const y=r[f];if(!a&&(y==="-"||y==="+"))a=y;else{const b=Number(y);!o&&b?o=b:c===-1&&(c=e+f)}}c!==-1&&s(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let u=!1,p="",d=r.length;for(let f=1;f<t.length;++f){const y=t[f];switch(y.type){case"space":u=!0;case"newline":d+=y.source.length;break;case"comment":n&&!u&&s(y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=y.source.length,p=y.source.substring(1);break;case"error":s(y,"UNEXPECTED_TOKEN",y.message),d+=y.source.length;break;default:{const b=`Unexpected token in block scalar header: ${y.type}`;s(y,"UNEXPECTED_TOKEN",b);const x=y.source;x&&typeof x=="string"&&(d+=x.length)}}}return{mode:i,indent:o,chomp:a,comment:p,length:d}}function U0(e){const t=e.split(/\n( *)/),n=t[0],s=n.match(/^( *)/),i=[s!=null&&s[1]?[s[1],n.slice(s[1].length)]:["",n]];for(let o=1;o<t.length;o+=2)i.push([t[o],t[o+1]]);return i}function H0(e,t,n){const{offset:s,type:r,source:i,end:o}=e;let a,c;const u=(f,y,b)=>n(s+f,y,b);switch(r){case"scalar":a=z.PLAIN,c=W0(i,u);break;case"single-quoted-scalar":a=z.QUOTE_SINGLE,c=K0(i,u);break;case"double-quoted-scalar":a=z.QUOTE_DOUBLE,c=V0(i,u);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[s,s+i.length,s+i.length]}}const p=s+i.length,d=jr(o,p,t,n);return{value:c,type:a,comment:d.comment,range:[s,p,d.offset]}}function W0(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Jp(e)}function K0(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),Jp(e.slice(1,-1)).replace(/''/g,"'")}function Jp(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
151
- `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
152
- `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let s=t.exec(e);if(!s)return e;let r=s[1],i=" ",o=t.lastIndex;for(n.lastIndex=o;s=n.exec(e);)s[1]===""?i===`
153
- `?r+=i:i=`
154
- `:(r+=i+s[1],i=" "),o=n.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=o,s=a.exec(e),r+i+((s==null?void 0:s[1])??"")}function V0(e,t){let n="";for(let s=1;s<e.length-1;++s){const r=e[s];if(!(r==="\r"&&e[s+1]===`
155
- `))if(r===`
156
- `){const{fold:i,offset:o}=G0(e,s);n+=i,s=o}else if(r==="\\"){let i=e[++s];const o=Y0[i];if(o)n+=o;else if(i===`
157
- `)for(i=e[s+1];i===" "||i===" ";)i=e[++s+1];else if(i==="\r"&&e[s+1]===`
158
- `)for(i=e[++s+1];i===" "||i===" ";)i=e[++s+1];else if(i==="x"||i==="u"||i==="U"){const a=i==="x"?2:i==="u"?4:8;n+=q0(e,s+1,a,t),s+=a}else{const a=e.substr(s-1,2);t(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(r===" "||r===" "){const i=s;let o=e[s+1];for(;o===" "||o===" ";)o=e[++s+1];o!==`
159
- `&&!(o==="\r"&&e[s+2]===`
160
- `)&&(n+=s>i?e.slice(i,s+1):r)}else n+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function G0(e,t){let n="",s=e[t+1];for(;(s===" "||s===" "||s===`
161
- `||s==="\r")&&!(s==="\r"&&e[t+2]!==`
162
- `);)s===`
163
- `&&(n+=`
164
- `),t+=1,s=e[t+1];return n||(n=" "),{fold:n,offset:t}}const Y0={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
165
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function q0(e,t,n,s){const r=e.substr(t,n),o=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(o)}catch{const a=e.substr(t-2,n+2);return s(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}function Xp(e,t,n,s){const{value:r,type:i,comment:o,range:a}=t.type==="block-scalar"?z0(e,t,s):H0(t,e.options.strict,s),c=n?e.directives.tagName(n.source,d=>s(n,"TAG_RESOLVE_FAILED",d)):null;let u;e.options.stringKeys&&e.atKey?u=e.schema[mt]:c?u=Q0(e.schema,r,c,n,s):t.type==="scalar"?u=J0(e,r,t,s):u=e.schema[mt];let p;try{const d=u.resolve(r,f=>s(n??t,"TAG_RESOLVE_FAILED",f),e.options);p=q(d)?d:new z(d)}catch(d){const f=d instanceof Error?d.message:String(d);s(n??t,"TAG_RESOLVE_FAILED",f),p=new z(r)}return p.range=a,p.source=r,i&&(p.type=i),c&&(p.tag=c),u.format&&(p.format=u.format),o&&(p.comment=o),p}function Q0(e,t,n,s,r){var a;if(n==="!")return e[mt];const i=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)i.push(c);else return c;for(const c of i)if((a=c.test)!=null&&a.test(t))return c;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[mt])}function J0({atKey:e,directives:t,schema:n},s,r,i){const o=n.tags.find(a=>{var c;return(a.default===!0||e&&a.default==="key")&&((c=a.test)==null?void 0:c.test(s))})||n[mt];if(n.compat){const a=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(s))})??n[mt];if(o.tag!==a.tag){const c=t.tagString(o.tag),u=t.tagString(a.tag),p=`Value may be parsed as either ${c} or ${u}`;i(r,"TAG_RESOLVE_FAILED",p,!0)}}return o}function X0(e,t,n){if(t){n??(n=t.length);for(let s=n-1;s>=0;--s){let r=t[s];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++s];(r==null?void 0:r.type)==="space";)e+=r.source.length,r=t[++s];break}}return e}const Z0={composeNode:Zp,composeEmptyNode:ac};function Zp(e,t,n,s){const r=e.atKey,{spaceBefore:i,comment:o,anchor:a,tag:c}=n;let u,p=!0;switch(t.type){case"alias":u=ex(e,t,s),(a||c)&&s(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=Xp(e,t,c,s),a&&(u.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=F0(Z0,e,t,n,s),a&&(u.anchor=a.source.substring(1))}catch(d){const f=d instanceof Error?d.message:String(d);s(t,"RESOURCE_EXHAUSTION",f)}break;default:{const d=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;s(t,"UNEXPECTED_TOKEN",d),p=!1}}return u??(u=ac(e,t.offset,void 0,null,n,s)),a&&u.anchor===""&&s(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!q(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&s(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(u.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?u.comment=o:u.commentBefore=o),e.options.keepSourceTokens&&p&&(u.srcToken=t),u}function ac(e,t,n,s,{spaceBefore:r,comment:i,anchor:o,tag:a,end:c},u){const p={type:"scalar",offset:X0(t,n,s),indent:-1,source:""},d=Xp(e,p,a,u);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&u(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(d.spaceBefore=!0),i&&(d.comment=i,d.range[2]=c),d}function ex({options:e},{offset:t,source:n,end:s},r){const i=new Qa(n.substring(1));i.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,a=jr(s,o,e.strict,r);return i.range=[t,o,a.offset],a.comment&&(i.comment=a.comment),i}function tx(e,t,{offset:n,start:s,value:r,end:i},o){const a=Object.assign({_directives:t},e),c=new br(void 0,a),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},p=is(s,{indicator:"doc-start",next:r??(i==null?void 0:i[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});p.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!p.hasNewline&&o(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?Zp(u,r,p,o):ac(u,p.end,s,null,p,o);const d=c.contents.range[2],f=jr(i,d,!1,o);return f.comment&&(c.comment=f.comment),c.range=[n,d,f.offset],c}function Ss(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function _u(e){var r;let t="",n=!1,s=!1;for(let i=0;i<e.length;++i){const o=e[i];switch(o[0]){case"#":t+=(t===""?"":s?`
166
-
167
- `:`
168
- `)+(o.substring(1)||" "),n=!0,s=!1;break;case"%":((r=e[i+1])==null?void 0:r[0])!=="#"&&(i+=1),n=!1;break;default:n||(s=!0),n=!1}}return{comment:t,afterEmptyLine:s}}class nx{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,s,r,i)=>{const o=Ss(n);i?this.warnings.push(new D0(o,s,r)):this.errors.push(new Is(o,s,r))},this.directives=new Ne({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:s,afterEmptyLine:r}=_u(this.prelude);if(s){const i=t.contents;if(n)t.comment=t.comment?`${t.comment}
169
- ${s}`:s;else if(r||t.directives.docStart||!i)t.commentBefore=s;else if(oe(i)&&!i.flow&&i.items.length>0){let o=i.items[0];ce(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${s}
170
- ${a}`:s}else{const o=i.commentBefore;i.commentBefore=o?`${s}
171
- ${o}`:s}}if(n){for(let i=0;i<this.errors.length;++i)t.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)t.warnings.push(this.warnings[i])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:_u(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,s=-1){for(const r of t)yield*this.next(r);yield*this.end(n,s)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,s,r)=>{const i=Ss(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",s,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=tx(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,s=new Is(Ss(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){const s="Unexpected doc-end without preceding document";this.errors.push(new Is(Ss(t),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const n=jr(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const s=this.doc.comment;this.doc.comment=s?`${s}
172
- ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Is(Ss(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const s=Object.assign({_directives:this.directives},this.options),r=new br(void 0,s);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}}const eh="\uFEFF",th="",nh="",Jo="";function sx(e){switch(e){case eh:return"byte-order-mark";case th:return"doc-mode";case nh:return"flow-error-end";case Jo:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
173
- `:case`\r
174
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function Ze(e){switch(e){case void 0:case" ":case`
175
- `:case"\r":case" ":return!0;default:return!1}}const Au=new Set("0123456789ABCDEFabcdef"),rx=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Wr=new Set(",[]{}"),ix=new Set(` ,[]{}
176
- \r `),Kl=e=>!e||ix.has(e);class lx{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let s=this.next??"stream";for(;s&&(n||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
177
- `?!0:n==="\r"?this.buffer[t+1]===`
178
- `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let s=0;for(;n===" ";)n=this.buffer[++s+t];if(n==="\r"){const r=this.buffer[s+t+1];if(r===`
179
- `||!r&&!this.atEnd)return t+s+1}return n===`
180
- `||s>=this.indentNext||!n&&!this.atEnd?t+s:-1}if(n==="-"||n==="."){const s=this.buffer.substr(t,3);if((s==="---"||s==="...")&&Ze(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
181
- `,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===eh&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,s=t.indexOf("#");for(;s!==-1;){const i=t[s-1];if(i===" "||i===" "){n=s-1;break}else s=t.indexOf("#",s+1)}for(;;){const i=t[n-1];if(i===" "||i===" ")n-=1;else break}const r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield th,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&Ze(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Ze(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&Ze(n)){const s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Kl),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,s=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=s=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&r[0]!=="#"||s===0&&(r.startsWith("---")||r.startsWith("..."))&&Ze(r[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield nh,yield*this.parseLineStart();let i=0;for(;r[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Kl),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||Ze(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let i=0;for(;this.buffer[n-1-i]==="\\";)i+=1;if(i%2===0)break;n=this.buffer.indexOf('"',n+1)}const s=this.buffer.substring(0,n);let r=s.indexOf(`
182
- `,this.pos);if(r!==-1){for(;r!==-1;){const i=this.continueScalar(r+1);if(i===-1)break;r=s.indexOf(`
183
- `,i)}r!==-1&&(n=r-(s[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>Ze(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,s;e:for(let i=this.pos;s=this.buffer[i];++i)switch(s){case" ":n+=1;break;case`
184
- `:t=i,n=0;break;case"\r":{const o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
185
- `)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const i=this.continueScalar(t+1);if(i===-1)break;t=this.buffer.indexOf(`
186
- `,i)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let r=t+1;for(s=this.buffer[r];s===" ";)s=this.buffer[++r];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===`
187
- `;)s=this.buffer[++r];t=r-1}else if(!this.blockScalarKeep)do{let i=t-1,o=this.buffer[i];o==="\r"&&(o=this.buffer[--i]);const a=i;for(;o===" ";)o=this.buffer[--i];if(o===`
188
- `&&i>=this.pos&&i+1+n>a)t=i;else break}while(!0);return yield Jo,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,s=this.pos-1,r;for(;r=this.buffer[++s];)if(r===":"){const i=this.buffer[s+1];if(Ze(i)||t&&Wr.has(i))break;n=s}else if(Ze(r)){let i=this.buffer[s+1];if(r==="\r"&&(i===`
189
- `?(s+=1,r=`
190
- `,i=this.buffer[s+1]):n=s),i==="#"||t&&Wr.has(i))break;if(r===`
191
- `){const o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(t&&Wr.has(r))break;n=s}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Jo,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const s=this.buffer.slice(this.pos,t);return s?(yield s,this.pos+=s.length,s.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(Kl),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,s=this.charAt(1);if(Ze(s)||n&&Wr.has(s)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!Ze(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(rx.has(n))n=this.buffer[++t];else if(n==="%"&&Au.has(this.buffer[t+1])&&Au.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
192
- `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
193
- `?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,s;do s=this.buffer[++n];while(s===" "||t&&s===" ");const r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let n=this.pos,s=this.buffer[n];for(;!t(s);)s=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class ox{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,s=this.lineStarts.length;for(;n<s;){const i=n+s>>1;this.lineStarts[i]<t?n=i+1:s=i}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const r=this.lineStarts[n-1];return{line:n,col:t-r+1}}}}function Ot(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Du(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function sh(e){switch(e==null?void 0:e.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Kr(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function Sn(e){var n;if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function Mi(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function Ru(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Ot(t.start,"explicit-key-ind")&&!Ot(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,sh(t.value)?t.value.end?Mi(t.value.end,t.sep):t.value.end=t.sep:Mi(t.start,t.sep),delete t.sep)}class ax{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new lx,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const s of this.lexer.lex(t,n))yield*this.next(s);n||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const n=sx(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const s=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const s=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in s?s.indent:0:n.type==="flow-collection"&&s.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Ru(n),s.type){case"document":s.value=n;break;case"block-scalar":s.props.push(n);break;case"block-map":{const r=s.items[s.items.length-1];if(r.value){s.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=s.items[s.items.length-1];r.value?s.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{const r=s.items[s.items.length-1];!r||r.value?s.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Du(r.start)===-1&&(n.indent===0||r.start.every(i=>i.type!=="comment"||i.indent<n.indent))&&(s.type==="document"?s.end=r.start:s.items.push({start:r.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{Du(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const n=Kr(this.peek(2)),s=Sn(n);let r;t.end?(r=t.end,r.push(this.sourceToken),delete t.end):r=[this.sourceToken];const i={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
194
- `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
195
- `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var s;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0,i=Array.isArray(r)?r[r.length-1]:void 0;(i==null?void 0:i.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],i=(s=r==null?void 0:r.value)==null?void 0:s.end;if(Array.isArray(i)){Mi(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(i&&n.sep&&!n.value){const a=[];for(let c=0;c<n.sep.length;++c){const u=n.sep[c];switch(u.type){case"newline":a.push(c);break;case"space":break;case"comment":u.indent>t.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(o=n.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(o.push(this.sourceToken),t.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ot(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(sh(n.key)&&!Ot(n.sep,"newline")){const a=Sn(n.start),c=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:c,sep:u}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Ot(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const a=Sn(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:o,key:null,sep:[this.sourceToken]}):Ot(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const a=this.flowScalar(this.type);i||n.value?(t.items.push({start:o,key:a,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(a):(Object.assign(n,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{const a=this.startBlockValue(t);if(a){if(a.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Ot(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:o});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var s;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0,i=Array.isArray(r)?r[r.length-1]:void 0;(i==null?void 0:i.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],i=(s=r==null?void 0:r.value)==null?void 0:s.end;if(Array.isArray(i)){Mi(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Ot(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while((s==null?void 0:s.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const s=this.startBlockValue(t);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===t.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const r=Kr(s),i=Sn(r);Ru(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
196
- `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
197
- `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Kr(t),s=Sn(n);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Kr(t),s=Sn(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function cx(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new ox||null,prettyErrors:t}}function ux(e,t={}){const{lineCounter:n,prettyErrors:s}=cx(t),r=new ax(n==null?void 0:n.addNewLine),i=new nx(t);let o=null;for(const a of i.compose(r.parse(e),!0,e.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Is(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&n&&(o.errors.forEach(Iu(e,n)),o.warnings.forEach(Iu(e,n))),o}function dx(e,t,n){let s;const r=ux(e,n);if(!r)return null;if(r.warnings.forEach(i=>Lp(r.options.logLevel,i)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:s},n))}function fx(e,t,n){let s=null;if(Array.isArray(t)&&(s=t),e===void 0){const{keepUndefined:r}={};if(!r)return}return yr(e)&&!s?e.toString(n):new br(e,s,n).toString(n)}const px=new Set(["daemon.host","daemon.port","app.port"]),hx=["js_evaluate","cookie_write"];function Mu(e){const t=e.daemon??{},n=e.security??{},s=e.connectors??{},r=e.audit??{},i=e.output??{},o=e.app??{};return{daemon:{host:String(t.host??"127.0.0.1"),port:Number(t.port??9091)},security:{extensionId:String(n.extensionId??""),highRiskCapabilities:n.highRiskCapabilities??[...hx],approvedHighRisk:n.approvedHighRisk??[],approvalRequired:n.approvalRequired??[],autoApproveConnectors:n.autoApproveConnectors??[],approvalTimeoutMs:Number(n.approvalTimeoutMs??12e4)},connectors:{paths:s.paths??["./connectors","~/.commandgarden/connectors"]},audit:{retentionDays:Number(r.retentionDays??90),dbPath:String(r.dbPath??"~/.commandgarden/audit.db")},output:{defaultFormat:String(i.defaultFormat??"table")},app:{port:Number(o.port??9092)}}}function mx(e){return{daemon:{...e.daemon},security:{...e.security},connectors:{...e.connectors},audit:{...e.audit},output:{...e.output},app:{...e.app}}}function gx(){const[e,t]=w.useState(null),[n,s]=w.useState(null),[r,i]=w.useState([]),[o,a]=w.useState(!0),[c,u]=w.useState(!1),[p,d]=w.useState(null),[f,y]=w.useState(!1),[b,x]=w.useState(""),[v,g]=w.useState(!1),[m,h]=w.useState("");w.useEffect(()=>{Promise.all([F.getConfig(),F.getConnectors()]).then(([C,D])=>{const O=Mu(C.config);t(O),s(structuredClone(O)),i(D.connectors)}).catch(()=>{t(null),s(null)}).finally(()=>a(!1))},[]);const j=w.useMemo(()=>!e||!n?!1:JSON.stringify(e)!==JSON.stringify(n),[e,n]),k=w.useMemo(()=>{if(!e||!n)return 0;let C=0;for(const D of Object.keys(n)){const O=e[D],M=n[D];for(const L of Object.keys(M))JSON.stringify(O[L])!==JSON.stringify(M[L])&&C++}return C},[e,n]),E=w.useCallback(async()=>{if(!e||!n)return;if(!n.daemon.host.trim()){d({type:"error",msg:"Daemon host cannot be empty."});return}u(!0),d(null);let C=!1;try{for(const D of Object.keys(n)){const O=e[D],M=n[D];for(const L of Object.keys(M)){const _=JSON.stringify(M[L]),R=JSON.stringify(O[L]??null);if(_!==R){const $=`${D}.${L}`,Q=M[L];let De;$==="security.approvalTimeoutMs"?De=String(Q):Array.isArray(Q)?De=JSON.stringify(Q):De=String(Q),await F.setConfig($,De),px.has($)&&(C=!0)}}}t(structuredClone(n)),d({type:"success",msg:"Configuration saved."}),C&&y(!0)}catch(D){d({type:"error",msg:D instanceof Error?D.message:"Save failed"})}finally{u(!1),setTimeout(()=>d(null),3e3)}},[e,n]),N=w.useCallback(()=>{e&&s(structuredClone(e))},[e]),S=w.useCallback(()=>{!v&&n&&(x(fx(mx(n))),h("")),g(!v)},[v,n]),T=w.useCallback(()=>{try{const C=dx(b);if(!C||typeof C!="object")throw new Error("Invalid YAML");s(Mu(C)),h("")}catch(C){h(C instanceof Error?C.message:"Invalid YAML")}},[b]),P=w.useCallback((C,D,O)=>{s(M=>M&&{...M,[C]:{...M[C],[D]:O}})},[]),B=w.useCallback((C,D,O)=>{s(M=>{if(!M)return M;const L=M[C],_=L[D]??[];return _.includes(O)?M:{...M,[C]:{...L,[D]:[..._,O]}}})},[]),G=w.useCallback((C,D,O)=>{s(M=>{if(!M)return M;const L=M[C],_=L[D]??[];return{...M,[C]:{...L,[D]:_.filter(R=>R!==O)}}})},[]),K=w.useMemo(()=>({updateField:P,addToArray:B,removeFromArray:G}),[P,B,G]);return o?l.jsx(ht,{label:"Loading configuration..."}):!n||!e?l.jsxs("div",{className:"max-w-3xl mx-auto",children:[l.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Configuration"}),l.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[l.jsx("p",{className:"text-sm opacity-50 mb-2",children:"No configuration found."}),l.jsx("p",{className:"font-mono text-xs opacity-30",children:"Make sure the daemon is running. Configuration will appear here automatically."})]})]}):l.jsxs("div",{className:"max-w-3xl mx-auto pb-20",children:[l.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Configuration"}),f&&l.jsxs("div",{className:"alert alert-warning mb-6",children:[l.jsxs("span",{children:["Some changes require a daemon restart to take effect. Restart with: ",l.jsx("code",{className:"font-mono text-sm",children:"cg down && cg up"})]}),l.jsx("button",{className:"btn btn-sm btn-ghost",onClick:()=>y(!1),children:"Dismiss"})]}),l.jsxs("div",{className:"space-y-8",children:[l.jsx("div",{id:"cfg-server",className:"scroll-mt-4",children:l.jsx(yx,{config:n,actions:K})}),l.jsx("div",{id:"cfg-security",className:"scroll-mt-4",children:l.jsx(xx,{config:n,connectors:r,actions:K})}),l.jsx("div",{id:"cfg-sources",className:"scroll-mt-4",children:l.jsx(vx,{config:n,actions:K})}),l.jsx("div",{id:"cfg-audit",className:"scroll-mt-4",children:l.jsx(wx,{config:n,actions:K})}),l.jsx("div",{id:"cfg-output",className:"scroll-mt-4",children:l.jsx(bx,{config:n,actions:K})}),l.jsx("div",{id:"cfg-journal",className:"scroll-mt-4",children:l.jsx(jx,{})})]}),l.jsxs("div",{className:"mt-8",children:[l.jsxs("button",{className:"btn btn-sm btn-ghost gap-1",onClick:S,children:[v?"▾":"▸"," Raw Configuration (YAML)"]}),v&&l.jsxs("div",{className:"mt-2 border border-base-300 p-4",children:[l.jsx("textarea",{className:"textarea textarea-bordered w-full font-mono text-sm",rows:16,value:b,onChange:C=>x(C.target.value)}),m&&l.jsx("p",{className:"text-error text-sm mt-1",children:m}),l.jsx("button",{className:"btn btn-sm btn-ghost mt-2",onClick:T,children:"Apply to form"})]})]}),j&&l.jsxs("div",{className:"fixed bottom-0 left-0 md:left-56 right-0 bg-base-100 border-t border-base-300 px-6 py-3 flex items-center justify-between z-50",children:[l.jsxs("span",{className:"text-sm opacity-60",children:[k," unsaved ",k===1?"change":"changes"]}),l.jsxs("div",{className:"flex items-center gap-3",children:[p&&l.jsx("span",{className:`text-sm ${p.type==="success"?"text-success":"text-error"}`,children:p.msg}),l.jsx("button",{className:"btn btn-sm btn-ghost",onClick:N,children:"Discard"}),l.jsx("button",{className:"btn btn-sm btn-primary",onClick:E,disabled:c,children:c?"Saving...":"Save changes"})]})]})]})}function ms({title:e,description:t,children:n}){return l.jsxs("div",{className:"border border-base-300 p-5",children:[l.jsx("h3",{className:"font-display font-semibold mb-1",children:e}),l.jsx("p",{className:"text-xs opacity-40 mb-5",children:t}),l.jsx("div",{className:"space-y-5",children:n})]})}function Ie({label:e,help:t,restart:n,children:s}){return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("div",{className:"w-48 shrink-0",children:[l.jsx("label",{className:"font-mono text-[0.7rem] font-medium uppercase tracking-wide",children:e}),n&&l.jsx("span",{className:"ml-1.5 tooltip tooltip-right","data-tip":"Requires daemon restart",children:l.jsx("span",{className:"text-xs opacity-40",children:"⟳"})})]}),l.jsx("div",{className:"flex-1",children:s})]}),l.jsx("p",{className:"text-xs opacity-40 mt-1 max-w-[12rem]",children:t})]})}function yx({config:e,actions:t}){const{updateField:n}=t;return l.jsxs(ms,{title:"Server",description:"Daemon and app server binding configuration",children:[l.jsx(Ie,{label:"Daemon Host",help:"IP address the daemon binds to",restart:!0,children:l.jsx("input",{type:"text",className:"input input-bordered input-sm w-full",required:!0,value:e.daemon.host,onChange:s=>n("daemon","host",s.target.value)})}),l.jsx(Ie,{label:"Daemon Port",help:"Port the daemon listens on",restart:!0,children:l.jsx("input",{type:"number",className:"input input-bordered input-sm w-full",min:1024,max:65535,value:e.daemon.port,onChange:s=>n("daemon","port",Number(s.target.value))})}),l.jsx(Ie,{label:"GUI Port",help:"Port the GUI app server listens on",restart:!0,children:l.jsx("input",{type:"number",className:"input input-bordered input-sm w-full",min:1024,max:65535,value:e.app.port,onChange:s=>n("app","port",Number(s.target.value))})})]})}function $u({values:e,onAdd:t,onRemove:n,placeholder:s}){const[r,i]=w.useState("");return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex flex-wrap gap-1 mb-1",children:e.map(o=>l.jsxs(W,{size:"sm",className:"gap-1",children:[o,l.jsx("button",{className:"text-xs opacity-50 hover:opacity-100",onClick:()=>n(o),children:"×"})]},o))}),l.jsxs("div",{className:"flex gap-1",children:[l.jsx("input",{type:"text",className:"input input-bordered input-xs flex-1",placeholder:s,value:r,onChange:o=>i(o.target.value),onKeyDown:o=>{o.key==="Enter"&&r.trim()&&(t(r.trim()),i(""))}}),l.jsx("button",{className:"btn btn-xs btn-ghost",onClick:()=>{r.trim()&&(t(r.trim()),i(""))},children:"Add"})]})]})}function xx({config:e,connectors:t,actions:n}){const{updateField:s,addToArray:r,removeFromArray:i}=n,o=new Set(e.security.highRiskCapabilities),a=w.useMemo(()=>sl(t),[t]);return l.jsxs(ms,{title:"Connector Security",description:"Manage which connectors are approved and which capabilities require approval",children:[t.length>0&&l.jsx("div",{className:"overflow-x-auto mb-4",children:l.jsxs("table",{className:"table table-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Connector"}),l.jsx("th",{children:"Capabilities"}),l.jsx("th",{children:"Risk"}),l.jsx("th",{children:"Approved"}),l.jsx("th",{children:"Auto-Approve"})]})}),l.jsx("tbody",{children:a.map(([c,u])=>l.jsxs(w.Fragment,{children:[l.jsx("tr",{children:l.jsxs("td",{colSpan:5,className:"bg-base-200/50 font-mono font-semibold text-xs pt-3 pb-1",children:[c,l.jsxs("span",{className:"font-normal opacity-40 ml-2",children:[u.length," ",u.length===1?"connector":"connectors"]})]})}),u.map(p=>{const d=p.key.split("/")[1],f=p.capabilities.some(x=>o.has(x)),y=e.security.approvedHighRisk.includes(p.key),b=e.security.autoApproveConnectors.includes(p.key);return l.jsxs("tr",{children:[l.jsx("td",{className:"font-mono text-sm pl-6",children:d}),l.jsx("td",{children:l.jsx("div",{className:"flex flex-wrap gap-1",children:p.capabilities.map(x=>l.jsx(W,{variant:o.has(x)?"warning":"neutral",size:"xs",children:x},x))})}),l.jsx("td",{children:f?l.jsx(W,{variant:"warning",size:"xs",children:"High"}):l.jsx("span",{className:"opacity-40",children:"—"})}),l.jsx("td",{children:f?l.jsx("input",{type:"checkbox",className:"toggle toggle-sm toggle-success",checked:y,onChange:()=>y?i("security","approvedHighRisk",p.key):r("security","approvedHighRisk",p.key)}):l.jsx("span",{className:"opacity-40",children:"—"})}),l.jsx("td",{children:l.jsx("input",{type:"checkbox",className:"toggle toggle-sm",checked:b,title:"Skip approval prompts — pipeline steps execute without confirmation",onChange:()=>b?i("security","autoApproveConnectors",p.key):r("security","autoApproveConnectors",p.key)})})]},p.key)})]},c))})]})}),l.jsx(Ie,{label:"High-Risk Capabilities",help:"Capabilities that require connector-level approval before first use",children:l.jsx($u,{values:e.security.highRiskCapabilities,onAdd:c=>r("security","highRiskCapabilities",c),onRemove:c=>i("security","highRiskCapabilities",c),placeholder:"Capability name"})}),l.jsx(Ie,{label:"Step Approval Required",help:"Capabilities that pause for user confirmation at each pipeline step",children:l.jsx($u,{values:e.security.approvalRequired,onAdd:c=>r("security","approvalRequired",c),onRemove:c=>i("security","approvalRequired",c),placeholder:"Capability name"})}),l.jsx(Ie,{label:"Approval Timeout (seconds)",help:"How long to wait for approval before aborting the pipeline",children:l.jsx("input",{type:"number",className:"input input-bordered input-sm w-full",min:1,max:600,value:Math.round(e.security.approvalTimeoutMs/1e3),onChange:c=>s("security","approvalTimeoutMs",Number(c.target.value)*1e3)})}),l.jsx(Ie,{label:"Extension ID",help:"Chrome extension ID for origin validation. Leave blank to accept any extension.",children:l.jsx("input",{type:"text",className:"input input-bordered input-sm w-full",placeholder:"Leave blank for any",value:e.security.extensionId,onChange:c=>s("security","extensionId",c.target.value)})})]})}function vx({config:e,actions:t}){const{addToArray:n,removeFromArray:s}=t,[r,i]=w.useState("");return l.jsxs(ms,{title:"Connector Sources",description:"Directories to scan for connector YAML files",children:[l.jsx("div",{className:"space-y-1",children:e.connectors.paths.map((o,a)=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"font-mono text-sm flex-1",children:o}),l.jsx("button",{className:"btn btn-xs btn-ghost opacity-50 hover:opacity-100",onClick:()=>s("connectors","paths",o),children:"×"})]},a))}),l.jsxs("div",{className:"flex gap-1 mt-2",children:[l.jsx("input",{type:"text",className:"input input-bordered input-xs flex-1 font-mono",placeholder:"~/path/to/connectors",value:r,onChange:o=>i(o.target.value),onKeyDown:o=>{o.key==="Enter"&&r.trim()&&(n("connectors","paths",r.trim()),i(""))}}),l.jsx("button",{className:"btn btn-xs btn-ghost",onClick:()=>{r.trim()&&(n("connectors","paths",r.trim()),i(""))},children:"Add path"})]}),l.jsxs("p",{className:"text-xs opacity-40 mt-1",children:["Use ",l.jsx("code",{children:"~/"})," for home directory paths. Relative paths resolve from the install directory."]})]})}function wx({config:e,actions:t}){const{updateField:n}=t;return l.jsxs(ms,{title:"Audit & Retention",description:"Audit log storage and cleanup settings",children:[l.jsx(Ie,{label:"Retention Period",help:"Days to keep audit log entries before cleanup",children:l.jsx("input",{type:"number",className:"input input-bordered input-sm w-full",min:1,max:3650,value:e.audit.retentionDays,onChange:s=>n("audit","retentionDays",Number(s.target.value))})}),l.jsx(Ie,{label:"Database Path",help:"Path to the audit SQLite database. Change only if you need a custom location.",children:l.jsx("input",{type:"text",className:"input input-bordered input-sm w-full font-mono opacity-60",value:e.audit.dbPath,onChange:s=>n("audit","dbPath",s.target.value)})})]})}function bx({config:e,actions:t}){const{updateField:n}=t;return l.jsx(ms,{title:"Output Defaults",description:"Default formatting for CLI output",children:l.jsx(Ie,{label:"Default Output Format",help:"Format used when no --format flag is specified",children:l.jsxs("select",{className:"select select-bordered select-sm w-full",value:e.output.defaultFormat,onChange:s=>n("output","defaultFormat",s.target.value),children:[l.jsx("option",{value:"table",children:"table"}),l.jsx("option",{value:"json",children:"json"}),l.jsx("option",{value:"csv",children:"csv"})]})})})}function jx(){const[e,t]=w.useState(""),[n,s]=w.useState(""),[r,i]=w.useState(""),[o,a]=w.useState("40"),[c,u]=w.useState(!1),[p,d]=w.useState(!1);w.useEffect(()=>{F.getPreferences().then(y=>{if(!y.ok)return;const b=y.preferences;t(b["journal.author"]??""),s(b["journal.ado_org"]??""),i(b["journal.ado_repos"]??""),a(b["journal.target_hours"]??"40"),u(!0)}).catch(()=>u(!0))},[]);async function f(){await Promise.all([F.setPreference("journal.author",e),F.setPreference("journal.ado_org",n),F.setPreference("journal.ado_repos",r),F.setPreference("journal.target_hours",o)]),d(!0),setTimeout(()=>d(!1),2e3)}return c?l.jsxs(ms,{title:"Journal Settings",description:"Configure your Dev Work Journal data sources",children:[l.jsx(Ie,{label:"Author",help:"Your name or email as it appears in ADO commits (e.g. mun_hong.lee@mercedes-benz.com)",children:l.jsx("input",{type:"text",className:"input input-bordered input-sm w-full",placeholder:"your.name@company.com",value:e,onChange:y=>t(y.target.value)})}),l.jsx(Ie,{label:"ADO Organization",help:"Azure DevOps organization name (e.g. daimler-mic)",children:l.jsx("input",{type:"text",className:"input input-bordered input-sm w-full",placeholder:"daimler-mic",value:n,onChange:y=>s(y.target.value)})}),l.jsx(Ie,{label:"ADO Repos",help:'Comma-separated project/repo pairs (e.g. "mic-dns/mic-dns-api,mic-dns/mic-dns-ui")',children:l.jsx("input",{type:"text",className:"input input-bordered input-sm w-full font-mono",placeholder:"project/repo,project/repo",value:r,onChange:y=>i(y.target.value)})}),l.jsx(Ie,{label:"Weekly Target Hours",help:"Target hours per week for the hours progress bar (default 40)",children:l.jsx("input",{type:"number",className:"input input-bordered input-sm w-20",min:1,max:80,value:o,onChange:y=>a(y.target.value)})}),l.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[l.jsx("button",{className:"btn btn-primary btn-sm",onClick:f,children:"Save Journal Settings"}),p&&l.jsx("span",{className:"text-success text-sm",children:"Saved ✓"})]})]}):null}const kx=l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",className:"w-3.5 h-3.5",children:l.jsx("path",{d:"M20 6 9 17l-5-5"})});function Nx(){const[e,t]=w.useState(!1),[n,s]=w.useState(!1),[r,i]=w.useState(0),[o,a]=w.useState([]),[c,u]=w.useState([]),[p,d]=w.useState(null),f=w.useCallback(async()=>{try{const k=await F.getStatus();t(k.ok),s(k.extensionConnected),i(k.connectorCount)}catch{t(!1),s(!1),i(0)}try{const k=await F.getConnectors();a(k.connectors);const N=(await F.getConfig().catch(()=>({ok:!1,config:{}}))).config.security??{};u(N.approvedHighRisk??[])}catch{}},[]);w.useEffect(()=>{f();const k=setInterval(f,1e4);return()=>clearInterval(k)},[f]);const y=w.useCallback(async k=>{d(k);try{const E=[...c,k];await F.setConfig("security.approvedHighRisk",JSON.stringify(E)),f()}catch{}finally{d(null)}},[c,f]),b=o.filter(k=>k.isHighRisk&&!k.isApproved),x=b.length>0,v=[{id:"daemon",label:"Background service",ok:e,detail:e?"Running":"Not running",instructions:"Run cg up in your terminal to start commandGarden. This launches the background service and opens the web interface."},{id:"extension",label:"Browser extension",ok:n,detail:n?"Connected":"Not connected",instructions:"Install the commandGarden Chrome extension, then open Chrome. The extension connects automatically when the background service is running."},{id:"connectors",label:"Connectors installed",ok:r>0,detail:r>0?`${r} available`:"None found",instructions:"Connectors are loaded automatically when you start the service. If none appear, check that connector files exist in ~/.commandgarden/connectors/ and restart with cg up."}];x&&v.push({id:"permissions",label:"Connector permissions",ok:!1,detail:`${b.length} need${b.length===1?"s":""} authorization`,instructions:"Some connectors need authorization before first use. You can authorize them here or in Configuration → Connector Security."});const g=v.filter(k=>k.ok).length,m=v.length,h=g===m,j=w.useMemo(()=>sl(o),[o]);return l.jsxs("div",{className:"max-w-3xl mx-auto",children:[l.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"Setup Guide"}),l.jsx("p",{className:"text-sm opacity-60 mb-6",children:"Complete these steps to start running connectors from your browser."}),l.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[l.jsx("div",{className:"flex-1 h-1.5 bg-base-300 overflow-hidden",children:l.jsx("div",{className:"h-full bg-success transition-all duration-300 ease-out",style:{width:`${m>0?g/m*100:0}%`}})}),l.jsxs("span",{className:"font-mono text-xs opacity-50 shrink-0",children:[g,"/",m]})]}),l.jsx("div",{className:"space-y-3 mb-8",children:v.map((k,E)=>l.jsxs("div",{className:`border ${k.ok?"border-base-300":"border-base-300 bg-base-200/50"}`,children:[l.jsxs("div",{className:"p-4 flex items-center gap-3",children:[l.jsx("span",{className:`w-5 h-5 flex items-center justify-center font-mono text-xs font-bold shrink-0 ${k.ok?"bg-success text-success-content":"border border-base-300 text-base-content/50"}`,children:k.ok?kx:E+1}),l.jsx("span",{className:"font-semibold flex-1",children:k.label}),l.jsx(W,{variant:k.ok?"success":"warning",children:k.detail})]}),!k.ok&&l.jsxs("div",{className:"px-4 pb-4 text-sm opacity-70 border-t border-base-300/50 pt-3 ml-8",children:[k.instructions,k.id==="permissions"&&b.length>0&&l.jsx("div",{className:"mt-3 space-y-2",children:b.map(N=>l.jsxs("div",{className:"flex items-center justify-between gap-3 py-1.5",children:[l.jsxs("div",{children:[l.jsx("span",{className:"font-mono text-sm",children:N.key}),N.description&&l.jsx("span",{className:"text-xs opacity-50 ml-2",children:N.description})]}),l.jsx("button",{className:"btn btn-sm btn-warning btn-outline shrink-0",disabled:p===N.key,onClick:()=>y(N.key),children:p===N.key?"Authorizing…":"Authorize"})]},N.key))})]})]},E))}),h&&o.length>0&&l.jsxs("div",{className:"border border-success/30 bg-success/5 p-5",children:[l.jsx("p",{className:"font-semibold text-success mb-3",children:"Everything's ready. Pick a connector to try."}),l.jsx("div",{className:"space-y-3",children:j.map(([k,E])=>l.jsxs("div",{children:[l.jsx("span",{className:"font-mono font-semibold text-sm",children:k}),l.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:E.map(N=>{const S=N.key.split("/")[1];return l.jsx(yn,{to:`/connectors/${k}/${S}`,className:"btn btn-sm btn-outline",children:l.jsx("span",{className:"font-mono",children:S})},N.key)})})]},k))})]}),!h&&o.length>0&&l.jsxs("div",{className:"border-t border-base-300 pt-6",children:[l.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.12em] mb-4",children:"Installed connectors"}),l.jsx("div",{className:"space-y-4",children:j.map(([k,E])=>l.jsxs("div",{children:[l.jsx("div",{className:"font-mono font-semibold text-sm mb-1.5",children:k}),l.jsx("div",{className:"space-y-1",children:E.map(N=>{const S=N.key.split("/")[1];return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-baseline gap-2",children:[l.jsx("span",{className:"font-mono text-sm",children:S}),l.jsx(W,{size:"xs",children:N.access})]}),N.description&&l.jsx("div",{className:"text-xs opacity-40 mb-1",children:N.description})]},N.key)})})]},k))}),l.jsx(yn,{to:"/connectors",className:"inline-flex items-center gap-1 font-mono text-xs mt-5 opacity-50 hover:opacity-80 transition-opacity",children:"View all connectors →"})]})]})}function ur({message:e}){return l.jsx("div",{role:"alert",className:"alert alert-warning",children:l.jsx("span",{children:e??"Sign in to the target app in Chrome, then try again."})})}function rh(e){const t=e.getDay();return t!==0&&t!==6}function Sx(e){const[t,n]=e.split("-").map(Number),s=new Date(t,n,0).getDate();let r=0;for(let i=1;i<=s;i++)rh(new Date(t,n-1,i))&&r++;return r}function Cx(e,t){const[n,s]=e.split("-").map(Number),r=new Date(t+"T00:00:00"),i=new Date(n,s,0),o=r>i?i:r;let a=0;for(let c=1;c<=o.getDate();c++){const u=new Date(n,s-1,c);if(u>o)break;rh(u)&&a++}return a}function Ex(e){const{targetHours:t,actualHours:n,month:s,today:r}=e,i=Sx(s),o=Cx(s,r),a=i-o,c=t>0?n/t*100:0,u=Math.max(0,(t-n)/8);if(n>=t)return{status:"reached",percentage:c,daysRemaining:0,hoursPerDayNeeded:0,workingDaysTotal:i,workingDaysElapsed:o,workingDaysRemaining:a};const p=i>0?t/i*o:0,d=a>0?Math.max(0,(t-n)/a):0;let f;return n>=p?f="on_track":i>0&&o/i<.8?f="behind":f="at_risk",{status:f,percentage:c,daysRemaining:u,hoursPerDayNeeded:d,workingDaysTotal:i,workingDaysElapsed:o,workingDaysRemaining:a}}const Tx={reached:"bg-success",on_track:"bg-success",behind:"bg-warning",at_risk:"bg-error"};function Lx({percentage:e,status:t,className:n=""}){const s=Math.min(100,Math.max(0,e));return l.jsx("div",{className:`h-2 bg-base-300 ${n}`,children:l.jsx("div",{className:`h-full ${Tx[t]} transition-[width] duration-150`,style:{width:`${s}%`}})})}/**
198
- * @license lucide-react v1.23.0 - ISC
199
- *
200
- * This source code is licensed under the ISC license.
201
- * See the LICENSE file in the root directory of this source tree.
202
- */const ih=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/**
203
- * @license lucide-react v1.23.0 - ISC
204
- *
205
- * This source code is licensed under the ISC license.
206
- * See the LICENSE file in the root directory of this source tree.
207
- */const Px=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
208
- * @license lucide-react v1.23.0 - ISC
209
- *
210
- * This source code is licensed under the ISC license.
211
- * See the LICENSE file in the root directory of this source tree.
212
- */const Ix=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());/**
213
- * @license lucide-react v1.23.0 - ISC
214
- *
215
- * This source code is licensed under the ISC license.
216
- * See the LICENSE file in the root directory of this source tree.
217
- */const Fu=e=>{const t=Ix(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
218
- * @license lucide-react v1.23.0 - ISC
219
- *
220
- * This source code is licensed under the ISC license.
221
- * See the LICENSE file in the root directory of this source tree.
222
- */var Vl={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"};/**
223
- * @license lucide-react v1.23.0 - ISC
224
- *
225
- * This source code is licensed under the ISC license.
226
- * See the LICENSE file in the root directory of this source tree.
227
- */const Ox=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},_x=w.createContext({}),Ax=()=>w.useContext(_x),Dx=w.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:s,className:r="",children:i,iconNode:o,...a},c)=>{const{size:u=24,strokeWidth:p=2,absoluteStrokeWidth:d=!1,color:f="currentColor",className:y=""}=Ax()??{},b=s??d?Number(n??p)*24/Number(t??u):n??p;return w.createElement("svg",{ref:c,...Vl,width:t??u??Vl.width,height:t??u??Vl.height,stroke:e??f,strokeWidth:b,className:ih("lucide",y,r),...!i&&!Ox(a)&&{"aria-hidden":"true"},...a},[...o.map(([x,v])=>w.createElement(x,v)),...Array.isArray(i)?i:[i]])});/**
228
- * @license lucide-react v1.23.0 - ISC
229
- *
230
- * This source code is licensed under the ISC license.
231
- * See the LICENSE file in the root directory of this source tree.
232
- */const fl=(e,t)=>{const n=w.forwardRef(({className:s,...r},i)=>w.createElement(Dx,{ref:i,iconNode:t,className:ih(`lucide-${Px(Fu(e))}`,`lucide-${e}`,s),...r}));return n.displayName=Fu(e),n};/**
233
- * @license lucide-react v1.23.0 - ISC
234
- *
235
- * This source code is licensed under the ISC license.
236
- * See the LICENSE file in the root directory of this source tree.
237
- */const Rx=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Mx=fl("circle-check-big",Rx);/**
238
- * @license lucide-react v1.23.0 - ISC
239
- *
240
- * This source code is licensed under the ISC license.
241
- * See the LICENSE file in the root directory of this source tree.
242
- */const $x=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Fx=fl("clock",$x);/**
243
- * @license lucide-react v1.23.0 - ISC
244
- *
245
- * This source code is licensed under the ISC license.
246
- * See the LICENSE file in the root directory of this source tree.
247
- */const zx=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Bx=fl("trending-up",zx);/**
248
- * @license lucide-react v1.23.0 - ISC
249
- *
250
- * This source code is licensed under the ISC license.
251
- * See the LICENSE file in the root directory of this source tree.
252
- */const Ux=[["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"}]],Hx=fl("triangle-alert",Ux),Wx={reached:Mx,on_track:Bx,behind:Fx,at_risk:Hx},Kx={reached:"text-success",on_track:"text-success",behind:"text-warning",at_risk:"text-error"},Vx={reached:"bg-success/10",on_track:"bg-success/5",behind:"bg-warning/10",at_risk:"bg-error/10"};function Gx(e,t,n){const s=n.find(r=>r.projectId===e&&r.activity===t);return(s==null?void 0:s.totalHours)??0}function Yx({goals:e,activityHours:t,projectNames:n,activityNames:s,month:r,today:i}){return e.length===0?null:l.jsx("div",{className:"border border-base-300",children:e.map((o,a)=>{const c=Gx(o.projectId,o.activity,t),u=Ex({targetHours:o.targetHours,actualHours:c,month:r,today:i}),p=n.get(o.projectId),d=Wx[u.status];return l.jsxs("div",{className:`grid grid-cols-[auto_1fr_auto_1fr] gap-0 ${Vx[u.status]} ${a>0?"border-t border-base-300":""}`,children:[l.jsx("div",{className:"p-3 border-r border-base-300 flex items-center justify-center",children:l.jsx(d,{size:18,className:Kx[u.status]})}),l.jsxs("div",{className:"p-3 border-r border-base-300",children:[l.jsx("div",{className:"font-display font-semibold text-sm",children:p??o.projectId}),l.jsxs("div",{className:"font-mono text-[0.6rem] opacity-50 mt-0.5",children:[p?`${o.projectId} · `:"",s.get(`${o.projectId}\0${o.activity}`)??o.activity]})]}),l.jsxs("div",{className:"p-3 border-r border-base-300 text-right min-w-[7rem]",children:[l.jsxs("div",{className:"font-display font-semibold text-sm",children:[Math.round(c*10)/10,"/",o.targetHours,"h"]}),l.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mt-0.5",children:[o.targetDays,"d target"]})]}),l.jsxs("div",{className:"p-3",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(Lx,{percentage:u.percentage,status:u.status,className:"flex-1"}),l.jsxs("span",{className:"font-mono text-xs font-medium min-w-[3rem] text-right",children:[Math.round(u.percentage),"%"]})]}),u.status==="reached"?l.jsx("div",{className:"font-mono text-[0.6rem] font-medium text-success uppercase tracking-[0.1em]",children:"Goal reached"}):l.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:u.workingDaysRemaining>0?`Book ${Math.round(u.hoursPerDayNeeded*10)/10}h/day · ${u.workingDaysRemaining} days left`:`${Math.round(u.daysRemaining*10)/10} days remaining`})]})]},o.id)})})}function qx({goals:e,month:t,onGoalChange:n,knownCombos:s,projectNames:r,activityNames:i,onRefreshProjects:o,refreshingProjects:a}){const[c,u]=w.useState(""),[p,d]=w.useState(""),[f,y]=w.useState(null),[b,x]=w.useState(""),[v,g]=w.useState(!1),m=w.useMemo(()=>{const T=new Set(e.map(P=>`${P.projectId}\0${P.activity}`));return s.filter(P=>!T.has(`${P.projectId}\0${P.activity}`))},[s,e]);function h(T){const P=T.indexOf("\0");return P<0?null:{projectId:T.slice(0,P),activity:T.slice(P+1)}}function j(T){return r.get(T)??T}function k(T,P){const B=i.get(`${T}\0${P}`);return B?`${j(T)} / ${B}`:`${j(T)} / ${P}`}async function E(){const T=h(c),P=parseFloat(p);if(!(!T||isNaN(P)||P<.5||P>31)){g(!0);try{await F.upsertGoal({month:t,projectId:T.projectId,activity:T.activity,targetDays:P}),u(""),d(""),n()}finally{g(!1)}}}async function N(T){g(!0);try{await F.deleteGoal(T),n()}finally{g(!1)}}async function S(T){const P=parseFloat(b);if(isNaN(P)||P<.5||P>31){y(null);return}g(!0);try{await F.upsertGoal({month:T.month,projectId:T.projectId,activity:T.activity,targetDays:P}),y(null),n()}finally{g(!1)}}return l.jsxs("details",{children:[l.jsxs("summary",{className:"cursor-pointer text-sm font-semibold mb-2",children:["Manage goals (",e.length,")"]}),l.jsxs("div",{className:"mt-2 space-y-3",children:[e.length>0&&l.jsx("div",{className:"overflow-x-auto border border-base-300",children:l.jsxs("table",{className:"table table-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Project"}),l.jsx("th",{children:"Activity"}),l.jsx("th",{className:"text-right",children:"Target (days)"}),l.jsx("th",{className:"text-right",children:"Target (hours)"}),l.jsx("th",{children:"Actions"})]})}),l.jsx("tbody",{children:e.map(T=>l.jsxs("tr",{children:[l.jsxs("td",{children:[l.jsx("div",{className:"text-sm",children:j(T.projectId)}),r.has(T.projectId)&&l.jsx("div",{className:"font-mono text-[0.6rem] opacity-50",children:T.projectId})]}),l.jsxs("td",{children:[l.jsx("div",{className:"text-sm",children:i.get(`${T.projectId}\0${T.activity}`)??T.activity}),l.jsx("div",{className:"font-mono text-[0.6rem] opacity-50",children:T.activity})]}),l.jsx("td",{className:"text-right",children:f===T.id?l.jsx("input",{type:"number",step:"0.5",className:"input input-bordered input-xs w-20 text-right",value:b,onChange:P=>x(P.target.value),onBlur:()=>S(T),onKeyDown:P=>{P.key==="Enter"&&S(T),P.key==="Escape"&&y(null)},autoFocus:!0}):T.targetDays}),l.jsx("td",{className:"text-right",children:T.targetHours}),l.jsxs("td",{className:"flex gap-1",children:[l.jsx("button",{className:"btn btn-ghost btn-xs font-mono",onClick:()=>{y(T.id),x(String(T.targetDays))},disabled:v,"aria-label":`Edit goal ${T.projectId} ${T.activity}`,children:"Edit"}),l.jsx("button",{className:"btn btn-ghost btn-xs text-error font-mono",onClick:()=>N(T.id),disabled:v,"aria-label":`Delete goal ${T.projectId} ${T.activity}`,children:"Del"})]})]},T.id))})]})}),l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsxs("select",{className:"select select-bordered select-sm",value:c,onChange:T=>u(T.target.value),children:[l.jsx("option",{value:"",children:"Select project / activity…"}),m.map(T=>l.jsx("option",{value:`${T.projectId}\0${T.activity}`,children:k(T.projectId,T.activity)},`${T.projectId}\0${T.activity}`))]}),l.jsx("input",{type:"number",step:"0.5",min:"0.5",max:"31",placeholder:"Days",className:"input input-bordered input-sm w-24",value:p,onChange:T=>d(T.target.value)}),l.jsx("button",{className:"btn btn-primary btn-sm",onClick:E,disabled:v||!c,children:"Add"}),l.jsx("button",{className:"btn btn-ghost btn-sm font-mono text-xs opacity-60",onClick:o,disabled:a,children:a?"Refreshing…":"Refresh projects"})]})]})]})}function Qx(e,t){var K;const[n,s]=w.useState([]),[r,i]=w.useState([]),[o,a]=w.useState(null),[c,u]=w.useState([]),p=w.useRef(c);p.current=c;const[d,f]=w.useState(!1),y=w.useCallback(async()=>{try{const C=await F.getGoals(e);s(C.goals)}catch{}},[e]),b=w.useCallback(async()=>{try{const C=await F.getCachedReport(e);C.data?(i(C.data),a(C.fetchedAt)):(i([]),a(null))}catch{}},[e]),x=w.useCallback(async()=>{try{const C=await F.getCachedProjects();C.data&&u(C.data)}catch{}},[]),v=w.useCallback(async()=>{f(!0);try{const C=await F.run("timetracking/projects",{month:e});if(C.ok&&C.data&&C.data.length>0){const D=C.data.map(O=>({projectId:String(O.projectId??""),projectName:String(O.projectName??""),activityNumber:String(O.activityNumber??""),activityName:String(O.activityName??""),category:String(O.category??""),linePropertyId:String(O.linePropertyId??"")}));u(D),await F.cacheProjects(D)}}catch{}f(!1)},[e]);w.useEffect(()=>{y(),b(),x()},[y,b,x]);const g=t==null?void 0:t.data;w.useEffect(()=>{if(g&&g.length>0){a(null),F.cacheReport(e,g).catch(()=>{});const C=new Set,D=[];for(const O of g){const M=String(O.projectId??""),L=String(O.activity??"");if(!M||!L)continue;const _=`${M}\0${L}`;C.has(_)||(C.add(_),D.push({projectId:M,projectName:O.projectName?String(O.projectName):M,activityNumber:L,activityName:O.activityName?String(O.activityName):L,category:String(O.category??""),linePropertyId:""}))}if(D.length>0){const O=new Map;for(const L of p.current)O.set(`${L.projectId}\0${L.activityNumber}`,L);for(const L of D)O.set(`${L.projectId}\0${L.activityNumber}`,L);const M=Array.from(O.values());u(M),F.cacheProjects(M).catch(()=>{})}}},[g,e]);const m=((t==null?void 0:t.data)??[]).length>0?(t==null?void 0:t.data)??[]:r,h=m===r&&r.length>0&&!((K=t==null?void 0:t.data)!=null&&K.length),{projectNames:j,activityNames:k}=w.useMemo(()=>{const C=new Map,D=new Map;for(const O of c)O.projectId&&O.projectName&&C.set(O.projectId,O.projectName),O.projectId&&O.activityNumber&&O.activityName&&D.set(`${O.projectId}\0${O.activityNumber}`,O.activityName);for(const O of m){const M=String(O.projectId??""),L=O.projectName?String(O.projectName):null;M&&L&&C.set(M,L);const _=String(O.activity??""),R=O.activityName?String(O.activityName):null;M&&_&&R&&D.set(`${M}\0${_}`,R)}return{projectNames:C,activityNames:D}},[c,m]),{projectList:E,totalHours:N,draftCount:S,workingDayCount:T}=w.useMemo(()=>{const C=new Map;let D=0,O=0;const M=new Set;for(const L of m){const _=String(L.projectId??"Unknown"),R=Number(L.hours??0),$=String(L.date??""),Q=String(L.status??""),De=String(L.activity??"");D+=R,$&&M.add($),Q==="draft"&&O++,C.has(_)||C.set(_,{projectId:_,totalHours:0,entryCount:0,activities:new Set});const Je=C.get(_);if(Je.totalHours+=R,Je.entryCount++,De){const gs=k.get(`${_}\0${De}`)??De;Je.activities.add(gs)}}return{projectList:Array.from(C.values()).sort((L,_)=>_.totalHours-L.totalHours),totalHours:D,draftCount:O,workingDayCount:M.size}},[m,k]),P=w.useMemo(()=>{const C=new Map;for(const D of m){const O=String(D.projectId??"Unknown"),M=String(D.activity??""),L=Number(D.hours??0),_=`${O}\0${M}`,R=C.get(_);R?R.totalHours+=L:C.set(_,{projectId:O,activity:M,totalHours:L})}return Array.from(C.values())},[m]),B=w.useMemo(()=>c.length>0?c.map(C=>({projectId:C.projectId,activity:C.activityNumber})):P.map(C=>({projectId:C.projectId,activity:C.activity})),[c,P]),G=new Date().toISOString().slice(0,10);return{goals:n,loadGoals:y,rows:m,isCached:h,cachedAt:o,projectNames:j,activityNames:k,projectList:E,totalHours:N,draftCount:S,workingDayCount:T,activityHours:P,allCombos:B,todayStr:G,refreshProjects:v,refreshingProjects:d}}function Jx(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`}function Xx(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const s=Math.floor(n/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function Zx(){const[e,t]=w.useState(Jx()),[n,s]=w.useState(!1),{running:r,result:i,error:o,approvalPending:a,approvalId:c,run:u,handleApproval:p,reset:d}=Ga(),{goals:f,loadGoals:y,rows:b,isCached:x,cachedAt:v,projectNames:g,activityNames:m,projectList:h,totalHours:j,draftCount:k,workingDayCount:E,activityHours:N,allCombos:S,todayStr:T,refreshProjects:P,refreshingProjects:B}=Qx(e,i),G=(o==null?void 0:o.includes("auth_required"))||(o==null?void 0:o.includes("sign in")),K=w.useCallback(async()=>{const C={};e&&(C.month=e),await u("timetracking/report",C),await y()},[e,u,y]);return l.jsxs("div",{className:"max-w-4xl mx-auto",children:[l.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Time Tracking"}),l.jsxs("div",{className:"flex items-end gap-4 mb-6",children:[l.jsxs("label",{className:"form-control",children:[l.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Month"}),l.jsx("input",{type:"month",className:"input input-bordered input-sm",value:e,onChange:C=>{t(C.target.value),d()},onClick:C=>{var D,O;return(O=(D=C.target).showPicker)==null?void 0:O.call(D)}})]}),l.jsx("button",{className:"btn btn-primary btn-sm",onClick:K,disabled:r,children:r?"Loading...":"Load report"})]}),r&&!a&&l.jsx(ht,{label:"Fetching timetracking data..."}),a&&l.jsxs("div",{className:"alert alert-warning mb-4",children:[l.jsx("span",{children:"This connector requires approval before proceeding."}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>p(!0),disabled:!c,children:"Approve"}),l.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>p(!1),disabled:!c,children:"Reject"})]})]}),G&&l.jsx(ur,{message:"Sign in to the timetracking portal in Chrome, then try again."}),o&&!G&&l.jsx("div",{className:"alert alert-error mb-4",children:l.jsx("span",{children:o})}),b.length>0&&l.jsxs(l.Fragment,{children:[x&&v&&l.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-2",children:["Showing cached data from ",Xx(v)]}),l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 border border-base-300 mb-6",children:[l.jsxs("div",{className:"p-3 border-r border-b border-base-300 md:border-b-0",children:[l.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Total hours"}),l.jsx("div",{className:"font-display text-xl font-bold",children:j.toFixed(1)})]}),l.jsxs("div",{className:"p-3 border-b border-base-300 md:border-r md:border-b-0",children:[l.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Working days"}),l.jsx("div",{className:"font-display text-xl font-bold",children:E})]}),l.jsxs("div",{className:"p-3 border-r border-base-300",children:[l.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Projects"}),l.jsx("div",{className:"font-display text-xl font-bold",children:h.length})]}),l.jsxs("div",{className:"p-3",children:[l.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Draft entries"}),l.jsx("div",{className:"font-display text-xl font-bold",children:k})]})]}),l.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"By project"}),l.jsx("div",{className:"overflow-x-auto border border-base-300 mb-6",children:l.jsxs("table",{className:"table table-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Project"}),l.jsx("th",{children:"Activities"}),l.jsx("th",{className:"text-right",children:"Hours"}),l.jsx("th",{className:"text-right",children:"Entries"})]})}),l.jsx("tbody",{children:h.map(C=>l.jsxs("tr",{children:[l.jsx("td",{children:g.has(C.projectId)?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"text-sm",children:g.get(C.projectId)}),l.jsx("div",{className:"font-mono text-[0.6rem] opacity-50",children:C.projectId})]}):l.jsx("span",{className:"font-mono text-sm",children:C.projectId})}),l.jsx("td",{className:"text-sm",children:Array.from(C.activities).join(", ")}),l.jsx("td",{className:"text-right font-semibold",children:C.totalHours.toFixed(1)}),l.jsx("td",{className:"text-right",children:C.entryCount})]},C.projectId))})]})}),l.jsxs("details",{open:n,onToggle:C=>s(C.target.open),children:[l.jsxs("summary",{className:"cursor-pointer text-sm font-semibold mb-2",children:["Raw booking lines (",b.length,")"]}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"table table-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Date"}),l.jsx("th",{children:"Project"}),l.jsx("th",{children:"Activity"}),l.jsx("th",{className:"text-right",children:"Hours"}),l.jsx("th",{children:"Status"})]})}),l.jsx("tbody",{children:b.map((C,D)=>l.jsxs("tr",{children:[l.jsx("td",{children:String(C.date??"")}),l.jsx("td",{className:"font-mono text-xs",children:String(C.projectId??"")}),l.jsx("td",{children:String(C.activity??"")}),l.jsx("td",{className:"text-right",children:Number(C.hours??0).toFixed(1)}),l.jsx("td",{children:l.jsx(W,{variant:String(C.status)==="posted"?"success":"warning",size:"xs",children:String(C.status??"")})})]},D))})]})})]})]}),i&&(i.data??[]).length===0&&b.length===0&&!o&&l.jsxs("p",{className:"text-sm opacity-50",children:["No entries found for ",e,"."]}),f.length>0&&l.jsxs("div",{className:"mb-6",children:[l.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Goal progress"}),l.jsx(Yx,{goals:f,activityHours:N,projectNames:g,activityNames:m,month:e,today:T})]}),l.jsx("div",{className:"mt-6",children:l.jsx(qx,{goals:f,month:e,onGoalChange:y,knownCombos:S,projectNames:g,activityNames:m,onRefreshProjects:P,refreshingProjects:B})})]})}const ev=["MBTMY THE BASE CAMP","MBTMY THE TRAILHEAD","MBTMY THE FOOTHILLS","MBTMY THE BRIDGE","MBTMY THE MEADOW","MBTMY THE FOREST","MBTMY THE LOOKOUT","MBTMY THE CLIFFSIDE","MBTMY THE LEDGE","MBTMY THE HIGHPOINT","MBTMY THE VISTA","MBTMY THE SHOULDER","MBTMY THE PINNACLE","MBTMY THE DESCENT"];function tv({value:e,onChange:t}){const[n,s]=w.useState(!1),[r,i]=w.useState(-1),o=w.useRef(null),a=w.useRef(null),c=ev.filter(d=>d.toLowerCase().includes(e.toLowerCase())),u=w.useCallback(d=>{t(d),s(!1),i(-1)},[t]);w.useEffect(()=>{function d(f){o.current&&!o.current.contains(f.target)&&(s(!1),i(-1))}return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[]),w.useEffect(()=>{var d;if(r>=0&&a.current){const f=a.current.children[r];(d=f==null?void 0:f.scrollIntoView)==null||d.call(f,{block:"nearest"})}},[r]);function p(d){if(!n&&(d.key==="ArrowDown"||d.key==="ArrowUp")){s(!0),i(0),d.preventDefault();return}if(n)switch(d.key){case"ArrowDown":d.preventDefault(),i(f=>f<c.length-1?f+1:0);break;case"ArrowUp":d.preventDefault(),i(f=>f>0?f-1:c.length-1);break;case"Enter":d.preventDefault(),r>=0&&r<c.length&&u(c[r]);break;case"Escape":d.preventDefault(),s(!1),i(-1);break}}return l.jsxs("div",{ref:o,className:"relative w-full",children:[l.jsx("input",{className:"input input-bordered input-sm w-full",placeholder:"Search or type a room name…",value:e,onChange:d=>{t(d.target.value),s(!0),i(-1)},onFocus:()=>s(!0),onKeyDown:p,role:"combobox","aria-expanded":n,"aria-autocomplete":"list","aria-controls":"room-listbox"}),n&&c.length>0&&l.jsx("ul",{ref:a,id:"room-listbox",role:"listbox",className:"menu dropdown-content bg-base-200 z-10 mt-1 max-h-60 w-full overflow-y-auto border border-base-300 absolute",children:c.map((d,f)=>l.jsx("li",{role:"option","aria-selected":f===r,children:l.jsx("button",{type:"button",className:f===r?"active":"",onMouseDown:y=>{y.preventDefault(),u(d)},onMouseEnter:()=>i(f),children:d})},d))})]})}const zu={free:"success",busy:"error",tentative:"warning",oof:"secondary",elsewhere:"info"},nv={free:"bg-success/20 border-success/40",busy:"bg-error/20 border-error/40",tentative:"bg-warning/20 border-warning/40",oof:"bg-secondary/20 border-secondary/40",elsewhere:"bg-info/20 border-info/40"},sv={free:"bg-success/35 border-success/60",busy:"bg-error/35 border-error/60",tentative:"bg-warning/35 border-warning/60",oof:"bg-secondary/35 border-secondary/60",elsewhere:"bg-info/35 border-info/60"};function Cn(e){const t=e.match(/(\d{1,2}:\d{2})/);return t?t[1]:e}function rv({rows:e}){var r,i;const[t,n]=w.useState(null),s=e.reduce((o,a)=>o+(a.durationMin??0),0);return l.jsxs("div",{children:[s>0&&l.jsxs("div",{className:"mb-6",children:[l.jsx("div",{className:"flex h-10 overflow-hidden gap-px border border-base-300",children:e.map((o,a)=>{const c=s>0?(o.durationMin??0)/s*100:0;if(c<.5)return null;const u=t===a,p=u?sv[o.state??""]??"bg-base-300":nv[o.state??""]??"bg-base-300";return l.jsxs("div",{className:`${p} border flex items-center justify-center text-xs transition-colors duration-75 cursor-default relative`,style:{width:`${c}%`},onMouseEnter:()=>n(a),onMouseLeave:()=>n(null),children:[c>12&&l.jsx("span",{className:"opacity-60 truncate px-1 font-mono text-[0.65rem] uppercase tracking-wide",children:o.state}),u&&l.jsxs("div",{className:"absolute -top-9 left-1/2 -translate-x-1/2 bg-base-300 border border-base-content/10 px-2 py-1 text-[0.65rem] font-mono whitespace-nowrap z-10 pointer-events-none",children:[o.state,": ",Cn(o.start??""),"–",Cn(o.end??"")," (",o.durationMin,"m)"]})]},a)})}),l.jsxs("div",{className:"flex justify-between mt-1",children:[l.jsx("span",{className:"font-mono text-[0.6rem] opacity-30",children:Cn(((r=e[0])==null?void 0:r.start)??"")}),l.jsx("span",{className:"font-mono text-[0.6rem] opacity-30",children:Cn(((i=e[e.length-1])==null?void 0:i.end)??"")})]})]}),l.jsx("div",{className:"overflow-x-auto border border-base-300",children:l.jsxs("table",{className:"table table-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Start"}),l.jsx("th",{children:"End"}),l.jsx("th",{children:"State"}),l.jsx("th",{className:"text-right",children:"Duration"})]})}),l.jsx("tbody",{children:e.map((o,a)=>l.jsxs("tr",{className:`transition-colors duration-75 ${t===a?"bg-base-200":"hover:bg-base-200"}`,onMouseEnter:()=>n(a),onMouseLeave:()=>n(null),children:[l.jsx("td",{className:"font-mono text-sm",children:Cn(o.start??"")}),l.jsx("td",{className:"font-mono text-sm",children:Cn(o.end??"")}),l.jsx("td",{children:l.jsx(W,{variant:zu[o.state??""]??"neutral",children:o.state})}),l.jsxs("td",{className:"text-right font-mono text-sm",children:[o.durationMin,"m"]})]},a))})]})}),l.jsx("div",{className:"flex flex-wrap gap-4 mt-3",children:Object.entries(zu).map(([o,a])=>l.jsx("div",{className:"flex items-center gap-1.5",children:l.jsx(W,{variant:a,size:"xs",children:o})},o))})]})}function iv(){return new Date().toISOString().slice(0,10)}function lv(e){try{const t=new Date(e+"T00:00:00"),n=new Date;n.setHours(0,0,0,0);const s=t.getTime()-n.getTime(),r=Math.round(s/864e5);return r===0?"Today":r===1?"Tomorrow":r===-1?"Yesterday":t.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})}catch{return e}}function ov(){const[e,t]=w.useState(""),[n,s]=w.useState(iv()),{running:r,result:i,error:o,approvalPending:a,approvalId:c,run:u,handleApproval:p}=Ga(),d=w.useCallback(async()=>{if(!e)return;const v={room:e};n&&(v.date=n),await u("teams/room-availability",v)},[e,n,u]),f=((i==null?void 0:i.data)??[]).map(v=>({start:String(v.start??""),end:String(v.end??""),state:String(v.state??""),durationMin:Number(v.durationMin??0)})),y=w.useMemo(()=>{if(f.length===0)return null;const v=f.reduce((k,E)=>k+E.durationMin,0),g=f.filter(k=>k.state==="free").reduce((k,E)=>k+E.durationMin,0),m=f.filter(k=>k.state==="busy").reduce((k,E)=>k+E.durationMin,0),h=f.filter(k=>k.state==="free").length,j=v>0?Math.round(g/v*100):0;return{totalMin:v,freeMin:g,busyMin:m,freeSlots:h,pct:j}},[f]),b=(o==null?void 0:o.includes("auth_required"))||(o==null?void 0:o.includes("sign in")),x=e.replace(/^MBTMY\s+/i,"");return l.jsxs("div",{className:"max-w-4xl mx-auto",children:[l.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Room Availability"}),l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end gap-3 mb-6",children:[l.jsxs("label",{className:"form-control flex-1 min-w-0",children:[l.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Room"}),l.jsx(tv,{value:e,onChange:t})]}),l.jsxs("label",{className:"form-control w-full sm:w-auto",children:[l.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Date"}),l.jsx("input",{type:"date",className:"input input-bordered input-sm w-full sm:w-auto",value:n,onChange:v=>s(v.target.value),onClick:v=>{var g,m;return(m=(g=v.target).showPicker)==null?void 0:m.call(g)}})]}),l.jsx("button",{className:"btn btn-primary btn-sm w-full sm:w-auto",onClick:d,disabled:r||!e,children:r?"Loading...":"Check availability"})]}),r&&!a&&l.jsx(ht,{label:"Checking room availability..."}),a&&l.jsxs("div",{className:"alert alert-warning mb-4",children:[l.jsx("span",{children:"This connector requires approval before proceeding."}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>p(!0),disabled:!c,children:"Approve"}),l.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>p(!1),disabled:!c,children:"Reject"})]})]}),b&&l.jsx(ur,{message:"Sign in to Microsoft Teams in Chrome, then try again."}),o&&!b&&l.jsx("div",{className:"alert alert-error mb-4",children:l.jsx("span",{children:o})}),i&&f.length>0&&y&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 border border-base-300 mb-6",children:[l.jsxs("div",{className:"p-3 border-r border-b border-base-300 md:border-b-0",children:[l.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Available"}),l.jsxs("div",{className:"font-display text-xl font-bold text-success",children:[y.pct,"%"]})]}),l.jsxs("div",{className:"p-3 border-b border-base-300 md:border-r md:border-b-0",children:[l.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Free time"}),l.jsxs("div",{className:"font-display text-xl font-bold",children:[Math.floor(y.freeMin/60),"h ",y.freeMin%60,"m"]})]}),l.jsxs("div",{className:"p-3 border-r border-base-300",children:[l.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Busy time"}),l.jsxs("div",{className:"font-display text-xl font-bold",children:[Math.floor(y.busyMin/60),"h ",y.busyMin%60,"m"]})]}),l.jsxs("div",{className:"p-3",children:[l.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Free slots"}),l.jsx("div",{className:"font-display text-xl font-bold",children:y.freeSlots})]})]}),l.jsxs("h3",{className:"font-display text-base font-semibold mb-3",children:[x||"Room"," · ",lv(n)]}),l.jsx(rv,{rows:f})]}),i&&f.length===0&&!o&&l.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[l.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No availability data found"}),l.jsx("p",{className:"font-mono text-xs opacity-30",children:"Try a different room or date."})]}),!i&&!r&&!o&&l.jsxs("div",{className:"border border-base-300 p-8 text-center",children:[l.jsx("p",{className:"text-sm opacity-50 mb-1",children:"Select a room and date to check availability"}),l.jsx("p",{className:"font-mono text-xs opacity-30",children:"Free/busy slots will appear as a visual timeline."})]})]})}function av({data:e}){const{timetracking:t,meetings:n,jira:s,git:r}=e,i=t?Math.min(100,Math.round(t.totalHours/t.targetHours*100)):0,o=t&&t.totalHours<t.targetHours*.8,a=(s==null?void 0:s.blockers.length)??0,c=(r==null?void 0:r.repos.length)??0;return l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsxs("div",{className:"stat bg-base-200 rounded-box p-4",children:[l.jsx("div",{className:"stat-title text-xs",children:"Hours Logged"}),l.jsx("div",{className:`stat-value text-2xl ${o?"text-warning":"text-success"}`,children:t?`${t.totalHours}h`:"—"}),l.jsxs("div",{className:"stat-desc",children:["/ ",(t==null?void 0:t.targetHours)??40,"h target"]}),t&&l.jsx("progress",{className:`progress ${o?"progress-warning":"progress-success"} w-full mt-1`,value:i,max:100})]}),l.jsxs("div",{className:"stat bg-base-200 rounded-box p-4",children:[l.jsx("div",{className:"stat-title text-xs",children:"Meetings"}),l.jsx("div",{className:`stat-value text-2xl ${n&&n.totalHours>20?"text-warning":"text-info"}`,children:n?String(n.totalCount):"—"}),l.jsx("div",{className:"stat-desc",children:n?`${n.totalHours}h · avg ${n.avgDurationMin}min`:""})]}),l.jsxs("div",{className:"stat bg-base-200 rounded-box p-4",children:[l.jsx("div",{className:"stat-title text-xs",children:"Tickets Done"}),l.jsx("div",{className:"stat-value text-2xl text-accent",children:s?String(s.resolved.length):"—"}),l.jsx("div",{className:"stat-desc",children:s?l.jsxs(l.Fragment,{children:[s.inProgress.length," in progress",a>0&&l.jsxs("span",{className:"text-error font-semibold ml-1",children:["· ",a," blocked"]})]}):""})]}),l.jsxs("div",{className:"stat bg-base-200 rounded-box p-4",children:[l.jsx("div",{className:"stat-title text-xs",children:"Commits"}),l.jsx("div",{className:"stat-value text-2xl text-primary",children:r?String(r.totalCommits):"—"}),l.jsx("div",{className:"stat-desc",children:r?`${r.totalPRsMerged} PRs · ${c} repo${c!==1?"s":""}`:""})]})]})}const cv=["Mon","Tue","Wed","Thu","Fri"];function uv(e){const t=new Date(e).getDay();return cv[t-1]??e}function dv({data:e}){const{timetracking:t,meetings:n,git:s,jira:r}=e,i=new Set;t==null||t.daily.forEach(f=>i.add(f.date)),n==null||n.daily.forEach(f=>i.add(f.date)),s==null||s.daily.forEach(f=>i.add(f.date));const o=[...i].sort().filter(f=>{const y=new Date(f+"T00:00:00").getDay();return y===0||y===6?(t==null?void 0:t.daily.some(x=>x.date===f&&x.hours>0))||(n==null?void 0:n.daily.some(x=>x.date===f&&x.count>0))||(s==null?void 0:s.daily.some(x=>x.date===f&&x.commits>0)):!0}),a=(t==null?void 0:t.totalHours)??0,c=(n==null?void 0:n.totalCount)??0,u=(n==null?void 0:n.totalHours)??0,p=(s==null?void 0:s.totalCommits)??0,d=(r==null?void 0:r.resolved.length)??0;return o.length===0?l.jsx("div",{className:"text-base-content/60",children:"No daily data available."}):l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"table table-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Day"}),l.jsx("th",{children:"Date"}),l.jsx("th",{children:"Hours Logged"}),l.jsx("th",{children:"Meetings"}),l.jsx("th",{children:"Commits"}),l.jsx("th",{children:"Tickets"})]})}),l.jsx("tbody",{children:o.map(f=>{const y=t==null?void 0:t.daily.find(m=>m.date===f),b=n==null?void 0:n.daily.find(m=>m.date===f),x=s==null?void 0:s.daily.find(m=>m.date===f),v=t==null?void 0:t.gaps.includes(f),g=(r==null?void 0:r.resolved.filter(m=>m.resolvedDate===f))??[];return l.jsxs("tr",{className:v?"bg-warning/10":"",children:[l.jsx("td",{className:"font-medium",children:uv(f)}),l.jsx("td",{className:"text-xs text-base-content/60",children:f}),l.jsxs("td",{children:[l.jsx("span",{className:v?"text-warning font-semibold":"",children:y?`${y.hours}h`:"—"}),v&&l.jsx("span",{className:"ml-1 text-warning text-xs",children:"⚠"})]}),l.jsx("td",{children:b?`${b.count} (${b.hours}h)`:"—"}),l.jsx("td",{children:x?`${x.commits}`:"0"}),l.jsx("td",{className:"text-xs",children:g.length>0?g.map(m=>m.key).join(", "):"—"})]},f)})}),l.jsx("tfoot",{children:l.jsxs("tr",{className:"font-semibold border-t border-base-300",children:[l.jsx("td",{colSpan:2,children:"Total"}),l.jsx("td",{children:a>0?`${a}h`:"—"}),l.jsx("td",{children:c>0?`${c} (${u}h)`:"—"}),l.jsx("td",{children:p}),l.jsx("td",{className:"text-xs",children:d>0?`${d} done`:"—"})]})})]})})}function fv({insights:e,errors:t}){return l.jsxs("div",{className:"space-y-3",children:[e.length>0&&l.jsxs("div",{className:"bg-base-200 rounded-box p-4",children:[l.jsx("h3",{className:"font-semibold mb-2",children:"Insights"}),l.jsx("ul",{className:"list-disc list-inside space-y-1 text-sm",children:e.map((n,s)=>l.jsx("li",{children:n},s))})]}),t.length>0&&l.jsx("div",{className:"alert alert-warning text-sm",children:l.jsxs("div",{children:[l.jsx("p",{className:"font-semibold",children:"Some data sources had issues:"}),l.jsx("ul",{className:"list-disc list-inside mt-1",children:t.map((n,s)=>l.jsx("li",{children:n},s))})]})})]})}function lh(e){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),s=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${s}`}function pv(){const e=new Date;return e.setDate(e.getDate()-e.getDay()),lh(e)}function Bu(e,t){const n=new Date(e+"T00:00:00");return n.setDate(n.getDate()+t*7),lh(n)}function hv(e){const t=new Date(e+"T00:00:00"),n=new Date(t);n.setDate(n.getDate()+6);const s=r=>r.toLocaleDateString("en-GB",{day:"numeric",month:"short"});return`${s(t)} – ${s(n)}, ${t.getFullYear()}`}function mv(){const[e,t]=w.useState(pv()),[n,s]=w.useState(!1),[r,i]=w.useState(null),[o,a]=w.useState(null),[c,u]=w.useState(null);async function p(){s(!0),a(null),i(null),u(null);const d=Date.now();try{const f=await F.generateJournal({weekStart:e});u(Date.now()-d),i(f)}catch(f){a(f instanceof Error?f.message:"Unknown error")}finally{s(!1)}}return l.jsxs("div",{className:"space-y-6 max-w-5xl",children:[l.jsx("h1",{className:"text-2xl font-bold",children:"Dev Work Journal"}),l.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[l.jsx("button",{className:"btn btn-sm btn-ghost",onClick:()=>t(Bu(e,-1)),disabled:n,children:"◄"}),l.jsx("span",{className:"font-medium text-lg",children:hv(e)}),l.jsx("button",{className:"btn btn-sm btn-ghost",onClick:()=>t(Bu(e,1)),disabled:n,children:"►"}),l.jsx("button",{className:"btn btn-primary ml-4",onClick:p,disabled:n,children:n?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"loading loading-spinner loading-xs"}),"Generating…"]}):"Generate"}),c!==null&&!n&&l.jsxs("span",{className:"text-xs text-base-content/40 ml-2",children:["Generated in ",(c/1e3).toFixed(1),"s"]})]}),n&&l.jsxs("div",{className:"flex items-center gap-3 text-base-content/60",children:[l.jsx("span",{className:"loading loading-spinner loading-md"}),l.jsx("span",{children:"Gathering data from Git, Outlook, Jira…"})]}),o&&l.jsx("div",{role:"alert",className:"alert alert-error",children:l.jsx("span",{children:o})}),(r==null?void 0:r.status)==="partial"&&l.jsx("div",{role:"alert",className:"alert alert-warning text-sm",children:l.jsxs("div",{children:[l.jsx("p",{className:"font-semibold",children:"Some data sources were unavailable. Results may be incomplete."}),l.jsx("ul",{className:"list-disc list-inside mt-1",children:r.errors.map((d,f)=>l.jsx("li",{children:d},f))})]})}),r&&r.status!=="error"&&l.jsxs("div",{className:"space-y-6",children:[l.jsx(av,{data:r}),l.jsx(dv,{data:r}),l.jsx(fv,{insights:r.insights,errors:r.errors})]}),(r==null?void 0:r.status)==="error"&&l.jsx("div",{role:"alert",className:"alert alert-error",children:l.jsxs("span",{children:["Failed to generate journal. ",r.errors.join("; ")]})})]})}const gv={socket:"info",wiz:"secondary",tldrsec:"warning"},yv={socket:"SOCKET",wiz:"WIZ",tldrsec:"TLDR SEC"};function xv(e,t){try{const n=new Date(e);if(isNaN(n.getTime()))return!1;const s=Date.now()-t*24*60*60*1e3;return n.getTime()>=s}catch{return!1}}function vv(e){try{const t=new Date(e);if(isNaN(t.getTime()))return e;const s=new Date().getTime()-t.getTime(),r=Math.floor(s/36e5);if(r<1)return"just now";if(r<24)return`${r}h ago`;const i=Math.floor(r/24);return i===1?"yesterday":i<7?`${i}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric"})}catch{return e}}function wv(e){return(e.data??[]).map(t=>({title:String(t.title??""),summary:String(t.summary??""),url:String(t.url??""),date:String(t.date??""),source:"socket",author:String(t.author??""),tags:String(t.tags??"")}))}function bv(e){return(e.data??[]).map(t=>({title:String(t.title??""),summary:String(t.excerpt??""),url:String(t.url??""),date:String(t.publishedAt??""),source:"wiz",author:String(t.authors??""),tags:String(t.tags??"")}))}function jv(e){return(e.data??[]).map(t=>({title:String(t.title??""),summary:String(t.excerpt??""),url:String(t.url??""),date:String(t.publishedAt??""),source:"tldrsec",author:String(t.authors??""),tags:String(t.tags??"")}))}const Uu={7:"Past 7 days",30:"Past 30 days"};function kv(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const s=Math.floor(n/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function Nv(){const[e,t]=w.useState(7),[n,s]=w.useState("idle"),[r,i]=w.useState("idle"),[o,a]=w.useState("idle"),[c,u]=w.useState([]),[p,d]=w.useState([]),[f,y]=w.useState([]),[b,x]=w.useState(null),[v,g]=w.useState(null),[m,h]=w.useState(null),[j,k]=w.useState(null),[E,N]=w.useState(!1);w.useEffect(()=>{let C=!1;return F.getCachedSecurityNews().then(D=>{if(!C&&D.data&&D.data.length>0){if(s(_=>_==="loading"?(C=!0,_):"done"),C)return;const O=[],M=[],L=[];for(const _ of D.data){const R=_;R.source==="wiz"?M.push(R):R.source==="tldrsec"?L.push(R):O.push(R)}u(O),d(M),y(L),k(D.fetchedAt),N(!0),i("done"),a("done")}}).catch(()=>{}),()=>{C=!0}},[]);const S=n==="loading"||r==="loading"||o==="loading",T=c.length>0||p.length>0||f.length>0,P=w.useMemo(()=>[...c,...p,...f].filter(D=>xv(D.date,e)).sort((D,O)=>new Date(O.date).getTime()-new Date(D.date).getTime()),[c,p,f,e]),B=w.useMemo(()=>{const C=P.filter(M=>M.source==="socket").length,D=P.filter(M=>M.source==="wiz").length,O=P.filter(M=>M.source==="tldrsec").length;return{total:P.length,socketCount:C,wizCount:D,tldrsecCount:O}},[P]),G=w.useCallback(async()=>{s("loading"),i("loading"),a("loading"),x(null),g(null),h(null),u([]),d([]),y([]),N(!1);let C=[],D=[],O=[];const M=F.run("socket/security-news",{}).then($=>{!$.ok&&$.error?(x($.error),s("error")):(C=wv($),u(C),s("done"))}).catch($=>{x($ instanceof Error?$.message:"Failed to fetch"),s("error")}),L=F.run("wiz/blog-security",{}).then($=>{!$.ok&&$.error?(g($.error),i("error")):(D=bv($),d(D),i("done"))}).catch($=>{g($ instanceof Error?$.message:"Failed to fetch"),i("error")}),_=F.run("tldrsec/newsletter",{}).then($=>{!$.ok&&$.error?(h($.error),a("error")):(O=jv($),y(O),a("done"))}).catch($=>{h($ instanceof Error?$.message:"Failed to fetch"),a("error")});await Promise.allSettled([M,L,_]);const R=[...C,...D,...O];if(R.length>0){const $=new Date().toISOString();k($),F.cacheSecurityNews(R).catch(()=>{})}},[]),K=C=>(C==null?void 0:C.includes("auth_required"))||(C==null?void 0:C.includes("sign in"));return l.jsxs("div",{className:"max-w-4xl mx-auto",children:[l.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Security News"}),l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end gap-3 mb-6",children:[l.jsxs("label",{className:"form-control w-full sm:w-auto",children:[l.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Range"}),l.jsxs("select",{className:"select select-bordered select-sm w-full sm:w-auto",value:e,onChange:C=>t(Number(C.target.value)),children:[l.jsx("option",{value:7,children:"Past 7 days"}),l.jsx("option",{value:30,children:"Past 30 days"})]})]}),l.jsx("button",{className:"btn btn-primary btn-sm w-full sm:w-auto",onClick:G,disabled:S,children:S?"Loading...":"Load news"}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Gl,{label:"Socket",status:n}),l.jsx(Gl,{label:"Wiz",status:r}),l.jsx(Gl,{label:"tl;dr sec",status:o})]})]}),S&&l.jsx(ht,{label:"Fetching security news..."}),b&&(K(b)?l.jsx(ur,{message:"Sign in to Socket.dev in Chrome, then try again."}):l.jsx("div",{className:"alert alert-error mb-3",children:l.jsxs("span",{children:[l.jsx("span",{className:"font-semibold",children:"Socket:"})," ",b]})})),v&&(K(v)?l.jsx(ur,{message:"Sign in to Wiz in Chrome, then try again."}):l.jsx("div",{className:"alert alert-error mb-3",children:l.jsxs("span",{children:[l.jsx("span",{className:"font-semibold",children:"Wiz:"})," ",v]})})),m&&l.jsx("div",{className:"alert alert-error mb-3",children:l.jsxs("span",{children:[l.jsx("span",{className:"font-semibold",children:"tl;dr sec:"})," ",m]})}),j&&!S&&l.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-2",children:[E?"Showing cached data from":"Last fetched"," ",kv(j)]}),T&&!S&&l.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 border border-base-300 mb-6",children:[l.jsxs("div",{className:"p-3 border-r border-base-300",children:[l.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:Uu[e]}),l.jsx("div",{className:"font-display text-xl font-bold",children:B.total})]}),l.jsxs("div",{className:"p-3 border-r border-base-300",children:[l.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Socket"}),l.jsx("div",{className:"font-display text-xl font-bold",children:B.socketCount})]}),l.jsxs("div",{className:"p-3 border-r border-base-300",children:[l.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Wiz"}),l.jsx("div",{className:"font-display text-xl font-bold",children:B.wizCount})]}),l.jsxs("div",{className:"p-3",children:[l.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"tl;dr sec"}),l.jsx("div",{className:"font-display text-xl font-bold",children:B.tldrsecCount})]})]}),P.length>0&&l.jsx("div",{className:"space-y-px",children:P.map((C,D)=>l.jsxs("article",{className:"border border-base-300 p-4",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3 mb-2",children:[l.jsx("a",{href:C.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-semibold hover:text-primary transition-colors leading-snug",children:C.title}),l.jsx(W,{variant:gv[C.source]??"neutral",size:"xs",children:yv[C.source]??C.source.toUpperCase()})]}),C.summary&&l.jsx("p",{className:"text-sm opacity-60 leading-relaxed mb-2 line-clamp-2",children:C.summary}),l.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[l.jsx("span",{className:"font-mono text-[0.6rem] opacity-40",children:vv(C.date)}),C.author&&l.jsx("span",{className:"font-mono text-[0.6rem] opacity-40",children:C.author}),C.tags&&l.jsx("div",{className:"flex gap-1 flex-wrap",children:C.tags.split(",").slice(0,3).map(O=>l.jsx(W,{variant:"neutral",size:"xs",children:O.trim()},O.trim()))})]})]},`${C.source}-${D}`))}),T&&P.length===0&&!S&&l.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[l.jsxs("p",{className:"text-sm opacity-50 mb-1",children:["No news from the ",Uu[e].toLowerCase()]}),l.jsx("p",{className:"font-mono text-xs opacity-30",children:"All sources returned data, but nothing within the date window."})]}),!T&&!S&&!b&&!v&&!m&&l.jsxs("div",{className:"border border-base-300 p-8 text-center",children:[l.jsx("p",{className:"text-sm opacity-50 mb-1",children:"Security news from Socket, Wiz, and tl;dr sec"}),l.jsx("p",{className:"font-mono text-xs opacity-30",children:"Select a range and press Load news to fetch the latest posts."})]})]})}function Gl({label:e,status:t}){const n={idle:"opacity-30",loading:"bg-warning animate-pulse",done:"bg-success",error:"bg-error"}[t];return l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:`w-1.5 h-1.5 ${n}`,"aria-hidden":"true"}),l.jsx("span",{className:"font-mono text-[0.6rem] opacity-50 uppercase",children:e})]})}function Vr(e){if(!e)return null;try{const t=new Date(e);if(isNaN(t.getTime()))return null;const n=new Date;return n.setHours(0,0,0,0),t.setHours(0,0,0,0),Math.ceil((t.getTime()-n.getTime())/(24*60*60*1e3))}catch{return null}}function Hu(e){return e===null?"none":e<0?"expired":e<=7?"critical":e<=30?"warning":"ok"}function Sv(e,t){switch(e){case"expired":return l.jsx(W,{variant:"error",size:"xs",children:"EXPIRED"});case"critical":return l.jsxs(W,{variant:"error",size:"xs",children:[t,"d LEFT"]});case"warning":return l.jsxs(W,{variant:"warning",size:"xs",children:[t,"d LEFT"]});case"none":return l.jsx(W,{variant:"neutral",size:"xs",children:"NO EXPIRY"});default:return null}}function Cv(e){if(!e)return"—";try{const t=new Date(e);return isNaN(t.getTime())?e:t.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return e}}function Ev(e){switch(e){case"expired":return"bg-red-500/5";case"critical":return"bg-red-500/5";case"warning":return"bg-amber-500/5";default:return""}}function Tv(){const[e,t]=w.useState("idle"),[n,s]=w.useState(""),[r,i]=w.useState([]),[o,a]=w.useState(null),[c,u]=w.useState("all"),p=e==="clients"||e==="trustedby",d=w.useCallback(async()=>{t("clients"),a(null),i([]),s("Fetching client list (all regions)...");try{const v=await F.run("tokenmaster/clients-list",{region:"all"});if(!v.ok&&v.error){a(v.error),t("error");return}const g=(v.data??[]).map(j=>({id:String(j.id??""),name:String(j.name??""),region:String(j.region??"emea")}));if(g.length===0){s("No clients found."),t("done");return}t("trustedby");const m=[],h=g.length;for(let j=0;j<g.length;j++){const k=g[j];s(`Fetching trusted peers... (${j+1}/${h}) — ${k.name||k.id}`);try{const E=await F.run("tokenmaster/client-trustedby",{clientid:k.id,region:k.region});if(E.ok&&E.data)for(const N of E.data)m.push({parentClientId:k.id,parentClientName:k.name||k.id,peerId:String(N.id??""),peerName:String(N.name??""),peerIdDisplay:String(N.idDisplay??""),expiryDate:N.expiry_date?String(N.expiry_date):null,region:String(N.region??k.region)})}catch{}}i(m),s(`Loaded ${m.length} trusted peers from ${h} clients.`),t("done")}catch(v){a(v instanceof Error?v.message:"Unknown error"),t("error")}},[]),f=w.useMemo(()=>[...c==="all"?r:r.filter(g=>g.region===c)].sort((g,m)=>{const h=Vr(g.expiryDate),j=Vr(m.expiryDate);return h===null&&j===null?0:h===null?1:j===null?-1:h-j}),[r,c]),y=w.useMemo(()=>{let v=0,g=0,m=0;for(const h of f){const j=Hu(Vr(h.expiryDate));j==="expired"?v++:j==="critical"?g++:j==="warning"&&m++}return{total:f.length,expired:v,critical:g,warning:m}},[f]),b=w.useMemo(()=>{const v=new Set(r.map(g=>g.region));return Array.from(v).sort()},[r]),x=v=>(v==null?void 0:v.includes("auth_required"))||(v==null?void 0:v.includes("sign in"));return l.jsxs("div",{className:"max-w-5xl mx-auto",children:[l.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Trusted Peer Expiry"}),l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end gap-3 mb-6",children:[l.jsxs("label",{className:"form-control w-full sm:w-auto",children:[l.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Region"}),l.jsxs("select",{className:"select select-bordered select-sm w-full sm:w-auto",value:c,onChange:v=>u(v.target.value),children:[l.jsx("option",{value:"all",children:"All regions"}),b.map(v=>l.jsx("option",{value:v,children:v.toUpperCase()},v))]})]}),l.jsx("button",{className:"btn btn-primary btn-sm w-full sm:w-auto",onClick:d,disabled:p,children:p?"Loading...":"Load trusted peers"})]}),p&&l.jsx(ht,{label:n}),o&&(x(o)?l.jsx(ur,{message:"Sign in to TokenMaster in Chrome, then try again."}):l.jsx("div",{className:"alert alert-error mb-3",children:l.jsx("span",{children:o})})),r.length>0&&!p&&l.jsxs("div",{className:"grid grid-cols-4 border border-base-300 mb-6",children:[l.jsxs("div",{className:"p-3 border-r border-base-300",children:[l.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Total"}),l.jsx("div",{className:"font-display text-xl font-bold",children:y.total})]}),l.jsxs("div",{className:"p-3 border-r border-base-300",children:[l.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Expired"}),l.jsx("div",{className:`font-display text-xl font-bold ${y.expired>0?"text-red-500":""}`,children:y.expired})]}),l.jsxs("div",{className:"p-3 border-r border-base-300",children:[l.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"≤ 7 days"}),l.jsx("div",{className:`font-display text-xl font-bold ${y.critical>0?"text-red-500":""}`,children:y.critical})]}),l.jsxs("div",{className:"p-3",children:[l.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"≤ 30 days"}),l.jsx("div",{className:`font-display text-xl font-bold ${y.warning>0?"text-amber-500":""}`,children:y.warning})]})]}),f.length>0&&l.jsx("div",{className:"border border-base-300 overflow-x-auto",children:l.jsxs("table",{className:"table table-sm w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-base-300",children:[l.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Status"}),l.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Expiry Date"}),l.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Days Left"}),l.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Trusted Peer"}),l.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Peer ID"}),l.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Parent Client"}),l.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Region"})]})}),l.jsx("tbody",{children:f.map((v,g)=>{const m=Vr(v.expiryDate),h=Hu(m);return l.jsxs("tr",{className:`border-b border-base-300/50 ${Ev(h)}`,children:[l.jsx("td",{children:Sv(h,m)}),l.jsx("td",{className:"font-mono text-sm",children:Cv(v.expiryDate)}),l.jsx("td",{className:"font-mono text-sm",children:m!==null?m<0?`${Math.abs(m)}d overdue`:`${m}d`:"—"}),l.jsx("td",{className:"text-sm font-semibold",children:v.peerName||v.peerId}),l.jsx("td",{className:"font-mono text-xs opacity-60",children:v.peerIdDisplay||v.peerId}),l.jsx("td",{className:"text-sm",children:v.parentClientName}),l.jsx("td",{children:l.jsx(W,{variant:"neutral",size:"xs",children:v.region.toUpperCase()})})]},`${v.parentClientId}-${v.peerId}-${v.region}-${g}`)})})]})}),e==="done"&&!p&&r.length>0&&l.jsx("div",{className:"mt-3 font-mono text-xs opacity-40",children:n}),e==="done"&&r.length===0&&!p&&l.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[l.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No trusted peers found"}),l.jsx("p",{className:"font-mono text-xs opacity-30",children:"No clients returned from TokenMaster, or no trustedby relationships exist."})]}),e==="idle"&&l.jsxs("div",{className:"border border-base-300 p-8 text-center",children:[l.jsx("p",{className:"text-sm opacity-50 mb-1",children:"TokenMaster trusted peer expiry monitor"}),l.jsx("p",{className:"font-mono text-xs opacity-30",children:'Press "Load trusted peers" to fetch all clients and their trusted peer expiry dates across all regions.'})]})]})}const Lv=[{name:"CLI Client",tech:"Node.js / Commander.js",port:null,desc:"Terminal interface. Sends commands to the Daemon over HTTP, formats output as table / JSON / CSV.",pkg:"@commandgarden/cli"},{name:"GUI",tech:"React SPA / Vite / Tailwind / DaisyUI",port:null,desc:"Browser-based interface. Talks to the App Server — never to the Daemon directly.",pkg:null},{name:"App Server",tech:"Fastify / SQLite",port:"9092",desc:"GUI backend. Proxies Daemon calls, enriches responses, and owns app-specific state (preferences, cached reports, goals).",pkg:"@commandgarden/app"},{name:"Daemon",tech:"Fastify / WebSocket / SQLite",port:"9091",desc:"Core service. Validates auth and capabilities, loads connectors, relays pipelines to the Chrome Extension, writes audit log.",pkg:"@commandgarden/daemon"},{name:"Chrome Extension",tech:"MV3 / TypeScript / Service Worker",port:null,desc:"Runs connector pipelines inside browser tabs via content scripts and CDP. Connects to the Daemon via WebSocket.",pkg:null}],Pv=[{name:"Audit Log",tech:"SQLite",path:"~/.commandgarden/audit.db",desc:"Every command execution, denial, auth failure, and config change."},{name:"App DB",tech:"SQLite",path:"~/.commandgarden/app.db",desc:"Preferences, cached reports, goals, and saved views."},{name:"Config",tech:"YAML",path:"~/.commandgarden/config.yaml",desc:"Daemon + security + connector + audit settings."},{name:"Session Token",tech:"File",path:"~/.commandgarden/session-token",desc:"Bearer token generated on daemon start. CLI and App Server read it for auth."}],Iv={client:"border-sky-500/50 bg-sky-500/10 text-sky-700 dark:text-sky-400",daemon:"border-amber-500/50 bg-amber-500/10 text-amber-700 dark:text-amber-400",extension:"border-emerald-500/50 bg-emerald-500/10 text-emerald-700 dark:text-emerald-400",browser:"border-violet-500/50 bg-violet-500/10 text-violet-700 dark:text-violet-400"},Ov={client:"bg-sky-400/20",daemon:"bg-amber-400/20",extension:"bg-emerald-400/20",browser:"bg-violet-400/20"},_v=[{title:"Command execution (CLI path)",lanes:[{id:"cli",label:"CLI",color:"client"},{id:"daemon",label:"Daemon :9091",color:"daemon"},{id:"ext",label:"Extension",color:"extension"},{id:"browser",label:"Browser Tab",color:"browser"}],steps:[{type:"arrow",from:"cli",to:"daemon",label:"POST /api/run (HTTP)"},{type:"action",lane:"daemon",label:"validate token + CSRF"},{type:"action",lane:"daemon",label:"check connector, domains, capabilities"},{type:"action",lane:"daemon",label:"audit: command.start"},{type:"action",lane:"daemon",label:"split pipeline (extension vs daemon steps)"},{type:"arrow",from:"daemon",to:"ext",label:"relay extension steps (WS)"},{type:"arrow",from:"ext",to:"browser",label:"execute pipeline steps"},{type:"arrow",from:"browser",to:"ext",label:"page data"},{type:"arrow",from:"ext",to:"daemon",label:"results (WS)"},{type:"action",lane:"daemon",label:"run daemon-side steps (transform, map)"},{type:"action",lane:"daemon",label:"audit: command.success / error"},{type:"arrow",from:"daemon",to:"cli",label:"structured data response"}]},{title:"Command execution (GUI path)",lanes:[{id:"gui",label:"GUI",color:"client"},{id:"app",label:"App Server :9092",color:"daemon"},{id:"daemon",label:"Daemon :9091",color:"daemon"}],steps:[{type:"arrow",from:"gui",to:"app",label:"POST /api/run (HTTP)"},{type:"arrow",from:"app",to:"daemon",label:"proxy to daemon (HTTP)"},{type:"action",lane:"daemon",label:"validate, execute, audit (same as CLI path)"},{type:"arrow",from:"daemon",to:"app",label:"structured data"},{type:"arrow",from:"app",to:"gui",label:"enriched response"}]},{title:"Step approval flow",lanes:[{id:"client",label:"CLI / GUI",color:"client"},{id:"daemon",label:"Daemon",color:"daemon"},{id:"ext",label:"Extension",color:"extension"}],steps:[{type:"action",lane:"daemon",label:"detect approval-required capability"},{type:"arrow",from:"daemon",to:"client",label:"HTTP 202 + requestId"},{type:"arrow",from:"daemon",to:"client",label:"approval prompt (SSE)"},{type:"arrow",from:"daemon",to:"ext",label:"approval notification (WS)"},{type:"arrow",from:"client",to:"daemon",label:"POST /api/approval"},{type:"arrow",from:"ext",to:"daemon",label:"resolve via WS"},{type:"action",lane:"daemon",label:"first responder wins → continue or abort"},{type:"action",lane:"daemon",label:"audit: approval.granted / rejected"}]},{title:"Extension connection",lanes:[{id:"ext",label:"Extension",color:"extension"},{id:"daemon",label:"Daemon",color:"daemon"}],steps:[{type:"arrow",from:"ext",to:"daemon",label:"WS connect :9091"},{type:"action",lane:"daemon",label:"validate origin"},{type:"action",lane:"daemon",label:"attach WS relay"},{type:"action",lane:"ext",label:"ready for commands"},{type:"arrow",from:"ext",to:"daemon",label:"heartbeat"}]}];function Av({flow:e}){const{lanes:t,steps:n,title:s}=e,r=t.length,i=`repeat(${r}, 1fr)`;return l.jsxs("div",{className:"border border-base-300 p-4 overflow-x-auto",children:[l.jsx("h4",{className:"font-semibold text-sm mb-3",children:s}),l.jsxs("div",{style:{minWidth:r*130},children:[l.jsx("div",{className:"grid",style:{gridTemplateColumns:i},children:t.map(o=>l.jsx("div",{className:"flex justify-center",children:l.jsx("span",{className:`px-2 py-1 text-[0.65rem] font-mono font-semibold border ${Iv[o.color]}`,children:o.label})},o.id))}),l.jsxs("div",{className:"relative py-1",children:[l.jsx("div",{className:"absolute inset-0 grid pointer-events-none",style:{gridTemplateColumns:i},children:t.map(o=>l.jsx("div",{className:"flex justify-center",children:l.jsx("div",{className:`w-0.5 h-full ${Ov[o.color]}`})},o.id))}),l.jsx("div",{className:"relative",children:n.map((o,a)=>{if(o.type==="action"){const v=(t.findIndex(g=>g.id===o.lane)+.5)/r*100;return l.jsx("div",{className:"relative",style:{height:26},children:l.jsx("div",{className:"absolute top-1/2 -translate-x-1/2 -translate-y-1/2 z-10",style:{left:`${v}%`},children:l.jsx("span",{className:"block px-2 py-0.5 text-[0.6rem] font-mono bg-base-200/90 border border-base-300/60 text-base-content/60 whitespace-nowrap",children:o.label})})},a)}const c=t.findIndex(x=>x.id===o.from),u=t.findIndex(x=>x.id===o.to),p=(c+.5)/r*100,d=(u+.5)/r*100,f=Math.min(p,d),y=Math.abs(d-p),b=c<u;return l.jsxs("div",{className:"relative",style:{height:30},children:[l.jsx("div",{className:"absolute top-1/2 h-px bg-base-content/20",style:{left:`${f}%`,width:`${y}%`}}),l.jsx("div",{className:"absolute top-1/2 w-1.5 h-1.5 rounded-full bg-base-content/30 -translate-x-1/2 -translate-y-1/2",style:{left:`${p}%`}}),l.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 text-[0.55rem] leading-none text-base-content/40",style:{left:`${d}%`,transform:`translate(${b?"-100%":"0"}, -50%)`},children:b?"▸":"◂"}),l.jsx("div",{className:"absolute top-1/2 -translate-x-1/2 -translate-y-1/2 z-10",style:{left:`${(p+d)/2}%`},children:l.jsx("span",{className:"px-1.5 py-px text-[0.6rem] font-mono bg-base-100 text-base-content/60 whitespace-nowrap",children:o.label})})]},a)})})]})]})]})}const Dv=[{name:"shared",desc:"Connector schema (Zod), protocol messages, audit events, expression parser, pipeline definitions",published:!1},{name:"daemon",desc:"HTTP + WebSocket server, auth, connector registry, capability validation, audit store, WebSocket relay",published:!1},{name:"cli",desc:"CLI client (Commander.js) — run, list, inspect, validate, daemon/gui management, audit queries, config",published:!0},{name:"chrome",desc:"Chrome MV3 extension — service worker, content scripts, domain guard, pipeline step execution engine",published:!1},{name:"app",desc:"Web GUI — Fastify app server + React SPA (Vite, Tailwind, DaisyUI)",published:!1},{name:"connectors",desc:"Built-in YAML connector definitions",published:!1}];function Rv(){return l.jsxs("div",{className:"max-w-4xl mx-auto",children:[l.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"Architecture"}),l.jsx("p",{className:"text-sm opacity-60 mb-6",children:"How commandGarden's components fit together."}),l.jsx("div",{id:"arch-diagram",className:"border border-base-300 p-5 mb-8 overflow-x-auto scroll-mt-4",children:l.jsxs("svg",{viewBox:"0 0 780 300",className:"w-full text-base-content",style:{minWidth:620},children:[l.jsxs("defs",{children:[l.jsx("marker",{id:"arch-ah",viewBox:"0 0 10 8",refX:"10",refY:"4",markerWidth:"7",markerHeight:"5",orient:"auto",children:l.jsx("path",{d:"M0 0L10 4L0 8z",fill:"currentColor",fillOpacity:.3})}),l.jsx("marker",{id:"arch-ah-rev",viewBox:"0 0 10 8",refX:"0",refY:"4",markerWidth:"7",markerHeight:"5",orient:"auto",children:l.jsx("path",{d:"M10 0L0 4L10 8z",fill:"currentColor",fillOpacity:.3})})]}),l.jsx("rect",{x:15,y:8,width:120,height:50,rx:3,fill:"rgba(56,189,248,0.08)",stroke:"rgba(56,189,248,0.4)",strokeWidth:1}),l.jsx("text",{x:75,y:29,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"CLI Client"}),l.jsx("text",{x:75,y:44,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"Node.js"}),l.jsx("rect",{x:15,y:120,width:120,height:50,rx:3,fill:"rgba(56,189,248,0.08)",stroke:"rgba(56,189,248,0.4)",strokeWidth:1}),l.jsx("text",{x:75,y:141,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"GUI"}),l.jsx("text",{x:75,y:156,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"React SPA"}),l.jsx("rect",{x:190,y:120,width:145,height:50,rx:3,fill:"rgba(251,191,36,0.08)",stroke:"rgba(251,191,36,0.4)",strokeWidth:1}),l.jsx("text",{x:262,y:141,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"App Server"}),l.jsx("text",{x:262,y:156,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"Fastify :9092"}),l.jsx("rect",{x:395,y:10,width:160,height:84,rx:3,fill:"rgba(251,191,36,0.08)",stroke:"rgba(251,191,36,0.5)",strokeWidth:1.5}),l.jsx("text",{x:475,y:38,textAnchor:"middle",fill:"currentColor",fontSize:13,fontWeight:700,children:"Daemon"}),l.jsx("text",{x:475,y:56,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"Fastify :9091"}),l.jsx("text",{x:475,y:78,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.25,fontFamily:"ui-monospace,monospace",children:"auth · registry · audit"}),l.jsx("rect",{x:615,y:20,width:150,height:60,rx:3,fill:"rgba(52,211,153,0.08)",stroke:"rgba(52,211,153,0.4)",strokeWidth:1}),l.jsx("text",{x:690,y:44,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"Extension"}),l.jsx("text",{x:690,y:62,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"Chrome MV3"}),l.jsx("rect",{x:630,y:200,width:130,height:50,rx:3,fill:"rgba(167,139,250,0.08)",stroke:"rgba(167,139,250,0.4)",strokeWidth:1}),l.jsx("text",{x:695,y:221,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"Browser Tab"}),l.jsx("text",{x:695,y:237,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"target page"}),l.jsx("rect",{x:195,y:240,width:100,height:36,rx:3,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),l.jsx("text",{x:245,y:257,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.45,children:"App DB"}),l.jsx("text",{x:245,y:269,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.25,fontFamily:"ui-monospace,monospace",children:"SQLite"}),l.jsx("rect",{x:390,y:200,width:105,height:36,rx:3,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),l.jsx("text",{x:442,y:217,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.45,children:"Audit Log"}),l.jsx("text",{x:442,y:229,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.25,fontFamily:"ui-monospace,monospace",children:"SQLite"}),l.jsx("rect",{x:500,y:200,width:85,height:36,rx:3,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),l.jsx("text",{x:542,y:217,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.45,children:"Config"}),l.jsx("text",{x:542,y:229,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.25,fontFamily:"ui-monospace,monospace",children:"YAML"}),l.jsx("rect",{x:75,y:200,width:105,height:36,rx:3,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),l.jsx("text",{x:127,y:217,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.45,children:"Session Token"}),l.jsx("text",{x:127,y:229,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.25,fontFamily:"ui-monospace,monospace",children:"file"}),l.jsx("line",{x1:137,y1:33,x2:393,y2:45,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#arch-ah)"}),l.jsx("text",{x:255,y:28,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"HTTP :9091"}),l.jsx("line",{x1:137,y1:145,x2:188,y2:145,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#arch-ah)"}),l.jsx("line",{x1:337,y1:138,x2:393,y2:78,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#arch-ah)"}),l.jsx("text",{x:354,y:97,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"proxy"}),l.jsx("line",{x1:557,y1:50,x2:613,y2:50,stroke:"currentColor",strokeOpacity:.2,strokeWidth:1.5,markerEnd:"url(#arch-ah)",markerStart:"url(#arch-ah-rev)"}),l.jsx("text",{x:585,y:40,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"WebSocket"}),l.jsx("line",{x1:695,y1:82,x2:695,y2:198,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#arch-ah)"}),l.jsx("text",{x:720,y:132,fill:"currentColor",fontSize:8,opacity:.35,fontFamily:"ui-monospace,monospace",children:"Content"}),l.jsx("text",{x:720,y:144,fill:"currentColor",fontSize:8,opacity:.35,fontFamily:"ui-monospace,monospace",children:"Scripts"}),l.jsx("text",{x:720,y:160,fill:"currentColor",fontSize:8,opacity:.35,fontFamily:"ui-monospace,monospace",children:"+ CDP"}),l.jsx("line",{x1:245,y1:172,x2:245,y2:238,stroke:"currentColor",strokeOpacity:.1,strokeDasharray:"3 2"}),l.jsx("line",{x1:442,y1:96,x2:442,y2:198,stroke:"currentColor",strokeOpacity:.1,strokeDasharray:"3 2"}),l.jsx("line",{x1:520,y1:96,x2:542,y2:198,stroke:"currentColor",strokeOpacity:.1,strokeDasharray:"3 2"}),l.jsx("line",{x1:75,y1:60,x2:110,y2:198,stroke:"currentColor",strokeOpacity:.08,strokeDasharray:"3 2"}),l.jsx("line",{x1:200,y1:172,x2:155,y2:198,stroke:"currentColor",strokeOpacity:.08,strokeDasharray:"3 2"})]})}),l.jsx("h3",{id:"arch-components",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Components"}),l.jsx("div",{className:"space-y-2 mb-8",children:Lv.map(e=>l.jsxs("div",{className:"border border-base-300 p-4",children:[l.jsxs("div",{className:"flex items-center gap-3 flex-wrap mb-1",children:[l.jsx("span",{className:"font-semibold",children:e.name}),l.jsx(W,{size:"xs",children:e.tech}),e.port&&l.jsxs(W,{variant:"info",size:"xs",children:[":",e.port]}),e.pkg&&l.jsx(W,{variant:"secondary",size:"xs",children:e.pkg})]}),l.jsx("p",{className:"text-sm opacity-60",children:e.desc})]},e.name))}),l.jsx("h3",{id:"arch-stores",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Data Stores"}),l.jsx("div",{className:"overflow-x-auto border border-base-300 mb-8",children:l.jsxs("table",{className:"table table-sm w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"bg-base-200",children:[l.jsx("th",{children:"Store"}),l.jsx("th",{children:"Format"}),l.jsx("th",{children:"Path"}),l.jsx("th",{children:"Purpose"})]})}),l.jsx("tbody",{children:Pv.map(e=>l.jsxs("tr",{className:"hover:bg-base-200",children:[l.jsx("td",{className:"font-semibold text-sm",children:e.name}),l.jsx("td",{children:l.jsx(W,{size:"xs",children:e.tech})}),l.jsx("td",{className:"font-mono text-xs opacity-60",children:e.path}),l.jsx("td",{className:"text-sm opacity-60",children:e.desc})]},e.name))})]})}),l.jsx("h3",{id:"arch-flows",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Data Flows"}),l.jsx("div",{className:"space-y-4 mb-8",children:_v.map(e=>l.jsx(Av,{flow:e},e.title))}),l.jsx("h3",{id:"arch-security",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Security Model"}),l.jsx("div",{className:"border border-base-300 p-4 mb-8",children:l.jsxs("ul",{className:"space-y-2",children:[l.jsxs("li",{className:"text-sm opacity-70",children:[l.jsx("span",{className:"font-semibold opacity-100",children:"Session token"})," — generated on daemon start, stored at ~/.commandgarden/session-token. Every API call (except /api/status) requires Bearer auth + X-CommandGarden CSRF header."]}),l.jsxs("li",{className:"text-sm opacity-70",children:[l.jsx("span",{className:"font-semibold opacity-100",children:"Domain guard"})," — connector YAML declares allowed domains. Extension refuses to run on undeclared domains."]}),l.jsxs("li",{className:"text-sm opacity-70",children:[l.jsx("span",{className:"font-semibold opacity-100",children:"Capability gating"})," — each pipeline step requires a declared capability. High-risk capabilities (js_evaluate, cookie_write) require explicit approval."]}),l.jsxs("li",{className:"text-sm opacity-70",children:[l.jsx("span",{className:"font-semibold opacity-100",children:"Audit-or-fail"})," — if the audit store is unavailable, commands are blocked."]}),l.jsxs("li",{className:"text-sm opacity-70",children:[l.jsx("span",{className:"font-semibold opacity-100",children:"No credentials stored"})," — commandGarden reuses existing Chrome sessions. No passwords or cookies are persisted."]}),l.jsxs("li",{className:"text-sm opacity-70",children:[l.jsx("span",{className:"font-semibold opacity-100",children:"Localhost only"})," — daemon and app server bind to 127.0.0.1 by default."]})]})}),l.jsx("h3",{id:"arch-packages",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Workspace Packages"}),l.jsx("div",{className:"overflow-x-auto border border-base-300 mb-8",children:l.jsxs("table",{className:"table table-sm w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"bg-base-200",children:[l.jsx("th",{children:"Package"}),l.jsx("th",{children:"Description"}),l.jsx("th",{children:"Published"})]})}),l.jsx("tbody",{children:Dv.map(e=>l.jsxs("tr",{className:"hover:bg-base-200",children:[l.jsx("td",{className:"font-mono text-sm font-semibold",children:e.name}),l.jsx("td",{className:"text-sm opacity-60",children:e.desc}),l.jsx("td",{children:e.published?l.jsx(W,{variant:"success",size:"xs",children:"npm"}):l.jsx(W,{size:"xs",children:"bundled"})})]},e.name))})]})}),l.jsx("h3",{id:"arch-build",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Build Order"}),l.jsxs("div",{className:"border border-base-300 p-4",children:[l.jsx("div",{className:"flex flex-wrap items-center gap-2 font-mono text-sm",children:["shared","daemon","cli","chrome","app"].map((e,t)=>l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"px-2 py-1 border border-base-300 bg-base-200",children:e}),t<4&&l.jsx("span",{className:"opacity-40",children:"→"})]},e))}),l.jsxs("p",{className:"text-sm opacity-60 mt-2",children:["Run ",l.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"npm run build"})," from the commandGarden root to build all packages in dependency order."]})]})]})}const Mv={GET:"success",POST:"warning",PUT:"info",DELETE:"error",WS:"secondary",SSE:"secondary"},$v=[{method:"GET",path:"/api/status",auth:!1,desc:"Health check. Returns daemon status, extension connection, and connector count."},{method:"GET",path:"/api/connectors",auth:!0,desc:"List all loaded connectors with key, description, access, domains, and capabilities."},{method:"GET",path:"/api/connectors/:site/:name",auth:!0,desc:"Full connector definition including pipeline, args, and columns.",params:"site, name — connector key segments"},{method:"POST",path:"/api/run",auth:!0,desc:"Execute a connector pipeline. Returns structured data. Returns 202 with requestId if step approval is required.",body:"{ connector: string, args: Record<string, string> }"},{method:"GET",path:"/api/audit",auth:!0,desc:"List audit events with optional filters.",params:"since?, connector?, type?, limit?"},{method:"GET",path:"/api/audit/:id",auth:!0,desc:"Single audit event with full detail including pipeline steps."},{method:"GET",path:"/api/config",auth:!0,desc:"Read the full config.yaml as JSON."},{method:"POST",path:"/api/config",auth:!0,desc:"Set a config value. Key must be section.property format.",body:"{ key: string, value: string }"},{method:"POST",path:"/api/approval",auth:!0,desc:"Resolve a pending step approval.",body:"{ approvalId: string, approved: boolean }"},{method:"SSE",path:"/api/run/events/:requestId",auth:!0,desc:"Server-Sent Events stream for approval-required runs. Sends approval and result events."},{method:"WS",path:"/ws/extension",auth:!1,desc:"WebSocket endpoint for Chrome Extension. Origin validated against security.extensionId."}],Fv=[{method:"GET",path:"/api/status",auth:!1,desc:"Proxied daemon status (same as daemon /api/status)."},{method:"GET",path:"/api/connectors",auth:!1,desc:"Enriched connector list with hasAppPage, appRoute, isHighRisk, isApproved, isAutoApproved."},{method:"GET",path:"/api/connectors/:site/:name",auth:!1,desc:"Proxied connector detail."},{method:"POST",path:"/api/run",auth:!1,desc:"Proxied connector execution."},{method:"GET",path:"/api/audit",auth:!1,desc:"Proxied audit event list."},{method:"GET",path:"/api/audit/:id",auth:!1,desc:"Proxied single audit event."},{method:"GET",path:"/api/config",auth:!1,desc:"Proxied config read."},{method:"POST",path:"/api/config",auth:!1,desc:"Proxied config write."},{method:"POST",path:"/api/approval",auth:!1,desc:"Proxied approval resolution."},{method:"GET",path:"/api/preferences",auth:!1,desc:"Read app preferences (SQLite-backed).",response:"{ ok, preferences }"},{method:"PUT",path:"/api/preferences",auth:!1,desc:"Set an app preference.",body:"{ key: string, value: string }"},{method:"GET",path:"/api/goals",auth:!1,desc:"Read goals for a month.",params:"month (YYYY-MM)"},{method:"POST",path:"/api/goals",auth:!1,desc:"Create or update a goal.",body:"{ month, projectId, activity, targetDays }"},{method:"DELETE",path:"/api/goals/:id",auth:!1,desc:"Delete a goal."},{method:"GET",path:"/api/timetracking/cache",auth:!1,desc:"Get cached timetracking report for a month.",params:"month (YYYY-MM)"},{method:"POST",path:"/api/timetracking/cache",auth:!1,desc:"Store timetracking report in cache.",body:"{ month, data }"},{method:"GET",path:"/api/timetracking/projects",auth:!1,desc:"Get cached project/activity list."},{method:"POST",path:"/api/timetracking/projects",auth:!1,desc:"Store project/activity list in cache.",body:"{ data }"},{method:"POST",path:"/api/journal/generate",auth:!1,desc:"Generate a dev journal for a given week.",body:"{ weekStart: string }"},{method:"GET",path:"/api/security-news/cache",auth:!1,desc:"Get cached security news articles."},{method:"POST",path:"/api/security-news/cache",auth:!1,desc:"Store security news in cache.",body:"{ data }"}],zv=[{cmd:"cg up",desc:"Start daemon + GUI, open browser.",opts:["--no-open Skip opening browser"]},{cmd:"cg down",desc:"Stop GUI + daemon."},{cmd:"cg run <connector>",desc:"Run a connector command.",args:"Connector key (site/name), plus connector-specific args as --key value",opts:["-f, --format <format> Output format: table, json, csv (default: table)"],example:"cg run timetracking/report --month 2026-07 --format json"},{cmd:"cg list",desc:"List all installed connectors with access, domains, and capabilities."},{cmd:"cg inspect <connector>",desc:"Show full details of a connector (args, columns, pipeline).",example:"cg inspect teams/room-availability"},{cmd:"cg validate <file>",desc:"Validate a connector YAML file against the schema.",example:"cg validate connectors/my-connector.yaml"},{cmd:"cg daemon status",desc:"Check if the daemon is running."},{cmd:"cg daemon start",desc:"Start the daemon in background."},{cmd:"cg daemon stop",desc:"Stop the daemon."},{cmd:"cg gui",desc:"Start the GUI app server (foreground by default).",opts:["-b, --background Run in background","--no-open Skip opening browser"]},{cmd:"cg gui stop",desc:"Stop the GUI app server."},{cmd:"cg gui status",desc:"Check if the GUI is running."},{cmd:"cg audit list",desc:"List recent audit events.",opts:["--since <duration> Time window (e.g. 7d, 2w, 12h)","--connector <pattern> Filter by connector (e.g. test/*)","--type <pattern> Filter by event type (e.g. auth.failed)","--limit <n> Max events (default: 100)"]},{cmd:"cg audit show <id>",desc:"Show full details of a single audit event including pipeline steps."},{cmd:"cg audit export",desc:"Export audit events.",opts:["--format <format> Export format: json, csv (default: json)","--since <duration> Time window","--connector <pattern> Filter","--type <pattern> Filter"]},{cmd:"cg config show",desc:"Show current config.yaml contents."},{cmd:"cg config set <key> <value>",desc:"Set a config value (section.property format).",example:"cg config set daemon.port 9999"},{cmd:"cg extension setup",desc:"Show extension path and instructions for Chrome installation."}],Bv=[{step:"navigate",capability:"navigate",desc:"Open a URL in the browser tab"},{step:"wait",capability:"navigate",desc:"Wait for a selector or timeout"},{step:"extract",capability:"dom_read",desc:"Read data from DOM elements"},{step:"extract_tree",capability:"dom_read",desc:"Recursive DOM tree walk with ancestry"},{step:"extract_html",capability:"dom_read",desc:"Capture element HTML as a variable"},{step:"click",capability:"dom_write",desc:"Click an element"},{step:"click_all",capability:"dom_write",desc:"Click all matching elements (with re-scan loop)"},{step:"type",capability:"dom_write",desc:"Type text into an input"},{step:"intercept",capability:"intercept_response",desc:"Capture a network response body"},{step:"cookie",capability:"cookie_read",desc:"Read cookies for a domain"},{step:"fetch",capability:"cookie_read",desc:"HTTP request from page context"},{step:"map",capability:"—",desc:"Transform/rename extracted fields"},{step:"filter",capability:"—",desc:"Filter rows by condition"},{step:"set",capability:"—",desc:"Set a variable for later steps"},{step:"transform",capability:"—",desc:"Server-side data transform (e.g. HTML→Markdown)"}];function Wu({ep:e}){const[t,n]=w.useState(!1),s=e.params||e.body||e.response;return l.jsxs("div",{className:"border-b border-base-300/50 last:border-b-0",children:[l.jsxs("button",{className:`flex items-center gap-3 w-full text-left px-3 py-2.5 ${s?"cursor-pointer hover:bg-base-200/50":""}`,onClick:()=>s&&n(!t),disabled:!s,children:[l.jsx(W,{variant:Mv[e.method]??"neutral",size:"xs",className:"w-10 justify-center shrink-0",children:e.method}),l.jsx("span",{className:"font-mono text-sm flex-1",children:e.path}),e.auth&&l.jsx(W,{variant:"warning",size:"xs",children:"auth"}),s&&l.jsx("span",{className:"text-xs opacity-40",children:t?"▾":"▸"})]}),l.jsx("div",{className:"px-3 pb-2 pl-16 text-sm opacity-60",children:e.desc}),t&&s&&l.jsxs("div",{className:"px-3 pb-3 pl-16 space-y-1.5",children:[e.params&&l.jsxs("div",{className:"text-xs",children:[l.jsx("span",{className:"font-semibold opacity-50",children:"Params: "}),l.jsx("span",{className:"font-mono opacity-60",children:e.params})]}),e.body&&l.jsxs("div",{className:"text-xs",children:[l.jsx("span",{className:"font-semibold opacity-50",children:"Body: "}),l.jsx("code",{className:"font-mono bg-base-200 px-1 py-0.5 opacity-70",children:e.body})]}),e.response&&l.jsxs("div",{className:"text-xs",children:[l.jsx("span",{className:"font-semibold opacity-50",children:"Response: "}),l.jsx("code",{className:"font-mono bg-base-200 px-1 py-0.5 opacity-70",children:e.response})]})]})]})}function Uv(){const[e,t]=w.useState("cli");return l.jsxs("div",{className:"max-w-4xl mx-auto",children:[l.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"API & CLI Reference"}),l.jsx("p",{className:"text-sm opacity-60 mb-6",children:"CLI commands, Daemon API endpoints, and App Server endpoints."}),l.jsx("div",{id:"api-endpoints",className:"border border-base-300 bg-base-200/30 p-3 mb-6 scroll-mt-4",children:l.jsxs("p",{className:"text-sm opacity-70",children:[l.jsx("span",{className:"font-semibold",children:"Authentication:"})," Daemon endpoints (except ",l.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"/api/status"})," and ",l.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"/ws/extension"}),") require an ",l.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"Authorization: Bearer <token>"})," header and an ",l.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"X-CommandGarden: 1"})," CSRF header. The App Server handles auth internally — GUI requests don't need tokens."]})}),l.jsx("div",{className:"flex border-b border-base-300 mb-4",children:[{id:"cli",label:"CLI Commands",sub:"cg"},{id:"daemon-api",label:"Daemon API",sub:":9091"},{id:"app-api",label:"App Server API",sub:":9092"}].map(n=>l.jsxs("button",{className:`px-4 py-2 text-sm font-medium transition-colors border-b-2 -mb-px ${e===n.id?"border-primary text-primary":"border-transparent opacity-60 hover:opacity-100"}`,onClick:()=>t(n.id),children:[n.label," ",l.jsx("span",{className:"font-mono text-xs opacity-40 ml-1",children:n.sub})]},n.id))}),e==="cli"&&l.jsx("div",{className:"space-y-2 mb-8",children:zv.map(n=>l.jsxs("div",{className:"border border-base-300 p-3",children:[l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("code",{className:"font-mono text-sm font-semibold bg-base-200 px-2 py-0.5 shrink-0",children:n.cmd}),l.jsx("span",{className:"text-sm opacity-60 pt-0.5",children:n.desc})]}),n.args&&l.jsxs("div",{className:"mt-2 ml-1 text-xs",children:[l.jsx("span",{className:"font-semibold opacity-50",children:"Args: "}),l.jsx("span",{className:"opacity-60",children:n.args})]}),n.opts&&n.opts.length>0&&l.jsx("div",{className:"mt-1.5 ml-1 space-y-0.5",children:n.opts.map((s,r)=>l.jsx("div",{className:"text-xs font-mono opacity-50",children:s},r))}),n.example&&l.jsx("div",{className:"mt-2 ml-1",children:l.jsx("code",{className:"text-xs font-mono bg-base-200/70 px-2 py-1 block opacity-60",children:n.example})})]},n.cmd))}),e==="daemon-api"&&l.jsx("div",{className:"border border-base-300 mb-8",children:$v.map((n,s)=>l.jsx(Wu,{ep:n},s))}),e==="app-api"&&l.jsxs(l.Fragment,{children:[l.jsxs("p",{className:"text-sm opacity-50 mb-3",children:["The App Server on ",l.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:":9092"})," proxies all daemon endpoints and adds app-specific routes for preferences, caching, goals, and journal generation."]}),l.jsx("div",{className:"border border-base-300 mb-8",children:Fv.map((n,s)=>l.jsx(Wu,{ep:n},s))})]}),l.jsx("h3",{id:"api-pipeline",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Pipeline Steps"}),l.jsx("p",{className:"text-sm opacity-50 mb-3",children:"Available steps for connector YAML pipeline definitions."}),l.jsx("div",{className:"overflow-x-auto border border-base-300 mb-8",children:l.jsxs("table",{className:"table table-sm w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"bg-base-200",children:[l.jsx("th",{children:"Step"}),l.jsx("th",{children:"Capability"}),l.jsx("th",{children:"Description"})]})}),l.jsx("tbody",{children:Bv.map(n=>l.jsxs("tr",{className:"hover:bg-base-200",children:[l.jsx("td",{className:"font-mono text-sm font-semibold",children:n.step}),l.jsx("td",{children:l.jsx(W,{size:"xs",variant:n.capability==="—"?"neutral":"info",children:n.capability})}),l.jsx("td",{className:"text-sm opacity-60",children:n.desc})]},n.step))})]})}),l.jsx("h3",{id:"api-expressions",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Expression Syntax"}),l.jsxs("div",{className:"border border-base-300 p-4",children:[l.jsxs("p",{className:"text-sm opacity-60 mb-3",children:["Use ",l.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"${{ }}"})," for template expressions (no JS eval):"]}),l.jsxs("div",{className:"space-y-1.5 font-mono text-xs",children:[l.jsxs("div",{className:"flex gap-3",children:[l.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Variable access"}),l.jsx("code",{className:"opacity-70",children:"args.month, vars.token, cookies.name"})]}),l.jsxs("div",{className:"flex gap-3",children:[l.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Row access (map)"}),l.jsx("code",{className:"opacity-70",children:"row.id, row.name"})]}),l.jsxs("div",{className:"flex gap-3",children:[l.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Concatenation"}),l.jsx("code",{className:"opacity-70",children:'"Bearer " + vars.token'})]}),l.jsxs("div",{className:"flex gap-3",children:[l.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Pipe filters"}),l.jsx("code",{className:"opacity-70",children:'args.month | default("2026-06"), value | number, text | trim'})]})]})]})]})}function Hv(e){const n=e.replace(/^---\s*\n[\s\S]*?\n---\s*\n/,"").split(`
253
- `),s=[];let r=null;for(const i of n){const o=i.match(/^(#{1,3})\s+(.+)/);o?(r&&s.push({heading:r.heading,body:r.lines.join(`
254
- `).trim()}),r={heading:o[2],lines:[]}):r?r.lines.push(i):i.trim()&&(r||(r={heading:"",lines:[]}),r.lines.push(i))}return r&&s.push({heading:r.heading,body:r.lines.join(`
255
- `).trim()}),s}function Wv({content:e}){return l.jsx("pre",{className:"text-sm font-mono whitespace-pre-wrap opacity-70 leading-relaxed overflow-x-auto",children:e})}function Ku({file:e,defaultOpen:t}){const[n,s]=w.useState(t??!1),r=w.useMemo(()=>Hv(e.content),[e.content]);return l.jsxs("div",{className:"border border-base-300/50",children:[l.jsxs("button",{className:"flex items-center gap-2 w-full text-left px-4 py-3 hover:bg-base-200/50 transition-colors",onClick:()=>s(!n),children:[l.jsx("span",{className:"text-xs opacity-50",children:n?"▾":"▸"}),l.jsx("span",{className:"font-mono text-sm font-semibold",children:e.name}),l.jsxs("span",{className:"text-xs opacity-40",children:[r.length," ",r.length===1?"section":"sections"]})]}),n&&l.jsx("div",{className:"px-4 pb-4 space-y-4",children:r.map((i,o)=>l.jsxs("div",{children:[i.heading&&l.jsx("h5",{className:"font-mono text-xs font-semibold uppercase tracking-[0.08em] opacity-50 mb-2",children:i.heading}),l.jsx(Wv,{content:i.body})]},o))})]})}function Kv({skill:e}){const[t,n]=w.useState(!1),s=e.files.find(i=>i.name==="SKILL.md"),r=e.files.filter(i=>i.name!=="SKILL.md");return l.jsxs("div",{className:"border border-base-300",children:[l.jsx("div",{className:"p-4",children:l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[l.jsx("span",{className:"font-mono text-base font-semibold",children:e.name}),l.jsxs(W,{size:"xs",children:[e.files.length," ",e.files.length===1?"file":"files"]})]}),l.jsx("p",{className:"text-sm opacity-60 mt-1.5 max-w-prose",children:e.description})]}),l.jsx("button",{className:"btn btn-sm btn-ghost font-mono text-xs shrink-0",onClick:()=>n(!t),children:t?"Collapse":"View"})]})}),t&&l.jsxs("div",{className:"border-t border-base-300 p-4 space-y-3",children:[s&&l.jsx(Ku,{file:s,defaultOpen:!0}),r.map(i=>l.jsx(Ku,{file:i},i.name))]})]})}function Vv(){const[e,t]=w.useState([]),[n,s]=w.useState(!0),[r,i]=w.useState(null);return w.useEffect(()=>{F.getSkills().then(o=>t(o.skills)).catch(o=>i(o instanceof Error?o.message:"Failed to load skills")).finally(()=>s(!1))},[]),n?l.jsx(ht,{label:"Loading skills..."}):l.jsxs("div",{className:"max-w-4xl mx-auto",children:[l.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"Skills"}),l.jsx("p",{className:"text-sm opacity-60 mb-5",children:"AI agent skills bundled with commandGarden. These teach coding assistants how to use cg and author connectors."}),r?l.jsxs("div",{className:"border border-error/30 p-4",children:[l.jsx("p",{className:"text-sm text-error font-semibold mb-1",children:"Failed to load skills"}),l.jsx("p",{className:"font-mono text-xs opacity-60",children:r})]}):e.length===0?l.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[l.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No skills found"}),l.jsx("p",{className:"font-mono text-xs opacity-30",children:"Skills should be located in the skills/ directory of the commandGarden package."})]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"overflow-x-auto border border-base-300 mb-6",children:l.jsxs("table",{className:"table table-sm w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"bg-base-200",children:[l.jsx("th",{children:"Skill"}),l.jsx("th",{children:"Description"}),l.jsx("th",{children:"Files"})]})}),l.jsx("tbody",{children:e.map(o=>l.jsxs("tr",{className:"hover:bg-base-200",children:[l.jsx("td",{className:"font-mono text-sm font-semibold whitespace-nowrap",children:o.name}),l.jsx("td",{className:"text-sm opacity-60",children:o.description}),l.jsx("td",{className:"text-center",children:l.jsx(W,{size:"xs",children:o.files.length})})]},o.name))})]})}),l.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Skill Details"}),l.jsx("div",{className:"space-y-3",children:e.map(o=>l.jsx(Kv,{skill:o},o.name))}),l.jsxs("div",{className:"border border-base-300 p-4 mt-6",children:[l.jsx("h4",{className:"font-mono text-xs font-semibold uppercase tracking-[0.08em] opacity-50 mb-2",children:"Usage"}),l.jsxs("p",{className:"text-sm opacity-60 mb-2",children:["Copy a skill's ",l.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"SKILL.md"})," into your AI assistant's skill directory to teach it how to use commandGarden."]}),l.jsxs("div",{className:"font-mono text-xs opacity-40",children:[l.jsx("span",{children:"Windsurf: "}),l.jsx("code",{className:"bg-base-200 px-1 py-0.5",children:".windsurf/skills/"}),l.jsx("span",{className:"mx-2",children:"|"}),l.jsx("span",{children:"Claude: "}),l.jsx("code",{className:"bg-base-200 px-1 py-0.5",children:".claude/skills/"})]})]})]})]})}function ct({isActive:e}){return`block px-3 py-2 text-sm transition-colors ${e?"bg-primary text-primary-content font-semibold":"hover:text-primary"}`}const Yl={"/config":[{label:"Server",id:"cfg-server"},{label:"Security",id:"cfg-security"},{label:"Sources",id:"cfg-sources"},{label:"Audit",id:"cfg-audit"},{label:"Output",id:"cfg-output"},{label:"Journal",id:"cfg-journal"}],"/architecture":[{label:"Diagram",id:"arch-diagram"},{label:"Components",id:"arch-components"},{label:"Data Stores",id:"arch-stores"},{label:"Data Flows",id:"arch-flows"},{label:"Security",id:"arch-security"},{label:"Packages",id:"arch-packages"},{label:"Build Order",id:"arch-build"}],"/api-reference":[{label:"Endpoints",id:"api-endpoints"},{label:"Pipeline Steps",id:"api-pipeline"},{label:"Expressions",id:"api-expressions"}]};function Gv({sections:e}){const t=w.useMemo(()=>e.map(r=>r.id),[e]),n=Ky(t),s=r=>{const i=document.getElementById(r);i&&i.scrollIntoView({behavior:"smooth",block:"start"})};return l.jsx("div",{className:"ml-3 border-l border-base-300 py-0.5",children:e.map(r=>l.jsx("button",{onClick:()=>s(r.id),className:`block w-full text-left pl-3 py-1 text-[0.7rem] font-mono transition-colors ${n===r.id?"text-primary opacity-100":"opacity-40 hover:opacity-70"}`,children:r.label},r.id))})}function Gr({to:e,label:t,sections:n}){const r=bn().pathname===e;return l.jsxs(l.Fragment,{children:[l.jsx(at,{to:e,end:e==="/",className:ct,children:t}),r&&n.length>0&&l.jsx(Gv,{sections:n})]})}function Yv(){const[e,t]=w.useState(!1),[n,s]=w.useState(!1),[r,i]=w.useState(!1),[o,a]=w.useState([]),c=bn();w.useEffect(()=>{i(!1)},[c.pathname]),w.useEffect(()=>{const p=()=>{F.getStatus().then(f=>{t(f.ok),s(f.extensionConnected)}).catch(()=>{t(!1),s(!1)})};p();const d=setInterval(p,3e4);return()=>clearInterval(d)},[]),w.useEffect(()=>{F.getConnectors().then(p=>{const d=sl(p.connectors).map(([f])=>f);a(d)}).catch(()=>{})},[]);const u=w.useMemo(()=>o.map(p=>({label:p,id:`conn-${p}`})),[o]);return l.jsxs("div",{className:"flex min-h-screen",children:[l.jsx("button",{className:"fixed top-3 left-3 z-50 md:hidden btn btn-sm btn-ghost",onClick:()=>i(!r),"aria-label":r?"Close menu":"Open menu",children:l.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:r?l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}):l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}),r&&l.jsx("div",{className:"fixed inset-0 bg-black/30 z-30 md:hidden",onClick:()=>i(!1)}),l.jsxs("aside",{className:`w-56 bg-base-100 border-r border-base-300 flex flex-col fixed top-0 left-0 bottom-0 z-40 transition-transform duration-150 ease-out ${r?"translate-x-0":"-translate-x-full"} md:translate-x-0`,children:[l.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-b border-base-300",children:[l.jsxs(yn,{to:"/",className:"hover:opacity-80 transition-opacity",children:[l.jsxs("h1",{className:"font-display text-base font-bold tracking-tight",children:[l.jsx("span",{className:"font-normal opacity-60",children:"command"}),"Garden"]}),l.jsx("p",{className:"font-mono text-[0.6rem] opacity-40 mt-0.5 uppercase tracking-widest",children:"browser automation"})]}),l.jsx("button",{className:"btn btn-ghost btn-sm btn-square",onClick:()=>{const p=document.documentElement.getAttribute("data-theme")==="dark"?"light":"dark";document.documentElement.setAttribute("data-theme",p),localStorage.setItem("theme",p)},"aria-label":"Toggle theme",children:l.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})})})]}),l.jsxs("nav",{className:"flex-1 px-2 py-2 space-y-px overflow-y-auto",children:[l.jsx("div",{className:"px-3 pt-3 pb-1.5 font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.12em]",children:"Overview"}),l.jsx(at,{to:"/",end:!0,className:ct,children:"Dashboard"}),l.jsx("div",{className:"px-3 pt-4 pb-1.5 font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.12em]",children:"Apps"}),l.jsx(at,{to:"/apps/timetracking",className:ct,children:"Time Tracking"}),l.jsx(at,{to:"/apps/rooms",className:ct,children:"Room Availability"}),l.jsx(at,{to:"/apps/journal",className:ct,children:"Dev Journal"}),l.jsx(at,{to:"/apps/security-news",className:ct,children:"Security News"}),l.jsx(at,{to:"/apps/trusted-peer-expiry",className:ct,children:"Trusted Peer Expiry"}),l.jsx("div",{className:"px-3 pt-4 pb-1.5 font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.12em]",children:"Platform"}),l.jsx(Gr,{to:"/connectors",label:"Connectors",sections:u}),l.jsx(at,{to:"/audit",className:ct,children:"Audit Log"}),l.jsx(Gr,{to:"/config",label:"Configuration",sections:Yl["/config"]}),l.jsx("div",{className:"px-3 pt-4 pb-1.5 font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.12em]",children:"Help"}),l.jsx(at,{to:"/guide",className:ct,children:"Setup Guide"}),l.jsx(at,{to:"/skills",className:ct,children:"Skills"}),l.jsx(Gr,{to:"/architecture",label:"Architecture",sections:Yl["/architecture"]}),l.jsx(Gr,{to:"/api-reference",label:"API & CLI",sections:Yl["/api-reference"]})]}),l.jsxs("div",{className:"px-3 py-2.5 border-t border-base-300",children:[l.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[l.jsx("span",{className:`w-1.5 h-1.5 ${e?"bg-success":"bg-error"}`,"aria-hidden":"true"}),l.jsx("span",{className:"opacity-50 text-[0.65rem]",children:e?"DAEMON OK":"DAEMON OFF"})]}),l.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono mt-1",children:[l.jsx("span",{className:`w-1.5 h-1.5 ${n?"bg-success":"bg-error"}`,"aria-hidden":"true"}),l.jsx("span",{className:"opacity-50 text-[0.65rem]",children:n?"EXTENSION LINKED":"EXTENSION OFF"})]})]})]}),l.jsx("main",{className:"flex-1 p-4 pt-14 md:pt-5 md:p-5 md:ml-56",children:l.jsx(Ly,{})})]})}function qv(){return l.jsx(Fy,{children:l.jsx(Iy,{children:l.jsxs(we,{element:l.jsx(Yv,{}),children:[l.jsx(we,{index:!0,element:l.jsx(Yy,{})}),l.jsx(we,{path:"connectors",element:l.jsx(Jy,{})}),l.jsx(we,{path:"connectors/:site/:name",element:l.jsx(Xy,{})}),l.jsx(we,{path:"audit",element:l.jsx(t0,{})}),l.jsx(we,{path:"config",element:l.jsx(gx,{})}),l.jsx(we,{path:"guide",element:l.jsx(Nx,{})}),l.jsx(we,{path:"apps/timetracking",element:l.jsx(Zx,{})}),l.jsx(we,{path:"apps/rooms",element:l.jsx(ov,{})}),l.jsx(we,{path:"apps/journal",element:l.jsx(mv,{})}),l.jsx(we,{path:"apps/security-news",element:l.jsx(Nv,{})}),l.jsx(we,{path:"apps/trusted-peer-expiry",element:l.jsx(Tv,{})}),l.jsx(we,{path:"architecture",element:l.jsx(Rv,{})}),l.jsx(we,{path:"api-reference",element:l.jsx(Uv,{})}),l.jsx(we,{path:"skills",element:l.jsx(Vv,{})})]})})})}ip(document.getElementById("root")).render(l.jsx(w.StrictMode,{children:l.jsx(qv,{})}));