@commandgarden/cli 2.14.3 → 2.15.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.
Files changed (25) hide show
  1. package/node_modules/@commandgarden/app/dist/client/assets/Slides-5KujoV-w.js +30 -0
  2. package/node_modules/@commandgarden/app/dist/client/assets/index-2gEJ4GIc.js +521 -0
  3. package/node_modules/@commandgarden/app/dist/client/assets/{index-rHqHbsBw.css → index-CHt4v0FJ.css} +1 -1
  4. package/node_modules/@commandgarden/app/dist/client/index.html +2 -2
  5. package/node_modules/@commandgarden/app/dist/server/routes/ai-news-cache.d.ts +3 -0
  6. package/node_modules/@commandgarden/app/dist/server/routes/ai-news-cache.js +17 -0
  7. package/node_modules/@commandgarden/app/dist/server/routes/connectors.js +4 -0
  8. package/node_modules/@commandgarden/app/dist/server/routes/index.js +4 -0
  9. package/node_modules/@commandgarden/app/dist/server/routes/roles-cache.d.ts +3 -0
  10. package/node_modules/@commandgarden/app/dist/server/routes/roles-cache.js +17 -0
  11. package/node_modules/@commandgarden/app/dist/server/store.d.ts +12 -0
  12. package/node_modules/@commandgarden/app/dist/server/store.js +44 -0
  13. package/node_modules/@commandgarden/app/skills/cg/SKILL.md +4 -0
  14. package/node_modules/@commandgarden/chrome/dist/service-worker.js +1 -1
  15. package/node_modules/@commandgarden/chrome/dist/service-worker.js.map +2 -2
  16. package/node_modules/@commandgarden/daemon/connectors/alice-role-list.yaml +62 -0
  17. package/node_modules/@commandgarden/daemon/connectors/every-newsletter.eval.js +87 -0
  18. package/node_modules/@commandgarden/daemon/connectors/every-newsletter.yaml +40 -0
  19. package/node_modules/@commandgarden/daemon/connectors/simonwillison-blog.eval.js +39 -0
  20. package/node_modules/@commandgarden/daemon/connectors/simonwillison-blog.yaml +39 -0
  21. package/node_modules/@commandgarden/daemon/connectors/uis-mic-user-information.eval.js +22 -0
  22. package/node_modules/@commandgarden/daemon/connectors/uis-mic-user-information.yaml +54 -0
  23. package/package.json +1 -1
  24. package/node_modules/@commandgarden/app/dist/client/assets/Slides-DMIm_HgI.js +0 -21
  25. package/node_modules/@commandgarden/app/dist/client/assets/index-CupEN1w-.js +0 -511
@@ -1,511 +0,0 @@
1
- function cp(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 a=Object.getOwnPropertyDescriptor(s,r);a&&Object.defineProperty(e,r,a.get?a:{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 a of r)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}})();function up(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Md={exports:{}},sa={},Od={exports:{}},G={};/**
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 Cr=Symbol.for("react.element"),dp=Symbol.for("react.portal"),fp=Symbol.for("react.fragment"),hp=Symbol.for("react.strict_mode"),mp=Symbol.for("react.profiler"),pp=Symbol.for("react.provider"),gp=Symbol.for("react.context"),yp=Symbol.for("react.forward_ref"),xp=Symbol.for("react.suspense"),vp=Symbol.for("react.memo"),bp=Symbol.for("react.lazy"),Rc=Symbol.iterator;function jp(e){return e===null||typeof e!="object"?null:(e=Rc&&e[Rc]||e["@@iterator"],typeof e=="function"?e:null)}var _d={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$d=Object.assign,Dd={};function ys(e,t,n){this.props=e,this.context=t,this.refs=Dd,this.updater=n||_d}ys.prototype.isReactComponent={};ys.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")};ys.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Rd(){}Rd.prototype=ys.prototype;function Sl(e,t,n){this.props=e,this.context=t,this.refs=Dd,this.updater=n||_d}var Cl=Sl.prototype=new Rd;Cl.constructor=Sl;$d(Cl,ys.prototype);Cl.isPureReactComponent=!0;var zc=Array.isArray,zd=Object.prototype.hasOwnProperty,El={current:null},Fd={key:!0,ref:!0,__self:!0,__source:!0};function Bd(e,t,n){var s,r={},a=null,o=null;if(t!=null)for(s in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)zd.call(t,s)&&!Fd.hasOwnProperty(s)&&(r[s]=t[s]);var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];r.children=c}if(e&&e.defaultProps)for(s in l=e.defaultProps,l)r[s]===void 0&&(r[s]=l[s]);return{$$typeof:Cr,type:e,key:a,ref:o,props:r,_owner:El.current}}function wp(e,t){return{$$typeof:Cr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Tl(e){return typeof e=="object"&&e!==null&&e.$$typeof===Cr}function kp(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Fc=/\/+/g;function Ia(e,t){return typeof e=="object"&&e!==null&&e.key!=null?kp(""+e.key):t.toString(36)}function di(e,t,n,s,r){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Cr:case dp:o=!0}}if(o)return o=e,r=r(o),e=s===""?"."+Ia(o,0):s,zc(r)?(n="",e!=null&&(n=e.replace(Fc,"$&/")+"/"),di(r,t,n,"",function(u){return u})):r!=null&&(Tl(r)&&(r=wp(r,n+(!r.key||o&&o.key===r.key?"":(""+r.key).replace(Fc,"$&/")+"/")+e)),t.push(r)),1;if(o=0,s=s===""?".":s+":",zc(e))for(var l=0;l<e.length;l++){a=e[l];var c=s+Ia(a,l);o+=di(a,t,n,c,r)}else if(c=jp(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=s+Ia(a,l++),o+=di(a,t,n,c,r);else if(a==="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 zr(e,t,n){if(e==null)return e;var s=[],r=0;return di(e,s,"","",function(a){return t.call(n,a,r++)}),s}function Np(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 Me={current:null},fi={transition:null},Sp={ReactCurrentDispatcher:Me,ReactCurrentBatchConfig:fi,ReactCurrentOwner:El};function Ud(){throw Error("act(...) is not supported in production builds of React.")}G.Children={map:zr,forEach:function(e,t,n){zr(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return zr(e,function(){t++}),t},toArray:function(e){return zr(e,function(t){return t})||[]},only:function(e){if(!Tl(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};G.Component=ys;G.Fragment=fp;G.Profiler=mp;G.PureComponent=Sl;G.StrictMode=hp;G.Suspense=xp;G.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Sp;G.act=Ud;G.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=$d({},e.props),r=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=El.current),t.key!==void 0&&(r=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)zd.call(t,c)&&!Fd.hasOwnProperty(c)&&(s[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)s.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];s.children=l}return{$$typeof:Cr,type:e.type,key:r,ref:a,props:s,_owner:o}};G.createContext=function(e){return e={$$typeof:gp,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:pp,_context:e},e.Consumer=e};G.createElement=Bd;G.createFactory=function(e){var t=Bd.bind(null,e);return t.type=e,t};G.createRef=function(){return{current:null}};G.forwardRef=function(e){return{$$typeof:yp,render:e}};G.isValidElement=Tl;G.lazy=function(e){return{$$typeof:bp,_payload:{_status:-1,_result:e},_init:Np}};G.memo=function(e,t){return{$$typeof:vp,type:e,compare:t===void 0?null:t}};G.startTransition=function(e){var t=fi.transition;fi.transition={};try{e()}finally{fi.transition=t}};G.unstable_act=Ud;G.useCallback=function(e,t){return Me.current.useCallback(e,t)};G.useContext=function(e){return Me.current.useContext(e)};G.useDebugValue=function(){};G.useDeferredValue=function(e){return Me.current.useDeferredValue(e)};G.useEffect=function(e,t){return Me.current.useEffect(e,t)};G.useId=function(){return Me.current.useId()};G.useImperativeHandle=function(e,t,n){return Me.current.useImperativeHandle(e,t,n)};G.useInsertionEffect=function(e,t){return Me.current.useInsertionEffect(e,t)};G.useLayoutEffect=function(e,t){return Me.current.useLayoutEffect(e,t)};G.useMemo=function(e,t){return Me.current.useMemo(e,t)};G.useReducer=function(e,t,n){return Me.current.useReducer(e,t,n)};G.useRef=function(e){return Me.current.useRef(e)};G.useState=function(e){return Me.current.useState(e)};G.useSyncExternalStore=function(e,t,n){return Me.current.useSyncExternalStore(e,t,n)};G.useTransition=function(){return Me.current.useTransition()};G.version="18.3.1";Od.exports=G;var v=Od.exports;const Cp=up(v),Ep=cp({__proto__:null,default:Cp},[v]);/**
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 Tp=v,Ap=Symbol.for("react.element"),Lp=Symbol.for("react.fragment"),Pp=Object.prototype.hasOwnProperty,Ip=Tp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Mp={key:!0,ref:!0,__self:!0,__source:!0};function Wd(e,t,n){var s,r={},a=null,o=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(s in t)Pp.call(t,s)&&!Mp.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:Ap,type:e,key:a,ref:o,props:r,_owner:Ip.current}}sa.Fragment=Lp;sa.jsx=Wd;sa.jsxs=Wd;Md.exports=sa;var i=Md.exports,Hd={exports:{}},Ke={},Vd={exports:{}},Kd={};/**
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 F=R-1>>>1,X=L[F];if(0<r(X,_))L[F]=_,L[R]=X,R=F;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 F=0,X=L.length,ye=X>>>1;F<ye;){var _e=2*(F+1)-1,cn=L[_e],mt=_e+1,O=L[mt];if(0>r(cn,R))mt<X&&0>r(O,cn)?(L[F]=O,L[mt]=R,F=mt):(L[F]=cn,L[_e]=R,F=_e);else if(mt<X&&0>r(O,R))L[F]=O,L[mt]=R,F=mt;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 a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],m=1,d=null,p=3,y=!1,b=!1,x=!1,j=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,g=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 w(L){if(x=!1,h(L),!b)if(n(c)!==null)b=!0,I(k);else{var _=n(u);_!==null&&z(w,_.startTime-L)}}function k(L,_){b=!1,x&&(x=!1,f(N),N=-1),y=!0;var R=p;try{for(h(_),d=n(c);d!==null&&(!(d.expirationTime>_)||L&&!M());){var F=d.callback;if(typeof F=="function"){d.callback=null,p=d.priorityLevel;var X=F(d.expirationTime<=_);_=e.unstable_now(),typeof X=="function"?d.callback=X:d===n(c)&&s(c),h(_)}else s(c);d=n(c)}if(d!==null)var ye=!0;else{var _e=n(u);_e!==null&&z(w,_e.startTime-_),ye=!1}return ye}finally{d=null,p=R,y=!1}}var C=!1,S=null,N=-1,T=5,A=-1;function M(){return!(e.unstable_now()-A<T)}function U(){if(S!==null){var L=e.unstable_now();A=L;var _=!0;try{_=S(!0,L)}finally{_?W():(C=!1,S=null)}}else C=!1}var W;if(typeof g=="function")W=function(){g(U)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,$=E.port2;E.port1.onmessage=U,W=function(){$.postMessage(null)}}else W=function(){j(U,0)};function I(L){S=L,C||(C=!0,W())}function z(L,_){N=j(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,I(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 p},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(L){switch(p){case 1:case 2:case 3:var _=3;break;default:_=p}var R=p;p=_;try{return L()}finally{p=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=p;p=L;try{return _()}finally{p=R}},e.unstable_scheduleCallback=function(L,_,R){var F=e.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?F+R:F):R=F,L){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=R+X,L={id:m++,callback:_,priorityLevel:L,startTime:R,expirationTime:X,sortIndex:-1},R>F?(L.sortIndex=R,t(u,L),n(c)===null&&L===n(u)&&(x?(f(N),N=-1):x=!0,z(w,R-F))):(L.sortIndex=X,t(c,L),b||y||(b=!0,I(k))),L},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(L){var _=p;return function(){var R=p;p=_;try{return L.apply(this,arguments)}finally{p=R}}}})(Kd);Vd.exports=Kd;var Op=Vd.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 _p=v,Ve=Op;function P(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 Gd=new Set,ir={};function En(e,t){as(e,t),as(e+"Capture",t)}function as(e,t){for(ir[e]=t,e=0;e<t.length;e++)Gd.add(t[e])}var Pt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xo=Object.prototype.hasOwnProperty,$p=/^[: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]*$/,Bc={},Uc={};function Dp(e){return xo.call(Uc,e)?!0:xo.call(Bc,e)?!1:$p.test(e)?Uc[e]=!0:(Bc[e]=!0,!1)}function Rp(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 zp(e,t,n,s){if(t===null||typeof t>"u"||Rp(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 Oe(e,t,n,s,r,a,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=a,this.removeEmptyString=o}var Ne={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ne[e]=new Oe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ne[t]=new Oe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ne[e]=new Oe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ne[e]=new Oe(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){Ne[e]=new Oe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ne[e]=new Oe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ne[e]=new Oe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ne[e]=new Oe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ne[e]=new Oe(e,5,!1,e.toLowerCase(),null,!1,!1)});var Al=/[\-:]([a-z])/g;function Ll(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(Al,Ll);Ne[t]=new Oe(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(Al,Ll);Ne[t]=new Oe(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(Al,Ll);Ne[t]=new Oe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ne[e]=new Oe(e,1,!1,e.toLowerCase(),null,!1,!1)});Ne.xlinkHref=new Oe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ne[e]=new Oe(e,1,!1,e.toLowerCase(),null,!0,!0)});function Pl(e,t,n,s){var r=Ne.hasOwnProperty(t)?Ne[t]:null;(r!==null?r.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(zp(t,n,r,s)&&(n=null),s||r===null?Dp(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 _t=_p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Fr=Symbol.for("react.element"),$n=Symbol.for("react.portal"),Dn=Symbol.for("react.fragment"),Il=Symbol.for("react.strict_mode"),vo=Symbol.for("react.profiler"),qd=Symbol.for("react.provider"),Yd=Symbol.for("react.context"),Ml=Symbol.for("react.forward_ref"),bo=Symbol.for("react.suspense"),jo=Symbol.for("react.suspense_list"),Ol=Symbol.for("react.memo"),Rt=Symbol.for("react.lazy"),Qd=Symbol.for("react.offscreen"),Wc=Symbol.iterator;function Ts(e){return e===null||typeof e!="object"?null:(e=Wc&&e[Wc]||e["@@iterator"],typeof e=="function"?e:null)}var ae=Object.assign,Ma;function Bs(e){if(Ma===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ma=t&&t[1]||""}return`
34
- `+Ma+e}var Oa=!1;function _a(e,t){if(!e||Oa)return"";Oa=!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
- `),a=s.stack.split(`
36
- `),o=r.length-1,l=a.length-1;1<=o&&0<=l&&r[o]!==a[l];)l--;for(;1<=o&&0<=l;o--,l--)if(r[o]!==a[l]){if(o!==1||l!==1)do if(o--,l--,0>l||r[o]!==a[l]){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<=l);break}}}finally{Oa=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Bs(e):""}function Fp(e){switch(e.tag){case 5:return Bs(e.type);case 16:return Bs("Lazy");case 13:return Bs("Suspense");case 19:return Bs("SuspenseList");case 0:case 2:case 15:return e=_a(e.type,!1),e;case 11:return e=_a(e.type.render,!1),e;case 1:return e=_a(e.type,!0),e;default:return""}}function wo(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 Dn:return"Fragment";case $n:return"Portal";case vo:return"Profiler";case Il:return"StrictMode";case bo:return"Suspense";case jo:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Yd:return(e.displayName||"Context")+".Consumer";case qd:return(e._context.displayName||"Context")+".Provider";case Ml:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ol:return t=e.displayName||null,t!==null?t:wo(e.type)||"Memo";case Rt:t=e._payload,e=e._init;try{return wo(e(t))}catch{}}return null}function Bp(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 wo(t);case 8:return t===Il?"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 nn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Jd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Up(e){var t=Jd(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,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(o){s=""+o,a.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 Br(e){e._valueTracker||(e._valueTracker=Up(e))}function Xd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=Jd(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function Ei(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 ko(e,t){var n=t.checked;return ae({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Hc(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=nn(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 Zd(e,t){t=t.checked,t!=null&&Pl(e,"checked",t,!1)}function No(e,t){Zd(e,t);var n=nn(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")?So(e,t.type,n):t.hasOwnProperty("defaultValue")&&So(e,t.type,nn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Vc(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 So(e,t,n){(t!=="number"||Ei(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Us=Array.isArray;function Xn(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=""+nn(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 Co(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(P(91));return ae({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Kc(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(P(92));if(Us(n)){if(1<n.length)throw Error(P(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:nn(n)}}function ef(e,t){var n=nn(t.value),s=nn(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 Gc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function tf(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 Eo(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?tf(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ur,nf=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(Ur=Ur||document.createElement("div"),Ur.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ur.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ar(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qs={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},Wp=["Webkit","ms","Moz","O"];Object.keys(qs).forEach(function(e){Wp.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),qs[t]=qs[e]})});function sf(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||qs.hasOwnProperty(e)&&qs[e]?(""+t).trim():t+"px"}function rf(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,r=sf(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,r):e[n]=r}}var Hp=ae({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 To(e,t){if(t){if(Hp[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(P(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(P(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(P(61))}if(t.style!=null&&typeof t.style!="object")throw Error(P(62))}}function Ao(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 Lo=null;function _l(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Po=null,Zn=null,es=null;function qc(e){if(e=Ar(e)){if(typeof Po!="function")throw Error(P(280));var t=e.stateNode;t&&(t=la(t),Po(e.stateNode,e.type,t))}}function af(e){Zn?es?es.push(e):es=[e]:Zn=e}function of(){if(Zn){var e=Zn,t=es;if(es=Zn=null,qc(e),t)for(e=0;e<t.length;e++)qc(t[e])}}function lf(e,t){return e(t)}function cf(){}var $a=!1;function uf(e,t,n){if($a)return e(t,n);$a=!0;try{return lf(e,t,n)}finally{$a=!1,(Zn!==null||es!==null)&&(cf(),of())}}function or(e,t){var n=e.stateNode;if(n===null)return null;var s=la(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(P(231,t,typeof n));return n}var Io=!1;if(Pt)try{var As={};Object.defineProperty(As,"passive",{get:function(){Io=!0}}),window.addEventListener("test",As,As),window.removeEventListener("test",As,As)}catch{Io=!1}function Vp(e,t,n,s,r,a,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(m){this.onError(m)}}var Ys=!1,Ti=null,Ai=!1,Mo=null,Kp={onError:function(e){Ys=!0,Ti=e}};function Gp(e,t,n,s,r,a,o,l,c){Ys=!1,Ti=null,Vp.apply(Kp,arguments)}function qp(e,t,n,s,r,a,o,l,c){if(Gp.apply(this,arguments),Ys){if(Ys){var u=Ti;Ys=!1,Ti=null}else throw Error(P(198));Ai||(Ai=!0,Mo=u)}}function Tn(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 df(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 Yc(e){if(Tn(e)!==e)throw Error(P(188))}function Yp(e){var t=e.alternate;if(!t){if(t=Tn(e),t===null)throw Error(P(188));return t!==e?null:e}for(var n=e,s=t;;){var r=n.return;if(r===null)break;var a=r.alternate;if(a===null){if(s=r.return,s!==null){n=s;continue}break}if(r.child===a.child){for(a=r.child;a;){if(a===n)return Yc(r),e;if(a===s)return Yc(r),t;a=a.sibling}throw Error(P(188))}if(n.return!==s.return)n=r,s=a;else{for(var o=!1,l=r.child;l;){if(l===n){o=!0,n=r,s=a;break}if(l===s){o=!0,s=r,n=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===n){o=!0,n=a,s=r;break}if(l===s){o=!0,s=a,n=r;break}l=l.sibling}if(!o)throw Error(P(189))}}if(n.alternate!==s)throw Error(P(190))}if(n.tag!==3)throw Error(P(188));return n.stateNode.current===n?e:t}function ff(e){return e=Yp(e),e!==null?hf(e):null}function hf(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=hf(e);if(t!==null)return t;e=e.sibling}return null}var mf=Ve.unstable_scheduleCallback,Qc=Ve.unstable_cancelCallback,Qp=Ve.unstable_shouldYield,Jp=Ve.unstable_requestPaint,ue=Ve.unstable_now,Xp=Ve.unstable_getCurrentPriorityLevel,$l=Ve.unstable_ImmediatePriority,pf=Ve.unstable_UserBlockingPriority,Li=Ve.unstable_NormalPriority,Zp=Ve.unstable_LowPriority,gf=Ve.unstable_IdlePriority,ra=null,bt=null;function e0(e){if(bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(ra,e,void 0,(e.current.flags&128)===128)}catch{}}var ut=Math.clz32?Math.clz32:s0,t0=Math.log,n0=Math.LN2;function s0(e){return e>>>=0,e===0?32:31-(t0(e)/n0|0)|0}var Wr=64,Hr=4194304;function Ws(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,a=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~r;l!==0?s=Ws(l):(a&=o,a!==0&&(s=Ws(a)))}else o=n&~r,o!==0?s=Ws(o):a!==0&&(s=Ws(a));if(s===0)return 0;if(t!==0&&t!==s&&!(t&r)&&(r=s&-s,a=t&-t,r>=a||r===16&&(a&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-ut(t),r=1<<n,s|=e[n],t&=~r;return s}function r0(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 i0(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-ut(a),l=1<<o,c=r[o];c===-1?(!(l&n)||l&s)&&(r[o]=r0(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function Oo(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function yf(){var e=Wr;return Wr<<=1,!(Wr&4194240)&&(Wr=64),e}function Da(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Er(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ut(t),e[t]=n}function a0(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-ut(n),a=1<<r;t[r]=0,s[r]=-1,e[r]=-1,n&=~a}}function Dl(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-ut(n),r=1<<s;r&t|e[s]&t&&(e[s]|=t),n&=~r}}var J=0;function xf(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var vf,Rl,bf,jf,wf,_o=!1,Vr=[],Kt=null,Gt=null,qt=null,lr=new Map,cr=new Map,Bt=[],o0="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":Kt=null;break;case"dragenter":case"dragleave":Gt=null;break;case"mouseover":case"mouseout":qt=null;break;case"pointerover":case"pointerout":lr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":cr.delete(t.pointerId)}}function Ls(e,t,n,s,r,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:a,targetContainers:[r]},t!==null&&(t=Ar(t),t!==null&&Rl(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function l0(e,t,n,s,r){switch(t){case"focusin":return Kt=Ls(Kt,e,t,n,s,r),!0;case"dragenter":return Gt=Ls(Gt,e,t,n,s,r),!0;case"mouseover":return qt=Ls(qt,e,t,n,s,r),!0;case"pointerover":var a=r.pointerId;return lr.set(a,Ls(lr.get(a)||null,e,t,n,s,r)),!0;case"gotpointercapture":return a=r.pointerId,cr.set(a,Ls(cr.get(a)||null,e,t,n,s,r)),!0}return!1}function kf(e){var t=mn(e.target);if(t!==null){var n=Tn(t);if(n!==null){if(t=n.tag,t===13){if(t=df(n),t!==null){e.blockedOn=t,wf(e.priority,function(){bf(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 hi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=$o(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);Lo=s,n.target.dispatchEvent(s),Lo=null}else return t=Ar(n),t!==null&&Rl(t),e.blockedOn=n,!1;t.shift()}return!0}function Xc(e,t,n){hi(e)&&n.delete(t)}function c0(){_o=!1,Kt!==null&&hi(Kt)&&(Kt=null),Gt!==null&&hi(Gt)&&(Gt=null),qt!==null&&hi(qt)&&(qt=null),lr.forEach(Xc),cr.forEach(Xc)}function Ps(e,t){e.blockedOn===t&&(e.blockedOn=null,_o||(_o=!0,Ve.unstable_scheduleCallback(Ve.unstable_NormalPriority,c0)))}function ur(e){function t(r){return Ps(r,e)}if(0<Vr.length){Ps(Vr[0],e);for(var n=1;n<Vr.length;n++){var s=Vr[n];s.blockedOn===e&&(s.blockedOn=null)}}for(Kt!==null&&Ps(Kt,e),Gt!==null&&Ps(Gt,e),qt!==null&&Ps(qt,e),lr.forEach(t),cr.forEach(t),n=0;n<Bt.length;n++)s=Bt[n],s.blockedOn===e&&(s.blockedOn=null);for(;0<Bt.length&&(n=Bt[0],n.blockedOn===null);)kf(n),n.blockedOn===null&&Bt.shift()}var ts=_t.ReactCurrentBatchConfig,Ii=!0;function u0(e,t,n,s){var r=J,a=ts.transition;ts.transition=null;try{J=1,zl(e,t,n,s)}finally{J=r,ts.transition=a}}function d0(e,t,n,s){var r=J,a=ts.transition;ts.transition=null;try{J=4,zl(e,t,n,s)}finally{J=r,ts.transition=a}}function zl(e,t,n,s){if(Ii){var r=$o(e,t,n,s);if(r===null)Ga(e,t,s,Mi,n),Jc(e,s);else if(l0(r,e,t,n,s))s.stopPropagation();else if(Jc(e,s),t&4&&-1<o0.indexOf(e)){for(;r!==null;){var a=Ar(r);if(a!==null&&vf(a),a=$o(e,t,n,s),a===null&&Ga(e,t,s,Mi,n),a===r)break;r=a}r!==null&&s.stopPropagation()}else Ga(e,t,s,null,n)}}var Mi=null;function $o(e,t,n,s){if(Mi=null,e=_l(s),e=mn(e),e!==null)if(t=Tn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=df(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 Nf(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(Xp()){case $l:return 1;case pf:return 4;case Li:case Zp:return 16;case gf:return 536870912;default:return 16}default:return 16}}var Wt=null,Fl=null,mi=null;function Sf(){if(mi)return mi;var e,t=Fl,n=t.length,s,r="value"in Wt?Wt.value:Wt.textContent,a=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[a-s];s++);return mi=r.slice(e,1<s?1-s:void 0)}function pi(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 Kr(){return!0}function Zc(){return!1}function Ge(e){function t(n,s,r,a,o){this._reactName=n,this._targetInst=r,this.type=s,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Kr:Zc,this.isPropagationStopped=Zc,this}return ae(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=Kr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Kr)},persist:function(){},isPersistent:Kr}),t}var xs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bl=Ge(xs),Tr=ae({},xs,{view:0,detail:0}),f0=Ge(Tr),Ra,za,Is,ia=ae({},Tr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ul,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!==Is&&(Is&&e.type==="mousemove"?(Ra=e.screenX-Is.screenX,za=e.screenY-Is.screenY):za=Ra=0,Is=e),Ra)},movementY:function(e){return"movementY"in e?e.movementY:za}}),eu=Ge(ia),h0=ae({},ia,{dataTransfer:0}),m0=Ge(h0),p0=ae({},Tr,{relatedTarget:0}),Fa=Ge(p0),g0=ae({},xs,{animationName:0,elapsedTime:0,pseudoElement:0}),y0=Ge(g0),x0=ae({},xs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),v0=Ge(x0),b0=ae({},xs,{data:0}),tu=Ge(b0),j0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},w0={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"},k0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function N0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=k0[e])?!!t[e]:!1}function Ul(){return N0}var S0=ae({},Tr,{key:function(e){if(e.key){var t=j0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=pi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?w0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ul,charCode:function(e){return e.type==="keypress"?pi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?pi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),C0=Ge(S0),E0=ae({},ia,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nu=Ge(E0),T0=ae({},Tr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ul}),A0=Ge(T0),L0=ae({},xs,{propertyName:0,elapsedTime:0,pseudoElement:0}),P0=Ge(L0),I0=ae({},ia,{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}),M0=Ge(I0),O0=[9,13,27,32],Wl=Pt&&"CompositionEvent"in window,Qs=null;Pt&&"documentMode"in document&&(Qs=document.documentMode);var _0=Pt&&"TextEvent"in window&&!Qs,Cf=Pt&&(!Wl||Qs&&8<Qs&&11>=Qs),su=" ",ru=!1;function Ef(e,t){switch(e){case"keyup":return O0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Rn=!1;function $0(e,t){switch(e){case"compositionend":return Tf(t);case"keypress":return t.which!==32?null:(ru=!0,su);case"textInput":return e=t.data,e===su&&ru?null:e;default:return null}}function D0(e,t){if(Rn)return e==="compositionend"||!Wl&&Ef(e,t)?(e=Sf(),mi=Fl=Wt=null,Rn=!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 Cf&&t.locale!=="ko"?null:t.data;default:return null}}var R0={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 iu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!R0[e.type]:t==="textarea"}function Af(e,t,n,s){af(s),t=Oi(t,"onChange"),0<t.length&&(n=new Bl("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var Js=null,dr=null;function z0(e){Ff(e,0)}function aa(e){var t=Bn(e);if(Xd(t))return e}function F0(e,t){if(e==="change")return t}var Lf=!1;if(Pt){var Ba;if(Pt){var Ua="oninput"in document;if(!Ua){var au=document.createElement("div");au.setAttribute("oninput","return;"),Ua=typeof au.oninput=="function"}Ba=Ua}else Ba=!1;Lf=Ba&&(!document.documentMode||9<document.documentMode)}function ou(){Js&&(Js.detachEvent("onpropertychange",Pf),dr=Js=null)}function Pf(e){if(e.propertyName==="value"&&aa(dr)){var t=[];Af(t,dr,e,_l(e)),uf(z0,t)}}function B0(e,t,n){e==="focusin"?(ou(),Js=t,dr=n,Js.attachEvent("onpropertychange",Pf)):e==="focusout"&&ou()}function U0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return aa(dr)}function W0(e,t){if(e==="click")return aa(t)}function H0(e,t){if(e==="input"||e==="change")return aa(t)}function V0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ft=typeof Object.is=="function"?Object.is:V0;function fr(e,t){if(ft(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(!xo.call(t,r)||!ft(e[r],t[r]))return!1}return!0}function lu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cu(e,t){var n=lu(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=lu(n)}}function If(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?If(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mf(){for(var e=window,t=Ei();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ei(e.document)}return t}function Hl(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 K0(e){var t=Mf(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&If(n.ownerDocument.documentElement,n)){if(s!==null&&Hl(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,a=Math.min(s.start,r);s=s.end===void 0?a:Math.min(s.end,r),!e.extend&&a>s&&(r=s,s=a,a=r),r=cu(n,a);var o=cu(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(),a>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 G0=Pt&&"documentMode"in document&&11>=document.documentMode,zn=null,Do=null,Xs=null,Ro=!1;function uu(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ro||zn==null||zn!==Ei(s)||(s=zn,"selectionStart"in s&&Hl(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}),Xs&&fr(Xs,s)||(Xs=s,s=Oi(Do,"onSelect"),0<s.length&&(t=new Bl("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=zn)))}function Gr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Fn={animationend:Gr("Animation","AnimationEnd"),animationiteration:Gr("Animation","AnimationIteration"),animationstart:Gr("Animation","AnimationStart"),transitionend:Gr("Transition","TransitionEnd")},Wa={},Of={};Pt&&(Of=document.createElement("div").style,"AnimationEvent"in window||(delete Fn.animationend.animation,delete Fn.animationiteration.animation,delete Fn.animationstart.animation),"TransitionEvent"in window||delete Fn.transitionend.transition);function oa(e){if(Wa[e])return Wa[e];if(!Fn[e])return e;var t=Fn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Of)return Wa[e]=t[n];return e}var _f=oa("animationend"),$f=oa("animationiteration"),Df=oa("animationstart"),Rf=oa("transitionend"),zf=new Map,du="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 rn(e,t){zf.set(e,t),En(t,[e])}for(var Ha=0;Ha<du.length;Ha++){var Va=du[Ha],q0=Va.toLowerCase(),Y0=Va[0].toUpperCase()+Va.slice(1);rn(q0,"on"+Y0)}rn(_f,"onAnimationEnd");rn($f,"onAnimationIteration");rn(Df,"onAnimationStart");rn("dblclick","onDoubleClick");rn("focusin","onFocus");rn("focusout","onBlur");rn(Rf,"onTransitionEnd");as("onMouseEnter",["mouseout","mouseover"]);as("onMouseLeave",["mouseout","mouseover"]);as("onPointerEnter",["pointerout","pointerover"]);as("onPointerLeave",["pointerout","pointerover"]);En("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));En("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));En("onBeforeInput",["compositionend","keypress","textInput","paste"]);En("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));En("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));En("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hs="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(" "),Q0=new Set("cancel close invalid load scroll toggle".split(" ").concat(Hs));function fu(e,t,n){var s=e.type||"unknown-event";e.currentTarget=n,qp(s,t,void 0,e),e.currentTarget=null}function Ff(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 a=void 0;if(t)for(var o=s.length-1;0<=o;o--){var l=s[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==a&&r.isPropagationStopped())break e;fu(r,l,u),a=c}else for(o=0;o<s.length;o++){if(l=s[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==a&&r.isPropagationStopped())break e;fu(r,l,u),a=c}}}if(Ai)throw e=Mo,Ai=!1,Mo=null,e}function te(e,t){var n=t[Wo];n===void 0&&(n=t[Wo]=new Set);var s=e+"__bubble";n.has(s)||(Bf(t,e,2,!1),n.add(s))}function Ka(e,t,n){var s=0;t&&(s|=4),Bf(n,e,s,t)}var qr="_reactListening"+Math.random().toString(36).slice(2);function hr(e){if(!e[qr]){e[qr]=!0,Gd.forEach(function(n){n!=="selectionchange"&&(Q0.has(n)||Ka(n,!1,e),Ka(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[qr]||(t[qr]=!0,Ka("selectionchange",!1,t))}}function Bf(e,t,n,s){switch(Nf(t)){case 1:var r=u0;break;case 4:r=d0;break;default:r=zl}n=r.bind(null,t,n,e),r=void 0,!Io||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 Ga(e,t,n,s,r){var a=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var o=s.tag;if(o===3||o===4){var l=s.stateNode.containerInfo;if(l===r||l.nodeType===8&&l.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(;l!==null;){if(o=mn(l),o===null)return;if(c=o.tag,c===5||c===6){s=a=o;continue e}l=l.parentNode}}s=s.return}uf(function(){var u=a,m=_l(n),d=[];e:{var p=zf.get(e);if(p!==void 0){var y=Bl,b=e;switch(e){case"keypress":if(pi(n)===0)break e;case"keydown":case"keyup":y=C0;break;case"focusin":b="focus",y=Fa;break;case"focusout":b="blur",y=Fa;break;case"beforeblur":case"afterblur":y=Fa;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=eu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=m0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=A0;break;case _f:case $f:case Df:y=y0;break;case Rf:y=P0;break;case"scroll":y=f0;break;case"wheel":y=M0;break;case"copy":case"cut":case"paste":y=v0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=nu}var x=(t&4)!==0,j=!x&&e==="scroll",f=x?p!==null?p+"Capture":null:p;x=[];for(var g=u,h;g!==null;){h=g;var w=h.stateNode;if(h.tag===5&&w!==null&&(h=w,f!==null&&(w=or(g,f),w!=null&&x.push(mr(g,w,h)))),j)break;g=g.return}0<x.length&&(p=new y(p,b,null,n,m),d.push({event:p,listeners:x}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",p&&n!==Lo&&(b=n.relatedTarget||n.fromElement)&&(mn(b)||b[It]))break e;if((y||p)&&(p=m.window===m?m:(p=m.ownerDocument)?p.defaultView||p.parentWindow:window,y?(b=n.relatedTarget||n.toElement,y=u,b=b?mn(b):null,b!==null&&(j=Tn(b),b!==j||b.tag!==5&&b.tag!==6)&&(b=null)):(y=null,b=u),y!==b)){if(x=eu,w="onMouseLeave",f="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(x=nu,w="onPointerLeave",f="onPointerEnter",g="pointer"),j=y==null?p:Bn(y),h=b==null?p:Bn(b),p=new x(w,g+"leave",y,n,m),p.target=j,p.relatedTarget=h,w=null,mn(m)===u&&(x=new x(f,g+"enter",b,n,m),x.target=h,x.relatedTarget=j,w=x),j=w,y&&b)t:{for(x=y,f=b,g=0,h=x;h;h=Ln(h))g++;for(h=0,w=f;w;w=Ln(w))h++;for(;0<g-h;)x=Ln(x),g--;for(;0<h-g;)f=Ln(f),h--;for(;g--;){if(x===f||f!==null&&x===f.alternate)break t;x=Ln(x),f=Ln(f)}x=null}else x=null;y!==null&&hu(d,p,y,x,!1),b!==null&&j!==null&&hu(d,j,b,x,!0)}}e:{if(p=u?Bn(u):window,y=p.nodeName&&p.nodeName.toLowerCase(),y==="select"||y==="input"&&p.type==="file")var k=F0;else if(iu(p))if(Lf)k=H0;else{k=U0;var C=B0}else(y=p.nodeName)&&y.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(k=W0);if(k&&(k=k(e,u))){Af(d,k,n,m);break e}C&&C(e,p,u),e==="focusout"&&(C=p._wrapperState)&&C.controlled&&p.type==="number"&&So(p,"number",p.value)}switch(C=u?Bn(u):window,e){case"focusin":(iu(C)||C.contentEditable==="true")&&(zn=C,Do=u,Xs=null);break;case"focusout":Xs=Do=zn=null;break;case"mousedown":Ro=!0;break;case"contextmenu":case"mouseup":case"dragend":Ro=!1,uu(d,n,m);break;case"selectionchange":if(G0)break;case"keydown":case"keyup":uu(d,n,m)}var S;if(Wl)e:{switch(e){case"compositionstart":var N="onCompositionStart";break e;case"compositionend":N="onCompositionEnd";break e;case"compositionupdate":N="onCompositionUpdate";break e}N=void 0}else Rn?Ef(e,n)&&(N="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(Cf&&n.locale!=="ko"&&(Rn||N!=="onCompositionStart"?N==="onCompositionEnd"&&Rn&&(S=Sf()):(Wt=m,Fl="value"in Wt?Wt.value:Wt.textContent,Rn=!0)),C=Oi(u,N),0<C.length&&(N=new tu(N,e,null,n,m),d.push({event:N,listeners:C}),S?N.data=S:(S=Tf(n),S!==null&&(N.data=S)))),(S=_0?$0(e,n):D0(e,n))&&(u=Oi(u,"onBeforeInput"),0<u.length&&(m=new tu("onBeforeInput","beforeinput",null,n,m),d.push({event:m,listeners:u}),m.data=S))}Ff(d,t)})}function mr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Oi(e,t){for(var n=t+"Capture",s=[];e!==null;){var r=e,a=r.stateNode;r.tag===5&&a!==null&&(r=a,a=or(e,n),a!=null&&s.unshift(mr(e,a,r)),a=or(e,t),a!=null&&s.push(mr(e,a,r))),e=e.return}return s}function Ln(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function hu(e,t,n,s,r){for(var a=t._reactName,o=[];n!==null&&n!==s;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===s)break;l.tag===5&&u!==null&&(l=u,r?(c=or(n,a),c!=null&&o.unshift(mr(n,c,l))):r||(c=or(n,a),c!=null&&o.push(mr(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var J0=/\r\n?/g,X0=/\u0000|\uFFFD/g;function mu(e){return(typeof e=="string"?e:""+e).replace(J0,`
38
- `).replace(X0,"")}function Yr(e,t,n){if(t=mu(t),mu(e)!==t&&n)throw Error(P(425))}function _i(){}var zo=null,Fo=null;function Bo(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 Uo=typeof setTimeout=="function"?setTimeout:void 0,Z0=typeof clearTimeout=="function"?clearTimeout:void 0,pu=typeof Promise=="function"?Promise:void 0,eg=typeof queueMicrotask=="function"?queueMicrotask:typeof pu<"u"?function(e){return pu.resolve(null).then(e).catch(tg)}:Uo;function tg(e){setTimeout(function(){throw e})}function qa(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),ur(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=r}while(n);ur(t)}function Yt(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 gu(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 vs=Math.random().toString(36).slice(2),vt="__reactFiber$"+vs,pr="__reactProps$"+vs,It="__reactContainer$"+vs,Wo="__reactEvents$"+vs,ng="__reactListeners$"+vs,sg="__reactHandles$"+vs;function mn(e){var t=e[vt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[It]||n[vt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=gu(e);e!==null;){if(n=e[vt])return n;e=gu(e)}return t}e=n,n=e.parentNode}return null}function Ar(e){return e=e[vt]||e[It],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Bn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(P(33))}function la(e){return e[pr]||null}var Ho=[],Un=-1;function an(e){return{current:e}}function ne(e){0>Un||(e.current=Ho[Un],Ho[Un]=null,Un--)}function Z(e,t){Un++,Ho[Un]=e.current,e.current=t}var sn={},Te=an(sn),ze=an(!1),jn=sn;function os(e,t){var n=e.type.contextTypes;if(!n)return sn;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var r={},a;for(a in n)r[a]=t[a];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=r),r}function Fe(e){return e=e.childContextTypes,e!=null}function $i(){ne(ze),ne(Te)}function yu(e,t,n){if(Te.current!==sn)throw Error(P(168));Z(Te,t),Z(ze,n)}function Uf(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(P(108,Bp(e)||"Unknown",r));return ae({},n,s)}function Di(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||sn,jn=Te.current,Z(Te,e),Z(ze,ze.current),!0}function xu(e,t,n){var s=e.stateNode;if(!s)throw Error(P(169));n?(e=Uf(e,t,jn),s.__reactInternalMemoizedMergedChildContext=e,ne(ze),ne(Te),Z(Te,e)):ne(ze),Z(ze,n)}var St=null,ca=!1,Ya=!1;function Wf(e){St===null?St=[e]:St.push(e)}function rg(e){ca=!0,Wf(e)}function on(){if(!Ya&&St!==null){Ya=!0;var e=0,t=J;try{var n=St;for(J=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}St=null,ca=!1}catch(r){throw St!==null&&(St=St.slice(e+1)),mf($l,on),r}finally{J=t,Ya=!1}}return null}var Wn=[],Hn=0,Ri=null,zi=0,Ye=[],Qe=0,wn=null,Ct=1,Et="";function dn(e,t){Wn[Hn++]=zi,Wn[Hn++]=Ri,Ri=e,zi=t}function Hf(e,t,n){Ye[Qe++]=Ct,Ye[Qe++]=Et,Ye[Qe++]=wn,wn=e;var s=Ct;e=Et;var r=32-ut(s)-1;s&=~(1<<r),n+=1;var a=32-ut(t)+r;if(30<a){var o=r-r%5;a=(s&(1<<o)-1).toString(32),s>>=o,r-=o,Ct=1<<32-ut(t)+r|n<<r|s,Et=a+e}else Ct=1<<a|n<<r|s,Et=e}function Vl(e){e.return!==null&&(dn(e,1),Hf(e,1,0))}function Kl(e){for(;e===Ri;)Ri=Wn[--Hn],Wn[Hn]=null,zi=Wn[--Hn],Wn[Hn]=null;for(;e===wn;)wn=Ye[--Qe],Ye[Qe]=null,Et=Ye[--Qe],Ye[Qe]=null,Ct=Ye[--Qe],Ye[Qe]=null}var He=null,We=null,se=!1,ct=null;function Vf(e,t){var n=Xe(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 vu(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,He=e,We=Yt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,He=e,We=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=wn!==null?{id:Ct,overflow:Et}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Xe(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,He=e,We=null,!0):!1;default:return!1}}function Vo(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ko(e){if(se){var t=We;if(t){var n=t;if(!vu(e,t)){if(Vo(e))throw Error(P(418));t=Yt(n.nextSibling);var s=He;t&&vu(e,t)?Vf(s,n):(e.flags=e.flags&-4097|2,se=!1,He=e)}}else{if(Vo(e))throw Error(P(418));e.flags=e.flags&-4097|2,se=!1,He=e}}}function bu(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;He=e}function Qr(e){if(e!==He)return!1;if(!se)return bu(e),se=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Bo(e.type,e.memoizedProps)),t&&(t=We)){if(Vo(e))throw Kf(),Error(P(418));for(;t;)Vf(e,t),t=Yt(t.nextSibling)}if(bu(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(P(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){We=Yt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}We=null}}else We=He?Yt(e.stateNode.nextSibling):null;return!0}function Kf(){for(var e=We;e;)e=Yt(e.nextSibling)}function ls(){We=He=null,se=!1}function Gl(e){ct===null?ct=[e]:ct.push(e)}var ig=_t.ReactCurrentBatchConfig;function Ms(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(P(309));var s=n.stateNode}if(!s)throw Error(P(147,e));var r=s,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var l=r.refs;o===null?delete l[a]:l[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(P(284));if(!n._owner)throw Error(P(290,e))}return e}function Jr(e,t){throw e=Object.prototype.toString.call(t),Error(P(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ju(e){var t=e._init;return t(e._payload)}function Gf(e){function t(f,g){if(e){var h=f.deletions;h===null?(f.deletions=[g],f.flags|=16):h.push(g)}}function n(f,g){if(!e)return null;for(;g!==null;)t(f,g),g=g.sibling;return null}function s(f,g){for(f=new Map;g!==null;)g.key!==null?f.set(g.key,g):f.set(g.index,g),g=g.sibling;return f}function r(f,g){return f=Zt(f,g),f.index=0,f.sibling=null,f}function a(f,g,h){return f.index=h,e?(h=f.alternate,h!==null?(h=h.index,h<g?(f.flags|=2,g):h):(f.flags|=2,g)):(f.flags|=1048576,g)}function o(f){return e&&f.alternate===null&&(f.flags|=2),f}function l(f,g,h,w){return g===null||g.tag!==6?(g=no(h,f.mode,w),g.return=f,g):(g=r(g,h),g.return=f,g)}function c(f,g,h,w){var k=h.type;return k===Dn?m(f,g,h.props.children,w,h.key):g!==null&&(g.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Rt&&ju(k)===g.type)?(w=r(g,h.props),w.ref=Ms(f,g,h),w.return=f,w):(w=wi(h.type,h.key,h.props,null,f.mode,w),w.ref=Ms(f,g,h),w.return=f,w)}function u(f,g,h,w){return g===null||g.tag!==4||g.stateNode.containerInfo!==h.containerInfo||g.stateNode.implementation!==h.implementation?(g=so(h,f.mode,w),g.return=f,g):(g=r(g,h.children||[]),g.return=f,g)}function m(f,g,h,w,k){return g===null||g.tag!==7?(g=bn(h,f.mode,w,k),g.return=f,g):(g=r(g,h),g.return=f,g)}function d(f,g,h){if(typeof g=="string"&&g!==""||typeof g=="number")return g=no(""+g,f.mode,h),g.return=f,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Fr:return h=wi(g.type,g.key,g.props,null,f.mode,h),h.ref=Ms(f,null,g),h.return=f,h;case $n:return g=so(g,f.mode,h),g.return=f,g;case Rt:var w=g._init;return d(f,w(g._payload),h)}if(Us(g)||Ts(g))return g=bn(g,f.mode,h,null),g.return=f,g;Jr(f,g)}return null}function p(f,g,h,w){var k=g!==null?g.key:null;if(typeof h=="string"&&h!==""||typeof h=="number")return k!==null?null:l(f,g,""+h,w);if(typeof h=="object"&&h!==null){switch(h.$$typeof){case Fr:return h.key===k?c(f,g,h,w):null;case $n:return h.key===k?u(f,g,h,w):null;case Rt:return k=h._init,p(f,g,k(h._payload),w)}if(Us(h)||Ts(h))return k!==null?null:m(f,g,h,w,null);Jr(f,h)}return null}function y(f,g,h,w,k){if(typeof w=="string"&&w!==""||typeof w=="number")return f=f.get(h)||null,l(g,f,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Fr:return f=f.get(w.key===null?h:w.key)||null,c(g,f,w,k);case $n:return f=f.get(w.key===null?h:w.key)||null,u(g,f,w,k);case Rt:var C=w._init;return y(f,g,h,C(w._payload),k)}if(Us(w)||Ts(w))return f=f.get(h)||null,m(g,f,w,k,null);Jr(g,w)}return null}function b(f,g,h,w){for(var k=null,C=null,S=g,N=g=0,T=null;S!==null&&N<h.length;N++){S.index>N?(T=S,S=null):T=S.sibling;var A=p(f,S,h[N],w);if(A===null){S===null&&(S=T);break}e&&S&&A.alternate===null&&t(f,S),g=a(A,g,N),C===null?k=A:C.sibling=A,C=A,S=T}if(N===h.length)return n(f,S),se&&dn(f,N),k;if(S===null){for(;N<h.length;N++)S=d(f,h[N],w),S!==null&&(g=a(S,g,N),C===null?k=S:C.sibling=S,C=S);return se&&dn(f,N),k}for(S=s(f,S);N<h.length;N++)T=y(S,f,N,h[N],w),T!==null&&(e&&T.alternate!==null&&S.delete(T.key===null?N:T.key),g=a(T,g,N),C===null?k=T:C.sibling=T,C=T);return e&&S.forEach(function(M){return t(f,M)}),se&&dn(f,N),k}function x(f,g,h,w){var k=Ts(h);if(typeof k!="function")throw Error(P(150));if(h=k.call(h),h==null)throw Error(P(151));for(var C=k=null,S=g,N=g=0,T=null,A=h.next();S!==null&&!A.done;N++,A=h.next()){S.index>N?(T=S,S=null):T=S.sibling;var M=p(f,S,A.value,w);if(M===null){S===null&&(S=T);break}e&&S&&M.alternate===null&&t(f,S),g=a(M,g,N),C===null?k=M:C.sibling=M,C=M,S=T}if(A.done)return n(f,S),se&&dn(f,N),k;if(S===null){for(;!A.done;N++,A=h.next())A=d(f,A.value,w),A!==null&&(g=a(A,g,N),C===null?k=A:C.sibling=A,C=A);return se&&dn(f,N),k}for(S=s(f,S);!A.done;N++,A=h.next())A=y(S,f,N,A.value,w),A!==null&&(e&&A.alternate!==null&&S.delete(A.key===null?N:A.key),g=a(A,g,N),C===null?k=A:C.sibling=A,C=A);return e&&S.forEach(function(U){return t(f,U)}),se&&dn(f,N),k}function j(f,g,h,w){if(typeof h=="object"&&h!==null&&h.type===Dn&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case Fr:e:{for(var k=h.key,C=g;C!==null;){if(C.key===k){if(k=h.type,k===Dn){if(C.tag===7){n(f,C.sibling),g=r(C,h.props.children),g.return=f,f=g;break e}}else if(C.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Rt&&ju(k)===C.type){n(f,C.sibling),g=r(C,h.props),g.ref=Ms(f,C,h),g.return=f,f=g;break e}n(f,C);break}else t(f,C);C=C.sibling}h.type===Dn?(g=bn(h.props.children,f.mode,w,h.key),g.return=f,f=g):(w=wi(h.type,h.key,h.props,null,f.mode,w),w.ref=Ms(f,g,h),w.return=f,f=w)}return o(f);case $n:e:{for(C=h.key;g!==null;){if(g.key===C)if(g.tag===4&&g.stateNode.containerInfo===h.containerInfo&&g.stateNode.implementation===h.implementation){n(f,g.sibling),g=r(g,h.children||[]),g.return=f,f=g;break e}else{n(f,g);break}else t(f,g);g=g.sibling}g=so(h,f.mode,w),g.return=f,f=g}return o(f);case Rt:return C=h._init,j(f,g,C(h._payload),w)}if(Us(h))return b(f,g,h,w);if(Ts(h))return x(f,g,h,w);Jr(f,h)}return typeof h=="string"&&h!==""||typeof h=="number"?(h=""+h,g!==null&&g.tag===6?(n(f,g.sibling),g=r(g,h),g.return=f,f=g):(n(f,g),g=no(h,f.mode,w),g.return=f,f=g),o(f)):n(f,g)}return j}var cs=Gf(!0),qf=Gf(!1),Fi=an(null),Bi=null,Vn=null,ql=null;function Yl(){ql=Vn=Bi=null}function Ql(e){var t=Fi.current;ne(Fi),e._currentValue=t}function Go(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 ns(e,t){Bi=e,ql=Vn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(De=!0),e.firstContext=null)}function tt(e){var t=e._currentValue;if(ql!==e)if(e={context:e,memoizedValue:t,next:null},Vn===null){if(Bi===null)throw Error(P(308));Vn=e,Bi.dependencies={lanes:0,firstContext:e}}else Vn=Vn.next=e;return t}var pn=null;function Jl(e){pn===null?pn=[e]:pn.push(e)}function Yf(e,t,n,s){var r=t.interleaved;return r===null?(n.next=n,Jl(t)):(n.next=r.next,r.next=n),t.interleaved=n,Mt(e,s)}function Mt(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 zt=!1;function Xl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Qf(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 At(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Qt(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,Y&2){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,Mt(e,n)}return r=s.interleaved,r===null?(t.next=t,Jl(s)):(t.next=r.next,r.next=t),s.interleaved=t,Mt(e,n)}function gi(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,Dl(e,n)}}function wu(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var r=null,a=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};a===null?r=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?r=a=t:a=a.next=t}else r=a=t;n={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:a,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 Ui(e,t,n,s){var r=e.updateQueue;zt=!1;var a=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?a=u:o.next=u,o=c;var m=e.alternate;m!==null&&(m=m.updateQueue,l=m.lastBaseUpdate,l!==o&&(l===null?m.firstBaseUpdate=u:l.next=u,m.lastBaseUpdate=c))}if(a!==null){var d=r.baseState;o=0,m=u=c=null,l=a;do{var p=l.lane,y=l.eventTime;if((s&p)===p){m!==null&&(m=m.next={eventTime:y,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var b=e,x=l;switch(p=t,y=n,x.tag){case 1:if(b=x.payload,typeof b=="function"){d=b.call(y,d,p);break e}d=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=x.payload,p=typeof b=="function"?b.call(y,d,p):b,p==null)break e;d=ae({},d,p);break e;case 2:zt=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,p=r.effects,p===null?r.effects=[l]:p.push(l))}else y={eventTime:y,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},m===null?(u=m=y,c=d):m=m.next=y,o|=p;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;p=l,l=p.next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}while(!0);if(m===null&&(c=d),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=m,t=r.shared.interleaved,t!==null){r=t;do o|=r.lane,r=r.next;while(r!==t)}else a===null&&(r.shared.lanes=0);Nn|=o,e.lanes=o,e.memoizedState=d}}function ku(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(P(191,r));r.call(s)}}}var Lr={},jt=an(Lr),gr=an(Lr),yr=an(Lr);function gn(e){if(e===Lr)throw Error(P(174));return e}function Zl(e,t){switch(Z(yr,t),Z(gr,e),Z(jt,Lr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Eo(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Eo(t,e)}ne(jt),Z(jt,t)}function us(){ne(jt),ne(gr),ne(yr)}function Jf(e){gn(yr.current);var t=gn(jt.current),n=Eo(t,e.type);t!==n&&(Z(gr,e),Z(jt,n))}function ec(e){gr.current===e&&(ne(jt),ne(gr))}var re=an(0);function Wi(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 Qa=[];function tc(){for(var e=0;e<Qa.length;e++)Qa[e]._workInProgressVersionPrimary=null;Qa.length=0}var yi=_t.ReactCurrentDispatcher,Ja=_t.ReactCurrentBatchConfig,kn=0,ie=null,pe=null,ve=null,Hi=!1,Zs=!1,xr=0,ag=0;function Se(){throw Error(P(321))}function nc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ft(e[n],t[n]))return!1;return!0}function sc(e,t,n,s,r,a){if(kn=a,ie=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,yi.current=e===null||e.memoizedState===null?ug:dg,e=n(s,r),Zs){a=0;do{if(Zs=!1,xr=0,25<=a)throw Error(P(301));a+=1,ve=pe=null,t.updateQueue=null,yi.current=fg,e=n(s,r)}while(Zs)}if(yi.current=Vi,t=pe!==null&&pe.next!==null,kn=0,ve=pe=ie=null,Hi=!1,t)throw Error(P(300));return e}function rc(){var e=xr!==0;return xr=0,e}function yt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ve===null?ie.memoizedState=ve=e:ve=ve.next=e,ve}function nt(){if(pe===null){var e=ie.alternate;e=e!==null?e.memoizedState:null}else e=pe.next;var t=ve===null?ie.memoizedState:ve.next;if(t!==null)ve=t,pe=e;else{if(e===null)throw Error(P(310));pe=e,e={memoizedState:pe.memoizedState,baseState:pe.baseState,baseQueue:pe.baseQueue,queue:pe.queue,next:null},ve===null?ie.memoizedState=ve=e:ve=ve.next=e}return ve}function vr(e,t){return typeof t=="function"?t(e):t}function Xa(e){var t=nt(),n=t.queue;if(n===null)throw Error(P(311));n.lastRenderedReducer=e;var s=pe,r=s.baseQueue,a=n.pending;if(a!==null){if(r!==null){var o=r.next;r.next=a.next,a.next=o}s.baseQueue=r=a,n.pending=null}if(r!==null){a=r.next,s=s.baseState;var l=o=null,c=null,u=a;do{var m=u.lane;if((kn&m)===m)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:m,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=d,o=s):c=c.next=d,ie.lanes|=m,Nn|=m}u=u.next}while(u!==null&&u!==a);c===null?o=s:c.next=l,ft(s,t.memoizedState)||(De=!0),t.memoizedState=s,t.baseState=o,t.baseQueue=c,n.lastRenderedState=s}if(e=n.interleaved,e!==null){r=e;do a=r.lane,ie.lanes|=a,Nn|=a,r=r.next;while(r!==e)}else r===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Za(e){var t=nt(),n=t.queue;if(n===null)throw Error(P(311));n.lastRenderedReducer=e;var s=n.dispatch,r=n.pending,a=t.memoizedState;if(r!==null){n.pending=null;var o=r=r.next;do a=e(a,o.action),o=o.next;while(o!==r);ft(a,t.memoizedState)||(De=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,s]}function Xf(){}function Zf(e,t){var n=ie,s=nt(),r=t(),a=!ft(s.memoizedState,r);if(a&&(s.memoizedState=r,De=!0),s=s.queue,ic(nh.bind(null,n,s,e),[e]),s.getSnapshot!==t||a||ve!==null&&ve.memoizedState.tag&1){if(n.flags|=2048,br(9,th.bind(null,n,s,r,t),void 0,null),be===null)throw Error(P(349));kn&30||eh(n,t,r)}return r}function eh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ie.updateQueue,t===null?(t={lastEffect:null,stores:null},ie.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function th(e,t,n,s){t.value=n,t.getSnapshot=s,sh(t)&&rh(e)}function nh(e,t,n){return n(function(){sh(t)&&rh(e)})}function sh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ft(e,n)}catch{return!0}}function rh(e){var t=Mt(e,1);t!==null&&dt(t,e,1,-1)}function Nu(e){var t=yt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:vr,lastRenderedState:e},t.queue=e,e=e.dispatch=cg.bind(null,ie,e),[t.memoizedState,e]}function br(e,t,n,s){return e={tag:e,create:t,destroy:n,deps:s,next:null},t=ie.updateQueue,t===null?(t={lastEffect:null,stores:null},ie.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 ih(){return nt().memoizedState}function xi(e,t,n,s){var r=yt();ie.flags|=e,r.memoizedState=br(1|t,n,void 0,s===void 0?null:s)}function ua(e,t,n,s){var r=nt();s=s===void 0?null:s;var a=void 0;if(pe!==null){var o=pe.memoizedState;if(a=o.destroy,s!==null&&nc(s,o.deps)){r.memoizedState=br(t,n,a,s);return}}ie.flags|=e,r.memoizedState=br(1|t,n,a,s)}function Su(e,t){return xi(8390656,8,e,t)}function ic(e,t){return ua(2048,8,e,t)}function ah(e,t){return ua(4,2,e,t)}function oh(e,t){return ua(4,4,e,t)}function lh(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 ch(e,t,n){return n=n!=null?n.concat([e]):null,ua(4,4,lh.bind(null,t,e),n)}function ac(){}function uh(e,t){var n=nt();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&nc(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function dh(e,t){var n=nt();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&nc(t,s[1])?s[0]:(e=e(),n.memoizedState=[e,t],e)}function fh(e,t,n){return kn&21?(ft(n,t)||(n=yf(),ie.lanes|=n,Nn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,De=!0),e.memoizedState=n)}function og(e,t){var n=J;J=n!==0&&4>n?n:4,e(!0);var s=Ja.transition;Ja.transition={};try{e(!1),t()}finally{J=n,Ja.transition=s}}function hh(){return nt().memoizedState}function lg(e,t,n){var s=Xt(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},mh(e))ph(t,n);else if(n=Yf(e,t,n,s),n!==null){var r=Pe();dt(n,e,s,r),gh(n,t,s)}}function cg(e,t,n){var s=Xt(e),r={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(mh(e))ph(t,r);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,n);if(r.hasEagerState=!0,r.eagerState=l,ft(l,o)){var c=t.interleaved;c===null?(r.next=r,Jl(t)):(r.next=c.next,c.next=r),t.interleaved=r;return}}catch{}finally{}n=Yf(e,t,r,s),n!==null&&(r=Pe(),dt(n,e,s,r),gh(n,t,s))}}function mh(e){var t=e.alternate;return e===ie||t!==null&&t===ie}function ph(e,t){Zs=Hi=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function gh(e,t,n){if(n&4194240){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Dl(e,n)}}var Vi={readContext:tt,useCallback:Se,useContext:Se,useEffect:Se,useImperativeHandle:Se,useInsertionEffect:Se,useLayoutEffect:Se,useMemo:Se,useReducer:Se,useRef:Se,useState:Se,useDebugValue:Se,useDeferredValue:Se,useTransition:Se,useMutableSource:Se,useSyncExternalStore:Se,useId:Se,unstable_isNewReconciler:!1},ug={readContext:tt,useCallback:function(e,t){return yt().memoizedState=[e,t===void 0?null:t],e},useContext:tt,useEffect:Su,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,xi(4194308,4,lh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return xi(4194308,4,e,t)},useInsertionEffect:function(e,t){return xi(4,2,e,t)},useMemo:function(e,t){var n=yt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=yt();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,ie,e),[s.memoizedState,e]},useRef:function(e){var t=yt();return e={current:e},t.memoizedState=e},useState:Nu,useDebugValue:ac,useDeferredValue:function(e){return yt().memoizedState=e},useTransition:function(){var e=Nu(!1),t=e[0];return e=og.bind(null,e[1]),yt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=ie,r=yt();if(se){if(n===void 0)throw Error(P(407));n=n()}else{if(n=t(),be===null)throw Error(P(349));kn&30||eh(s,t,n)}r.memoizedState=n;var a={value:n,getSnapshot:t};return r.queue=a,Su(nh.bind(null,s,a,e),[e]),s.flags|=2048,br(9,th.bind(null,s,a,n,t),void 0,null),n},useId:function(){var e=yt(),t=be.identifierPrefix;if(se){var n=Et,s=Ct;n=(s&~(1<<32-ut(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=xr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=ag++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},dg={readContext:tt,useCallback:uh,useContext:tt,useEffect:ic,useImperativeHandle:ch,useInsertionEffect:ah,useLayoutEffect:oh,useMemo:dh,useReducer:Xa,useRef:ih,useState:function(){return Xa(vr)},useDebugValue:ac,useDeferredValue:function(e){var t=nt();return fh(t,pe.memoizedState,e)},useTransition:function(){var e=Xa(vr)[0],t=nt().memoizedState;return[e,t]},useMutableSource:Xf,useSyncExternalStore:Zf,useId:hh,unstable_isNewReconciler:!1},fg={readContext:tt,useCallback:uh,useContext:tt,useEffect:ic,useImperativeHandle:ch,useInsertionEffect:ah,useLayoutEffect:oh,useMemo:dh,useReducer:Za,useRef:ih,useState:function(){return Za(vr)},useDebugValue:ac,useDeferredValue:function(e){var t=nt();return pe===null?t.memoizedState=e:fh(t,pe.memoizedState,e)},useTransition:function(){var e=Za(vr)[0],t=nt().memoizedState;return[e,t]},useMutableSource:Xf,useSyncExternalStore:Zf,useId:hh,unstable_isNewReconciler:!1};function ot(e,t){if(e&&e.defaultProps){t=ae({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function qo(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:ae({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var da={isMounted:function(e){return(e=e._reactInternals)?Tn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var s=Pe(),r=Xt(e),a=At(s,r);a.payload=t,n!=null&&(a.callback=n),t=Qt(e,a,r),t!==null&&(dt(t,e,r,s),gi(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=Pe(),r=Xt(e),a=At(s,r);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Qt(e,a,r),t!==null&&(dt(t,e,r,s),gi(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Pe(),s=Xt(e),r=At(n,s);r.tag=2,t!=null&&(r.callback=t),t=Qt(e,r,s),t!==null&&(dt(t,e,s,n),gi(t,e,s))}};function Cu(e,t,n,s,r,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,a,o):t.prototype&&t.prototype.isPureReactComponent?!fr(n,s)||!fr(r,a):!0}function yh(e,t,n){var s=!1,r=sn,a=t.contextType;return typeof a=="object"&&a!==null?a=tt(a):(r=Fe(t)?jn:Te.current,s=t.contextTypes,a=(s=s!=null)?os(e,r):sn),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=da,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=a),t}function Eu(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&&da.enqueueReplaceState(t,t.state,null)}function Yo(e,t,n,s){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs={},Xl(e);var a=t.contextType;typeof a=="object"&&a!==null?r.context=tt(a):(a=Fe(t)?jn:Te.current,r.context=os(e,a)),r.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(qo(e,t,a,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&&da.enqueueReplaceState(r,r.state,null),Ui(e,n,r,s),r.state=e.memoizedState),typeof r.componentDidMount=="function"&&(e.flags|=4194308)}function ds(e,t){try{var n="",s=t;do n+=Fp(s),s=s.return;while(s);var r=n}catch(a){r=`
39
- Error generating stack: `+a.message+`
40
- `+a.stack}return{value:e,source:t,stack:r,digest:null}}function eo(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Qo(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var hg=typeof WeakMap=="function"?WeakMap:Map;function xh(e,t,n){n=At(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){Gi||(Gi=!0,al=s),Qo(e,t)},n}function vh(e,t,n){n=At(-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(){Qo(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){Qo(e,t),typeof s!="function"&&(Jt===null?Jt=new Set([this]):Jt.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Tu(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new hg;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=Eg.bind(null,e,t,n),t.then(e,e))}function Au(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 Lu(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=At(-1,1),t.tag=2,Qt(n,t,1))),n.lanes|=1),e)}var mg=_t.ReactCurrentOwner,De=!1;function Ae(e,t,n,s){t.child=e===null?qf(t,null,n,s):cs(t,e.child,n,s)}function Pu(e,t,n,s,r){n=n.render;var a=t.ref;return ns(t,r),s=sc(e,t,n,s,a,r),n=rc(),e!==null&&!De?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Ot(e,t,r)):(se&&n&&Vl(t),t.flags|=1,Ae(e,t,s,r),t.child)}function Iu(e,t,n,s,r){if(e===null){var a=n.type;return typeof a=="function"&&!mc(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,bh(e,t,a,s,r)):(e=wi(n.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&r)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:fr,n(o,s)&&e.ref===t.ref)return Ot(e,t,r)}return t.flags|=1,e=Zt(a,s),e.ref=t.ref,e.return=t,t.child=e}function bh(e,t,n,s,r){if(e!==null){var a=e.memoizedProps;if(fr(a,s)&&e.ref===t.ref)if(De=!1,t.pendingProps=s=a,(e.lanes&r)!==0)e.flags&131072&&(De=!0);else return t.lanes=e.lanes,Ot(e,t,r)}return Jo(e,t,n,s,r)}function jh(e,t,n){var s=t.pendingProps,r=s.children,a=e!==null?e.memoizedState:null;if(s.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Z(Gn,Ue),Ue|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Z(Gn,Ue),Ue|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=a!==null?a.baseLanes:n,Z(Gn,Ue),Ue|=s}else a!==null?(s=a.baseLanes|n,t.memoizedState=null):s=n,Z(Gn,Ue),Ue|=s;return Ae(e,t,r,n),t.child}function wh(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Jo(e,t,n,s,r){var a=Fe(n)?jn:Te.current;return a=os(t,a),ns(t,r),n=sc(e,t,n,s,a,r),s=rc(),e!==null&&!De?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Ot(e,t,r)):(se&&s&&Vl(t),t.flags|=1,Ae(e,t,n,r),t.child)}function Mu(e,t,n,s,r){if(Fe(n)){var a=!0;Di(t)}else a=!1;if(ns(t,r),t.stateNode===null)vi(e,t),yh(t,n,s),Yo(t,n,s,r),s=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=tt(u):(u=Fe(n)?jn:Te.current,u=os(t,u));var m=n.getDerivedStateFromProps,d=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==s||c!==u)&&Eu(t,o,s,u),zt=!1;var p=t.memoizedState;o.state=p,Ui(t,s,o,r),c=t.memoizedState,l!==s||p!==c||ze.current||zt?(typeof m=="function"&&(qo(t,n,m,s),c=t.memoizedState),(l=zt||Cu(t,n,l,s,p,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=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{o=t.stateNode,Qf(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:ot(t.type,l),o.props=u,d=t.pendingProps,p=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=tt(c):(c=Fe(n)?jn:Te.current,c=os(t,c));var y=n.getDerivedStateFromProps;(m=typeof y=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==d||p!==c)&&Eu(t,o,s,c),zt=!1,p=t.memoizedState,o.state=p,Ui(t,s,o,r);var b=t.memoizedState;l!==d||p!==b||ze.current||zt?(typeof y=="function"&&(qo(t,n,y,s),b=t.memoizedState),(u=zt||Cu(t,n,u,s,p,b,c)||!1)?(m||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"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===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"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),s=!1)}return Xo(e,t,n,s,a,r)}function Xo(e,t,n,s,r,a){wh(e,t);var o=(t.flags&128)!==0;if(!s&&!o)return r&&xu(t,n,!1),Ot(e,t,a);s=t.stateNode,mg.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&o?(t.child=cs(t,e.child,null,a),t.child=cs(t,null,l,a)):Ae(e,t,l,a),t.memoizedState=s.state,r&&xu(t,n,!0),t.child}function kh(e){var t=e.stateNode;t.pendingContext?yu(e,t.pendingContext,t.pendingContext!==t.context):t.context&&yu(e,t.context,!1),Zl(e,t.containerInfo)}function Ou(e,t,n,s,r){return ls(),Gl(r),t.flags|=256,Ae(e,t,n,s),t.child}var Zo={dehydrated:null,treeContext:null,retryLane:0};function el(e){return{baseLanes:e,cachePool:null,transitions:null}}function Nh(e,t,n){var s=t.pendingProps,r=re.current,a=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(r&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(r|=1),Z(re,r&1),e===null)return Ko(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,a?(s=t.mode,a=t.child,o={mode:"hidden",children:o},!(s&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=ma(o,s,0,null),e=bn(e,s,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=el(n),t.memoizedState=Zo,e):oc(t,o));if(r=e.memoizedState,r!==null&&(l=r.dehydrated,l!==null))return pg(e,t,o,s,l,r,n);if(a){a=s.fallback,o=t.mode,r=e.child,l=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=Zt(r,c),s.subtreeFlags=r.subtreeFlags&14680064),l!==null?a=Zt(l,a):(a=bn(a,o,n,null),a.flags|=2),a.return=t,s.return=t,s.sibling=a,t.child=s,s=a,a=t.child,o=e.child.memoizedState,o=o===null?el(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Zo,s}return a=e.child,e=a.sibling,s=Zt(a,{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 oc(e,t){return t=ma({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Xr(e,t,n,s){return s!==null&&Gl(s),cs(t,e.child,null,n),e=oc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function pg(e,t,n,s,r,a,o){if(n)return t.flags&256?(t.flags&=-257,s=eo(Error(P(422))),Xr(e,t,o,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=s.fallback,r=t.mode,s=ma({mode:"visible",children:s.children},r,0,null),a=bn(a,r,o,null),a.flags|=2,s.return=t,a.return=t,s.sibling=a,t.child=s,t.mode&1&&cs(t,e.child,null,o),t.child.memoizedState=el(o),t.memoizedState=Zo,a);if(!(t.mode&1))return Xr(e,t,o,null);if(r.data==="$!"){if(s=r.nextSibling&&r.nextSibling.dataset,s)var l=s.dgst;return s=l,a=Error(P(419)),s=eo(a,s,void 0),Xr(e,t,o,s)}if(l=(o&e.childLanes)!==0,De||l){if(s=be,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!==a.retryLane&&(a.retryLane=r,Mt(e,r),dt(s,e,r,-1))}return hc(),s=eo(Error(P(421))),Xr(e,t,o,s)}return r.data==="$?"?(t.flags|=128,t.child=e.child,t=Tg.bind(null,e),r._reactRetry=t,null):(e=a.treeContext,We=Yt(r.nextSibling),He=t,se=!0,ct=null,e!==null&&(Ye[Qe++]=Ct,Ye[Qe++]=Et,Ye[Qe++]=wn,Ct=e.id,Et=e.overflow,wn=t),t=oc(t,s.children),t.flags|=4096,t)}function _u(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Go(e.return,t,n)}function to(e,t,n,s,r){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:r}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=s,a.tail=n,a.tailMode=r)}function Sh(e,t,n){var s=t.pendingProps,r=s.revealOrder,a=s.tail;if(Ae(e,t,s.children,n),s=re.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&&_u(e,n,t);else if(e.tag===19)_u(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(Z(re,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&&Wi(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),to(t,!1,r,n,a);break;case"backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&Wi(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}to(t,!0,n,null,a);break;case"together":to(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function vi(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ot(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Nn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(P(153));if(t.child!==null){for(e=t.child,n=Zt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Zt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function gg(e,t,n){switch(t.tag){case 3:kh(t),ls();break;case 5:Jf(t);break;case 1:Fe(t.type)&&Di(t);break;case 4:Zl(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,r=t.memoizedProps.value;Z(Fi,s._currentValue),s._currentValue=r;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(Z(re,re.current&1),t.flags|=128,null):n&t.child.childLanes?Nh(e,t,n):(Z(re,re.current&1),e=Ot(e,t,n),e!==null?e.sibling:null);Z(re,re.current&1);break;case 19:if(s=(n&t.childLanes)!==0,e.flags&128){if(s)return Sh(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Z(re,re.current),s)break;return null;case 22:case 23:return t.lanes=0,jh(e,t,n)}return Ot(e,t,n)}var Ch,tl,Eh,Th;Ch=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}};tl=function(){};Eh=function(e,t,n,s){var r=e.memoizedProps;if(r!==s){e=t.stateNode,gn(jt.current);var a=null;switch(n){case"input":r=ko(e,r),s=ko(e,s),a=[];break;case"select":r=ae({},r,{value:void 0}),s=ae({},s,{value:void 0}),a=[];break;case"textarea":r=Co(e,r),s=Co(e,s),a=[];break;default:typeof r.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=_i)}To(n,s);var o;n=null;for(u in r)if(!s.hasOwnProperty(u)&&r.hasOwnProperty(u)&&r[u]!=null)if(u==="style"){var l=r[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ir.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in s){var c=s[u];if(l=r!=null?r[u]:void 0,s.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(a||(a=[]),a.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ir.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&te("scroll",e),a||l===c||(a=[])):(a=a||[]).push(u,c))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};Th=function(e,t,n,s){n!==s&&(t.flags|=4)};function Os(e,t){if(!se)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 Ce(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 yg(e,t,n){var s=t.pendingProps;switch(Kl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ce(t),null;case 1:return Fe(t.type)&&$i(),Ce(t),null;case 3:return s=t.stateNode,us(),ne(ze),ne(Te),tc(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Qr(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ct!==null&&(cl(ct),ct=null))),tl(e,t),Ce(t),null;case 5:ec(t);var r=gn(yr.current);if(n=t.type,e!==null&&t.stateNode!=null)Eh(e,t,n,s,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(P(166));return Ce(t),null}if(e=gn(jt.current),Qr(t)){s=t.stateNode,n=t.type;var a=t.memoizedProps;switch(s[vt]=t,s[pr]=a,e=(t.mode&1)!==0,n){case"dialog":te("cancel",s),te("close",s);break;case"iframe":case"object":case"embed":te("load",s);break;case"video":case"audio":for(r=0;r<Hs.length;r++)te(Hs[r],s);break;case"source":te("error",s);break;case"img":case"image":case"link":te("error",s),te("load",s);break;case"details":te("toggle",s);break;case"input":Hc(s,a),te("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!a.multiple},te("invalid",s);break;case"textarea":Kc(s,a),te("invalid",s)}To(n,a),r=null;for(var o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="children"?typeof l=="string"?s.textContent!==l&&(a.suppressHydrationWarning!==!0&&Yr(s.textContent,l,e),r=["children",l]):typeof l=="number"&&s.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&Yr(s.textContent,l,e),r=["children",""+l]):ir.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&te("scroll",s)}switch(n){case"input":Br(s),Vc(s,a,!0);break;case"textarea":Br(s),Gc(s);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(s.onclick=_i)}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=tf(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[vt]=t,e[pr]=s,Ch(e,t,!1,!1),t.stateNode=e;e:{switch(o=Ao(n,s),n){case"dialog":te("cancel",e),te("close",e),r=s;break;case"iframe":case"object":case"embed":te("load",e),r=s;break;case"video":case"audio":for(r=0;r<Hs.length;r++)te(Hs[r],e);r=s;break;case"source":te("error",e),r=s;break;case"img":case"image":case"link":te("error",e),te("load",e),r=s;break;case"details":te("toggle",e),r=s;break;case"input":Hc(e,s),r=ko(e,s),te("invalid",e);break;case"option":r=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},r=ae({},s,{value:void 0}),te("invalid",e);break;case"textarea":Kc(e,s),r=Co(e,s),te("invalid",e);break;default:r=s}To(n,r),l=r;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?rf(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&nf(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&ar(e,c):typeof c=="number"&&ar(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(ir.hasOwnProperty(a)?c!=null&&a==="onScroll"&&te("scroll",e):c!=null&&Pl(e,a,c,o))}switch(n){case"input":Br(e),Vc(e,s,!1);break;case"textarea":Br(e),Gc(e);break;case"option":s.value!=null&&e.setAttribute("value",""+nn(s.value));break;case"select":e.multiple=!!s.multiple,a=s.value,a!=null?Xn(e,!!s.multiple,a,!1):s.defaultValue!=null&&Xn(e,!!s.multiple,s.defaultValue,!0);break;default:typeof r.onClick=="function"&&(e.onclick=_i)}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 Ce(t),null;case 6:if(e&&t.stateNode!=null)Th(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(P(166));if(n=gn(yr.current),gn(jt.current),Qr(t)){if(s=t.stateNode,n=t.memoizedProps,s[vt]=t,(a=s.nodeValue!==n)&&(e=He,e!==null))switch(e.tag){case 3:Yr(s.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Yr(s.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[vt]=t,t.stateNode=s}return Ce(t),null;case 13:if(ne(re),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(se&&We!==null&&t.mode&1&&!(t.flags&128))Kf(),ls(),t.flags|=98560,a=!1;else if(a=Qr(t),s!==null&&s.dehydrated!==null){if(e===null){if(!a)throw Error(P(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(P(317));a[vt]=t}else ls(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ce(t),a=!1}else ct!==null&&(cl(ct),ct=null),a=!0;if(!a)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||re.current&1?ge===0&&(ge=3):hc())),t.updateQueue!==null&&(t.flags|=4),Ce(t),null);case 4:return us(),tl(e,t),e===null&&hr(t.stateNode.containerInfo),Ce(t),null;case 10:return Ql(t.type._context),Ce(t),null;case 17:return Fe(t.type)&&$i(),Ce(t),null;case 19:if(ne(re),a=t.memoizedState,a===null)return Ce(t),null;if(s=(t.flags&128)!==0,o=a.rendering,o===null)if(s)Os(a,!1);else{if(ge!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Wi(e),o!==null){for(t.flags|=128,Os(a,!1),s=o.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=n,n=t.child;n!==null;)a=n,e=s,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Z(re,re.current&1|2),t.child}e=e.sibling}a.tail!==null&&ue()>fs&&(t.flags|=128,s=!0,Os(a,!1),t.lanes=4194304)}else{if(!s)if(e=Wi(o),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Os(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!se)return Ce(t),null}else 2*ue()-a.renderingStartTime>fs&&n!==1073741824&&(t.flags|=128,s=!0,Os(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(n=a.last,n!==null?n.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=ue(),t.sibling=null,n=re.current,Z(re,s?n&1|2:n&1),t):(Ce(t),null);case 22:case 23:return fc(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?Ue&1073741824&&(Ce(t),t.subtreeFlags&6&&(t.flags|=8192)):Ce(t),null;case 24:return null;case 25:return null}throw Error(P(156,t.tag))}function xg(e,t){switch(Kl(t),t.tag){case 1:return Fe(t.type)&&$i(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return us(),ne(ze),ne(Te),tc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ec(t),null;case 13:if(ne(re),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(P(340));ls()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ne(re),null;case 4:return us(),null;case 10:return Ql(t.type._context),null;case 22:case 23:return fc(),null;case 24:return null;default:return null}}var Zr=!1,Ee=!1,vg=typeof WeakSet=="function"?WeakSet:Set,D=null;function Kn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){oe(e,t,s)}else n.current=null}function nl(e,t,n){try{n()}catch(s){oe(e,t,s)}}var $u=!1;function bg(e,t){if(zo=Ii,e=Mf(),Hl(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,a=s.focusNode;s=s.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,m=0,d=e,p=null;t:for(;;){for(var y;d!==n||r!==0&&d.nodeType!==3||(l=o+r),d!==a||s!==0&&d.nodeType!==3||(c=o+s),d.nodeType===3&&(o+=d.nodeValue.length),(y=d.firstChild)!==null;)p=d,d=y;for(;;){if(d===e)break t;if(p===n&&++u===r&&(l=o),p===a&&++m===s&&(c=o),(y=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=y}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Fo={focusedElem:e,selectionRange:n},Ii=!1,D=t;D!==null;)if(t=D,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,D=e;else for(;D!==null;){t=D;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,j=b.memoizedState,f=t.stateNode,g=f.getSnapshotBeforeUpdate(t.elementType===t.type?x:ot(t.type,x),j);f.__reactInternalSnapshotBeforeUpdate=g}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(P(163))}}catch(w){oe(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,D=e;break}D=t.return}return b=$u,$u=!1,b}function er(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 a=r.destroy;r.destroy=void 0,a!==void 0&&nl(t,n,a)}r=r.next}while(r!==s)}}function fa(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 sl(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 Ah(e){var t=e.alternate;t!==null&&(e.alternate=null,Ah(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[vt],delete t[pr],delete t[Wo],delete t[ng],delete t[sg])),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 Lh(e){return e.tag===5||e.tag===3||e.tag===4}function Du(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Lh(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 rl(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=_i));else if(s!==4&&(e=e.child,e!==null))for(rl(e,t,n),e=e.sibling;e!==null;)rl(e,t,n),e=e.sibling}function il(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(il(e,t,n),e=e.sibling;e!==null;)il(e,t,n),e=e.sibling}var je=null,lt=!1;function Dt(e,t,n){for(n=n.child;n!==null;)Ph(e,t,n),n=n.sibling}function Ph(e,t,n){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(ra,n)}catch{}switch(n.tag){case 5:Ee||Kn(n,t);case 6:var s=je,r=lt;je=null,Dt(e,t,n),je=s,lt=r,je!==null&&(lt?(e=je,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):je.removeChild(n.stateNode));break;case 18:je!==null&&(lt?(e=je,n=n.stateNode,e.nodeType===8?qa(e.parentNode,n):e.nodeType===1&&qa(e,n),ur(e)):qa(je,n.stateNode));break;case 4:s=je,r=lt,je=n.stateNode.containerInfo,lt=!0,Dt(e,t,n),je=s,lt=r;break;case 0:case 11:case 14:case 15:if(!Ee&&(s=n.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){r=s=s.next;do{var a=r,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&nl(n,t,o),r=r.next}while(r!==s)}Dt(e,t,n);break;case 1:if(!Ee&&(Kn(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(l){oe(n,t,l)}Dt(e,t,n);break;case 21:Dt(e,t,n);break;case 22:n.mode&1?(Ee=(s=Ee)||n.memoizedState!==null,Dt(e,t,n),Ee=s):Dt(e,t,n);break;default:Dt(e,t,n)}}function Ru(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new vg),t.forEach(function(s){var r=Ag.bind(null,e,s);n.has(s)||(n.add(s),s.then(r,r))})}}function it(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var r=n[s];try{var a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:je=l.stateNode,lt=!1;break e;case 3:je=l.stateNode.containerInfo,lt=!0;break e;case 4:je=l.stateNode.containerInfo,lt=!0;break e}l=l.return}if(je===null)throw Error(P(160));Ph(a,o,r),je=null,lt=!1;var c=r.alternate;c!==null&&(c.return=null),r.return=null}catch(u){oe(r,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Ih(t,e),t=t.sibling}function Ih(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(it(t,e),pt(e),s&4){try{er(3,e,e.return),fa(3,e)}catch(x){oe(e,e.return,x)}try{er(5,e,e.return)}catch(x){oe(e,e.return,x)}}break;case 1:it(t,e),pt(e),s&512&&n!==null&&Kn(n,n.return);break;case 5:if(it(t,e),pt(e),s&512&&n!==null&&Kn(n,n.return),e.flags&32){var r=e.stateNode;try{ar(r,"")}catch(x){oe(e,e.return,x)}}if(s&4&&(r=e.stateNode,r!=null)){var a=e.memoizedProps,o=n!==null?n.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&Zd(r,a),Ao(l,o);var u=Ao(l,a);for(o=0;o<c.length;o+=2){var m=c[o],d=c[o+1];m==="style"?rf(r,d):m==="dangerouslySetInnerHTML"?nf(r,d):m==="children"?ar(r,d):Pl(r,m,d,u)}switch(l){case"input":No(r,a);break;case"textarea":ef(r,a);break;case"select":var p=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!a.multiple;var y=a.value;y!=null?Xn(r,!!a.multiple,y,!1):p!==!!a.multiple&&(a.defaultValue!=null?Xn(r,!!a.multiple,a.defaultValue,!0):Xn(r,!!a.multiple,a.multiple?[]:"",!1))}r[pr]=a}catch(x){oe(e,e.return,x)}}break;case 6:if(it(t,e),pt(e),s&4){if(e.stateNode===null)throw Error(P(162));r=e.stateNode,a=e.memoizedProps;try{r.nodeValue=a}catch(x){oe(e,e.return,x)}}break;case 3:if(it(t,e),pt(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{ur(t.containerInfo)}catch(x){oe(e,e.return,x)}break;case 4:it(t,e),pt(e);break;case 13:it(t,e),pt(e),r=e.child,r.flags&8192&&(a=r.memoizedState!==null,r.stateNode.isHidden=a,!a||r.alternate!==null&&r.alternate.memoizedState!==null||(uc=ue())),s&4&&Ru(e);break;case 22:if(m=n!==null&&n.memoizedState!==null,e.mode&1?(Ee=(u=Ee)||m,it(t,e),Ee=u):it(t,e),pt(e),s&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!m&&e.mode&1)for(D=e,m=e.child;m!==null;){for(d=D=m;D!==null;){switch(p=D,y=p.child,p.tag){case 0:case 11:case 14:case 15:er(4,p,p.return);break;case 1:Kn(p,p.return);var b=p.stateNode;if(typeof b.componentWillUnmount=="function"){s=p,n=p.return;try{t=s,b.props=t.memoizedProps,b.state=t.memoizedState,b.componentWillUnmount()}catch(x){oe(s,n,x)}}break;case 5:Kn(p,p.return);break;case 22:if(p.memoizedState!==null){Fu(d);continue}}y!==null?(y.return=p,D=y):Fu(d)}m=m.sibling}e:for(m=null,d=e;;){if(d.tag===5){if(m===null){m=d;try{r=d.stateNode,u?(a=r.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=d.stateNode,c=d.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=sf("display",o))}catch(x){oe(e,e.return,x)}}}else if(d.tag===6){if(m===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(x){oe(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;m===d&&(m=null),d=d.return}m===d&&(m=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:it(t,e),pt(e),s&4&&Ru(e);break;case 21:break;default:it(t,e),pt(e)}}function pt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Lh(n)){var s=n;break e}n=n.return}throw Error(P(160))}switch(s.tag){case 5:var r=s.stateNode;s.flags&32&&(ar(r,""),s.flags&=-33);var a=Du(e);il(e,a,r);break;case 3:case 4:var o=s.stateNode.containerInfo,l=Du(e);rl(e,l,o);break;default:throw Error(P(161))}}catch(c){oe(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function jg(e,t,n){D=e,Mh(e)}function Mh(e,t,n){for(var s=(e.mode&1)!==0;D!==null;){var r=D,a=r.child;if(r.tag===22&&s){var o=r.memoizedState!==null||Zr;if(!o){var l=r.alternate,c=l!==null&&l.memoizedState!==null||Ee;l=Zr;var u=Ee;if(Zr=o,(Ee=c)&&!u)for(D=r;D!==null;)o=D,c=o.child,o.tag===22&&o.memoizedState!==null?Bu(r):c!==null?(c.return=o,D=c):Bu(r);for(;a!==null;)D=a,Mh(a),a=a.sibling;D=r,Zr=l,Ee=u}zu(e)}else r.subtreeFlags&8772&&a!==null?(a.return=r,D=a):zu(e)}}function zu(e){for(;D!==null;){var t=D;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ee||fa(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!Ee)if(n===null)s.componentDidMount();else{var r=t.elementType===t.type?n.memoizedProps:ot(t.type,n.memoizedProps);s.componentDidUpdate(r,n.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&ku(t,a,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}ku(t,o,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;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 m=u.memoizedState;if(m!==null){var d=m.dehydrated;d!==null&&ur(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(P(163))}Ee||t.flags&512&&sl(t)}catch(p){oe(t,t.return,p)}}if(t===e){D=null;break}if(n=t.sibling,n!==null){n.return=t.return,D=n;break}D=t.return}}function Fu(e){for(;D!==null;){var t=D;if(t===e){D=null;break}var n=t.sibling;if(n!==null){n.return=t.return,D=n;break}D=t.return}}function Bu(e){for(;D!==null;){var t=D;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{fa(4,t)}catch(c){oe(t,n,c)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var r=t.return;try{s.componentDidMount()}catch(c){oe(t,r,c)}}var a=t.return;try{sl(t)}catch(c){oe(t,a,c)}break;case 5:var o=t.return;try{sl(t)}catch(c){oe(t,o,c)}}}catch(c){oe(t,t.return,c)}if(t===e){D=null;break}var l=t.sibling;if(l!==null){l.return=t.return,D=l;break}D=t.return}}var wg=Math.ceil,Ki=_t.ReactCurrentDispatcher,lc=_t.ReactCurrentOwner,Ze=_t.ReactCurrentBatchConfig,Y=0,be=null,me=null,ke=0,Ue=0,Gn=an(0),ge=0,jr=null,Nn=0,ha=0,cc=0,tr=null,$e=null,uc=0,fs=1/0,Nt=null,Gi=!1,al=null,Jt=null,ei=!1,Ht=null,qi=0,nr=0,ol=null,bi=-1,ji=0;function Pe(){return Y&6?ue():bi!==-1?bi:bi=ue()}function Xt(e){return e.mode&1?Y&2&&ke!==0?ke&-ke:ig.transition!==null?(ji===0&&(ji=yf()),ji):(e=J,e!==0||(e=window.event,e=e===void 0?16:Nf(e.type)),e):1}function dt(e,t,n,s){if(50<nr)throw nr=0,ol=null,Error(P(185));Er(e,n,s),(!(Y&2)||e!==be)&&(e===be&&(!(Y&2)&&(ha|=n),ge===4&&Ut(e,ke)),Be(e,s),n===1&&Y===0&&!(t.mode&1)&&(fs=ue()+500,ca&&on()))}function Be(e,t){var n=e.callbackNode;i0(e,t);var s=Pi(e,e===be?ke:0);if(s===0)n!==null&&Qc(n),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(n!=null&&Qc(n),t===1)e.tag===0?rg(Uu.bind(null,e)):Wf(Uu.bind(null,e)),eg(function(){!(Y&6)&&on()}),n=null;else{switch(xf(s)){case 1:n=$l;break;case 4:n=pf;break;case 16:n=Li;break;case 536870912:n=gf;break;default:n=Li}n=Bh(n,Oh.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Oh(e,t){if(bi=-1,ji=0,Y&6)throw Error(P(327));var n=e.callbackNode;if(ss()&&e.callbackNode!==n)return null;var s=Pi(e,e===be?ke:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=Yi(e,s);else{t=s;var r=Y;Y|=2;var a=$h();(be!==e||ke!==t)&&(Nt=null,fs=ue()+500,vn(e,t));do try{Sg();break}catch(l){_h(e,l)}while(!0);Yl(),Ki.current=a,Y=r,me!==null?t=0:(be=null,ke=0,t=ge)}if(t!==0){if(t===2&&(r=Oo(e),r!==0&&(s=r,t=ll(e,r))),t===1)throw n=jr,vn(e,0),Ut(e,s),Be(e,ue()),n;if(t===6)Ut(e,s);else{if(r=e.current.alternate,!(s&30)&&!kg(r)&&(t=Yi(e,s),t===2&&(a=Oo(e),a!==0&&(s=a,t=ll(e,a))),t===1))throw n=jr,vn(e,0),Ut(e,s),Be(e,ue()),n;switch(e.finishedWork=r,e.finishedLanes=s,t){case 0:case 1:throw Error(P(345));case 2:fn(e,$e,Nt);break;case 3:if(Ut(e,s),(s&130023424)===s&&(t=uc+500-ue(),10<t)){if(Pi(e,0)!==0)break;if(r=e.suspendedLanes,(r&s)!==s){Pe(),e.pingedLanes|=e.suspendedLanes&r;break}e.timeoutHandle=Uo(fn.bind(null,e,$e,Nt),t);break}fn(e,$e,Nt);break;case 4:if(Ut(e,s),(s&4194240)===s)break;for(t=e.eventTimes,r=-1;0<s;){var o=31-ut(s);a=1<<o,o=t[o],o>r&&(r=o),s&=~a}if(s=r,s=ue()-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=Uo(fn.bind(null,e,$e,Nt),s);break}fn(e,$e,Nt);break;case 5:fn(e,$e,Nt);break;default:throw Error(P(329))}}}return Be(e,ue()),e.callbackNode===n?Oh.bind(null,e):null}function ll(e,t){var n=tr;return e.current.memoizedState.isDehydrated&&(vn(e,t).flags|=256),e=Yi(e,t),e!==2&&(t=$e,$e=n,t!==null&&cl(t)),e}function cl(e){$e===null?$e=e:$e.push.apply($e,e)}function kg(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],a=r.getSnapshot;r=r.value;try{if(!ft(a(),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 Ut(e,t){for(t&=~cc,t&=~ha,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ut(t),s=1<<n;e[n]=-1,t&=~s}}function Uu(e){if(Y&6)throw Error(P(327));ss();var t=Pi(e,0);if(!(t&1))return Be(e,ue()),null;var n=Yi(e,t);if(e.tag!==0&&n===2){var s=Oo(e);s!==0&&(t=s,n=ll(e,s))}if(n===1)throw n=jr,vn(e,0),Ut(e,t),Be(e,ue()),n;if(n===6)throw Error(P(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,fn(e,$e,Nt),Be(e,ue()),null}function dc(e,t){var n=Y;Y|=1;try{return e(t)}finally{Y=n,Y===0&&(fs=ue()+500,ca&&on())}}function Sn(e){Ht!==null&&Ht.tag===0&&!(Y&6)&&ss();var t=Y;Y|=1;var n=Ze.transition,s=J;try{if(Ze.transition=null,J=1,e)return e()}finally{J=s,Ze.transition=n,Y=t,!(Y&6)&&on()}}function fc(){Ue=Gn.current,ne(Gn)}function vn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Z0(n)),me!==null)for(n=me.return;n!==null;){var s=n;switch(Kl(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&$i();break;case 3:us(),ne(ze),ne(Te),tc();break;case 5:ec(s);break;case 4:us();break;case 13:ne(re);break;case 19:ne(re);break;case 10:Ql(s.type._context);break;case 22:case 23:fc()}n=n.return}if(be=e,me=e=Zt(e.current,null),ke=Ue=t,ge=0,jr=null,cc=ha=Nn=0,$e=tr=null,pn!==null){for(t=0;t<pn.length;t++)if(n=pn[t],s=n.interleaved,s!==null){n.interleaved=null;var r=s.next,a=n.pending;if(a!==null){var o=a.next;a.next=r,s.next=o}n.pending=s}pn=null}return e}function _h(e,t){do{var n=me;try{if(Yl(),yi.current=Vi,Hi){for(var s=ie.memoizedState;s!==null;){var r=s.queue;r!==null&&(r.pending=null),s=s.next}Hi=!1}if(kn=0,ve=pe=ie=null,Zs=!1,xr=0,lc.current=null,n===null||n.return===null){ge=1,jr=t,me=null;break}e:{var a=e,o=n.return,l=n,c=t;if(t=ke,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,m=l,d=m.tag;if(!(m.mode&1)&&(d===0||d===11||d===15)){var p=m.alternate;p?(m.updateQueue=p.updateQueue,m.memoizedState=p.memoizedState,m.lanes=p.lanes):(m.updateQueue=null,m.memoizedState=null)}var y=Au(o);if(y!==null){y.flags&=-257,Lu(y,o,l,a,t),y.mode&1&&Tu(a,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)){Tu(a,u,t),hc();break e}c=Error(P(426))}}else if(se&&l.mode&1){var j=Au(o);if(j!==null){!(j.flags&65536)&&(j.flags|=256),Lu(j,o,l,a,t),Gl(ds(c,l));break e}}a=c=ds(c,l),ge!==4&&(ge=2),tr===null?tr=[a]:tr.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var f=xh(a,c,t);wu(a,f);break e;case 1:l=c;var g=a.type,h=a.stateNode;if(!(a.flags&128)&&(typeof g.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Jt===null||!Jt.has(h)))){a.flags|=65536,t&=-t,a.lanes|=t;var w=vh(a,l,t);wu(a,w);break e}}a=a.return}while(a!==null)}Rh(n)}catch(k){t=k,me===n&&n!==null&&(me=n=n.return);continue}break}while(!0)}function $h(){var e=Ki.current;return Ki.current=Vi,e===null?Vi:e}function hc(){(ge===0||ge===3||ge===2)&&(ge=4),be===null||!(Nn&268435455)&&!(ha&268435455)||Ut(be,ke)}function Yi(e,t){var n=Y;Y|=2;var s=$h();(be!==e||ke!==t)&&(Nt=null,vn(e,t));do try{Ng();break}catch(r){_h(e,r)}while(!0);if(Yl(),Y=n,Ki.current=s,me!==null)throw Error(P(261));return be=null,ke=0,ge}function Ng(){for(;me!==null;)Dh(me)}function Sg(){for(;me!==null&&!Qp();)Dh(me)}function Dh(e){var t=Fh(e.alternate,e,Ue);e.memoizedProps=e.pendingProps,t===null?Rh(e):me=t,lc.current=null}function Rh(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=xg(n,t),n!==null){n.flags&=32767,me=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ge=6,me=null;return}}else if(n=yg(n,t,Ue),n!==null){me=n;return}if(t=t.sibling,t!==null){me=t;return}me=t=e}while(t!==null);ge===0&&(ge=5)}function fn(e,t,n){var s=J,r=Ze.transition;try{Ze.transition=null,J=1,Cg(e,t,n,s)}finally{Ze.transition=r,J=s}return null}function Cg(e,t,n,s){do ss();while(Ht!==null);if(Y&6)throw Error(P(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(P(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(a0(e,a),e===be&&(me=be=null,ke=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ei||(ei=!0,Bh(Li,function(){return ss(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Ze.transition,Ze.transition=null;var o=J;J=1;var l=Y;Y|=4,lc.current=null,bg(e,n),Ih(n,e),K0(Fo),Ii=!!zo,Fo=zo=null,e.current=n,jg(n),Jp(),Y=l,J=o,Ze.transition=a}else e.current=n;if(ei&&(ei=!1,Ht=e,qi=r),a=e.pendingLanes,a===0&&(Jt=null),e0(n.stateNode),Be(e,ue()),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(Gi)throw Gi=!1,e=al,al=null,e;return qi&1&&e.tag!==0&&ss(),a=e.pendingLanes,a&1?e===ol?nr++:(nr=0,ol=e):nr=0,on(),null}function ss(){if(Ht!==null){var e=xf(qi),t=Ze.transition,n=J;try{if(Ze.transition=null,J=16>e?16:e,Ht===null)var s=!1;else{if(e=Ht,Ht=null,qi=0,Y&6)throw Error(P(331));var r=Y;for(Y|=4,D=e.current;D!==null;){var a=D,o=a.child;if(D.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(D=u;D!==null;){var m=D;switch(m.tag){case 0:case 11:case 15:er(8,m,a)}var d=m.child;if(d!==null)d.return=m,D=d;else for(;D!==null;){m=D;var p=m.sibling,y=m.return;if(Ah(m),m===u){D=null;break}if(p!==null){p.return=y,D=p;break}D=y}}}var b=a.alternate;if(b!==null){var x=b.child;if(x!==null){b.child=null;do{var j=x.sibling;x.sibling=null,x=j}while(x!==null)}}D=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,D=o;else e:for(;D!==null;){if(a=D,a.flags&2048)switch(a.tag){case 0:case 11:case 15:er(9,a,a.return)}var f=a.sibling;if(f!==null){f.return=a.return,D=f;break e}D=a.return}}var g=e.current;for(D=g;D!==null;){o=D;var h=o.child;if(o.subtreeFlags&2064&&h!==null)h.return=o,D=h;else e:for(o=g;D!==null;){if(l=D,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:fa(9,l)}}catch(k){oe(l,l.return,k)}if(l===o){D=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,D=w;break e}D=l.return}}if(Y=r,on(),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(ra,e)}catch{}s=!0}return s}finally{J=n,Ze.transition=t}}return!1}function Wu(e,t,n){t=ds(n,t),t=xh(e,t,1),e=Qt(e,t,1),t=Pe(),e!==null&&(Er(e,1,t),Be(e,t))}function oe(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Jt===null||!Jt.has(s))){e=ds(n,e),e=vh(t,e,1),t=Qt(t,e,1),e=Pe(),t!==null&&(Er(t,1,e),Be(t,e));break}}t=t.return}}function Eg(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),t=Pe(),e.pingedLanes|=e.suspendedLanes&n,be===e&&(ke&n)===n&&(ge===4||ge===3&&(ke&130023424)===ke&&500>ue()-uc?vn(e,0):cc|=n),Be(e,t)}function zh(e,t){t===0&&(e.mode&1?(t=Hr,Hr<<=1,!(Hr&130023424)&&(Hr=4194304)):t=1);var n=Pe();e=Mt(e,t),e!==null&&(Er(e,t,n),Be(e,n))}function Tg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),zh(e,n)}function Ag(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(P(314))}s!==null&&s.delete(t),zh(e,n)}var Fh;Fh=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ze.current)De=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return De=!1,gg(e,t,n);De=!!(e.flags&131072)}else De=!1,se&&t.flags&1048576&&Hf(t,zi,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;vi(e,t),e=t.pendingProps;var r=os(t,Te.current);ns(t,n),r=sc(null,t,s,e,r,n);var a=rc();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,Fe(s)?(a=!0,Di(t)):a=!1,t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Xl(t),r.updater=da,t.stateNode=r,r._reactInternals=t,Yo(t,s,e,n),t=Xo(null,t,s,!0,a,n)):(t.tag=0,se&&a&&Vl(t),Ae(null,t,r,n),t=t.child),t;case 16:s=t.elementType;e:{switch(vi(e,t),e=t.pendingProps,r=s._init,s=r(s._payload),t.type=s,r=t.tag=Pg(s),e=ot(s,e),r){case 0:t=Jo(null,t,s,e,n);break e;case 1:t=Mu(null,t,s,e,n);break e;case 11:t=Pu(null,t,s,e,n);break e;case 14:t=Iu(null,t,s,ot(s.type,e),n);break e}throw Error(P(306,s,""))}return t;case 0:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:ot(s,r),Jo(e,t,s,r,n);case 1:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:ot(s,r),Mu(e,t,s,r,n);case 3:e:{if(kh(t),e===null)throw Error(P(387));s=t.pendingProps,a=t.memoizedState,r=a.element,Qf(e,t),Ui(t,s,null,n);var o=t.memoizedState;if(s=o.element,a.isDehydrated)if(a={element:s,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){r=ds(Error(P(423)),t),t=Ou(e,t,s,n,r);break e}else if(s!==r){r=ds(Error(P(424)),t),t=Ou(e,t,s,n,r);break e}else for(We=Yt(t.stateNode.containerInfo.firstChild),He=t,se=!0,ct=null,n=qf(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ls(),s===r){t=Ot(e,t,n);break e}Ae(e,t,s,n)}t=t.child}return t;case 5:return Jf(t),e===null&&Ko(t),s=t.type,r=t.pendingProps,a=e!==null?e.memoizedProps:null,o=r.children,Bo(s,r)?o=null:a!==null&&Bo(s,a)&&(t.flags|=32),wh(e,t),Ae(e,t,o,n),t.child;case 6:return e===null&&Ko(t),null;case 13:return Nh(e,t,n);case 4:return Zl(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=cs(t,null,s,n):Ae(e,t,s,n),t.child;case 11:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:ot(s,r),Pu(e,t,s,r,n);case 7:return Ae(e,t,t.pendingProps,n),t.child;case 8:return Ae(e,t,t.pendingProps.children,n),t.child;case 12:return Ae(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(s=t.type._context,r=t.pendingProps,a=t.memoizedProps,o=r.value,Z(Fi,s._currentValue),s._currentValue=o,a!==null)if(ft(a.value,o)){if(a.children===r.children&&!ze.current){t=Ot(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===s){if(a.tag===1){c=At(-1,n&-n),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var m=u.pending;m===null?c.next=c:(c.next=m.next,m.next=c),u.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Go(a.return,n,t),l.lanes|=n;break}c=c.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(P(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Go(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Ae(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,s=t.pendingProps.children,ns(t,n),r=tt(r),s=s(r),t.flags|=1,Ae(e,t,s,n),t.child;case 14:return s=t.type,r=ot(s,t.pendingProps),r=ot(s.type,r),Iu(e,t,s,r,n);case 15:return bh(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:ot(s,r),vi(e,t),t.tag=1,Fe(s)?(e=!0,Di(t)):e=!1,ns(t,n),yh(t,s,r),Yo(t,s,r,n),Xo(null,t,s,!0,e,n);case 19:return Sh(e,t,n);case 22:return jh(e,t,n)}throw Error(P(156,t.tag))};function Bh(e,t){return mf(e,t)}function Lg(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 Xe(e,t,n,s){return new Lg(e,t,n,s)}function mc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Pg(e){if(typeof e=="function")return mc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ml)return 11;if(e===Ol)return 14}return 2}function Zt(e,t){var n=e.alternate;return n===null?(n=Xe(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 wi(e,t,n,s,r,a){var o=2;if(s=e,typeof e=="function")mc(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Dn:return bn(n.children,r,a,t);case Il:o=8,r|=8;break;case vo:return e=Xe(12,n,t,r|2),e.elementType=vo,e.lanes=a,e;case bo:return e=Xe(13,n,t,r),e.elementType=bo,e.lanes=a,e;case jo:return e=Xe(19,n,t,r),e.elementType=jo,e.lanes=a,e;case Qd:return ma(n,r,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case qd:o=10;break e;case Yd:o=9;break e;case Ml:o=11;break e;case Ol:o=14;break e;case Rt:o=16,s=null;break e}throw Error(P(130,e==null?e:typeof e,""))}return t=Xe(o,n,t,r),t.elementType=e,t.type=s,t.lanes=a,t}function bn(e,t,n,s){return e=Xe(7,e,s,t),e.lanes=n,e}function ma(e,t,n,s){return e=Xe(22,e,s,t),e.elementType=Qd,e.lanes=n,e.stateNode={isHidden:!1},e}function no(e,t,n){return e=Xe(6,e,null,t),e.lanes=n,e}function so(e,t,n){return t=Xe(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ig(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=Da(0),this.expirationTimes=Da(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Da(0),this.identifierPrefix=s,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function pc(e,t,n,s,r,a,o,l,c){return e=new Ig(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Xe(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Xl(a),e}function Mg(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:$n,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}function Uh(e){if(!e)return sn;e=e._reactInternals;e:{if(Tn(e)!==e||e.tag!==1)throw Error(P(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Fe(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(P(171))}if(e.tag===1){var n=e.type;if(Fe(n))return Uf(e,n,t)}return t}function Wh(e,t,n,s,r,a,o,l,c){return e=pc(n,s,!0,e,r,a,o,l,c),e.context=Uh(null),n=e.current,s=Pe(),r=Xt(n),a=At(s,r),a.callback=t??null,Qt(n,a,r),e.current.lanes=r,Er(e,r,s),Be(e,s),e}function pa(e,t,n,s){var r=t.current,a=Pe(),o=Xt(r);return n=Uh(n),t.context===null?t.context=n:t.pendingContext=n,t=At(a,o),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=Qt(r,t,o),e!==null&&(dt(e,r,o,a),gi(e,r,o)),o}function Qi(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 Hu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function gc(e,t){Hu(e,t),(e=e.alternate)&&Hu(e,t)}function Og(){return null}var Hh=typeof reportError=="function"?reportError:function(e){console.error(e)};function yc(e){this._internalRoot=e}ga.prototype.render=yc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(P(409));pa(e,t,null,null)};ga.prototype.unmount=yc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Sn(function(){pa(null,e,null,null)}),t[It]=null}};function ga(e){this._internalRoot=e}ga.prototype.unstable_scheduleHydration=function(e){if(e){var t=jf();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Bt.length&&t!==0&&t<Bt[n].priority;n++);Bt.splice(n,0,e),n===0&&kf(e)}};function xc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ya(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Vu(){}function _g(e,t,n,s,r){if(r){if(typeof s=="function"){var a=s;s=function(){var u=Qi(o);a.call(u)}}var o=Wh(t,s,e,0,null,!1,!1,"",Vu);return e._reactRootContainer=o,e[It]=o.current,hr(e.nodeType===8?e.parentNode:e),Sn(),o}for(;r=e.lastChild;)e.removeChild(r);if(typeof s=="function"){var l=s;s=function(){var u=Qi(c);l.call(u)}}var c=pc(e,0,!1,null,null,!1,!1,"",Vu);return e._reactRootContainer=c,e[It]=c.current,hr(e.nodeType===8?e.parentNode:e),Sn(function(){pa(t,c,n,s)}),c}function xa(e,t,n,s,r){var a=n._reactRootContainer;if(a){var o=a;if(typeof r=="function"){var l=r;r=function(){var c=Qi(o);l.call(c)}}pa(t,o,e,r)}else o=_g(n,t,e,r,s);return Qi(o)}vf=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ws(t.pendingLanes);n!==0&&(Dl(t,n|1),Be(t,ue()),!(Y&6)&&(fs=ue()+500,on()))}break;case 13:Sn(function(){var s=Mt(e,1);if(s!==null){var r=Pe();dt(s,e,1,r)}}),gc(e,1)}};Rl=function(e){if(e.tag===13){var t=Mt(e,134217728);if(t!==null){var n=Pe();dt(t,e,134217728,n)}gc(e,134217728)}};bf=function(e){if(e.tag===13){var t=Xt(e),n=Mt(e,t);if(n!==null){var s=Pe();dt(n,e,t,s)}gc(e,t)}};jf=function(){return J};wf=function(e,t){var n=J;try{return J=e,t()}finally{J=n}};Po=function(e,t,n){switch(t){case"input":if(No(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=la(s);if(!r)throw Error(P(90));Xd(s),No(s,r)}}}break;case"textarea":ef(e,n);break;case"select":t=n.value,t!=null&&Xn(e,!!n.multiple,t,!1)}};lf=dc;cf=Sn;var $g={usingClientEntryPoint:!1,Events:[Ar,Bn,la,af,of,dc]},_s={findFiberByHostInstance:mn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Dg={bundleType:_s.bundleType,version:_s.version,rendererPackageName:_s.rendererPackageName,rendererConfig:_s.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:_t.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ff(e),e===null?null:e.stateNode},findFiberByHostInstance:_s.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 ti=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ti.isDisabled&&ti.supportsFiber)try{ra=ti.inject(Dg),bt=ti}catch{}}Ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$g;Ke.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!xc(t))throw Error(P(200));return Mg(e,t,null,n)};Ke.createRoot=function(e,t){if(!xc(e))throw Error(P(299));var n=!1,s="",r=Hh;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=pc(e,1,!1,null,null,n,!1,s,r),e[It]=t.current,hr(e.nodeType===8?e.parentNode:e),new yc(t)};Ke.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(P(188)):(e=Object.keys(e).join(","),Error(P(268,e)));return e=ff(t),e=e===null?null:e.stateNode,e};Ke.flushSync=function(e){return Sn(e)};Ke.hydrate=function(e,t,n){if(!ya(t))throw Error(P(200));return xa(null,e,t,!0,n)};Ke.hydrateRoot=function(e,t,n){if(!xc(e))throw Error(P(405));var s=n!=null&&n.hydratedSources||null,r=!1,a="",o=Hh;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Wh(t,null,e,1,n??null,r,!1,a,o),e[It]=t.current,hr(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 ga(t)};Ke.render=function(e,t,n){if(!ya(t))throw Error(P(200));return xa(null,e,t,!1,n)};Ke.unmountComponentAtNode=function(e){if(!ya(e))throw Error(P(40));return e._reactRootContainer?(Sn(function(){xa(null,null,e,!1,function(){e._reactRootContainer=null,e[It]=null})}),!0):!1};Ke.unstable_batchedUpdates=dc;Ke.unstable_renderSubtreeIntoContainer=function(e,t,n,s){if(!ya(n))throw Error(P(200));if(e==null||e._reactInternals===void 0)throw Error(P(38));return xa(e,t,n,!1,s)};Ke.version="18.3.1-next-f1338f8080-20240426";function Vh(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Vh)}catch(e){console.error(e)}}Vh(),Hd.exports=Ke;var Rg=Hd.exports,Kh,Ku=Rg;Kh=Ku.createRoot,Ku.hydrateRoot;const zg="modulepreload",Fg=function(e){return"/"+e},Gu={},Bg=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.allSettled(n.map(c=>{if(c=Fg(c),c in Gu)return;Gu[c]=!0;const u=c.endsWith(".css"),m=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${m}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":zg,u||(d.as="script"),d.crossOrigin="",d.href=c,l&&d.setAttribute("nonce",l),document.head.appendChild(d),u)return new Promise((p,y)=>{d.addEventListener("load",p),d.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${c}`)))})}))}function a(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return r.then(o=>{for(const l of o||[])l.status==="rejected"&&a(l.reason);return t().catch(a)})};/**
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 wr(){return wr=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},wr.apply(null,arguments)}var Vt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Vt||(Vt={}));const qu="popstate";function Ug(e){e===void 0&&(e={});function t(s,r){let{pathname:a,search:o,hash:l}=s.location;return ul("",{pathname:a,search:o,hash:l},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function n(s,r){return typeof r=="string"?r:Ji(r)}return Hg(t,n,null,e)}function le(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function vc(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Wg(){return Math.random().toString(36).substr(2,8)}function Yu(e,t){return{usr:e.state,key:e.key,idx:t}}function ul(e,t,n,s){return n===void 0&&(n=null),wr({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?bs(t):t,{state:n,key:t&&t.key||s||Wg()})}function Ji(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 bs(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 Hg(e,t,n,s){s===void 0&&(s={});let{window:r=document.defaultView,v5Compat:a=!1}=s,o=r.history,l=Vt.Pop,c=null,u=m();u==null&&(u=0,o.replaceState(wr({},o.state,{idx:u}),""));function m(){return(o.state||{idx:null}).idx}function d(){l=Vt.Pop;let j=m(),f=j==null?null:j-u;u=j,c&&c({action:l,location:x.location,delta:f})}function p(j,f){l=Vt.Push;let g=ul(x.location,j,f);u=m()+1;let h=Yu(g,u),w=x.createHref(g);try{o.pushState(h,"",w)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;r.location.assign(w)}a&&c&&c({action:l,location:x.location,delta:1})}function y(j,f){l=Vt.Replace;let g=ul(x.location,j,f);u=m();let h=Yu(g,u),w=x.createHref(g);o.replaceState(h,"",w),a&&c&&c({action:l,location:x.location,delta:0})}function b(j){let f=r.location.origin!=="null"?r.location.origin:r.location.href,g=typeof j=="string"?j:Ji(j);return g=g.replace(/ $/,"%20"),le(f,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,f)}let x={get action(){return l},get location(){return e(r,o)},listen(j){if(c)throw new Error("A history only accepts one active listener");return r.addEventListener(qu,d),c=j,()=>{r.removeEventListener(qu,d),c=null}},createHref(j){return t(r,j)},createURL:b,encodeLocation(j){let f=b(j);return{pathname:f.pathname,search:f.search,hash:f.hash}},push:p,replace:y,go(j){return o.go(j)}};return x}var Qu;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Qu||(Qu={}));function Vg(e,t,n){return n===void 0&&(n="/"),Kg(e,t,n)}function Kg(e,t,n,s){let r=typeof t=="string"?bs(t):t,a=hs(r.pathname||"/",n);if(a==null)return null;let o=Gh(e);Gg(o);let l=null,c=ry(a);for(let u=0;l==null&&u<o.length;++u)l=ny(o[u],c);return l}function Gh(e,t,n,s){t===void 0&&(t=[]),n===void 0&&(n=[]),s===void 0&&(s="");let r=(a,o,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(le(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=en([s,c.relativePath]),m=n.concat(c);a.children&&a.children.length>0&&(le(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Gh(a.children,t,m,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:ey(u,a.index),routesMeta:m})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))r(a,o);else for(let c of qh(a.path))r(a,o,c)}),t}function qh(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,r=n.endsWith("?"),a=n.replace(/\?$/,"");if(s.length===0)return r?[a,""]:[a];let o=qh(s.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),r&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function Gg(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:ty(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}const qg=/^:[\w-]+$/,Yg=3,Qg=2,Jg=1,Xg=10,Zg=-2,Ju=e=>e==="*";function ey(e,t){let n=e.split("/"),s=n.length;return n.some(Ju)&&(s+=Zg),t&&(s+=Qg),n.filter(r=>!Ju(r)).reduce((r,a)=>r+(qg.test(a)?Yg:a===""?Jg:Xg),s)}function ty(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 ny(e,t,n){let{routesMeta:s}=e,r={},a="/",o=[];for(let l=0;l<s.length;++l){let c=s[l],u=l===s.length-1,m=a==="/"?t:t.slice(a.length)||"/",d=dl({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},m),p=c.route;if(!d)return null;Object.assign(r,d.params),o.push({params:r,pathname:en([a,d.pathname]),pathnameBase:cy(en([a,d.pathnameBase])),route:p}),d.pathnameBase!=="/"&&(a=en([a,d.pathnameBase]))}return o}function dl(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=sy(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let a=r[0],o=a.replace(/(.)\/+$/,"$1"),l=r.slice(1);return{params:s.reduce((u,m,d)=>{let{paramName:p,isOptional:y}=m;if(p==="*"){let x=l[d]||"";o=a.slice(0,a.length-x.length).replace(/(.)\/+$/,"$1")}const b=l[d];return y&&!b?u[p]=void 0:u[p]=(b||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function sy(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),vc(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,l,c)=>(s.push({paramName:l,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 ry(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return vc(!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 hs(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 iy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ay=e=>iy.test(e);function oy(e,t){t===void 0&&(t="/");let{pathname:n,search:s="",hash:r=""}=typeof e=="string"?bs(e):e,a;if(n)if(ay(n))a=n;else{if(n.includes("//")){let o=n;n=Jh(n),vc(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?a=Xu(n.substring(1),"/"):a=Xu(n,t)}else a=t;return{pathname:a,search:uy(s),hash:dy(r)}}function Xu(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 ro(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 ly(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Yh(e,t){let n=ly(e);return t?n.map((s,r)=>r===n.length-1?s.pathname:s.pathnameBase):n.map(s=>s.pathnameBase)}function Qh(e,t,n,s){s===void 0&&(s=!1);let r;typeof e=="string"?r=bs(e):(r=wr({},e),le(!r.pathname||!r.pathname.includes("?"),ro("?","pathname","search",r)),le(!r.pathname||!r.pathname.includes("#"),ro("#","pathname","hash",r)),le(!r.search||!r.search.includes("#"),ro("#","search","hash",r)));let a=e===""||r.pathname==="",o=a?"/":r.pathname,l;if(o==null)l=n;else{let d=t.length-1;if(!s&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),d-=1;r.pathname=p.join("/")}l=d>=0?t[d]:"/"}let c=oy(r,l),u=o&&o!=="/"&&o.endsWith("/"),m=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||m)&&(c.pathname+="/"),c}const Jh=e=>e.replace(/\/\/+/g,"/"),en=e=>Jh(e.join("/")),cy=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),uy=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,dy=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function fy(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Xh=["post","put","patch","delete"];new Set(Xh);const hy=["get",...Xh];new Set(hy);/**
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 kr(){return kr=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},kr.apply(null,arguments)}const va=v.createContext(null),Zh=v.createContext(null),ln=v.createContext(null),ba=v.createContext(null),$t=v.createContext({outlet:null,matches:[],isDataRoute:!1}),em=v.createContext(null);function my(e,t){let{relative:n}=t===void 0?{}:t;Pr()||le(!1);let{basename:s,navigator:r}=v.useContext(ln),{hash:a,pathname:o,search:l}=ja(e,{relative:n}),c=o;return s!=="/"&&(c=o==="/"?s:en([s,o])),r.createHref({pathname:c,search:l,hash:a})}function Pr(){return v.useContext(ba)!=null}function An(){return Pr()||le(!1),v.useContext(ba).location}function tm(e){v.useContext(ln).static||v.useLayoutEffect(e)}function py(){let{isDataRoute:e}=v.useContext($t);return e?Py():gy()}function gy(){Pr()||le(!1);let e=v.useContext(va),{basename:t,future:n,navigator:s}=v.useContext(ln),{matches:r}=v.useContext($t),{pathname:a}=An(),o=JSON.stringify(Yh(r,n.v7_relativeSplatPath)),l=v.useRef(!1);return tm(()=>{l.current=!0}),v.useCallback(function(u,m){if(m===void 0&&(m={}),!l.current)return;if(typeof u=="number"){s.go(u);return}let d=Qh(u,JSON.parse(o),a,m.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:en([t,d.pathname])),(m.replace?s.replace:s.push)(d,m.state,m)},[t,s,o,a,e])}const yy=v.createContext(null);function xy(e){let t=v.useContext($t).outlet;return t&&v.createElement(yy.Provider,{value:e},t)}function vy(){let{matches:e}=v.useContext($t),t=e[e.length-1];return t?t.params:{}}function ja(e,t){let{relative:n}=t===void 0?{}:t,{future:s}=v.useContext(ln),{matches:r}=v.useContext($t),{pathname:a}=An(),o=JSON.stringify(Yh(r,s.v7_relativeSplatPath));return v.useMemo(()=>Qh(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function by(e,t){return jy(e,t)}function jy(e,t,n,s){Pr()||le(!1);let{navigator:r}=v.useContext(ln),{matches:a}=v.useContext($t),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=An(),m;if(t){var d;let j=typeof t=="string"?bs(t):t;c==="/"||(d=j.pathname)!=null&&d.startsWith(c)||le(!1),m=j}else m=u;let p=m.pathname||"/",y=p;if(c!=="/"){let j=c.replace(/^\//,"").split("/");y="/"+p.replace(/^\//,"").split("/").slice(j.length).join("/")}let b=Vg(e,{pathname:y}),x=Cy(b&&b.map(j=>Object.assign({},j,{params:Object.assign({},l,j.params),pathname:en([c,r.encodeLocation?r.encodeLocation(j.pathname).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?c:en([c,r.encodeLocation?r.encodeLocation(j.pathnameBase).pathname:j.pathnameBase])})),a,n,s);return t&&x?v.createElement(ba.Provider,{value:{location:kr({pathname:"/",search:"",hash:"",state:null,key:"default"},m),navigationType:Vt.Pop}},x):x}function wy(){let e=Ly(),t=fy(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 v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:r},n):null,null)}const ky=v.createElement(wy,null);class Ny extends v.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?v.createElement($t.Provider,{value:this.props.routeContext},v.createElement(em.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Sy(e){let{routeContext:t,match:n,children:s}=e,r=v.useContext(va);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement($t.Provider,{value:t},s)}function Cy(e,t,n,s){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),s===void 0&&(s=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=s)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(r=n)==null?void 0:r.errors;if(l!=null){let m=o.findIndex(d=>d.route.id&&(l==null?void 0:l[d.route.id])!==void 0);m>=0||le(!1),o=o.slice(0,Math.min(o.length,m+1))}let c=!1,u=-1;if(n&&s&&s.v7_partialHydration)for(let m=0;m<o.length;m++){let d=o[m];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=m),d.route.id){let{loaderData:p,errors:y}=n,b=d.route.loader&&p[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((m,d,p)=>{let y,b=!1,x=null,j=null;n&&(y=l&&d.route.id?l[d.route.id]:void 0,x=d.route.errorElement||ky,c&&(u<0&&p===0?(Iy("route-fallback"),b=!0,j=null):u===p&&(b=!0,j=d.route.hydrateFallbackElement||null)));let f=t.concat(o.slice(0,p+1)),g=()=>{let h;return y?h=x:b?h=j:d.route.Component?h=v.createElement(d.route.Component,null):d.route.element?h=d.route.element:h=m,v.createElement(Sy,{match:d,routeContext:{outlet:m,matches:f,isDataRoute:n!=null},children:h})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?v.createElement(Ny,{location:n.location,revalidation:n.revalidation,component:x,error:y,children:g(),routeContext:{outlet:null,matches:f,isDataRoute:!0}}):g()},null)}var nm=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(nm||{}),sm=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}(sm||{});function Ey(e){let t=v.useContext(va);return t||le(!1),t}function Ty(e){let t=v.useContext(Zh);return t||le(!1),t}function Ay(e){let t=v.useContext($t);return t||le(!1),t}function rm(e){let t=Ay(),n=t.matches[t.matches.length-1];return n.route.id||le(!1),n.route.id}function Ly(){var e;let t=v.useContext(em),n=Ty(),s=rm();return t!==void 0?t:(e=n.errors)==null?void 0:e[s]}function Py(){let{router:e}=Ey(nm.UseNavigateStable),t=rm(sm.UseNavigateStable),n=v.useRef(!1);return tm(()=>{n.current=!0}),v.useCallback(function(r,a){a===void 0&&(a={}),n.current&&(typeof r=="number"?e.navigate(r):e.navigate(r,kr({fromRouteId:t},a)))},[e,t])}const Zu={};function Iy(e,t,n){Zu[e]||(Zu[e]=!0)}function My(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Oy(e){return xy(e.context)}function xe(e){le(!1)}function _y(e){let{basename:t="/",children:n=null,location:s,navigationType:r=Vt.Pop,navigator:a,static:o=!1,future:l}=e;Pr()&&le(!1);let c=t.replace(/^\/*/,"/"),u=v.useMemo(()=>({basename:c,navigator:a,static:o,future:kr({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof s=="string"&&(s=bs(s));let{pathname:m="/",search:d="",hash:p="",state:y=null,key:b="default"}=s,x=v.useMemo(()=>{let j=hs(m,c);return j==null?null:{location:{pathname:j,search:d,hash:p,state:y,key:b},navigationType:r}},[c,m,d,p,y,b,r]);return x==null?null:v.createElement(ln.Provider,{value:u},v.createElement(ba.Provider,{children:n,value:x}))}function $y(e){let{children:t,location:n}=e;return by(fl(t),n)}new Promise(()=>{});function fl(e,t){t===void 0&&(t=[]);let n=[];return v.Children.forEach(e,(s,r)=>{if(!v.isValidElement(s))return;let a=[...t,r];if(s.type===v.Fragment){n.push.apply(n,fl(s.props.children,a));return}s.type!==xe&&le(!1),!s.props.index||!s.props.children||le(!1);let o={id:s.props.id||a.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=fl(s.props.children,a)),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 Xi(){return Xi=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},Xi.apply(null,arguments)}function im(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 Dy(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ry(e,t){return e.button===0&&(!t||t==="_self")&&!Dy(e)}const zy=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Fy=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],By="6";try{window.__reactRouterVersion=By}catch{}const Uy=v.createContext({isTransitioning:!1}),Wy="startTransition",ed=Ep[Wy];function Hy(e){let{basename:t,children:n,future:s,window:r}=e,a=v.useRef();a.current==null&&(a.current=Ug({window:r,v5Compat:!0}));let o=a.current,[l,c]=v.useState({action:o.action,location:o.location}),{v7_startTransition:u}=s||{},m=v.useCallback(d=>{u&&ed?ed(()=>c(d)):c(d)},[c,u]);return v.useLayoutEffect(()=>o.listen(m),[o,m]),v.useEffect(()=>My(s),[s]),v.createElement(_y,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:s})}const Vy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Ky=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,we=v.forwardRef(function(t,n){let{onClick:s,relative:r,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:m,viewTransition:d}=t,p=im(t,zy),{basename:y}=v.useContext(ln),b,x=!1;if(typeof u=="string"&&Ky.test(u)&&(b=u,Vy))try{let h=new URL(window.location.href),w=u.startsWith("//")?new URL(h.protocol+u):new URL(u),k=hs(w.pathname,y);w.origin===h.origin&&k!=null?u=k+w.search+w.hash:x=!0}catch{}let j=my(u,{relative:r}),f=qy(u,{replace:o,state:l,target:c,preventScrollReset:m,relative:r,viewTransition:d});function g(h){s&&s(h),h.defaultPrevented||f(h)}return v.createElement("a",Xi({},p,{href:b||j,onClick:x||a?s:g,ref:n,target:c}))}),gt=v.forwardRef(function(t,n){let{"aria-current":s="page",caseSensitive:r=!1,className:a="",end:o=!1,style:l,to:c,viewTransition:u,children:m}=t,d=im(t,Fy),p=ja(c,{relative:d.relative}),y=An(),b=v.useContext(Zh),{navigator:x,basename:j}=v.useContext(ln),f=b!=null&&Yy(p)&&u===!0,g=x.encodeLocation?x.encodeLocation(p).pathname:p.pathname,h=y.pathname,w=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;r||(h=h.toLowerCase(),w=w?w.toLowerCase():null,g=g.toLowerCase()),w&&j&&(w=hs(w,j)||w);const k=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let C=h===g||!o&&h.startsWith(g)&&h.charAt(k)==="/",S=w!=null&&(w===g||!o&&w.startsWith(g)&&w.charAt(g.length)==="/"),N={isActive:C,isPending:S,isTransitioning:f},T=C?s:void 0,A;typeof a=="function"?A=a(N):A=[a,C?"active":null,S?"pending":null,f?"transitioning":null].filter(Boolean).join(" ");let M=typeof l=="function"?l(N):l;return v.createElement(we,Xi({},d,{"aria-current":T,className:A,ref:n,style:M,to:c,viewTransition:u}),typeof m=="function"?m(N):m)});var hl;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(hl||(hl={}));var td;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(td||(td={}));function Gy(e){let t=v.useContext(va);return t||le(!1),t}function qy(e,t){let{target:n,replace:s,state:r,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=py(),u=An(),m=ja(e,{relative:o});return v.useCallback(d=>{if(Ry(d,n)){d.preventDefault();let p=s!==void 0?s:Ji(u)===Ji(m);c(e,{replace:p,state:r,preventScrollReset:a,relative:o,viewTransition:l})}},[u,c,m,s,r,n,e,a,o,l])}function Yy(e,t){t===void 0&&(t={});let n=v.useContext(Uy);n==null&&le(!1);let{basename:s}=Gy(hl.useViewTransitionState),r=ja(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=hs(n.currentLocation.pathname,s)||n.currentLocation.pathname,o=hs(n.nextLocation.pathname,s)||n.nextLocation.pathname;return dl(r.pathname,o)!=null||dl(r.pathname,a)!=null}function Qy(e){const[t,n]=v.useState(null),s=v.useRef(0),r=v.useCallback(()=>{if(e.length===0){n(null);return}let a=e[0];for(const o of e){const l=document.getElementById(o);l&&l.getBoundingClientRect().top<=100&&(a=o)}n(a)},[e]);return v.useEffect(()=>{if(e.length===0)return;r();const a=()=>{cancelAnimationFrame(s.current),s.current=requestAnimationFrame(r)};return window.addEventListener("scroll",a,{passive:!0}),()=>{window.removeEventListener("scroll",a),cancelAnimationFrame(s.current)}},[r,e]),t}async function Q(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),a=await r.json();if(!r.ok)throw new Error(a.error??`HTTP ${r.status}`);return a}const B={getStatus:()=>Q("GET","/api/status"),getConnectors:()=>Q("GET","/api/connectors"),getConnector:(e,t)=>Q("GET",`/api/connectors/${e}/${t}`),run:(e,t)=>Q("POST","/api/run",{connector:e,args:t}),approve:(e,t)=>Q("POST","/api/approval",{approvalId:e,approved:t}),getAudit:e=>{const t=new URLSearchParams(e).toString();return Q("GET",`/api/audit${t?`?${t}`:""}`)},getAuditEvent:e=>Q("GET",`/api/audit/${e}`),getConfig:()=>Q("GET","/api/config"),setConfig:(e,t)=>Q("POST","/api/config",{key:e,value:t}),getPreferences:()=>Q("GET","/api/preferences"),setPreference:(e,t)=>Q("PUT","/api/preferences",{key:e,value:t}),getGoals:e=>Q("GET",`/api/goals?month=${e}`),upsertGoal:e=>Q("POST","/api/goals",e),deleteGoal:e=>Q("DELETE",`/api/goals/${e}`),getCachedReport:e=>Q("GET",`/api/timetracking/cache?month=${e}`),cacheReport:(e,t)=>Q("POST","/api/timetracking/cache",{month:e,data:t}),getCachedProjects:()=>Q("GET","/api/timetracking/projects"),cacheProjects:e=>Q("POST","/api/timetracking/projects",{data:e}),generateJournal:e=>Q("POST","/api/journal/generate",e),getCachedJournal:e=>Q("GET",`/api/journal/cache?weekStart=${e}`),cacheJournalSaba:(e,t)=>Q("POST","/api/journal/cache/saba",{weekStart:e,saba:t}),getJournalSourcePrefs:()=>Q("GET","/api/journal/source-prefs"),saveJournalSourcePrefs:e=>Q("POST","/api/journal/source-prefs",e),getCachedSecurityNews:()=>Q("GET","/api/security-news/cache"),cacheSecurityNews:e=>Q("POST","/api/security-news/cache",{data:e}),getCachedTrustedPeers:()=>Q("GET","/api/trusted-peers/cache"),cacheTrustedPeers:e=>Q("POST","/api/trusted-peers/cache",{data:e}),getCachedRoomAvailability:e=>Q("GET",`/api/room-availability/cache?date=${e}`),cacheRoomAvailability:(e,t)=>Q("POST","/api/room-availability/cache",{date:e,data:t}),getSkills:()=>Q("GET","/api/skills")};function wa(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 am={"command.success":"success","command.error":"error","command.denied":"error","command.start":"neutral","auth.failed":"warning","approval.granted":"success","approval.rejected":"error","config.changed":"neutral"},Jy={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"},Xy={sm:"px-2 py-0.5 text-xs",xs:"px-1.5 py-px text-[0.65rem]"};function K({variant:e="neutral",size:t="sm",className:n="",children:s}){return i.jsx("span",{className:`inline-flex items-center font-mono font-medium border ${Xy[t]} ${Jy[e]} ${n}`,children:s})}function Zy(){const[e,t]=v.useState(null),[n,s]=v.useState([]),r=v.useCallback(()=>{B.getStatus().then(t).catch(()=>t(null)),B.getAudit({limit:"10"}).then(o=>s(o.events)).catch(()=>{})},[]);v.useEffect(()=>{r();const o=setInterval(r,3e4);return()=>clearInterval(o)},[r]);function a(o){const l=Date.now()-new Date(o).getTime(),c=Math.floor(l/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 i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Dashboard"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 border border-base-300 mb-8",children:[i.jsxs("div",{className:"p-3 sm:border-r sm:border-r-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Daemon"}),i.jsx("div",{className:`font-display font-semibold text-sm ${e!=null&&e.ok?"text-success":"text-error"}`,children:e!=null&&e.ok?"Running":"Offline"})]}),i.jsxs("div",{className:"p-3 border-t border-t-base-300 sm:border-t-0 sm:border-r sm:border-r-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Extension"}),i.jsx("div",{className:`font-display font-semibold text-sm ${e!=null&&e.extensionConnected?"text-success":"text-error"}`,children:e!=null&&e.extensionConnected?"Connected":"Disconnected"})]}),i.jsxs("div",{className:"p-3 border-t border-t-base-300 sm:border-t-0",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Connectors"}),i.jsxs("div",{className:"font-display font-semibold text-sm",children:[(e==null?void 0:e.connectorCount)??0," loaded"]})]})]}),i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Recent activity"}),n.length===0?i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No recent activity"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Run a connector to see events here."})]}):i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{children:"Time"}),i.jsx("th",{children:"Connector"}),i.jsx("th",{children:"Type"}),i.jsx("th",{children:"Duration"})]})}),i.jsx("tbody",{children:n.map(o=>i.jsxs("tr",{className:"hover:bg-base-200",children:[i.jsx("td",{className:"opacity-50 text-sm font-mono",children:a(o.timestamp)}),i.jsx("td",{className:"font-mono text-sm",children:o.connector}),i.jsx("td",{children:i.jsx(K,{variant:am[o.type]??"neutral",children:o.type})}),i.jsx("td",{className:"text-sm font-mono",children:o.durationMs?`${(o.durationMs/1e3).toFixed(1)}s`:"—"})]},o.id))})]})})]})}function wt({label:e}){return i.jsxs("div",{className:"flex items-center gap-3 py-4",children:[i.jsx("span",{className:"loading loading-spinner loading-md"}),e&&i.jsx("span",{className:"text-sm opacity-60",children:e})]})}function ex({c:e,approvingKey:t,onApprove:n}){const[s,r]=e.key.split("/");return i.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:[i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[i.jsx("span",{className:"font-mono font-semibold text-sm",children:r}),i.jsx(K,{size:"sm",children:e.access}),e.capabilities.map(a=>i.jsx(K,{size:"sm",children:a},a)),e.isHighRisk&&e.isApproved&&i.jsx(K,{variant:"success",size:"sm",children:"Approved"}),e.isHighRisk&&!e.isApproved&&i.jsx(K,{variant:"warning",size:"sm",children:"Blocked — requires approval"})]}),i.jsx("p",{className:"text-sm opacity-60 mt-1",children:e.description}),e.domains.length>0&&i.jsxs("div",{className:"text-xs opacity-40 mt-1",children:["Domains: ",e.domains.join(", ")]})]}),i.jsxs("div",{className:"flex gap-2 ml-4 shrink-0",children:[e.isHighRisk&&!e.isApproved&&i.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&&i.jsx(we,{to:e.appRoute,className:"btn btn-sm btn-primary",children:"Open App"}),i.jsx(we,{to:`/connectors/${s}/${r}`,className:"btn btn-sm btn-ghost",children:"Run"})]})]})}function tx({site:e,connectors:t,approvingKey:n,onApprove:s}){const[r,a]=v.useState(!1);return i.jsxs("div",{id:`conn-${e}`,className:"border border-base-300 p-4 scroll-mt-4",children:[i.jsxs("button",{className:"flex items-center gap-2 w-full text-left",onClick:()=>a(!r),children:[i.jsx("span",{className:"text-xs opacity-50",children:r?"▸":"▾"}),i.jsx("span",{className:"font-mono font-semibold",children:e}),i.jsxs("span",{className:"text-xs opacity-40",children:[t.length," ",t.length===1?"connector":"connectors"]})]}),!r&&i.jsx("div",{className:"space-y-2 mt-3",children:t.map(o=>i.jsx(ex,{c:o,approvingKey:n,onApprove:s},o.key))})]})}function nx(){const[e,t]=v.useState([]),[n,s]=v.useState([]),[r,a]=v.useState(!0),[o,l]=v.useState(null),c=v.useCallback(()=>{const d=B.getConnectors(),p=B.getConfig().catch(()=>({ok:!1,config:{}}));Promise.all([d,p]).then(([y,b])=>{t(y.connectors);const x=b.config.security??{};s(x.approvedHighRisk??[])}).catch(()=>{}).finally(()=>a(!1))},[]);v.useEffect(()=>{c()},[c]);const u=v.useCallback(async d=>{l(d);try{const p=[...n,d];await B.setConfig("security.approvedHighRisk",JSON.stringify(p)),c()}catch{}finally{l(null)}},[n,c]),m=v.useMemo(()=>wa(e),[e]);return r?i.jsx(wt,{label:"Loading connectors..."}):i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Connectors"}),e.length===0?i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No connectors loaded"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Check the daemon is running and connectors are installed in ~/.commandgarden/connectors/"})]}):i.jsx("div",{className:"space-y-3",children:m.map(([d,p])=>i.jsx(tx,{site:d,connectors:p,approvingKey:o,onApprove:u},d))})]})}function ka(){const[e,t]=v.useState(!1),[n,s]=v.useState(null),[r,a]=v.useState(null),[o,l]=v.useState(!1),[c,u]=v.useState(null),m=v.useCallback(()=>{t(!1),s(null),a(null),l(!1),u(null)},[]),d=v.useCallback(async(b,x)=>{t(!0),a(null),s(null),l(!1),u(null);try{const j=await B.run(b,x);if(j.requiresApproval&&j.requestId){l(!0);const f=new EventSource(`/api/run/events/${j.requestId}`);f.addEventListener("approval",g=>{const h=JSON.parse(g.data);u(h.approvalId)}),f.addEventListener("result",g=>{const h=JSON.parse(g.data);!h.ok&&h.error?a(h.error):s(h),l(!1),t(!1),f.close()}),f.onerror=()=>{a("SSE connection lost"),l(!1),t(!1),f.close()}}else!j.ok&&j.error?(a(j.error),t(!1)):(s(j),t(!1))}catch(j){a(j instanceof Error?j.message:"Unknown error"),t(!1)}},[]),p=v.useCallback(async b=>{if(c)try{await B.approve(c,b),b||(l(!1),t(!1),a("Approval rejected"))}catch(x){a(x instanceof Error?x.message:"Approval failed")}},[c]),y=v.useCallback(b=>{t(!1),s(b),a(null),l(!1),u(null)},[]);return{running:e,result:n,error:r,approvalPending:o,approvalId:c,run:d,handleApproval:p,reset:m,hydrate:y}}function sx(){const{site:e,name:t}=vy(),n=`${e}/${t}`,[s,r]=v.useState(null),[a,o]=v.useState(!0),[l,c]=v.useState({}),[u,m]=v.useState(null),{running:d,result:p,error:y,approvalPending:b,approvalId:x,run:j,handleApproval:f}=ka();v.useEffect(()=>{!e||!t||B.getConnector(e,t).then(h=>{r(h.connector);const w={};for(const k of h.connector.args??[])w[k.name]="";c(w)}).catch(h=>m(h.message)).finally(()=>o(!1))},[e,t]);const g=v.useCallback(async()=>{const h={};for(const[w,k]of Object.entries(l))k&&(h[w]=k);await j(n,h)},[l,n,j]);return a?i.jsx(wt,{label:"Loading connector..."}):s?i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx(we,{to:"/connectors",className:"text-sm opacity-50 hover:opacity-80",children:"Connectors"}),i.jsx("span",{className:"text-sm opacity-30",children:"/"})]}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-2",children:n}),i.jsx("p",{className:"text-sm opacity-50 mb-5",children:s.description}),i.jsxs("div",{className:"border border-base-300 p-5 mb-6",children:[i.jsx("h3",{className:"font-display font-semibold mb-4",children:"Arguments"}),i.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[(s.args??[]).map(h=>i.jsxs("label",{className:"form-control",children:[i.jsxs("span",{className:"label-text mb-1 text-sm",children:[h.name,!h.required&&i.jsx("span",{className:"opacity-40",children:" (optional)"})]}),i.jsx("input",{type:"text",className:"input input-bordered input-sm w-40",placeholder:h.help,value:l[h.name]??"",onChange:w=>c(k=>({...k,[h.name]:w.target.value})),pattern:h.pattern}),h.help&&i.jsx("span",{className:"text-xs opacity-40 mt-1",children:h.help})]},h.name)),i.jsx("button",{className:"btn btn-primary btn-sm",onClick:g,disabled:d,children:d?"Running...":"Run connector"})]})]}),d&&!b&&i.jsx(wt,{label:`Running ${n} — this drives your browser and may take up to a minute.`}),b&&i.jsxs("div",{className:"alert alert-warning mb-4",children:[i.jsx("span",{children:"This connector requires approval before proceeding."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>f(!0),disabled:!x,children:"Approve"}),i.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>f(!1),disabled:!x,children:"Reject"})]})]}),y&&i.jsx("div",{className:"alert alert-error mb-4",children:i.jsx("span",{children:y})}),p&&i.jsxs("div",{className:"border border-base-300 p-5",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsx("h3",{className:"font-semibold",children:"Results"}),i.jsxs("div",{className:"text-xs opacity-40",children:[p.rowCount??p.data.length," rows",p.durationMs?` · ${(p.durationMs/1e3).toFixed(1)}s`:""]})]}),p.data.length===0?i.jsx("p",{className:"text-sm opacity-50",children:"No results returned."}):i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"table table-sm",children:[i.jsx("thead",{children:i.jsx("tr",{children:(p.columns??Object.keys(p.data[0])).map(h=>i.jsx("th",{children:h},h))})}),i.jsx("tbody",{children:p.data.map((h,w)=>i.jsx("tr",{children:(p.columns??Object.keys(h)).map(k=>i.jsx("td",{className:"text-sm",children:String(h[k]??"")},k))},w))})]})})]})]}):i.jsx("div",{className:"text-error",children:u??`Connector not found: ${n}`})}const rx=[{label:"Last 24 hours",hours:24},{label:"Last 7 days",hours:168},{label:"Last 30 days",hours:720},{label:"Last 90 days",hours:2160}],ix=["command.start","command.success","command.error","command.denied","auth.failed","approval.granted","approval.rejected","config.changed"],Pn=20;function ax(){const[e,t]=v.useState([]),[n,s]=v.useState([]),[r,a]=v.useState(!0),[o,l]=v.useState(168),[c,u]=v.useState(""),[m,d]=v.useState(""),[p,y]=v.useState(null),[b,x]=v.useState(0);v.useEffect(()=>{B.getConnectors().then(h=>s(h.connectors)).catch(()=>{})},[]);const j=v.useCallback(()=>{a(!0);const h={since:new Date(Date.now()-o*36e5).toISOString(),limit:String(Pn+b+1)};c&&(h.type=c),m&&(h.connector=m),B.getAudit(h).then(w=>t(w.events)).catch(()=>{}).finally(()=>a(!1))},[o,c,m,b]);v.useEffect(()=>{j();const h=setInterval(j,6e4);return()=>clearInterval(h)},[j]);const f=e.slice(b,b+Pn),g=e.length>b+Pn;return i.jsxs("div",{className:"max-w-5xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Audit Log"}),i.jsxs("div",{className:"flex flex-wrap items-end gap-3 mb-6",children:[i.jsxs("label",{className:"form-control",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Time range"}),i.jsx("select",{className:"select select-bordered select-sm",value:o,onChange:h=>{l(Number(h.target.value)),x(0)},children:rx.map(h=>i.jsx("option",{value:h.hours,children:h.label},h.hours))})]}),i.jsxs("label",{className:"form-control",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Event type"}),i.jsxs("select",{className:"select select-bordered select-sm",value:c,onChange:h=>{u(h.target.value),x(0)},children:[i.jsx("option",{value:"",children:"All types"}),ix.map(h=>i.jsx("option",{value:h,children:h},h))]})]}),i.jsxs("label",{className:"form-control",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Connector"}),i.jsxs("select",{className:"select select-bordered select-sm",value:m,onChange:h=>{d(h.target.value),x(0)},children:[i.jsx("option",{value:"",children:"All connectors"}),n.map(h=>i.jsx("option",{value:h.key,children:h.key},h.key))]})]})]}),r&&e.length===0?i.jsx(wt,{label:"Loading audit events..."}):i.jsxs(i.Fragment,{children:[f.length===0?i.jsx("p",{className:"text-sm opacity-50",children:"No events match the current filters."}):i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Time"}),i.jsx("th",{children:"Type"}),i.jsx("th",{children:"Connector"}),i.jsx("th",{children:"User"}),i.jsx("th",{children:"Duration"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:f.map(h=>i.jsxs(v.Fragment,{children:[i.jsxs("tr",{className:"cursor-pointer hover:bg-base-200",onClick:()=>y(p===h.id?null:h.id),role:"button","aria-expanded":p===h.id,tabIndex:0,onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),y(p===h.id?null:h.id))},children:[i.jsx("td",{className:"text-sm font-mono",children:new Date(h.timestamp).toLocaleString()}),i.jsx("td",{children:i.jsx(K,{variant:am[h.type]??"neutral",children:h.type})}),i.jsx("td",{className:"font-mono text-sm",children:h.connector||"—"}),i.jsx("td",{className:"text-sm",children:h.user}),i.jsx("td",{className:"text-sm font-mono",children:h.durationMs?`${(h.durationMs/1e3).toFixed(1)}s`:"—"}),i.jsx("td",{className:"text-xs opacity-40","aria-hidden":"true",children:p===h.id?"▲":"▼"})]},h.id),p===h.id&&i.jsx("tr",{children:i.jsxs("td",{colSpan:6,className:"bg-base-200/50 p-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm mb-3",children:[i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"ID:"})," ",i.jsx("span",{className:"font-mono text-xs",children:h.id})]}),i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"Correlation:"})," ",i.jsx("span",{className:"font-mono text-xs",children:h.correlationId??"—"})]}),h.connectorHash&&i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"Connector hash:"})," ",i.jsx("span",{className:"font-mono text-xs",children:h.connectorHash})]}),h.error&&i.jsxs("div",{className:"col-span-2",children:[i.jsx("span",{className:"opacity-50",children:"Error:"})," ",i.jsx("span",{className:"text-error",children:h.error})]}),h.args&&i.jsxs("div",{className:"col-span-2",children:[i.jsx("span",{className:"opacity-50",children:"Args:"})," ",i.jsx("span",{className:"font-mono text-xs",children:JSON.stringify(h.args)})]}),h.domains&&h.domains.length>0&&i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"Domains:"})," ",h.domains.join(", ")]}),h.capabilities&&h.capabilities.length>0&&i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"Capabilities:"})," ",h.capabilities.join(", ")]})]}),h.steps&&h.steps.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("h4",{className:"font-semibold text-sm mb-2",children:"Pipeline steps"}),i.jsxs("table",{className:"table table-xs",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"#"}),i.jsx("th",{children:"Step"}),i.jsx("th",{children:"Capability"}),i.jsx("th",{children:"Duration"}),i.jsx("th",{children:"Error"})]})}),i.jsx("tbody",{children:h.steps.map((w,k)=>i.jsxs("tr",{children:[i.jsx("td",{children:k+1}),i.jsx("td",{children:w.step}),i.jsx("td",{children:w.capability}),i.jsxs("td",{children:[(w.durationMs/1e3).toFixed(2),"s"]}),i.jsx("td",{className:"text-error",children:w.error??""})]},k))})]})]})]})},`${h.id}-detail`)]},h.id))})]})}),f.length>0&&i.jsxs("div",{className:"flex justify-between items-center mt-4",children:[i.jsx("button",{className:"btn btn-sm btn-ghost",disabled:b===0,onClick:()=>x(Math.max(0,b-Pn)),children:"Previous"}),i.jsxs("span",{className:"text-sm opacity-50",children:["Showing ",b+1,"–",Math.min(b+Pn,e.length),g?"":` of ${e.length}`]}),i.jsx("button",{className:"btn btn-sm btn-ghost",disabled:!g,onClick:()=>x(b+Pn),children:"Next"})]})]})]})}const bc=Symbol.for("yaml.alias"),ml=Symbol.for("yaml.document"),tn=Symbol.for("yaml.map"),om=Symbol.for("yaml.pair"),kt=Symbol.for("yaml.scalar"),js=Symbol.for("yaml.seq"),st=Symbol.for("yaml.node.type"),ws=e=>!!e&&typeof e=="object"&&e[st]===bc,Ir=e=>!!e&&typeof e=="object"&&e[st]===ml,Mr=e=>!!e&&typeof e=="object"&&e[st]===tn,he=e=>!!e&&typeof e=="object"&&e[st]===om,ee=e=>!!e&&typeof e=="object"&&e[st]===kt,Or=e=>!!e&&typeof e=="object"&&e[st]===js;function de(e){if(e&&typeof e=="object")switch(e[st]){case tn:case js:return!0}return!1}function fe(e){if(e&&typeof e=="object")switch(e[st]){case bc:case tn:case kt:case js:return!0}return!1}const lm=e=>(ee(e)||de(e))&&!!e.anchor,hn=Symbol("break visit"),ox=Symbol("skip children"),sr=Symbol("remove node");function ks(e,t){const n=lx(t);Ir(e)?qn(null,e.contents,n,Object.freeze([e]))===sr&&(e.contents=null):qn(null,e,n,Object.freeze([]))}ks.BREAK=hn;ks.SKIP=ox;ks.REMOVE=sr;function qn(e,t,n,s){const r=cx(e,t,n,s);if(fe(r)||he(r))return ux(e,s,r),qn(e,r,n,s);if(typeof r!="symbol"){if(de(t)){s=Object.freeze(s.concat(t));for(let a=0;a<t.items.length;++a){const o=qn(a,t.items[a],n,s);if(typeof o=="number")a=o-1;else{if(o===hn)return hn;o===sr&&(t.items.splice(a,1),a-=1)}}}else if(he(t)){s=Object.freeze(s.concat(t));const a=qn("key",t.key,n,s);if(a===hn)return hn;a===sr&&(t.key=null);const o=qn("value",t.value,n,s);if(o===hn)return hn;o===sr&&(t.value=null)}}return r}function lx(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 cx(e,t,n,s){var r,a,o,l,c;if(typeof n=="function")return n(e,t,s);if(Mr(t))return(r=n.Map)==null?void 0:r.call(n,e,t,s);if(Or(t))return(a=n.Seq)==null?void 0:a.call(n,e,t,s);if(he(t))return(o=n.Pair)==null?void 0:o.call(n,e,t,s);if(ee(t))return(l=n.Scalar)==null?void 0:l.call(n,e,t,s);if(ws(t))return(c=n.Alias)==null?void 0:c.call(n,e,t,s)}function ux(e,t,n){const s=t[t.length-1];if(de(s))s.items[e]=n;else if(he(s))e==="key"?s.key=n:s.value=n;else if(Ir(s))s.contents=n;else{const r=ws(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const dx={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},fx=e=>e.replace(/[!,[\]{}]/g,t=>dx[t]);class Le{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Le.defaultYaml,t),this.tags=Object.assign({},Le.defaultTags,n)}clone(){const t=new Le(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Le(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Le.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Le.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Le.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Le.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[a,o]=s;return this.tags[a]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[a]=s;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{const o=/^\d+\.\d+$/.test(a);return n(6,`Unsupported YAML version ${a}`,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 a=this.tags[s];if(a)try{return a+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+fx(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&&fe(t.contents)){const a={};ks(t.contents,(o,l)=>{fe(l)&&l.tag&&(a[l.tag]=!0)}),r=Object.keys(a)}else r=[];for(const[a,o]of s)a==="!!"&&o==="tag:yaml.org,2002:"||(!t||r.some(l=>l.startsWith(o)))&&n.push(`%TAG ${a} ${o}`);return n.join(`
68
- `)}}Le.defaultYaml={explicit:!1,version:"1.2"};Le.defaultTags={"!!":"tag:yaml.org,2002:"};function cm(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 um(e){const t=new Set;return ks(e,{Value(n,s){s.anchor&&t.add(s.anchor)}}),t}function dm(e,t){for(let n=1;;++n){const s=`${e}${n}`;if(!t.has(s))return s}}function hx(e,t){const n=[],s=new Map;let r=null;return{onAnchor:a=>{n.push(a),r??(r=um(e));const o=dm(t,r);return r.add(o),o},setAnchors:()=>{for(const a of n){const o=s.get(a);if(typeof o=="object"&&o.anchor&&(ee(o.node)||de(o.node)))o.node.anchor=o.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=a,l}}},sourceObjects:s}}function Yn(e,t,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let r=0,a=s.length;r<a;++r){const o=s[r],l=Yn(e,s,String(r),o);l===void 0?delete s[r]:l!==o&&(s[r]=l)}else if(s instanceof Map)for(const r of Array.from(s.keys())){const a=s.get(r),o=Yn(e,s,r,a);o===void 0?s.delete(r):o!==a&&s.set(r,o)}else if(s instanceof Set)for(const r of Array.from(s)){const a=Yn(e,s,r,r);a===void 0?s.delete(r):a!==r&&(s.delete(r),s.add(a))}else for(const[r,a]of Object.entries(s)){const o=Yn(e,s,r,a);o===void 0?delete s[r]:o!==a&&(s[r]=o)}return e.call(t,n,s)}function et(e,t,n){if(Array.isArray(e))return e.map((s,r)=>et(s,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!lm(e))return e.toJSON(t,n);const s={aliasCount:0,count:1,res:void 0};n.anchors.set(e,s),n.onCreate=a=>{s.res=a,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 jc{constructor(t){Object.defineProperty(this,st,{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:a}={}){if(!Ir(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},l=et(this,"",o);if(typeof r=="function")for(const{count:c,res:u}of o.anchors.values())r(u,c);return typeof a=="function"?Yn(a,{"":l},"",l):l}}class wc extends jc{constructor(t){super(bc),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=[],ks(t,{Node:(a,o)=>{(ws(o)||lm(o))&&s.push(o)}}),n&&(n.aliasResolveCache=s));let r;for(const a of s){if(a===this)break;a.anchor===this.source&&(r=a)}return r}toJSON(t,n){if(!n)return{source:this.source};const{anchors:s,doc:r,maxAliasCount:a}=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 l=s.get(o);if(l||(et(o,null,n),l=s.get(o)),(l==null?void 0:l.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(a>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=ki(r,o,s)),l.count*l.aliasCount>a)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(t,n,s){const r=`*${this.source}`;if(t){if(cm(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(t.implicitKey)return`${r} `}return r}}function ki(e,t,n){if(ws(t)){const s=t.resolve(e),r=n&&s&&n.get(s);return r?r.count*r.aliasCount:0}else if(de(t)){let s=0;for(const r of t.items){const a=ki(e,r,n);a>s&&(s=a)}return s}else if(he(t)){const s=ki(e,t.key,n),r=ki(e,t.value,n);return Math.max(s,r)}return 1}const fm=e=>!e||typeof e!="function"&&typeof e!="object";class V extends jc{constructor(t){super(kt),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:et(this.value,t,n)}toString(){return String(this.value)}}V.BLOCK_FOLDED="BLOCK_FOLDED";V.BLOCK_LITERAL="BLOCK_LITERAL";V.PLAIN="PLAIN";V.QUOTE_DOUBLE="QUOTE_DOUBLE";V.QUOTE_SINGLE="QUOTE_SINGLE";const mx="tag:yaml.org,2002:";function px(e,t,n){if(t){const s=n.filter(a=>a.tag===t),r=s.find(a=>!a.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 Nr(e,t,n){var d,p,y;if(Ir(e)&&(e=e.contents),fe(e))return e;if(he(e)){const b=(p=(d=n.schema[tn]).createNode)==null?void 0:p.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:a,schema:o,sourceObjects:l}=n;let c;if(s&&e&&typeof e=="object"){if(c=l.get(e),c)return c.anchor??(c.anchor=r(e)),new wc(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=mx+t.slice(2));let u=px(e,t,o.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const b=new V(e);return c&&(c.node=b),b}u=e instanceof Map?o[tn]:Symbol.iterator in Object(e)?o[js]:o[tn]}a&&(a(u),delete n.onTagObj);const m=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 V(e);return t?m.tag=t:u.default||(m.tag=u.tag),c&&(c.node=m),m}function Zi(e,t,n){let s=n;for(let r=t.length-1;r>=0;--r){const a=t[r];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){const o=[];o[a]=s,s=o}else s=new Map([[a,s]])}return Nr(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 Vs=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class hm extends jc{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=>fe(s)||he(s)?s.clone(t):s),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Vs(t))this.add(n);else{const[s,...r]=t,a=this.get(s,!0);if(de(a))a.addIn(r,n);else if(a===void 0&&this.schema)this.set(s,Zi(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(de(r))return r.deleteIn(s);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}getIn(t,n){const[s,...r]=t,a=this.get(s,!0);return r.length===0?!n&&ee(a)?a.value:a:de(a)?a.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!he(n))return!1;const s=n.value;return s==null||t&&ee(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 de(r)?r.hasIn(s):!1}setIn(t,n){const[s,...r]=t;if(r.length===0)this.set(s,n);else{const a=this.get(s,!0);if(de(a))a.setIn(r,n);else if(a===void 0&&this.schema)this.set(s,Zi(this.schema,r,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}}const gx=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Tt(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const yn=(e,t,n)=>e.endsWith(`
69
- `)?Tt(n,t):n.includes(`
70
- `)?`
71
- `+Tt(n,t):(e.endsWith(" ")?"":" ")+n,mm="flow",pl="block",Ni="quoted";function Na(e,t,n="flow",{indentAtStart:s,lineWidth:r=80,minContentWidth:a=20,onFold:o,onOverflow:l}={}){if(!r||r<0)return e;r<a&&(a=0);const c=Math.max(1+a,1+r-t.length);if(e.length<=c)return e;const u=[],m={};let d=r-t.length;typeof s=="number"&&(s>r-Math.max(2,a)?u.push(0):d=r-s);let p,y,b=!1,x=-1,j=-1,f=-1;n===pl&&(x=nd(e,x,t.length),x!==-1&&(d=x+c));for(let h;h=e[x+=1];){if(n===Ni&&h==="\\"){switch(j=x,e[x+1]){case"x":x+=3;break;case"u":x+=5;break;case"U":x+=9;break;default:x+=1}f=x}if(h===`
72
- `)n===pl&&(x=nd(e,x,t.length)),d=x+t.length+c,p=void 0;else{if(h===" "&&y&&y!==" "&&y!==`
73
- `&&y!==" "){const w=e[x+1];w&&w!==" "&&w!==`
74
- `&&w!==" "&&(p=x)}if(x>=d)if(p)u.push(p),d=p+c,p=void 0;else if(n===Ni){for(;y===" "||y===" ";)y=h,h=e[x+=1],b=!0;const w=x>f+1?x-2:j-1;if(m[w])return e;u.push(w),m[w]=!0,d=w+c,p=void 0}else b=!0}y=h}if(b&&l&&l(),u.length===0)return e;o&&o();let g=e.slice(0,u[0]);for(let h=0;h<u.length;++h){const w=u[h],k=u[h+1]||e.length;w===0?g=`
75
- ${t}${e.slice(0,k)}`:(n===Ni&&m[w]&&(g+=`${e[w]}\\`),g+=`
76
- ${t}${e.slice(w+1,k)}`)}return g}function nd(e,t,n){let s=t,r=t+1,a=e[r];for(;a===" "||a===" ";)if(t<r+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
77
- `);s=t,r=t+1,a=e[r]}return s}const Sa=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Ca=e=>/^(%|---|\.\.\.)/m.test(e);function yx(e,t,n){if(!t||t<0)return!1;const s=t-n,r=e.length;if(r<=s)return!1;for(let a=0,o=0;a<r;++a)if(e[a]===`
78
- `){if(a-o>s)return!0;if(o=a+1,r-o<=s)return!1}return!0}function rr(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:s}=t,r=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(Ca(e)?" ":"");let o="",l=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{o+=n.slice(l,c);const m=n.substr(c+2,4);switch(m){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:m.substr(0,2)==="00"?o+="\\x"+m.substr(2):o+=n.substr(c,6)}c+=5,l=c+1}break;case"n":if(s||n[c+2]==='"'||n.length<r)c+=1;else{for(o+=n.slice(l,c)+`
79
-
80
- `;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)o+=`
81
- `,c+=2;o+=a,n[c+2]===" "&&(o+="\\"),c+=1,l=c+1}break;default:c+=1}return o=l?o+n.slice(l):n,s?o:Na(o,a,Ni,Sa(t,!1))}function gl(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
82
- `)||/[ \t]\n|\n[ \t]/.test(e))return rr(e,t);const n=t.indent||(Ca(e)?" ":""),s="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
83
- ${n}`)+"'";return t.implicitKey?s:Na(s,n,mm,Sa(t,!1))}function Qn(e,t){const{singleQuote:n}=t.options;let s;if(n===!1)s=rr;else{const r=e.includes('"'),a=e.includes("'");r&&!a?s=gl:a&&!r?s=rr:s=n?gl:rr}return s(e,t)}let yl;try{yl=new RegExp(`(^|(?<!
84
- ))
85
- +(?!
86
- |$)`,"g")}catch{yl=/\n+(?!\n|$)/g}function Si({comment:e,type:t,value:n},s,r,a){const{blockQuote:o,commentString:l,lineWidth:c}=s.options;if(!o||/\n[\t ]+$/.test(n))return Qn(n,s);const u=s.indent||(s.forceBlockIndent||Ca(n)?" ":""),m=o==="literal"?!0:o==="folded"||t===V.BLOCK_FOLDED?!1:t===V.BLOCK_LITERAL?!0:!yx(n,c,u.length);if(!n)return m?`|
87
- `:`>
88
- `;let d,p;for(p=n.length;p>0;--p){const k=n[p-1];if(k!==`
89
- `&&k!==" "&&k!==" ")break}let y=n.substring(p);const b=y.indexOf(`
90
- `);b===-1?d="-":n===y||b!==y.length-1?(d="+",a&&a()):d="",y&&(n=n.slice(0,-y.length),y[y.length-1]===`
91
- `&&(y=y.slice(0,-1)),y=y.replace(yl,`$&${u}`));let x=!1,j,f=-1;for(j=0;j<n.length;++j){const k=n[j];if(k===" ")x=!0;else if(k===`
92
- `)f=j;else break}let g=n.substring(0,f<j?f+1:j);g&&(n=n.substring(g.length),g=g.replace(/\n+/g,`$&${u}`));let w=(x?u?"2":"1":"")+d;if(e&&(w+=" "+l(e.replace(/ ?[\r\n]+/g," ")),r&&r()),!m){const k=n.replace(/\n+/g,`
93
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`);let C=!1;const S=Sa(s,!0);o!=="folded"&&t!==V.BLOCK_FOLDED&&(S.onOverflow=()=>{C=!0});const N=Na(`${g}${k}${y}`,u,pl,S);if(!C)return`>${w}
94
- ${u}${N}`}return n=n.replace(/\n+/g,`$&${u}`),`|${w}
95
- ${u}${g}${n}${y}`}function xx(e,t,n,s){const{type:r,value:a}=e,{actualString:o,implicitKey:l,indent:c,indentStep:u,inFlow:m}=t;if(l&&a.includes(`
96
- `)||m&&/[[\]{},]/.test(a))return Qn(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return l||m||!a.includes(`
97
- `)?Qn(a,t):Si(e,t,n,s);if(!l&&!m&&r!==V.PLAIN&&a.includes(`
98
- `))return Si(e,t,n,s);if(Ca(a)){if(c==="")return t.forceBlockIndent=!0,Si(e,t,n,s);if(l&&c===u)return Qn(a,t)}const d=a.replace(/\n+/g,`$&
99
- ${c}`);if(o){const p=x=>{var j;return x.default&&x.tag!=="tag:yaml.org,2002:str"&&((j=x.test)==null?void 0:j.test(d))},{compat:y,tags:b}=t.doc.schema;if(b.some(p)||y!=null&&y.some(p))return Qn(a,t)}return l?d:Na(d,c,mm,Sa(t,!1))}function kc(e,t,n,s){const{implicitKey:r,inFlow:a}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:l}=e;l!==V.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=V.QUOTE_DOUBLE);const c=m=>{switch(m){case V.BLOCK_FOLDED:case V.BLOCK_LITERAL:return r||a?Qn(o.value,t):Si(o,t,n,s);case V.QUOTE_DOUBLE:return rr(o.value,t);case V.QUOTE_SINGLE:return gl(o.value,t);case V.PLAIN:return xx(o,t,n,s);default:return null}};let u=c(l);if(u===null){const{defaultKeyType:m,defaultStringType:d}=t.options,p=r&&m||d;if(u=c(p),u===null)throw new Error(`Unsupported default string type ${p}`)}return u}function pm(e,t){const n=Object.assign({blockQuote:!0,commentString:gx,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 vx(e,t){var r;if(t.tag){const a=e.filter(o=>o.tag===t.tag);if(a.length>0)return a.find(o=>o.format===t.format)??a[0]}let n,s;if(ee(t)){s=t.value;let a=e.filter(o=>{var l;return(l=o.identify)==null?void 0:l.call(o,s)});if(a.length>1){const o=a.filter(l=>l.test);o.length>0&&(a=o)}n=a.find(o=>o.format===t.format)??a.find(o=>!o.format)}else s=t,n=e.find(a=>a.nodeClass&&s instanceof a.nodeClass);if(!n){const a=((r=s==null?void 0:s.constructor)==null?void 0:r.name)??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${a} value`)}return n}function bx(e,t,{anchors:n,doc:s}){if(!s.directives)return"";const r=[],a=(ee(e)||de(e))&&e.anchor;a&&cm(a)&&(n.add(a),r.push(`&${a}`));const o=e.tag??(t.default?null:t.tag);return o&&r.push(s.directives.tagString(o)),r.join(" ")}function ms(e,t,n,s){var c;if(he(e))return e.toString(t,n,s);if(ws(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 a=fe(e)?e:t.doc.createNode(e,{onTagObj:u=>r=u});r??(r=vx(t.doc.schema.tags,a));const o=bx(a,r,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const l=typeof r.stringify=="function"?r.stringify(a,t,n,s):ee(a)?kc(a,t,n,s):a.toString(t,n,s);return o?ee(a)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
100
- ${t.indent}${l}`:l}function jx({key:e,value:t},n,s,r){const{allNullValues:a,doc:o,indent:l,indentStep:c,options:{commentString:u,indentSeq:m,simpleKeys:d}}=n;let p=fe(e)&&e.comment||null;if(d){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(de(e)||!fe(e)&&typeof e=="object"){const S="With simple keys, collection cannot be used as a key value";throw new Error(S)}}let y=!d&&(!e||p&&t==null&&!n.inFlow||de(e)||(ee(e)?e.type===V.BLOCK_FOLDED||e.type===V.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!y&&(d||!a),indent:l+c});let b=!1,x=!1,j=ms(e,n,()=>b=!0,()=>x=!0);if(!y&&!n.inFlow&&j.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(a||t==null)return b&&s&&s(),j===""?"?":y?`? ${j}`:j}else if(a&&!d||t==null&&y)return j=`? ${j}`,p&&!b?j+=yn(j,n.indent,u(p)):x&&r&&r(),j;b&&(p=null),y?(p&&(j+=yn(j,n.indent,u(p))),j=`? ${j}
101
- ${l}:`):(j=`${j}:`,p&&(j+=yn(j,n.indent,u(p))));let f,g,h;fe(t)?(f=!!t.spaceBefore,g=t.commentBefore,h=t.comment):(f=!1,g=null,h=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!y&&!p&&ee(t)&&(n.indentAtStart=j.length+1),x=!1,!m&&c.length>=2&&!n.inFlow&&!y&&Or(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let w=!1;const k=ms(t,n,()=>w=!0,()=>x=!0);let C=" ";if(p||f||g){if(C=f?`
102
- `:"",g){const S=u(g);C+=`
103
- ${Tt(S,n.indent)}`}k===""&&!n.inFlow?C===`
104
- `&&h&&(C=`
105
-
106
- `):C+=`
107
- ${n.indent}`}else if(!y&&de(t)){const S=k[0],N=k.indexOf(`
108
- `),T=N!==-1,A=n.inFlow??t.flow??t.items.length===0;if(T||!A){let M=!1;if(T&&(S==="&"||S==="!")){let U=k.indexOf(" ");S==="&"&&U!==-1&&U<N&&k[U+1]==="!"&&(U=k.indexOf(" ",U+1)),(U===-1||N<U)&&(M=!0)}M||(C=`
109
- ${n.indent}`)}}else(k===""||k[0]===`
110
- `)&&(C="");return j+=C+k,n.inFlow?w&&s&&s():h&&!w?j+=yn(j,n.indent,u(h)):x&&r&&r(),j}function gm(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const ni="<<",Lt={identify:e=>e===ni||typeof e=="symbol"&&e.description===ni,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new V(Symbol(ni)),{addToJSMap:ym}),stringify:()=>ni},wx=(e,t)=>(Lt.identify(t)||ee(t)&&(!t.type||t.type===V.PLAIN)&&Lt.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Lt.tag&&n.default));function ym(e,t,n){const s=xm(e,n);if(Or(s))for(const r of s.items)io(e,t,r);else if(Array.isArray(s))for(const r of s)io(e,t,r);else io(e,t,s)}function io(e,t,n){const s=xm(e,n);if(!Mr(s))throw new Error("Merge sources must be maps or map aliases");const r=s.toJSON(null,e,Map);for(const[a,o]of r)t instanceof Map?t.has(a)||t.set(a,o):t instanceof Set?t.add(a):Object.prototype.hasOwnProperty.call(t,a)||Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function xm(e,t){return e&&ws(t)?t.resolve(e.doc,e):t}function vm(e,t,{key:n,value:s}){if(fe(n)&&n.addToJSMap)n.addToJSMap(e,t,s);else if(wx(e,n))ym(e,t,s);else{const r=et(n,"",e);if(t instanceof Map)t.set(r,et(s,r,e));else if(t instanceof Set)t.add(r);else{const a=kx(n,r,e),o=et(s,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function kx(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(fe(e)&&(n!=null&&n.doc)){const s=pm(n.doc,{});s.anchors=new Set;for(const a of n.anchors.keys())s.anchors.add(a.anchor);s.inFlow=!0,s.inStringifyKey=!0;const r=e.toString(s);if(!n.mapKeyWarned){let a=JSON.stringify(r);a.length>40&&(a=a.substring(0,36)+'..."'),gm(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Nc(e,t,n){const s=Nr(e,void 0,n),r=Nr(t,void 0,n);return new Ie(s,r)}class Ie{constructor(t,n=null){Object.defineProperty(this,st,{value:om}),this.key=t,this.value=n}clone(t){let{key:n,value:s}=this;return fe(n)&&(n=n.clone(t)),fe(s)&&(s=s.clone(t)),new Ie(n,s)}toJSON(t,n){const s=n!=null&&n.mapAsMap?new Map:{};return vm(n,s,this)}toString(t,n,s){return t!=null&&t.doc?jx(this,t,n,s):JSON.stringify(this)}}function bm(e,t,n){return(t.inFlow??e.flow?Sx:Nx)(e,t,n)}function Nx({comment:e,items:t},n,{blockItemPrefix:s,flowChars:r,itemIndent:a,onChompKeep:o,onComment:l}){const{indent:c,options:{commentString:u}}=n,m=Object.assign({},n,{indent:a,type:null});let d=!1;const p=[];for(let b=0;b<t.length;++b){const x=t[b];let j=null;if(fe(x))!d&&x.spaceBefore&&p.push(""),ea(n,p,x.commentBefore,d),x.comment&&(j=x.comment);else if(he(x)){const g=fe(x.key)?x.key:null;g&&(!d&&g.spaceBefore&&p.push(""),ea(n,p,g.commentBefore,d))}d=!1;let f=ms(x,m,()=>j=null,()=>d=!0);j&&(f+=yn(f,a,u(j))),d&&j&&(d=!1),p.push(s+f)}let y;if(p.length===0)y=r.start+r.end;else{y=p[0];for(let b=1;b<p.length;++b){const x=p[b];y+=x?`
111
- ${c}${x}`:`
112
- `}}return e?(y+=`
113
- `+Tt(u(e),c),l&&l()):d&&o&&o(),y}function Sx({items:e},t,{flowChars:n,itemIndent:s}){const{indent:r,indentStep:a,flowCollectionPadding:o,options:{commentString:l}}=t;s+=a;const c=Object.assign({},t,{indent:s,inFlow:!0,type:null});let u=!1,m=0;const d=[];for(let b=0;b<e.length;++b){const x=e[b];let j=null;if(fe(x))x.spaceBefore&&d.push(""),ea(t,d,x.commentBefore,!1),x.comment&&(j=x.comment);else if(he(x)){const g=fe(x.key)?x.key:null;g&&(g.spaceBefore&&d.push(""),ea(t,d,g.commentBefore,!1),g.comment&&(u=!0));const h=fe(x.value)?x.value:null;h?(h.comment&&(j=h.comment),h.commentBefore&&(u=!0)):x.value==null&&(g!=null&&g.comment)&&(j=g.comment)}j&&(u=!0);let f=ms(x,c,()=>j=null);u||(u=d.length>m||f.includes(`
114
- `)),b<e.length-1?f+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(u||(u=d.reduce((g,h)=>g+h.length+2,2)+(f.length+2)>t.options.lineWidth)),u&&(f+=",")),j&&(f+=yn(f,s,l(j))),d.push(f),m=d.length}const{start:p,end:y}=n;if(d.length===0)return p+y;if(!u){const b=d.reduce((x,j)=>x+j.length+2,2);u=t.options.lineWidth>0&&b>t.options.lineWidth}if(u){let b=p;for(const x of d)b+=x?`
115
- ${a}${r}${x}`:`
116
- `;return`${b}
117
- ${r}${y}`}else return`${p}${o}${d.join(" ")}${o}${y}`}function ea({indent:e,options:{commentString:t}},n,s,r){if(s&&r&&(s=s.replace(/^\n+/,"")),s){const a=Tt(t(s),e);n.push(a.trimStart())}}function xn(e,t){const n=ee(t)?t.value:t;for(const s of e)if(he(s)&&(s.key===t||s.key===n||ee(s.key)&&s.key.value===n))return s}class Je extends hm{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(tn,t),this.items=[]}static from(t,n,s){const{keepUndefined:r,replacer:a}=s,o=new this(t),l=(c,u)=>{if(typeof a=="function")u=a.call(n,c,u);else if(Array.isArray(a)&&!a.includes(c))return;(u!==void 0||r)&&o.items.push(Nc(c,u,s))};if(n instanceof Map)for(const[c,u]of n)l(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))l(c,n[c]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){var o;let s;he(t)?s=t:!t||typeof t!="object"||!("key"in t)?s=new Ie(t,t==null?void 0:t.value):s=new Ie(t.key,t.value);const r=xn(this.items,s.key),a=(o=this.schema)==null?void 0:o.sortMapEntries;if(r){if(!n)throw new Error(`Key ${s.key} already set`);ee(r.value)&&fm(s.value)?r.value.value=s.value:r.value=s.value}else if(a){const l=this.items.findIndex(c=>a(s,c)<0);l===-1?this.items.push(s):this.items.splice(l,0,s)}else this.items.push(s)}delete(t){const n=xn(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const s=xn(this.items,t),r=s==null?void 0:s.value;return(!n&&ee(r)?r.value:r)??void 0}has(t){return!!xn(this.items,t)}set(t,n){this.add(new Ie(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 a of this.items)vm(n,r,a);return r}toString(t,n,s){if(!t)return JSON.stringify(this);for(const r of this.items)if(!he(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})),bm(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}}const Ns={collection:"map",default:!0,nodeClass:Je,tag:"tag:yaml.org,2002:map",resolve(e,t){return Mr(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Je.from(e,t,n)};class Cn extends hm{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(js,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=si(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const s=si(t);if(typeof s!="number")return;const r=this.items[s];return!n&&ee(r)?r.value:r}has(t){const n=si(t);return typeof n=="number"&&n<this.items.length}set(t,n){const s=si(t);if(typeof s!="number")throw new Error(`Expected a valid index, not ${t}.`);const r=this.items[s];ee(r)&&fm(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 a of this.items)s.push(et(a,String(r++),n));return s}toString(t,n,s){return t?bm(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,a=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let l of n){if(typeof r=="function"){const c=n instanceof Set?l:String(o++);l=r.call(n,c,l)}a.items.push(Nr(l,void 0,s))}}return a}}function si(e){let t=ee(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Ss={collection:"seq",default:!0,nodeClass:Cn,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Or(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Cn.from(e,t,n)},Ea={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),kc(e,t,n,s)}},Ta={identify:e=>e==null,createNode:()=>new V(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new V(null),stringify:({source:e},t)=>typeof e=="string"&&Ta.test.test(e)?e:t.options.nullStr},Sc={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new V(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Sc.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 ht({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 a=Object.is(s,-0)?"-0":JSON.stringify(s);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(a)&&!a.includes("e")){let o=a.indexOf(".");o<0&&(o=a.length,a+=".");let l=t-(a.length-o-1);for(;l-- >0;)a+="0"}return a}const jm={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:ht},wm={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():ht(e)}},km={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 V(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:ht},Aa=e=>typeof e=="bigint"||Number.isInteger(e),Cc=(e,t,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),n);function Nm(e,t,n){const{value:s}=e;return Aa(s)&&s>=0?n+s.toString(t):ht(e)}const Sm={identify:e=>Aa(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Cc(e,2,8,n),stringify:e=>Nm(e,8,"0o")},Cm={identify:Aa,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Cc(e,0,10,n),stringify:ht},Em={identify:e=>Aa(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Cc(e,2,16,n),stringify:e=>Nm(e,16,"0x")},Cx=[Ns,Ss,Ea,Ta,Sc,Sm,Cm,Em,jm,wm,km];function sd(e){return typeof e=="bigint"||Number.isInteger(e)}const ri=({value:e})=>JSON.stringify(e),Ex=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:ri},{identify:e=>e==null,createNode:()=>new V(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ri},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:ri},{identify:sd,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})=>sd(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:ri}],Tx={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Ax=[Ns,Ss].concat(Ex,Tx),Ec={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,a){if(!n)return"";const o=n;let l;if(typeof btoa=="function"){let c="";for(let u=0;u<o.length;++u)c+=String.fromCharCode(o[u]);l=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=V.BLOCK_LITERAL),t!==V.QUOTE_DOUBLE){const c=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),u=Math.ceil(l.length/c),m=new Array(u);for(let d=0,p=0;d<u;++d,p+=c)m[d]=l.substr(p,c);l=m.join(t===V.BLOCK_LITERAL?`
118
- `:" ")}return kc({comment:e,type:t,value:l},s,r,a)}};function Tm(e,t){if(Or(e))for(let n=0;n<e.items.length;++n){let s=e.items[n];if(!he(s)){if(Mr(s)){s.items.length>1&&t("Each pair must have its own sequence indicator");const r=s.items[0]||new Ie(new V(null));if(s.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${s.commentBefore}
119
- ${r.key.commentBefore}`:s.commentBefore),s.comment){const a=r.value??r.key;a.comment=a.comment?`${s.comment}
120
- ${a.comment}`:s.comment}s=r}e.items[n]=he(s)?s:new Ie(s)}}else t("Expected a sequence for this tag");return e}function Am(e,t,n){const{replacer:s}=n,r=new Cn(e);r.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof s=="function"&&(o=s.call(t,String(a++),o));let l,c;if(Array.isArray(o))if(o.length===2)l=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)l=u[0],c=o[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=o;r.items.push(Nc(l,c,n))}return r}const Tc={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Tm,createNode:Am};class rs extends Cn{constructor(){super(),this.add=Je.prototype.add.bind(this),this.delete=Je.prototype.delete.bind(this),this.get=Je.prototype.get.bind(this),this.has=Je.prototype.has.bind(this),this.set=Je.prototype.set.bind(this),this.tag=rs.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 a,o;if(he(r)?(a=et(r.key,"",n),o=et(r.value,a,n)):a=et(r,"",n),s.has(a))throw new Error("Ordered maps must not include duplicate keys");s.set(a,o)}return s}static from(t,n,s){const r=Am(t,n,s),a=new this;return a.items=r.items,a}}rs.tag="tag:yaml.org,2002:omap";const Ac={collection:"seq",identify:e=>e instanceof Map,nodeClass:rs,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=Tm(e,t),s=[];for(const{key:r}of n.items)ee(r)&&(s.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):s.push(r.value));return Object.assign(new rs,n)},createNode:(e,t,n)=>rs.from(e,t,n)};function Lm({value:e,source:t},n){return t&&(e?Pm:Im).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const Pm={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 V(!0),stringify:Lm},Im={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 V(!1),stringify:Lm},Lx={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:ht},Px={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():ht(e)}},Ix={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 V(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:ht},_r=e=>typeof e=="bigint"||Number.isInteger(e);function La(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 a=parseInt(e,n);return r==="-"?-1*a:a}function Lc(e,t,n){const{value:s}=e;if(_r(s)){const r=s.toString(t);return s<0?"-"+n+r.substr(1):n+r}return ht(e)}const Mx={identify:_r,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>La(e,2,2,n),stringify:e=>Lc(e,2,"0b")},Ox={identify:_r,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>La(e,1,8,n),stringify:e=>Lc(e,8,"0")},_x={identify:_r,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>La(e,0,10,n),stringify:ht},$x={identify:_r,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>La(e,2,16,n),stringify:e=>Lc(e,16,"0x")};class is extends Je{constructor(t){super(t),this.tag=is.tag}add(t){let n;he(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Ie(t.key,null):n=new Ie(t,null),xn(this.items,n.key)||this.items.push(n)}get(t,n){const s=xn(this.items,t);return!n&&he(s)?ee(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=xn(this.items,t);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new Ie(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,a=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),a.items.push(Nc(o,null,s));return a}}is.tag="tag:yaml.org,2002:set";const Pc={collection:"map",identify:e=>e instanceof Set,nodeClass:is,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>is.from(e,t,n),resolve(e,t){if(Mr(e)){if(e.hasAllNullValues(!0))return Object.assign(new is,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Ic(e,t){const n=e[0],s=n==="-"||n==="+"?e.substring(1):e,r=o=>t?BigInt(o):Number(o),a=s.replace(/_/g,"").split(":").reduce((o,l)=>o*r(60)+r(l),r(0));return n==="-"?r(-1)*a:a}function Mm(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return ht(e);let s="";t<0&&(s="-",t*=n(-1));const r=n(60),a=[t%r];return t<60?a.unshift(0):(t=(t-a[0])/r,a.unshift(t%r),t>=60&&(t=(t-a[0])/r,a.unshift(t))),s+a.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Om={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})=>Ic(e,n),stringify:Mm},_m={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=>Ic(e,!1),stringify:Mm},Pa={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(Pa.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,s,r,a,o,l]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,s-1,r,a||0,o||0,l||0,c);const m=t[8];if(m&&m!=="Z"){let d=Ic(m,!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$/,""))??""},rd=[Ns,Ss,Ea,Ta,Pm,Im,Mx,Ox,_x,$x,Lx,Px,Ix,Ec,Lt,Ac,Tc,Pc,Om,_m,Pa],id=new Map([["core",Cx],["failsafe",[Ns,Ss,Ea]],["json",Ax],["yaml11",rd],["yaml-1.1",rd]]),ad={binary:Ec,bool:Sc,float:km,floatExp:wm,floatNaN:jm,floatTime:_m,int:Cm,intHex:Em,intOct:Sm,intTime:Om,map:Ns,merge:Lt,null:Ta,omap:Ac,pairs:Tc,seq:Ss,set:Pc,timestamp:Pa},Dx={"tag:yaml.org,2002:binary":Ec,"tag:yaml.org,2002:merge":Lt,"tag:yaml.org,2002:omap":Ac,"tag:yaml.org,2002:pairs":Tc,"tag:yaml.org,2002:set":Pc,"tag:yaml.org,2002:timestamp":Pa};function ao(e,t,n){const s=id.get(t);if(s&&!e)return n&&!s.includes(Lt)?s.concat(Lt):s.slice();let r=s;if(!r)if(Array.isArray(e))r=[];else{const a=Array.from(id.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${a} or define customTags array`)}if(Array.isArray(e))for(const a of e)r=r.concat(a);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(Lt)),r.reduce((a,o)=>{const l=typeof o=="string"?ad[o]:o;if(!l){const c=JSON.stringify(o),u=Object.keys(ad).map(m=>JSON.stringify(m)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return a.includes(l)||a.push(l),a},[])}const Rx=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Mc{constructor({compat:t,customTags:n,merge:s,resolveKnownTags:r,schema:a,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(t)?ao(t,"compat"):t?ao(null,t):null,this.name=typeof a=="string"&&a||"core",this.knownTags=r?Dx:{},this.tags=ao(n,this.name,s),this.toStringOptions=l??null,Object.defineProperty(this,tn,{value:Ns}),Object.defineProperty(this,kt,{value:Ea}),Object.defineProperty(this,js,{value:Ss}),this.sortMapEntries=typeof o=="function"?o:o===!0?Rx:null}clone(){const t=Object.create(Mc.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function zx(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=pm(e,t),{commentString:a}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=a(e.commentBefore);n.unshift(Tt(u,""))}let o=!1,l=null;if(e.contents){if(fe(e.contents)){if(e.contents.spaceBefore&&s&&n.push(""),e.contents.commentBefore){const d=a(e.contents.commentBefore);n.push(Tt(d,""))}r.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>o=!0;let m=ms(e.contents,r,()=>l=null,u);l&&(m+=yn(m,"",a(l))),(m[0]==="|"||m[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${m}`:n.push(m)}else n.push(ms(e.contents,r));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=a(e.comment);u.includes(`
121
- `)?(n.push("..."),n.push(Tt(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&o&&(u=u.replace(/^\n+/,"")),u&&((!o||l)&&n[n.length-1]!==""&&n.push(""),n.push(Tt(a(u),"")))}return n.join(`
122
- `)+`
123
- `}class $r{constructor(t,n,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,st,{value:ml});let r=null;typeof n=="function"||Array.isArray(n)?r=n:s===void 0&&n&&(s=n,n=void 0);const a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=a;let{version:o}=a;s!=null&&s._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Le({version:o}),this.setSchema(o,s),this.contents=t===void 0?null:this.createNode(t,r,s)}clone(){const t=Object.create($r.prototype,{[st]:{value:ml}});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=fe(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){In(this.contents)&&this.contents.add(t)}addIn(t,n){In(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const s=um(this);t.anchor=!n||s.has(n)?dm(n||"a",s):n}return new wc(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 j=g=>typeof g=="number"||g instanceof String||g instanceof Number,f=n.filter(j).map(String);f.length>0&&(n=n.concat(f)),r=n}else s===void 0&&n&&(s=n,n=void 0);const{aliasDuplicateObjects:a,anchorPrefix:o,flow:l,keepUndefined:c,onTagObj:u,tag:m}=s??{},{onAnchor:d,setAnchors:p,sourceObjects:y}=hx(this,o||"a"),b={aliasDuplicateObjects:a??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:y},x=Nr(t,m,b);return l&&de(x)&&(x.flow=!0),p(),x}createPair(t,n,s={}){const r=this.createNode(t,null,s),a=this.createNode(n,null,s);return new Ie(r,a)}delete(t){return In(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Vs(t)?this.contents==null?!1:(this.contents=null,!0):In(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return de(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Vs(t)?!n&&ee(this.contents)?this.contents.value:this.contents:de(this.contents)?this.contents.getIn(t,n):void 0}has(t){return de(this.contents)?this.contents.has(t):!1}hasIn(t){return Vs(t)?this.contents!==void 0:de(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Zi(this.schema,[t],n):In(this.contents)&&this.contents.set(t,n)}setIn(t,n){Vs(t)?this.contents=n:this.contents==null?this.contents=Zi(this.schema,Array.from(t),n):In(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 Le({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 Le({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 Mc(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:a,reviver:o}={}){const l={anchors:new Map,doc:this,keep:!t,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=et(this.contents,n??"",l);if(typeof a=="function")for(const{count:u,res:m}of l.anchors.values())a(m,u);return typeof o=="function"?Yn(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 zx(this,t)}}function In(e){if(de(e))return!0;throw new Error("Expected a YAML collection as document contents")}class $m extends Error{constructor(t,n,s,r){super(),this.name=t,this.code=s,this.message=r,this.pos=n}}class Ks extends $m{constructor(t,n,s){super("YAMLParseError",t,n,s)}}class Fx extends $m{constructor(t,n,s){super("YAMLWarning",t,n,s)}}const od=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>t.linePos(l));const{line:s,col:r}=n.linePos[0];n.message+=` at line ${s}, column ${r}`;let a=r-1,o=e.substring(t.lineStarts[s-1],t.lineStarts[s]).replace(/[\n\r]+$/,"");if(a>=60&&o.length>80){const l=Math.min(a-39,o.length-79);o="…"+o.substring(l),a-=l-1}if(o.length>80&&(o=o.substring(0,79)+"…"),s>1&&/^ *$/.test(o.substring(0,a))){let l=e.substring(t.lineStarts[s-2],t.lineStarts[s-1]);l.length>80&&(l=l.substring(0,79)+`…
124
- `),o=l+o}if(/[^ ]/.test(o)){let l=1;const c=n.linePos[1];(c==null?void 0:c.line)===s&&c.col>r&&(l=Math.max(1,Math.min(c.col-r,80-a)));const u=" ".repeat(a)+"^".repeat(l);n.message+=`:
125
-
126
- ${o}
127
- ${u}
128
- `}};function ps(e,{flow:t,indicator:n,next:s,offset:r,onError:a,parentIndent:o,startOnNewline:l}){let c=!1,u=l,m=l,d="",p="",y=!1,b=!1,x=null,j=null,f=null,g=null,h=null,w=null,k=null;for(const N of e)switch(b&&(N.type!=="space"&&N.type!=="newline"&&N.type!=="comma"&&a(N.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b=!1),x&&(u&&N.type!=="comment"&&N.type!=="newline"&&a(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),x=null),N.type){case"space":!t&&(n!=="doc-start"||(s==null?void 0:s.type)!=="flow-collection")&&N.source.includes(" ")&&(x=N),m=!0;break;case"comment":{m||a(N,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const T=N.source.substring(1)||" ";d?d+=p+T:d=T,p="",u=!1;break}case"newline":u?d?d+=N.source:(!w||n!=="seq-item-ind")&&(c=!0):p+=N.source,u=!0,y=!0,(j||f)&&(g=N),m=!0;break;case"anchor":j&&a(N,"MULTIPLE_ANCHORS","A node can have at most one anchor"),N.source.endsWith(":")&&a(N.offset+N.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),j=N,k??(k=N.offset),u=!1,m=!1,b=!0;break;case"tag":{f&&a(N,"MULTIPLE_TAGS","A node can have at most one tag"),f=N,k??(k=N.offset),u=!1,m=!1,b=!0;break}case n:(j||f)&&a(N,"BAD_PROP_ORDER",`Anchors and tags must be after the ${N.source} indicator`),w&&a(N,"UNEXPECTED_TOKEN",`Unexpected ${N.source} in ${t??"collection"}`),w=N,u=n==="seq-item-ind"||n==="explicit-key-ind",m=!1;break;case"comma":if(t){h&&a(N,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),h=N,u=!1,m=!1;break}default:a(N,"UNEXPECTED_TOKEN",`Unexpected ${N.type} token`),u=!1,m=!1}const C=e[e.length-1],S=C?C.offset+C.source.length:r;return b&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&a(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")&&a(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:h,found:w,spaceBefore:c,comment:d,hasNewline:y,anchor:j,tag:f,newlineAfterProp:g,end:S,start:k??S}}function Sr(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(Sr(t.key)||Sr(t.value))return!0}return!1;default:return!0}}function xl(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const s=t.end[0];s.indent===e&&(s.source==="]"||s.source==="}")&&Sr(t)&&n(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Dm(e,t,n){const{uniqueKeys:s}=e.options;if(s===!1)return!1;const r=typeof s=="function"?s:(a,o)=>a===o||ee(a)&&ee(o)&&a.value===o.value;return t.some(a=>r(a.key,n))}const ld="All mapping items must start at the same column";function Bx({composeNode:e,composeEmptyNode:t},n,s,r,a){var m;const o=(a==null?void 0:a.nodeClass)??Je,l=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=s.offset,u=null;for(const d of s.items){const{start:p,key:y,sep:b,value:x}=d,j=ps(p,{indicator:"explicit-key-ind",next:y??(b==null?void 0:b[0]),offset:c,onError:r,parentIndent:s.indent,startOnNewline:!0}),f=!j.found;if(f){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",ld)),!j.anchor&&!j.tag&&!b){u=j.end,j.comment&&(l.comment?l.comment+=`
130
- `+j.comment:l.comment=j.comment);continue}(j.newlineAfterProp||Sr(y))&&r(y??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((m=j.found)==null?void 0:m.indent)!==s.indent&&r(c,"BAD_INDENT",ld);n.atKey=!0;const g=j.end,h=y?e(n,y,j,r):t(n,g,p,null,j,r);n.schema.compat&&xl(s.indent,y,r),n.atKey=!1,Dm(n,l.items,h)&&r(g,"DUPLICATE_KEY","Map keys must be unique");const w=ps(b??[],{indicator:"map-value-ind",next:x,offset:h.range[2],onError:r,parentIndent:s.indent,startOnNewline:!y||y.type==="block-scalar"});if(c=w.end,w.found){f&&((x==null?void 0:x.type)==="block-map"&&!w.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&j.start<w.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,w,r):t(n,c,b,null,w,r);n.schema.compat&&xl(s.indent,x,r),c=k.range[2];const C=new Ie(h,k);n.options.keepSourceTokens&&(C.srcToken=d),l.items.push(C)}else{f&&r(h.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),w.comment&&(h.comment?h.comment+=`
131
- `+w.comment:h.comment=w.comment);const k=new Ie(h);n.options.keepSourceTokens&&(k.srcToken=d),l.items.push(k)}}return u&&u<c&&r(u,"IMPOSSIBLE","Map comment with trailing content"),l.range=[s.offset,c,u??c],l}function Ux({composeNode:e,composeEmptyNode:t},n,s,r,a){const o=(a==null?void 0:a.nodeClass)??Cn,l=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=s.offset,u=null;for(const{start:m,value:d}of s.items){const p=ps(m,{indicator:"seq-item-ind",next:d,offset:c,onError:r,parentIndent:s.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||d)(d==null?void 0:d.type)==="block-seq"?r(p.end,"BAD_INDENT","All sequence items must start at the same column"):r(c,"MISSING_CHAR","Sequence item without - indicator");else{u=p.end,p.comment&&(l.comment=p.comment);continue}const y=d?e(n,d,p,r):t(n,p.end,m,null,p,r);n.schema.compat&&xl(s.indent,d,r),c=y.range[2],l.items.push(y)}return l.range=[s.offset,c,u??c],l}function Dr(e,t,n,s){let r="";if(e){let a=!1,o="";for(const l of e){const{source:c,type:u}=l;switch(u){case"space":a=!0;break;case"comment":{n&&!a&&s(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const m=c.substring(1)||" ";r?r+=o+m:r=m,o="";break}case"newline":r&&(o+=c),a=!0;break;default:s(l,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}t+=c.length}}return{comment:r,offset:t}}const oo="Block collections are not allowed within flow collections",lo=e=>e&&(e.type==="block-map"||e.type==="block-seq");function Wx({composeNode:e,composeEmptyNode:t},n,s,r,a){var j;const o=s.start.source==="{",l=o?"flow map":"flow sequence",c=(a==null?void 0:a.nodeClass)??(o?Je:Cn),u=new c(n.schema);u.flow=!0;const m=n.atRoot;m&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=s.offset+s.start.source.length;for(let f=0;f<s.items.length;++f){const g=s.items[f],{start:h,key:w,sep:k,value:C}=g,S=ps(h,{flow:l,indicator:"explicit-key-ind",next:w??(k==null?void 0:k[0]),offset:d,onError:r,parentIndent:s.indent,startOnNewline:!1});if(!S.found){if(!S.anchor&&!S.tag&&!k&&!C){f===0&&S.comma?r(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):f<s.items.length-1&&r(S.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),S.comment&&(u.comment?u.comment+=`
132
- `+S.comment:u.comment=S.comment),d=S.end;continue}!o&&n.options.strict&&Sr(w)&&r(w,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(f===0)S.comma&&r(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(S.comma||r(S.start,"MISSING_CHAR",`Missing , between ${l} items`),S.comment){let N="";e:for(const T of h)switch(T.type){case"comma":case"space":break;case"comment":N=T.source.substring(1);break e;default:break e}if(N){let T=u.items[u.items.length-1];he(T)&&(T=T.value??T.key),T.comment?T.comment+=`
133
- `+N:T.comment=N,S.comment=S.comment.substring(N.length+1)}}if(!o&&!k&&!S.found){const N=C?e(n,C,S,r):t(n,S.end,k,null,S,r);u.items.push(N),d=N.range[2],lo(C)&&r(N.range,"BLOCK_IN_FLOW",oo)}else{n.atKey=!0;const N=S.end,T=w?e(n,w,S,r):t(n,N,h,null,S,r);lo(w)&&r(T.range,"BLOCK_IN_FLOW",oo),n.atKey=!1;const A=ps(k??[],{flow:l,indicator:"map-value-ind",next:C,offset:T.range[2],onError:r,parentIndent:s.indent,startOnNewline:!1});if(A.found){if(!o&&!S.found&&n.options.strict){if(k)for(const W of k){if(W===A.found)break;if(W.type==="newline"){r(W,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}S.start<A.found.offset-1024&&r(A.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else C&&("source"in C&&((j=C.source)==null?void 0:j[0])===":"?r(C,"MISSING_CHAR",`Missing space after : in ${l}`):r(A.start,"MISSING_CHAR",`Missing , or : between ${l} items`));const M=C?e(n,C,A,r):A.found?t(n,A.end,k,null,A,r):null;M?lo(C)&&r(M.range,"BLOCK_IN_FLOW",oo):A.comment&&(T.comment?T.comment+=`
134
- `+A.comment:T.comment=A.comment);const U=new Ie(T,M);if(n.options.keepSourceTokens&&(U.srcToken=g),o){const W=u;Dm(n,W.items,T)&&r(N,"DUPLICATE_KEY","Map keys must be unique"),W.items.push(U)}else{const W=new Je(n.schema);W.flow=!0,W.items.push(U);const E=(M??T).range;W.range=[T.range[0],E[1],E[2]],u.items.push(W)}d=M?M.range[2]:A.end}}const p=o?"}":"]",[y,...b]=s.end;let x=d;if((y==null?void 0:y.source)===p)x=y.offset+y.source.length;else{const f=l[0].toUpperCase()+l.substring(1),g=m?`${f} must end with a ${p}`:`${f} in block collection must be sufficiently indented and end with a ${p}`;r(d,m?"MISSING_CHAR":"BAD_INDENT",g),y&&y.source.length!==1&&b.unshift(y)}if(b.length>0){const f=Dr(b,x,n.options.strict,r);f.comment&&(u.comment?u.comment+=`
135
- `+f.comment:u.comment=f.comment),u.range=[s.offset,x,f.offset]}else u.range=[s.offset,x,x];return u}function co(e,t,n,s,r,a){const o=n.type==="block-map"?Bx(e,t,n,s,a):n.type==="block-seq"?Ux(e,t,n,s,a):Wx(e,t,n,s,a),l=o.constructor;return r==="!"||r===l.tagName?(o.tag=l.tagName,o):(r&&(o.tag=r),o)}function Hx(e,t,n,s,r){var p;const a=s.tag,o=a?t.directives.tagName(a.source,y=>r(a,"TAG_RESOLVE_FAILED",y)):null;if(n.type==="block-seq"){const{anchor:y,newlineAfterProp:b}=s,x=y&&a?y.offset>a.offset?y:a:y??a;x&&(!b||b.offset<x.offset)&&r(x,"MISSING_CHAR","Missing newline after block sequence props")}const l=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!a||!o||o==="!"||o===Je.tagName&&l==="map"||o===Cn.tagName&&l==="seq")return co(e,t,n,r,o);let c=t.schema.tags.find(y=>y.tag===o&&y.collection===l);if(!c){const y=t.schema.knownTags[o];if((y==null?void 0:y.collection)===l)t.schema.tags.push(Object.assign({},y,{default:!1})),c=y;else return y?r(a,"BAD_COLLECTION_TYPE",`${y.tag} used for ${l} collection, but expects ${y.collection??"scalar"}`,!0):r(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),co(e,t,n,r,o)}const u=co(e,t,n,r,o,c),m=((p=c.resolve)==null?void 0:p.call(c,u,y=>r(a,"TAG_RESOLVE_FAILED",y),t.options))??u,d=fe(m)?m:new V(m);return d.range=u.range,d.tag=o,c!=null&&c.format&&(d.format=c.format),d}function Vx(e,t,n){const s=t.offset,r=Kx(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[s,s,s]};const a=r.mode===">"?V.BLOCK_FOLDED:V.BLOCK_LITERAL,o=t.source?Gx(t.source):[];let l=o.length;for(let x=o.length-1;x>=0;--x){const j=o[x][1];if(j===""||j==="\r")l=x;else break}if(l===0){const x=r.chomp==="+"&&o.length>0?`
136
- `.repeat(Math.max(1,o.length-1)):"";let j=s+r.length;return t.source&&(j+=t.source.length),{value:x,type:a,comment:r.comment,range:[s,j,j]}}let c=t.indent+r.indent,u=t.offset+r.length,m=0;for(let x=0;x<l;++x){const[j,f]=o[x];if(f===""||f==="\r")r.indent===0&&j.length>c&&(c=j.length);else{j.length<c&&n(u+j.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(c=j.length),m=x,c===0&&!e.atRoot&&n(u,"BAD_INDENT","Block scalar values in collections must be indented");break}u+=j.length+f.length+1}for(let x=o.length-1;x>=l;--x)o[x][0].length>c&&(l=x+1);let d="",p="",y=!1;for(let x=0;x<m;++x)d+=o[x][0].slice(c)+`
137
- `;for(let x=m;x<l;++x){let[j,f]=o[x];u+=j.length+f.length+1;const g=f[f.length-1]==="\r";if(g&&(f=f.slice(0,-1)),f&&j.length<c){const w=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(u-f.length-(g?2:1),"BAD_INDENT",w),j=""}a===V.BLOCK_LITERAL?(d+=p+j.slice(c)+f,p=`
138
- `):j.length>c||f[0]===" "?(p===" "?p=`
139
- `:!y&&p===`
140
- `&&(p=`
141
-
142
- `),d+=p+j.slice(c)+f,p=`
143
- `,y=!0):f===""?p===`
144
- `?d+=`
145
- `:p=`
146
- `:(d+=p+f,p=" ",y=!1)}switch(r.chomp){case"-":break;case"+":for(let x=l;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:a,comment:r.comment,range:[s,b,b]}}function Kx({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],a=r[0];let o=0,l="",c=-1;for(let p=1;p<r.length;++p){const y=r[p];if(!l&&(y==="-"||y==="+"))l=y;else{const b=Number(y);!o&&b?o=b:c===-1&&(c=e+p)}}c!==-1&&s(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let u=!1,m="",d=r.length;for(let p=1;p<t.length;++p){const y=t[p];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,m=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:a,indent:o,chomp:l,comment:m,length:d}}function Gx(e){const t=e.split(/\n( *)/),n=t[0],s=n.match(/^( *)/),a=[s!=null&&s[1]?[s[1],n.slice(s[1].length)]:["",n]];for(let o=1;o<t.length;o+=2)a.push([t[o],t[o+1]]);return a}function qx(e,t,n){const{offset:s,type:r,source:a,end:o}=e;let l,c;const u=(p,y,b)=>n(s+p,y,b);switch(r){case"scalar":l=V.PLAIN,c=Yx(a,u);break;case"single-quoted-scalar":l=V.QUOTE_SINGLE,c=Qx(a,u);break;case"double-quoted-scalar":l=V.QUOTE_DOUBLE,c=Jx(a,u);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[s,s+a.length,s+a.length]}}const m=s+a.length,d=Dr(o,m,t,n);return{value:c,type:l,comment:d.comment,range:[s,m,d.offset]}}function Yx(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}`),Rm(e)}function Qx(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),Rm(e.slice(1,-1)).replace(/''/g,"'")}function Rm(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],a=" ",o=t.lastIndex;for(n.lastIndex=o;s=n.exec(e);)s[1]===""?a===`
153
- `?r+=a:a=`
154
- `:(r+=a+s[1],a=" "),o=n.lastIndex;const l=/[ \t]*(.*)/sy;return l.lastIndex=o,s=l.exec(e),r+a+((s==null?void 0:s[1])??"")}function Jx(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:a,offset:o}=Xx(e,s);n+=a,s=o}else if(r==="\\"){let a=e[++s];const o=Zx[a];if(o)n+=o;else if(a===`
157
- `)for(a=e[s+1];a===" "||a===" ";)a=e[++s+1];else if(a==="\r"&&e[s+1]===`
158
- `)for(a=e[++s+1];a===" "||a===" ";)a=e[++s+1];else if(a==="x"||a==="u"||a==="U"){const l=a==="x"?2:a==="u"?4:8;n+=e1(e,s+1,l,t),s+=l}else{const l=e.substr(s-1,2);t(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),n+=l}}else if(r===" "||r===" "){const a=s;let o=e[s+1];for(;o===" "||o===" ";)o=e[++s+1];o!==`
159
- `&&!(o==="\r"&&e[s+2]===`
160
- `)&&(n+=s>a?e.slice(a,s+1):r)}else n+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function Xx(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 Zx={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
165
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function e1(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 l=e.substr(t-2,n+2);return s(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}function zm(e,t,n,s){const{value:r,type:a,comment:o,range:l}=t.type==="block-scalar"?Vx(e,t,s):qx(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[kt]:c?u=t1(e.schema,r,c,n,s):t.type==="scalar"?u=n1(e,r,t,s):u=e.schema[kt];let m;try{const d=u.resolve(r,p=>s(n??t,"TAG_RESOLVE_FAILED",p),e.options);m=ee(d)?d:new V(d)}catch(d){const p=d instanceof Error?d.message:String(d);s(n??t,"TAG_RESOLVE_FAILED",p),m=new V(r)}return m.range=l,m.source=r,a&&(m.type=a),c&&(m.tag=c),u.format&&(m.format=u.format),o&&(m.comment=o),m}function t1(e,t,n,s,r){var l;if(n==="!")return e[kt];const a=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)a.push(c);else return c;for(const c of a)if((l=c.test)!=null&&l.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[kt])}function n1({atKey:e,directives:t,schema:n},s,r,a){const o=n.tags.find(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(s))})||n[kt];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(s))})??n[kt];if(o.tag!==l.tag){const c=t.tagString(o.tag),u=t.tagString(l.tag),m=`Value may be parsed as either ${c} or ${u}`;a(r,"TAG_RESOLVE_FAILED",m,!0)}}return o}function s1(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 r1={composeNode:Fm,composeEmptyNode:Oc};function Fm(e,t,n,s){const r=e.atKey,{spaceBefore:a,comment:o,anchor:l,tag:c}=n;let u,m=!0;switch(t.type){case"alias":u=i1(e,t,s),(l||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=zm(e,t,c,s),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=Hx(r1,e,t,n,s),l&&(u.anchor=l.source.substring(1))}catch(d){const p=d instanceof Error?d.message:String(d);s(t,"RESOURCE_EXHAUSTION",p)}break;default:{const d=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;s(t,"UNEXPECTED_TOKEN",d),m=!1}}return u??(u=Oc(e,t.offset,void 0,null,n,s)),l&&u.anchor===""&&s(l,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!ee(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"),a&&(u.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?u.comment=o:u.commentBefore=o),e.options.keepSourceTokens&&m&&(u.srcToken=t),u}function Oc(e,t,n,s,{spaceBefore:r,comment:a,anchor:o,tag:l,end:c},u){const m={type:"scalar",offset:s1(t,n,s),indent:-1,source:""},d=zm(e,m,l,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),a&&(d.comment=a,d.range[2]=c),d}function i1({options:e},{offset:t,source:n,end:s},r){const a=new wc(n.substring(1));a.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,l=Dr(s,o,e.strict,r);return a.range=[t,o,l.offset],l.comment&&(a.comment=l.comment),a}function a1(e,t,{offset:n,start:s,value:r,end:a},o){const l=Object.assign({_directives:t},e),c=new $r(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},m=ps(s,{indicator:"doc-start",next:r??(a==null?void 0:a[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});m.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!m.hasNewline&&o(m.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?Fm(u,r,m,o):Oc(u,m.end,s,null,m,o);const d=c.contents.range[2],p=Dr(a,d,!1,o);return p.comment&&(c.comment=p.comment),c.range=[n,d,p.offset],c}function $s(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 cd(e){var r;let t="",n=!1,s=!1;for(let a=0;a<e.length;++a){const o=e[a];switch(o[0]){case"#":t+=(t===""?"":s?`
166
-
167
- `:`
168
- `)+(o.substring(1)||" "),n=!0,s=!1;break;case"%":((r=e[a+1])==null?void 0:r[0])!=="#"&&(a+=1),n=!1;break;default:n||(s=!0),n=!1}}return{comment:t,afterEmptyLine:s}}class o1{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,s,r,a)=>{const o=$s(n);a?this.warnings.push(new Fx(o,s,r)):this.errors.push(new Ks(o,s,r))},this.directives=new Le({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:s,afterEmptyLine:r}=cd(this.prelude);if(s){const a=t.contents;if(n)t.comment=t.comment?`${t.comment}
169
- ${s}`:s;else if(r||t.directives.docStart||!a)t.commentBefore=s;else if(de(a)&&!a.flow&&a.items.length>0){let o=a.items[0];he(o)&&(o=o.key);const l=o.commentBefore;o.commentBefore=l?`${s}
170
- ${l}`:s}else{const o=a.commentBefore;a.commentBefore=o?`${s}
171
- ${o}`:s}}if(n){for(let a=0;a<this.errors.length;++a)t.errors.push(this.errors[a]);for(let a=0;a<this.warnings.length;++a)t.warnings.push(this.warnings[a])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:cd(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 a=$s(t);a[0]+=n,this.onError(a,"BAD_DIRECTIVE",s,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=a1(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 Ks($s(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 Ks($s(t),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const n=Dr(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 Ks($s(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 $r(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 Bm="\uFEFF",Um="",Wm="",vl="";function l1(e){switch(e){case Bm:return"byte-order-mark";case Um:return"doc-mode";case Wm:return"flow-error-end";case vl: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 at(e){switch(e){case void 0:case" ":case`
175
- `:case"\r":case" ":return!0;default:return!1}}const ud=new Set("0123456789ABCDEFabcdef"),c1=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),ii=new Set(",[]{}"),u1=new Set(` ,[]{}
176
- \r `),uo=e=>!e||u1.has(e);class d1{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==="...")&&at(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]===Bm&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,s=t.indexOf("#");for(;s!==-1;){const a=t[s-1];if(a===" "||a===" "){n=s-1;break}else s=t.indexOf("#",s+1)}for(;;){const a=t[n-1];if(a===" "||a===" ")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 Um,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==="...")&&at(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&&!at(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===":")&&at(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(uo),"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("..."))&&at(r[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield Wm,yield*this.parseLineStart();let a=0;for(;r[a]===",";)a+=yield*this.pushCount(1),a+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(a+=yield*this.pushIndicators(),r[a]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-a),"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(uo),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||at(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 a=0;for(;this.buffer[n-1-a]==="\\";)a+=1;if(a%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 a=this.continueScalar(r+1);if(a===-1)break;r=s.indexOf(`
183
- `,a)}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=>at(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,s;e:for(let a=this.pos;s=this.buffer[a];++a)switch(s){case" ":n+=1;break;case`
184
- `:t=a,n=0;break;case"\r":{const o=this.buffer[a+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 a=this.continueScalar(t+1);if(a===-1)break;t=this.buffer.indexOf(`
186
- `,a)}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 a=t-1,o=this.buffer[a];o==="\r"&&(o=this.buffer[--a]);const l=a;for(;o===" ";)o=this.buffer[--a];if(o===`
188
- `&&a>=this.pos&&a+1+n>l)t=a;else break}while(!0);return yield vl,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 a=this.buffer[s+1];if(at(a)||t&&ii.has(a))break;n=s}else if(at(r)){let a=this.buffer[s+1];if(r==="\r"&&(a===`
189
- `?(s+=1,r=`
190
- `,a=this.buffer[s+1]):n=s),a==="#"||t&&ii.has(a))break;if(r===`
191
- `){const o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(t&&ii.has(r))break;n=s}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield vl,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(uo),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,s=this.charAt(1);if(at(s)||n&&ii.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(;!at(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(c1.has(n))n=this.buffer[++t];else if(n==="%"&&ud.has(this.buffer[t+1])&&ud.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 f1{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,s=this.lineStarts.length;for(;n<s;){const a=n+s>>1;this.lineStarts[a]<t?n=a+1:s=a}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 Ft(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function dd(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 Hm(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 ai(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 Mn(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 ta(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 fd(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Ft(t.start,"explicit-key-ind")&&!Ft(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,Hm(t.value)?t.value.end?ta(t.value.end,t.sep):t.value.end=t.sep:ta(t.start,t.sep),delete t.sep)}class h1{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 d1,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=l1(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"&&fd(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&&dd(r.start)===-1&&(n.indent===0||r.start.every(a=>a.type!=="comment"||a.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":{dd(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=ai(this.peek(2)),s=Mn(n);let r;t.end?(r=t.end,r.push(this.sourceToken),delete t.end):r=[this.sourceToken];const a={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]=a}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,a=Array.isArray(r)?r[r.length-1]:void 0;(a==null?void 0:a.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],a=(s=r==null?void 0:r.value)==null?void 0:s.end;if(Array.isArray(a)){ta(a,n.start),a.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,a=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(a&&n.sep&&!n.value){const l=[];for(let c=0;c<n.sep.length;++c){const u=n.sep[c];switch(u.type){case"newline":l.push(c);break;case"space":break;case"comment":u.indent>t.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(o=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":a||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):a||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(Ft(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(Hm(n.key)&&!Ft(n.sep,"newline")){const l=Mn(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:l,key:c,sep:u}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Ft(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=Mn(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||a?t.items.push({start:o,key:null,sep:[this.sourceToken]}):Ft(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 l=this.flowScalar(this.type);a||n.value?(t.items.push({start:o,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Ft(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(l);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,a=Array.isArray(r)?r[r.length-1]:void 0;(a==null?void 0:a.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],a=(s=r==null?void 0:r.value)==null?void 0:s.end;if(Array.isArray(a)){ta(a,n.start),a.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||Ft(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=ai(s),a=Mn(r);fd(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const l={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}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=ai(t),s=Mn(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=ai(t),s=Mn(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 m1(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new f1||null,prettyErrors:t}}function p1(e,t={}){const{lineCounter:n,prettyErrors:s}=m1(t),r=new h1(n==null?void 0:n.addNewLine),a=new o1(t);let o=null;for(const l of a.compose(r.parse(e),!0,e.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new Ks(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&n&&(o.errors.forEach(od(e,n)),o.warnings.forEach(od(e,n))),o}function g1(e,t,n){let s;const r=p1(e,n);if(!r)return null;if(r.warnings.forEach(a=>gm(r.options.logLevel,a)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:s},n))}function y1(e,t,n){let s=null;if(Array.isArray(t)&&(s=t),e===void 0){const{keepUndefined:r}={};if(!r)return}return Ir(e)&&!s?e.toString(n):new $r(e,s,n).toString(n)}const x1=new Set(["daemon.host","daemon.port","app.port"]),v1=["js_evaluate","cookie_write"];function hd(e){const t=e.daemon??{},n=e.security??{},s=e.connectors??{},r=e.audit??{},a=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??[...v1],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(a.defaultFormat??"table")},app:{port:Number(o.port??9092)}}}function b1(e){return{daemon:{...e.daemon},security:{...e.security},connectors:{...e.connectors},audit:{...e.audit},output:{...e.output},app:{...e.app}}}function j1(){const[e,t]=v.useState(null),[n,s]=v.useState(null),[r,a]=v.useState([]),[o,l]=v.useState(!0),[c,u]=v.useState(!1),[m,d]=v.useState(null),[p,y]=v.useState(!1),[b,x]=v.useState(""),[j,f]=v.useState(!1),[g,h]=v.useState("");v.useEffect(()=>{Promise.all([B.getConfig(),B.getConnectors()]).then(([E,$])=>{const I=hd(E.config);t(I),s(structuredClone(I)),a($.connectors)}).catch(()=>{t(null),s(null)}).finally(()=>l(!1))},[]);const w=v.useMemo(()=>!e||!n?!1:JSON.stringify(e)!==JSON.stringify(n),[e,n]),k=v.useMemo(()=>{if(!e||!n)return 0;let E=0;for(const $ of Object.keys(n)){const I=e[$],z=n[$];for(const L of Object.keys(z))JSON.stringify(I[L])!==JSON.stringify(z[L])&&E++}return E},[e,n]),C=v.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 E=!1;try{for(const $ of Object.keys(n)){const I=e[$],z=n[$];for(const L of Object.keys(z)){const _=JSON.stringify(z[L]),R=JSON.stringify(I[L]??null);if(_!==R){const F=`${$}.${L}`,X=z[L];let ye;F==="security.approvalTimeoutMs"?ye=String(X):Array.isArray(X)?ye=JSON.stringify(X):ye=String(X),await B.setConfig(F,ye),x1.has(F)&&(E=!0)}}}t(structuredClone(n)),d({type:"success",msg:"Configuration saved."}),E&&y(!0)}catch($){d({type:"error",msg:$ instanceof Error?$.message:"Save failed"})}finally{u(!1),setTimeout(()=>d(null),3e3)}},[e,n]),S=v.useCallback(()=>{e&&s(structuredClone(e))},[e]),N=v.useCallback(()=>{!j&&n&&(x(y1(b1(n))),h("")),f(!j)},[j,n]),T=v.useCallback(()=>{try{const E=g1(b);if(!E||typeof E!="object")throw new Error("Invalid YAML");s(hd(E)),h("")}catch(E){h(E instanceof Error?E.message:"Invalid YAML")}},[b]),A=v.useCallback((E,$,I)=>{s(z=>z&&{...z,[E]:{...z[E],[$]:I}})},[]),M=v.useCallback((E,$,I)=>{s(z=>{if(!z)return z;const L=z[E],_=L[$]??[];return _.includes(I)?z:{...z,[E]:{...L,[$]:[..._,I]}}})},[]),U=v.useCallback((E,$,I)=>{s(z=>{if(!z)return z;const L=z[E],_=L[$]??[];return{...z,[E]:{...L,[$]:_.filter(R=>R!==I)}}})},[]),W=v.useMemo(()=>({updateField:A,addToArray:M,removeFromArray:U}),[A,M,U]);return o?i.jsx(wt,{label:"Loading configuration..."}):!n||!e?i.jsxs("div",{className:"max-w-3xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Configuration"}),i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-2",children:"No configuration found."}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Make sure the daemon is running. Configuration will appear here automatically."})]})]}):i.jsxs("div",{className:"max-w-3xl mx-auto pb-20",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Configuration"}),p&&i.jsxs("div",{className:"alert alert-warning mb-6",children:[i.jsxs("span",{children:["Some changes require a daemon restart to take effect. Restart with: ",i.jsx("code",{className:"font-mono text-sm",children:"cg down && cg up"})]}),i.jsx("button",{className:"btn btn-sm btn-ghost",onClick:()=>y(!1),children:"Dismiss"})]}),i.jsxs("div",{className:"space-y-8",children:[i.jsx("div",{id:"cfg-server",className:"scroll-mt-4",children:i.jsx(w1,{config:n,actions:W})}),i.jsx("div",{id:"cfg-security",className:"scroll-mt-4",children:i.jsx(k1,{config:n,connectors:r,actions:W})}),i.jsx("div",{id:"cfg-sources",className:"scroll-mt-4",children:i.jsx(N1,{config:n,actions:W})}),i.jsx("div",{id:"cfg-audit",className:"scroll-mt-4",children:i.jsx(S1,{config:n,actions:W})}),i.jsx("div",{id:"cfg-output",className:"scroll-mt-4",children:i.jsx(C1,{config:n,actions:W})}),i.jsx("div",{id:"cfg-journal",className:"scroll-mt-4",children:i.jsx(E1,{})})]}),i.jsxs("div",{className:"mt-8",children:[i.jsxs("button",{className:"btn btn-sm btn-ghost gap-1",onClick:N,children:[j?"▾":"▸"," Raw Configuration (YAML)"]}),j&&i.jsxs("div",{className:"mt-2 border border-base-300 p-4",children:[i.jsx("textarea",{className:"textarea textarea-bordered w-full font-mono text-sm",rows:16,value:b,onChange:E=>x(E.target.value)}),g&&i.jsx("p",{className:"text-error text-sm mt-1",children:g}),i.jsx("button",{className:"btn btn-sm btn-ghost mt-2",onClick:T,children:"Apply to form"})]})]}),w&&i.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:[i.jsxs("span",{className:"text-sm opacity-60",children:[k," unsaved ",k===1?"change":"changes"]}),i.jsxs("div",{className:"flex items-center gap-3",children:[m&&i.jsx("span",{className:`text-sm ${m.type==="success"?"text-success":"text-error"}`,children:m.msg}),i.jsx("button",{className:"btn btn-sm btn-ghost",onClick:S,children:"Discard"}),i.jsx("button",{className:"btn btn-sm btn-primary",onClick:C,disabled:c,children:c?"Saving...":"Save changes"})]})]})]})}function Cs({title:e,description:t,children:n}){return i.jsxs("div",{className:"border border-base-300 p-5",children:[i.jsx("h3",{className:"font-display font-semibold mb-1",children:e}),i.jsx("p",{className:"text-xs opacity-40 mb-5",children:t}),i.jsx("div",{className:"space-y-5",children:n})]})}function Re({label:e,help:t,restart:n,children:s}){return i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("div",{className:"w-48 shrink-0",children:[i.jsx("label",{className:"font-mono text-[0.7rem] font-medium uppercase tracking-wide",children:e}),n&&i.jsx("span",{className:"ml-1.5 tooltip tooltip-right","data-tip":"Requires daemon restart",children:i.jsx("span",{className:"text-xs opacity-40",children:"⟳"})})]}),i.jsx("div",{className:"flex-1",children:s})]}),i.jsx("p",{className:"text-xs opacity-40 mt-1 max-w-[12rem]",children:t})]})}function w1({config:e,actions:t}){const{updateField:n}=t;return i.jsxs(Cs,{title:"Server",description:"Daemon and app server binding configuration",children:[i.jsx(Re,{label:"Daemon Host",help:"IP address the daemon binds to",restart:!0,children:i.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)})}),i.jsx(Re,{label:"Daemon Port",help:"Port the daemon listens on",restart:!0,children:i.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))})}),i.jsx(Re,{label:"GUI Port",help:"Port the GUI app server listens on",restart:!0,children:i.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 md({values:e,onAdd:t,onRemove:n,placeholder:s}){const[r,a]=v.useState("");return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex flex-wrap gap-1 mb-1",children:e.map(o=>i.jsxs(K,{size:"sm",className:"gap-1",children:[o,i.jsx("button",{className:"text-xs opacity-50 hover:opacity-100",onClick:()=>n(o),children:"×"})]},o))}),i.jsxs("div",{className:"flex gap-1",children:[i.jsx("input",{type:"text",className:"input input-bordered input-xs flex-1",placeholder:s,value:r,onChange:o=>a(o.target.value),onKeyDown:o=>{o.key==="Enter"&&r.trim()&&(t(r.trim()),a(""))}}),i.jsx("button",{className:"btn btn-xs btn-ghost",onClick:()=>{r.trim()&&(t(r.trim()),a(""))},children:"Add"})]})]})}function k1({config:e,connectors:t,actions:n}){const{updateField:s,addToArray:r,removeFromArray:a}=n,o=new Set(e.security.highRiskCapabilities),l=v.useMemo(()=>wa(t),[t]);return i.jsxs(Cs,{title:"Connector Security",description:"Manage which connectors are approved and which capabilities require approval",children:[t.length>0&&i.jsx("div",{className:"overflow-x-auto mb-4",children:i.jsxs("table",{className:"table table-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Connector"}),i.jsx("th",{children:"Capabilities"}),i.jsx("th",{children:"Risk"}),i.jsx("th",{children:"Approved"}),i.jsx("th",{children:"Auto-Approve"})]})}),i.jsx("tbody",{children:l.map(([c,u])=>i.jsxs(v.Fragment,{children:[i.jsx("tr",{children:i.jsxs("td",{colSpan:5,className:"bg-base-200/50 font-mono font-semibold text-xs pt-3 pb-1",children:[c,i.jsxs("span",{className:"font-normal opacity-40 ml-2",children:[u.length," ",u.length===1?"connector":"connectors"]})]})}),u.map(m=>{const d=m.key.split("/")[1],p=m.capabilities.some(x=>o.has(x)),y=e.security.approvedHighRisk.includes(m.key),b=e.security.autoApproveConnectors.includes(m.key);return i.jsxs("tr",{children:[i.jsx("td",{className:"font-mono text-sm pl-6",children:d}),i.jsx("td",{children:i.jsx("div",{className:"flex flex-wrap gap-1",children:m.capabilities.map(x=>i.jsx(K,{variant:o.has(x)?"warning":"neutral",size:"xs",children:x},x))})}),i.jsx("td",{children:p?i.jsx(K,{variant:"warning",size:"xs",children:"High"}):i.jsx("span",{className:"opacity-40",children:"—"})}),i.jsx("td",{children:p?i.jsx("input",{type:"checkbox",className:"toggle toggle-sm toggle-success",checked:y,onChange:()=>y?a("security","approvedHighRisk",m.key):r("security","approvedHighRisk",m.key)}):i.jsx("span",{className:"opacity-40",children:"—"})}),i.jsx("td",{children:i.jsx("input",{type:"checkbox",className:"toggle toggle-sm",checked:b,title:"Skip approval prompts — pipeline steps execute without confirmation",onChange:()=>b?a("security","autoApproveConnectors",m.key):r("security","autoApproveConnectors",m.key)})})]},m.key)})]},c))})]})}),i.jsx(Re,{label:"High-Risk Capabilities",help:"Capabilities that require connector-level approval before first use",children:i.jsx(md,{values:e.security.highRiskCapabilities,onAdd:c=>r("security","highRiskCapabilities",c),onRemove:c=>a("security","highRiskCapabilities",c),placeholder:"Capability name"})}),i.jsx(Re,{label:"Step Approval Required",help:"Capabilities that pause for user confirmation at each pipeline step",children:i.jsx(md,{values:e.security.approvalRequired,onAdd:c=>r("security","approvalRequired",c),onRemove:c=>a("security","approvalRequired",c),placeholder:"Capability name"})}),i.jsx(Re,{label:"Approval Timeout (seconds)",help:"How long to wait for approval before aborting the pipeline",children:i.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)})}),i.jsx(Re,{label:"Extension ID",help:"Chrome extension ID for origin validation. Leave blank to accept any extension.",children:i.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 N1({config:e,actions:t}){const{addToArray:n,removeFromArray:s}=t,[r,a]=v.useState("");return i.jsxs(Cs,{title:"Connector Sources",description:"Directories to scan for connector YAML files",children:[i.jsx("div",{className:"space-y-1",children:e.connectors.paths.map((o,l)=>i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-mono text-sm flex-1",children:o}),i.jsx("button",{className:"btn btn-xs btn-ghost opacity-50 hover:opacity-100",onClick:()=>s("connectors","paths",o),children:"×"})]},l))}),i.jsxs("div",{className:"flex gap-1 mt-2",children:[i.jsx("input",{type:"text",className:"input input-bordered input-xs flex-1 font-mono",placeholder:"~/path/to/connectors",value:r,onChange:o=>a(o.target.value),onKeyDown:o=>{o.key==="Enter"&&r.trim()&&(n("connectors","paths",r.trim()),a(""))}}),i.jsx("button",{className:"btn btn-xs btn-ghost",onClick:()=>{r.trim()&&(n("connectors","paths",r.trim()),a(""))},children:"Add path"})]}),i.jsxs("p",{className:"text-xs opacity-40 mt-1",children:["Use ",i.jsx("code",{children:"~/"})," for home directory paths. Relative paths resolve from the install directory."]})]})}function S1({config:e,actions:t}){const{updateField:n}=t;return i.jsxs(Cs,{title:"Audit & Retention",description:"Audit log storage and cleanup settings",children:[i.jsx(Re,{label:"Retention Period",help:"Days to keep audit log entries before cleanup",children:i.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))})}),i.jsx(Re,{label:"Database Path",help:"Path to the audit SQLite database. Change only if you need a custom location.",children:i.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 C1({config:e,actions:t}){const{updateField:n}=t;return i.jsx(Cs,{title:"Output Defaults",description:"Default formatting for CLI output",children:i.jsx(Re,{label:"Default Output Format",help:"Format used when no --format flag is specified",children:i.jsxs("select",{className:"select select-bordered select-sm w-full",value:e.output.defaultFormat,onChange:s=>n("output","defaultFormat",s.target.value),children:[i.jsx("option",{value:"table",children:"table"}),i.jsx("option",{value:"json",children:"json"}),i.jsx("option",{value:"csv",children:"csv"})]})})})}function E1(){const[e,t]=v.useState(""),[n,s]=v.useState(""),[r,a]=v.useState(""),[o,l]=v.useState("40"),[c,u]=v.useState(!1),[m,d]=v.useState(!1);v.useEffect(()=>{B.getPreferences().then(y=>{if(!y.ok)return;const b=y.preferences;t(b["journal.author"]??""),s(b["journal.ado_org"]??""),a(b["journal.ado_repos"]??""),l(b["journal.target_hours"]??"40"),u(!0)}).catch(()=>u(!0))},[]);async function p(){await Promise.all([B.setPreference("journal.author",e),B.setPreference("journal.ado_org",n),B.setPreference("journal.ado_repos",r),B.setPreference("journal.target_hours",o)]),d(!0),setTimeout(()=>d(!1),2e3)}return c?i.jsxs(Cs,{title:"Journal Settings",description:"Configure your Dev Work Journal data sources",children:[i.jsx(Re,{label:"Author",help:"Your name or email as it appears in ADO commits (e.g. mun_hong.lee@mercedes-benz.com)",children:i.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)})}),i.jsx(Re,{label:"ADO Organization",help:"Azure DevOps organization name (e.g. daimler-mic)",children:i.jsx("input",{type:"text",className:"input input-bordered input-sm w-full",placeholder:"daimler-mic",value:n,onChange:y=>s(y.target.value)})}),i.jsx(Re,{label:"ADO Repos",help:'Comma-separated project/repo pairs (e.g. "mic-dns/mic-dns-api,mic-dns/mic-dns-ui")',children:i.jsx("input",{type:"text",className:"input input-bordered input-sm w-full font-mono",placeholder:"project/repo,project/repo",value:r,onChange:y=>a(y.target.value)})}),i.jsx(Re,{label:"Weekly Target Hours",help:"Target hours per week for the hours progress bar (default 40)",children:i.jsx("input",{type:"number",className:"input input-bordered input-sm w-20",min:1,max:80,value:o,onChange:y=>l(y.target.value)})}),i.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[i.jsx("button",{className:"btn btn-primary btn-sm",onClick:p,children:"Save Journal Settings"}),m&&i.jsx("span",{className:"text-success text-sm",children:"Saved ✓"})]})]}):null}const T1=i.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:i.jsx("path",{d:"M20 6 9 17l-5-5"})});function A1(){const[e,t]=v.useState(!1),[n,s]=v.useState(!1),[r,a]=v.useState(0),[o,l]=v.useState([]),[c,u]=v.useState([]),[m,d]=v.useState(null),p=v.useCallback(async()=>{try{const k=await B.getStatus();t(k.ok),s(k.extensionConnected),a(k.connectorCount)}catch{t(!1),s(!1),a(0)}try{const k=await B.getConnectors();l(k.connectors);const S=(await B.getConfig().catch(()=>({ok:!1,config:{}}))).config.security??{};u(S.approvedHighRisk??[])}catch{}},[]);v.useEffect(()=>{p();const k=setInterval(p,1e4);return()=>clearInterval(k)},[p]);const y=v.useCallback(async k=>{d(k);try{const C=[...c,k];await B.setConfig("security.approvedHighRisk",JSON.stringify(C)),p()}catch{}finally{d(null)}},[c,p]),b=o.filter(k=>k.isHighRisk&&!k.isApproved),x=b.length>0,j=[{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&&j.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 f=j.filter(k=>k.ok).length,g=j.length,h=f===g,w=v.useMemo(()=>wa(o),[o]);return i.jsxs("div",{className:"max-w-3xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"Setup Guide"}),i.jsx("p",{className:"text-sm opacity-60 mb-6",children:"Complete these steps to start running connectors from your browser."}),i.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[i.jsx("div",{className:"flex-1 h-1.5 bg-base-300 overflow-hidden",children:i.jsx("div",{className:"h-full bg-success transition-all duration-300 ease-out",style:{width:`${g>0?f/g*100:0}%`}})}),i.jsxs("span",{className:"font-mono text-xs opacity-50 shrink-0",children:[f,"/",g]})]}),i.jsx("div",{className:"space-y-3 mb-8",children:j.map((k,C)=>i.jsxs("div",{className:`border ${k.ok?"border-base-300":"border-base-300 bg-base-200/50"}`,children:[i.jsxs("div",{className:"p-4 flex items-center gap-3",children:[i.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?T1:C+1}),i.jsx("span",{className:"font-semibold flex-1",children:k.label}),i.jsx(K,{variant:k.ok?"success":"warning",children:k.detail})]}),!k.ok&&i.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&&i.jsx("div",{className:"mt-3 space-y-2",children:b.map(S=>i.jsxs("div",{className:"flex items-center justify-between gap-3 py-1.5",children:[i.jsxs("div",{children:[i.jsx("span",{className:"font-mono text-sm",children:S.key}),S.description&&i.jsx("span",{className:"text-xs opacity-50 ml-2",children:S.description})]}),i.jsx("button",{className:"btn btn-sm btn-warning btn-outline shrink-0",disabled:m===S.key,onClick:()=>y(S.key),children:m===S.key?"Authorizing…":"Authorize"})]},S.key))})]})]},C))}),h&&o.length>0&&i.jsxs("div",{className:"border border-success/30 bg-success/5 p-5",children:[i.jsx("p",{className:"font-semibold text-success mb-3",children:"Everything's ready. Pick a connector to try."}),i.jsx("div",{className:"space-y-3",children:w.map(([k,C])=>i.jsxs("div",{children:[i.jsx("span",{className:"font-mono font-semibold text-sm",children:k}),i.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:C.map(S=>{const N=S.key.split("/")[1];return i.jsx(we,{to:`/connectors/${k}/${N}`,className:"btn btn-sm btn-outline",children:i.jsx("span",{className:"font-mono",children:N})},S.key)})})]},k))})]}),!h&&o.length>0&&i.jsxs("div",{className:"border-t border-base-300 pt-6",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.12em] mb-4",children:"Installed connectors"}),i.jsx("div",{className:"space-y-4",children:w.map(([k,C])=>i.jsxs("div",{children:[i.jsx("div",{className:"font-mono font-semibold text-sm mb-1.5",children:k}),i.jsx("div",{className:"space-y-1",children:C.map(S=>{const N=S.key.split("/")[1];return i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-baseline gap-2",children:[i.jsx("span",{className:"font-mono text-sm",children:N}),i.jsx(K,{size:"xs",children:S.access})]}),S.description&&i.jsx("div",{className:"text-xs opacity-40 mb-1",children:S.description})]},S.key)})})]},k))}),i.jsx(we,{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 gs({message:e}){return i.jsx("div",{role:"alert",className:"alert alert-warning",children:i.jsx("span",{children:e??"Sign in to the target app in Chrome, then try again."})})}function Vm(e){const t=e.getDay();return t!==0&&t!==6}function L1(e){const[t,n]=e.split("-").map(Number),s=new Date(t,n,0).getDate();let r=0;for(let a=1;a<=s;a++)Vm(new Date(t,n-1,a))&&r++;return r}function P1(e,t){const[n,s]=e.split("-").map(Number),r=new Date(t+"T00:00:00"),a=new Date(n,s,0),o=r>a?a:r;let l=0;for(let c=1;c<=o.getDate();c++){const u=new Date(n,s-1,c);if(u>o)break;Vm(u)&&l++}return l}function I1(e){const{targetHours:t,actualHours:n,month:s,today:r}=e,a=L1(s),o=P1(s,r),l=a-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:a,workingDaysElapsed:o,workingDaysRemaining:l};const m=a>0?t/a*o:0,d=l>0?Math.max(0,(t-n)/l):0;let p;return n>=m?p="on_track":a>0&&o/a<.8?p="behind":p="at_risk",{status:p,percentage:c,daysRemaining:u,hoursPerDayNeeded:d,workingDaysTotal:a,workingDaysElapsed:o,workingDaysRemaining:l}}const M1={reached:"bg-success",on_track:"bg-success",behind:"bg-warning",at_risk:"bg-error"};function O1({percentage:e,status:t,className:n=""}){const s=Math.min(100,Math.max(0,e));return i.jsx("div",{className:`h-2 bg-base-300 ${n}`,children:i.jsx("div",{className:`h-full ${M1[t]} transition-[width] duration-150`,style:{width:`${s}%`}})})}/**
198
- * @license lucide-react v1.25.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 Km=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/**
203
- * @license lucide-react v1.25.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 _1=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
208
- * @license lucide-react v1.25.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 $1=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());/**
213
- * @license lucide-react v1.25.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 pd=e=>{const t=$1(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
218
- * @license lucide-react v1.25.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 fo={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.25.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 D1=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},R1=v.createContext({}),z1=()=>v.useContext(R1),F1=v.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:s,className:r="",children:a,iconNode:o,...l},c)=>{const{size:u=24,strokeWidth:m=2,absoluteStrokeWidth:d=!1,color:p="currentColor",className:y=""}=z1()??{},b=s??d?Number(n??m)*24/Number(t??u):n??m;return v.createElement("svg",{ref:c,...fo,width:t??u??fo.width,height:t??u??fo.height,stroke:e??p,strokeWidth:b,className:Km("lucide",y,r),...!a&&!D1(l)&&{"aria-hidden":"true"},...l},[...o.map(([x,j])=>v.createElement(x,j)),...Array.isArray(a)?a:[a]])});/**
228
- * @license lucide-react v1.25.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 H=(e,t)=>{const n=v.forwardRef(({className:s,...r},a)=>v.createElement(F1,{ref:a,iconNode:t,className:Km(`lucide-${_1(pd(e))}`,`lucide-${e}`,s),...r}));return n.displayName=pd(e),n};/**
233
- * @license lucide-react v1.25.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 B1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],qe=H("arrow-right",B1);/**
238
- * @license lucide-react v1.25.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 U1=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Gm=H("book-open",U1);/**
243
- * @license lucide-react v1.25.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 W1=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],H1=H("calendar-days",W1);/**
248
- * @license lucide-react v1.25.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 V1=[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M17 14h-6",key:"bkmgh3"}],["path",{d:"M13 18H7",key:"bb0bb7"}],["path",{d:"M7 14h.01",key:"1qa3f1"}],["path",{d:"M17 18h.01",key:"1bdyru"}]],K1=H("calendar-range",V1);/**
253
- * @license lucide-react v1.25.0 - ISC
254
- *
255
- * This source code is licensed under the ISC license.
256
- * See the LICENSE file in the root directory of this source tree.
257
- */const G1=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],q1=H("calendar",G1);/**
258
- * @license lucide-react v1.25.0 - ISC
259
- *
260
- * This source code is licensed under the ISC license.
261
- * See the LICENSE file in the root directory of this source tree.
262
- */const Y1=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Q1=H("chevron-down",Y1);/**
263
- * @license lucide-react v1.25.0 - ISC
264
- *
265
- * This source code is licensed under the ISC license.
266
- * See the LICENSE file in the root directory of this source tree.
267
- */const J1=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],X1=H("chevron-left",J1);/**
268
- * @license lucide-react v1.25.0 - ISC
269
- *
270
- * This source code is licensed under the ISC license.
271
- * See the LICENSE file in the root directory of this source tree.
272
- */const Z1=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ev=H("chevron-right",Z1);/**
273
- * @license lucide-react v1.25.0 - ISC
274
- *
275
- * This source code is licensed under the ISC license.
276
- * See the LICENSE file in the root directory of this source tree.
277
- */const tv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],_c=H("circle-alert",tv);/**
278
- * @license lucide-react v1.25.0 - ISC
279
- *
280
- * This source code is licensed under the ISC license.
281
- * See the LICENSE file in the root directory of this source tree.
282
- */const nv=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],$c=H("circle-check-big",nv);/**
283
- * @license lucide-react v1.25.0 - ISC
284
- *
285
- * This source code is licensed under the ISC license.
286
- * See the LICENSE file in the root directory of this source tree.
287
- */const sv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Dc=H("circle-check",sv);/**
288
- * @license lucide-react v1.25.0 - ISC
289
- *
290
- * This source code is licensed under the ISC license.
291
- * See the LICENSE file in the root directory of this source tree.
292
- */const rv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],qm=H("circle-x",rv);/**
293
- * @license lucide-react v1.25.0 - ISC
294
- *
295
- * This source code is licensed under the ISC license.
296
- * See the LICENSE file in the root directory of this source tree.
297
- */const iv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Rr=H("clock",iv);/**
298
- * @license lucide-react v1.25.0 - ISC
299
- *
300
- * This source code is licensed under the ISC license.
301
- * See the LICENSE file in the root directory of this source tree.
302
- */const av=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],ov=H("code-xml",av);/**
303
- * @license lucide-react v1.25.0 - ISC
304
- *
305
- * This source code is licensed under the ISC license.
306
- * See the LICENSE file in the root directory of this source tree.
307
- */const lv=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],gd=H("database",lv);/**
308
- * @license lucide-react v1.25.0 - ISC
309
- *
310
- * This source code is licensed under the ISC license.
311
- * See the LICENSE file in the root directory of this source tree.
312
- */const cv=[["path",{d:"M11 20H2",key:"nlcfvz"}],["path",{d:"M11 4.562v16.157a1 1 0 0 0 1.242.97L19 20V5.562a2 2 0 0 0-1.515-1.94l-4-1A2 2 0 0 0 11 4.561z",key:"au4z13"}],["path",{d:"M11 4H8a2 2 0 0 0-2 2v14",key:"74r1mk"}],["path",{d:"M14 12h.01",key:"1jfl7z"}],["path",{d:"M22 20h-3",key:"vhrsz"}]],Ym=H("door-open",cv);/**
313
- * @license lucide-react v1.25.0 - ISC
314
- *
315
- * This source code is licensed under the ISC license.
316
- * See the LICENSE file in the root directory of this source tree.
317
- */const uv=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Qm=H("eye",uv);/**
318
- * @license lucide-react v1.25.0 - ISC
319
- *
320
- * This source code is licensed under the ISC license.
321
- * See the LICENSE file in the root directory of this source tree.
322
- */const dv=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ho=H("file-text",dv);/**
323
- * @license lucide-react v1.25.0 - ISC
324
- *
325
- * This source code is licensed under the ISC license.
326
- * See the LICENSE file in the root directory of this source tree.
327
- */const fv=[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]],hv=H("fingerprint-pattern",fv);/**
328
- * @license lucide-react v1.25.0 - ISC
329
- *
330
- * This source code is licensed under the ISC license.
331
- * See the LICENSE file in the root directory of this source tree.
332
- */const mv=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Jm=H("git-branch",mv);/**
333
- * @license lucide-react v1.25.0 - ISC
334
- *
335
- * This source code is licensed under the ISC license.
336
- * See the LICENSE file in the root directory of this source tree.
337
- */const pv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],oi=H("globe",pv);/**
338
- * @license lucide-react v1.25.0 - ISC
339
- *
340
- * This source code is licensed under the ISC license.
341
- * See the LICENSE file in the root directory of this source tree.
342
- */const gv=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],yv=H("graduation-cap",gv);/**
343
- * @license lucide-react v1.25.0 - ISC
344
- *
345
- * This source code is licensed under the ISC license.
346
- * See the LICENSE file in the root directory of this source tree.
347
- */const xv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],vv=H("info",xv);/**
348
- * @license lucide-react v1.25.0 - ISC
349
- *
350
- * This source code is licensed under the ISC license.
351
- * See the LICENSE file in the root directory of this source tree.
352
- */const bv=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],jv=H("key-round",bv);/**
353
- * @license lucide-react v1.25.0 - ISC
354
- *
355
- * This source code is licensed under the ISC license.
356
- * See the LICENSE file in the root directory of this source tree.
357
- */const wv=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],kv=H("layers",wv);/**
358
- * @license lucide-react v1.25.0 - ISC
359
- *
360
- * This source code is licensed under the ISC license.
361
- * See the LICENSE file in the root directory of this source tree.
362
- */const Nv=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Sv=H("layout-dashboard",Nv);/**
363
- * @license lucide-react v1.25.0 - ISC
364
- *
365
- * This source code is licensed under the ISC license.
366
- * See the LICENSE file in the root directory of this source tree.
367
- */const Cv=[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]],Ev=H("library",Cv);/**
368
- * @license lucide-react v1.25.0 - ISC
369
- *
370
- * This source code is licensed under the ISC license.
371
- * See the LICENSE file in the root directory of this source tree.
372
- */const Tv=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],Av=H("lightbulb",Tv);/**
373
- * @license lucide-react v1.25.0 - ISC
374
- *
375
- * This source code is licensed under the ISC license.
376
- * See the LICENSE file in the root directory of this source tree.
377
- */const Lv=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Xm=H("lock",Lv);/**
378
- * @license lucide-react v1.25.0 - ISC
379
- *
380
- * This source code is licensed under the ISC license.
381
- * See the LICENSE file in the root directory of this source tree.
382
- */const Pv=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],Iv=H("network",Pv);/**
383
- * @license lucide-react v1.25.0 - ISC
384
- *
385
- * This source code is licensed under the ISC license.
386
- * See the LICENSE file in the root directory of this source tree.
387
- */const Mv=[["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2",key:"39pd36"}],["rect",{width:"8",height:"4",x:"10",y:"6",rx:"1",key:"aywv1n"}]],Zm=H("newspaper",Mv);/**
388
- * @license lucide-react v1.25.0 - ISC
389
- *
390
- * This source code is licensed under the ISC license.
391
- * See the LICENSE file in the root directory of this source tree.
392
- */const Ov=[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]],_v=H("notebook-pen",Ov);/**
393
- * @license lucide-react v1.25.0 - ISC
394
- *
395
- * This source code is licensed under the ISC license.
396
- * See the LICENSE file in the root directory of this source tree.
397
- */const $v=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],Dv=H("panels-top-left",$v);/**
398
- * @license lucide-react v1.25.0 - ISC
399
- *
400
- * This source code is licensed under the ISC license.
401
- * See the LICENSE file in the root directory of this source tree.
402
- */const Rv=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],zv=H("plug",Rv);/**
403
- * @license lucide-react v1.25.0 - ISC
404
- *
405
- * This source code is licensed under the ISC license.
406
- * See the LICENSE file in the root directory of this source tree.
407
- */const Fv=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],ep=H("scroll-text",Fv);/**
408
- * @license lucide-react v1.25.0 - ISC
409
- *
410
- * This source code is licensed under the ISC license.
411
- * See the LICENSE file in the root directory of this source tree.
412
- */const Bv=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],bl=H("server",Bv);/**
413
- * @license lucide-react v1.25.0 - ISC
414
- *
415
- * This source code is licensed under the ISC license.
416
- * See the LICENSE file in the root directory of this source tree.
417
- */const Uv=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Wv=H("settings",Uv);/**
418
- * @license lucide-react v1.25.0 - ISC
419
- *
420
- * This source code is licensed under the ISC license.
421
- * See the LICENSE file in the root directory of this source tree.
422
- */const Hv=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],Vv=H("shield-alert",Hv);/**
423
- * @license lucide-react v1.25.0 - ISC
424
- *
425
- * This source code is licensed under the ISC license.
426
- * See the LICENSE file in the root directory of this source tree.
427
- */const Kv=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],tp=H("shield-check",Kv);/**
428
- * @license lucide-react v1.25.0 - ISC
429
- *
430
- * This source code is licensed under the ISC license.
431
- * See the LICENSE file in the root directory of this source tree.
432
- */const Gv=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],qv=H("shield",Gv);/**
433
- * @license lucide-react v1.25.0 - ISC
434
- *
435
- * This source code is licensed under the ISC license.
436
- * See the LICENSE file in the root directory of this source tree.
437
- */const Yv=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],jl=H("sparkles",Yv);/**
438
- * @license lucide-react v1.25.0 - ISC
439
- *
440
- * This source code is licensed under the ISC license.
441
- * See the LICENSE file in the root directory of this source tree.
442
- */const Qv=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Ci=H("terminal",Qv);/**
443
- * @license lucide-react v1.25.0 - ISC
444
- *
445
- * This source code is licensed under the ISC license.
446
- * See the LICENSE file in the root directory of this source tree.
447
- */const Jv=[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"qn84l0"}],["path",{d:"M13 5v2",key:"dyzc3o"}],["path",{d:"M13 17v2",key:"1ont0d"}],["path",{d:"M13 11v2",key:"1wjjxi"}]],np=H("ticket",Jv);/**
448
- * @license lucide-react v1.25.0 - ISC
449
- *
450
- * This source code is licensed under the ISC license.
451
- * See the LICENSE file in the root directory of this source tree.
452
- */const Xv=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Zv=H("trending-up",Xv);/**
453
- * @license lucide-react v1.25.0 - ISC
454
- *
455
- * This source code is licensed under the ISC license.
456
- * See the LICENSE file in the root directory of this source tree.
457
- */const eb=[["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"}]],sp=H("triangle-alert",eb),tb={reached:$c,on_track:Zv,behind:Rr,at_risk:sp},nb={reached:"text-success",on_track:"text-success",behind:"text-warning",at_risk:"text-error"},sb={reached:"bg-success/10",on_track:"bg-success/5",behind:"bg-warning/10",at_risk:"bg-error/10"};function rb(e,t,n){const s=n.find(r=>r.projectId===e&&r.activity===t);return(s==null?void 0:s.totalHours)??0}function ib({goals:e,activityHours:t,projectNames:n,activityNames:s,month:r,today:a}){return e.length===0?null:i.jsx("div",{className:"border border-base-300",children:e.map((o,l)=>{const c=rb(o.projectId,o.activity,t),u=I1({targetHours:o.targetHours,actualHours:c,month:r,today:a}),m=n.get(o.projectId),d=tb[u.status];return i.jsxs("div",{className:`grid grid-cols-[auto_1fr_auto_1fr] gap-0 ${sb[u.status]} ${l>0?"border-t border-base-300":""}`,children:[i.jsx("div",{className:"p-3 border-r border-base-300 flex items-center justify-center",children:i.jsx(d,{size:18,className:nb[u.status]})}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-display font-semibold text-sm",children:m??o.projectId}),i.jsxs("div",{className:"font-mono text-[0.6rem] opacity-50 mt-0.5",children:[m?`${o.projectId} · `:"",s.get(`${o.projectId}\0${o.activity}`)??o.activity]})]}),i.jsxs("div",{className:"p-3 border-r border-base-300 text-right min-w-[7rem]",children:[i.jsxs("div",{className:"font-display font-semibold text-sm",children:[Math.round(c*10)/10,"/",o.targetHours,"h"]}),i.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mt-0.5",children:[o.targetDays,"d target"]})]}),i.jsxs("div",{className:"p-3",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx(O1,{percentage:u.percentage,status:u.status,className:"flex-1"}),i.jsxs("span",{className:"font-mono text-xs font-medium min-w-[3rem] text-right",children:[Math.round(u.percentage),"%"]})]}),u.status==="reached"?i.jsx("div",{className:"font-mono text-[0.6rem] font-medium text-success uppercase tracking-[0.1em]",children:"Goal reached"}):i.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 ab({goals:e,month:t,onGoalChange:n,knownCombos:s,projectNames:r,activityNames:a,onRefreshProjects:o,refreshingProjects:l}){const[c,u]=v.useState(""),[m,d]=v.useState(""),[p,y]=v.useState(null),[b,x]=v.useState(""),[j,f]=v.useState(!1),g=v.useMemo(()=>{const T=new Set(e.map(A=>`${A.projectId}\0${A.activity}`));return s.filter(A=>!T.has(`${A.projectId}\0${A.activity}`))},[s,e]);function h(T){const A=T.indexOf("\0");return A<0?null:{projectId:T.slice(0,A),activity:T.slice(A+1)}}function w(T){return r.get(T)??T}function k(T,A){const M=a.get(`${T}\0${A}`);return M?`${w(T)} / ${M}`:`${w(T)} / ${A}`}async function C(){const T=h(c),A=parseFloat(m);if(!(!T||isNaN(A)||A<.5||A>31)){f(!0);try{await B.upsertGoal({month:t,projectId:T.projectId,activity:T.activity,targetDays:A}),u(""),d(""),n()}finally{f(!1)}}}async function S(T){f(!0);try{await B.deleteGoal(T),n()}finally{f(!1)}}async function N(T){const A=parseFloat(b);if(isNaN(A)||A<.5||A>31){y(null);return}f(!0);try{await B.upsertGoal({month:T.month,projectId:T.projectId,activity:T.activity,targetDays:A}),y(null),n()}finally{f(!1)}}return i.jsxs("details",{children:[i.jsxs("summary",{className:"cursor-pointer text-sm font-semibold mb-2",children:["Manage goals (",e.length,")"]}),i.jsxs("div",{className:"mt-2 space-y-3",children:[e.length>0&&i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-xs",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Project"}),i.jsx("th",{children:"Activity"}),i.jsx("th",{className:"text-right",children:"Target (days)"}),i.jsx("th",{className:"text-right",children:"Target (hours)"}),i.jsx("th",{children:"Actions"})]})}),i.jsx("tbody",{children:e.map(T=>i.jsxs("tr",{children:[i.jsxs("td",{children:[i.jsx("div",{className:"text-sm",children:w(T.projectId)}),r.has(T.projectId)&&i.jsx("div",{className:"font-mono text-[0.6rem] opacity-50",children:T.projectId})]}),i.jsxs("td",{children:[i.jsx("div",{className:"text-sm",children:a.get(`${T.projectId}\0${T.activity}`)??T.activity}),i.jsx("div",{className:"font-mono text-[0.6rem] opacity-50",children:T.activity})]}),i.jsx("td",{className:"text-right",children:p===T.id?i.jsx("input",{type:"number",step:"0.5",className:"input input-bordered input-xs w-20 text-right",value:b,onChange:A=>x(A.target.value),onBlur:()=>N(T),onKeyDown:A=>{A.key==="Enter"&&N(T),A.key==="Escape"&&y(null)},autoFocus:!0}):T.targetDays}),i.jsx("td",{className:"text-right",children:T.targetHours}),i.jsxs("td",{className:"flex gap-1",children:[i.jsx("button",{className:"btn btn-ghost btn-xs font-mono",onClick:()=>{y(T.id),x(String(T.targetDays))},disabled:j,"aria-label":`Edit goal ${T.projectId} ${T.activity}`,children:"Edit"}),i.jsx("button",{className:"btn btn-ghost btn-xs text-error font-mono",onClick:()=>S(T.id),disabled:j,"aria-label":`Delete goal ${T.projectId} ${T.activity}`,children:"Del"})]})]},T.id))})]})}),i.jsxs("div",{className:"flex items-end gap-2",children:[i.jsxs("select",{className:"select select-bordered select-sm",value:c,onChange:T=>u(T.target.value),children:[i.jsx("option",{value:"",children:"Select project / activity…"}),g.map(T=>i.jsx("option",{value:`${T.projectId}\0${T.activity}`,children:k(T.projectId,T.activity)},`${T.projectId}\0${T.activity}`))]}),i.jsx("input",{type:"number",step:"0.5",min:"0.5",max:"31",placeholder:"Days",className:"input input-bordered input-sm w-24",value:m,onChange:T=>d(T.target.value)}),i.jsx("button",{className:"btn btn-primary btn-sm",onClick:C,disabled:j||!c,children:"Add"}),i.jsx("button",{className:"btn btn-ghost btn-sm font-mono text-xs opacity-60",onClick:o,disabled:l,children:l?"Refreshing…":"Refresh projects"})]})]})]})}function ob(e,t){var W;const[n,s]=v.useState([]),[r,a]=v.useState([]),[o,l]=v.useState(null),[c,u]=v.useState([]),m=v.useRef(c);m.current=c;const[d,p]=v.useState(!1),y=v.useCallback(async()=>{try{const E=await B.getGoals(e);s(E.goals)}catch{}},[e]),b=v.useCallback(async()=>{try{const E=await B.getCachedReport(e);E.data?(a(E.data),l(E.fetchedAt)):(a([]),l(null))}catch{}},[e]),x=v.useCallback(async()=>{try{const E=await B.getCachedProjects();E.data&&u(E.data)}catch{}},[]),j=v.useCallback(async()=>{p(!0);try{const E=await B.run("timetracking/projects",{month:e});if(E.ok&&E.data&&E.data.length>0){const $=E.data.map(I=>({projectId:String(I.projectId??""),projectName:String(I.projectName??""),activityNumber:String(I.activityNumber??""),activityName:String(I.activityName??""),category:String(I.category??""),linePropertyId:String(I.linePropertyId??"")}));u($),await B.cacheProjects($)}}catch{}p(!1)},[e]);v.useEffect(()=>{y(),b(),x()},[y,b,x]);const f=t==null?void 0:t.data;v.useEffect(()=>{if(f&&f.length>0){l(null),B.cacheReport(e,f).catch(()=>{});const E=new Set,$=[];for(const I of f){const z=String(I.projectId??""),L=String(I.activity??"");if(!z||!L)continue;const _=`${z}\0${L}`;E.has(_)||(E.add(_),$.push({projectId:z,projectName:I.projectName?String(I.projectName):z,activityNumber:L,activityName:I.activityName?String(I.activityName):L,category:String(I.category??""),linePropertyId:""}))}if($.length>0){const I=new Map;for(const L of m.current)I.set(`${L.projectId}\0${L.activityNumber}`,L);for(const L of $)I.set(`${L.projectId}\0${L.activityNumber}`,L);const z=Array.from(I.values());u(z),B.cacheProjects(z).catch(()=>{})}}},[f,e]);const g=((t==null?void 0:t.data)??[]).length>0?(t==null?void 0:t.data)??[]:r,h=g===r&&r.length>0&&!((W=t==null?void 0:t.data)!=null&&W.length),{projectNames:w,activityNames:k}=v.useMemo(()=>{const E=new Map,$=new Map;for(const I of c)I.projectId&&I.projectName&&E.set(I.projectId,I.projectName),I.projectId&&I.activityNumber&&I.activityName&&$.set(`${I.projectId}\0${I.activityNumber}`,I.activityName);for(const I of g){const z=String(I.projectId??""),L=I.projectName?String(I.projectName):null;z&&L&&E.set(z,L);const _=String(I.activity??""),R=I.activityName?String(I.activityName):null;z&&_&&R&&$.set(`${z}\0${_}`,R)}return{projectNames:E,activityNames:$}},[c,g]),{projectList:C,totalHours:S,draftCount:N,workingDayCount:T}=v.useMemo(()=>{const E=new Map;let $=0,I=0;const z=new Set;for(const L of g){const _=String(L.projectId??"Unknown"),R=Number(L.hours??0),F=String(L.date??""),X=String(L.status??""),ye=String(L.activity??"");$+=R,F&&z.add(F),X==="draft"&&I++,E.has(_)||E.set(_,{projectId:_,totalHours:0,entryCount:0,activities:new Set});const _e=E.get(_);if(_e.totalHours+=R,_e.entryCount++,ye){const cn=k.get(`${_}\0${ye}`)??ye;_e.activities.add(cn)}}return{projectList:Array.from(E.values()).sort((L,_)=>_.totalHours-L.totalHours),totalHours:$,draftCount:I,workingDayCount:z.size}},[g,k]),A=v.useMemo(()=>{const E=new Map;for(const $ of g){const I=String($.projectId??"Unknown"),z=String($.activity??""),L=Number($.hours??0),_=`${I}\0${z}`,R=E.get(_);R?R.totalHours+=L:E.set(_,{projectId:I,activity:z,totalHours:L})}return Array.from(E.values())},[g]),M=v.useMemo(()=>c.length>0?c.map(E=>({projectId:E.projectId,activity:E.activityNumber})):A.map(E=>({projectId:E.projectId,activity:E.activity})),[c,A]),U=new Date().toISOString().slice(0,10);return{goals:n,loadGoals:y,rows:g,isCached:h,cachedAt:o,projectNames:w,activityNames:k,projectList:C,totalHours:S,draftCount:N,workingDayCount:T,activityHours:A,allCombos:M,todayStr:U,refreshProjects:j,refreshingProjects:d}}function lb(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`}function cb(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 ub(){const[e,t]=v.useState(lb()),[n,s]=v.useState(!1),{running:r,result:a,error:o,approvalPending:l,approvalId:c,run:u,handleApproval:m,reset:d}=ka(),{goals:p,loadGoals:y,rows:b,isCached:x,cachedAt:j,projectNames:f,activityNames:g,projectList:h,totalHours:w,draftCount:k,workingDayCount:C,activityHours:S,allCombos:N,todayStr:T,refreshProjects:A,refreshingProjects:M}=ob(e,a),U=(o==null?void 0:o.includes("auth_required"))||(o==null?void 0:o.includes("sign in")),W=v.useCallback(async()=>{const E={};e&&(E.month=e),await u("timetracking/report",E),await y()},[e,u,y]);return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Time Tracking"}),i.jsxs("div",{className:"flex items-end gap-4 mb-6",children:[i.jsxs("label",{className:"form-control",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Month"}),i.jsx("input",{type:"month",className:"input input-bordered input-sm",value:e,onChange:E=>{t(E.target.value),d()},onClick:E=>{var $,I;return(I=($=E.target).showPicker)==null?void 0:I.call($)}})]}),i.jsx("button",{className:"btn btn-primary btn-sm",onClick:W,disabled:r,children:r?"Loading...":"Load report"})]}),r&&!l&&i.jsx(wt,{label:"Fetching timetracking data..."}),l&&i.jsxs("div",{className:"alert alert-warning mb-4",children:[i.jsx("span",{children:"This connector requires approval before proceeding."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>m(!0),disabled:!c,children:"Approve"}),i.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>m(!1),disabled:!c,children:"Reject"})]})]}),U&&i.jsx(gs,{message:"Sign in to the timetracking portal in Chrome, then try again."}),o&&!U&&i.jsx("div",{className:"alert alert-error mb-4",children:i.jsx("span",{children:o})}),b.length>0&&i.jsxs(i.Fragment,{children:[x&&j&&i.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-2",children:["Showing cached data from ",cb(j)]}),i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 border border-base-300 mb-6",children:[i.jsxs("div",{className:"p-3 border-r border-b border-base-300 md:border-b-0",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Total hours"}),i.jsx("div",{className:"font-display text-xl font-bold",children:w.toFixed(1)})]}),i.jsxs("div",{className:"p-3 border-b border-base-300 md:border-r md:border-b-0",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Working days"}),i.jsx("div",{className:"font-display text-xl font-bold",children:C})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Projects"}),i.jsx("div",{className:"font-display text-xl font-bold",children:h.length})]}),i.jsxs("div",{className:"p-3",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Draft entries"}),i.jsx("div",{className:"font-display text-xl font-bold",children:k})]})]}),i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"By project"}),i.jsx("div",{className:"overflow-x-auto border border-base-300 mb-6",children:i.jsxs("table",{className:"table table-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Project"}),i.jsx("th",{children:"Activities"}),i.jsx("th",{className:"text-right",children:"Hours"}),i.jsx("th",{className:"text-right",children:"Entries"})]})}),i.jsx("tbody",{children:h.map(E=>i.jsxs("tr",{children:[i.jsx("td",{children:f.has(E.projectId)?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"text-sm",children:f.get(E.projectId)}),i.jsx("div",{className:"font-mono text-[0.6rem] opacity-50",children:E.projectId})]}):i.jsx("span",{className:"font-mono text-sm",children:E.projectId})}),i.jsx("td",{className:"text-sm",children:Array.from(E.activities).join(", ")}),i.jsx("td",{className:"text-right font-semibold",children:E.totalHours.toFixed(1)}),i.jsx("td",{className:"text-right",children:E.entryCount})]},E.projectId))})]})}),i.jsxs("details",{open:n,onToggle:E=>s(E.target.open),children:[i.jsxs("summary",{className:"cursor-pointer text-sm font-semibold mb-2",children:["Raw booking lines (",b.length,")"]}),i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"table table-xs",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Date"}),i.jsx("th",{children:"Project"}),i.jsx("th",{children:"Activity"}),i.jsx("th",{className:"text-right",children:"Hours"}),i.jsx("th",{children:"Status"})]})}),i.jsx("tbody",{children:b.map((E,$)=>i.jsxs("tr",{children:[i.jsx("td",{children:String(E.date??"")}),i.jsx("td",{className:"font-mono text-xs",children:String(E.projectId??"")}),i.jsx("td",{children:String(E.activity??"")}),i.jsx("td",{className:"text-right",children:Number(E.hours??0).toFixed(1)}),i.jsx("td",{children:i.jsx(K,{variant:String(E.status)==="posted"?"success":"warning",size:"xs",children:String(E.status??"")})})]},$))})]})})]})]}),a&&(a.data??[]).length===0&&b.length===0&&!o&&i.jsxs("p",{className:"text-sm opacity-50",children:["No entries found for ",e,"."]}),p.length>0&&i.jsxs("div",{className:"mb-6",children:[i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Goal progress"}),i.jsx(ib,{goals:p,activityHours:S,projectNames:f,activityNames:g,month:e,today:T})]}),i.jsx("div",{className:"mt-6",children:i.jsx(ab,{goals:p,month:e,onGoalChange:y,knownCombos:N,projectNames:f,activityNames:g,onRefreshProjects:A,refreshingProjects:M})})]})}const rp={"MBTMY THE BASE CAMP":"res-rere-m6vz23ty@mercedes-benz.com","MBTMY THE TRAILHEAD":"res-rere-m6vc2q4d@mercedes-benz.com","MBTMY THE FOOTHILLS":"res-rere-m6vcb79c@mercedes-benz.com","MBTMY THE BRIDGE":"res-rere-m6vgcah6@mercedes-benz.com","MBTMY THE RIDGE":"res-rere-m6vjxdkc@mercedes-benz.com","MBTMY THE MEADOW":"res-rere-m6vhkzmd@mercedes-benz.com","MBTMY THE FOREST":"res-rere-m6vhsc6h@mercedes-benz.com","MBTMY THE LOOKOUT":"res-rere-m6vjqgrq@mercedes-benz.com","MBTMY THE CLIFFSIDE":"res-rere-m6vjl2tw@mercedes-benz.com","MBTMY THE LEDGE":"res-rere-m6vjfbmr@mercedes-benz.com","MBTMY THE HIGHPOINT":"res-rere-m6vjblgb@mercedes-benz.com","MBTMY THE VISTA":"RES-RERE-M6VJ7ZUW@mercedes-benz.com","MBTMY THE SHOULDER":"res-rere-m6vj3tuq@mercedes-benz.com","MBTMY THE PINNACLE":"res-rere-m6vhxd4c@mercedes-benz.com","MBTMY THE DESCENT":"res-rere-m6vzgysp@mercedes-benz.com"},db=Object.fromEntries(Object.entries(rp).map(([e,t])=>[t.toLowerCase(),e.replace(/^MBTMY\s+/i,"").replace(/\b\w+/g,n=>n[0].toUpperCase()+n.slice(1).toLowerCase())])),yd={free:"success",busy:"error",tentative:"warning",oof:"secondary",elsewhere:"info"},fb={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"},hb={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 On(e){const t=e.match(/(\d{1,2}:\d{2})/);return t?t[1]:e}function mb({rows:e}){var r,a;const[t,n]=v.useState(null),s=e.reduce((o,l)=>o+(l.durationMin??0),0);return i.jsxs("div",{children:[s>0&&i.jsxs("div",{className:"mb-6",children:[i.jsx("div",{className:"flex h-10 overflow-hidden gap-px border border-base-300",children:e.map((o,l)=>{const c=s>0?(o.durationMin??0)/s*100:0;if(c<.5)return null;const u=t===l,m=u?hb[o.state??""]??"bg-base-300":fb[o.state??""]??"bg-base-300";return i.jsxs("div",{className:`${m} border flex items-center justify-center text-xs transition-colors duration-75 cursor-default relative`,style:{width:`${c}%`},onMouseEnter:()=>n(l),onMouseLeave:()=>n(null),children:[c>12&&i.jsx("span",{className:"opacity-60 truncate px-1 font-mono text-[0.65rem] uppercase tracking-wide",children:o.state}),u&&i.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,": ",On(o.start??""),"–",On(o.end??"")," (",o.durationMin,"m)"]})]},l)})}),i.jsxs("div",{className:"flex justify-between mt-1",children:[i.jsx("span",{className:"font-mono text-[0.6rem] opacity-30",children:On(((r=e[0])==null?void 0:r.start)??"")}),i.jsx("span",{className:"font-mono text-[0.6rem] opacity-30",children:On(((a=e[e.length-1])==null?void 0:a.end)??"")})]})]}),i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Start"}),i.jsx("th",{children:"End"}),i.jsx("th",{children:"State"}),i.jsx("th",{className:"text-right",children:"Duration"})]})}),i.jsx("tbody",{children:e.map((o,l)=>i.jsxs("tr",{className:`transition-colors duration-75 ${t===l?"bg-base-200":"hover:bg-base-200"}`,onMouseEnter:()=>n(l),onMouseLeave:()=>n(null),children:[i.jsx("td",{className:"font-mono text-sm",children:On(o.start??"")}),i.jsx("td",{className:"font-mono text-sm",children:On(o.end??"")}),i.jsx("td",{children:i.jsx(K,{variant:yd[o.state??""]??"neutral",children:o.state})}),i.jsxs("td",{className:"text-right font-mono text-sm",children:[o.durationMin,"m"]})]},l))})]})}),i.jsx("div",{className:"flex flex-wrap gap-4 mt-3",children:Object.entries(yd).map(([o,l])=>i.jsx("div",{className:"flex items-center gap-1.5",children:i.jsx(K,{variant:l,size:"xs",children:o})},o))})]})}const pb=[{id:1,name:"The Base Camp",x:685,y:75,w:160,h:85,capacity:10},{id:2,name:"The Trailhead",x:880,y:130,w:95,h:100,capacity:4},{id:3,name:"The Foothills",x:880,y:255,w:95,h:100,capacity:5},{id:4,name:"The Bridge",x:880,y:380,w:95,h:100,capacity:4},{id:5,name:"The Ridge",x:650,y:620,w:250,h:110,capacity:18},{id:6,name:"The Meadow",x:535,y:480,w:92,h:80,capacity:6},{id:7,name:"The Forest",x:428,y:480,w:92,h:80,capacity:16},{id:8,name:"The Lookout",x:540,y:795,w:110,h:75,capacity:4},{id:9,name:"The Cliffside",x:410,y:795,w:110,h:75,capacity:4},{id:10,name:"The Ledge",x:280,y:795,w:110,h:75,capacity:4},{id:11,name:"The Highpoint",x:150,y:795,w:110,h:75,capacity:10},{id:12,name:"The Vista",x:30,y:750,w:100,h:115,capacity:12},{id:13,name:"The Shoulder",x:30,y:620,w:100,h:110,capacity:4},{id:14,name:"The Pinnacle",x:30,y:300,w:120,h:260,capacity:16},{id:15,name:"The Descent",x:30,y:60,w:120,h:170,capacity:6}],gb=[{name:"The Summit",x:170,y:60,w:230,h:500},{name:"The Lodge",x:670,y:60,w:190,h:500},{name:"The Plateau",x:150,y:620,w:470,h:150}],yb=[{x:90,y:28,dir:"down"},{x:355,y:28,dir:"down"},{x:765,y:28,dir:"down"},{x:24,y:596,dir:"left"}],xb={free:"fill-success/15 stroke-success",busy:"fill-error/15 stroke-error",unknown:"fill-base-200/60 stroke-base-300"};function li(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"").replace(/^mbtmy/,"").replace(/^the/,"")}function vb({statuses:e={},selected:t,onSelect:n}){const r=`hatch-${v.useId().replace(/[^a-zA-Z0-9]/g,"")}`,a=new Map(Object.entries(e).map(([c,u])=>[li(c),u])),o=t?li(t):null,l=c=>a.get(li(c.name))??"unknown";return i.jsxs("div",{className:"border border-base-300 p-3 sm:p-4",children:[i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("svg",{viewBox:"0 0 1000 900",className:"min-w-[560px] w-full h-auto select-none",role:"group","aria-label":"Office floor plan",children:[i.jsx("defs",{children:i.jsx("pattern",{id:r,width:"7",height:"7",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:i.jsx("line",{x1:"0",y1:"0",x2:"0",y2:"7",strokeWidth:"1",className:"stroke-base-300"})})}),i.jsx("rect",{x:"14",y:"40",width:"972",height:"846",className:"fill-base-100 stroke-base-content/60",strokeWidth:"2"}),gb.map(c=>i.jsxs("g",{children:[i.jsx("rect",{x:c.x,y:c.y,width:c.w,height:c.h,className:"fill-base-200/30 stroke-base-300",strokeWidth:"1",strokeDasharray:"4 4"}),i.jsx("text",{x:c.x+c.w/2,y:c.y+c.h/2,textAnchor:"middle",dominantBaseline:"middle",fontSize:"13",letterSpacing:"2",className:"fill-base-content/25 font-mono uppercase",children:c.name})]},c.name)),i.jsxs("g",{children:[i.jsx("rect",{x:"420",y:"60",width:"232",height:"405",fill:`url(#${r})`,className:"stroke-base-300",strokeWidth:"1"}),i.jsx("rect",{x:"437",y:"192",width:"198",height:"140",className:"fill-base-100 stroke-base-300",strokeWidth:"1"}),i.jsx("text",{x:"536",y:"255",textAnchor:"middle",fontSize:"12",letterSpacing:"2",className:"fill-base-content/40 font-mono uppercase",children:"Courtyard"}),i.jsx("text",{x:"536",y:"275",textAnchor:"middle",fontSize:"8",letterSpacing:"1.5",className:"fill-base-content/25 font-mono uppercase",children:"Reflective pool"})]}),i.jsx("rect",{x:"680",y:"758",width:"220",height:"112",fill:`url(#${r})`,className:"stroke-base-300",strokeWidth:"1"}),i.jsx("text",{x:"790",y:"818",textAnchor:"middle",fontSize:"9",letterSpacing:"1.5",className:"fill-base-content/30 font-mono uppercase",children:"Facilities"}),yb.map((c,u)=>i.jsx("g",{children:c.dir==="left"?i.jsxs(i.Fragment,{children:[i.jsx("path",{d:`M ${c.x} ${c.y-6} L ${c.x} ${c.y+6} L ${c.x-7} ${c.y} Z`,className:"fill-base-content/40"}),i.jsx("text",{x:c.x+10,y:c.y,textAnchor:"start",dominantBaseline:"central",fontSize:"8",letterSpacing:"1",className:"fill-base-content/40 font-mono uppercase",children:"Entry"})]}):i.jsxs(i.Fragment,{children:[i.jsx("path",{d:`M ${c.x-6} ${c.y} L ${c.x+6} ${c.y} L ${c.x} ${c.y+7} Z`,className:"fill-base-content/40"}),i.jsx("text",{x:c.x,y:c.y-5,textAnchor:"middle",fontSize:"8",letterSpacing:"1",className:"fill-base-content/40 font-mono uppercase",children:"Entry"})]})},u)),pb.map(c=>{const u=l(c),m=o!==null&&li(c.name)===o,d=c.w<100;return i.jsxs("g",{role:n?"button":void 0,tabIndex:n?0:void 0,onClick:n?()=>n(c.name):void 0,onKeyDown:n?p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),n(c.name))}:void 0,className:n?"cursor-pointer hover:opacity-75 focus:outline-none transition-opacity":void 0,children:[i.jsx("title",{children:`${c.name} — ${u==="unknown"?"not checked":u}`}),i.jsx("rect",{x:c.x,y:c.y,width:c.w,height:c.h,strokeWidth:u==="unknown"?1:1.5,className:xb[u]}),m&&i.jsx("rect",{x:c.x+3,y:c.y+3,width:c.w-6,height:c.h-6,className:"fill-none stroke-primary",strokeWidth:"2"}),i.jsx("circle",{cx:c.x+15,cy:c.y+15,r:"9",className:"fill-base-100 stroke-base-content/30",strokeWidth:"1"}),i.jsx("text",{x:c.x+15,y:c.y+15,textAnchor:"middle",dominantBaseline:"central",fontSize:"8.5",className:"fill-base-content/60 font-mono",children:c.id}),i.jsx("text",{x:c.x+c.w/2,y:c.y+c.h/2+(c.h>90?10:8),textAnchor:"middle",fontSize:d?12:13.5,letterSpacing:"0.8",className:"fill-base-content/80 font-mono uppercase font-medium",children:c.name.replace(/^The\s+/i,"")}),i.jsxs("text",{x:c.x+c.w/2,y:c.y+c.h/2+(c.h>90?10:8)+(d?14:16),textAnchor:"middle",fontSize:10.5,letterSpacing:"0.5",className:"fill-base-content/40 font-mono",children:[c.capacity,"p"]})]},c.id)})]})}),i.jsxs("div",{className:"flex flex-wrap gap-x-5 gap-y-1 mt-3 font-mono text-[0.6rem] uppercase tracking-[0.1em] opacity-70",children:[i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2.5 h-2.5 inline-block bg-success/15 border border-success"})," Available"]}),i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2.5 h-2.5 inline-block bg-error/15 border border-error"})," Busy"]}),i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2.5 h-2.5 inline-block bg-base-200 border border-base-300"})," Not checked"]}),n&&i.jsx("span",{className:"opacity-60",children:"Click a room to select it"})]})]})}function bb(){return new Date().toISOString().slice(0,10)}const xd=[15,30,45,60,90,120,180,240,300,360,420,480,540],Ds=15,vd=Array.from({length:24*4},(e,t)=>{const n=Math.floor(t/4),s=t%4*15;return`${String(n).padStart(2,"0")}:${String(s).padStart(2,"0")}`});function bd(){const e=new Date,t=e.getHours()*60+Math.round(e.getMinutes()/15)*15,n=Math.floor(t/60)%24,s=t%60;return`${String(n).padStart(2,"0")}:${String(s).padStart(2,"0")}`}function Rs(e){const[t,n]=e.split(":").map(Number);return t*60+n}function na(e){const t=Math.floor(e/60)%24,n=e%60;return`${String(t).padStart(2,"0")}:${String(n).padStart(2,"0")}`}function Jn(e){const[t,n]=e.split(":").map(Number),s=t<12?"AM":"PM";return`${t%12===0?12:t%12}:${String(n).padStart(2,"0")} ${s}`}function jb(e){if(e<60)return`${e} min`;const t=Math.floor(e/60),n=e%60;return n===0?`${t}h`:`${t}h ${n}m`}function jd(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 wd(e,t){if(!e)return null;let n=new Date(e);return Number.isNaN(n.getTime())?(n=new Date(`${t}T${e}`),Number.isNaN(n.getTime())?null:n):n}function wb(e,t,n,s){const r=new Date(`${t}T${n}:00`),a=new Date(r.getTime()+s*6e4);return!e.some(l=>{if(l.state==="free")return!1;const c=wd(l.start,t),u=wd(l.end,t);return c===null||u===null?!1:c<a&&r<u})}const xt=24*60;function wl(e,t){return Math.max(0,Math.min(xt-t,e))}function kd(e){return Math.round(e/15)*15}function kb({startMinutes:e,durationMinutes:t,onChange:n}){const s=v.useRef(null),r=v.useRef(!1),a=y=>{const b=s.current;if(!b)return e;const x=b.getBoundingClientRect(),f=Math.max(0,Math.min(1,(y-x.left)/x.width))*xt;return kd(f)},o=y=>{const b=a(y)-t/2;n(wl(kd(b),t))},l=y=>{r.current=!0,y.currentTarget.setPointerCapture(y.pointerId),o(y.clientX)},c=y=>{r.current&&o(y.clientX)},u=()=>{r.current=!1},m=e/xt*100,d=t/xt*100,p=e+t;return i.jsxs("div",{children:[i.jsxs("div",{ref:s,className:"relative h-10 bg-base-200 border border-base-300 rounded cursor-pointer select-none touch-none",onPointerDown:l,onPointerMove:c,onPointerUp:u,children:[i.jsx("div",{className:"absolute inset-0 flex",children:Array.from({length:8},(y,b)=>i.jsx("div",{className:"flex-1 border-r border-base-300/60 last:border-r-0"},b))}),i.jsx("div",{className:"absolute top-0 h-full bg-primary/20 border border-primary/50 rounded cursor-grab active:cursor-grabbing",style:{left:`${m}%`,width:`${d}%`}}),i.jsx("div",{className:"absolute top-0 h-full flex items-center text-xs font-mono font-semibold text-base-content whitespace-nowrap pointer-events-none",style:{left:d<10?`${m+d+.5}%`:`${m}%`,width:d<10?"auto":`${d}%`,justifyContent:d<10?"flex-start":"center"},children:i.jsxs("span",{className:d<10?"text-base-content/80":"",children:[Jn(na(e)),"–",Jn(na(p))]})})]}),i.jsxs("div",{className:"flex justify-between font-mono text-[0.55rem] opacity-50 mt-1",children:[i.jsx("span",{children:"12 AM"}),i.jsx("span",{children:"3 AM"}),i.jsx("span",{children:"6 AM"}),i.jsx("span",{children:"9 AM"}),i.jsx("span",{children:"12 PM"}),i.jsx("span",{children:"3 PM"}),i.jsx("span",{children:"6 PM"}),i.jsx("span",{children:"9 PM"}),i.jsx("span",{children:"12 AM"})]})]})}function Nb(){var mt;const[e,t]=v.useState(bb()),[n,s]=v.useState(()=>Rs(bd())),r=na(n),[a,o]=v.useState(120),[l,c]=v.useState("duration"),[u,m]=v.useState(()=>Rs(bd())+120),[d,p]=v.useState(1),y=l==="endtime"?Math.max(Ds,u-n):a,b=v.useCallback(O=>{if(O!==l){if(O==="endtime")m(Math.min(xt,n+a));else{const q=Math.max(Ds,u-n),ce=xd.reduce((rt,Es)=>Math.abs(Es-q)<Math.abs(rt-q)?Es:rt);o(ce)}c(O)}},[l,n,a,u]),x=v.useCallback(O=>{const q=Math.max(n+Ds,Math.min(xt,O));m(q)},[n]),j=v.useCallback(O=>{const q=wl(O,l==="endtime"?Ds:a);s(q),l==="endtime"&&m(ce=>Math.max(q+Ds,Math.min(xt,ce)))},[l,a]),[f,g]=v.useState(null),[h,w]=v.useState(null),[k,C]=v.useState(null),[S,N]=v.useState(!1),T=v.useRef(e),{running:A,result:M,error:U,approvalPending:W,approvalId:E,run:$,handleApproval:I}=ka();v.useEffect(()=>{let O=!1;return B.getCachedRoomAvailability(e).then(q=>{O||(q.data&&q.data.length>0?(w(q.data),C(q.fetchedAt),N(!0)):(w(null),C(null),N(!1)))}).catch(()=>{}),()=>{O=!0}},[e]),v.useEffect(()=>{if(M!=null&&M.data&&M.data.length>0){const O=new Date().toISOString();C(O),N(!1),w(M.data),B.cacheRoomAvailability(T.current,M.data).catch(()=>{})}},[M]);const z=v.useCallback(async()=>{N(!1),T.current=e;const O=Object.entries(rp).map(([q,ce])=>`${q}:${ce}`).join(",");await $("teams/rooms-availability",{rooms:O,date:e})},[$,e]),L=(U==null?void 0:U.includes("auth_required"))||(U==null?void 0:U.includes("sign in")),_=(M==null?void 0:M.data)??h??[],R=v.useMemo(()=>_.map(O=>({room:String(O.roomEmail??O.room??""),capacity:O.capacity===null||O.capacity===void 0||O.capacity===""?null:Number(O.capacity),start:String(O.start??""),end:String(O.end??""),state:String(O.state??""),durationMin:Number(O.durationMin??0)})),[_]),F=v.useMemo(()=>{const O=new Map;for(const ce of R){const rt=ce.room.toLowerCase();O.has(rt)||O.set(rt,[]),O.get(rt).push(ce)}const q=new Map;for(const[ce,rt]of O)q.set(db[ce]??ce,rt);return q},[R]),X=v.useMemo(()=>{var q;const O={};for(const[ce,rt]of F){const Es=((q=rt.find(lp=>lp.capacity!==null))==null?void 0:q.capacity)??null,ap=Es===null||Es>=d,op=wb(rt,e,r,y);O[ce]=op&&ap?"free":"busy"}return O},[F,e,r,y,d]),ye=f?F.get(f)??[]:[],_e=((mt=ye.find(O=>O.capacity!==null))==null?void 0:mt.capacity)??null,cn=v.useCallback(O=>{g(q=>q===O?null:O)},[]);return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Room Availability"}),i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end gap-3 mb-6",children:[i.jsxs("label",{className:"form-control w-full sm:w-auto",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Date"}),i.jsx("input",{type:"date",className:"input input-bordered input-sm w-full sm:w-auto",value:e,onChange:O=>t(O.target.value),onClick:O=>{var q,ce;return(ce=(q=O.target).showPicker)==null?void 0:ce.call(q)}})]}),i.jsxs("label",{className:"form-control w-full sm:w-auto",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Start time"}),i.jsx("select",{className:"select select-bordered select-sm w-full sm:w-auto",value:r,onChange:O=>j(Rs(O.target.value)),children:vd.map(O=>i.jsx("option",{value:O,children:Jn(O)},O))})]}),i.jsxs("div",{className:"form-control w-full sm:w-auto",children:[i.jsxs("div",{className:"join mb-1",children:[i.jsx("button",{type:"button",className:`join-item btn btn-xs px-3 font-mono text-[0.6rem] uppercase tracking-[0.1em] ${l==="duration"?"btn-primary":"btn-ghost opacity-40"}`,onClick:()=>b("duration"),children:"Duration"}),i.jsx("button",{type:"button",className:`join-item btn btn-xs px-3 font-mono text-[0.6rem] uppercase tracking-[0.1em] ${l==="endtime"?"btn-primary":"btn-ghost opacity-40"}`,onClick:()=>b("endtime"),children:"End time"})]}),l==="duration"?i.jsx("select",{className:"select select-bordered select-sm w-full sm:w-auto",value:a,onChange:O=>{const q=Number(O.target.value);o(q),s(ce=>wl(ce,q))},children:xd.map(O=>i.jsx("option",{value:O,children:jb(O)},O))}):i.jsxs("select",{className:"select select-bordered select-sm w-full sm:w-auto",value:u===xt?"24:00":na(u),onChange:O=>{const q=O.target.value;x(q==="24:00"?xt:Rs(q))},children:[vd.filter(O=>Rs(O)>n).map(O=>i.jsx("option",{value:O,children:Jn(O)},O)),i.jsx("option",{value:"24:00",children:"End of day"},"eod")]})]}),i.jsxs("label",{className:"form-control w-full sm:w-24",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"People"}),i.jsx("input",{type:"number",min:1,className:"input input-bordered input-sm w-full sm:w-24",value:d,onFocus:O=>O.target.select(),onChange:O=>p(Math.max(1,Number(O.target.value)||1))})]}),i.jsx("button",{className:"btn btn-primary btn-sm w-full sm:w-auto",onClick:z,disabled:A,children:A?"Checking floor...":"Check floor plan"})]}),i.jsxs("div",{className:"mb-6",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1 block",children:"Drag to pick a time · bar width = duration"}),i.jsx(kb,{startMinutes:n,durationMinutes:y,onChange:O=>{s(O),l==="endtime"&&m(Math.min(xt,O+y))}})]}),A&&!W&&i.jsx(wt,{label:"Checking all rooms on the floor plan (this drives Outlook UI and can take a few minutes)..."}),W&&i.jsxs("div",{className:"alert alert-warning mb-4",children:[i.jsx("span",{children:"This connector requires approval before proceeding."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>I(!0),disabled:!E,children:"Approve"}),i.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>I(!1),disabled:!E,children:"Reject"})]})]}),L&&i.jsx(gs,{message:"Sign in to Microsoft Teams in Chrome, then try again."}),U&&!L&&i.jsx("div",{className:"alert alert-error mb-4",children:i.jsx("span",{children:U})}),k&&i.jsxs("div",{className:"flex items-center gap-2 mb-4 font-mono text-xs opacity-50",children:[S&&i.jsx("span",{className:"badge badge-sm badge-outline",children:"cached"}),i.jsxs("span",{children:["Last fetched ",new Date(k).toLocaleString()]})]}),!M&&!h&&!A&&!U&&i.jsxs("div",{className:"border border-base-300 p-8 text-center mb-8",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"Pick a date, time, duration and party size, then check the floor plan"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Rooms that are free and big enough will show green; everything else red."})]}),i.jsxs("div",{className:"mt-2",children:[i.jsxs("h3",{className:"font-display text-base font-semibold mb-3",children:["Floor plan · ",Jn(r),"–",Jn((()=>{const[O,q]=r.split(":").map(Number),ce=(O*60+q+y)%(24*60);return`${String(Math.floor(ce/60)).padStart(2,"0")}:${String(ce%60).padStart(2,"0")}`})())," · ",jd(e)," · ",d," ",d===1?"person":"people"]}),i.jsx(vb,{statuses:X,selected:f??void 0,onSelect:cn})]}),f&&ye.length>0&&i.jsxs("div",{className:"mt-8",children:[i.jsxs("h3",{className:"font-display text-base font-semibold mb-3",children:[f,_e!==null&&i.jsxs("span",{className:"ml-2 font-mono text-xs font-normal opacity-50 uppercase tracking-[0.08em]",children:["Capacity ",_e]})," ","· ",jd(e)]}),i.jsx(mb,{rows:ye})]}),f&&ye.length===0&&i.jsx("div",{className:"mt-8 border border-base-300 p-6 text-center",children:i.jsxs("p",{className:"text-sm opacity-50",children:["No data for ",f,' yet — run "Check floor plan" first.']})})]})}function Sb({data:e}){const{timetracking:t,meetings:n,jira:s,git:r}=e,a=t?Math.min(100,Math.round(t.totalHours/t.targetHours*100)):0,o=t&&t.totalHours<t.targetHours*.8,l=(s==null?void 0:s.blockers.length)??0,c=(r==null?void 0:r.repos.length)??0;return i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 border border-base-300",children:[i.jsxs("div",{className:"p-3 border-r border-b border-base-300 md:border-b-0",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Hours Logged"}),i.jsx("div",{className:`font-display text-xl font-bold ${o?"text-warning":"text-success"}`,children:t?`${t.totalHours}h`:"—"}),i.jsxs("div",{className:"text-xs opacity-40",children:["/ ",(t==null?void 0:t.targetHours)??40,"h target"]}),t&&i.jsx("progress",{className:`progress ${o?"progress-warning":"progress-success"} w-full mt-1`,value:a,max:100})]}),i.jsxs("div",{className:"p-3 border-b border-base-300 md:border-r md:border-b-0",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Meetings"}),i.jsx("div",{className:`font-display text-xl font-bold ${n&&n.totalHours>20?"text-warning":"text-info"}`,children:n?String(n.totalCount):"—"}),i.jsx("div",{className:"text-xs opacity-40",children:n?`${n.totalHours}h · avg ${n.avgDurationMin}min`:""})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Tickets Done"}),i.jsx("div",{className:"font-display text-xl font-bold text-accent",children:s?String(s.resolved.length):"—"}),i.jsx("div",{className:"text-xs opacity-40",children:s?i.jsxs(i.Fragment,{children:[s.inProgress.length," in progress",l>0&&i.jsxs("span",{className:"text-error font-semibold ml-1",children:["· ",l," blocked"]})]}):""})]}),i.jsxs("div",{className:"p-3",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Commits"}),i.jsx("div",{className:"font-display text-xl font-bold text-primary",children:r?String(r.totalCommits):"—"}),i.jsx("div",{className:"text-xs opacity-40",children:r?`${r.totalPRsMerged} PRs · ${c} repo${c!==1?"s":""}`:""})]})]})}const Cb=["Mon","Tue","Wed","Thu","Fri"];function Eb(e){const t=new Date(e).getDay();return Cb[t-1]??e}function Tb({data:e,weekStart:t}){const{timetracking:n,meetings:s,git:r,jira:a}=e,o=new Set,l=new Date(t+"T00:00:00");for(let j=0;j<5;j++){const f=l.getFullYear(),g=String(l.getMonth()+1).padStart(2,"0"),h=String(l.getDate()).padStart(2,"0");o.add(`${f}-${g}-${h}`),l.setDate(l.getDate()+1)}n==null||n.daily.forEach(j=>o.add(j.date)),s==null||s.daily.forEach(j=>o.add(j.date)),r==null||r.daily.forEach(j=>o.add(j.date));const c=new Date(t+"T00:00:00");c.setDate(c.getDate()+6);const u=c.toISOString().slice(0,10),m=[...o].filter(j=>j>=t&&j<=u).sort().filter(j=>{const f=new Date(j+"T00:00:00").getDay();return f===0||f===6?(n==null?void 0:n.daily.some(h=>h.date===j&&h.hours>0))||(s==null?void 0:s.daily.some(h=>h.date===j&&h.count>0))||(r==null?void 0:r.daily.some(h=>h.date===j&&h.commits>0)):!0}),d=(n==null?void 0:n.totalHours)??0,p=(s==null?void 0:s.totalCount)??0,y=(s==null?void 0:s.totalHours)??0,b=(r==null?void 0:r.totalCommits)??0,x=(a==null?void 0:a.resolved.length)??0;return m.length===0?i.jsx("div",{className:"text-base-content/60",children:"No daily data available."}):i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"font-mono text-[0.6rem] uppercase tracking-[0.1em] opacity-50",children:[i.jsx("th",{children:"Day"}),i.jsx("th",{children:"Date"}),i.jsx("th",{children:"Hours Logged"}),i.jsx("th",{children:"Meetings"}),i.jsx("th",{children:"Commits"}),i.jsx("th",{children:"Tickets"})]})}),i.jsx("tbody",{children:m.map(j=>{const f=n==null?void 0:n.daily.find(C=>C.date===j),g=s==null?void 0:s.daily.find(C=>C.date===j),h=r==null?void 0:r.daily.find(C=>C.date===j),w=n==null?void 0:n.gaps.includes(j),k=(a==null?void 0:a.resolved.filter(C=>C.resolvedDate===j))??[];return i.jsxs("tr",{className:w?"bg-warning/10":"",children:[i.jsx("td",{className:"font-medium",children:Eb(j)}),i.jsx("td",{className:"text-xs text-base-content/60",children:j}),i.jsxs("td",{children:[i.jsx("span",{className:w?"text-warning font-semibold":"",children:f?`${f.hours}h`:"—"}),w&&i.jsx("span",{className:"ml-1 text-warning text-xs",children:"⚠"})]}),i.jsx("td",{children:g?`${g.count} (${g.hours}h)`:"—"}),i.jsx("td",{children:h?`${h.commits}`:"0"}),i.jsx("td",{className:"text-xs",children:k.length>0?k.map(C=>C.key).join(", "):"—"})]},j)})}),i.jsx("tfoot",{children:i.jsxs("tr",{className:"font-semibold border-t border-base-300",children:[i.jsx("td",{colSpan:2,children:"Total"}),i.jsx("td",{children:d>0?`${d}h`:"—"}),i.jsx("td",{children:p>0?`${p} (${y}h)`:"—"}),i.jsx("td",{children:b}),i.jsx("td",{className:"text-xs",children:x>0?`${x} done`:"—"})]})})]})})}const kl=["action","warning","info","positive"],Ab={action:{border:"border-l-error",icon:_c,iconClass:"text-error"},warning:{border:"border-l-warning",icon:sp,iconClass:"text-warning"},info:{border:"border-l-info",icon:vv,iconClass:"text-info"},positive:{border:"border-l-success",icon:$c,iconClass:"text-success"}},Nd=[{key:"time",label:"Time",icon:Rr},{key:"meetings",label:"Meetings",icon:q1},{key:"tickets",label:"Tickets",icon:np},{key:"code",label:"Code",icon:Jm}];function Lb(e,t){for(const n of kl)if(e.some(s=>s.category===t&&s.severity===n))return n;return"positive"}const Pb={action:"bg-error",warning:"bg-warning",info:"bg-info",positive:"bg-success opacity-40"};function Ib(e,t){if(!t)return"—";switch(e){case"time":return`${t.totalLoggedHours}h logged`;case"meetings":return`${t.totalMeetingHours}h in meetings`;case"tickets":return t.blockerCount>0?`${t.blockerCount} blocked`:t.resolvedCount>0?`${t.resolvedCount} resolved`:t.inProgressCount>0?`${t.inProgressCount} in progress`:"No activity";case"code":if(t.totalCommits>0){const n=t.totalPRsMerged>0?` · ${t.totalPRsMerged} PRs`:"";return`${t.totalCommits} commit${t.totalCommits!==1?"s":""}${n}`}return"No activity"}}function Mb(e){return e.map((t,n)=>typeof t=="string"?{id:`legacy-${n}`,severity:"info",category:"time",title:"Insight",detail:t}:t)}function Ob({insights:e,errors:t,crossRef:n}){const s=v.useMemo(()=>Mb(e),[e]),r=v.useMemo(()=>[...s].sort((l,c)=>kl.indexOf(l.severity)-kl.indexOf(c.severity)),[s]),a=r.length===1&&r[0].id==="all-clear",o=r.length>0&&!a;return i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"border border-base-300",children:[n&&i.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4",children:Nd.map(({key:l,label:c,icon:u},m)=>{const d=Lb(s,l),p=Ib(l,n);return i.jsxs("div",{className:`p-3 ${m<Nd.length-1?"border-r border-base-300":""} ${m<2?"border-b border-base-300 md:border-b-0":""}`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("span",{className:`inline-block w-2 h-2 ${Pb[d]}`}),i.jsx(u,{className:"w-3 h-3 opacity-40","aria-hidden":"true"}),i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-50 uppercase tracking-[0.1em]",children:c})]}),p&&i.jsx("div",{className:"text-xs opacity-50 pl-[24px]",children:p})]},l)})}),o&&i.jsx("div",{className:`divide-y divide-base-300 ${n?"border-t border-base-300":""}`,children:r.map(l=>{const c=Ab[l.severity],u=c.icon;return i.jsxs("div",{className:`flex items-start gap-3 p-3 border-l-4 ${c.border}`,children:[i.jsx(u,{className:`w-3.5 h-3.5 mt-0.5 shrink-0 ${c.iconClass}`,"aria-hidden":"true"}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"text-sm font-medium",children:l.title}),i.jsx("div",{className:"text-xs opacity-60",children:l.detail})]})]},l.id)})}),a&&i.jsxs("div",{className:`p-4 flex items-center gap-3 ${n?"border-t border-base-300":""}`,children:[i.jsx($c,{className:"w-4 h-4 text-success opacity-60","aria-hidden":"true"}),i.jsx("span",{className:"text-sm opacity-60",children:"Nothing to flag this week."})]})]}),t.length>0&&i.jsx("div",{className:"alert alert-warning text-sm",children:i.jsxs("div",{children:[i.jsx("p",{className:"font-semibold",children:"Some data sources had issues:"}),i.jsx("ul",{className:"list-disc list-inside mt-1",children:t.map((l,c)=>i.jsx("li",{children:l},c))})]})})]})}function _b(e){const[t,n]=e.split("-").map(Number);return new Date(t,n-1,1).toLocaleDateString("en-GB",{month:"long",year:"numeric"})}function $b(e){return new Date(e+"T00:00:00").toLocaleDateString("en-GB",{weekday:"short",day:"numeric",month:"short"})}function Db(e){return e.isOverdue?"badge badge-error badge-sm":typeof e.daysUntilDue=="number"&&e.daysUntilDue<=7?"badge badge-warning badge-sm":typeof e.daysUntilDue=="number"&&e.daysUntilDue<=30?"badge badge-info badge-sm":"badge badge-ghost badge-sm"}function Rb(e){return e.isOverdue?"Overdue":e.daysUntilDue==null||e.daysUntilDue===9999?"No deadline":e.daysUntilDue===0?"Due today":e.daysUntilDue===1?"Due tomorrow":`${e.daysUntilDue}d left`}function zb({month:e,monthly:t,goals:n,projectNames:s,activityNames:r,saba:a,enabled:o}){const[l,c]=v.useState(!1),u=v.useMemo(()=>{const f=new Map;for(const g of(t==null?void 0:t.hoursByProjectActivity)??[])f.set(`${g.projectId}\0${g.activity}`,g.hours);return f},[t]),m=v.useMemo(()=>{var f;return((f=a.result)==null?void 0:f.data)??[]},[a.result]),d=typeof a.error=="string"&&(a.error.toLowerCase().includes("auth_required")||a.error.toLowerCase().includes("sign in")),p=m.filter(f=>f.isOverdue).length,y=m.filter(f=>!f.isOverdue&&typeof f.daysUntilDue=="number"&&f.daysUntilDue<=30).length,b=o.timetracking?t?t.unreleasedDates.length>0?{label:`${t.unreleasedDates.length} unreleased`,className:"text-warning"}:{label:"Released ✓",className:"text-success"}:{label:"Not checked",className:"opacity-40"}:null,x=o.saba?a.result?m.length===0?{label:"No training due ✓",className:"text-success"}:{label:`${m.length} training${m.length!==1?"s":""}${p>0?` · ${p} overdue`:""}`,className:p>0?"text-error":"text-warning"}:{label:"Not checked",className:"opacity-40"}:null,j=a.approvalPending||d||a.error&&!d;return i.jsxs("div",{className:"border border-base-300 text-sm",children:[i.jsxs("button",{type:"button",onClick:()=>c(f=>!f),className:"w-full flex items-center justify-between gap-3 p-3 text-left","aria-expanded":l,children:[i.jsxs("div",{className:"flex items-baseline gap-2",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-50 uppercase tracking-[0.1em]",children:"Month-to-date"}),i.jsx("span",{className:"text-xs opacity-40",children:_b(e)})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[b&&i.jsx("span",{className:`text-xs font-medium whitespace-nowrap ${b.className}`,children:b.label}),x&&i.jsx("span",{className:`text-xs font-medium whitespace-nowrap ${x.className}`,children:x.label}),i.jsx(Q1,{className:`w-3.5 h-3.5 opacity-40 transition-transform ${l?"rotate-180":""}`})]})]}),j&&i.jsxs("div",{className:"border-t border-base-300 p-3 space-y-2",children:[a.approvalPending&&i.jsxs("div",{className:"alert alert-warning",children:[i.jsx("span",{children:"This connector requires approval before proceeding."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>a.handleApproval(!0),disabled:!a.approvalId,children:"Approve"}),i.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>a.handleApproval(!1),disabled:!a.approvalId,children:"Reject"})]})]}),d&&i.jsx(gs,{message:"Sign in to Saba Cloud (daimler.sabacloud.com) in Chrome, then try again."}),a.error&&!d&&i.jsx("div",{className:"alert alert-error text-sm font-mono whitespace-pre-wrap",children:i.jsx("span",{children:a.error})})]}),l&&i.jsxs("div",{className:"border-t border-base-300 p-3 space-y-4",children:[o.timetracking&&i.jsxs("div",{className:"space-y-3",children:[i.jsx("p",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Time Tracking"}),t?i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"text-xs opacity-50",children:[t.workingDaysElapsed," of ",t.workingDaysTotal," working days elapsed this month"]}),t.unreleasedDates.length>0&&i.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.unreleasedDates.map(f=>i.jsx("span",{className:"badge badge-warning badge-outline badge-sm",children:$b(f)},f))}),n.length>0&&i.jsx("div",{className:"space-y-2 pt-1",children:n.map(f=>{const g=Math.round((u.get(`${f.projectId}\0${f.activity}`)??0)*100)/100,h=Math.round((f.targetHours-g)*100)/100,w=Math.min(100,Math.round(g/f.targetHours*100)),k=h<=0;return i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center justify-between text-xs",children:[i.jsxs("span",{className:"font-medium",children:[s.get(f.projectId)??f.projectId,s.has(f.projectId)&&i.jsx("span",{className:"font-mono text-[0.6rem] opacity-50 ml-1",children:f.projectId}),i.jsxs("span",{className:"font-mono text-[0.6rem] opacity-40 ml-1",children:["· ",r.get(`${f.projectId}\0${f.activity}`)??f.activity]})]}),i.jsx("span",{className:`font-mono ${k?"text-success":"text-warning"}`,children:k?"✓ Goal met":`${h}h to go`})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("progress",{className:`progress flex-1 ${k?"progress-success":"progress-warning"}`,value:w,max:100}),i.jsxs("span",{className:"font-mono text-[0.65rem] opacity-50 w-20 text-right",children:[g,"h / ",f.targetHours,"h"]})]})]},f.id)})})]}):i.jsx("p",{className:"text-xs opacity-40",children:"Click Generate above to check your time tracking status."})]}),o.saba&&i.jsxs("div",{className:"space-y-3",children:[i.jsx("p",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Pending Training (Saba)"}),a.result&&m.length>0&&i.jsxs(i.Fragment,{children:[y>0&&i.jsxs("p",{className:"text-xs opacity-50",children:[y," due within 30 days"]}),i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"font-mono text-[0.6rem] uppercase tracking-[0.1em] opacity-50",children:[i.jsx("th",{children:"Course"}),i.jsx("th",{children:"Type"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Due"}),i.jsx("th",{children:"Urgency"})]})}),i.jsx("tbody",{children:m.map((f,g)=>i.jsxs("tr",{className:"hover",children:[i.jsx("td",{className:`font-medium text-sm ${f.isOverdue?"text-error":""}`,children:f.title??"—"}),i.jsx("td",{className:"font-mono text-xs opacity-60",children:f.type??"—"}),i.jsx("td",{className:"text-xs opacity-70",children:f.status??"—"}),i.jsx("td",{className:"font-mono text-xs",children:f.dueDate||"—"}),i.jsx("td",{children:i.jsx("span",{className:Db(f),children:Rb(f)})})]},g))})]})})]}),a.result&&m.length===0&&!a.error&&i.jsx("p",{className:"text-xs opacity-40",children:"You're all caught up."}),!a.result&&!a.error&&!a.running&&i.jsx("p",{className:"text-xs opacity-40",children:"Click Generate above to fetch your pending Saba training."})]})]})]})}const Sd=[{key:"timetracking",label:"Timetracking",icon:Rr},{key:"meetings",label:"Meetings",icon:H1},{key:"jira",label:"Jira",icon:np},{key:"git",label:"ADO (Git)",icon:Jm},{key:"saba",label:"Saba Training",icon:yv}];function ip(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 mo(){const e=new Date,t=e.getDay(),n=t===0?-6:1-t;return e.setDate(e.getDate()+n),ip(e)}function Cd(e,t){const n=new Date(e+"T00:00:00");return n.setDate(n.getDate()+t*7),ip(n)}function Fb(e){const t=new Date(e+"T00:00:00"),n=new Date(t);n.setDate(n.getDate()+4);const s=r=>r.toLocaleDateString("en-GB",{day:"numeric",month:"short"});return`${s(t)} – ${s(n)}, ${t.getFullYear()}`}function Bb(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`}function Ub(e){const t=Math.round((Date.now()-new Date(e).getTime())/1e3);if(t<5)return"just now";if(t<60)return`${t}s ago`;const n=Math.round(t/60);if(n<60)return`${n} min ago`;const s=Math.round(n/60);return s<24?`${s}h ago`:`${Math.round(s/24)}d ago`}function Wb(){const[e,t]=v.useState(mo()),[n]=v.useState(Bb()),[s,r]=v.useState(!1),[a,o]=v.useState(null),[l,c]=v.useState(null),[u,m]=v.useState(null),[d,p]=v.useState([]),[y,b]=v.useState(new Map),[x,j]=v.useState(new Map),[f,g]=v.useState({timetracking:!0,meetings:!0,jira:!0,git:!0,saba:!0}),h=ka();function w(M){g(U=>{const W={...U,[M]:!U[M]};return B.saveJournalSourcePrefs(W).catch(()=>{}),W})}function k(M){t(M),o(null),c(null),m(null),C(M)}async function C(M){try{const U=await B.getCachedJournal(M);U.data&&o(U.data),h.hydrate(U.saba??null)}catch{}}v.useEffect(()=>{B.getJournalSourcePrefs().then(M=>{M.prefs&&g(M.prefs)}).catch(()=>{}).finally(()=>{C(e)})},[]),v.useEffect(()=>{h.result&&B.cacheJournalSaba(e,h.result).catch(()=>{})},[h.result]);const S=e===mo(),N=Object.values(f).some(Boolean),T=Sd.filter(M=>f[M.key]).map(M=>M.label);async function A(M=!1){r(!0),c(null),m(null);const U=Date.now();f.timetracking&&(B.getGoals(n).then(W=>p(W.goals)).catch(()=>{}),B.getCachedProjects().then(W=>{if(W.data){const E=new Map,$=new Map;for(const I of W.data)I.projectId&&I.projectName&&E.set(I.projectId,I.projectName),I.projectId&&I.activityNumber&&I.activityName&&$.set(`${I.projectId}\0${I.activityNumber}`,I.activityName);b(E),j($)}}).catch(()=>{})),f.saba&&h.run("saba/pending-training",{});try{const W=await B.generateJournal({weekStart:e,sources:f,forceRefresh:M});m(Date.now()-U),o(W)}catch(W){c(W instanceof Error?W.message:"Unknown error")}finally{r(!1)}}return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsxs("div",{className:"mb-6",children:[i.jsxs("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] flex items-center gap-2",children:[i.jsx(K1,{className:"w-5 h-5 opacity-50","aria-hidden":"true"}),"Dev Work Journal"]}),i.jsx("p",{className:"text-sm opacity-50 mt-1",children:"Pulls your week's activity from the sources below so you can spot gaps before your report is due."})]}),i.jsxs("div",{className:"border border-base-300 p-4 mb-6 space-y-4",children:[i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("button",{className:"btn btn-sm btn-ghost btn-square",onClick:()=>k(Cd(e,-1)),disabled:s,"aria-label":"Previous week",children:i.jsx(X1,{className:"w-4 h-4"})}),i.jsxs("div",{className:"text-center min-w-[170px]",children:[i.jsx("div",{className:"font-medium leading-tight",children:Fb(e)}),i.jsx("div",{className:"font-mono text-[0.6rem] uppercase tracking-[0.1em] text-primary/70 h-4",children:S?"This week":" "})]}),i.jsx("button",{className:"btn btn-sm btn-ghost btn-square",onClick:()=>k(Cd(e,1)),disabled:s,"aria-label":"Next week",children:i.jsx(ev,{className:"w-4 h-4"})}),!S&&i.jsx("button",{className:"btn btn-xs btn-ghost ml-1",onClick:()=>k(mo()),disabled:s,children:"Today"})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[u!==null&&!s&&i.jsxs("span",{className:"font-mono text-[0.65rem] opacity-40",children:["Generated in ",(u/1e3).toFixed(1),"s"]}),i.jsx("button",{className:"btn btn-primary gap-2",onClick:()=>A(!0),disabled:s||!N,title:N?void 0:"Select at least one source first",children:s?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"loading loading-spinner loading-xs"}),"Generating…"]}):i.jsxs(i.Fragment,{children:[i.jsx(jl,{className:"w-4 h-4"}),"Generate"]})})]})]}),i.jsxs("div",{className:"border-t border-base-300 pt-3",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-2",children:"Sources"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:Sd.map(({key:M,label:U,icon:W})=>{const E=f[M];return i.jsxs("button",{type:"button",onClick:()=>w(M),disabled:s,"aria-pressed":E,className:`inline-flex items-center gap-1.5 px-3 py-1.5 border text-xs font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed ${E?"border-primary text-primary bg-primary/10":"border-base-300 text-base-content/40 hover:text-base-content/70 hover:border-base-content/30"}`,children:[i.jsx(W,{className:"w-3.5 h-3.5","aria-hidden":"true"}),U]},M)})}),!N&&i.jsx("p",{className:"text-xs text-warning mt-2",children:"Select at least one source to generate a journal."})]})]}),s&&i.jsxs("div",{className:"flex items-center gap-3 text-base-content/60 mb-4 border border-base-300 p-3",children:[i.jsx("span",{className:"loading loading-spinner loading-md"}),i.jsxs("span",{className:"text-sm",children:["Gathering data from ",T.join(", "),"…"]})]}),!a&&!s&&!l&&i.jsxs("div",{className:"border border-dashed border-base-300 p-8 text-center mb-6",children:[i.jsx(jl,{className:"w-6 h-6 mx-auto opacity-30 mb-2","aria-hidden":"true"}),i.jsx("p",{className:"text-sm opacity-50",children:"Pick a week and hit Generate to build your journal."})]}),l&&i.jsx("div",{role:"alert",className:"alert alert-error mb-4",children:i.jsx("span",{children:l})}),(a==null?void 0:a.cache)&&i.jsxs("div",{className:"flex items-center justify-between gap-3 border border-base-300 px-3 py-2 mb-4 text-xs",children:[i.jsxs("span",{className:"opacity-70",children:[a.cache.hit?"Cached result from":"Freshly fetched"," ",i.jsx("span",{className:`font-medium ${a.cache.hit?"text-warning":"text-success"}`,title:new Date(a.cache.fetchedAt).toLocaleString(),children:Ub(a.cache.fetchedAt)})]}),i.jsx("button",{type:"button",className:"btn btn-ghost btn-xs",onClick:()=>A(!0),disabled:s,children:"Refresh"})]}),i.jsx(zb,{month:n,monthly:(a==null?void 0:a.monthlyTimetracking)??null,goals:d,projectNames:y,activityNames:x,saba:h,enabled:{timetracking:f.timetracking,saba:f.saba}}),i.jsx("div",{className:"h-6"}),(a==null?void 0:a.status)==="partial"&&i.jsx("div",{role:"alert",className:"alert alert-warning text-sm mb-4",children:i.jsxs("div",{children:[i.jsx("p",{className:"font-semibold",children:"Some data sources were unavailable. Results may be incomplete."}),i.jsx("ul",{className:"list-disc list-inside mt-1",children:a.errors.map((M,U)=>i.jsx("li",{children:M},U))})]})}),a&&a.status!=="error"&&i.jsxs("div",{className:"space-y-6",children:[i.jsxs("section",{className:"space-y-4",children:[i.jsx("h3",{className:"font-mono text-[0.65rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Summary"}),i.jsx(Sb,{data:a})]}),i.jsxs("section",{className:"space-y-4",children:[i.jsx("h3",{className:"font-mono text-[0.65rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Daily Breakdown"}),i.jsx(Tb,{data:a,weekStart:e})]}),i.jsxs("section",{className:"space-y-4",children:[i.jsx("h3",{className:"font-mono text-[0.65rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Insights"}),i.jsx(Ob,{insights:a.insights,errors:a.errors,crossRef:a.crossRef})]})]}),(a==null?void 0:a.status)==="error"&&i.jsx("div",{role:"alert",className:"alert alert-error mb-4",children:i.jsxs("span",{children:["Failed to generate journal. ",a.errors.join("; ")]})})]})}const Hb={socket:"info",wiz:"secondary",tldrsec:"warning"},Vb={socket:"SOCKET",wiz:"WIZ",tldrsec:"TLDR SEC"};function Kb(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 Gb(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 a=Math.floor(r/24);return a===1?"yesterday":a<7?`${a}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric"})}catch{return e}}function qb(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 Yb(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 Qb(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 Ed={7:"Past 7 days",30:"Past 30 days"};function Jb(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 Xb(){const[e,t]=v.useState(7),[n,s]=v.useState("idle"),[r,a]=v.useState("idle"),[o,l]=v.useState("idle"),[c,u]=v.useState([]),[m,d]=v.useState([]),[p,y]=v.useState([]),[b,x]=v.useState(null),[j,f]=v.useState(null),[g,h]=v.useState(null),[w,k]=v.useState(null),[C,S]=v.useState(!1);v.useEffect(()=>{let E=!1;return B.getCachedSecurityNews().then($=>{if(!E&&$.data&&$.data.length>0){if(s(_=>_==="loading"?(E=!0,_):"done"),E)return;const I=[],z=[],L=[];for(const _ of $.data){const R=_;R.source==="wiz"?z.push(R):R.source==="tldrsec"?L.push(R):I.push(R)}u(I),d(z),y(L),k($.fetchedAt),S(!0),a("done"),l("done")}}).catch(()=>{}),()=>{E=!0}},[]);const N=n==="loading"||r==="loading"||o==="loading",T=c.length>0||m.length>0||p.length>0,A=v.useMemo(()=>[...c,...m,...p].filter($=>Kb($.date,e)).sort(($,I)=>new Date(I.date).getTime()-new Date($.date).getTime()),[c,m,p,e]),M=v.useMemo(()=>{const E=A.filter(z=>z.source==="socket").length,$=A.filter(z=>z.source==="wiz").length,I=A.filter(z=>z.source==="tldrsec").length;return{total:A.length,socketCount:E,wizCount:$,tldrsecCount:I}},[A]),U=v.useCallback(async()=>{s("loading"),a("loading"),l("loading"),x(null),f(null),h(null),u([]),d([]),y([]),S(!1);let E=[],$=[],I=[];const z=B.run("socket/security-news",{}).then(F=>{!F.ok&&F.error?(x(F.error),s("error")):(E=qb(F),u(E),s("done"))}).catch(F=>{x(F instanceof Error?F.message:"Failed to fetch"),s("error")}),L=B.run("wiz/blog-security",{}).then(F=>{!F.ok&&F.error?(f(F.error),a("error")):($=Yb(F),d($),a("done"))}).catch(F=>{f(F instanceof Error?F.message:"Failed to fetch"),a("error")}),_=B.run("tldrsec/newsletter",{}).then(F=>{!F.ok&&F.error?(h(F.error),l("error")):(I=Qb(F),y(I),l("done"))}).catch(F=>{h(F instanceof Error?F.message:"Failed to fetch"),l("error")});await Promise.allSettled([z,L,_]);const R=[...E,...$,...I];if(R.length>0){const F=new Date().toISOString();k(F),B.cacheSecurityNews(R).catch(()=>{})}},[]),W=E=>(E==null?void 0:E.includes("auth_required"))||(E==null?void 0:E.includes("sign in"));return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Security News"}),i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end gap-3 mb-6",children:[i.jsxs("label",{className:"form-control w-full sm:w-auto",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Range"}),i.jsxs("select",{className:"select select-bordered select-sm w-full sm:w-auto",value:e,onChange:E=>t(Number(E.target.value)),children:[i.jsx("option",{value:7,children:"Past 7 days"}),i.jsx("option",{value:30,children:"Past 30 days"})]})]}),i.jsx("button",{className:"btn btn-primary btn-sm w-full sm:w-auto",onClick:U,disabled:N,children:N?"Loading...":"Load news"}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(po,{label:"Socket",status:n}),i.jsx(po,{label:"Wiz",status:r}),i.jsx(po,{label:"tl;dr sec",status:o})]})]}),N&&i.jsx(wt,{label:"Fetching security news..."}),b&&(W(b)?i.jsx(gs,{message:"Sign in to Socket.dev in Chrome, then try again."}):i.jsx("div",{className:"alert alert-error mb-3",children:i.jsxs("span",{children:[i.jsx("span",{className:"font-semibold",children:"Socket:"})," ",b]})})),j&&(W(j)?i.jsx(gs,{message:"Sign in to Wiz in Chrome, then try again."}):i.jsx("div",{className:"alert alert-error mb-3",children:i.jsxs("span",{children:[i.jsx("span",{className:"font-semibold",children:"Wiz:"})," ",j]})})),g&&i.jsx("div",{className:"alert alert-error mb-3",children:i.jsxs("span",{children:[i.jsx("span",{className:"font-semibold",children:"tl;dr sec:"})," ",g]})}),w&&!N&&i.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-2",children:[C?"Showing cached data from":"Last fetched"," ",Jb(w)]}),T&&!N&&i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 border border-base-300 mb-6",children:[i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:Ed[e]}),i.jsx("div",{className:"font-display text-xl font-bold",children:M.total})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Socket"}),i.jsx("div",{className:"font-display text-xl font-bold",children:M.socketCount})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Wiz"}),i.jsx("div",{className:"font-display text-xl font-bold",children:M.wizCount})]}),i.jsxs("div",{className:"p-3",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"tl;dr sec"}),i.jsx("div",{className:"font-display text-xl font-bold",children:M.tldrsecCount})]})]}),A.length>0&&i.jsx("div",{className:"space-y-px",children:A.map((E,$)=>i.jsxs("article",{className:"border border-base-300 p-4",children:[i.jsxs("div",{className:"flex items-start justify-between gap-3 mb-2",children:[i.jsx("a",{href:E.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-semibold hover:text-primary transition-colors leading-snug",children:E.title}),i.jsx(K,{variant:Hb[E.source]??"neutral",size:"xs",children:Vb[E.source]??E.source.toUpperCase()})]}),E.summary&&i.jsx("p",{className:"text-sm opacity-60 leading-relaxed mb-2 line-clamp-2",children:E.summary}),i.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[i.jsx("span",{className:"font-mono text-[0.6rem] opacity-40",children:Gb(E.date)}),E.author&&i.jsx("span",{className:"font-mono text-[0.6rem] opacity-40",children:E.author}),E.tags&&i.jsx("div",{className:"flex gap-1 flex-wrap",children:E.tags.split(",").slice(0,3).map(I=>i.jsx(K,{variant:"neutral",size:"xs",children:I.trim()},I.trim()))})]})]},`${E.source}-${$}`))}),T&&A.length===0&&!N&&i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsxs("p",{className:"text-sm opacity-50 mb-1",children:["No news from the ",Ed[e].toLowerCase()]}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"All sources returned data, but nothing within the date window."})]}),!T&&!N&&!b&&!j&&!g&&i.jsxs("div",{className:"border border-base-300 p-8 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"Security news from Socket, Wiz, and tl;dr sec"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Select a range and press Load news to fetch the latest posts."})]})]})}function po({label:e,status:t}){const n={idle:"opacity-30",loading:"bg-warning animate-pulse",done:"bg-success",error:"bg-error"}[t];return i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:`w-1.5 h-1.5 ${n}`,"aria-hidden":"true"}),i.jsx("span",{className:"font-mono text-[0.6rem] opacity-50 uppercase",children:e})]})}function ci(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 Td(e){return e===null?"none":e<0?"expired":e<=7?"critical":e<=30?"warning":"ok"}function Zb(e,t){switch(e){case"expired":return i.jsx(K,{variant:"error",size:"xs",children:"EXPIRED"});case"critical":return i.jsxs(K,{variant:"error",size:"xs",children:[t,"d LEFT"]});case"warning":return i.jsxs(K,{variant:"warning",size:"xs",children:[t,"d LEFT"]});case"ok":return i.jsxs(K,{variant:"success",size:"xs",children:[t,"d LEFT"]});case"none":return i.jsx(K,{variant:"neutral",size:"xs",children:"NO EXPIRY"});default:return null}}function ej(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 tj(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 nj(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 sj(){const[e,t]=v.useState("idle"),[n,s]=v.useState(""),[r,a]=v.useState([]),[o,l]=v.useState(null),[c,u]=v.useState("all"),[m,d]=v.useState(null),[p,y]=v.useState(!1),b=e==="clients"||e==="trustedby";v.useEffect(()=>{let w=!1;return B.getCachedTrustedPeers().then(k=>{if(!w&&k.data&&k.data.length>0){if(t(S=>S==="clients"||S==="trustedby"?(w=!0,S):"done"),w)return;const C=k.data;a(C),d(k.fetchedAt),y(!0),s(`Loaded ${C.length} trusted peers from cache.`)}}).catch(()=>{}),()=>{w=!0}},[]);const x=v.useCallback(async()=>{t("clients"),l(null),a([]),y(!1),s("Fetching client list (all regions)...");try{const w=await B.run("tokenmaster/clients-list",{region:"all"});if(!w.ok&&w.error){l(w.error),t("error");return}const k=(w.data??[]).map(N=>({id:String(N.id??""),name:String(N.name??""),region:String(N.region??"emea")}));if(k.length===0){s("No clients found."),t("done");return}t("trustedby");const C=[],S=k.length;for(let N=0;N<k.length;N++){const T=k[N];s(`Fetching trusted peers... (${N+1}/${S}) — ${T.name||T.id}`);try{const A=await B.run("tokenmaster/client-trustedby",{clientid:T.id,region:T.region});if(A.ok&&A.data)for(const M of A.data)C.push({parentClientId:T.id,parentClientName:T.name||T.id,peerId:String(M.id??""),peerName:String(M.name??""),peerIdDisplay:String(M.idDisplay??""),expiryDate:M.expiry_date?String(M.expiry_date):null,region:String(M.region??T.region)})}catch{}}if(a(C),s(`Loaded ${C.length} trusted peers from ${S} clients.`),t("done"),C.length>0){const N=new Date().toISOString();d(N),B.cacheTrustedPeers(C).catch(()=>{})}}catch(w){l(w instanceof Error?w.message:"Unknown error"),t("error")}},[]),j=v.useMemo(()=>[...c==="all"?r:r.filter(k=>k.region===c)].sort((k,C)=>{const S=ci(k.expiryDate),N=ci(C.expiryDate);return S===null&&N===null?0:S===null?1:N===null?-1:S-N}),[r,c]),f=v.useMemo(()=>{let w=0,k=0,C=0;for(const S of j){const N=Td(ci(S.expiryDate));N==="expired"?w++:N==="critical"?k++:N==="warning"&&C++}return{total:j.length,expired:w,critical:k,warning:C}},[j]),g=v.useMemo(()=>{const w=new Set(r.map(k=>k.region));return Array.from(w).sort()},[r]),h=w=>(w==null?void 0:w.includes("auth_required"))||(w==null?void 0:w.includes("sign in"));return i.jsxs("div",{className:"max-w-5xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Trusted Peer Expiry"}),m&&!b&&i.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-3",children:[p?"Showing cached data from":"Last fetched"," ",nj(m)]}),i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end gap-3 mb-6",children:[i.jsxs("label",{className:"form-control w-full sm:w-auto",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Region"}),i.jsxs("select",{className:"select select-bordered select-sm w-full sm:w-auto",value:c,onChange:w=>u(w.target.value),children:[i.jsx("option",{value:"all",children:"All regions"}),g.map(w=>i.jsx("option",{value:w,children:w.toUpperCase()},w))]})]}),i.jsx("button",{className:"btn btn-primary btn-sm w-full sm:w-auto",onClick:x,disabled:b,children:b?"Loading...":"Load trusted peers"})]}),b&&i.jsx(wt,{label:n}),o&&(h(o)?i.jsx(gs,{message:"Sign in to TokenMaster in Chrome, then try again."}):i.jsx("div",{className:"alert alert-error mb-3",children:i.jsx("span",{children:o})})),r.length>0&&!b&&i.jsxs("div",{className:"grid grid-cols-4 border border-base-300 mb-6",children:[i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Total"}),i.jsx("div",{className:"font-display text-xl font-bold",children:f.total})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Expired"}),i.jsx("div",{className:`font-display text-xl font-bold ${f.expired>0?"text-red-500":""}`,children:f.expired})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"≤ 7 days"}),i.jsx("div",{className:`font-display text-xl font-bold ${f.critical>0?"text-red-500":""}`,children:f.critical})]}),i.jsxs("div",{className:"p-3",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"≤ 30 days"}),i.jsx("div",{className:`font-display text-xl font-bold ${f.warning>0?"text-amber-500":""}`,children:f.warning})]})]}),j.length>0&&i.jsx("div",{className:"border border-base-300 overflow-x-auto",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"border-b border-base-300",children:[i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Status"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Expiry Date"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Days Left"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Trusted Peer"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Peer ID"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Parent Client"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Region"})]})}),i.jsx("tbody",{children:j.map((w,k)=>{const C=ci(w.expiryDate),S=Td(C);return i.jsxs("tr",{className:`border-b border-base-300/50 ${tj(S)}`,children:[i.jsx("td",{children:Zb(S,C)}),i.jsx("td",{className:"font-mono text-sm",children:ej(w.expiryDate)}),i.jsx("td",{className:"font-mono text-sm",children:C!==null?C<0?`${Math.abs(C)}d overdue`:`${C}d`:"—"}),i.jsx("td",{className:"text-sm font-semibold",children:w.peerName||w.peerId}),i.jsx("td",{className:"font-mono text-xs opacity-60",children:w.peerIdDisplay||w.peerId}),i.jsx("td",{className:"text-sm",children:w.parentClientName}),i.jsx("td",{children:i.jsx(K,{variant:"neutral",size:"xs",children:w.region.toUpperCase()})})]},`${w.parentClientId}-${w.peerId}-${w.region}-${k}`)})})]})}),e==="done"&&!b&&r.length>0&&i.jsx("div",{className:"mt-1 font-mono text-xs opacity-40",children:n}),e==="done"&&r.length===0&&!b&&i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No trusted peers found"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"No clients returned from TokenMaster, or no trustedby relationships exist."})]}),e==="idle"&&i.jsxs("div",{className:"border border-base-300 p-8 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"TokenMaster trusted peer expiry monitor"}),i.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 rj={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"},ij={client:"bg-sky-400/20",daemon:"bg-amber-400/20",extension:"bg-emerald-400/20",browser:"bg-violet-400/20"};function Nl({flow:e}){const{lanes:t,steps:n,title:s}=e,r=t.length,a=`repeat(${r}, 1fr)`;return i.jsxs("div",{className:"border border-base-300 p-4 overflow-x-auto",children:[i.jsx("h4",{className:"font-semibold text-sm mb-3",children:s}),i.jsxs("div",{style:{minWidth:r*130},children:[i.jsx("div",{className:"grid",style:{gridTemplateColumns:a},children:t.map(o=>i.jsx("div",{className:"flex justify-center",children:i.jsx("span",{className:`px-2 py-1 text-[0.65rem] font-mono font-semibold border ${rj[o.color]}`,children:o.label})},o.id))}),i.jsxs("div",{className:"relative py-1",children:[i.jsx("div",{className:"absolute inset-0 grid pointer-events-none",style:{gridTemplateColumns:a},children:t.map(o=>i.jsx("div",{className:"flex justify-center",children:i.jsx("div",{className:`w-0.5 h-full ${ij[o.color]}`})},o.id))}),i.jsx("div",{className:"relative",children:n.map((o,l)=>{if(o.type==="action"){const j=(t.findIndex(f=>f.id===o.lane)+.5)/r*100;return i.jsx("div",{className:"relative",style:{height:26},children:i.jsx("div",{className:"absolute top-1/2 -translate-x-1/2 -translate-y-1/2 z-10",style:{left:`${j}%`},children:i.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})})},l)}const c=t.findIndex(x=>x.id===o.from),u=t.findIndex(x=>x.id===o.to),m=(c+.5)/r*100,d=(u+.5)/r*100,p=Math.min(m,d),y=Math.abs(d-m),b=c<u;return i.jsxs("div",{className:"relative",style:{height:30},children:[i.jsx("div",{className:"absolute top-1/2 h-px bg-base-content/20",style:{left:`${p}%`,width:`${y}%`}}),i.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:`${m}%`}}),i.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?"▸":"◂"}),i.jsx("div",{className:"absolute top-1/2 -translate-x-1/2 -translate-y-1/2 z-10",style:{left:`${(m+d)/2}%`},children:i.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})})]},l)})})]})]})]})}const aj=[{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}],oj=[{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."}],lj=[{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"}]}],cj=[{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 uj(){return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"Architecture"}),i.jsx("p",{className:"text-sm opacity-60 mb-6",children:"How commandGarden's components fit together."}),i.jsx("div",{id:"arch-diagram",className:"border border-base-300 p-5 mb-8 overflow-x-auto scroll-mt-4",children:i.jsxs("svg",{viewBox:"0 0 780 300",className:"w-full text-base-content",style:{minWidth:620},children:[i.jsxs("defs",{children:[i.jsx("marker",{id:"arch-ah",viewBox:"0 0 10 8",refX:"10",refY:"4",markerWidth:"7",markerHeight:"5",orient:"auto",children:i.jsx("path",{d:"M0 0L10 4L0 8z",fill:"currentColor",fillOpacity:.5})}),i.jsx("marker",{id:"arch-ah-rev",viewBox:"0 0 10 8",refX:"0",refY:"4",markerWidth:"7",markerHeight:"5",orient:"auto",children:i.jsx("path",{d:"M10 0L0 4L10 8z",fill:"currentColor",fillOpacity:.5})})]}),i.jsx("rect",{x:15,y:8,width:120,height:50,rx:3,fill:"rgba(56,189,248,0.15)",stroke:"rgba(56,189,248,0.6)",strokeWidth:1}),i.jsx("text",{x:75,y:29,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"CLI Client"}),i.jsx("text",{x:75,y:44,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.6,fontFamily:"ui-monospace,monospace",children:"Node.js"}),i.jsx("rect",{x:15,y:120,width:120,height:50,rx:3,fill:"rgba(56,189,248,0.15)",stroke:"rgba(56,189,248,0.6)",strokeWidth:1}),i.jsx("text",{x:75,y:141,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"GUI"}),i.jsx("text",{x:75,y:156,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.6,fontFamily:"ui-monospace,monospace",children:"React SPA"}),i.jsx("rect",{x:190,y:120,width:145,height:50,rx:3,fill:"rgba(251,191,36,0.15)",stroke:"rgba(251,191,36,0.6)",strokeWidth:1}),i.jsx("text",{x:262,y:141,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"App Server"}),i.jsx("text",{x:262,y:156,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.6,fontFamily:"ui-monospace,monospace",children:"Fastify :9092"}),i.jsx("rect",{x:395,y:10,width:160,height:84,rx:3,fill:"rgba(251,191,36,0.15)",stroke:"rgba(251,191,36,0.7)",strokeWidth:1.5}),i.jsx("text",{x:475,y:38,textAnchor:"middle",fill:"currentColor",fontSize:13,fontWeight:700,children:"Daemon"}),i.jsx("text",{x:475,y:56,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.6,fontFamily:"ui-monospace,monospace",children:"Fastify :9091"}),i.jsx("text",{x:475,y:78,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.45,fontFamily:"ui-monospace,monospace",children:"auth · registry · audit"}),i.jsx("rect",{x:615,y:20,width:150,height:60,rx:3,fill:"rgba(52,211,153,0.15)",stroke:"rgba(52,211,153,0.6)",strokeWidth:1}),i.jsx("text",{x:690,y:44,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"Extension"}),i.jsx("text",{x:690,y:62,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.6,fontFamily:"ui-monospace,monospace",children:"Chrome MV3"}),i.jsx("rect",{x:630,y:200,width:130,height:50,rx:3,fill:"rgba(167,139,250,0.15)",stroke:"rgba(167,139,250,0.6)",strokeWidth:1}),i.jsx("text",{x:695,y:221,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"Browser Tab"}),i.jsx("text",{x:695,y:237,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.6,fontFamily:"ui-monospace,monospace",children:"target page"}),i.jsx("rect",{x:195,y:240,width:100,height:36,rx:3,fill:"currentColor",fillOpacity:.08,stroke:"currentColor",strokeOpacity:.25,strokeWidth:1}),i.jsx("text",{x:245,y:257,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.65,children:"App DB"}),i.jsx("text",{x:245,y:269,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.45,fontFamily:"ui-monospace,monospace",children:"SQLite"}),i.jsx("rect",{x:390,y:200,width:105,height:36,rx:3,fill:"currentColor",fillOpacity:.08,stroke:"currentColor",strokeOpacity:.25,strokeWidth:1}),i.jsx("text",{x:442,y:217,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.65,children:"Audit Log"}),i.jsx("text",{x:442,y:229,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.45,fontFamily:"ui-monospace,monospace",children:"SQLite"}),i.jsx("rect",{x:500,y:200,width:85,height:36,rx:3,fill:"currentColor",fillOpacity:.08,stroke:"currentColor",strokeOpacity:.25,strokeWidth:1}),i.jsx("text",{x:542,y:217,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.65,children:"Config"}),i.jsx("text",{x:542,y:229,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.45,fontFamily:"ui-monospace,monospace",children:"YAML"}),i.jsx("rect",{x:75,y:200,width:105,height:36,rx:3,fill:"currentColor",fillOpacity:.08,stroke:"currentColor",strokeOpacity:.25,strokeWidth:1}),i.jsx("text",{x:127,y:217,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.65,children:"Session Token"}),i.jsx("text",{x:127,y:229,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.45,fontFamily:"ui-monospace,monospace",children:"file"}),i.jsx("line",{x1:137,y1:33,x2:393,y2:45,stroke:"currentColor",strokeOpacity:.35,markerEnd:"url(#arch-ah)"}),i.jsx("text",{x:255,y:28,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.6,fontFamily:"ui-monospace,monospace",children:"HTTP :9091"}),i.jsx("line",{x1:137,y1:145,x2:188,y2:145,stroke:"currentColor",strokeOpacity:.35,markerEnd:"url(#arch-ah)"}),i.jsx("line",{x1:337,y1:138,x2:393,y2:78,stroke:"currentColor",strokeOpacity:.35,markerEnd:"url(#arch-ah)"}),i.jsx("text",{x:354,y:97,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.6,fontFamily:"ui-monospace,monospace",children:"proxy"}),i.jsx("line",{x1:557,y1:50,x2:613,y2:50,stroke:"currentColor",strokeOpacity:.4,strokeWidth:1.5,markerEnd:"url(#arch-ah)",markerStart:"url(#arch-ah-rev)"}),i.jsx("text",{x:585,y:40,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.6,fontFamily:"ui-monospace,monospace",children:"WebSocket"}),i.jsx("line",{x1:695,y1:82,x2:695,y2:198,stroke:"currentColor",strokeOpacity:.35,markerEnd:"url(#arch-ah)"}),i.jsx("text",{x:720,y:132,fill:"currentColor",fontSize:8,opacity:.55,fontFamily:"ui-monospace,monospace",children:"Content"}),i.jsx("text",{x:720,y:144,fill:"currentColor",fontSize:8,opacity:.55,fontFamily:"ui-monospace,monospace",children:"Scripts"}),i.jsx("text",{x:720,y:160,fill:"currentColor",fontSize:8,opacity:.55,fontFamily:"ui-monospace,monospace",children:"+ CDP"}),i.jsx("line",{x1:245,y1:172,x2:245,y2:238,stroke:"currentColor",strokeOpacity:.2,strokeDasharray:"3 2"}),i.jsx("line",{x1:442,y1:96,x2:442,y2:198,stroke:"currentColor",strokeOpacity:.2,strokeDasharray:"3 2"}),i.jsx("line",{x1:520,y1:96,x2:542,y2:198,stroke:"currentColor",strokeOpacity:.2,strokeDasharray:"3 2"}),i.jsx("line",{x1:75,y1:60,x2:110,y2:198,stroke:"currentColor",strokeOpacity:.18,strokeDasharray:"3 2"}),i.jsx("line",{x1:200,y1:172,x2:155,y2:198,stroke:"currentColor",strokeOpacity:.18,strokeDasharray:"3 2"})]})}),i.jsx("h3",{id:"arch-components",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Components"}),i.jsx("div",{className:"space-y-2 mb-8",children:aj.map(e=>i.jsxs("div",{className:"border border-base-300 p-4",children:[i.jsxs("div",{className:"flex items-center gap-3 flex-wrap mb-1",children:[i.jsx("span",{className:"font-semibold",children:e.name}),i.jsx(K,{size:"xs",children:e.tech}),e.port&&i.jsxs(K,{variant:"info",size:"xs",children:[":",e.port]}),e.pkg&&i.jsx(K,{variant:"secondary",size:"xs",children:e.pkg})]}),i.jsx("p",{className:"text-sm opacity-60",children:e.desc})]},e.name))}),i.jsx("h3",{id:"arch-stores",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Data Stores"}),i.jsx("div",{className:"overflow-x-auto border border-base-300 mb-8",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{children:"Store"}),i.jsx("th",{children:"Format"}),i.jsx("th",{children:"Path"}),i.jsx("th",{children:"Purpose"})]})}),i.jsx("tbody",{children:oj.map(e=>i.jsxs("tr",{className:"hover:bg-base-200",children:[i.jsx("td",{className:"font-semibold text-sm",children:e.name}),i.jsx("td",{children:i.jsx(K,{size:"xs",children:e.tech})}),i.jsx("td",{className:"font-mono text-xs opacity-60",children:e.path}),i.jsx("td",{className:"text-sm opacity-60",children:e.desc})]},e.name))})]})}),i.jsx("h3",{id:"arch-flows",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Data Flows"}),i.jsxs("p",{className:"text-sm opacity-60 mb-4",children:["For a plain-language walkthrough of these same flows, see"," ",i.jsxs(we,{to:"/concepts",className:"text-primary hover:underline inline-flex items-center gap-1",children:["Concepts ",i.jsx(qe,{className:"w-3 h-3"})]}),"."]}),i.jsx("div",{className:"space-y-4 mb-8",children:lj.map(e=>i.jsx(Nl,{flow:e},e.title))}),i.jsx("h3",{id:"arch-security",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Security Model"}),i.jsx("div",{className:"border border-base-300 p-4 mb-8",children:i.jsxs("ul",{className:"space-y-2",children:[i.jsxs("li",{className:"text-sm opacity-70",children:[i.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."]}),i.jsxs("li",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold opacity-100",children:"Domain guard"})," — connector YAML declares allowed domains. Extension refuses to run on undeclared domains."]}),i.jsxs("li",{className:"text-sm opacity-70",children:[i.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."]}),i.jsxs("li",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold opacity-100",children:"Audit-or-fail"})," — if the audit store is unavailable, commands are blocked."]}),i.jsxs("li",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold opacity-100",children:"No credentials stored"})," — commandGarden reuses existing Chrome sessions. No passwords or cookies are persisted."]}),i.jsxs("li",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold opacity-100",children:"Localhost only"})," — daemon and app server bind to 127.0.0.1 by default."]})]})}),i.jsx("h3",{id:"arch-packages",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Workspace Packages"}),i.jsx("div",{className:"overflow-x-auto border border-base-300 mb-8",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{children:"Package"}),i.jsx("th",{children:"Description"}),i.jsx("th",{children:"Published"})]})}),i.jsx("tbody",{children:cj.map(e=>i.jsxs("tr",{className:"hover:bg-base-200",children:[i.jsx("td",{className:"font-mono text-sm font-semibold",children:e.name}),i.jsx("td",{className:"text-sm opacity-60",children:e.desc}),i.jsx("td",{children:e.published?i.jsx(K,{variant:"success",size:"xs",children:"npm"}):i.jsx(K,{size:"xs",children:"bundled"})})]},e.name))})]})}),i.jsx("h3",{id:"arch-build",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Build Order"}),i.jsxs("div",{className:"border border-base-300 p-4",children:[i.jsx("div",{className:"flex flex-wrap items-center gap-2 font-mono text-sm",children:["shared","daemon","cli","chrome","app"].map((e,t)=>i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"px-2 py-1 border border-base-300 bg-base-200",children:e}),t<4&&i.jsx("span",{className:"opacity-40",children:"→"})]},e))}),i.jsxs("p",{className:"text-sm opacity-60 mt-2",children:["Run ",i.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 dj={GET:"success",POST:"warning",PUT:"info",DELETE:"error",WS:"secondary",SSE:"secondary"},fj=[{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."}],hj=[{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 }"}],mj=[{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."}],pj=[{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 Ad({ep:e}){const[t,n]=v.useState(!1),s=e.params||e.body||e.response;return i.jsxs("div",{className:"border-b border-base-300/50 last:border-b-0",children:[i.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:[i.jsx(K,{variant:dj[e.method]??"neutral",size:"xs",className:"w-10 justify-center shrink-0",children:e.method}),i.jsx("span",{className:"font-mono text-sm flex-1",children:e.path}),e.auth&&i.jsx(K,{variant:"warning",size:"xs",children:"auth"}),s&&i.jsx("span",{className:"text-xs opacity-40",children:t?"▾":"▸"})]}),i.jsx("div",{className:"px-3 pb-2 pl-16 text-sm opacity-60",children:e.desc}),t&&s&&i.jsxs("div",{className:"px-3 pb-3 pl-16 space-y-1.5",children:[e.params&&i.jsxs("div",{className:"text-xs",children:[i.jsx("span",{className:"font-semibold opacity-50",children:"Params: "}),i.jsx("span",{className:"font-mono opacity-60",children:e.params})]}),e.body&&i.jsxs("div",{className:"text-xs",children:[i.jsx("span",{className:"font-semibold opacity-50",children:"Body: "}),i.jsx("code",{className:"font-mono bg-base-200 px-1 py-0.5 opacity-70",children:e.body})]}),e.response&&i.jsxs("div",{className:"text-xs",children:[i.jsx("span",{className:"font-semibold opacity-50",children:"Response: "}),i.jsx("code",{className:"font-mono bg-base-200 px-1 py-0.5 opacity-70",children:e.response})]})]})]})}function gj(){const[e,t]=v.useState("cli");return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"API & CLI Reference"}),i.jsx("p",{className:"text-sm opacity-60 mb-6",children:"CLI commands, Daemon API endpoints, and App Server endpoints."}),i.jsx("div",{id:"api-endpoints",className:"border border-base-300 bg-base-200/30 p-3 mb-6 scroll-mt-4",children:i.jsxs("p",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold",children:"Authentication:"})," Daemon endpoints (except ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"/api/status"})," and ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"/ws/extension"}),") require an ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"Authorization: Bearer <token>"})," header and an ",i.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."]})}),i.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=>i.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," ",i.jsx("span",{className:"font-mono text-xs opacity-40 ml-1",children:n.sub})]},n.id))}),e==="cli"&&i.jsx("div",{className:"space-y-2 mb-8",children:mj.map(n=>i.jsxs("div",{className:"border border-base-300 p-3",children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("code",{className:"font-mono text-sm font-semibold bg-base-200 px-2 py-0.5 shrink-0",children:n.cmd}),i.jsx("span",{className:"text-sm opacity-60 pt-0.5",children:n.desc})]}),n.args&&i.jsxs("div",{className:"mt-2 ml-1 text-xs",children:[i.jsx("span",{className:"font-semibold opacity-50",children:"Args: "}),i.jsx("span",{className:"opacity-60",children:n.args})]}),n.opts&&n.opts.length>0&&i.jsx("div",{className:"mt-1.5 ml-1 space-y-0.5",children:n.opts.map((s,r)=>i.jsx("div",{className:"text-xs font-mono opacity-50",children:s},r))}),n.example&&i.jsx("div",{className:"mt-2 ml-1",children:i.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"&&i.jsx("div",{className:"border border-base-300 mb-8",children:fj.map((n,s)=>i.jsx(Ad,{ep:n},s))}),e==="app-api"&&i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"text-sm opacity-50 mb-3",children:["The App Server on ",i.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."]}),i.jsx("div",{className:"border border-base-300 mb-8",children:hj.map((n,s)=>i.jsx(Ad,{ep:n},s))})]}),i.jsx("h3",{id:"api-pipeline",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Pipeline Steps"}),i.jsxs("p",{className:"text-sm opacity-50 mb-3",children:["Available steps for connector YAML pipeline definitions. For why each capability runs where it does, see"," ",i.jsxs(we,{to:"/concepts#concepts-worlds",className:"text-primary hover:underline inline-flex items-center gap-1",children:["Capability & World Model ",i.jsx(qe,{className:"w-3 h-3"})]}),"."]}),i.jsx("div",{className:"overflow-x-auto border border-base-300 mb-8",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{children:"Step"}),i.jsx("th",{children:"Capability"}),i.jsx("th",{children:"Description"})]})}),i.jsx("tbody",{children:pj.map(n=>i.jsxs("tr",{className:"hover:bg-base-200",children:[i.jsx("td",{className:"font-mono text-sm font-semibold",children:n.step}),i.jsx("td",{children:i.jsx(K,{size:"xs",variant:n.capability==="—"?"neutral":"info",children:n.capability})}),i.jsx("td",{className:"text-sm opacity-60",children:n.desc})]},n.step))})]})}),i.jsx("h3",{id:"api-expressions",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Expression Syntax"}),i.jsxs("div",{className:"border border-base-300 p-4",children:[i.jsxs("p",{className:"text-sm opacity-60 mb-3",children:["Use ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"${{ }}"})," for template expressions (no JS eval):"]}),i.jsxs("div",{className:"space-y-1.5 font-mono text-xs",children:[i.jsxs("div",{className:"flex gap-3",children:[i.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Variable access"}),i.jsx("code",{className:"opacity-70",children:"args.month, vars.token, cookies.name"})]}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Row access (map)"}),i.jsx("code",{className:"opacity-70",children:"row.id, row.name"})]}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Concatenation"}),i.jsx("code",{className:"opacity-70",children:'"Bearer " + vars.token'})]}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Pipe filters"}),i.jsx("code",{className:"opacity-70",children:'args.month | default("2026-06"), value | number, text | trim'})]})]})]})]})}function yj(e){const n=e.replace(/^---\s*\n[\s\S]*?\n---\s*\n/,"").split(`
458
- `),s=[];let r=null;for(const a of n){const o=a.match(/^(#{1,3})\s+(.+)/);o?(r&&s.push({heading:r.heading,body:r.lines.join(`
459
- `).trim()}),r={heading:o[2],lines:[]}):r?r.lines.push(a):a.trim()&&(r||(r={heading:"",lines:[]}),r.lines.push(a))}return r&&s.push({heading:r.heading,body:r.lines.join(`
460
- `).trim()}),s}function xj({content:e}){return i.jsx("pre",{className:"text-sm font-mono whitespace-pre-wrap opacity-70 leading-relaxed overflow-x-auto",children:e})}function Ld({file:e,defaultOpen:t}){const[n,s]=v.useState(t??!1),r=v.useMemo(()=>yj(e.content),[e.content]);return i.jsxs("div",{className:"border border-base-300/50",children:[i.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:[i.jsx("span",{className:"text-xs opacity-50",children:n?"▾":"▸"}),i.jsx("span",{className:"font-mono text-sm font-semibold",children:e.name}),i.jsxs("span",{className:"text-xs opacity-40",children:[r.length," ",r.length===1?"section":"sections"]})]}),n&&i.jsx("div",{className:"px-4 pb-4 space-y-4",children:r.map((a,o)=>i.jsxs("div",{children:[a.heading&&i.jsx("h5",{className:"font-mono text-xs font-semibold uppercase tracking-[0.08em] opacity-50 mb-2",children:a.heading}),i.jsx(xj,{content:a.body})]},o))})]})}function vj({skill:e}){const[t,n]=v.useState(!1),s=e.files.find(a=>a.name==="SKILL.md"),r=e.files.filter(a=>a.name!=="SKILL.md");return i.jsxs("div",{className:"border border-base-300",children:[i.jsx("div",{className:"p-4",children:i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-3 flex-wrap min-w-0",children:[i.jsx("span",{className:"font-mono text-base font-semibold",children:e.name}),i.jsxs(K,{size:"xs",children:[e.files.length," ",e.files.length===1?"file":"files"]})]}),i.jsx("button",{className:"btn btn-sm btn-ghost font-mono text-xs shrink-0",onClick:()=>n(!t),children:t?"Collapse":"View"})]})}),t&&i.jsxs("div",{className:"border-t border-base-300 p-4 space-y-3",children:[s&&i.jsx(Ld,{file:s,defaultOpen:!0}),r.map(a=>i.jsx(Ld,{file:a},a.name))]})]})}function bj(){const[e,t]=v.useState([]),[n,s]=v.useState(!0),[r,a]=v.useState(null);return v.useEffect(()=>{B.getSkills().then(o=>t(o.skills)).catch(o=>a(o instanceof Error?o.message:"Failed to load skills")).finally(()=>s(!1))},[]),n?i.jsx(wt,{label:"Loading skills..."}):i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"Skills"}),i.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?i.jsxs("div",{className:"border border-error/30 p-4",children:[i.jsx("p",{className:"text-sm text-error font-semibold mb-1",children:"Failed to load skills"}),i.jsx("p",{className:"font-mono text-xs opacity-60",children:r})]}):e.length===0?i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No skills found"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Skills should be located in the skills/ directory of the commandGarden package."})]}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"overflow-x-auto border border-base-300 mb-6",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{children:"Skill"}),i.jsx("th",{children:"Description"}),i.jsx("th",{children:"Files"})]})}),i.jsx("tbody",{children:e.map(o=>i.jsxs("tr",{className:"hover:bg-base-200",children:[i.jsx("td",{className:"font-mono text-sm font-semibold whitespace-nowrap",children:o.name}),i.jsx("td",{className:"text-sm opacity-60",children:o.description}),i.jsx("td",{className:"text-center",children:i.jsx(K,{size:"xs",children:o.files.length})})]},o.name))})]})}),i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Skill Details"}),i.jsx("div",{className:"space-y-3",children:e.map(o=>i.jsx(vj,{skill:o},o.name))}),i.jsxs("div",{className:"border border-base-300 p-4 mt-6",children:[i.jsx("h4",{className:"font-mono text-xs font-semibold uppercase tracking-[0.08em] opacity-50 mb-2",children:"Usage"}),i.jsxs("p",{className:"text-sm opacity-60 mb-2",children:["Copy a skill's ",i.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."]}),i.jsxs("div",{className:"font-mono text-xs opacity-40",children:[i.jsx("span",{children:"Windsurf: "}),i.jsx("code",{className:"bg-base-200 px-1 py-0.5",children:".windsurf/skills/"}),i.jsx("span",{className:"mx-2",children:"|"}),i.jsx("span",{children:"Claude: "}),i.jsx("code",{className:"bg-base-200 px-1 py-0.5",children:".claude/skills/"})]})]})]})]})}function un({children:e}){return i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.12em] mb-2",children:e})}function ui({children:e}){return i.jsx("pre",{className:"bg-base-200 border border-base-300 p-4 overflow-x-auto text-sm font-mono leading-relaxed",children:i.jsx("code",{children:e})})}const jj={success:Dc,warning:_c,error:qm},wj={success:"text-emerald-600 dark:text-emerald-400",warning:"text-amber-600 dark:text-amber-400",error:"text-red-600 dark:text-red-400"};function go({label:e,status:t}){const n=jj[t];return i.jsxs("span",{className:`inline-flex items-center gap-1.5 text-xs font-medium ${wj[t]}`,children:[i.jsx(n,{className:"w-3.5 h-3.5 shrink-0"}),e]})}const kj=[{label:"Return format",cg:{label:"Fixed schema",status:"success"},skills:{label:"Loose, varies",status:"warning"},mcp:{label:"Typed schema",status:"success"}},{label:"Parsing cost",cg:{label:"Zero tokens",status:"success"},skills:{label:"Tokens/call",status:"error"},mcp:{label:"Tool-call overhead",status:"warning"}},{label:"Auth handling",cg:{label:"Browser required",status:"warning"},skills:{label:"Agent navigates",status:"error"},mcp:{label:"Server-configured",status:"success"}},{label:"Processing",cg:{label:"Local only",status:"success"},skills:{label:"Cloud/agent",status:"warning"},mcp:{label:"Server-side",status:"warning"}},{label:"Privacy",cg:{label:"Stays on machine",status:"success"},skills:{label:"Through AI",status:"error"},mcp:{label:"Through server",status:"warning"}},{label:"Coverage",cg:{label:"Any website",status:"success"},skills:{label:"Any (expensive)",status:"warning"},mcp:{label:"Server-limited",status:"warning"}}];function Nj(){return i.jsxs("div",{className:"max-w-4xl mx-auto pb-20",children:[i.jsxs("section",{className:"pt-8 pb-16 border-b border-base-300",children:[i.jsx(un,{children:"For engineers tired of copy-pasting from internal portals"}),i.jsx("h1",{className:"font-display text-3xl sm:text-4xl font-bold tracking-tight leading-tight mb-3",style:{textWrap:"balance"},children:"Turn any website into a CLI command."}),i.jsx("p",{className:"text-base sm:text-lg opacity-70 max-w-[65ch] mb-8 leading-relaxed",style:{textWrap:"pretty"},children:"commandGarden reuses your existing browser sessions to extract structured data from authenticated websites. You're already logged in — it just reads what's on screen."}),i.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-8 font-mono text-xs",children:[{label:"cg run",color:"border-sky-500/50 bg-sky-500/10 text-sky-700 dark:text-sky-400"},{label:"Daemon",color:"border-amber-500/50 bg-amber-500/10 text-amber-700 dark:text-amber-400"},{label:"Chrome Extension",color:"border-emerald-500/50 bg-emerald-500/10 text-emerald-700 dark:text-emerald-400"},{label:"Browser Tab",color:"border-violet-500/50 bg-violet-500/10 text-violet-700 dark:text-violet-400"},{label:"Structured JSON",color:"border-primary/50 bg-primary/10 text-primary"}].map((e,t)=>i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx("span",{className:`px-2.5 py-1 border font-semibold ${e.color}`,children:e.label}),t<4&&i.jsx("span",{className:"opacity-30",children:"→"})]},e.label))}),i.jsx(ui,{children:"npm install -g @commandgarden/cli"})]}),i.jsxs("section",{id:"why-problem",className:"py-16 border-b border-base-300 scroll-mt-4",children:[i.jsx(un,{children:"Where the data actually lives"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-8",children:"The Problem"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-12",children:[i.jsxs("div",{className:"border border-base-300 p-5",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(oi,{className:"w-4 h-4 text-primary"}),i.jsx("h3",{className:"font-display font-semibold text-sm",children:"Real-world data lives in browsers"})]}),i.jsx("p",{className:"text-sm opacity-70 leading-relaxed",children:"AI agents can't reach data inside enterprise tools and SaaS dashboards. These systems are where the work happens, but they're locked behind browser sessions."})]}),i.jsxs("div",{className:"border border-base-300 p-5",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(qm,{className:"w-4 h-4 text-error"}),i.jsx("h3",{className:"font-display font-semibold text-sm",children:"APIs are the exception"})]}),i.jsx("p",{className:"text-sm opacity-70 leading-relaxed",children:"Most sites don't provide APIs. When one exists, you need service accounts and OAuth flows before you see a single row of data. What's visible in the UI often has no programmatic equivalent."})]}),i.jsxs("div",{className:"border border-base-300 p-5",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(_c,{className:"w-4 h-4 text-warning"}),i.jsx("h3",{className:"font-display font-semibold text-sm",children:"Browser automation is expensive"})]}),i.jsx("p",{className:"text-sm opacity-70 leading-relaxed",children:"AI browser tools like Playwright burn tokens on every interaction just to understand what's on screen — even when the page layout hasn't changed."})]})]}),i.jsx("p",{className:"text-sm opacity-50 max-w-[65ch]",children:"Skills, MCP servers, and browser agents all re-parse page structure on every call. That parsing only needs to happen once."})]}),i.jsxs("section",{id:"why-solution",className:"py-16 border-b border-base-300 scroll-mt-4",children:[i.jsx(un,{children:"How commandGarden works"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"The Solution"}),i.jsxs("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-10",children:["commandGarden replaces ad-hoc browser automation with ",i.jsx("strong",{className:"text-base-content",children:"connectors"}),": pre-built recipes that know how to navigate a site and return structured JSON. The agent (or a human) runs one CLI command and gets back a fixed-schema response, instead of re-parsing the page from scratch."]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[i.jsxs("div",{className:"border border-error/20 bg-error/[0.03] p-5",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium text-error/60 uppercase tracking-[0.12em] mb-4",children:"Without commandGarden"}),i.jsx("div",{className:"space-y-0",children:[{label:"Task received",note:"agent or human",struck:!1},{label:"Launch browser",note:"headless instance",struck:!0},{label:"Navigate + Wait",note:"auth redirects",struck:!0},{label:"Parse HTML",note:"tokens for structure",struck:!0},{label:"Extract Data",note:"tokens for content",struck:!0},{label:"Loose output",note:"varies per run",struck:!1}].map((e,t)=>i.jsxs("div",{children:[i.jsxs("div",{className:`flex items-center gap-2.5 ${e.struck?"opacity-40 line-through decoration-error/50":""}`,children:[i.jsx("span",{className:`w-5 h-5 border flex items-center justify-center font-mono text-[0.6rem] shrink-0 ${e.struck?"border-error/20 text-error/40":"border-error/30 bg-error/10 text-error/60"}`,children:t+1}),i.jsx("span",{className:"text-sm font-medium",children:e.label}),i.jsx("span",{className:"text-xs opacity-40 font-mono",children:e.note})]}),t<5&&i.jsx("div",{className:`ml-2.5 w-px h-2 ${e.struck?"bg-error/15":"bg-error/20"}`})]},t))})]}),i.jsxs("div",{className:"border border-primary/20 bg-primary/[0.03] p-5 flex flex-col",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium text-primary/60 uppercase tracking-[0.12em] mb-4",children:"With commandGarden"}),i.jsx("div",{className:"space-y-0",children:[{label:"Task received",note:"agent or human"},{label:"cg run site/command",note:"one CLI call",accent:!0},{label:"Structured JSON",note:"fixed schema"}].map((e,t)=>i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("span",{className:"w-5 h-5 border border-primary/30 bg-primary/10 flex items-center justify-center font-mono text-[0.6rem] text-primary/60 shrink-0",children:t+1}),i.jsx("span",{className:`text-sm font-medium ${"accent"in e&&e.accent?"text-primary font-semibold":""}`,children:e.label}),i.jsx("span",{className:"text-xs opacity-40 font-mono",children:e.note})]}),t<2&&i.jsx("div",{className:"ml-2.5 w-px h-2 bg-primary/20"})]},t))})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-14",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(K,{variant:"error",size:"xs",children:"thousands of tokens"}),i.jsx("span",{className:"text-xs opacity-50",children:"per interaction"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(K,{variant:"success",size:"xs",children:"0 tokens"}),i.jsx("span",{className:"text-xs opacity-50",children:"parsing done locally"})]})]}),i.jsxs("div",{className:"space-y-8 mb-12",children:[i.jsxs("div",{className:"flex gap-4",children:[i.jsx(oi,{className:"w-5 h-5 shrink-0 mt-0.5 text-primary"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-display font-semibold mb-1",children:"Reuse your browser session"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[60ch] leading-relaxed",children:"A Chrome extension runs inside your already-authenticated browser. No separate login, no stored credentials."})]})]}),i.jsxs("div",{className:"flex gap-4",children:[i.jsx(ho,{className:"w-5 h-5 shrink-0 mt-0.5 text-primary"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-display font-semibold mb-1",children:"Fixed-format parsing, done locally"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[60ch] leading-relaxed",children:"Each connector defines a pipeline that produces the same output shape on every run. Parsing happens in the extension and daemon — nothing leaves your machine."})]})]}),i.jsxs("div",{className:"flex gap-4",children:[i.jsx(Ci,{className:"w-5 h-5 shrink-0 mt-0.5 text-primary"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-display font-semibold mb-1",children:"One CLI for humans and AI agents"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[60ch] leading-relaxed mb-3",children:"The same command works whether a human types it or an AI agent calls it via a skill. Same arguments, same JSON schema."}),i.jsx(ui,{children:"cg run timetracking/report --month 2026-06"})]})]})]}),i.jsx("h3",{className:"font-display font-semibold text-sm mb-3",children:"How it compares"}),i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{className:"sticky left-0 z-10 bg-base-200"}),i.jsx("th",{className:"bg-primary/10 border-x border-primary/20 text-primary",children:"commandGarden"}),i.jsx("th",{children:"AI Skills"}),i.jsx("th",{children:"MCP Servers"})]})}),i.jsx("tbody",{children:kj.map(e=>i.jsxs("tr",{children:[i.jsx("td",{className:"sticky left-0 z-10 bg-base-100 font-mono text-xs font-medium border-r border-base-300",children:e.label}),i.jsx("td",{className:"bg-primary/5 border-x border-primary/20",children:i.jsx(go,{...e.cg})}),i.jsx("td",{children:i.jsx(go,{...e.skills})}),i.jsx("td",{children:i.jsx(go,{...e.mcp})})]},e.label))})]})}),i.jsxs("p",{className:"text-sm opacity-50 mt-4 max-w-[65ch]",children:["Skills and MCP provide the integration layer; commandGarden does the extraction and parsing locally. The ",i.jsx("span",{className:"font-mono",children:"cg"})," skill lets AI agents call commandGarden commands directly."]})]}),i.jsx("section",{id:"why-architecture",className:"py-16 border-b border-base-300 bg-base-200/30 -mx-4 px-4 md:-mx-5 md:px-5 scroll-mt-4",children:i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx(un,{children:"Five processes, all on localhost"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Architecture"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-8",children:"All communication stays on localhost. Here's what each piece does."}),i.jsx("div",{className:"border border-base-300 bg-base-100 p-5 mb-8 overflow-x-auto",children:i.jsxs("svg",{viewBox:"0 0 700 260",className:"w-full text-base-content",style:{minWidth:560},children:[i.jsxs("defs",{children:[i.jsx("marker",{id:"why-ah",viewBox:"0 0 10 8",refX:"10",refY:"4",markerWidth:"7",markerHeight:"5",orient:"auto",children:i.jsx("path",{d:"M0 0L10 4L0 8z",fill:"currentColor",fillOpacity:.5})}),i.jsx("marker",{id:"why-ah-rev",viewBox:"0 0 10 8",refX:"0",refY:"4",markerWidth:"7",markerHeight:"5",orient:"auto",children:i.jsx("path",{d:"M10 0L0 4L10 8z",fill:"currentColor",fillOpacity:.5})})]}),i.jsx("rect",{x:10,y:10,width:110,height:46,rx:0,fill:"rgba(56,189,248,0.15)",stroke:"rgba(56,189,248,0.6)",strokeWidth:1}),i.jsx("text",{x:65,y:30,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"CLI"}),i.jsx("text",{x:65,y:44,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.6,fontFamily:"ui-monospace,monospace",children:"cg run ..."}),i.jsx("rect",{x:10,y:80,width:110,height:46,rx:0,fill:"rgba(56,189,248,0.15)",stroke:"rgba(56,189,248,0.6)",strokeWidth:1}),i.jsx("text",{x:65,y:100,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"GUI"}),i.jsx("text",{x:65,y:114,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.6,fontFamily:"ui-monospace,monospace",children:"React SPA"}),i.jsx("rect",{x:160,y:80,width:120,height:46,rx:0,fill:"rgba(251,191,36,0.15)",stroke:"rgba(251,191,36,0.6)",strokeWidth:1}),i.jsx("text",{x:220,y:100,textAnchor:"middle",fill:"currentColor",fontSize:10,fontWeight:600,children:"App Server"}),i.jsx("text",{x:220,y:114,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.6,fontFamily:"ui-monospace,monospace",children:":9092"}),i.jsx("rect",{x:320,y:15,width:150,height:76,rx:0,fill:"rgba(251,191,36,0.15)",stroke:"rgba(251,191,36,0.7)",strokeWidth:1.5}),i.jsx("text",{x:395,y:40,textAnchor:"middle",fill:"currentColor",fontSize:13,fontWeight:700,children:"Daemon"}),i.jsx("text",{x:395,y:56,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.6,fontFamily:"ui-monospace,monospace",children:"Fastify :9091"}),i.jsx("text",{x:395,y:78,textAnchor:"middle",fill:"currentColor",fontSize:7,opacity:.45,fontFamily:"ui-monospace,monospace",children:"auth · registry · audit"}),i.jsx("rect",{x:520,y:20,width:130,height:55,rx:0,fill:"rgba(52,211,153,0.15)",stroke:"rgba(52,211,153,0.6)",strokeWidth:1}),i.jsx("text",{x:585,y:42,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"Extension"}),i.jsx("text",{x:585,y:58,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.6,fontFamily:"ui-monospace,monospace",children:"Chrome MV3"}),i.jsx("rect",{x:530,y:160,width:120,height:46,rx:0,fill:"rgba(167,139,250,0.15)",stroke:"rgba(167,139,250,0.6)",strokeWidth:1}),i.jsx("text",{x:590,y:180,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"Browser Tab"}),i.jsx("text",{x:590,y:194,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.6,fontFamily:"ui-monospace,monospace",children:"target page"}),i.jsx("rect",{x:310,y:170,width:90,height:30,rx:0,fill:"currentColor",fillOpacity:.08,stroke:"currentColor",strokeOpacity:.25,strokeWidth:1}),i.jsx("text",{x:355,y:188,textAnchor:"middle",fill:"currentColor",fontSize:8,fontWeight:500,opacity:.65,children:"Audit Log"}),i.jsx("rect",{x:410,y:170,width:80,height:30,rx:0,fill:"currentColor",fillOpacity:.08,stroke:"currentColor",strokeOpacity:.25,strokeWidth:1}),i.jsx("text",{x:450,y:188,textAnchor:"middle",fill:"currentColor",fontSize:8,fontWeight:500,opacity:.65,children:"Config"}),i.jsx("rect",{x:160,y:170,width:90,height:30,rx:0,fill:"currentColor",fillOpacity:.08,stroke:"currentColor",strokeOpacity:.25,strokeWidth:1}),i.jsx("text",{x:205,y:188,textAnchor:"middle",fill:"currentColor",fontSize:8,fontWeight:500,opacity:.65,children:"App DB"}),i.jsx("line",{x1:122,y1:33,x2:318,y2:45,stroke:"currentColor",strokeOpacity:.35,markerEnd:"url(#why-ah)"}),i.jsx("text",{x:210,y:28,textAnchor:"middle",fill:"currentColor",fontSize:7,opacity:.6,fontFamily:"ui-monospace,monospace",children:"HTTP"}),i.jsx("line",{x1:122,y1:103,x2:158,y2:103,stroke:"currentColor",strokeOpacity:.35,markerEnd:"url(#why-ah)"}),i.jsx("line",{x1:282,y1:96,x2:318,y2:72,stroke:"currentColor",strokeOpacity:.35,markerEnd:"url(#why-ah)"}),i.jsx("text",{x:295,y:76,textAnchor:"middle",fill:"currentColor",fontSize:7,opacity:.6,fontFamily:"ui-monospace,monospace",children:"proxy"}),i.jsx("line",{x1:472,y1:48,x2:518,y2:48,stroke:"currentColor",strokeOpacity:.4,strokeWidth:1.5,markerEnd:"url(#why-ah)",markerStart:"url(#why-ah-rev)"}),i.jsx("text",{x:495,y:38,textAnchor:"middle",fill:"currentColor",fontSize:7,opacity:.6,fontFamily:"ui-monospace,monospace",children:"WebSocket"}),i.jsx("line",{x1:590,y1:77,x2:590,y2:158,stroke:"currentColor",strokeOpacity:.35,markerEnd:"url(#why-ah)"}),i.jsx("line",{x1:370,y1:93,x2:365,y2:168,stroke:"currentColor",strokeOpacity:.2,strokeDasharray:"3 2"}),i.jsx("line",{x1:430,y1:93,x2:445,y2:168,stroke:"currentColor",strokeOpacity:.2,strokeDasharray:"3 2"}),i.jsx("line",{x1:210,y1:128,x2:210,y2:168,stroke:"currentColor",strokeOpacity:.2,strokeDasharray:"3 2"})]})}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-6",children:[{icon:Ci,title:"CLI",mono:"cg",desc:"Entry point for humans and AI agents. One command in, JSON out."},{icon:bl,title:"Daemon",mono:":9091",desc:"Validates auth and capabilities, loads connectors, writes audit log."},{icon:oi,title:"Extension",mono:"MV3",desc:"Runs inside your authenticated Chrome. Accesses cookies and page data."},{icon:ho,title:"Connectors",mono:"YAML",desc:"Declarative pipelines: navigate → wait → extract → map. No code execution."},{icon:gd,title:"Audit Log",mono:"SQLite",desc:"Every execution logged: connector, domains, timing, approvals."},{icon:Dv,title:"GUI",mono:":9092",desc:"React SPA with app pages, connector browsing, and config management."}].map(({icon:e,title:t,mono:n,desc:s})=>i.jsxs("div",{className:"flex gap-3 p-3 border border-base-300 bg-base-100",children:[i.jsx(e,{className:"w-4 h-4 shrink-0 mt-0.5 opacity-40"}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-baseline gap-1.5 mb-0.5",children:[i.jsx("span",{className:"font-display font-semibold text-sm",children:t}),i.jsx("span",{className:"font-mono text-[0.65rem] opacity-40",children:n})]}),i.jsx("p",{className:"text-xs opacity-60 leading-relaxed",children:s})]})]},t))}),i.jsxs("div",{className:"flex flex-wrap gap-4",children:[i.jsxs(we,{to:"/architecture",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Full architecture details ",i.jsx(qe,{className:"w-3 h-3"})]}),i.jsxs(we,{to:"/concepts",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Concepts deep dive ",i.jsx(qe,{className:"w-3 h-3"})]})]})]})}),i.jsxs("section",{id:"why-apps",className:"py-16 border-b border-base-300 scroll-mt-4",children:[i.jsx(un,{children:"Ships with six connectors"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Built-in Apps"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-8",children:"commandGarden ships with connectors and app pages for common enterprise tasks. Each runs on your local machine using your browser session."}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[{icon:Rr,title:"Time Tracking",tag:"Administrative",desc:"Monthly report with project breakdown and summary cards",route:"/apps/timetracking",cmd:"timetracking/report"},{icon:Ym,title:"Room Availability",tag:"Administrative",desc:"Meeting room free/busy from Outlook Scheduling Assistant",route:"/apps/rooms",cmd:"teams/room-availability"},{icon:Gm,title:"Dev Journal",tag:"Productivity",desc:"Auto-generated daily journal from Git commits and Jira tickets",route:"/apps/journal",cmd:"ado/git-commits"},{icon:Zm,title:"Security News",tag:"Security",desc:"Aggregated feed from Socket.dev, Wiz, and tl;dr sec",route:"/apps/security-news",cmd:"socket/security-news"},{icon:jv,title:"Trusted Peer Expiry",tag:"Productivity",desc:"TokenMaster client trust relationships with expiry tracking",route:"/apps/trusted-peer-expiry",cmd:"tokenmaster/clients-list"},{icon:Ev,title:"GCS Knowledge Base",tag:"Security",desc:"Browse and read internal security docs, converted to Markdown",route:null,cmd:"gcs/kb-pages"}].map(({icon:e,title:t,tag:n,desc:s,route:r,cmd:a})=>i.jsxs("div",{className:"border border-base-300 p-4",children:[i.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[i.jsx(e,{className:"w-4 h-4 shrink-0 mt-0.5 opacity-40"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("span",{className:"font-display font-semibold text-sm",children:t}),i.jsx(K,{size:"xs",children:n})]}),i.jsx("p",{className:"text-xs opacity-60 leading-relaxed",children:s})]})]}),i.jsxs("div",{className:"flex items-center justify-between mt-3 pt-2 border-t border-base-300/50",children:[i.jsxs("span",{className:"font-mono text-[0.65rem] opacity-30",children:["cg run ",a]}),r&&i.jsxs(we,{to:r,className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Open ",i.jsx(qe,{className:"w-3 h-3"})]})]})]},t))}),i.jsx("p",{className:"text-xs opacity-40 mt-4 max-w-[65ch]",children:"Each app page combines multiple connector calls into a single view. The GUI handles layout and caching; the connectors provide the raw data."})]}),i.jsxs("section",{id:"why-happy-path",className:"py-16 border-b border-base-300 scroll-mt-4",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-8",children:"From install to first result"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(Ci,{className:"w-4 h-4 opacity-40"}),i.jsx("h3",{className:"font-display font-semibold text-sm",children:"Human user"})]}),i.jsx("div",{className:"space-y-3 mb-4",children:[{step:"Install",cmd:"npm install -g @commandgarden/cli"},{step:"Start",cmd:"cg up"},{step:"Load extension",cmd:"chrome://extensions → Load unpacked"},{step:"Verify",cmd:"cg daemon status"},{step:"Run",cmd:"cg run timetracking/report --month 2026-06"}].map((e,t)=>i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("span",{className:"w-5 h-5 border border-base-300 bg-base-200 flex items-center justify-center font-mono text-[0.6rem] opacity-50 shrink-0",children:t+1}),i.jsx("span",{className:"text-xs font-medium opacity-60",children:e.step})]}),i.jsx("div",{className:"ml-[1.875rem] mt-1",children:i.jsx("code",{className:"text-xs font-mono bg-base-200 border border-base-300 px-2 py-0.5 opacity-70",children:e.cmd})}),t<4&&i.jsx("div",{className:"ml-2.5 w-px h-2 bg-base-300"})]},t))}),i.jsxs("p",{className:"text-xs opacity-50 ml-[1.875rem]",children:["Or open the GUI at ",i.jsx("span",{className:"font-mono",children:"localhost:9092"})," and use the visual interface."]})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(oi,{className:"w-4 h-4 opacity-40"}),i.jsx("h3",{className:"font-display font-semibold text-sm",children:"AI agent"})]}),i.jsx("div",{className:"space-y-3 mb-4",children:[{step:"Load skill",cmd:"cg skill loaded"},{step:"Check status",cmd:"cg daemon status → ready"},{step:"Discover",cmd:"cg list → available connectors"},{step:"Inspect",cmd:"cg inspect timetracking/report → args, columns"},{step:"Run",cmd:"cg run timetracking/report --format json"}].map((e,t)=>i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("span",{className:"w-5 h-5 border border-base-300 bg-base-200 flex items-center justify-center font-mono text-[0.6rem] opacity-50 shrink-0",children:t+1}),i.jsx("span",{className:"text-xs font-medium opacity-60",children:e.step})]}),i.jsx("div",{className:"ml-[1.875rem] mt-1",children:i.jsx("code",{className:"text-xs font-mono bg-base-200 border border-base-300 px-2 py-0.5 opacity-70",children:e.cmd})}),t<4&&i.jsx("div",{className:"ml-2.5 w-px h-2 bg-base-300"})]},t))}),i.jsx("p",{className:"text-xs opacity-50 ml-[1.875rem]",children:"Same JSON, same schema as the human path."})]})]}),i.jsxs("div",{className:"mt-8 border border-primary/20 bg-primary/[0.03] p-4 flex items-center gap-3",children:[i.jsx(Dc,{className:"w-4 h-4 text-primary shrink-0"}),i.jsx("p",{className:"text-sm opacity-70",children:"Human or agent, the output is the same. Same connector, same schema."})]})]}),i.jsx("section",{id:"why-security",className:"py-16 border-b border-base-300 bg-base-200/30 -mx-4 px-4 md:-mx-5 md:px-5 scroll-mt-4",children:i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx(un,{children:"Touching enterprise data means no shortcuts"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Security"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-8",children:"This tool has access to your cookies and session tokens. That's a lot of trust, so the defaults are locked down — you have to explicitly open things up."}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-8",children:[{icon:Xm,title:"No credentials stored",desc:"Reuses session cookies already in Chrome. Nothing stored on disk, nothing sent externally."},{icon:qv,title:"Domain-scoped permissions",desc:"Connectors declare allowed domains. Undeclared domains are blocked by the daemon."},{icon:Qm,title:"Capability gating",desc:"Each step requires a declared capability. High-risk ops (js_evaluate, cookie_write) need approval."},{icon:hv,title:"Step-by-step approval",desc:"Sensitive operations pause for confirmation. Approve in CLI or via Chrome notification."},{icon:bl,title:"Local-only processing",desc:"Daemon on :9091, app server on :9092. Bound to localhost. No network exposure."},{icon:ho,title:"Declarative connectors",desc:"Pure YAML pipelines. No JavaScript evaluation unless explicitly declared and approved."},{icon:ep,title:"Audit-or-fail",desc:"Every execution logged to SQLite. Domains, timing, approvals, row counts. If audit fails, commands are blocked."},{icon:gd,title:"Per-session auth",desc:"Session token generated on startup with owner-only permissions. Extension verifies its own ID per message."}].map(({icon:e,title:t,desc:n})=>i.jsxs("div",{className:"flex gap-3 p-3 border border-base-300 bg-base-100",children:[i.jsx(e,{className:"w-4 h-4 shrink-0 mt-0.5 opacity-40"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-display font-semibold text-sm mb-0.5",children:t}),i.jsx("p",{className:"text-xs opacity-60 leading-relaxed",children:n})]})]},t))}),i.jsxs("div",{className:"border border-base-300 bg-base-100 p-5",children:[i.jsx("h3",{className:"font-mono text-xs font-medium opacity-50 uppercase tracking-wide mb-3",children:"Limitations"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-1.5 text-sm opacity-70",children:[i.jsx("p",{children:"Only works while browser is open and you're logged in."}),i.jsx("p",{children:"Connectors may break when a site redesigns its HTML/APIs."}),i.jsx("p",{children:"Chrome-based browsers only for now."}),i.jsx("p",{children:"No credential storage, so sessions expire when you log out."})]})]})]})}),i.jsxs("section",{id:"why-get-started",className:"py-16 border-b border-base-300 scroll-mt-4",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Get started in 60 seconds"}),i.jsx(ui,{children:`# Install
461
- npm install -g @commandgarden/cli
462
-
463
- # Start the daemon and GUI
464
- cg up
465
-
466
- # Load the Chrome extension
467
- # Chrome → chrome://extensions → Developer mode → Load unpacked
468
-
469
- # Run your first connector
470
- cg run socket/security-news --format table`}),i.jsxs("div",{className:"flex flex-wrap gap-4 mt-6",children:[i.jsxs(we,{to:"/guide",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Setup Guide ",i.jsx(qe,{className:"w-3 h-3"})]}),i.jsxs(we,{to:"/architecture",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Architecture ",i.jsx(qe,{className:"w-3 h-3"})]}),i.jsxs(we,{to:"/concepts",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Concepts ",i.jsx(qe,{className:"w-3 h-3"})]}),i.jsxs(we,{to:"/api-reference",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["API & CLI Reference ",i.jsx(qe,{className:"w-3 h-3"})]}),i.jsxs(we,{to:"/skills",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Skills ",i.jsx(qe,{className:"w-3 h-3"})]})]})]}),i.jsxs("section",{id:"why-extend",className:"pt-16 scroll-mt-4",children:[i.jsx(un,{children:"Extend to any website"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Write your own connector"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-8",children:"The built-in connectors cover common tasks, but you can write your own for any site. If you can see it in Chrome, you can turn it into a CLI command."}),i.jsx("div",{className:"space-y-3 mb-8",children:[["Create a YAML file","~/.commandgarden/connectors/"],["Declare the domain, capabilities, arguments, and columns",null],["Define a pipeline","navigate → wait → extract/fetch → map"],["Validate","cg validate my-connector.yaml"],["Run","cg run mysite/my-command --format json"]].map(([e,t],n)=>i.jsxs("div",{className:"flex gap-3 items-baseline",children:[i.jsxs("span",{className:"font-mono text-xs opacity-30 w-4 text-right shrink-0",children:[n+1,"."]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-sm font-medium",children:e}),t&&i.jsx("span",{className:"font-mono text-xs opacity-40 ml-2",children:t})]})]},n))}),i.jsx(ui,{children:`site: mysite
471
- name: my-command
472
- version: "1.0"
473
- description: "Fetch search results"
474
- access: read
475
-
476
- domains:
477
- - "mysite.example.com"
478
- capabilities:
479
- - navigate
480
- - dom_read
481
-
482
- args:
483
- - name: query
484
- type: string
485
- required: true
486
-
487
- columns:
488
- - name: title
489
- type: string
490
- - name: url
491
- type: string
492
-
493
- pipeline:
494
- - step: navigate
495
- url: "https://mysite.example.com/search?q=\${{ args.query }}"
496
- - step: wait
497
- selector: ".results"
498
- - step: extract
499
- selector: ".results .item"
500
- fields:
501
- title: "h3"
502
- url: "a@href"`}),i.jsx("p",{className:"text-xs opacity-40 mt-4 max-w-[65ch]",children:"Most connectors are pure YAML. The declarative format covers DOM extraction, cookie-authenticated API calls, network interception, and field mapping."})]})]})}function yo({children:e}){return i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.12em] mb-2",children:e})}function Sj({children:e}){return i.jsx("pre",{className:"bg-base-200 border border-base-300 p-4 overflow-x-auto text-sm font-mono leading-relaxed",children:i.jsx("code",{children:e})})}const Pd=[{icon:bl,title:"Background Worker",subtitle:"no page contact",access:"Never touches the page. Talks to Chrome APIs directly.",steps:["navigate","cookie"],tone:"border-sky-500/40 bg-sky-500/[0.04]"},{icon:Qm,title:"ISOLATED Content Script",subtitle:"DOM only",access:"Shares the live page DOM, but can't see the page's own JavaScript variables or in-memory state.",steps:["dom_read","dom_write","fetch"],tone:"border-emerald-500/40 bg-emerald-500/[0.04]"},{icon:ov,title:"MAIN Page World",subtitle:"full page access",access:"Runs in the exact same JS realm as the website itself. Anything the page can do, this can do too.",steps:["js_evaluate"],tone:"border-red-500/40 bg-red-500/[0.04]"}],Cj=[{cap:"navigate",zone:"Background",risk:"info",desc:"Open a URL and wait for the page to finish loading."},{cap:"dom_read",zone:"ISOLATED",risk:"info",desc:"Read text and structure out of the page. Never modifies anything."},{cap:"dom_write",zone:"ISOLATED",risk:"warning",desc:"Click, type, and interact with page elements."},{cap:"cookie_read",zone:"Background / ISOLATED",risk:"warning",desc:"Reuse the browser's existing session to call an API or read a cookie value."},{cap:"js_evaluate",zone:"MAIN",risk:"error",desc:"Run arbitrary JavaScript in the page: the escape hatch for sites with no simpler path. Least constrained, used as a last resort."}],Ej={title:"What happens when you run a command",lanes:[{id:"client",label:"CLI / GUI",color:"client"},{id:"daemon",label:"Daemon",color:"daemon"},{id:"extension",label:"Extension",color:"extension"},{id:"browser",label:"Browser Tab",color:"browser"}],steps:[{type:"arrow",from:"client",to:"daemon",label:"cg run site/command"},{type:"action",lane:"daemon",label:"check auth + declared domains + capabilities"},{type:"arrow",from:"daemon",to:"extension",label:"send the pipeline"},{type:"arrow",from:"extension",to:"browser",label:"run each step in your open tab"},{type:"arrow",from:"browser",to:"extension",label:"page data"},{type:"arrow",from:"extension",to:"daemon",label:"structured rows"},{type:"arrow",from:"daemon",to:"client",label:"JSON / table / CSV"}]},Tj={title:"When a step needs your OK",lanes:[{id:"client",label:"CLI / GUI",color:"client"},{id:"daemon",label:"Daemon",color:"daemon"},{id:"extension",label:"Extension",color:"extension"}],steps:[{type:"action",lane:"daemon",label:"this step needs approval"},{type:"arrow",from:"daemon",to:"client",label:'prompt: "allow this?"'},{type:"arrow",from:"daemon",to:"extension",label:"also notify the extension"},{type:"arrow",from:"client",to:"daemon",label:"you say yes or no"},{type:"action",lane:"daemon",label:"whichever answers first wins"},{type:"action",lane:"daemon",label:"continue the pipeline, or stop and report why"}]},Id=[{label:"Low",variant:"success",desc:"Runs automatically. Reading data, navigating pages.",icon:Dc},{label:"Medium",variant:"warning",desc:"Runs automatically, but every use is logged to the audit trail.",icon:tp},{label:"High",variant:"error",desc:"Pauses for a yes/no, unless you've pre-approved that specific connector.",icon:Vv}];function Aj(){return i.jsxs("div",{className:"max-w-4xl mx-auto pb-20",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"Concepts"}),i.jsx("p",{className:"text-sm opacity-60 mb-10",children:"Three ideas worth understanding before you dig deeper into commandGarden."}),i.jsxs("section",{id:"concepts-worlds",className:"mb-16 scroll-mt-4",children:[i.jsx(yo,{children:"Not every step is equally trusted"}),i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Capability & world model"}),i.jsxs("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-6",children:["A connector's pipeline is a list of steps: ",i.jsx("span",{className:"font-mono text-xs",children:"navigate"}),","," ",i.jsx("span",{className:"font-mono text-xs",children:"extract"}),", ",i.jsx("span",{className:"font-mono text-xs",children:"click"}),", and so on. Each step type is only allowed to run in one of three places, and each place can see a little more of the page than the last."]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 mb-4",children:Pd.map((e,t)=>i.jsxs("div",{className:"relative",children:[i.jsxs("div",{className:`border p-4 h-full ${e.tone}`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(e.icon,{className:"w-4 h-4 opacity-50"}),i.jsx("span",{className:"font-display font-semibold text-sm",children:e.title})]}),i.jsx(K,{size:"xs",className:"mb-2",children:e.subtitle}),i.jsx("p",{className:"text-xs opacity-60 leading-relaxed mb-3",children:e.access}),i.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.steps.map(n=>i.jsx("span",{className:"font-mono text-[0.65rem] px-1.5 py-0.5 bg-base-200 border border-base-300",children:n},n))})]}),t<Pd.length-1&&i.jsx(qe,{className:"hidden md:block w-4 h-4 opacity-30 absolute top-1/2 -right-2 -translate-y-1/2 translate-x-1/2 z-10"})]},e.title))}),i.jsx("p",{className:"text-xs opacity-40 mb-8",children:"More access, left to right. Most steps never need the rightmost zone."}),i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{children:"Capability"}),i.jsx("th",{children:"Runs in"}),i.jsx("th",{children:"Risk"}),i.jsx("th",{children:"What it does"})]})}),i.jsx("tbody",{children:Cj.map(e=>i.jsxs("tr",{children:[i.jsx("td",{className:"font-mono text-xs font-semibold",children:e.cap}),i.jsx("td",{className:"text-xs opacity-60",children:e.zone}),i.jsx("td",{children:i.jsx(K,{variant:e.risk,size:"xs",children:e.risk==="info"?"low":e.risk==="warning"?"medium":"high"})}),i.jsx("td",{className:"text-sm opacity-70",children:e.desc})]},e.cap))})]})})]}),i.jsxs("section",{id:"concepts-lifecycle",className:"mb-16 scroll-mt-4",children:[i.jsx(yo,{children:"From command to structured data"}),i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Connector pipeline lifecycle"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-6",children:"A connector is a YAML file describing a pipeline. Running it walks the same four hops every time, whether you typed the command or an AI agent did."}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1.3fr_1fr] gap-4 mb-2",children:[i.jsx(Nl,{flow:Ej}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-sm mb-3",children:"A minimal connector pipeline"}),i.jsx(Sj,{children:`pipeline:
503
- - step: navigate
504
- url: "https://example.com/tickets"
505
- - step: wait
506
- selector: ".ticket-row"
507
- - step: extract
508
- selector: ".ticket-row"
509
- fields:
510
- id: ".ticket-id"
511
- title: ".ticket-title"`}),i.jsxs("p",{className:"text-xs opacity-50 mt-2",children:["Each ",i.jsx("span",{className:"font-mono",children:"step"})," above maps to one hop in the diagram: navigate opens the tab, wait confirms it loaded, extract reads structured rows back out."]})]})]})]}),i.jsxs("section",{id:"concepts-approval",className:"scroll-mt-4",children:[i.jsx(yo,{children:"Not everything runs unattended"}),i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Approval & risk-tiering workflow"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-6",children:"Every capability has a risk tier. Low and medium tiers run without interruption. High-risk steps pause and wait for a human to say yes, either in the CLI or as a Chrome notification."}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-8",children:Id.map((e,t)=>i.jsxs("div",{className:"relative",children:[i.jsxs("div",{className:"border border-base-300 p-4 h-full",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(e.icon,{className:"w-4 h-4 opacity-50"}),i.jsx(K,{variant:e.variant,size:"xs",children:e.label})]}),i.jsx("p",{className:"text-xs opacity-60 leading-relaxed",children:e.desc})]}),t<Id.length-1&&i.jsx(qe,{className:"hidden sm:block w-4 h-4 opacity-30 absolute top-1/2 -right-2 -translate-y-1/2 translate-x-1/2 z-10"})]},e.label))}),i.jsx(Nl,{flow:Tj}),i.jsxs("div",{className:"mt-6 border border-primary/20 bg-primary/[0.03] p-4 flex items-center gap-3",children:[i.jsx(Xm,{className:"w-4 h-4 text-primary shrink-0"}),i.jsx("p",{className:"text-sm opacity-70",children:"No credentials are ever stored to make this work. Approval just gates whether an already-authenticated step is allowed to run."})]})]})]})}v.lazy(()=>Bg(()=>import("./Slides-DMIm_HgI.js"),[]));function Gs({isActive:e}){return`flex items-center gap-2 px-3 py-2 text-sm transition-colors ${e?"bg-primary text-primary-content font-semibold":"hover:text-primary"}`}function zs({isActive:e}){return`flex items-center gap-2 pl-4 pr-3 py-1.5 text-sm transition-colors ${e?"bg-primary text-primary-content font-semibold":"hover:text-primary"}`}const Fs={"/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"}],"/concepts":[{label:"Capability & World Model",id:"concepts-worlds"},{label:"Pipeline Lifecycle",id:"concepts-lifecycle"},{label:"Approval & Risk-Tiering",id:"concepts-approval"}],"/why":[{label:"The Problem",id:"why-problem"},{label:"The Solution",id:"why-solution"},{label:"Architecture",id:"why-architecture"},{label:"Built-in Apps",id:"why-apps"},{label:"Workflow",id:"why-happy-path"},{label:"Security",id:"why-security"},{label:"Get Started",id:"why-get-started"},{label:"Extend",id:"why-extend"}]};function Lj({sections:e}){const t=v.useMemo(()=>e.map(r=>r.id),[e]),n=Qy(t),s=r=>{const a=document.getElementById(r);a&&a.scrollIntoView({behavior:"smooth",block:"start"})};return i.jsx("div",{className:"ml-3 border-l border-base-300 py-0.5",children:e.map(r=>i.jsx("button",{onClick:()=>s(r.id),className:`block w-full text-left pl-3 py-1 text-[0.7rem] transition-colors ${n===r.id?"text-primary opacity-100":"opacity-50 hover:opacity-70"}`,children:r.label},r.id))})}function _n({to:e,label:t,icon:n,sections:s}){const a=An().pathname===e;return i.jsxs(i.Fragment,{children:[i.jsxs(gt,{to:e,end:e==="/",className:Gs,children:[n,t]}),a&&s.length>0&&i.jsx(Lj,{sections:s})]})}function Pj(){const[e,t]=v.useState(!1),[n,s]=v.useState(!1),[r,a]=v.useState(!1),[o,l]=v.useState([]),[c,u]=v.useState(!1),m=v.useRef(null),d=An();v.useEffect(()=>{a(!1)},[d.pathname]),v.useEffect(()=>{if(!d.hash)return;const b=d.hash.slice(1),x=document.getElementById(b);x&&x.scrollIntoView({behavior:"smooth",block:"start"})},[d.pathname,d.hash]),v.useEffect(()=>{const b=()=>{B.getStatus().then(j=>{t(j.ok),s(j.extensionConnected)}).catch(()=>{t(!1),s(!1)})};b();const x=setInterval(b,3e4);return()=>clearInterval(x)},[]),v.useEffect(()=>{B.getConnectors().then(b=>{const x=wa(b.connectors).map(([j])=>j);l(x)}).catch(()=>{})},[]);const p=v.useMemo(()=>o.map(b=>({label:b,id:`conn-${b}`})),[o]),y=v.useCallback(()=>{const b=m.current;b&&u(b.scrollHeight-b.scrollTop-b.clientHeight>1)},[]);return v.useEffect(()=>{y();const b=m.current;if(b)return b.addEventListener("scroll",y,{passive:!0}),window.addEventListener("resize",y),()=>{b.removeEventListener("scroll",y),window.removeEventListener("resize",y)}},[y,p,d.pathname,e]),i.jsxs("div",{className:"flex min-h-screen",children:[i.jsx("button",{className:"fixed top-3 left-3 z-50 md:hidden btn btn-sm btn-ghost",onClick:()=>a(!r),"aria-label":r?"Close menu":"Open menu",children:i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:r?i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}):i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}),r&&i.jsx("div",{className:"fixed inset-0 bg-black/30 z-30 md:hidden",onClick:()=>a(!1)}),i.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:[i.jsxs("div",{className:"flex items-start justify-between px-3 py-3 border-b border-base-300",children:[i.jsxs(we,{to:"/",className:"hover:opacity-80 transition-opacity",children:[i.jsxs("h1",{className:"font-display text-lg font-bold tracking-tight",children:[i.jsx("span",{className:"font-normal opacity-50",children:"command"}),"Garden"]}),i.jsx("p",{className:"font-mono text-[0.65rem] opacity-30 mt-1 uppercase tracking-[0.14em]",children:"browser automation"})]}),i.jsx("button",{className:"btn btn-ghost btn-sm btn-square",onClick:()=>{const b=document.documentElement.getAttribute("data-theme")==="dark"?"light":"dark";document.documentElement.setAttribute("data-theme",b),localStorage.setItem("theme",b)},"aria-label":"Toggle theme",children:i.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:i.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"})})})]}),i.jsxs("div",{className:"relative flex-1 min-h-0",children:[i.jsxs("nav",{ref:m,className:"h-full px-2 py-2 space-y-0.5 overflow-y-auto",children:[i.jsx("div",{className:"px-3 pt-3 pb-1.5 font-mono text-[0.6rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Overview"}),i.jsxs(gt,{to:"/",end:!0,className:Gs,children:[i.jsx(Sv,{className:"w-4 h-4 shrink-0"}),"Dashboard"]}),i.jsxs(gt,{to:"/guide",className:Gs,children:[i.jsx(Gm,{className:"w-4 h-4 shrink-0"}),"Setup Guide"]}),i.jsx("div",{className:"px-3 pt-6 pb-1.5 font-mono text-[0.6rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Apps"}),i.jsx("div",{className:"pl-5 pr-3 pt-3 pb-1 font-mono text-[0.65rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Administrative"}),i.jsxs(gt,{to:"/apps/timetracking",className:zs,children:[i.jsx(Rr,{className:"w-4 h-4 shrink-0"}),"Time Tracking"]}),i.jsxs(gt,{to:"/apps/rooms",className:zs,children:[i.jsx(Ym,{className:"w-4 h-4 shrink-0"}),"Room Availability"]}),i.jsx("div",{className:"pl-5 pr-3 pt-3 pb-1 font-mono text-[0.65rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Productivity"}),i.jsxs(gt,{to:"/apps/journal",className:zs,children:[i.jsx(_v,{className:"w-4 h-4 shrink-0"}),"Dev Journal"]}),i.jsxs(gt,{to:"/apps/trusted-peer-expiry",className:zs,children:[i.jsx(tp,{className:"w-4 h-4 shrink-0"}),"Trusted Peer Expiry"]}),i.jsx("div",{className:"pl-5 pr-3 pt-3 pb-1 font-mono text-[0.65rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Security"}),i.jsxs(gt,{to:"/apps/security-news",className:zs,children:[i.jsx(Zm,{className:"w-4 h-4 shrink-0"}),"Security News"]}),i.jsx("div",{className:"px-3 pt-6 pb-1.5 font-mono text-[0.6rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Platform"}),i.jsx(_n,{to:"/connectors",label:"Connectors",icon:i.jsx(zv,{className:"w-4 h-4 shrink-0"}),sections:p}),i.jsxs(gt,{to:"/audit",className:Gs,children:[i.jsx(ep,{className:"w-4 h-4 shrink-0"}),"Audit Log"]}),i.jsx(_n,{to:"/config",label:"Configuration",icon:i.jsx(Wv,{className:"w-4 h-4 shrink-0"}),sections:e?Fs["/config"]:[]}),i.jsx("div",{className:"px-3 pt-6 pb-1.5 font-mono text-[0.6rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Reference"}),i.jsx(_n,{to:"/why",label:"Why commandGarden",icon:i.jsx(Av,{className:"w-4 h-4 shrink-0"}),sections:Fs["/why"]}),i.jsx(_n,{to:"/api-reference",label:"API & CLI",icon:i.jsx(Ci,{className:"w-4 h-4 shrink-0"}),sections:Fs["/api-reference"]}),i.jsxs(gt,{to:"/skills",className:Gs,children:[i.jsx(jl,{className:"w-4 h-4 shrink-0"}),"Skills"]}),i.jsx("div",{className:"px-3 pt-6 pb-1.5 font-mono text-[0.6rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Deep Dive"}),i.jsx(_n,{to:"/concepts",label:"Concepts",icon:i.jsx(kv,{className:"w-4 h-4 shrink-0"}),sections:Fs["/concepts"]}),i.jsx(_n,{to:"/architecture",label:"Architecture",icon:i.jsx(Iv,{className:"w-4 h-4 shrink-0"}),sections:Fs["/architecture"]}),!1]}),c&&i.jsx("div",{className:"pointer-events-none absolute bottom-0 inset-x-0 h-8 bg-gradient-to-t from-base-100 to-transparent","aria-hidden":"true"})]}),i.jsxs("div",{className:"px-3 py-2.5 border-t border-base-300",children:[i.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[i.jsx("span",{className:`w-1.5 h-1.5 ${e?"bg-success":"bg-error"}`,"aria-hidden":"true"}),i.jsx("span",{className:"opacity-50 text-[0.65rem]",children:e?"DAEMON OK":"DAEMON OFF"})]}),i.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono mt-1",children:[i.jsx("span",{className:`w-1.5 h-1.5 ${n?"bg-success":"bg-error"}`,"aria-hidden":"true"}),i.jsx("span",{className:"opacity-50 text-[0.65rem]",children:n?"EXTENSION LINKED":"EXTENSION OFF"})]})]})]}),i.jsx("main",{className:"flex-1 p-4 pt-14 md:pt-5 md:p-5 md:ml-56",children:i.jsx(Oy,{})})]})}function Ij(){return i.jsx(Hy,{children:i.jsx($y,{children:i.jsxs(xe,{element:i.jsx(Pj,{}),children:[i.jsx(xe,{index:!0,element:i.jsx(Zy,{})}),i.jsx(xe,{path:"connectors",element:i.jsx(nx,{})}),i.jsx(xe,{path:"connectors/:site/:name",element:i.jsx(sx,{})}),i.jsx(xe,{path:"audit",element:i.jsx(ax,{})}),i.jsx(xe,{path:"config",element:i.jsx(j1,{})}),i.jsx(xe,{path:"guide",element:i.jsx(A1,{})}),i.jsx(xe,{path:"apps/timetracking",element:i.jsx(ub,{})}),i.jsx(xe,{path:"apps/rooms",element:i.jsx(Nb,{})}),i.jsx(xe,{path:"apps/journal",element:i.jsx(Wb,{})}),i.jsx(xe,{path:"apps/security-news",element:i.jsx(Xb,{})}),i.jsx(xe,{path:"apps/trusted-peer-expiry",element:i.jsx(sj,{})}),i.jsx(xe,{path:"architecture",element:i.jsx(uj,{})}),i.jsx(xe,{path:"api-reference",element:i.jsx(gj,{})}),i.jsx(xe,{path:"skills",element:i.jsx(bj,{})}),i.jsx(xe,{path:"why",element:i.jsx(Nj,{})}),i.jsx(xe,{path:"concepts",element:i.jsx(Aj,{})}),!1]})})})}Kh(document.getElementById("root")).render(i.jsx(v.StrictMode,{children:i.jsx(Ij,{})}));export{Gm as B,X1 as C,gd as D,Qm as E,ho as F,oi as G,Xm as L,Dv as P,bl as S,Ci as T,ev as a,qm as b,H as c,_c as d,qv as e,hv as f,K as g,i as j,v as r,py as u};