@nickduy/agent-studio 0.1.8 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- function Xm(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const l=Object.getOwnPropertyDescriptor(r,i);l&&Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>r[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();function md(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Zm={exports:{}},ho={},eg={exports:{}},be={};/**
1
+ function tg(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const l=Object.getOwnPropertyDescriptor(r,i);l&&Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>r[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();function gd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ng={exports:{}},ho={},rg={exports:{}},be={};/**
2
2
  * @license React
3
3
  * react.production.min.js
4
4
  *
@@ -6,7 +6,7 @@ function Xm(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var gl=Symbol.for("react.element"),_j=Symbol.for("react.portal"),Oj=Symbol.for("react.fragment"),Fj=Symbol.for("react.strict_mode"),Uj=Symbol.for("react.profiler"),Bj=Symbol.for("react.provider"),Hj=Symbol.for("react.context"),Wj=Symbol.for("react.forward_ref"),Vj=Symbol.for("react.suspense"),Qj=Symbol.for("react.memo"),qj=Symbol.for("react.lazy"),sf=Symbol.iterator;function Gj(e){return e===null||typeof e!="object"?null:(e=sf&&e[sf]||e["@@iterator"],typeof e=="function"?e:null)}var tg={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ng=Object.assign,rg={};function ri(e,t,n){this.props=e,this.context=t,this.refs=rg,this.updater=n||tg}ri.prototype.isReactComponent={};ri.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")};ri.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function sg(){}sg.prototype=ri.prototype;function gd(e,t,n){this.props=e,this.context=t,this.refs=rg,this.updater=n||tg}var xd=gd.prototype=new sg;xd.constructor=gd;ng(xd,ri.prototype);xd.isPureReactComponent=!0;var lf=Array.isArray,ig=Object.prototype.hasOwnProperty,yd={current:null},lg={key:!0,ref:!0,__self:!0,__source:!0};function ag(e,t,n){var r,i={},l=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(l=""+t.key),t)ig.call(t,r)&&!lg.hasOwnProperty(r)&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var u=Array(o),c=0;c<o;c++)u[c]=arguments[c+2];i.children=u}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return{$$typeof:gl,type:e,key:l,ref:a,props:i,_owner:yd.current}}function Kj(e,t){return{$$typeof:gl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function vd(e){return typeof e=="object"&&e!==null&&e.$$typeof===gl}function Yj(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var af=/\/+/g;function Vo(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Yj(""+e.key):t.toString(36)}function ca(e,t,n,r,i){var l=typeof e;(l==="undefined"||l==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(l){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case gl:case _j:a=!0}}if(a)return a=e,i=i(a),e=r===""?"."+Vo(a,0):r,lf(i)?(n="",e!=null&&(n=e.replace(af,"$&/")+"/"),ca(i,t,n,"",function(c){return c})):i!=null&&(vd(i)&&(i=Kj(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(af,"$&/")+"/")+e)),t.push(i)),1;if(a=0,r=r===""?".":r+":",lf(e))for(var o=0;o<e.length;o++){l=e[o];var u=r+Vo(l,o);a+=ca(l,t,n,u,i)}else if(u=Gj(e),typeof u=="function")for(e=u.call(e),o=0;!(l=e.next()).done;)l=l.value,u=r+Vo(l,o++),a+=ca(l,t,n,u,i);else if(l==="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 a}function $l(e,t,n){if(e==null)return e;var r=[],i=0;return ca(e,r,"","",function(l){return t.call(n,l,i++)}),r}function Jj(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 Lt={current:null},da={transition:null},Xj={ReactCurrentDispatcher:Lt,ReactCurrentBatchConfig:da,ReactCurrentOwner:yd};function og(){throw Error("act(...) is not supported in production builds of React.")}be.Children={map:$l,forEach:function(e,t,n){$l(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return $l(e,function(){t++}),t},toArray:function(e){return $l(e,function(t){return t})||[]},only:function(e){if(!vd(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};be.Component=ri;be.Fragment=Oj;be.Profiler=Uj;be.PureComponent=gd;be.StrictMode=Fj;be.Suspense=Vj;be.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Xj;be.act=og;be.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=ng({},e.props),i=e.key,l=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(l=t.ref,a=yd.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(u in t)ig.call(t,u)&&!lg.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&o!==void 0?o[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){o=Array(u);for(var c=0;c<u;c++)o[c]=arguments[c+2];r.children=o}return{$$typeof:gl,type:e.type,key:i,ref:l,props:r,_owner:a}};be.createContext=function(e){return e={$$typeof:Hj,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Bj,_context:e},e.Consumer=e};be.createElement=ag;be.createFactory=function(e){var t=ag.bind(null,e);return t.type=e,t};be.createRef=function(){return{current:null}};be.forwardRef=function(e){return{$$typeof:Wj,render:e}};be.isValidElement=vd;be.lazy=function(e){return{$$typeof:qj,_payload:{_status:-1,_result:e},_init:Jj}};be.memo=function(e,t){return{$$typeof:Qj,type:e,compare:t===void 0?null:t}};be.startTransition=function(e){var t=da.transition;da.transition={};try{e()}finally{da.transition=t}};be.unstable_act=og;be.useCallback=function(e,t){return Lt.current.useCallback(e,t)};be.useContext=function(e){return Lt.current.useContext(e)};be.useDebugValue=function(){};be.useDeferredValue=function(e){return Lt.current.useDeferredValue(e)};be.useEffect=function(e,t){return Lt.current.useEffect(e,t)};be.useId=function(){return Lt.current.useId()};be.useImperativeHandle=function(e,t,n){return Lt.current.useImperativeHandle(e,t,n)};be.useInsertionEffect=function(e,t){return Lt.current.useInsertionEffect(e,t)};be.useLayoutEffect=function(e,t){return Lt.current.useLayoutEffect(e,t)};be.useMemo=function(e,t){return Lt.current.useMemo(e,t)};be.useReducer=function(e,t,n){return Lt.current.useReducer(e,t,n)};be.useRef=function(e){return Lt.current.useRef(e)};be.useState=function(e){return Lt.current.useState(e)};be.useSyncExternalStore=function(e,t,n){return Lt.current.useSyncExternalStore(e,t,n)};be.useTransition=function(){return Lt.current.useTransition()};be.version="18.3.1";eg.exports=be;var j=eg.exports;const Zj=md(j),ew=Xm({__proto__:null,default:Zj},[j]);/**
9
+ */var gl=Symbol.for("react.element"),Hj=Symbol.for("react.portal"),Wj=Symbol.for("react.fragment"),Vj=Symbol.for("react.strict_mode"),Qj=Symbol.for("react.profiler"),qj=Symbol.for("react.provider"),Gj=Symbol.for("react.context"),Kj=Symbol.for("react.forward_ref"),Yj=Symbol.for("react.suspense"),Jj=Symbol.for("react.memo"),Xj=Symbol.for("react.lazy"),af=Symbol.iterator;function Zj(e){return e===null||typeof e!="object"?null:(e=af&&e[af]||e["@@iterator"],typeof e=="function"?e:null)}var sg={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ig=Object.assign,lg={};function si(e,t,n){this.props=e,this.context=t,this.refs=lg,this.updater=n||sg}si.prototype.isReactComponent={};si.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")};si.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ag(){}ag.prototype=si.prototype;function xd(e,t,n){this.props=e,this.context=t,this.refs=lg,this.updater=n||sg}var yd=xd.prototype=new ag;yd.constructor=xd;ig(yd,si.prototype);yd.isPureReactComponent=!0;var of=Array.isArray,og=Object.prototype.hasOwnProperty,vd={current:null},ug={key:!0,ref:!0,__self:!0,__source:!0};function cg(e,t,n){var r,i={},l=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(l=""+t.key),t)og.call(t,r)&&!ug.hasOwnProperty(r)&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var u=Array(o),c=0;c<o;c++)u[c]=arguments[c+2];i.children=u}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return{$$typeof:gl,type:e,key:l,ref:a,props:i,_owner:vd.current}}function ew(e,t){return{$$typeof:gl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function jd(e){return typeof e=="object"&&e!==null&&e.$$typeof===gl}function tw(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var uf=/\/+/g;function Qo(e,t){return typeof e=="object"&&e!==null&&e.key!=null?tw(""+e.key):t.toString(36)}function ca(e,t,n,r,i){var l=typeof e;(l==="undefined"||l==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(l){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case gl:case Hj:a=!0}}if(a)return a=e,i=i(a),e=r===""?"."+Qo(a,0):r,of(i)?(n="",e!=null&&(n=e.replace(uf,"$&/")+"/"),ca(i,t,n,"",function(c){return c})):i!=null&&(jd(i)&&(i=ew(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(uf,"$&/")+"/")+e)),t.push(i)),1;if(a=0,r=r===""?".":r+":",of(e))for(var o=0;o<e.length;o++){l=e[o];var u=r+Qo(l,o);a+=ca(l,t,n,u,i)}else if(u=Zj(e),typeof u=="function")for(e=u.call(e),o=0;!(l=e.next()).done;)l=l.value,u=r+Qo(l,o++),a+=ca(l,t,n,u,i);else if(l==="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 a}function $l(e,t,n){if(e==null)return e;var r=[],i=0;return ca(e,r,"","",function(l){return t.call(n,l,i++)}),r}function nw(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 Lt={current:null},da={transition:null},rw={ReactCurrentDispatcher:Lt,ReactCurrentBatchConfig:da,ReactCurrentOwner:vd};function dg(){throw Error("act(...) is not supported in production builds of React.")}be.Children={map:$l,forEach:function(e,t,n){$l(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return $l(e,function(){t++}),t},toArray:function(e){return $l(e,function(t){return t})||[]},only:function(e){if(!jd(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};be.Component=si;be.Fragment=Wj;be.Profiler=Qj;be.PureComponent=xd;be.StrictMode=Vj;be.Suspense=Yj;be.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=rw;be.act=dg;be.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=ig({},e.props),i=e.key,l=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(l=t.ref,a=vd.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(u in t)og.call(t,u)&&!ug.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&o!==void 0?o[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){o=Array(u);for(var c=0;c<u;c++)o[c]=arguments[c+2];r.children=o}return{$$typeof:gl,type:e.type,key:i,ref:l,props:r,_owner:a}};be.createContext=function(e){return e={$$typeof:Gj,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:qj,_context:e},e.Consumer=e};be.createElement=cg;be.createFactory=function(e){var t=cg.bind(null,e);return t.type=e,t};be.createRef=function(){return{current:null}};be.forwardRef=function(e){return{$$typeof:Kj,render:e}};be.isValidElement=jd;be.lazy=function(e){return{$$typeof:Xj,_payload:{_status:-1,_result:e},_init:nw}};be.memo=function(e,t){return{$$typeof:Jj,type:e,compare:t===void 0?null:t}};be.startTransition=function(e){var t=da.transition;da.transition={};try{e()}finally{da.transition=t}};be.unstable_act=dg;be.useCallback=function(e,t){return Lt.current.useCallback(e,t)};be.useContext=function(e){return Lt.current.useContext(e)};be.useDebugValue=function(){};be.useDeferredValue=function(e){return Lt.current.useDeferredValue(e)};be.useEffect=function(e,t){return Lt.current.useEffect(e,t)};be.useId=function(){return Lt.current.useId()};be.useImperativeHandle=function(e,t,n){return Lt.current.useImperativeHandle(e,t,n)};be.useInsertionEffect=function(e,t){return Lt.current.useInsertionEffect(e,t)};be.useLayoutEffect=function(e,t){return Lt.current.useLayoutEffect(e,t)};be.useMemo=function(e,t){return Lt.current.useMemo(e,t)};be.useReducer=function(e,t,n){return Lt.current.useReducer(e,t,n)};be.useRef=function(e){return Lt.current.useRef(e)};be.useState=function(e){return Lt.current.useState(e)};be.useSyncExternalStore=function(e,t,n){return Lt.current.useSyncExternalStore(e,t,n)};be.useTransition=function(){return Lt.current.useTransition()};be.version="18.3.1";rg.exports=be;var j=rg.exports;const sw=gd(j),iw=tg({__proto__:null,default:sw},[j]);/**
10
10
  * @license React
11
11
  * react-jsx-runtime.production.min.js
12
12
  *
@@ -14,7 +14,7 @@ function Xm(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var tw=j,nw=Symbol.for("react.element"),rw=Symbol.for("react.fragment"),sw=Object.prototype.hasOwnProperty,iw=tw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,lw={key:!0,ref:!0,__self:!0,__source:!0};function ug(e,t,n){var r,i={},l=null,a=null;n!==void 0&&(l=""+n),t.key!==void 0&&(l=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)sw.call(t,r)&&!lw.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:nw,type:e,key:l,ref:a,props:i,_owner:iw.current}}ho.Fragment=rw;ho.jsx=ug;ho.jsxs=ug;Zm.exports=ho;var s=Zm.exports,cg={exports:{}},Jt={},dg={exports:{}},hg={};/**
17
+ */var lw=j,aw=Symbol.for("react.element"),ow=Symbol.for("react.fragment"),uw=Object.prototype.hasOwnProperty,cw=lw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,dw={key:!0,ref:!0,__self:!0,__source:!0};function hg(e,t,n){var r,i={},l=null,a=null;n!==void 0&&(l=""+n),t.key!==void 0&&(l=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)uw.call(t,r)&&!dw.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:aw,type:e,key:l,ref:a,props:i,_owner:cw.current}}ho.Fragment=ow;ho.jsx=hg;ho.jsxs=hg;ng.exports=ho;var s=ng.exports,fg={exports:{}},Jt={},pg={exports:{}},mg={};/**
18
18
  * @license React
19
19
  * scheduler.production.min.js
20
20
  *
@@ -22,7 +22,7 @@ function Xm(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(B,X){var S=B.length;B.push(X);e:for(;0<S;){var ae=S-1>>>1,O=B[ae];if(0<i(O,X))B[ae]=X,B[S]=O,S=ae;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var X=B[0],S=B.pop();if(S!==X){B[0]=S;e:for(var ae=0,O=B.length,N=O>>>1;ae<N;){var F=2*(ae+1)-1,Z=B[F],ce=F+1,Te=B[ce];if(0>i(Z,S))ce<O&&0>i(Te,Z)?(B[ae]=Te,B[ce]=S,ae=ce):(B[ae]=Z,B[F]=S,ae=F);else if(ce<O&&0>i(Te,S))B[ae]=Te,B[ce]=S,ae=ce;else break e}}return X}function i(B,X){var S=B.sortIndex-X.sortIndex;return S!==0?S:B.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var u=[],c=[],h=1,d=null,f=3,m=!1,p=!1,g=!1,w=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(B){for(var X=n(c);X!==null;){if(X.callback===null)r(c);else if(X.startTime<=B)r(c),X.sortIndex=X.expirationTime,t(u,X);else break;X=n(c)}}function b(B){if(g=!1,v(B),!p)if(n(u)!==null)p=!0,q(A);else{var X=n(c);X!==null&&J(b,X.startTime-B)}}function A(B,X){p=!1,g&&(g=!1,y(T),T=-1),m=!0;var S=f;try{for(v(X),d=n(u);d!==null&&(!(d.expirationTime>X)||B&&!R());){var ae=d.callback;if(typeof ae=="function"){d.callback=null,f=d.priorityLevel;var O=ae(d.expirationTime<=X);X=e.unstable_now(),typeof O=="function"?d.callback=O:d===n(u)&&r(u),v(X)}else r(u);d=n(u)}if(d!==null)var N=!0;else{var F=n(c);F!==null&&J(b,F.startTime-X),N=!1}return N}finally{d=null,f=S,m=!1}}var k=!1,E=null,T=-1,I=5,C=-1;function R(){return!(e.unstable_now()-C<I)}function L(){if(E!==null){var B=e.unstable_now();C=B;var X=!0;try{X=E(!0,B)}finally{X?M():(k=!1,E=null)}}else k=!1}var M;if(typeof x=="function")M=function(){x(L)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,D=U.port2;U.port1.onmessage=L,M=function(){D.postMessage(null)}}else M=function(){w(L,0)};function q(B){E=B,k||(k=!0,M())}function J(B,X){T=w(function(){B(e.unstable_now())},X)}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(B){B.callback=null},e.unstable_continueExecution=function(){p||m||(p=!0,q(A))},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(B){switch(f){case 1:case 2:case 3:var X=3;break;default:X=f}var S=f;f=X;try{return B()}finally{f=S}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(B,X){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var S=f;f=B;try{return X()}finally{f=S}},e.unstable_scheduleCallback=function(B,X,S){var ae=e.unstable_now();switch(typeof S=="object"&&S!==null?(S=S.delay,S=typeof S=="number"&&0<S?ae+S:ae):S=ae,B){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=S+O,B={id:h++,callback:X,priorityLevel:B,startTime:S,expirationTime:O,sortIndex:-1},S>ae?(B.sortIndex=S,t(c,B),n(u)===null&&B===n(c)&&(g?(y(T),T=-1):g=!0,J(b,S-ae))):(B.sortIndex=O,t(u,B),p||m||(p=!0,q(A))),B},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(B){var X=f;return function(){var S=f;f=X;try{return B.apply(this,arguments)}finally{f=S}}}})(hg);dg.exports=hg;var aw=dg.exports;/**
25
+ */(function(e){function t(B,X){var S=B.length;B.push(X);e:for(;0<S;){var ae=S-1>>>1,O=B[ae];if(0<i(O,X))B[ae]=X,B[S]=O,S=ae;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var X=B[0],S=B.pop();if(S!==X){B[0]=S;e:for(var ae=0,O=B.length,N=O>>>1;ae<N;){var F=2*(ae+1)-1,Z=B[F],ce=F+1,Te=B[ce];if(0>i(Z,S))ce<O&&0>i(Te,Z)?(B[ae]=Te,B[ce]=S,ae=ce):(B[ae]=Z,B[F]=S,ae=F);else if(ce<O&&0>i(Te,S))B[ae]=Te,B[ce]=S,ae=ce;else break e}}return X}function i(B,X){var S=B.sortIndex-X.sortIndex;return S!==0?S:B.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var u=[],c=[],h=1,d=null,f=3,m=!1,p=!1,g=!1,w=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(B){for(var X=n(c);X!==null;){if(X.callback===null)r(c);else if(X.startTime<=B)r(c),X.sortIndex=X.expirationTime,t(u,X);else break;X=n(c)}}function b(B){if(g=!1,v(B),!p)if(n(u)!==null)p=!0,q(A);else{var X=n(c);X!==null&&J(b,X.startTime-B)}}function A(B,X){p=!1,g&&(g=!1,y(T),T=-1),m=!0;var S=f;try{for(v(X),d=n(u);d!==null&&(!(d.expirationTime>X)||B&&!R());){var ae=d.callback;if(typeof ae=="function"){d.callback=null,f=d.priorityLevel;var O=ae(d.expirationTime<=X);X=e.unstable_now(),typeof O=="function"?d.callback=O:d===n(u)&&r(u),v(X)}else r(u);d=n(u)}if(d!==null)var N=!0;else{var F=n(c);F!==null&&J(b,F.startTime-X),N=!1}return N}finally{d=null,f=S,m=!1}}var k=!1,E=null,T=-1,I=5,C=-1;function R(){return!(e.unstable_now()-C<I)}function L(){if(E!==null){var B=e.unstable_now();C=B;var X=!0;try{X=E(!0,B)}finally{X?M():(k=!1,E=null)}}else k=!1}var M;if(typeof x=="function")M=function(){x(L)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,D=U.port2;U.port1.onmessage=L,M=function(){D.postMessage(null)}}else M=function(){w(L,0)};function q(B){E=B,k||(k=!0,M())}function J(B,X){T=w(function(){B(e.unstable_now())},X)}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(B){B.callback=null},e.unstable_continueExecution=function(){p||m||(p=!0,q(A))},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(B){switch(f){case 1:case 2:case 3:var X=3;break;default:X=f}var S=f;f=X;try{return B()}finally{f=S}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(B,X){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var S=f;f=B;try{return X()}finally{f=S}},e.unstable_scheduleCallback=function(B,X,S){var ae=e.unstable_now();switch(typeof S=="object"&&S!==null?(S=S.delay,S=typeof S=="number"&&0<S?ae+S:ae):S=ae,B){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=S+O,B={id:h++,callback:X,priorityLevel:B,startTime:S,expirationTime:O,sortIndex:-1},S>ae?(B.sortIndex=S,t(c,B),n(u)===null&&B===n(c)&&(g?(y(T),T=-1):g=!0,J(b,S-ae))):(B.sortIndex=O,t(u,B),p||m||(p=!0,q(A))),B},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(B){var X=f;return function(){var S=f;f=X;try{return B.apply(this,arguments)}finally{f=S}}}})(mg);pg.exports=mg;var hw=pg.exports;/**
26
26
  * @license React
27
27
  * react-dom.production.min.js
28
28
  *
@@ -30,14 +30,14 @@ function Xm(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var ow=j,Yt=aw;function K(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 fg=new Set,Gi={};function os(e,t){Vs(e,t),Vs(e+"Capture",t)}function Vs(e,t){for(Gi[e]=t,e=0;e<t.length;e++)fg.add(t[e])}var Hn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vu=Object.prototype.hasOwnProperty,uw=/^[: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]*$/,of={},uf={};function cw(e){return Vu.call(uf,e)?!0:Vu.call(of,e)?!1:uw.test(e)?uf[e]=!0:(of[e]=!0,!1)}function dw(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function hw(e,t,n,r){if(t===null||typeof t>"u"||dw(e,t,n,r))return!0;if(r)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 At(e,t,n,r,i,l,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=l,this.removeEmptyString=a}var kt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){kt[e]=new At(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];kt[t]=new At(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){kt[e]=new At(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){kt[e]=new At(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){kt[e]=new At(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){kt[e]=new At(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){kt[e]=new At(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){kt[e]=new At(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){kt[e]=new At(e,5,!1,e.toLowerCase(),null,!1,!1)});var jd=/[\-:]([a-z])/g;function wd(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(jd,wd);kt[t]=new At(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(jd,wd);kt[t]=new At(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(jd,wd);kt[t]=new At(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){kt[e]=new At(e,1,!1,e.toLowerCase(),null,!1,!1)});kt.xlinkHref=new At("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){kt[e]=new At(e,1,!1,e.toLowerCase(),null,!0,!0)});function kd(e,t,n,r){var i=kt.hasOwnProperty(t)?kt[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(hw(t,n,i,r)&&(n=null),r||i===null?cw(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var qn=ow.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,_l=Symbol.for("react.element"),Ns=Symbol.for("react.portal"),Cs=Symbol.for("react.fragment"),bd=Symbol.for("react.strict_mode"),Qu=Symbol.for("react.profiler"),pg=Symbol.for("react.provider"),mg=Symbol.for("react.context"),Sd=Symbol.for("react.forward_ref"),qu=Symbol.for("react.suspense"),Gu=Symbol.for("react.suspense_list"),Nd=Symbol.for("react.memo"),rr=Symbol.for("react.lazy"),gg=Symbol.for("react.offscreen"),cf=Symbol.iterator;function pi(e){return e===null||typeof e!="object"?null:(e=cf&&e[cf]||e["@@iterator"],typeof e=="function"?e:null)}var Ke=Object.assign,Qo;function Ri(e){if(Qo===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Qo=t&&t[1]||""}return`
34
- `+Qo+e}var qo=!1;function Go(e,t){if(!e||qo)return"";qo=!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(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
33
+ */var fw=j,Yt=hw;function K(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 gg=new Set,Gi={};function us(e,t){Qs(e,t),Qs(e+"Capture",t)}function Qs(e,t){for(Gi[e]=t,e=0;e<t.length;e++)gg.add(t[e])}var Hn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qu=Object.prototype.hasOwnProperty,pw=/^[: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]*$/,cf={},df={};function mw(e){return Qu.call(df,e)?!0:Qu.call(cf,e)?!1:pw.test(e)?df[e]=!0:(cf[e]=!0,!1)}function gw(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function xw(e,t,n,r){if(t===null||typeof t>"u"||gw(e,t,n,r))return!0;if(r)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 At(e,t,n,r,i,l,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=l,this.removeEmptyString=a}var kt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){kt[e]=new At(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];kt[t]=new At(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){kt[e]=new At(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){kt[e]=new At(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){kt[e]=new At(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){kt[e]=new At(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){kt[e]=new At(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){kt[e]=new At(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){kt[e]=new At(e,5,!1,e.toLowerCase(),null,!1,!1)});var wd=/[\-:]([a-z])/g;function kd(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(wd,kd);kt[t]=new At(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(wd,kd);kt[t]=new At(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(wd,kd);kt[t]=new At(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){kt[e]=new At(e,1,!1,e.toLowerCase(),null,!1,!1)});kt.xlinkHref=new At("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){kt[e]=new At(e,1,!1,e.toLowerCase(),null,!0,!0)});function bd(e,t,n,r){var i=kt.hasOwnProperty(t)?kt[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(xw(t,n,i,r)&&(n=null),r||i===null?mw(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Gn=fw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,_l=Symbol.for("react.element"),Cs=Symbol.for("react.portal"),Es=Symbol.for("react.fragment"),Sd=Symbol.for("react.strict_mode"),qu=Symbol.for("react.profiler"),xg=Symbol.for("react.provider"),yg=Symbol.for("react.context"),Nd=Symbol.for("react.forward_ref"),Gu=Symbol.for("react.suspense"),Ku=Symbol.for("react.suspense_list"),Cd=Symbol.for("react.memo"),sr=Symbol.for("react.lazy"),vg=Symbol.for("react.offscreen"),hf=Symbol.iterator;function pi(e){return e===null||typeof e!="object"?null:(e=hf&&e[hf]||e["@@iterator"],typeof e=="function"?e:null)}var Ke=Object.assign,qo;function Ri(e){if(qo===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);qo=t&&t[1]||""}return`
34
+ `+qo+e}var Go=!1;function Ko(e,t){if(!e||Go)return"";Go=!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(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
35
35
  `),l=r.stack.split(`
36
36
  `),a=i.length-1,o=l.length-1;1<=a&&0<=o&&i[a]!==l[o];)o--;for(;1<=a&&0<=o;a--,o--)if(i[a]!==l[o]){if(a!==1||o!==1)do if(a--,o--,0>o||i[a]!==l[o]){var u=`
37
- `+i[a].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=a&&0<=o);break}}}finally{qo=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ri(e):""}function fw(e){switch(e.tag){case 5:return Ri(e.type);case 16:return Ri("Lazy");case 13:return Ri("Suspense");case 19:return Ri("SuspenseList");case 0:case 2:case 15:return e=Go(e.type,!1),e;case 11:return e=Go(e.type.render,!1),e;case 1:return e=Go(e.type,!0),e;default:return""}}function Ku(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 Cs:return"Fragment";case Ns:return"Portal";case Qu:return"Profiler";case bd:return"StrictMode";case qu:return"Suspense";case Gu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case mg:return(e.displayName||"Context")+".Consumer";case pg:return(e._context.displayName||"Context")+".Provider";case Sd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Nd:return t=e.displayName||null,t!==null?t:Ku(e.type)||"Memo";case rr:t=e._payload,e=e._init;try{return Ku(e(t))}catch{}}return null}function pw(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 Ku(t);case 8:return t===bd?"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 vr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function mw(e){var t=xg(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,l.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ol(e){e._valueTracker||(e._valueTracker=mw(e))}function yg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=xg(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ea(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 Yu(e,t){var n=t.checked;return Ke({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function df(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=vr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function vg(e,t){t=t.checked,t!=null&&kd(e,"checked",t,!1)}function Ju(e,t){vg(e,t);var n=vr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Xu(e,t.type,n):t.hasOwnProperty("defaultValue")&&Xu(e,t.type,vr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function hf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="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 Xu(e,t,n){(t!=="number"||Ea(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Li=Array.isArray;function _s(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+vr(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Zu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(K(91));return Ke({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ff(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(K(92));if(Li(n)){if(1<n.length)throw Error(K(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:vr(n)}}function jg(e,t){var n=vr(t.value),r=vr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function pf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function wg(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 ec(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?wg(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Fl,kg=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Fl=Fl||document.createElement("div"),Fl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Fl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ki(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var zi={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},gw=["Webkit","ms","Moz","O"];Object.keys(zi).forEach(function(e){gw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),zi[t]=zi[e]})});function bg(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||zi.hasOwnProperty(e)&&zi[e]?(""+t).trim():t+"px"}function Sg(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=bg(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var xw=Ke({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 tc(e,t){if(t){if(xw[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function nc(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 rc=null;function Cd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var sc=null,Os=null,Fs=null;function mf(e){if(e=vl(e)){if(typeof sc!="function")throw Error(K(280));var t=e.stateNode;t&&(t=xo(t),sc(e.stateNode,e.type,t))}}function Ng(e){Os?Fs?Fs.push(e):Fs=[e]:Os=e}function Cg(){if(Os){var e=Os,t=Fs;if(Fs=Os=null,mf(e),t)for(e=0;e<t.length;e++)mf(t[e])}}function Eg(e,t){return e(t)}function Tg(){}var Ko=!1;function Pg(e,t,n){if(Ko)return e(t,n);Ko=!0;try{return Eg(e,t,n)}finally{Ko=!1,(Os!==null||Fs!==null)&&(Tg(),Cg())}}function Yi(e,t){var n=e.stateNode;if(n===null)return null;var r=xo(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(K(231,t,typeof n));return n}var ic=!1;if(Hn)try{var mi={};Object.defineProperty(mi,"passive",{get:function(){ic=!0}}),window.addEventListener("test",mi,mi),window.removeEventListener("test",mi,mi)}catch{ic=!1}function yw(e,t,n,r,i,l,a,o,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(h){this.onError(h)}}var Mi=!1,Ta=null,Pa=!1,lc=null,vw={onError:function(e){Mi=!0,Ta=e}};function jw(e,t,n,r,i,l,a,o,u){Mi=!1,Ta=null,yw.apply(vw,arguments)}function ww(e,t,n,r,i,l,a,o,u){if(jw.apply(this,arguments),Mi){if(Mi){var c=Ta;Mi=!1,Ta=null}else throw Error(K(198));Pa||(Pa=!0,lc=c)}}function us(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 Rg(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 gf(e){if(us(e)!==e)throw Error(K(188))}function kw(e){var t=e.alternate;if(!t){if(t=us(e),t===null)throw Error(K(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var l=i.alternate;if(l===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===l.child){for(l=i.child;l;){if(l===n)return gf(i),e;if(l===r)return gf(i),t;l=l.sibling}throw Error(K(188))}if(n.return!==r.return)n=i,r=l;else{for(var a=!1,o=i.child;o;){if(o===n){a=!0,n=i,r=l;break}if(o===r){a=!0,r=i,n=l;break}o=o.sibling}if(!a){for(o=l.child;o;){if(o===n){a=!0,n=l,r=i;break}if(o===r){a=!0,r=l,n=i;break}o=o.sibling}if(!a)throw Error(K(189))}}if(n.alternate!==r)throw Error(K(190))}if(n.tag!==3)throw Error(K(188));return n.stateNode.current===n?e:t}function Lg(e){return e=kw(e),e!==null?Ag(e):null}function Ag(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Ag(e);if(t!==null)return t;e=e.sibling}return null}var Ig=Yt.unstable_scheduleCallback,xf=Yt.unstable_cancelCallback,bw=Yt.unstable_shouldYield,Sw=Yt.unstable_requestPaint,et=Yt.unstable_now,Nw=Yt.unstable_getCurrentPriorityLevel,Ed=Yt.unstable_ImmediatePriority,Dg=Yt.unstable_UserBlockingPriority,Ra=Yt.unstable_NormalPriority,Cw=Yt.unstable_LowPriority,zg=Yt.unstable_IdlePriority,fo=null,Rn=null;function Ew(e){if(Rn&&typeof Rn.onCommitFiberRoot=="function")try{Rn.onCommitFiberRoot(fo,e,void 0,(e.current.flags&128)===128)}catch{}}var gn=Math.clz32?Math.clz32:Rw,Tw=Math.log,Pw=Math.LN2;function Rw(e){return e>>>=0,e===0?32:31-(Tw(e)/Pw|0)|0}var Ul=64,Bl=4194304;function Ai(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 La(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,l=e.pingedLanes,a=n&268435455;if(a!==0){var o=a&~i;o!==0?r=Ai(o):(l&=a,l!==0&&(r=Ai(l)))}else a=n&~i,a!==0?r=Ai(a):l!==0&&(r=Ai(l));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,l=t&-t,i>=l||i===16&&(l&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-gn(t),i=1<<n,r|=e[n],t&=~i;return r}function Lw(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 Aw(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,l=e.pendingLanes;0<l;){var a=31-gn(l),o=1<<a,u=i[a];u===-1?(!(o&n)||o&r)&&(i[a]=Lw(o,t)):u<=t&&(e.expiredLanes|=o),l&=~o}}function ac(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Mg(){var e=Ul;return Ul<<=1,!(Ul&4194240)&&(Ul=64),e}function Yo(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function xl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-gn(t),e[t]=n}function Iw(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 r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-gn(n),l=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~l}}function Td(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-gn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var ze=0;function $g(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var _g,Pd,Og,Fg,Ug,oc=!1,Hl=[],dr=null,hr=null,fr=null,Ji=new Map,Xi=new Map,ir=[],Dw="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 yf(e,t){switch(e){case"focusin":case"focusout":dr=null;break;case"dragenter":case"dragleave":hr=null;break;case"mouseover":case"mouseout":fr=null;break;case"pointerover":case"pointerout":Ji.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xi.delete(t.pointerId)}}function gi(e,t,n,r,i,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:l,targetContainers:[i]},t!==null&&(t=vl(t),t!==null&&Pd(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function zw(e,t,n,r,i){switch(t){case"focusin":return dr=gi(dr,e,t,n,r,i),!0;case"dragenter":return hr=gi(hr,e,t,n,r,i),!0;case"mouseover":return fr=gi(fr,e,t,n,r,i),!0;case"pointerover":var l=i.pointerId;return Ji.set(l,gi(Ji.get(l)||null,e,t,n,r,i)),!0;case"gotpointercapture":return l=i.pointerId,Xi.set(l,gi(Xi.get(l)||null,e,t,n,r,i)),!0}return!1}function Bg(e){var t=Qr(e.target);if(t!==null){var n=us(t);if(n!==null){if(t=n.tag,t===13){if(t=Rg(n),t!==null){e.blockedOn=t,Ug(e.priority,function(){Og(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 ha(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=uc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);rc=r,n.target.dispatchEvent(r),rc=null}else return t=vl(n),t!==null&&Pd(t),e.blockedOn=n,!1;t.shift()}return!0}function vf(e,t,n){ha(e)&&n.delete(t)}function Mw(){oc=!1,dr!==null&&ha(dr)&&(dr=null),hr!==null&&ha(hr)&&(hr=null),fr!==null&&ha(fr)&&(fr=null),Ji.forEach(vf),Xi.forEach(vf)}function xi(e,t){e.blockedOn===t&&(e.blockedOn=null,oc||(oc=!0,Yt.unstable_scheduleCallback(Yt.unstable_NormalPriority,Mw)))}function Zi(e){function t(i){return xi(i,e)}if(0<Hl.length){xi(Hl[0],e);for(var n=1;n<Hl.length;n++){var r=Hl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(dr!==null&&xi(dr,e),hr!==null&&xi(hr,e),fr!==null&&xi(fr,e),Ji.forEach(t),Xi.forEach(t),n=0;n<ir.length;n++)r=ir[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ir.length&&(n=ir[0],n.blockedOn===null);)Bg(n),n.blockedOn===null&&ir.shift()}var Us=qn.ReactCurrentBatchConfig,Aa=!0;function $w(e,t,n,r){var i=ze,l=Us.transition;Us.transition=null;try{ze=1,Rd(e,t,n,r)}finally{ze=i,Us.transition=l}}function _w(e,t,n,r){var i=ze,l=Us.transition;Us.transition=null;try{ze=4,Rd(e,t,n,r)}finally{ze=i,Us.transition=l}}function Rd(e,t,n,r){if(Aa){var i=uc(e,t,n,r);if(i===null)lu(e,t,r,Ia,n),yf(e,r);else if(zw(i,e,t,n,r))r.stopPropagation();else if(yf(e,r),t&4&&-1<Dw.indexOf(e)){for(;i!==null;){var l=vl(i);if(l!==null&&_g(l),l=uc(e,t,n,r),l===null&&lu(e,t,r,Ia,n),l===i)break;i=l}i!==null&&r.stopPropagation()}else lu(e,t,r,null,n)}}var Ia=null;function uc(e,t,n,r){if(Ia=null,e=Cd(r),e=Qr(e),e!==null)if(t=us(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Rg(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 Ia=e,null}function Hg(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(Nw()){case Ed:return 1;case Dg:return 4;case Ra:case Cw:return 16;case zg:return 536870912;default:return 16}default:return 16}}var ar=null,Ld=null,fa=null;function Wg(){if(fa)return fa;var e,t=Ld,n=t.length,r,i="value"in ar?ar.value:ar.textContent,l=i.length;for(e=0;e<n&&t[e]===i[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===i[l-r];r++);return fa=i.slice(e,1<r?1-r:void 0)}function pa(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 Wl(){return!0}function jf(){return!1}function Xt(e){function t(n,r,i,l,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=l,this.target=a,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(l):l[o]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?Wl:jf,this.isPropagationStopped=jf,this}return Ke(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Wl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Wl)},persist:function(){},isPersistent:Wl}),t}var si={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ad=Xt(si),yl=Ke({},si,{view:0,detail:0}),Ow=Xt(yl),Jo,Xo,yi,po=Ke({},yl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Id,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!==yi&&(yi&&e.type==="mousemove"?(Jo=e.screenX-yi.screenX,Xo=e.screenY-yi.screenY):Xo=Jo=0,yi=e),Jo)},movementY:function(e){return"movementY"in e?e.movementY:Xo}}),wf=Xt(po),Fw=Ke({},po,{dataTransfer:0}),Uw=Xt(Fw),Bw=Ke({},yl,{relatedTarget:0}),Zo=Xt(Bw),Hw=Ke({},si,{animationName:0,elapsedTime:0,pseudoElement:0}),Ww=Xt(Hw),Vw=Ke({},si,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Qw=Xt(Vw),qw=Ke({},si,{data:0}),kf=Xt(qw),Gw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Kw={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"},Yw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Jw(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yw[e])?!!t[e]:!1}function Id(){return Jw}var Xw=Ke({},yl,{key:function(e){if(e.key){var t=Gw[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=pa(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Kw[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Id,charCode:function(e){return e.type==="keypress"?pa(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?pa(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Zw=Xt(Xw),e1=Ke({},po,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bf=Xt(e1),t1=Ke({},yl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Id}),n1=Xt(t1),r1=Ke({},si,{propertyName:0,elapsedTime:0,pseudoElement:0}),s1=Xt(r1),i1=Ke({},po,{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}),l1=Xt(i1),a1=[9,13,27,32],Dd=Hn&&"CompositionEvent"in window,$i=null;Hn&&"documentMode"in document&&($i=document.documentMode);var o1=Hn&&"TextEvent"in window&&!$i,Vg=Hn&&(!Dd||$i&&8<$i&&11>=$i),Sf=" ",Nf=!1;function Qg(e,t){switch(e){case"keyup":return a1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Es=!1;function u1(e,t){switch(e){case"compositionend":return qg(t);case"keypress":return t.which!==32?null:(Nf=!0,Sf);case"textInput":return e=t.data,e===Sf&&Nf?null:e;default:return null}}function c1(e,t){if(Es)return e==="compositionend"||!Dd&&Qg(e,t)?(e=Wg(),fa=Ld=ar=null,Es=!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 Vg&&t.locale!=="ko"?null:t.data;default:return null}}var d1={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 Cf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!d1[e.type]:t==="textarea"}function Gg(e,t,n,r){Ng(r),t=Da(t,"onChange"),0<t.length&&(n=new Ad("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var _i=null,el=null;function h1(e){ix(e,0)}function mo(e){var t=Rs(e);if(yg(t))return e}function f1(e,t){if(e==="change")return t}var Kg=!1;if(Hn){var eu;if(Hn){var tu="oninput"in document;if(!tu){var Ef=document.createElement("div");Ef.setAttribute("oninput","return;"),tu=typeof Ef.oninput=="function"}eu=tu}else eu=!1;Kg=eu&&(!document.documentMode||9<document.documentMode)}function Tf(){_i&&(_i.detachEvent("onpropertychange",Yg),el=_i=null)}function Yg(e){if(e.propertyName==="value"&&mo(el)){var t=[];Gg(t,el,e,Cd(e)),Pg(h1,t)}}function p1(e,t,n){e==="focusin"?(Tf(),_i=t,el=n,_i.attachEvent("onpropertychange",Yg)):e==="focusout"&&Tf()}function m1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return mo(el)}function g1(e,t){if(e==="click")return mo(t)}function x1(e,t){if(e==="input"||e==="change")return mo(t)}function y1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var jn=typeof Object.is=="function"?Object.is:y1;function tl(e,t){if(jn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Vu.call(t,i)||!jn(e[i],t[i]))return!1}return!0}function Pf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Rf(e,t){var n=Pf(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Pf(n)}}function Jg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Jg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xg(){for(var e=window,t=Ea();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ea(e.document)}return t}function zd(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 v1(e){var t=Xg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Jg(n.ownerDocument.documentElement,n)){if(r!==null&&zd(n)){if(t=r.start,e=r.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 i=n.textContent.length,l=Math.min(r.start,i);r=r.end===void 0?l:Math.min(r.end,i),!e.extend&&l>r&&(i=r,r=l,l=i),i=Rf(n,l);var a=Rf(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),l>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.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 j1=Hn&&"documentMode"in document&&11>=document.documentMode,Ts=null,cc=null,Oi=null,dc=!1;function Lf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;dc||Ts==null||Ts!==Ea(r)||(r=Ts,"selectionStart"in r&&zd(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Oi&&tl(Oi,r)||(Oi=r,r=Da(cc,"onSelect"),0<r.length&&(t=new Ad("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ts)))}function Vl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ps={animationend:Vl("Animation","AnimationEnd"),animationiteration:Vl("Animation","AnimationIteration"),animationstart:Vl("Animation","AnimationStart"),transitionend:Vl("Transition","TransitionEnd")},nu={},Zg={};Hn&&(Zg=document.createElement("div").style,"AnimationEvent"in window||(delete Ps.animationend.animation,delete Ps.animationiteration.animation,delete Ps.animationstart.animation),"TransitionEvent"in window||delete Ps.transitionend.transition);function go(e){if(nu[e])return nu[e];if(!Ps[e])return e;var t=Ps[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Zg)return nu[e]=t[n];return e}var ex=go("animationend"),tx=go("animationiteration"),nx=go("animationstart"),rx=go("transitionend"),sx=new Map,Af="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 Cr(e,t){sx.set(e,t),os(t,[e])}for(var ru=0;ru<Af.length;ru++){var su=Af[ru],w1=su.toLowerCase(),k1=su[0].toUpperCase()+su.slice(1);Cr(w1,"on"+k1)}Cr(ex,"onAnimationEnd");Cr(tx,"onAnimationIteration");Cr(nx,"onAnimationStart");Cr("dblclick","onDoubleClick");Cr("focusin","onFocus");Cr("focusout","onBlur");Cr(rx,"onTransitionEnd");Vs("onMouseEnter",["mouseout","mouseover"]);Vs("onMouseLeave",["mouseout","mouseover"]);Vs("onPointerEnter",["pointerout","pointerover"]);Vs("onPointerLeave",["pointerout","pointerover"]);os("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));os("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));os("onBeforeInput",["compositionend","keypress","textInput","paste"]);os("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));os("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));os("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ii="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(" "),b1=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ii));function If(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,ww(r,t,void 0,e),e.currentTarget=null}function ix(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var l=void 0;if(t)for(var a=r.length-1;0<=a;a--){var o=r[a],u=o.instance,c=o.currentTarget;if(o=o.listener,u!==l&&i.isPropagationStopped())break e;If(i,o,c),l=u}else for(a=0;a<r.length;a++){if(o=r[a],u=o.instance,c=o.currentTarget,o=o.listener,u!==l&&i.isPropagationStopped())break e;If(i,o,c),l=u}}}if(Pa)throw e=lc,Pa=!1,lc=null,e}function He(e,t){var n=t[gc];n===void 0&&(n=t[gc]=new Set);var r=e+"__bubble";n.has(r)||(lx(t,e,2,!1),n.add(r))}function iu(e,t,n){var r=0;t&&(r|=4),lx(n,e,r,t)}var Ql="_reactListening"+Math.random().toString(36).slice(2);function nl(e){if(!e[Ql]){e[Ql]=!0,fg.forEach(function(n){n!=="selectionchange"&&(b1.has(n)||iu(n,!1,e),iu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ql]||(t[Ql]=!0,iu("selectionchange",!1,t))}}function lx(e,t,n,r){switch(Hg(t)){case 1:var i=$w;break;case 4:i=_w;break;default:i=Rd}n=i.bind(null,t,n,e),i=void 0,!ic||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function lu(e,t,n,r,i){var l=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var o=r.stateNode.containerInfo;if(o===i||o.nodeType===8&&o.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var u=a.tag;if((u===3||u===4)&&(u=a.stateNode.containerInfo,u===i||u.nodeType===8&&u.parentNode===i))return;a=a.return}for(;o!==null;){if(a=Qr(o),a===null)return;if(u=a.tag,u===5||u===6){r=l=a;continue e}o=o.parentNode}}r=r.return}Pg(function(){var c=l,h=Cd(n),d=[];e:{var f=sx.get(e);if(f!==void 0){var m=Ad,p=e;switch(e){case"keypress":if(pa(n)===0)break e;case"keydown":case"keyup":m=Zw;break;case"focusin":p="focus",m=Zo;break;case"focusout":p="blur",m=Zo;break;case"beforeblur":case"afterblur":m=Zo;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":m=wf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=Uw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=n1;break;case ex:case tx:case nx:m=Ww;break;case rx:m=s1;break;case"scroll":m=Ow;break;case"wheel":m=l1;break;case"copy":case"cut":case"paste":m=Qw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=bf}var g=(t&4)!==0,w=!g&&e==="scroll",y=g?f!==null?f+"Capture":null:f;g=[];for(var x=c,v;x!==null;){v=x;var b=v.stateNode;if(v.tag===5&&b!==null&&(v=b,y!==null&&(b=Yi(x,y),b!=null&&g.push(rl(x,b,v)))),w)break;x=x.return}0<g.length&&(f=new m(f,p,null,n,h),d.push({event:f,listeners:g}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",f&&n!==rc&&(p=n.relatedTarget||n.fromElement)&&(Qr(p)||p[Wn]))break e;if((m||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,m?(p=n.relatedTarget||n.toElement,m=c,p=p?Qr(p):null,p!==null&&(w=us(p),p!==w||p.tag!==5&&p.tag!==6)&&(p=null)):(m=null,p=c),m!==p)){if(g=wf,b="onMouseLeave",y="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(g=bf,b="onPointerLeave",y="onPointerEnter",x="pointer"),w=m==null?f:Rs(m),v=p==null?f:Rs(p),f=new g(b,x+"leave",m,n,h),f.target=w,f.relatedTarget=v,b=null,Qr(h)===c&&(g=new g(y,x+"enter",p,n,h),g.target=v,g.relatedTarget=w,b=g),w=b,m&&p)t:{for(g=m,y=p,x=0,v=g;v;v=vs(v))x++;for(v=0,b=y;b;b=vs(b))v++;for(;0<x-v;)g=vs(g),x--;for(;0<v-x;)y=vs(y),v--;for(;x--;){if(g===y||y!==null&&g===y.alternate)break t;g=vs(g),y=vs(y)}g=null}else g=null;m!==null&&Df(d,f,m,g,!1),p!==null&&w!==null&&Df(d,w,p,g,!0)}}e:{if(f=c?Rs(c):window,m=f.nodeName&&f.nodeName.toLowerCase(),m==="select"||m==="input"&&f.type==="file")var A=f1;else if(Cf(f))if(Kg)A=x1;else{A=m1;var k=p1}else(m=f.nodeName)&&m.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(A=g1);if(A&&(A=A(e,c))){Gg(d,A,n,h);break e}k&&k(e,f,c),e==="focusout"&&(k=f._wrapperState)&&k.controlled&&f.type==="number"&&Xu(f,"number",f.value)}switch(k=c?Rs(c):window,e){case"focusin":(Cf(k)||k.contentEditable==="true")&&(Ts=k,cc=c,Oi=null);break;case"focusout":Oi=cc=Ts=null;break;case"mousedown":dc=!0;break;case"contextmenu":case"mouseup":case"dragend":dc=!1,Lf(d,n,h);break;case"selectionchange":if(j1)break;case"keydown":case"keyup":Lf(d,n,h)}var E;if(Dd)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else Es?Qg(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(Vg&&n.locale!=="ko"&&(Es||T!=="onCompositionStart"?T==="onCompositionEnd"&&Es&&(E=Wg()):(ar=h,Ld="value"in ar?ar.value:ar.textContent,Es=!0)),k=Da(c,T),0<k.length&&(T=new kf(T,e,null,n,h),d.push({event:T,listeners:k}),E?T.data=E:(E=qg(n),E!==null&&(T.data=E)))),(E=o1?u1(e,n):c1(e,n))&&(c=Da(c,"onBeforeInput"),0<c.length&&(h=new kf("onBeforeInput","beforeinput",null,n,h),d.push({event:h,listeners:c}),h.data=E))}ix(d,t)})}function rl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Da(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,l=i.stateNode;i.tag===5&&l!==null&&(i=l,l=Yi(e,n),l!=null&&r.unshift(rl(e,l,i)),l=Yi(e,t),l!=null&&r.push(rl(e,l,i))),e=e.return}return r}function vs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Df(e,t,n,r,i){for(var l=t._reactName,a=[];n!==null&&n!==r;){var o=n,u=o.alternate,c=o.stateNode;if(u!==null&&u===r)break;o.tag===5&&c!==null&&(o=c,i?(u=Yi(n,l),u!=null&&a.unshift(rl(n,u,o))):i||(u=Yi(n,l),u!=null&&a.push(rl(n,u,o)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var S1=/\r\n?/g,N1=/\u0000|\uFFFD/g;function zf(e){return(typeof e=="string"?e:""+e).replace(S1,`
38
- `).replace(N1,"")}function ql(e,t,n){if(t=zf(t),zf(e)!==t&&n)throw Error(K(425))}function za(){}var hc=null,fc=null;function pc(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 mc=typeof setTimeout=="function"?setTimeout:void 0,C1=typeof clearTimeout=="function"?clearTimeout:void 0,Mf=typeof Promise=="function"?Promise:void 0,E1=typeof queueMicrotask=="function"?queueMicrotask:typeof Mf<"u"?function(e){return Mf.resolve(null).then(e).catch(T1)}:mc;function T1(e){setTimeout(function(){throw e})}function au(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),Zi(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Zi(t)}function pr(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 $f(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 ii=Math.random().toString(36).slice(2),Tn="__reactFiber$"+ii,sl="__reactProps$"+ii,Wn="__reactContainer$"+ii,gc="__reactEvents$"+ii,P1="__reactListeners$"+ii,R1="__reactHandles$"+ii;function Qr(e){var t=e[Tn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Wn]||n[Tn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=$f(e);e!==null;){if(n=e[Tn])return n;e=$f(e)}return t}e=n,n=e.parentNode}return null}function vl(e){return e=e[Tn]||e[Wn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Rs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(K(33))}function xo(e){return e[sl]||null}var xc=[],Ls=-1;function Er(e){return{current:e}}function We(e){0>Ls||(e.current=xc[Ls],xc[Ls]=null,Ls--)}function Be(e,t){Ls++,xc[Ls]=e.current,e.current=t}var jr={},Et=Er(jr),$t=Er(!1),es=jr;function Qs(e,t){var n=e.type.contextTypes;if(!n)return jr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},l;for(l in n)i[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function _t(e){return e=e.childContextTypes,e!=null}function Ma(){We($t),We(Et)}function _f(e,t,n){if(Et.current!==jr)throw Error(K(168));Be(Et,t),Be($t,n)}function ax(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(K(108,pw(e)||"Unknown",i));return Ke({},n,r)}function $a(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||jr,es=Et.current,Be(Et,e),Be($t,$t.current),!0}function Of(e,t,n){var r=e.stateNode;if(!r)throw Error(K(169));n?(e=ax(e,t,es),r.__reactInternalMemoizedMergedChildContext=e,We($t),We(Et),Be(Et,e)):We($t),Be($t,n)}var _n=null,yo=!1,ou=!1;function ox(e){_n===null?_n=[e]:_n.push(e)}function L1(e){yo=!0,ox(e)}function Tr(){if(!ou&&_n!==null){ou=!0;var e=0,t=ze;try{var n=_n;for(ze=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}_n=null,yo=!1}catch(i){throw _n!==null&&(_n=_n.slice(e+1)),Ig(Ed,Tr),i}finally{ze=t,ou=!1}}return null}var As=[],Is=0,_a=null,Oa=0,en=[],tn=0,ts=null,On=1,Fn="";function Ur(e,t){As[Is++]=Oa,As[Is++]=_a,_a=e,Oa=t}function ux(e,t,n){en[tn++]=On,en[tn++]=Fn,en[tn++]=ts,ts=e;var r=On;e=Fn;var i=32-gn(r)-1;r&=~(1<<i),n+=1;var l=32-gn(t)+i;if(30<l){var a=i-i%5;l=(r&(1<<a)-1).toString(32),r>>=a,i-=a,On=1<<32-gn(t)+i|n<<i|r,Fn=l+e}else On=1<<l|n<<i|r,Fn=e}function Md(e){e.return!==null&&(Ur(e,1),ux(e,1,0))}function $d(e){for(;e===_a;)_a=As[--Is],As[Is]=null,Oa=As[--Is],As[Is]=null;for(;e===ts;)ts=en[--tn],en[tn]=null,Fn=en[--tn],en[tn]=null,On=en[--tn],en[tn]=null}var Gt=null,Qt=null,Qe=!1,mn=null;function cx(e,t){var n=rn(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 Ff(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,Gt=e,Qt=pr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Gt=e,Qt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ts!==null?{id:On,overflow:Fn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=rn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Gt=e,Qt=null,!0):!1;default:return!1}}function yc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function vc(e){if(Qe){var t=Qt;if(t){var n=t;if(!Ff(e,t)){if(yc(e))throw Error(K(418));t=pr(n.nextSibling);var r=Gt;t&&Ff(e,t)?cx(r,n):(e.flags=e.flags&-4097|2,Qe=!1,Gt=e)}}else{if(yc(e))throw Error(K(418));e.flags=e.flags&-4097|2,Qe=!1,Gt=e}}}function Uf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Gt=e}function Gl(e){if(e!==Gt)return!1;if(!Qe)return Uf(e),Qe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!pc(e.type,e.memoizedProps)),t&&(t=Qt)){if(yc(e))throw dx(),Error(K(418));for(;t;)cx(e,t),t=pr(t.nextSibling)}if(Uf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(K(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Qt=pr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Qt=null}}else Qt=Gt?pr(e.stateNode.nextSibling):null;return!0}function dx(){for(var e=Qt;e;)e=pr(e.nextSibling)}function qs(){Qt=Gt=null,Qe=!1}function _d(e){mn===null?mn=[e]:mn.push(e)}var A1=qn.ReactCurrentBatchConfig;function vi(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(K(309));var r=n.stateNode}if(!r)throw Error(K(147,e));var i=r,l=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===l?t.ref:(t=function(a){var o=i.refs;a===null?delete o[l]:o[l]=a},t._stringRef=l,t)}if(typeof e!="string")throw Error(K(284));if(!n._owner)throw Error(K(290,e))}return e}function Kl(e,t){throw e=Object.prototype.toString.call(t),Error(K(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Bf(e){var t=e._init;return t(e._payload)}function hx(e){function t(y,x){if(e){var v=y.deletions;v===null?(y.deletions=[x],y.flags|=16):v.push(x)}}function n(y,x){if(!e)return null;for(;x!==null;)t(y,x),x=x.sibling;return null}function r(y,x){for(y=new Map;x!==null;)x.key!==null?y.set(x.key,x):y.set(x.index,x),x=x.sibling;return y}function i(y,x){return y=yr(y,x),y.index=0,y.sibling=null,y}function l(y,x,v){return y.index=v,e?(v=y.alternate,v!==null?(v=v.index,v<x?(y.flags|=2,x):v):(y.flags|=2,x)):(y.flags|=1048576,x)}function a(y){return e&&y.alternate===null&&(y.flags|=2),y}function o(y,x,v,b){return x===null||x.tag!==6?(x=mu(v,y.mode,b),x.return=y,x):(x=i(x,v),x.return=y,x)}function u(y,x,v,b){var A=v.type;return A===Cs?h(y,x,v.props.children,b,v.key):x!==null&&(x.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===rr&&Bf(A)===x.type)?(b=i(x,v.props),b.ref=vi(y,x,v),b.return=y,b):(b=wa(v.type,v.key,v.props,null,y.mode,b),b.ref=vi(y,x,v),b.return=y,b)}function c(y,x,v,b){return x===null||x.tag!==4||x.stateNode.containerInfo!==v.containerInfo||x.stateNode.implementation!==v.implementation?(x=gu(v,y.mode,b),x.return=y,x):(x=i(x,v.children||[]),x.return=y,x)}function h(y,x,v,b,A){return x===null||x.tag!==7?(x=Xr(v,y.mode,b,A),x.return=y,x):(x=i(x,v),x.return=y,x)}function d(y,x,v){if(typeof x=="string"&&x!==""||typeof x=="number")return x=mu(""+x,y.mode,v),x.return=y,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case _l:return v=wa(x.type,x.key,x.props,null,y.mode,v),v.ref=vi(y,null,x),v.return=y,v;case Ns:return x=gu(x,y.mode,v),x.return=y,x;case rr:var b=x._init;return d(y,b(x._payload),v)}if(Li(x)||pi(x))return x=Xr(x,y.mode,v,null),x.return=y,x;Kl(y,x)}return null}function f(y,x,v,b){var A=x!==null?x.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return A!==null?null:o(y,x,""+v,b);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case _l:return v.key===A?u(y,x,v,b):null;case Ns:return v.key===A?c(y,x,v,b):null;case rr:return A=v._init,f(y,x,A(v._payload),b)}if(Li(v)||pi(v))return A!==null?null:h(y,x,v,b,null);Kl(y,v)}return null}function m(y,x,v,b,A){if(typeof b=="string"&&b!==""||typeof b=="number")return y=y.get(v)||null,o(x,y,""+b,A);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case _l:return y=y.get(b.key===null?v:b.key)||null,u(x,y,b,A);case Ns:return y=y.get(b.key===null?v:b.key)||null,c(x,y,b,A);case rr:var k=b._init;return m(y,x,v,k(b._payload),A)}if(Li(b)||pi(b))return y=y.get(v)||null,h(x,y,b,A,null);Kl(x,b)}return null}function p(y,x,v,b){for(var A=null,k=null,E=x,T=x=0,I=null;E!==null&&T<v.length;T++){E.index>T?(I=E,E=null):I=E.sibling;var C=f(y,E,v[T],b);if(C===null){E===null&&(E=I);break}e&&E&&C.alternate===null&&t(y,E),x=l(C,x,T),k===null?A=C:k.sibling=C,k=C,E=I}if(T===v.length)return n(y,E),Qe&&Ur(y,T),A;if(E===null){for(;T<v.length;T++)E=d(y,v[T],b),E!==null&&(x=l(E,x,T),k===null?A=E:k.sibling=E,k=E);return Qe&&Ur(y,T),A}for(E=r(y,E);T<v.length;T++)I=m(E,y,T,v[T],b),I!==null&&(e&&I.alternate!==null&&E.delete(I.key===null?T:I.key),x=l(I,x,T),k===null?A=I:k.sibling=I,k=I);return e&&E.forEach(function(R){return t(y,R)}),Qe&&Ur(y,T),A}function g(y,x,v,b){var A=pi(v);if(typeof A!="function")throw Error(K(150));if(v=A.call(v),v==null)throw Error(K(151));for(var k=A=null,E=x,T=x=0,I=null,C=v.next();E!==null&&!C.done;T++,C=v.next()){E.index>T?(I=E,E=null):I=E.sibling;var R=f(y,E,C.value,b);if(R===null){E===null&&(E=I);break}e&&E&&R.alternate===null&&t(y,E),x=l(R,x,T),k===null?A=R:k.sibling=R,k=R,E=I}if(C.done)return n(y,E),Qe&&Ur(y,T),A;if(E===null){for(;!C.done;T++,C=v.next())C=d(y,C.value,b),C!==null&&(x=l(C,x,T),k===null?A=C:k.sibling=C,k=C);return Qe&&Ur(y,T),A}for(E=r(y,E);!C.done;T++,C=v.next())C=m(E,y,T,C.value,b),C!==null&&(e&&C.alternate!==null&&E.delete(C.key===null?T:C.key),x=l(C,x,T),k===null?A=C:k.sibling=C,k=C);return e&&E.forEach(function(L){return t(y,L)}),Qe&&Ur(y,T),A}function w(y,x,v,b){if(typeof v=="object"&&v!==null&&v.type===Cs&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case _l:e:{for(var A=v.key,k=x;k!==null;){if(k.key===A){if(A=v.type,A===Cs){if(k.tag===7){n(y,k.sibling),x=i(k,v.props.children),x.return=y,y=x;break e}}else if(k.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===rr&&Bf(A)===k.type){n(y,k.sibling),x=i(k,v.props),x.ref=vi(y,k,v),x.return=y,y=x;break e}n(y,k);break}else t(y,k);k=k.sibling}v.type===Cs?(x=Xr(v.props.children,y.mode,b,v.key),x.return=y,y=x):(b=wa(v.type,v.key,v.props,null,y.mode,b),b.ref=vi(y,x,v),b.return=y,y=b)}return a(y);case Ns:e:{for(k=v.key;x!==null;){if(x.key===k)if(x.tag===4&&x.stateNode.containerInfo===v.containerInfo&&x.stateNode.implementation===v.implementation){n(y,x.sibling),x=i(x,v.children||[]),x.return=y,y=x;break e}else{n(y,x);break}else t(y,x);x=x.sibling}x=gu(v,y.mode,b),x.return=y,y=x}return a(y);case rr:return k=v._init,w(y,x,k(v._payload),b)}if(Li(v))return p(y,x,v,b);if(pi(v))return g(y,x,v,b);Kl(y,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,x!==null&&x.tag===6?(n(y,x.sibling),x=i(x,v),x.return=y,y=x):(n(y,x),x=mu(v,y.mode,b),x.return=y,y=x),a(y)):n(y,x)}return w}var Gs=hx(!0),fx=hx(!1),Fa=Er(null),Ua=null,Ds=null,Od=null;function Fd(){Od=Ds=Ua=null}function Ud(e){var t=Fa.current;We(Fa),e._currentValue=t}function jc(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Bs(e,t){Ua=e,Od=Ds=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Mt=!0),e.firstContext=null)}function an(e){var t=e._currentValue;if(Od!==e)if(e={context:e,memoizedValue:t,next:null},Ds===null){if(Ua===null)throw Error(K(308));Ds=e,Ua.dependencies={lanes:0,firstContext:e}}else Ds=Ds.next=e;return t}var qr=null;function Bd(e){qr===null?qr=[e]:qr.push(e)}function px(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Bd(t)):(n.next=i.next,i.next=n),t.interleaved=n,Vn(e,r)}function Vn(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 sr=!1;function Hd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function mx(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 Un(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function mr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Re&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Vn(e,n)}return i=r.interleaved,i===null?(t.next=t,Bd(r)):(t.next=i.next,i.next=t),r.interleaved=t,Vn(e,n)}function ma(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Td(e,n)}}function Hf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};l===null?i=l=a:l=l.next=a,n=n.next}while(n!==null);l===null?i=l=t:l=l.next=t}else i=l=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:l,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ba(e,t,n,r){var i=e.updateQueue;sr=!1;var l=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var u=o,c=u.next;u.next=null,a===null?l=c:a.next=c,a=u;var h=e.alternate;h!==null&&(h=h.updateQueue,o=h.lastBaseUpdate,o!==a&&(o===null?h.firstBaseUpdate=c:o.next=c,h.lastBaseUpdate=u))}if(l!==null){var d=i.baseState;a=0,h=c=u=null,o=l;do{var f=o.lane,m=o.eventTime;if((r&f)===f){h!==null&&(h=h.next={eventTime:m,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var p=e,g=o;switch(f=t,m=n,g.tag){case 1:if(p=g.payload,typeof p=="function"){d=p.call(m,d,f);break e}d=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=g.payload,f=typeof p=="function"?p.call(m,d,f):p,f==null)break e;d=Ke({},d,f);break e;case 2:sr=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[o]:f.push(o))}else m={eventTime:m,lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},h===null?(c=h=m,u=d):h=h.next=m,a|=f;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;f=o,o=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(h===null&&(u=d),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=h,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else l===null&&(i.shared.lanes=0);rs|=a,e.lanes=a,e.memoizedState=d}}function Wf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(K(191,i));i.call(r)}}}var jl={},Ln=Er(jl),il=Er(jl),ll=Er(jl);function Gr(e){if(e===jl)throw Error(K(174));return e}function Wd(e,t){switch(Be(ll,t),Be(il,e),Be(Ln,jl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ec(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ec(t,e)}We(Ln),Be(Ln,t)}function Ks(){We(Ln),We(il),We(ll)}function gx(e){Gr(ll.current);var t=Gr(Ln.current),n=ec(t,e.type);t!==n&&(Be(il,e),Be(Ln,n))}function Vd(e){il.current===e&&(We(Ln),We(il))}var qe=Er(0);function Ha(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 uu=[];function Qd(){for(var e=0;e<uu.length;e++)uu[e]._workInProgressVersionPrimary=null;uu.length=0}var ga=qn.ReactCurrentDispatcher,cu=qn.ReactCurrentBatchConfig,ns=0,Ge=null,lt=null,dt=null,Wa=!1,Fi=!1,al=0,I1=0;function St(){throw Error(K(321))}function qd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!jn(e[n],t[n]))return!1;return!0}function Gd(e,t,n,r,i,l){if(ns=l,Ge=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ga.current=e===null||e.memoizedState===null?$1:_1,e=n(r,i),Fi){l=0;do{if(Fi=!1,al=0,25<=l)throw Error(K(301));l+=1,dt=lt=null,t.updateQueue=null,ga.current=O1,e=n(r,i)}while(Fi)}if(ga.current=Va,t=lt!==null&&lt.next!==null,ns=0,dt=lt=Ge=null,Wa=!1,t)throw Error(K(300));return e}function Kd(){var e=al!==0;return al=0,e}function Cn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dt===null?Ge.memoizedState=dt=e:dt=dt.next=e,dt}function on(){if(lt===null){var e=Ge.alternate;e=e!==null?e.memoizedState:null}else e=lt.next;var t=dt===null?Ge.memoizedState:dt.next;if(t!==null)dt=t,lt=e;else{if(e===null)throw Error(K(310));lt=e,e={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},dt===null?Ge.memoizedState=dt=e:dt=dt.next=e}return dt}function ol(e,t){return typeof t=="function"?t(e):t}function du(e){var t=on(),n=t.queue;if(n===null)throw Error(K(311));n.lastRenderedReducer=e;var r=lt,i=r.baseQueue,l=n.pending;if(l!==null){if(i!==null){var a=i.next;i.next=l.next,l.next=a}r.baseQueue=i=l,n.pending=null}if(i!==null){l=i.next,r=r.baseState;var o=a=null,u=null,c=l;do{var h=c.lane;if((ns&h)===h)u!==null&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var d={lane:h,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(o=u=d,a=r):u=u.next=d,Ge.lanes|=h,rs|=h}c=c.next}while(c!==null&&c!==l);u===null?a=r:u.next=o,jn(r,t.memoizedState)||(Mt=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do l=i.lane,Ge.lanes|=l,rs|=l,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function hu(e){var t=on(),n=t.queue;if(n===null)throw Error(K(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,l=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do l=e(l,a.action),a=a.next;while(a!==i);jn(l,t.memoizedState)||(Mt=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,r]}function xx(){}function yx(e,t){var n=Ge,r=on(),i=t(),l=!jn(r.memoizedState,i);if(l&&(r.memoizedState=i,Mt=!0),r=r.queue,Yd(wx.bind(null,n,r,e),[e]),r.getSnapshot!==t||l||dt!==null&&dt.memoizedState.tag&1){if(n.flags|=2048,ul(9,jx.bind(null,n,r,i,t),void 0,null),ht===null)throw Error(K(349));ns&30||vx(n,t,i)}return i}function vx(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ge.updateQueue,t===null?(t={lastEffect:null,stores:null},Ge.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function jx(e,t,n,r){t.value=n,t.getSnapshot=r,kx(t)&&bx(e)}function wx(e,t,n){return n(function(){kx(t)&&bx(e)})}function kx(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!jn(e,n)}catch{return!0}}function bx(e){var t=Vn(e,1);t!==null&&xn(t,e,1,-1)}function Vf(e){var t=Cn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ol,lastRenderedState:e},t.queue=e,e=e.dispatch=M1.bind(null,Ge,e),[t.memoizedState,e]}function ul(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ge.updateQueue,t===null?(t={lastEffect:null,stores:null},Ge.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Sx(){return on().memoizedState}function xa(e,t,n,r){var i=Cn();Ge.flags|=e,i.memoizedState=ul(1|t,n,void 0,r===void 0?null:r)}function vo(e,t,n,r){var i=on();r=r===void 0?null:r;var l=void 0;if(lt!==null){var a=lt.memoizedState;if(l=a.destroy,r!==null&&qd(r,a.deps)){i.memoizedState=ul(t,n,l,r);return}}Ge.flags|=e,i.memoizedState=ul(1|t,n,l,r)}function Qf(e,t){return xa(8390656,8,e,t)}function Yd(e,t){return vo(2048,8,e,t)}function Nx(e,t){return vo(4,2,e,t)}function Cx(e,t){return vo(4,4,e,t)}function Ex(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 Tx(e,t,n){return n=n!=null?n.concat([e]):null,vo(4,4,Ex.bind(null,t,e),n)}function Jd(){}function Px(e,t){var n=on();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&qd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Rx(e,t){var n=on();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&qd(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Lx(e,t,n){return ns&21?(jn(n,t)||(n=Mg(),Ge.lanes|=n,rs|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Mt=!0),e.memoizedState=n)}function D1(e,t){var n=ze;ze=n!==0&&4>n?n:4,e(!0);var r=cu.transition;cu.transition={};try{e(!1),t()}finally{ze=n,cu.transition=r}}function Ax(){return on().memoizedState}function z1(e,t,n){var r=xr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ix(e))Dx(t,n);else if(n=px(e,t,n,r),n!==null){var i=Pt();xn(n,e,r,i),zx(n,t,r)}}function M1(e,t,n){var r=xr(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ix(e))Dx(t,i);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var a=t.lastRenderedState,o=l(a,n);if(i.hasEagerState=!0,i.eagerState=o,jn(o,a)){var u=t.interleaved;u===null?(i.next=i,Bd(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=px(e,t,i,r),n!==null&&(i=Pt(),xn(n,e,r,i),zx(n,t,r))}}function Ix(e){var t=e.alternate;return e===Ge||t!==null&&t===Ge}function Dx(e,t){Fi=Wa=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function zx(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Td(e,n)}}var Va={readContext:an,useCallback:St,useContext:St,useEffect:St,useImperativeHandle:St,useInsertionEffect:St,useLayoutEffect:St,useMemo:St,useReducer:St,useRef:St,useState:St,useDebugValue:St,useDeferredValue:St,useTransition:St,useMutableSource:St,useSyncExternalStore:St,useId:St,unstable_isNewReconciler:!1},$1={readContext:an,useCallback:function(e,t){return Cn().memoizedState=[e,t===void 0?null:t],e},useContext:an,useEffect:Qf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,xa(4194308,4,Ex.bind(null,t,e),n)},useLayoutEffect:function(e,t){return xa(4194308,4,e,t)},useInsertionEffect:function(e,t){return xa(4,2,e,t)},useMemo:function(e,t){var n=Cn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Cn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=z1.bind(null,Ge,e),[r.memoizedState,e]},useRef:function(e){var t=Cn();return e={current:e},t.memoizedState=e},useState:Vf,useDebugValue:Jd,useDeferredValue:function(e){return Cn().memoizedState=e},useTransition:function(){var e=Vf(!1),t=e[0];return e=D1.bind(null,e[1]),Cn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ge,i=Cn();if(Qe){if(n===void 0)throw Error(K(407));n=n()}else{if(n=t(),ht===null)throw Error(K(349));ns&30||vx(r,t,n)}i.memoizedState=n;var l={value:n,getSnapshot:t};return i.queue=l,Qf(wx.bind(null,r,l,e),[e]),r.flags|=2048,ul(9,jx.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=Cn(),t=ht.identifierPrefix;if(Qe){var n=Fn,r=On;n=(r&~(1<<32-gn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=al++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=I1++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},_1={readContext:an,useCallback:Px,useContext:an,useEffect:Yd,useImperativeHandle:Tx,useInsertionEffect:Nx,useLayoutEffect:Cx,useMemo:Rx,useReducer:du,useRef:Sx,useState:function(){return du(ol)},useDebugValue:Jd,useDeferredValue:function(e){var t=on();return Lx(t,lt.memoizedState,e)},useTransition:function(){var e=du(ol)[0],t=on().memoizedState;return[e,t]},useMutableSource:xx,useSyncExternalStore:yx,useId:Ax,unstable_isNewReconciler:!1},O1={readContext:an,useCallback:Px,useContext:an,useEffect:Yd,useImperativeHandle:Tx,useInsertionEffect:Nx,useLayoutEffect:Cx,useMemo:Rx,useReducer:hu,useRef:Sx,useState:function(){return hu(ol)},useDebugValue:Jd,useDeferredValue:function(e){var t=on();return lt===null?t.memoizedState=e:Lx(t,lt.memoizedState,e)},useTransition:function(){var e=hu(ol)[0],t=on().memoizedState;return[e,t]},useMutableSource:xx,useSyncExternalStore:yx,useId:Ax,unstable_isNewReconciler:!1};function hn(e,t){if(e&&e.defaultProps){t=Ke({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function wc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ke({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var jo={isMounted:function(e){return(e=e._reactInternals)?us(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Pt(),i=xr(e),l=Un(r,i);l.payload=t,n!=null&&(l.callback=n),t=mr(e,l,i),t!==null&&(xn(t,e,i,r),ma(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Pt(),i=xr(e),l=Un(r,i);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=mr(e,l,i),t!==null&&(xn(t,e,i,r),ma(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Pt(),r=xr(e),i=Un(n,r);i.tag=2,t!=null&&(i.callback=t),t=mr(e,i,r),t!==null&&(xn(t,e,r,n),ma(t,e,r))}};function qf(e,t,n,r,i,l,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,l,a):t.prototype&&t.prototype.isPureReactComponent?!tl(n,r)||!tl(i,l):!0}function Mx(e,t,n){var r=!1,i=jr,l=t.contextType;return typeof l=="object"&&l!==null?l=an(l):(i=_t(t)?es:Et.current,r=t.contextTypes,l=(r=r!=null)?Qs(e,i):jr),t=new t(n,l),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=jo,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=l),t}function Gf(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&jo.enqueueReplaceState(t,t.state,null)}function kc(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Hd(e);var l=t.contextType;typeof l=="object"&&l!==null?i.context=an(l):(l=_t(t)?es:Et.current,i.context=Qs(e,l)),i.state=e.memoizedState,l=t.getDerivedStateFromProps,typeof l=="function"&&(wc(e,t,l,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&jo.enqueueReplaceState(i,i.state,null),Ba(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Ys(e,t){try{var n="",r=t;do n+=fw(r),r=r.return;while(r);var i=n}catch(l){i=`
37
+ `+i[a].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=a&&0<=o);break}}}finally{Go=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ri(e):""}function yw(e){switch(e.tag){case 5:return Ri(e.type);case 16:return Ri("Lazy");case 13:return Ri("Suspense");case 19:return Ri("SuspenseList");case 0:case 2:case 15:return e=Ko(e.type,!1),e;case 11:return e=Ko(e.type.render,!1),e;case 1:return e=Ko(e.type,!0),e;default:return""}}function Yu(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 Es:return"Fragment";case Cs:return"Portal";case qu:return"Profiler";case Sd:return"StrictMode";case Gu:return"Suspense";case Ku:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case yg:return(e.displayName||"Context")+".Consumer";case xg:return(e._context.displayName||"Context")+".Provider";case Nd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Cd:return t=e.displayName||null,t!==null?t:Yu(e.type)||"Memo";case sr:t=e._payload,e=e._init;try{return Yu(e(t))}catch{}}return null}function vw(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 Yu(t);case 8:return t===Sd?"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 jr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function jg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function jw(e){var t=jg(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,l.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ol(e){e._valueTracker||(e._valueTracker=jw(e))}function wg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=jg(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ea(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 Ju(e,t){var n=t.checked;return Ke({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ff(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=jr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function kg(e,t){t=t.checked,t!=null&&bd(e,"checked",t,!1)}function Xu(e,t){kg(e,t);var n=jr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Zu(e,t.type,n):t.hasOwnProperty("defaultValue")&&Zu(e,t.type,jr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function pf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="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 Zu(e,t,n){(t!=="number"||Ea(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Li=Array.isArray;function Os(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+jr(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function ec(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(K(91));return Ke({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function mf(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(K(92));if(Li(n)){if(1<n.length)throw Error(K(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:jr(n)}}function bg(e,t){var n=jr(t.value),r=jr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function gf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Sg(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 tc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Sg(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Fl,Ng=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Fl=Fl||document.createElement("div"),Fl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Fl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ki(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var zi={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},ww=["Webkit","ms","Moz","O"];Object.keys(zi).forEach(function(e){ww.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),zi[t]=zi[e]})});function Cg(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||zi.hasOwnProperty(e)&&zi[e]?(""+t).trim():t+"px"}function Eg(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Cg(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var kw=Ke({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 nc(e,t){if(t){if(kw[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function rc(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 sc=null;function Ed(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ic=null,Fs=null,Us=null;function xf(e){if(e=vl(e)){if(typeof ic!="function")throw Error(K(280));var t=e.stateNode;t&&(t=xo(t),ic(e.stateNode,e.type,t))}}function Tg(e){Fs?Us?Us.push(e):Us=[e]:Fs=e}function Pg(){if(Fs){var e=Fs,t=Us;if(Us=Fs=null,xf(e),t)for(e=0;e<t.length;e++)xf(t[e])}}function Rg(e,t){return e(t)}function Lg(){}var Yo=!1;function Ag(e,t,n){if(Yo)return e(t,n);Yo=!0;try{return Rg(e,t,n)}finally{Yo=!1,(Fs!==null||Us!==null)&&(Lg(),Pg())}}function Yi(e,t){var n=e.stateNode;if(n===null)return null;var r=xo(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(K(231,t,typeof n));return n}var lc=!1;if(Hn)try{var mi={};Object.defineProperty(mi,"passive",{get:function(){lc=!0}}),window.addEventListener("test",mi,mi),window.removeEventListener("test",mi,mi)}catch{lc=!1}function bw(e,t,n,r,i,l,a,o,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(h){this.onError(h)}}var Mi=!1,Ta=null,Pa=!1,ac=null,Sw={onError:function(e){Mi=!0,Ta=e}};function Nw(e,t,n,r,i,l,a,o,u){Mi=!1,Ta=null,bw.apply(Sw,arguments)}function Cw(e,t,n,r,i,l,a,o,u){if(Nw.apply(this,arguments),Mi){if(Mi){var c=Ta;Mi=!1,Ta=null}else throw Error(K(198));Pa||(Pa=!0,ac=c)}}function cs(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 Ig(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 yf(e){if(cs(e)!==e)throw Error(K(188))}function Ew(e){var t=e.alternate;if(!t){if(t=cs(e),t===null)throw Error(K(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var l=i.alternate;if(l===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===l.child){for(l=i.child;l;){if(l===n)return yf(i),e;if(l===r)return yf(i),t;l=l.sibling}throw Error(K(188))}if(n.return!==r.return)n=i,r=l;else{for(var a=!1,o=i.child;o;){if(o===n){a=!0,n=i,r=l;break}if(o===r){a=!0,r=i,n=l;break}o=o.sibling}if(!a){for(o=l.child;o;){if(o===n){a=!0,n=l,r=i;break}if(o===r){a=!0,r=l,n=i;break}o=o.sibling}if(!a)throw Error(K(189))}}if(n.alternate!==r)throw Error(K(190))}if(n.tag!==3)throw Error(K(188));return n.stateNode.current===n?e:t}function Dg(e){return e=Ew(e),e!==null?zg(e):null}function zg(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=zg(e);if(t!==null)return t;e=e.sibling}return null}var Mg=Yt.unstable_scheduleCallback,vf=Yt.unstable_cancelCallback,Tw=Yt.unstable_shouldYield,Pw=Yt.unstable_requestPaint,et=Yt.unstable_now,Rw=Yt.unstable_getCurrentPriorityLevel,Td=Yt.unstable_ImmediatePriority,$g=Yt.unstable_UserBlockingPriority,Ra=Yt.unstable_NormalPriority,Lw=Yt.unstable_LowPriority,_g=Yt.unstable_IdlePriority,fo=null,Rn=null;function Aw(e){if(Rn&&typeof Rn.onCommitFiberRoot=="function")try{Rn.onCommitFiberRoot(fo,e,void 0,(e.current.flags&128)===128)}catch{}}var xn=Math.clz32?Math.clz32:zw,Iw=Math.log,Dw=Math.LN2;function zw(e){return e>>>=0,e===0?32:31-(Iw(e)/Dw|0)|0}var Ul=64,Bl=4194304;function Ai(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 La(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,l=e.pingedLanes,a=n&268435455;if(a!==0){var o=a&~i;o!==0?r=Ai(o):(l&=a,l!==0&&(r=Ai(l)))}else a=n&~i,a!==0?r=Ai(a):l!==0&&(r=Ai(l));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,l=t&-t,i>=l||i===16&&(l&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-xn(t),i=1<<n,r|=e[n],t&=~i;return r}function Mw(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 $w(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,l=e.pendingLanes;0<l;){var a=31-xn(l),o=1<<a,u=i[a];u===-1?(!(o&n)||o&r)&&(i[a]=Mw(o,t)):u<=t&&(e.expiredLanes|=o),l&=~o}}function oc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Og(){var e=Ul;return Ul<<=1,!(Ul&4194240)&&(Ul=64),e}function Jo(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function xl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-xn(t),e[t]=n}function _w(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 r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-xn(n),l=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~l}}function Pd(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-xn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var ze=0;function Fg(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Ug,Rd,Bg,Hg,Wg,uc=!1,Hl=[],hr=null,fr=null,pr=null,Ji=new Map,Xi=new Map,lr=[],Ow="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 jf(e,t){switch(e){case"focusin":case"focusout":hr=null;break;case"dragenter":case"dragleave":fr=null;break;case"mouseover":case"mouseout":pr=null;break;case"pointerover":case"pointerout":Ji.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xi.delete(t.pointerId)}}function gi(e,t,n,r,i,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:l,targetContainers:[i]},t!==null&&(t=vl(t),t!==null&&Rd(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Fw(e,t,n,r,i){switch(t){case"focusin":return hr=gi(hr,e,t,n,r,i),!0;case"dragenter":return fr=gi(fr,e,t,n,r,i),!0;case"mouseover":return pr=gi(pr,e,t,n,r,i),!0;case"pointerover":var l=i.pointerId;return Ji.set(l,gi(Ji.get(l)||null,e,t,n,r,i)),!0;case"gotpointercapture":return l=i.pointerId,Xi.set(l,gi(Xi.get(l)||null,e,t,n,r,i)),!0}return!1}function Vg(e){var t=qr(e.target);if(t!==null){var n=cs(t);if(n!==null){if(t=n.tag,t===13){if(t=Ig(n),t!==null){e.blockedOn=t,Wg(e.priority,function(){Bg(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 ha(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=cc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);sc=r,n.target.dispatchEvent(r),sc=null}else return t=vl(n),t!==null&&Rd(t),e.blockedOn=n,!1;t.shift()}return!0}function wf(e,t,n){ha(e)&&n.delete(t)}function Uw(){uc=!1,hr!==null&&ha(hr)&&(hr=null),fr!==null&&ha(fr)&&(fr=null),pr!==null&&ha(pr)&&(pr=null),Ji.forEach(wf),Xi.forEach(wf)}function xi(e,t){e.blockedOn===t&&(e.blockedOn=null,uc||(uc=!0,Yt.unstable_scheduleCallback(Yt.unstable_NormalPriority,Uw)))}function Zi(e){function t(i){return xi(i,e)}if(0<Hl.length){xi(Hl[0],e);for(var n=1;n<Hl.length;n++){var r=Hl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(hr!==null&&xi(hr,e),fr!==null&&xi(fr,e),pr!==null&&xi(pr,e),Ji.forEach(t),Xi.forEach(t),n=0;n<lr.length;n++)r=lr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<lr.length&&(n=lr[0],n.blockedOn===null);)Vg(n),n.blockedOn===null&&lr.shift()}var Bs=Gn.ReactCurrentBatchConfig,Aa=!0;function Bw(e,t,n,r){var i=ze,l=Bs.transition;Bs.transition=null;try{ze=1,Ld(e,t,n,r)}finally{ze=i,Bs.transition=l}}function Hw(e,t,n,r){var i=ze,l=Bs.transition;Bs.transition=null;try{ze=4,Ld(e,t,n,r)}finally{ze=i,Bs.transition=l}}function Ld(e,t,n,r){if(Aa){var i=cc(e,t,n,r);if(i===null)au(e,t,r,Ia,n),jf(e,r);else if(Fw(i,e,t,n,r))r.stopPropagation();else if(jf(e,r),t&4&&-1<Ow.indexOf(e)){for(;i!==null;){var l=vl(i);if(l!==null&&Ug(l),l=cc(e,t,n,r),l===null&&au(e,t,r,Ia,n),l===i)break;i=l}i!==null&&r.stopPropagation()}else au(e,t,r,null,n)}}var Ia=null;function cc(e,t,n,r){if(Ia=null,e=Ed(r),e=qr(e),e!==null)if(t=cs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Ig(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 Ia=e,null}function Qg(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(Rw()){case Td:return 1;case $g:return 4;case Ra:case Lw:return 16;case _g:return 536870912;default:return 16}default:return 16}}var or=null,Ad=null,fa=null;function qg(){if(fa)return fa;var e,t=Ad,n=t.length,r,i="value"in or?or.value:or.textContent,l=i.length;for(e=0;e<n&&t[e]===i[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===i[l-r];r++);return fa=i.slice(e,1<r?1-r:void 0)}function pa(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 Wl(){return!0}function kf(){return!1}function Xt(e){function t(n,r,i,l,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=l,this.target=a,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(l):l[o]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?Wl:kf,this.isPropagationStopped=kf,this}return Ke(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Wl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Wl)},persist:function(){},isPersistent:Wl}),t}var ii={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Id=Xt(ii),yl=Ke({},ii,{view:0,detail:0}),Ww=Xt(yl),Xo,Zo,yi,po=Ke({},yl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dd,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!==yi&&(yi&&e.type==="mousemove"?(Xo=e.screenX-yi.screenX,Zo=e.screenY-yi.screenY):Zo=Xo=0,yi=e),Xo)},movementY:function(e){return"movementY"in e?e.movementY:Zo}}),bf=Xt(po),Vw=Ke({},po,{dataTransfer:0}),Qw=Xt(Vw),qw=Ke({},yl,{relatedTarget:0}),eu=Xt(qw),Gw=Ke({},ii,{animationName:0,elapsedTime:0,pseudoElement:0}),Kw=Xt(Gw),Yw=Ke({},ii,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Jw=Xt(Yw),Xw=Ke({},ii,{data:0}),Sf=Xt(Xw),Zw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},e1={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"},t1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function n1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=t1[e])?!!t[e]:!1}function Dd(){return n1}var r1=Ke({},yl,{key:function(e){if(e.key){var t=Zw[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=pa(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?e1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dd,charCode:function(e){return e.type==="keypress"?pa(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?pa(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),s1=Xt(r1),i1=Ke({},po,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nf=Xt(i1),l1=Ke({},yl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dd}),a1=Xt(l1),o1=Ke({},ii,{propertyName:0,elapsedTime:0,pseudoElement:0}),u1=Xt(o1),c1=Ke({},po,{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}),d1=Xt(c1),h1=[9,13,27,32],zd=Hn&&"CompositionEvent"in window,$i=null;Hn&&"documentMode"in document&&($i=document.documentMode);var f1=Hn&&"TextEvent"in window&&!$i,Gg=Hn&&(!zd||$i&&8<$i&&11>=$i),Cf=" ",Ef=!1;function Kg(e,t){switch(e){case"keyup":return h1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ts=!1;function p1(e,t){switch(e){case"compositionend":return Yg(t);case"keypress":return t.which!==32?null:(Ef=!0,Cf);case"textInput":return e=t.data,e===Cf&&Ef?null:e;default:return null}}function m1(e,t){if(Ts)return e==="compositionend"||!zd&&Kg(e,t)?(e=qg(),fa=Ad=or=null,Ts=!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 Gg&&t.locale!=="ko"?null:t.data;default:return null}}var g1={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 Tf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!g1[e.type]:t==="textarea"}function Jg(e,t,n,r){Tg(r),t=Da(t,"onChange"),0<t.length&&(n=new Id("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var _i=null,el=null;function x1(e){ox(e,0)}function mo(e){var t=Ls(e);if(wg(t))return e}function y1(e,t){if(e==="change")return t}var Xg=!1;if(Hn){var tu;if(Hn){var nu="oninput"in document;if(!nu){var Pf=document.createElement("div");Pf.setAttribute("oninput","return;"),nu=typeof Pf.oninput=="function"}tu=nu}else tu=!1;Xg=tu&&(!document.documentMode||9<document.documentMode)}function Rf(){_i&&(_i.detachEvent("onpropertychange",Zg),el=_i=null)}function Zg(e){if(e.propertyName==="value"&&mo(el)){var t=[];Jg(t,el,e,Ed(e)),Ag(x1,t)}}function v1(e,t,n){e==="focusin"?(Rf(),_i=t,el=n,_i.attachEvent("onpropertychange",Zg)):e==="focusout"&&Rf()}function j1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return mo(el)}function w1(e,t){if(e==="click")return mo(t)}function k1(e,t){if(e==="input"||e==="change")return mo(t)}function b1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wn=typeof Object.is=="function"?Object.is:b1;function tl(e,t){if(wn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Qu.call(t,i)||!wn(e[i],t[i]))return!1}return!0}function Lf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Af(e,t){var n=Lf(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Lf(n)}}function ex(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ex(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function tx(){for(var e=window,t=Ea();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ea(e.document)}return t}function Md(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 S1(e){var t=tx(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ex(n.ownerDocument.documentElement,n)){if(r!==null&&Md(n)){if(t=r.start,e=r.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 i=n.textContent.length,l=Math.min(r.start,i);r=r.end===void 0?l:Math.min(r.end,i),!e.extend&&l>r&&(i=r,r=l,l=i),i=Af(n,l);var a=Af(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),l>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.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 N1=Hn&&"documentMode"in document&&11>=document.documentMode,Ps=null,dc=null,Oi=null,hc=!1;function If(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;hc||Ps==null||Ps!==Ea(r)||(r=Ps,"selectionStart"in r&&Md(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Oi&&tl(Oi,r)||(Oi=r,r=Da(dc,"onSelect"),0<r.length&&(t=new Id("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ps)))}function Vl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Rs={animationend:Vl("Animation","AnimationEnd"),animationiteration:Vl("Animation","AnimationIteration"),animationstart:Vl("Animation","AnimationStart"),transitionend:Vl("Transition","TransitionEnd")},ru={},nx={};Hn&&(nx=document.createElement("div").style,"AnimationEvent"in window||(delete Rs.animationend.animation,delete Rs.animationiteration.animation,delete Rs.animationstart.animation),"TransitionEvent"in window||delete Rs.transitionend.transition);function go(e){if(ru[e])return ru[e];if(!Rs[e])return e;var t=Rs[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in nx)return ru[e]=t[n];return e}var rx=go("animationend"),sx=go("animationiteration"),ix=go("animationstart"),lx=go("transitionend"),ax=new Map,Df="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 Cr(e,t){ax.set(e,t),us(t,[e])}for(var su=0;su<Df.length;su++){var iu=Df[su],C1=iu.toLowerCase(),E1=iu[0].toUpperCase()+iu.slice(1);Cr(C1,"on"+E1)}Cr(rx,"onAnimationEnd");Cr(sx,"onAnimationIteration");Cr(ix,"onAnimationStart");Cr("dblclick","onDoubleClick");Cr("focusin","onFocus");Cr("focusout","onBlur");Cr(lx,"onTransitionEnd");Qs("onMouseEnter",["mouseout","mouseover"]);Qs("onMouseLeave",["mouseout","mouseover"]);Qs("onPointerEnter",["pointerout","pointerover"]);Qs("onPointerLeave",["pointerout","pointerover"]);us("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));us("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));us("onBeforeInput",["compositionend","keypress","textInput","paste"]);us("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));us("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));us("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ii="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(" "),T1=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ii));function zf(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Cw(r,t,void 0,e),e.currentTarget=null}function ox(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var l=void 0;if(t)for(var a=r.length-1;0<=a;a--){var o=r[a],u=o.instance,c=o.currentTarget;if(o=o.listener,u!==l&&i.isPropagationStopped())break e;zf(i,o,c),l=u}else for(a=0;a<r.length;a++){if(o=r[a],u=o.instance,c=o.currentTarget,o=o.listener,u!==l&&i.isPropagationStopped())break e;zf(i,o,c),l=u}}}if(Pa)throw e=ac,Pa=!1,ac=null,e}function He(e,t){var n=t[xc];n===void 0&&(n=t[xc]=new Set);var r=e+"__bubble";n.has(r)||(ux(t,e,2,!1),n.add(r))}function lu(e,t,n){var r=0;t&&(r|=4),ux(n,e,r,t)}var Ql="_reactListening"+Math.random().toString(36).slice(2);function nl(e){if(!e[Ql]){e[Ql]=!0,gg.forEach(function(n){n!=="selectionchange"&&(T1.has(n)||lu(n,!1,e),lu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ql]||(t[Ql]=!0,lu("selectionchange",!1,t))}}function ux(e,t,n,r){switch(Qg(t)){case 1:var i=Bw;break;case 4:i=Hw;break;default:i=Ld}n=i.bind(null,t,n,e),i=void 0,!lc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function au(e,t,n,r,i){var l=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var o=r.stateNode.containerInfo;if(o===i||o.nodeType===8&&o.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var u=a.tag;if((u===3||u===4)&&(u=a.stateNode.containerInfo,u===i||u.nodeType===8&&u.parentNode===i))return;a=a.return}for(;o!==null;){if(a=qr(o),a===null)return;if(u=a.tag,u===5||u===6){r=l=a;continue e}o=o.parentNode}}r=r.return}Ag(function(){var c=l,h=Ed(n),d=[];e:{var f=ax.get(e);if(f!==void 0){var m=Id,p=e;switch(e){case"keypress":if(pa(n)===0)break e;case"keydown":case"keyup":m=s1;break;case"focusin":p="focus",m=eu;break;case"focusout":p="blur",m=eu;break;case"beforeblur":case"afterblur":m=eu;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":m=bf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=Qw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=a1;break;case rx:case sx:case ix:m=Kw;break;case lx:m=u1;break;case"scroll":m=Ww;break;case"wheel":m=d1;break;case"copy":case"cut":case"paste":m=Jw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Nf}var g=(t&4)!==0,w=!g&&e==="scroll",y=g?f!==null?f+"Capture":null:f;g=[];for(var x=c,v;x!==null;){v=x;var b=v.stateNode;if(v.tag===5&&b!==null&&(v=b,y!==null&&(b=Yi(x,y),b!=null&&g.push(rl(x,b,v)))),w)break;x=x.return}0<g.length&&(f=new m(f,p,null,n,h),d.push({event:f,listeners:g}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",f&&n!==sc&&(p=n.relatedTarget||n.fromElement)&&(qr(p)||p[Wn]))break e;if((m||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,m?(p=n.relatedTarget||n.toElement,m=c,p=p?qr(p):null,p!==null&&(w=cs(p),p!==w||p.tag!==5&&p.tag!==6)&&(p=null)):(m=null,p=c),m!==p)){if(g=bf,b="onMouseLeave",y="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(g=Nf,b="onPointerLeave",y="onPointerEnter",x="pointer"),w=m==null?f:Ls(m),v=p==null?f:Ls(p),f=new g(b,x+"leave",m,n,h),f.target=w,f.relatedTarget=v,b=null,qr(h)===c&&(g=new g(y,x+"enter",p,n,h),g.target=v,g.relatedTarget=w,b=g),w=b,m&&p)t:{for(g=m,y=p,x=0,v=g;v;v=js(v))x++;for(v=0,b=y;b;b=js(b))v++;for(;0<x-v;)g=js(g),x--;for(;0<v-x;)y=js(y),v--;for(;x--;){if(g===y||y!==null&&g===y.alternate)break t;g=js(g),y=js(y)}g=null}else g=null;m!==null&&Mf(d,f,m,g,!1),p!==null&&w!==null&&Mf(d,w,p,g,!0)}}e:{if(f=c?Ls(c):window,m=f.nodeName&&f.nodeName.toLowerCase(),m==="select"||m==="input"&&f.type==="file")var A=y1;else if(Tf(f))if(Xg)A=k1;else{A=j1;var k=v1}else(m=f.nodeName)&&m.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(A=w1);if(A&&(A=A(e,c))){Jg(d,A,n,h);break e}k&&k(e,f,c),e==="focusout"&&(k=f._wrapperState)&&k.controlled&&f.type==="number"&&Zu(f,"number",f.value)}switch(k=c?Ls(c):window,e){case"focusin":(Tf(k)||k.contentEditable==="true")&&(Ps=k,dc=c,Oi=null);break;case"focusout":Oi=dc=Ps=null;break;case"mousedown":hc=!0;break;case"contextmenu":case"mouseup":case"dragend":hc=!1,If(d,n,h);break;case"selectionchange":if(N1)break;case"keydown":case"keyup":If(d,n,h)}var E;if(zd)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else Ts?Kg(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(Gg&&n.locale!=="ko"&&(Ts||T!=="onCompositionStart"?T==="onCompositionEnd"&&Ts&&(E=qg()):(or=h,Ad="value"in or?or.value:or.textContent,Ts=!0)),k=Da(c,T),0<k.length&&(T=new Sf(T,e,null,n,h),d.push({event:T,listeners:k}),E?T.data=E:(E=Yg(n),E!==null&&(T.data=E)))),(E=f1?p1(e,n):m1(e,n))&&(c=Da(c,"onBeforeInput"),0<c.length&&(h=new Sf("onBeforeInput","beforeinput",null,n,h),d.push({event:h,listeners:c}),h.data=E))}ox(d,t)})}function rl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Da(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,l=i.stateNode;i.tag===5&&l!==null&&(i=l,l=Yi(e,n),l!=null&&r.unshift(rl(e,l,i)),l=Yi(e,t),l!=null&&r.push(rl(e,l,i))),e=e.return}return r}function js(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Mf(e,t,n,r,i){for(var l=t._reactName,a=[];n!==null&&n!==r;){var o=n,u=o.alternate,c=o.stateNode;if(u!==null&&u===r)break;o.tag===5&&c!==null&&(o=c,i?(u=Yi(n,l),u!=null&&a.unshift(rl(n,u,o))):i||(u=Yi(n,l),u!=null&&a.push(rl(n,u,o)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var P1=/\r\n?/g,R1=/\u0000|\uFFFD/g;function $f(e){return(typeof e=="string"?e:""+e).replace(P1,`
38
+ `).replace(R1,"")}function ql(e,t,n){if(t=$f(t),$f(e)!==t&&n)throw Error(K(425))}function za(){}var fc=null,pc=null;function mc(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 gc=typeof setTimeout=="function"?setTimeout:void 0,L1=typeof clearTimeout=="function"?clearTimeout:void 0,_f=typeof Promise=="function"?Promise:void 0,A1=typeof queueMicrotask=="function"?queueMicrotask:typeof _f<"u"?function(e){return _f.resolve(null).then(e).catch(I1)}:gc;function I1(e){setTimeout(function(){throw e})}function ou(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),Zi(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Zi(t)}function mr(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 Of(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 li=Math.random().toString(36).slice(2),Tn="__reactFiber$"+li,sl="__reactProps$"+li,Wn="__reactContainer$"+li,xc="__reactEvents$"+li,D1="__reactListeners$"+li,z1="__reactHandles$"+li;function qr(e){var t=e[Tn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Wn]||n[Tn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Of(e);e!==null;){if(n=e[Tn])return n;e=Of(e)}return t}e=n,n=e.parentNode}return null}function vl(e){return e=e[Tn]||e[Wn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ls(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(K(33))}function xo(e){return e[sl]||null}var yc=[],As=-1;function Er(e){return{current:e}}function We(e){0>As||(e.current=yc[As],yc[As]=null,As--)}function Be(e,t){As++,yc[As]=e.current,e.current=t}var wr={},Et=Er(wr),$t=Er(!1),ts=wr;function qs(e,t){var n=e.type.contextTypes;if(!n)return wr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},l;for(l in n)i[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function _t(e){return e=e.childContextTypes,e!=null}function Ma(){We($t),We(Et)}function Ff(e,t,n){if(Et.current!==wr)throw Error(K(168));Be(Et,t),Be($t,n)}function cx(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(K(108,vw(e)||"Unknown",i));return Ke({},n,r)}function $a(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||wr,ts=Et.current,Be(Et,e),Be($t,$t.current),!0}function Uf(e,t,n){var r=e.stateNode;if(!r)throw Error(K(169));n?(e=cx(e,t,ts),r.__reactInternalMemoizedMergedChildContext=e,We($t),We(Et),Be(Et,e)):We($t),Be($t,n)}var _n=null,yo=!1,uu=!1;function dx(e){_n===null?_n=[e]:_n.push(e)}function M1(e){yo=!0,dx(e)}function Tr(){if(!uu&&_n!==null){uu=!0;var e=0,t=ze;try{var n=_n;for(ze=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}_n=null,yo=!1}catch(i){throw _n!==null&&(_n=_n.slice(e+1)),Mg(Td,Tr),i}finally{ze=t,uu=!1}}return null}var Is=[],Ds=0,_a=null,Oa=0,en=[],tn=0,ns=null,On=1,Fn="";function Br(e,t){Is[Ds++]=Oa,Is[Ds++]=_a,_a=e,Oa=t}function hx(e,t,n){en[tn++]=On,en[tn++]=Fn,en[tn++]=ns,ns=e;var r=On;e=Fn;var i=32-xn(r)-1;r&=~(1<<i),n+=1;var l=32-xn(t)+i;if(30<l){var a=i-i%5;l=(r&(1<<a)-1).toString(32),r>>=a,i-=a,On=1<<32-xn(t)+i|n<<i|r,Fn=l+e}else On=1<<l|n<<i|r,Fn=e}function $d(e){e.return!==null&&(Br(e,1),hx(e,1,0))}function _d(e){for(;e===_a;)_a=Is[--Ds],Is[Ds]=null,Oa=Is[--Ds],Is[Ds]=null;for(;e===ns;)ns=en[--tn],en[tn]=null,Fn=en[--tn],en[tn]=null,On=en[--tn],en[tn]=null}var Gt=null,Qt=null,Qe=!1,gn=null;function fx(e,t){var n=rn(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 Bf(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,Gt=e,Qt=mr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Gt=e,Qt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ns!==null?{id:On,overflow:Fn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=rn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Gt=e,Qt=null,!0):!1;default:return!1}}function vc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function jc(e){if(Qe){var t=Qt;if(t){var n=t;if(!Bf(e,t)){if(vc(e))throw Error(K(418));t=mr(n.nextSibling);var r=Gt;t&&Bf(e,t)?fx(r,n):(e.flags=e.flags&-4097|2,Qe=!1,Gt=e)}}else{if(vc(e))throw Error(K(418));e.flags=e.flags&-4097|2,Qe=!1,Gt=e}}}function Hf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Gt=e}function Gl(e){if(e!==Gt)return!1;if(!Qe)return Hf(e),Qe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!mc(e.type,e.memoizedProps)),t&&(t=Qt)){if(vc(e))throw px(),Error(K(418));for(;t;)fx(e,t),t=mr(t.nextSibling)}if(Hf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(K(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Qt=mr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Qt=null}}else Qt=Gt?mr(e.stateNode.nextSibling):null;return!0}function px(){for(var e=Qt;e;)e=mr(e.nextSibling)}function Gs(){Qt=Gt=null,Qe=!1}function Od(e){gn===null?gn=[e]:gn.push(e)}var $1=Gn.ReactCurrentBatchConfig;function vi(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(K(309));var r=n.stateNode}if(!r)throw Error(K(147,e));var i=r,l=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===l?t.ref:(t=function(a){var o=i.refs;a===null?delete o[l]:o[l]=a},t._stringRef=l,t)}if(typeof e!="string")throw Error(K(284));if(!n._owner)throw Error(K(290,e))}return e}function Kl(e,t){throw e=Object.prototype.toString.call(t),Error(K(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Wf(e){var t=e._init;return t(e._payload)}function mx(e){function t(y,x){if(e){var v=y.deletions;v===null?(y.deletions=[x],y.flags|=16):v.push(x)}}function n(y,x){if(!e)return null;for(;x!==null;)t(y,x),x=x.sibling;return null}function r(y,x){for(y=new Map;x!==null;)x.key!==null?y.set(x.key,x):y.set(x.index,x),x=x.sibling;return y}function i(y,x){return y=vr(y,x),y.index=0,y.sibling=null,y}function l(y,x,v){return y.index=v,e?(v=y.alternate,v!==null?(v=v.index,v<x?(y.flags|=2,x):v):(y.flags|=2,x)):(y.flags|=1048576,x)}function a(y){return e&&y.alternate===null&&(y.flags|=2),y}function o(y,x,v,b){return x===null||x.tag!==6?(x=gu(v,y.mode,b),x.return=y,x):(x=i(x,v),x.return=y,x)}function u(y,x,v,b){var A=v.type;return A===Es?h(y,x,v.props.children,b,v.key):x!==null&&(x.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===sr&&Wf(A)===x.type)?(b=i(x,v.props),b.ref=vi(y,x,v),b.return=y,b):(b=wa(v.type,v.key,v.props,null,y.mode,b),b.ref=vi(y,x,v),b.return=y,b)}function c(y,x,v,b){return x===null||x.tag!==4||x.stateNode.containerInfo!==v.containerInfo||x.stateNode.implementation!==v.implementation?(x=xu(v,y.mode,b),x.return=y,x):(x=i(x,v.children||[]),x.return=y,x)}function h(y,x,v,b,A){return x===null||x.tag!==7?(x=Zr(v,y.mode,b,A),x.return=y,x):(x=i(x,v),x.return=y,x)}function d(y,x,v){if(typeof x=="string"&&x!==""||typeof x=="number")return x=gu(""+x,y.mode,v),x.return=y,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case _l:return v=wa(x.type,x.key,x.props,null,y.mode,v),v.ref=vi(y,null,x),v.return=y,v;case Cs:return x=xu(x,y.mode,v),x.return=y,x;case sr:var b=x._init;return d(y,b(x._payload),v)}if(Li(x)||pi(x))return x=Zr(x,y.mode,v,null),x.return=y,x;Kl(y,x)}return null}function f(y,x,v,b){var A=x!==null?x.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return A!==null?null:o(y,x,""+v,b);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case _l:return v.key===A?u(y,x,v,b):null;case Cs:return v.key===A?c(y,x,v,b):null;case sr:return A=v._init,f(y,x,A(v._payload),b)}if(Li(v)||pi(v))return A!==null?null:h(y,x,v,b,null);Kl(y,v)}return null}function m(y,x,v,b,A){if(typeof b=="string"&&b!==""||typeof b=="number")return y=y.get(v)||null,o(x,y,""+b,A);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case _l:return y=y.get(b.key===null?v:b.key)||null,u(x,y,b,A);case Cs:return y=y.get(b.key===null?v:b.key)||null,c(x,y,b,A);case sr:var k=b._init;return m(y,x,v,k(b._payload),A)}if(Li(b)||pi(b))return y=y.get(v)||null,h(x,y,b,A,null);Kl(x,b)}return null}function p(y,x,v,b){for(var A=null,k=null,E=x,T=x=0,I=null;E!==null&&T<v.length;T++){E.index>T?(I=E,E=null):I=E.sibling;var C=f(y,E,v[T],b);if(C===null){E===null&&(E=I);break}e&&E&&C.alternate===null&&t(y,E),x=l(C,x,T),k===null?A=C:k.sibling=C,k=C,E=I}if(T===v.length)return n(y,E),Qe&&Br(y,T),A;if(E===null){for(;T<v.length;T++)E=d(y,v[T],b),E!==null&&(x=l(E,x,T),k===null?A=E:k.sibling=E,k=E);return Qe&&Br(y,T),A}for(E=r(y,E);T<v.length;T++)I=m(E,y,T,v[T],b),I!==null&&(e&&I.alternate!==null&&E.delete(I.key===null?T:I.key),x=l(I,x,T),k===null?A=I:k.sibling=I,k=I);return e&&E.forEach(function(R){return t(y,R)}),Qe&&Br(y,T),A}function g(y,x,v,b){var A=pi(v);if(typeof A!="function")throw Error(K(150));if(v=A.call(v),v==null)throw Error(K(151));for(var k=A=null,E=x,T=x=0,I=null,C=v.next();E!==null&&!C.done;T++,C=v.next()){E.index>T?(I=E,E=null):I=E.sibling;var R=f(y,E,C.value,b);if(R===null){E===null&&(E=I);break}e&&E&&R.alternate===null&&t(y,E),x=l(R,x,T),k===null?A=R:k.sibling=R,k=R,E=I}if(C.done)return n(y,E),Qe&&Br(y,T),A;if(E===null){for(;!C.done;T++,C=v.next())C=d(y,C.value,b),C!==null&&(x=l(C,x,T),k===null?A=C:k.sibling=C,k=C);return Qe&&Br(y,T),A}for(E=r(y,E);!C.done;T++,C=v.next())C=m(E,y,T,C.value,b),C!==null&&(e&&C.alternate!==null&&E.delete(C.key===null?T:C.key),x=l(C,x,T),k===null?A=C:k.sibling=C,k=C);return e&&E.forEach(function(L){return t(y,L)}),Qe&&Br(y,T),A}function w(y,x,v,b){if(typeof v=="object"&&v!==null&&v.type===Es&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case _l:e:{for(var A=v.key,k=x;k!==null;){if(k.key===A){if(A=v.type,A===Es){if(k.tag===7){n(y,k.sibling),x=i(k,v.props.children),x.return=y,y=x;break e}}else if(k.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===sr&&Wf(A)===k.type){n(y,k.sibling),x=i(k,v.props),x.ref=vi(y,k,v),x.return=y,y=x;break e}n(y,k);break}else t(y,k);k=k.sibling}v.type===Es?(x=Zr(v.props.children,y.mode,b,v.key),x.return=y,y=x):(b=wa(v.type,v.key,v.props,null,y.mode,b),b.ref=vi(y,x,v),b.return=y,y=b)}return a(y);case Cs:e:{for(k=v.key;x!==null;){if(x.key===k)if(x.tag===4&&x.stateNode.containerInfo===v.containerInfo&&x.stateNode.implementation===v.implementation){n(y,x.sibling),x=i(x,v.children||[]),x.return=y,y=x;break e}else{n(y,x);break}else t(y,x);x=x.sibling}x=xu(v,y.mode,b),x.return=y,y=x}return a(y);case sr:return k=v._init,w(y,x,k(v._payload),b)}if(Li(v))return p(y,x,v,b);if(pi(v))return g(y,x,v,b);Kl(y,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,x!==null&&x.tag===6?(n(y,x.sibling),x=i(x,v),x.return=y,y=x):(n(y,x),x=gu(v,y.mode,b),x.return=y,y=x),a(y)):n(y,x)}return w}var Ks=mx(!0),gx=mx(!1),Fa=Er(null),Ua=null,zs=null,Fd=null;function Ud(){Fd=zs=Ua=null}function Bd(e){var t=Fa.current;We(Fa),e._currentValue=t}function wc(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Hs(e,t){Ua=e,Fd=zs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Mt=!0),e.firstContext=null)}function an(e){var t=e._currentValue;if(Fd!==e)if(e={context:e,memoizedValue:t,next:null},zs===null){if(Ua===null)throw Error(K(308));zs=e,Ua.dependencies={lanes:0,firstContext:e}}else zs=zs.next=e;return t}var Gr=null;function Hd(e){Gr===null?Gr=[e]:Gr.push(e)}function xx(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Hd(t)):(n.next=i.next,i.next=n),t.interleaved=n,Vn(e,r)}function Vn(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 ir=!1;function Wd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function yx(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 Un(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function gr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Re&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Vn(e,n)}return i=r.interleaved,i===null?(t.next=t,Hd(r)):(t.next=i.next,i.next=t),r.interleaved=t,Vn(e,n)}function ma(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Pd(e,n)}}function Vf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};l===null?i=l=a:l=l.next=a,n=n.next}while(n!==null);l===null?i=l=t:l=l.next=t}else i=l=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:l,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ba(e,t,n,r){var i=e.updateQueue;ir=!1;var l=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var u=o,c=u.next;u.next=null,a===null?l=c:a.next=c,a=u;var h=e.alternate;h!==null&&(h=h.updateQueue,o=h.lastBaseUpdate,o!==a&&(o===null?h.firstBaseUpdate=c:o.next=c,h.lastBaseUpdate=u))}if(l!==null){var d=i.baseState;a=0,h=c=u=null,o=l;do{var f=o.lane,m=o.eventTime;if((r&f)===f){h!==null&&(h=h.next={eventTime:m,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var p=e,g=o;switch(f=t,m=n,g.tag){case 1:if(p=g.payload,typeof p=="function"){d=p.call(m,d,f);break e}d=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=g.payload,f=typeof p=="function"?p.call(m,d,f):p,f==null)break e;d=Ke({},d,f);break e;case 2:ir=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[o]:f.push(o))}else m={eventTime:m,lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},h===null?(c=h=m,u=d):h=h.next=m,a|=f;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;f=o,o=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(h===null&&(u=d),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=h,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else l===null&&(i.shared.lanes=0);ss|=a,e.lanes=a,e.memoizedState=d}}function Qf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(K(191,i));i.call(r)}}}var jl={},Ln=Er(jl),il=Er(jl),ll=Er(jl);function Kr(e){if(e===jl)throw Error(K(174));return e}function Vd(e,t){switch(Be(ll,t),Be(il,e),Be(Ln,jl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:tc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=tc(t,e)}We(Ln),Be(Ln,t)}function Ys(){We(Ln),We(il),We(ll)}function vx(e){Kr(ll.current);var t=Kr(Ln.current),n=tc(t,e.type);t!==n&&(Be(il,e),Be(Ln,n))}function Qd(e){il.current===e&&(We(Ln),We(il))}var qe=Er(0);function Ha(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 cu=[];function qd(){for(var e=0;e<cu.length;e++)cu[e]._workInProgressVersionPrimary=null;cu.length=0}var ga=Gn.ReactCurrentDispatcher,du=Gn.ReactCurrentBatchConfig,rs=0,Ge=null,lt=null,dt=null,Wa=!1,Fi=!1,al=0,_1=0;function St(){throw Error(K(321))}function Gd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!wn(e[n],t[n]))return!1;return!0}function Kd(e,t,n,r,i,l){if(rs=l,Ge=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ga.current=e===null||e.memoizedState===null?B1:H1,e=n(r,i),Fi){l=0;do{if(Fi=!1,al=0,25<=l)throw Error(K(301));l+=1,dt=lt=null,t.updateQueue=null,ga.current=W1,e=n(r,i)}while(Fi)}if(ga.current=Va,t=lt!==null&&lt.next!==null,rs=0,dt=lt=Ge=null,Wa=!1,t)throw Error(K(300));return e}function Yd(){var e=al!==0;return al=0,e}function Cn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dt===null?Ge.memoizedState=dt=e:dt=dt.next=e,dt}function on(){if(lt===null){var e=Ge.alternate;e=e!==null?e.memoizedState:null}else e=lt.next;var t=dt===null?Ge.memoizedState:dt.next;if(t!==null)dt=t,lt=e;else{if(e===null)throw Error(K(310));lt=e,e={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},dt===null?Ge.memoizedState=dt=e:dt=dt.next=e}return dt}function ol(e,t){return typeof t=="function"?t(e):t}function hu(e){var t=on(),n=t.queue;if(n===null)throw Error(K(311));n.lastRenderedReducer=e;var r=lt,i=r.baseQueue,l=n.pending;if(l!==null){if(i!==null){var a=i.next;i.next=l.next,l.next=a}r.baseQueue=i=l,n.pending=null}if(i!==null){l=i.next,r=r.baseState;var o=a=null,u=null,c=l;do{var h=c.lane;if((rs&h)===h)u!==null&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var d={lane:h,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(o=u=d,a=r):u=u.next=d,Ge.lanes|=h,ss|=h}c=c.next}while(c!==null&&c!==l);u===null?a=r:u.next=o,wn(r,t.memoizedState)||(Mt=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do l=i.lane,Ge.lanes|=l,ss|=l,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function fu(e){var t=on(),n=t.queue;if(n===null)throw Error(K(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,l=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do l=e(l,a.action),a=a.next;while(a!==i);wn(l,t.memoizedState)||(Mt=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,r]}function jx(){}function wx(e,t){var n=Ge,r=on(),i=t(),l=!wn(r.memoizedState,i);if(l&&(r.memoizedState=i,Mt=!0),r=r.queue,Jd(Sx.bind(null,n,r,e),[e]),r.getSnapshot!==t||l||dt!==null&&dt.memoizedState.tag&1){if(n.flags|=2048,ul(9,bx.bind(null,n,r,i,t),void 0,null),ht===null)throw Error(K(349));rs&30||kx(n,t,i)}return i}function kx(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ge.updateQueue,t===null?(t={lastEffect:null,stores:null},Ge.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function bx(e,t,n,r){t.value=n,t.getSnapshot=r,Nx(t)&&Cx(e)}function Sx(e,t,n){return n(function(){Nx(t)&&Cx(e)})}function Nx(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!wn(e,n)}catch{return!0}}function Cx(e){var t=Vn(e,1);t!==null&&yn(t,e,1,-1)}function qf(e){var t=Cn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ol,lastRenderedState:e},t.queue=e,e=e.dispatch=U1.bind(null,Ge,e),[t.memoizedState,e]}function ul(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ge.updateQueue,t===null?(t={lastEffect:null,stores:null},Ge.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Ex(){return on().memoizedState}function xa(e,t,n,r){var i=Cn();Ge.flags|=e,i.memoizedState=ul(1|t,n,void 0,r===void 0?null:r)}function vo(e,t,n,r){var i=on();r=r===void 0?null:r;var l=void 0;if(lt!==null){var a=lt.memoizedState;if(l=a.destroy,r!==null&&Gd(r,a.deps)){i.memoizedState=ul(t,n,l,r);return}}Ge.flags|=e,i.memoizedState=ul(1|t,n,l,r)}function Gf(e,t){return xa(8390656,8,e,t)}function Jd(e,t){return vo(2048,8,e,t)}function Tx(e,t){return vo(4,2,e,t)}function Px(e,t){return vo(4,4,e,t)}function Rx(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 Lx(e,t,n){return n=n!=null?n.concat([e]):null,vo(4,4,Rx.bind(null,t,e),n)}function Xd(){}function Ax(e,t){var n=on();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Gd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ix(e,t){var n=on();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Gd(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Dx(e,t,n){return rs&21?(wn(n,t)||(n=Og(),Ge.lanes|=n,ss|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Mt=!0),e.memoizedState=n)}function O1(e,t){var n=ze;ze=n!==0&&4>n?n:4,e(!0);var r=du.transition;du.transition={};try{e(!1),t()}finally{ze=n,du.transition=r}}function zx(){return on().memoizedState}function F1(e,t,n){var r=yr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Mx(e))$x(t,n);else if(n=xx(e,t,n,r),n!==null){var i=Pt();yn(n,e,r,i),_x(n,t,r)}}function U1(e,t,n){var r=yr(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Mx(e))$x(t,i);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var a=t.lastRenderedState,o=l(a,n);if(i.hasEagerState=!0,i.eagerState=o,wn(o,a)){var u=t.interleaved;u===null?(i.next=i,Hd(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=xx(e,t,i,r),n!==null&&(i=Pt(),yn(n,e,r,i),_x(n,t,r))}}function Mx(e){var t=e.alternate;return e===Ge||t!==null&&t===Ge}function $x(e,t){Fi=Wa=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function _x(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Pd(e,n)}}var Va={readContext:an,useCallback:St,useContext:St,useEffect:St,useImperativeHandle:St,useInsertionEffect:St,useLayoutEffect:St,useMemo:St,useReducer:St,useRef:St,useState:St,useDebugValue:St,useDeferredValue:St,useTransition:St,useMutableSource:St,useSyncExternalStore:St,useId:St,unstable_isNewReconciler:!1},B1={readContext:an,useCallback:function(e,t){return Cn().memoizedState=[e,t===void 0?null:t],e},useContext:an,useEffect:Gf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,xa(4194308,4,Rx.bind(null,t,e),n)},useLayoutEffect:function(e,t){return xa(4194308,4,e,t)},useInsertionEffect:function(e,t){return xa(4,2,e,t)},useMemo:function(e,t){var n=Cn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Cn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=F1.bind(null,Ge,e),[r.memoizedState,e]},useRef:function(e){var t=Cn();return e={current:e},t.memoizedState=e},useState:qf,useDebugValue:Xd,useDeferredValue:function(e){return Cn().memoizedState=e},useTransition:function(){var e=qf(!1),t=e[0];return e=O1.bind(null,e[1]),Cn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ge,i=Cn();if(Qe){if(n===void 0)throw Error(K(407));n=n()}else{if(n=t(),ht===null)throw Error(K(349));rs&30||kx(r,t,n)}i.memoizedState=n;var l={value:n,getSnapshot:t};return i.queue=l,Gf(Sx.bind(null,r,l,e),[e]),r.flags|=2048,ul(9,bx.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=Cn(),t=ht.identifierPrefix;if(Qe){var n=Fn,r=On;n=(r&~(1<<32-xn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=al++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=_1++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},H1={readContext:an,useCallback:Ax,useContext:an,useEffect:Jd,useImperativeHandle:Lx,useInsertionEffect:Tx,useLayoutEffect:Px,useMemo:Ix,useReducer:hu,useRef:Ex,useState:function(){return hu(ol)},useDebugValue:Xd,useDeferredValue:function(e){var t=on();return Dx(t,lt.memoizedState,e)},useTransition:function(){var e=hu(ol)[0],t=on().memoizedState;return[e,t]},useMutableSource:jx,useSyncExternalStore:wx,useId:zx,unstable_isNewReconciler:!1},W1={readContext:an,useCallback:Ax,useContext:an,useEffect:Jd,useImperativeHandle:Lx,useInsertionEffect:Tx,useLayoutEffect:Px,useMemo:Ix,useReducer:fu,useRef:Ex,useState:function(){return fu(ol)},useDebugValue:Xd,useDeferredValue:function(e){var t=on();return lt===null?t.memoizedState=e:Dx(t,lt.memoizedState,e)},useTransition:function(){var e=fu(ol)[0],t=on().memoizedState;return[e,t]},useMutableSource:jx,useSyncExternalStore:wx,useId:zx,unstable_isNewReconciler:!1};function fn(e,t){if(e&&e.defaultProps){t=Ke({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function kc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ke({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var jo={isMounted:function(e){return(e=e._reactInternals)?cs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Pt(),i=yr(e),l=Un(r,i);l.payload=t,n!=null&&(l.callback=n),t=gr(e,l,i),t!==null&&(yn(t,e,i,r),ma(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Pt(),i=yr(e),l=Un(r,i);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=gr(e,l,i),t!==null&&(yn(t,e,i,r),ma(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Pt(),r=yr(e),i=Un(n,r);i.tag=2,t!=null&&(i.callback=t),t=gr(e,i,r),t!==null&&(yn(t,e,r,n),ma(t,e,r))}};function Kf(e,t,n,r,i,l,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,l,a):t.prototype&&t.prototype.isPureReactComponent?!tl(n,r)||!tl(i,l):!0}function Ox(e,t,n){var r=!1,i=wr,l=t.contextType;return typeof l=="object"&&l!==null?l=an(l):(i=_t(t)?ts:Et.current,r=t.contextTypes,l=(r=r!=null)?qs(e,i):wr),t=new t(n,l),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=jo,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=l),t}function Yf(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&jo.enqueueReplaceState(t,t.state,null)}function bc(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Wd(e);var l=t.contextType;typeof l=="object"&&l!==null?i.context=an(l):(l=_t(t)?ts:Et.current,i.context=qs(e,l)),i.state=e.memoizedState,l=t.getDerivedStateFromProps,typeof l=="function"&&(kc(e,t,l,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&jo.enqueueReplaceState(i,i.state,null),Ba(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Js(e,t){try{var n="",r=t;do n+=yw(r),r=r.return;while(r);var i=n}catch(l){i=`
39
39
  Error generating stack: `+l.message+`
40
- `+l.stack}return{value:e,source:t,stack:i,digest:null}}function fu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function bc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var F1=typeof WeakMap=="function"?WeakMap:Map;function $x(e,t,n){n=Un(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){qa||(qa=!0,Ic=r),bc(e,t)},n}function _x(e,t,n){n=Un(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){bc(e,t)}}var l=e.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(n.callback=function(){bc(e,t),typeof r!="function"&&(gr===null?gr=new Set([this]):gr.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function Kf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new F1;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=ek.bind(null,e,t,n),t.then(e,e))}function Yf(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 Jf(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,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=Un(-1,1),t.tag=2,mr(n,t,1))),n.lanes|=1),e)}var U1=qn.ReactCurrentOwner,Mt=!1;function Tt(e,t,n,r){t.child=e===null?fx(t,null,n,r):Gs(t,e.child,n,r)}function Xf(e,t,n,r,i){n=n.render;var l=t.ref;return Bs(t,i),r=Gd(e,t,n,r,l,i),n=Kd(),e!==null&&!Mt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Qn(e,t,i)):(Qe&&n&&Md(t),t.flags|=1,Tt(e,t,r,i),t.child)}function Zf(e,t,n,r,i){if(e===null){var l=n.type;return typeof l=="function"&&!ih(l)&&l.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=l,Ox(e,t,l,r,i)):(e=wa(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!(e.lanes&i)){var a=l.memoizedProps;if(n=n.compare,n=n!==null?n:tl,n(a,r)&&e.ref===t.ref)return Qn(e,t,i)}return t.flags|=1,e=yr(l,r),e.ref=t.ref,e.return=t,t.child=e}function Ox(e,t,n,r,i){if(e!==null){var l=e.memoizedProps;if(tl(l,r)&&e.ref===t.ref)if(Mt=!1,t.pendingProps=r=l,(e.lanes&i)!==0)e.flags&131072&&(Mt=!0);else return t.lanes=e.lanes,Qn(e,t,i)}return Sc(e,t,n,r,i)}function Fx(e,t,n){var r=t.pendingProps,i=r.children,l=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Be(Ms,Wt),Wt|=n;else{if(!(n&1073741824))return e=l!==null?l.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Be(Ms,Wt),Wt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=l!==null?l.baseLanes:n,Be(Ms,Wt),Wt|=r}else l!==null?(r=l.baseLanes|n,t.memoizedState=null):r=n,Be(Ms,Wt),Wt|=r;return Tt(e,t,i,n),t.child}function Ux(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Sc(e,t,n,r,i){var l=_t(n)?es:Et.current;return l=Qs(t,l),Bs(t,i),n=Gd(e,t,n,r,l,i),r=Kd(),e!==null&&!Mt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Qn(e,t,i)):(Qe&&r&&Md(t),t.flags|=1,Tt(e,t,n,i),t.child)}function ep(e,t,n,r,i){if(_t(n)){var l=!0;$a(t)}else l=!1;if(Bs(t,i),t.stateNode===null)ya(e,t),Mx(t,n,r),kc(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,o=t.memoizedProps;a.props=o;var u=a.context,c=n.contextType;typeof c=="object"&&c!==null?c=an(c):(c=_t(n)?es:Et.current,c=Qs(t,c));var h=n.getDerivedStateFromProps,d=typeof h=="function"||typeof a.getSnapshotBeforeUpdate=="function";d||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||u!==c)&&Gf(t,a,r,c),sr=!1;var f=t.memoizedState;a.state=f,Ba(t,r,a,i),u=t.memoizedState,o!==r||f!==u||$t.current||sr?(typeof h=="function"&&(wc(t,n,h,r),u=t.memoizedState),(o=sr||qf(t,n,o,r,f,u,c))?(d||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),a.props=r,a.state=u,a.context=c,r=o):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,mx(e,t),o=t.memoizedProps,c=t.type===t.elementType?o:hn(t.type,o),a.props=c,d=t.pendingProps,f=a.context,u=n.contextType,typeof u=="object"&&u!==null?u=an(u):(u=_t(n)?es:Et.current,u=Qs(t,u));var m=n.getDerivedStateFromProps;(h=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==d||f!==u)&&Gf(t,a,r,u),sr=!1,f=t.memoizedState,a.state=f,Ba(t,r,a,i);var p=t.memoizedState;o!==d||f!==p||$t.current||sr?(typeof m=="function"&&(wc(t,n,m,r),p=t.memoizedState),(c=sr||qf(t,n,c,r,f,p,u)||!1)?(h||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,p,u),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,p,u)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=u,r=c):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Nc(e,t,n,r,l,i)}function Nc(e,t,n,r,i,l){Ux(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&Of(t,n,!1),Qn(e,t,l);r=t.stateNode,U1.current=t;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Gs(t,e.child,null,l),t.child=Gs(t,null,o,l)):Tt(e,t,o,l),t.memoizedState=r.state,i&&Of(t,n,!0),t.child}function Bx(e){var t=e.stateNode;t.pendingContext?_f(e,t.pendingContext,t.pendingContext!==t.context):t.context&&_f(e,t.context,!1),Wd(e,t.containerInfo)}function tp(e,t,n,r,i){return qs(),_d(i),t.flags|=256,Tt(e,t,n,r),t.child}var Cc={dehydrated:null,treeContext:null,retryLane:0};function Ec(e){return{baseLanes:e,cachePool:null,transitions:null}}function Hx(e,t,n){var r=t.pendingProps,i=qe.current,l=!1,a=(t.flags&128)!==0,o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:(i&2)!==0),o?(l=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Be(qe,i&1),e===null)return vc(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):(a=r.children,e=r.fallback,l?(r=t.mode,l=t.child,a={mode:"hidden",children:a},!(r&1)&&l!==null?(l.childLanes=0,l.pendingProps=a):l=bo(a,r,0,null),e=Xr(e,r,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=Ec(n),t.memoizedState=Cc,e):Xd(t,a));if(i=e.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return B1(e,t,a,r,o,i,n);if(l){l=r.fallback,a=t.mode,i=e.child,o=i.sibling;var u={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=yr(i,u),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?l=yr(o,l):(l=Xr(l,a,n,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,r=l,l=t.child,a=e.child.memoizedState,a=a===null?Ec(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},l.memoizedState=a,l.childLanes=e.childLanes&~n,t.memoizedState=Cc,r}return l=e.child,e=l.sibling,r=yr(l,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Xd(e,t){return t=bo({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Yl(e,t,n,r){return r!==null&&_d(r),Gs(t,e.child,null,n),e=Xd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function B1(e,t,n,r,i,l,a){if(n)return t.flags&256?(t.flags&=-257,r=fu(Error(K(422))),Yl(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(l=r.fallback,i=t.mode,r=bo({mode:"visible",children:r.children},i,0,null),l=Xr(l,i,a,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,t.mode&1&&Gs(t,e.child,null,a),t.child.memoizedState=Ec(a),t.memoizedState=Cc,l);if(!(t.mode&1))return Yl(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,l=Error(K(419)),r=fu(l,r,void 0),Yl(e,t,a,r)}if(o=(a&e.childLanes)!==0,Mt||o){if(r=ht,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==l.retryLane&&(l.retryLane=i,Vn(e,i),xn(r,e,i,-1))}return sh(),r=fu(Error(K(421))),Yl(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=tk.bind(null,e),i._reactRetry=t,null):(e=l.treeContext,Qt=pr(i.nextSibling),Gt=t,Qe=!0,mn=null,e!==null&&(en[tn++]=On,en[tn++]=Fn,en[tn++]=ts,On=e.id,Fn=e.overflow,ts=t),t=Xd(t,r.children),t.flags|=4096,t)}function np(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),jc(e.return,t,n)}function pu(e,t,n,r,i){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=r,l.tail=n,l.tailMode=i)}function Wx(e,t,n){var r=t.pendingProps,i=r.revealOrder,l=r.tail;if(Tt(e,t,r.children,n),r=qe.current,r&2)r=r&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&&np(e,n,t);else if(e.tag===19)np(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}r&=1}if(Be(qe,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Ha(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),pu(t,!1,i,n,l);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ha(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}pu(t,!0,n,null,l);break;case"together":pu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ya(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Qn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),rs|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(K(153));if(t.child!==null){for(e=t.child,n=yr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=yr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function H1(e,t,n){switch(t.tag){case 3:Bx(t),qs();break;case 5:gx(t);break;case 1:_t(t.type)&&$a(t);break;case 4:Wd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Be(Fa,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Be(qe,qe.current&1),t.flags|=128,null):n&t.child.childLanes?Hx(e,t,n):(Be(qe,qe.current&1),e=Qn(e,t,n),e!==null?e.sibling:null);Be(qe,qe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Wx(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Be(qe,qe.current),r)break;return null;case 22:case 23:return t.lanes=0,Fx(e,t,n)}return Qn(e,t,n)}var Vx,Tc,Qx,qx;Vx=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}};Tc=function(){};Qx=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Gr(Ln.current);var l=null;switch(n){case"input":i=Yu(e,i),r=Yu(e,r),l=[];break;case"select":i=Ke({},i,{value:void 0}),r=Ke({},r,{value:void 0}),l=[];break;case"textarea":i=Zu(e,i),r=Zu(e,r),l=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=za)}tc(n,r);var a;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var o=i[c];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Gi.hasOwnProperty(c)?l||(l=[]):(l=l||[]).push(c,null));for(c in r){var u=r[c];if(o=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&u!==o&&(u!=null||o!=null))if(c==="style")if(o){for(a in o)!o.hasOwnProperty(a)||u&&u.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in u)u.hasOwnProperty(a)&&o[a]!==u[a]&&(n||(n={}),n[a]=u[a])}else n||(l||(l=[]),l.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,o=o?o.__html:void 0,u!=null&&o!==u&&(l=l||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(l=l||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Gi.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&He("scroll",e),l||o===u||(l=[])):(l=l||[]).push(c,u))}n&&(l=l||[]).push("style",n);var c=l;(t.updateQueue=c)&&(t.flags|=4)}};qx=function(e,t,n,r){n!==r&&(t.flags|=4)};function ji(e,t){if(!Qe)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 r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Nt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function W1(e,t,n){var r=t.pendingProps;switch($d(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nt(t),null;case 1:return _t(t.type)&&Ma(),Nt(t),null;case 3:return r=t.stateNode,Ks(),We($t),We(Et),Qd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Gl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,mn!==null&&(Mc(mn),mn=null))),Tc(e,t),Nt(t),null;case 5:Vd(t);var i=Gr(ll.current);if(n=t.type,e!==null&&t.stateNode!=null)Qx(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(K(166));return Nt(t),null}if(e=Gr(Ln.current),Gl(t)){r=t.stateNode,n=t.type;var l=t.memoizedProps;switch(r[Tn]=t,r[sl]=l,e=(t.mode&1)!==0,n){case"dialog":He("cancel",r),He("close",r);break;case"iframe":case"object":case"embed":He("load",r);break;case"video":case"audio":for(i=0;i<Ii.length;i++)He(Ii[i],r);break;case"source":He("error",r);break;case"img":case"image":case"link":He("error",r),He("load",r);break;case"details":He("toggle",r);break;case"input":df(r,l),He("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!l.multiple},He("invalid",r);break;case"textarea":ff(r,l),He("invalid",r)}tc(n,l),i=null;for(var a in l)if(l.hasOwnProperty(a)){var o=l[a];a==="children"?typeof o=="string"?r.textContent!==o&&(l.suppressHydrationWarning!==!0&&ql(r.textContent,o,e),i=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(l.suppressHydrationWarning!==!0&&ql(r.textContent,o,e),i=["children",""+o]):Gi.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&He("scroll",r)}switch(n){case"input":Ol(r),hf(r,l,!0);break;case"textarea":Ol(r),pf(r);break;case"select":case"option":break;default:typeof l.onClick=="function"&&(r.onclick=za)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=wg(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Tn]=t,e[sl]=r,Vx(e,t,!1,!1),t.stateNode=e;e:{switch(a=nc(n,r),n){case"dialog":He("cancel",e),He("close",e),i=r;break;case"iframe":case"object":case"embed":He("load",e),i=r;break;case"video":case"audio":for(i=0;i<Ii.length;i++)He(Ii[i],e);i=r;break;case"source":He("error",e),i=r;break;case"img":case"image":case"link":He("error",e),He("load",e),i=r;break;case"details":He("toggle",e),i=r;break;case"input":df(e,r),i=Yu(e,r),He("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Ke({},r,{value:void 0}),He("invalid",e);break;case"textarea":ff(e,r),i=Zu(e,r),He("invalid",e);break;default:i=r}tc(n,i),o=i;for(l in o)if(o.hasOwnProperty(l)){var u=o[l];l==="style"?Sg(e,u):l==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&kg(e,u)):l==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&Ki(e,u):typeof u=="number"&&Ki(e,""+u):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(Gi.hasOwnProperty(l)?u!=null&&l==="onScroll"&&He("scroll",e):u!=null&&kd(e,l,u,a))}switch(n){case"input":Ol(e),hf(e,r,!1);break;case"textarea":Ol(e),pf(e);break;case"option":r.value!=null&&e.setAttribute("value",""+vr(r.value));break;case"select":e.multiple=!!r.multiple,l=r.value,l!=null?_s(e,!!r.multiple,l,!1):r.defaultValue!=null&&_s(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=za)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Nt(t),null;case 6:if(e&&t.stateNode!=null)qx(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(K(166));if(n=Gr(ll.current),Gr(Ln.current),Gl(t)){if(r=t.stateNode,n=t.memoizedProps,r[Tn]=t,(l=r.nodeValue!==n)&&(e=Gt,e!==null))switch(e.tag){case 3:ql(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ql(r.nodeValue,n,(e.mode&1)!==0)}l&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Tn]=t,t.stateNode=r}return Nt(t),null;case 13:if(We(qe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Qe&&Qt!==null&&t.mode&1&&!(t.flags&128))dx(),qs(),t.flags|=98560,l=!1;else if(l=Gl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!l)throw Error(K(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(K(317));l[Tn]=t}else qs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Nt(t),l=!1}else mn!==null&&(Mc(mn),mn=null),l=!0;if(!l)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||qe.current&1?at===0&&(at=3):sh())),t.updateQueue!==null&&(t.flags|=4),Nt(t),null);case 4:return Ks(),Tc(e,t),e===null&&nl(t.stateNode.containerInfo),Nt(t),null;case 10:return Ud(t.type._context),Nt(t),null;case 17:return _t(t.type)&&Ma(),Nt(t),null;case 19:if(We(qe),l=t.memoizedState,l===null)return Nt(t),null;if(r=(t.flags&128)!==0,a=l.rendering,a===null)if(r)ji(l,!1);else{if(at!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Ha(e),a!==null){for(t.flags|=128,ji(l,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)l=n,e=r,l.flags&=14680066,a=l.alternate,a===null?(l.childLanes=0,l.lanes=e,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=a.childLanes,l.lanes=a.lanes,l.child=a.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=a.memoizedProps,l.memoizedState=a.memoizedState,l.updateQueue=a.updateQueue,l.type=a.type,e=a.dependencies,l.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Be(qe,qe.current&1|2),t.child}e=e.sibling}l.tail!==null&&et()>Js&&(t.flags|=128,r=!0,ji(l,!1),t.lanes=4194304)}else{if(!r)if(e=Ha(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ji(l,!0),l.tail===null&&l.tailMode==="hidden"&&!a.alternate&&!Qe)return Nt(t),null}else 2*et()-l.renderingStartTime>Js&&n!==1073741824&&(t.flags|=128,r=!0,ji(l,!1),t.lanes=4194304);l.isBackwards?(a.sibling=t.child,t.child=a):(n=l.last,n!==null?n.sibling=a:t.child=a,l.last=a)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=et(),t.sibling=null,n=qe.current,Be(qe,r?n&1|2:n&1),t):(Nt(t),null);case 22:case 23:return rh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Wt&1073741824&&(Nt(t),t.subtreeFlags&6&&(t.flags|=8192)):Nt(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function V1(e,t){switch($d(t),t.tag){case 1:return _t(t.type)&&Ma(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ks(),We($t),We(Et),Qd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Vd(t),null;case 13:if(We(qe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));qs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return We(qe),null;case 4:return Ks(),null;case 10:return Ud(t.type._context),null;case 22:case 23:return rh(),null;case 24:return null;default:return null}}var Jl=!1,Ct=!1,Q1=typeof WeakSet=="function"?WeakSet:Set,te=null;function zs(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Xe(e,t,r)}else n.current=null}function Pc(e,t,n){try{n()}catch(r){Xe(e,t,r)}}var rp=!1;function q1(e,t){if(hc=Aa,e=Xg(),zd(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var a=0,o=-1,u=-1,c=0,h=0,d=e,f=null;t:for(;;){for(var m;d!==n||i!==0&&d.nodeType!==3||(o=a+i),d!==l||r!==0&&d.nodeType!==3||(u=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(m=d.firstChild)!==null;)f=d,d=m;for(;;){if(d===e)break t;if(f===n&&++c===i&&(o=a),f===l&&++h===r&&(u=a),(m=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=m}n=o===-1||u===-1?null:{start:o,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(fc={focusedElem:e,selectionRange:n},Aa=!1,te=t;te!==null;)if(t=te,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,te=e;else for(;te!==null;){t=te;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var g=p.memoizedProps,w=p.memoizedState,y=t.stateNode,x=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:hn(t.type,g),w);y.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(b){Xe(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,te=e;break}te=t.return}return p=rp,rp=!1,p}function Ui(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var l=i.destroy;i.destroy=void 0,l!==void 0&&Pc(t,n,l)}i=i.next}while(i!==r)}}function wo(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 r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Rc(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 Gx(e){var t=e.alternate;t!==null&&(e.alternate=null,Gx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Tn],delete t[sl],delete t[gc],delete t[P1],delete t[R1])),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 Kx(e){return e.tag===5||e.tag===3||e.tag===4}function sp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Kx(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 Lc(e,t,n){var r=e.tag;if(r===5||r===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=za));else if(r!==4&&(e=e.child,e!==null))for(Lc(e,t,n),e=e.sibling;e!==null;)Lc(e,t,n),e=e.sibling}function Ac(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ac(e,t,n),e=e.sibling;e!==null;)Ac(e,t,n),e=e.sibling}var xt=null,fn=!1;function er(e,t,n){for(n=n.child;n!==null;)Yx(e,t,n),n=n.sibling}function Yx(e,t,n){if(Rn&&typeof Rn.onCommitFiberUnmount=="function")try{Rn.onCommitFiberUnmount(fo,n)}catch{}switch(n.tag){case 5:Ct||zs(n,t);case 6:var r=xt,i=fn;xt=null,er(e,t,n),xt=r,fn=i,xt!==null&&(fn?(e=xt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):xt.removeChild(n.stateNode));break;case 18:xt!==null&&(fn?(e=xt,n=n.stateNode,e.nodeType===8?au(e.parentNode,n):e.nodeType===1&&au(e,n),Zi(e)):au(xt,n.stateNode));break;case 4:r=xt,i=fn,xt=n.stateNode.containerInfo,fn=!0,er(e,t,n),xt=r,fn=i;break;case 0:case 11:case 14:case 15:if(!Ct&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var l=i,a=l.destroy;l=l.tag,a!==void 0&&(l&2||l&4)&&Pc(n,t,a),i=i.next}while(i!==r)}er(e,t,n);break;case 1:if(!Ct&&(zs(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){Xe(n,t,o)}er(e,t,n);break;case 21:er(e,t,n);break;case 22:n.mode&1?(Ct=(r=Ct)||n.memoizedState!==null,er(e,t,n),Ct=r):er(e,t,n);break;default:er(e,t,n)}}function ip(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Q1),t.forEach(function(r){var i=nk.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function dn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var l=e,a=t,o=a;e:for(;o!==null;){switch(o.tag){case 5:xt=o.stateNode,fn=!1;break e;case 3:xt=o.stateNode.containerInfo,fn=!0;break e;case 4:xt=o.stateNode.containerInfo,fn=!0;break e}o=o.return}if(xt===null)throw Error(K(160));Yx(l,a,i),xt=null,fn=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(c){Xe(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Jx(t,e),t=t.sibling}function Jx(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(dn(t,e),Nn(e),r&4){try{Ui(3,e,e.return),wo(3,e)}catch(g){Xe(e,e.return,g)}try{Ui(5,e,e.return)}catch(g){Xe(e,e.return,g)}}break;case 1:dn(t,e),Nn(e),r&512&&n!==null&&zs(n,n.return);break;case 5:if(dn(t,e),Nn(e),r&512&&n!==null&&zs(n,n.return),e.flags&32){var i=e.stateNode;try{Ki(i,"")}catch(g){Xe(e,e.return,g)}}if(r&4&&(i=e.stateNode,i!=null)){var l=e.memoizedProps,a=n!==null?n.memoizedProps:l,o=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{o==="input"&&l.type==="radio"&&l.name!=null&&vg(i,l),nc(o,a);var c=nc(o,l);for(a=0;a<u.length;a+=2){var h=u[a],d=u[a+1];h==="style"?Sg(i,d):h==="dangerouslySetInnerHTML"?kg(i,d):h==="children"?Ki(i,d):kd(i,h,d,c)}switch(o){case"input":Ju(i,l);break;case"textarea":jg(i,l);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!l.multiple;var m=l.value;m!=null?_s(i,!!l.multiple,m,!1):f!==!!l.multiple&&(l.defaultValue!=null?_s(i,!!l.multiple,l.defaultValue,!0):_s(i,!!l.multiple,l.multiple?[]:"",!1))}i[sl]=l}catch(g){Xe(e,e.return,g)}}break;case 6:if(dn(t,e),Nn(e),r&4){if(e.stateNode===null)throw Error(K(162));i=e.stateNode,l=e.memoizedProps;try{i.nodeValue=l}catch(g){Xe(e,e.return,g)}}break;case 3:if(dn(t,e),Nn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Zi(t.containerInfo)}catch(g){Xe(e,e.return,g)}break;case 4:dn(t,e),Nn(e);break;case 13:dn(t,e),Nn(e),i=e.child,i.flags&8192&&(l=i.memoizedState!==null,i.stateNode.isHidden=l,!l||i.alternate!==null&&i.alternate.memoizedState!==null||(th=et())),r&4&&ip(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(Ct=(c=Ct)||h,dn(t,e),Ct=c):dn(t,e),Nn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!h&&e.mode&1)for(te=e,h=e.child;h!==null;){for(d=te=h;te!==null;){switch(f=te,m=f.child,f.tag){case 0:case 11:case 14:case 15:Ui(4,f,f.return);break;case 1:zs(f,f.return);var p=f.stateNode;if(typeof p.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(g){Xe(r,n,g)}}break;case 5:zs(f,f.return);break;case 22:if(f.memoizedState!==null){ap(d);continue}}m!==null?(m.return=f,te=m):ap(d)}h=h.sibling}e:for(h=null,d=e;;){if(d.tag===5){if(h===null){h=d;try{i=d.stateNode,c?(l=i.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"):(o=d.stateNode,u=d.memoizedProps.style,a=u!=null&&u.hasOwnProperty("display")?u.display:null,o.style.display=bg("display",a))}catch(g){Xe(e,e.return,g)}}}else if(d.tag===6){if(h===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(g){Xe(e,e.return,g)}}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;h===d&&(h=null),d=d.return}h===d&&(h=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:dn(t,e),Nn(e),r&4&&ip(e);break;case 21:break;default:dn(t,e),Nn(e)}}function Nn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Kx(n)){var r=n;break e}n=n.return}throw Error(K(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Ki(i,""),r.flags&=-33);var l=sp(e);Ac(e,l,i);break;case 3:case 4:var a=r.stateNode.containerInfo,o=sp(e);Lc(e,o,a);break;default:throw Error(K(161))}}catch(u){Xe(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function G1(e,t,n){te=e,Xx(e)}function Xx(e,t,n){for(var r=(e.mode&1)!==0;te!==null;){var i=te,l=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||Jl;if(!a){var o=i.alternate,u=o!==null&&o.memoizedState!==null||Ct;o=Jl;var c=Ct;if(Jl=a,(Ct=u)&&!c)for(te=i;te!==null;)a=te,u=a.child,a.tag===22&&a.memoizedState!==null?op(i):u!==null?(u.return=a,te=u):op(i);for(;l!==null;)te=l,Xx(l),l=l.sibling;te=i,Jl=o,Ct=c}lp(e)}else i.subtreeFlags&8772&&l!==null?(l.return=i,te=l):lp(e)}}function lp(e){for(;te!==null;){var t=te;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ct||wo(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ct)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:hn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var l=t.updateQueue;l!==null&&Wf(t,l,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Wf(t,a,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var h=c.memoizedState;if(h!==null){var d=h.dehydrated;d!==null&&Zi(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(K(163))}Ct||t.flags&512&&Rc(t)}catch(f){Xe(t,t.return,f)}}if(t===e){te=null;break}if(n=t.sibling,n!==null){n.return=t.return,te=n;break}te=t.return}}function ap(e){for(;te!==null;){var t=te;if(t===e){te=null;break}var n=t.sibling;if(n!==null){n.return=t.return,te=n;break}te=t.return}}function op(e){for(;te!==null;){var t=te;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{wo(4,t)}catch(u){Xe(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(u){Xe(t,i,u)}}var l=t.return;try{Rc(t)}catch(u){Xe(t,l,u)}break;case 5:var a=t.return;try{Rc(t)}catch(u){Xe(t,a,u)}}}catch(u){Xe(t,t.return,u)}if(t===e){te=null;break}var o=t.sibling;if(o!==null){o.return=t.return,te=o;break}te=t.return}}var K1=Math.ceil,Qa=qn.ReactCurrentDispatcher,Zd=qn.ReactCurrentOwner,ln=qn.ReactCurrentBatchConfig,Re=0,ht=null,it=null,wt=0,Wt=0,Ms=Er(0),at=0,cl=null,rs=0,ko=0,eh=0,Bi=null,zt=null,th=0,Js=1/0,$n=null,qa=!1,Ic=null,gr=null,Xl=!1,or=null,Ga=0,Hi=0,Dc=null,va=-1,ja=0;function Pt(){return Re&6?et():va!==-1?va:va=et()}function xr(e){return e.mode&1?Re&2&&wt!==0?wt&-wt:A1.transition!==null?(ja===0&&(ja=Mg()),ja):(e=ze,e!==0||(e=window.event,e=e===void 0?16:Hg(e.type)),e):1}function xn(e,t,n,r){if(50<Hi)throw Hi=0,Dc=null,Error(K(185));xl(e,n,r),(!(Re&2)||e!==ht)&&(e===ht&&(!(Re&2)&&(ko|=n),at===4&&lr(e,wt)),Ot(e,r),n===1&&Re===0&&!(t.mode&1)&&(Js=et()+500,yo&&Tr()))}function Ot(e,t){var n=e.callbackNode;Aw(e,t);var r=La(e,e===ht?wt:0);if(r===0)n!==null&&xf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&xf(n),t===1)e.tag===0?L1(up.bind(null,e)):ox(up.bind(null,e)),E1(function(){!(Re&6)&&Tr()}),n=null;else{switch($g(r)){case 1:n=Ed;break;case 4:n=Dg;break;case 16:n=Ra;break;case 536870912:n=zg;break;default:n=Ra}n=ly(n,Zx.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Zx(e,t){if(va=-1,ja=0,Re&6)throw Error(K(327));var n=e.callbackNode;if(Hs()&&e.callbackNode!==n)return null;var r=La(e,e===ht?wt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ka(e,r);else{t=r;var i=Re;Re|=2;var l=ty();(ht!==e||wt!==t)&&($n=null,Js=et()+500,Jr(e,t));do try{X1();break}catch(o){ey(e,o)}while(!0);Fd(),Qa.current=l,Re=i,it!==null?t=0:(ht=null,wt=0,t=at)}if(t!==0){if(t===2&&(i=ac(e),i!==0&&(r=i,t=zc(e,i))),t===1)throw n=cl,Jr(e,0),lr(e,r),Ot(e,et()),n;if(t===6)lr(e,r);else{if(i=e.current.alternate,!(r&30)&&!Y1(i)&&(t=Ka(e,r),t===2&&(l=ac(e),l!==0&&(r=l,t=zc(e,l))),t===1))throw n=cl,Jr(e,0),lr(e,r),Ot(e,et()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(K(345));case 2:Br(e,zt,$n);break;case 3:if(lr(e,r),(r&130023424)===r&&(t=th+500-et(),10<t)){if(La(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Pt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=mc(Br.bind(null,e,zt,$n),t);break}Br(e,zt,$n);break;case 4:if(lr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-gn(r);l=1<<a,a=t[a],a>i&&(i=a),r&=~l}if(r=i,r=et()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*K1(r/1960))-r,10<r){e.timeoutHandle=mc(Br.bind(null,e,zt,$n),r);break}Br(e,zt,$n);break;case 5:Br(e,zt,$n);break;default:throw Error(K(329))}}}return Ot(e,et()),e.callbackNode===n?Zx.bind(null,e):null}function zc(e,t){var n=Bi;return e.current.memoizedState.isDehydrated&&(Jr(e,t).flags|=256),e=Ka(e,t),e!==2&&(t=zt,zt=n,t!==null&&Mc(t)),e}function Mc(e){zt===null?zt=e:zt.push.apply(zt,e)}function Y1(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],l=i.getSnapshot;i=i.value;try{if(!jn(l(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function lr(e,t){for(t&=~eh,t&=~ko,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-gn(t),r=1<<n;e[n]=-1,t&=~r}}function up(e){if(Re&6)throw Error(K(327));Hs();var t=La(e,0);if(!(t&1))return Ot(e,et()),null;var n=Ka(e,t);if(e.tag!==0&&n===2){var r=ac(e);r!==0&&(t=r,n=zc(e,r))}if(n===1)throw n=cl,Jr(e,0),lr(e,t),Ot(e,et()),n;if(n===6)throw Error(K(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Br(e,zt,$n),Ot(e,et()),null}function nh(e,t){var n=Re;Re|=1;try{return e(t)}finally{Re=n,Re===0&&(Js=et()+500,yo&&Tr())}}function ss(e){or!==null&&or.tag===0&&!(Re&6)&&Hs();var t=Re;Re|=1;var n=ln.transition,r=ze;try{if(ln.transition=null,ze=1,e)return e()}finally{ze=r,ln.transition=n,Re=t,!(Re&6)&&Tr()}}function rh(){Wt=Ms.current,We(Ms)}function Jr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,C1(n)),it!==null)for(n=it.return;n!==null;){var r=n;switch($d(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ma();break;case 3:Ks(),We($t),We(Et),Qd();break;case 5:Vd(r);break;case 4:Ks();break;case 13:We(qe);break;case 19:We(qe);break;case 10:Ud(r.type._context);break;case 22:case 23:rh()}n=n.return}if(ht=e,it=e=yr(e.current,null),wt=Wt=t,at=0,cl=null,eh=ko=rs=0,zt=Bi=null,qr!==null){for(t=0;t<qr.length;t++)if(n=qr[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,l=n.pending;if(l!==null){var a=l.next;l.next=i,r.next=a}n.pending=r}qr=null}return e}function ey(e,t){do{var n=it;try{if(Fd(),ga.current=Va,Wa){for(var r=Ge.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Wa=!1}if(ns=0,dt=lt=Ge=null,Fi=!1,al=0,Zd.current=null,n===null||n.return===null){at=1,cl=t,it=null;break}e:{var l=e,a=n.return,o=n,u=t;if(t=wt,o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,h=o,d=h.tag;if(!(h.mode&1)&&(d===0||d===11||d===15)){var f=h.alternate;f?(h.updateQueue=f.updateQueue,h.memoizedState=f.memoizedState,h.lanes=f.lanes):(h.updateQueue=null,h.memoizedState=null)}var m=Yf(a);if(m!==null){m.flags&=-257,Jf(m,a,o,l,t),m.mode&1&&Kf(l,c,t),t=m,u=c;var p=t.updateQueue;if(p===null){var g=new Set;g.add(u),t.updateQueue=g}else p.add(u);break e}else{if(!(t&1)){Kf(l,c,t),sh();break e}u=Error(K(426))}}else if(Qe&&o.mode&1){var w=Yf(a);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Jf(w,a,o,l,t),_d(Ys(u,o));break e}}l=u=Ys(u,o),at!==4&&(at=2),Bi===null?Bi=[l]:Bi.push(l),l=a;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t;var y=$x(l,u,t);Hf(l,y);break e;case 1:o=u;var x=l.type,v=l.stateNode;if(!(l.flags&128)&&(typeof x.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(gr===null||!gr.has(v)))){l.flags|=65536,t&=-t,l.lanes|=t;var b=_x(l,o,t);Hf(l,b);break e}}l=l.return}while(l!==null)}ry(n)}catch(A){t=A,it===n&&n!==null&&(it=n=n.return);continue}break}while(!0)}function ty(){var e=Qa.current;return Qa.current=Va,e===null?Va:e}function sh(){(at===0||at===3||at===2)&&(at=4),ht===null||!(rs&268435455)&&!(ko&268435455)||lr(ht,wt)}function Ka(e,t){var n=Re;Re|=2;var r=ty();(ht!==e||wt!==t)&&($n=null,Jr(e,t));do try{J1();break}catch(i){ey(e,i)}while(!0);if(Fd(),Re=n,Qa.current=r,it!==null)throw Error(K(261));return ht=null,wt=0,at}function J1(){for(;it!==null;)ny(it)}function X1(){for(;it!==null&&!bw();)ny(it)}function ny(e){var t=iy(e.alternate,e,Wt);e.memoizedProps=e.pendingProps,t===null?ry(e):it=t,Zd.current=null}function ry(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=V1(n,t),n!==null){n.flags&=32767,it=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{at=6,it=null;return}}else if(n=W1(n,t,Wt),n!==null){it=n;return}if(t=t.sibling,t!==null){it=t;return}it=t=e}while(t!==null);at===0&&(at=5)}function Br(e,t,n){var r=ze,i=ln.transition;try{ln.transition=null,ze=1,Z1(e,t,n,r)}finally{ln.transition=i,ze=r}return null}function Z1(e,t,n,r){do Hs();while(or!==null);if(Re&6)throw Error(K(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(K(177));e.callbackNode=null,e.callbackPriority=0;var l=n.lanes|n.childLanes;if(Iw(e,l),e===ht&&(it=ht=null,wt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Xl||(Xl=!0,ly(Ra,function(){return Hs(),null})),l=(n.flags&15990)!==0,n.subtreeFlags&15990||l){l=ln.transition,ln.transition=null;var a=ze;ze=1;var o=Re;Re|=4,Zd.current=null,q1(e,n),Jx(n,e),v1(fc),Aa=!!hc,fc=hc=null,e.current=n,G1(n),Sw(),Re=o,ze=a,ln.transition=l}else e.current=n;if(Xl&&(Xl=!1,or=e,Ga=i),l=e.pendingLanes,l===0&&(gr=null),Ew(n.stateNode),Ot(e,et()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(qa)throw qa=!1,e=Ic,Ic=null,e;return Ga&1&&e.tag!==0&&Hs(),l=e.pendingLanes,l&1?e===Dc?Hi++:(Hi=0,Dc=e):Hi=0,Tr(),null}function Hs(){if(or!==null){var e=$g(Ga),t=ln.transition,n=ze;try{if(ln.transition=null,ze=16>e?16:e,or===null)var r=!1;else{if(e=or,or=null,Ga=0,Re&6)throw Error(K(331));var i=Re;for(Re|=4,te=e.current;te!==null;){var l=te,a=l.child;if(te.flags&16){var o=l.deletions;if(o!==null){for(var u=0;u<o.length;u++){var c=o[u];for(te=c;te!==null;){var h=te;switch(h.tag){case 0:case 11:case 15:Ui(8,h,l)}var d=h.child;if(d!==null)d.return=h,te=d;else for(;te!==null;){h=te;var f=h.sibling,m=h.return;if(Gx(h),h===c){te=null;break}if(f!==null){f.return=m,te=f;break}te=m}}}var p=l.alternate;if(p!==null){var g=p.child;if(g!==null){p.child=null;do{var w=g.sibling;g.sibling=null,g=w}while(g!==null)}}te=l}}if(l.subtreeFlags&2064&&a!==null)a.return=l,te=a;else e:for(;te!==null;){if(l=te,l.flags&2048)switch(l.tag){case 0:case 11:case 15:Ui(9,l,l.return)}var y=l.sibling;if(y!==null){y.return=l.return,te=y;break e}te=l.return}}var x=e.current;for(te=x;te!==null;){a=te;var v=a.child;if(a.subtreeFlags&2064&&v!==null)v.return=a,te=v;else e:for(a=x;te!==null;){if(o=te,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:wo(9,o)}}catch(A){Xe(o,o.return,A)}if(o===a){te=null;break e}var b=o.sibling;if(b!==null){b.return=o.return,te=b;break e}te=o.return}}if(Re=i,Tr(),Rn&&typeof Rn.onPostCommitFiberRoot=="function")try{Rn.onPostCommitFiberRoot(fo,e)}catch{}r=!0}return r}finally{ze=n,ln.transition=t}}return!1}function cp(e,t,n){t=Ys(n,t),t=$x(e,t,1),e=mr(e,t,1),t=Pt(),e!==null&&(xl(e,1,t),Ot(e,t))}function Xe(e,t,n){if(e.tag===3)cp(e,e,n);else for(;t!==null;){if(t.tag===3){cp(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(gr===null||!gr.has(r))){e=Ys(n,e),e=_x(t,e,1),t=mr(t,e,1),e=Pt(),t!==null&&(xl(t,1,e),Ot(t,e));break}}t=t.return}}function ek(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Pt(),e.pingedLanes|=e.suspendedLanes&n,ht===e&&(wt&n)===n&&(at===4||at===3&&(wt&130023424)===wt&&500>et()-th?Jr(e,0):eh|=n),Ot(e,t)}function sy(e,t){t===0&&(e.mode&1?(t=Bl,Bl<<=1,!(Bl&130023424)&&(Bl=4194304)):t=1);var n=Pt();e=Vn(e,t),e!==null&&(xl(e,t,n),Ot(e,n))}function tk(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),sy(e,n)}function nk(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(K(314))}r!==null&&r.delete(t),sy(e,n)}var iy;iy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||$t.current)Mt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Mt=!1,H1(e,t,n);Mt=!!(e.flags&131072)}else Mt=!1,Qe&&t.flags&1048576&&ux(t,Oa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ya(e,t),e=t.pendingProps;var i=Qs(t,Et.current);Bs(t,n),i=Gd(null,t,r,e,i,n);var l=Kd();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,_t(r)?(l=!0,$a(t)):l=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Hd(t),i.updater=jo,t.stateNode=i,i._reactInternals=t,kc(t,r,e,n),t=Nc(null,t,r,!0,l,n)):(t.tag=0,Qe&&l&&Md(t),Tt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ya(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=sk(r),e=hn(r,e),i){case 0:t=Sc(null,t,r,e,n);break e;case 1:t=ep(null,t,r,e,n);break e;case 11:t=Xf(null,t,r,e,n);break e;case 14:t=Zf(null,t,r,hn(r.type,e),n);break e}throw Error(K(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:hn(r,i),Sc(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:hn(r,i),ep(e,t,r,i,n);case 3:e:{if(Bx(t),e===null)throw Error(K(387));r=t.pendingProps,l=t.memoizedState,i=l.element,mx(e,t),Ba(t,r,null,n);var a=t.memoizedState;if(r=a.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){i=Ys(Error(K(423)),t),t=tp(e,t,r,n,i);break e}else if(r!==i){i=Ys(Error(K(424)),t),t=tp(e,t,r,n,i);break e}else for(Qt=pr(t.stateNode.containerInfo.firstChild),Gt=t,Qe=!0,mn=null,n=fx(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(qs(),r===i){t=Qn(e,t,n);break e}Tt(e,t,r,n)}t=t.child}return t;case 5:return gx(t),e===null&&vc(t),r=t.type,i=t.pendingProps,l=e!==null?e.memoizedProps:null,a=i.children,pc(r,i)?a=null:l!==null&&pc(r,l)&&(t.flags|=32),Ux(e,t),Tt(e,t,a,n),t.child;case 6:return e===null&&vc(t),null;case 13:return Hx(e,t,n);case 4:return Wd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Gs(t,null,r,n):Tt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:hn(r,i),Xf(e,t,r,i,n);case 7:return Tt(e,t,t.pendingProps,n),t.child;case 8:return Tt(e,t,t.pendingProps.children,n),t.child;case 12:return Tt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,l=t.memoizedProps,a=i.value,Be(Fa,r._currentValue),r._currentValue=a,l!==null)if(jn(l.value,a)){if(l.children===i.children&&!$t.current){t=Qn(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var o=l.dependencies;if(o!==null){a=l.child;for(var u=o.firstContext;u!==null;){if(u.context===r){if(l.tag===1){u=Un(-1,n&-n),u.tag=2;var c=l.updateQueue;if(c!==null){c=c.shared;var h=c.pending;h===null?u.next=u:(u.next=h.next,h.next=u),c.pending=u}}l.lanes|=n,u=l.alternate,u!==null&&(u.lanes|=n),jc(l.return,n,t),o.lanes|=n;break}u=u.next}}else if(l.tag===10)a=l.type===t.type?null:l.child;else if(l.tag===18){if(a=l.return,a===null)throw Error(K(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),jc(a,n,t),a=l.sibling}else a=l.child;if(a!==null)a.return=l;else for(a=l;a!==null;){if(a===t){a=null;break}if(l=a.sibling,l!==null){l.return=a.return,a=l;break}a=a.return}l=a}Tt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Bs(t,n),i=an(i),r=r(i),t.flags|=1,Tt(e,t,r,n),t.child;case 14:return r=t.type,i=hn(r,t.pendingProps),i=hn(r.type,i),Zf(e,t,r,i,n);case 15:return Ox(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:hn(r,i),ya(e,t),t.tag=1,_t(r)?(e=!0,$a(t)):e=!1,Bs(t,n),Mx(t,r,i),kc(t,r,i,n),Nc(null,t,r,!0,e,n);case 19:return Wx(e,t,n);case 22:return Fx(e,t,n)}throw Error(K(156,t.tag))};function ly(e,t){return Ig(e,t)}function rk(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rn(e,t,n,r){return new rk(e,t,n,r)}function ih(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sk(e){if(typeof e=="function")return ih(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Sd)return 11;if(e===Nd)return 14}return 2}function yr(e,t){var n=e.alternate;return n===null?(n=rn(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 wa(e,t,n,r,i,l){var a=2;if(r=e,typeof e=="function")ih(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Cs:return Xr(n.children,i,l,t);case bd:a=8,i|=8;break;case Qu:return e=rn(12,n,t,i|2),e.elementType=Qu,e.lanes=l,e;case qu:return e=rn(13,n,t,i),e.elementType=qu,e.lanes=l,e;case Gu:return e=rn(19,n,t,i),e.elementType=Gu,e.lanes=l,e;case gg:return bo(n,i,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case pg:a=10;break e;case mg:a=9;break e;case Sd:a=11;break e;case Nd:a=14;break e;case rr:a=16,r=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=rn(a,n,t,i),t.elementType=e,t.type=r,t.lanes=l,t}function Xr(e,t,n,r){return e=rn(7,e,r,t),e.lanes=n,e}function bo(e,t,n,r){return e=rn(22,e,r,t),e.elementType=gg,e.lanes=n,e.stateNode={isHidden:!1},e}function mu(e,t,n){return e=rn(6,e,null,t),e.lanes=n,e}function gu(e,t,n){return t=rn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ik(e,t,n,r,i){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=Yo(0),this.expirationTimes=Yo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yo(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function lh(e,t,n,r,i,l,a,o,u){return e=new ik(e,t,n,o,u),t===1?(t=1,l===!0&&(t|=8)):t=0,l=rn(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Hd(l),e}function lk(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ns,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function ay(e){if(!e)return jr;e=e._reactInternals;e:{if(us(e)!==e||e.tag!==1)throw Error(K(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(_t(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(K(171))}if(e.tag===1){var n=e.type;if(_t(n))return ax(e,n,t)}return t}function oy(e,t,n,r,i,l,a,o,u){return e=lh(n,r,!0,e,i,l,a,o,u),e.context=ay(null),n=e.current,r=Pt(),i=xr(n),l=Un(r,i),l.callback=t??null,mr(n,l,i),e.current.lanes=i,xl(e,i,r),Ot(e,r),e}function So(e,t,n,r){var i=t.current,l=Pt(),a=xr(i);return n=ay(n),t.context===null?t.context=n:t.pendingContext=n,t=Un(l,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=mr(i,t,a),e!==null&&(xn(e,i,a,l),ma(e,i,a)),a}function Ya(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 dp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ah(e,t){dp(e,t),(e=e.alternate)&&dp(e,t)}function ak(){return null}var uy=typeof reportError=="function"?reportError:function(e){console.error(e)};function oh(e){this._internalRoot=e}No.prototype.render=oh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(K(409));So(e,t,null,null)};No.prototype.unmount=oh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ss(function(){So(null,e,null,null)}),t[Wn]=null}};function No(e){this._internalRoot=e}No.prototype.unstable_scheduleHydration=function(e){if(e){var t=Fg();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ir.length&&t!==0&&t<ir[n].priority;n++);ir.splice(n,0,e),n===0&&Bg(e)}};function uh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Co(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function hp(){}function ok(e,t,n,r,i){if(i){if(typeof r=="function"){var l=r;r=function(){var c=Ya(a);l.call(c)}}var a=oy(t,r,e,0,null,!1,!1,"",hp);return e._reactRootContainer=a,e[Wn]=a.current,nl(e.nodeType===8?e.parentNode:e),ss(),a}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var o=r;r=function(){var c=Ya(u);o.call(c)}}var u=lh(e,0,!1,null,null,!1,!1,"",hp);return e._reactRootContainer=u,e[Wn]=u.current,nl(e.nodeType===8?e.parentNode:e),ss(function(){So(t,u,n,r)}),u}function Eo(e,t,n,r,i){var l=n._reactRootContainer;if(l){var a=l;if(typeof i=="function"){var o=i;i=function(){var u=Ya(a);o.call(u)}}So(t,a,e,i)}else a=ok(n,t,e,i,r);return Ya(a)}_g=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ai(t.pendingLanes);n!==0&&(Td(t,n|1),Ot(t,et()),!(Re&6)&&(Js=et()+500,Tr()))}break;case 13:ss(function(){var r=Vn(e,1);if(r!==null){var i=Pt();xn(r,e,1,i)}}),ah(e,1)}};Pd=function(e){if(e.tag===13){var t=Vn(e,134217728);if(t!==null){var n=Pt();xn(t,e,134217728,n)}ah(e,134217728)}};Og=function(e){if(e.tag===13){var t=xr(e),n=Vn(e,t);if(n!==null){var r=Pt();xn(n,e,t,r)}ah(e,t)}};Fg=function(){return ze};Ug=function(e,t){var n=ze;try{return ze=e,t()}finally{ze=n}};sc=function(e,t,n){switch(t){case"input":if(Ju(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 r=n[t];if(r!==e&&r.form===e.form){var i=xo(r);if(!i)throw Error(K(90));yg(r),Ju(r,i)}}}break;case"textarea":jg(e,n);break;case"select":t=n.value,t!=null&&_s(e,!!n.multiple,t,!1)}};Eg=nh;Tg=ss;var uk={usingClientEntryPoint:!1,Events:[vl,Rs,xo,Ng,Cg,nh]},wi={findFiberByHostInstance:Qr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ck={bundleType:wi.bundleType,version:wi.version,rendererPackageName:wi.rendererPackageName,rendererConfig:wi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:qn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Lg(e),e===null?null:e.stateNode},findFiberByHostInstance:wi.findFiberByHostInstance||ak,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 Zl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zl.isDisabled&&Zl.supportsFiber)try{fo=Zl.inject(ck),Rn=Zl}catch{}}Jt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=uk;Jt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!uh(t))throw Error(K(200));return lk(e,t,null,n)};Jt.createRoot=function(e,t){if(!uh(e))throw Error(K(299));var n=!1,r="",i=uy;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,!1,r,i),e[Wn]=t.current,nl(e.nodeType===8?e.parentNode:e),new oh(t)};Jt.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(K(188)):(e=Object.keys(e).join(","),Error(K(268,e)));return e=Lg(t),e=e===null?null:e.stateNode,e};Jt.flushSync=function(e){return ss(e)};Jt.hydrate=function(e,t,n){if(!Co(t))throw Error(K(200));return Eo(null,e,t,!0,n)};Jt.hydrateRoot=function(e,t,n){if(!uh(e))throw Error(K(405));var r=n!=null&&n.hydratedSources||null,i=!1,l="",a=uy;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=oy(t,null,e,1,n??null,i,!1,l,a),e[Wn]=t.current,nl(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new No(t)};Jt.render=function(e,t,n){if(!Co(t))throw Error(K(200));return Eo(null,e,t,!1,n)};Jt.unmountComponentAtNode=function(e){if(!Co(e))throw Error(K(40));return e._reactRootContainer?(ss(function(){Eo(null,null,e,!1,function(){e._reactRootContainer=null,e[Wn]=null})}),!0):!1};Jt.unstable_batchedUpdates=nh;Jt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Co(n))throw Error(K(200));if(e==null||e._reactInternals===void 0)throw Error(K(38));return Eo(e,t,n,!1,r)};Jt.version="18.3.1-next-f1338f8080-20240426";function cy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(cy)}catch(e){console.error(e)}}cy(),cg.exports=Jt;var Pr=cg.exports;const dk=md(Pr),hk=Xm({__proto__:null,default:dk},[Pr]);var dy,fp=Pr;dy=fp.createRoot,fp.hydrateRoot;/**
40
+ `+l.stack}return{value:e,source:t,stack:i,digest:null}}function pu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Sc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var V1=typeof WeakMap=="function"?WeakMap:Map;function Fx(e,t,n){n=Un(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){qa||(qa=!0,Dc=r),Sc(e,t)},n}function Ux(e,t,n){n=Un(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Sc(e,t)}}var l=e.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(n.callback=function(){Sc(e,t),typeof r!="function"&&(xr===null?xr=new Set([this]):xr.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function Jf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new V1;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=ik.bind(null,e,t,n),t.then(e,e))}function Xf(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 Zf(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,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=Un(-1,1),t.tag=2,gr(n,t,1))),n.lanes|=1),e)}var Q1=Gn.ReactCurrentOwner,Mt=!1;function Tt(e,t,n,r){t.child=e===null?gx(t,null,n,r):Ks(t,e.child,n,r)}function ep(e,t,n,r,i){n=n.render;var l=t.ref;return Hs(t,i),r=Kd(e,t,n,r,l,i),n=Yd(),e!==null&&!Mt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Qn(e,t,i)):(Qe&&n&&$d(t),t.flags|=1,Tt(e,t,r,i),t.child)}function tp(e,t,n,r,i){if(e===null){var l=n.type;return typeof l=="function"&&!lh(l)&&l.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=l,Bx(e,t,l,r,i)):(e=wa(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!(e.lanes&i)){var a=l.memoizedProps;if(n=n.compare,n=n!==null?n:tl,n(a,r)&&e.ref===t.ref)return Qn(e,t,i)}return t.flags|=1,e=vr(l,r),e.ref=t.ref,e.return=t,t.child=e}function Bx(e,t,n,r,i){if(e!==null){var l=e.memoizedProps;if(tl(l,r)&&e.ref===t.ref)if(Mt=!1,t.pendingProps=r=l,(e.lanes&i)!==0)e.flags&131072&&(Mt=!0);else return t.lanes=e.lanes,Qn(e,t,i)}return Nc(e,t,n,r,i)}function Hx(e,t,n){var r=t.pendingProps,i=r.children,l=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Be($s,Wt),Wt|=n;else{if(!(n&1073741824))return e=l!==null?l.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Be($s,Wt),Wt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=l!==null?l.baseLanes:n,Be($s,Wt),Wt|=r}else l!==null?(r=l.baseLanes|n,t.memoizedState=null):r=n,Be($s,Wt),Wt|=r;return Tt(e,t,i,n),t.child}function Wx(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Nc(e,t,n,r,i){var l=_t(n)?ts:Et.current;return l=qs(t,l),Hs(t,i),n=Kd(e,t,n,r,l,i),r=Yd(),e!==null&&!Mt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Qn(e,t,i)):(Qe&&r&&$d(t),t.flags|=1,Tt(e,t,n,i),t.child)}function np(e,t,n,r,i){if(_t(n)){var l=!0;$a(t)}else l=!1;if(Hs(t,i),t.stateNode===null)ya(e,t),Ox(t,n,r),bc(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,o=t.memoizedProps;a.props=o;var u=a.context,c=n.contextType;typeof c=="object"&&c!==null?c=an(c):(c=_t(n)?ts:Et.current,c=qs(t,c));var h=n.getDerivedStateFromProps,d=typeof h=="function"||typeof a.getSnapshotBeforeUpdate=="function";d||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||u!==c)&&Yf(t,a,r,c),ir=!1;var f=t.memoizedState;a.state=f,Ba(t,r,a,i),u=t.memoizedState,o!==r||f!==u||$t.current||ir?(typeof h=="function"&&(kc(t,n,h,r),u=t.memoizedState),(o=ir||Kf(t,n,o,r,f,u,c))?(d||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),a.props=r,a.state=u,a.context=c,r=o):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,yx(e,t),o=t.memoizedProps,c=t.type===t.elementType?o:fn(t.type,o),a.props=c,d=t.pendingProps,f=a.context,u=n.contextType,typeof u=="object"&&u!==null?u=an(u):(u=_t(n)?ts:Et.current,u=qs(t,u));var m=n.getDerivedStateFromProps;(h=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==d||f!==u)&&Yf(t,a,r,u),ir=!1,f=t.memoizedState,a.state=f,Ba(t,r,a,i);var p=t.memoizedState;o!==d||f!==p||$t.current||ir?(typeof m=="function"&&(kc(t,n,m,r),p=t.memoizedState),(c=ir||Kf(t,n,c,r,f,p,u)||!1)?(h||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,p,u),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,p,u)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=u,r=c):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Cc(e,t,n,r,l,i)}function Cc(e,t,n,r,i,l){Wx(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&Uf(t,n,!1),Qn(e,t,l);r=t.stateNode,Q1.current=t;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Ks(t,e.child,null,l),t.child=Ks(t,null,o,l)):Tt(e,t,o,l),t.memoizedState=r.state,i&&Uf(t,n,!0),t.child}function Vx(e){var t=e.stateNode;t.pendingContext?Ff(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ff(e,t.context,!1),Vd(e,t.containerInfo)}function rp(e,t,n,r,i){return Gs(),Od(i),t.flags|=256,Tt(e,t,n,r),t.child}var Ec={dehydrated:null,treeContext:null,retryLane:0};function Tc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Qx(e,t,n){var r=t.pendingProps,i=qe.current,l=!1,a=(t.flags&128)!==0,o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:(i&2)!==0),o?(l=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Be(qe,i&1),e===null)return jc(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):(a=r.children,e=r.fallback,l?(r=t.mode,l=t.child,a={mode:"hidden",children:a},!(r&1)&&l!==null?(l.childLanes=0,l.pendingProps=a):l=bo(a,r,0,null),e=Zr(e,r,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=Tc(n),t.memoizedState=Ec,e):Zd(t,a));if(i=e.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return q1(e,t,a,r,o,i,n);if(l){l=r.fallback,a=t.mode,i=e.child,o=i.sibling;var u={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=vr(i,u),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?l=vr(o,l):(l=Zr(l,a,n,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,r=l,l=t.child,a=e.child.memoizedState,a=a===null?Tc(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},l.memoizedState=a,l.childLanes=e.childLanes&~n,t.memoizedState=Ec,r}return l=e.child,e=l.sibling,r=vr(l,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Zd(e,t){return t=bo({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Yl(e,t,n,r){return r!==null&&Od(r),Ks(t,e.child,null,n),e=Zd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function q1(e,t,n,r,i,l,a){if(n)return t.flags&256?(t.flags&=-257,r=pu(Error(K(422))),Yl(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(l=r.fallback,i=t.mode,r=bo({mode:"visible",children:r.children},i,0,null),l=Zr(l,i,a,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,t.mode&1&&Ks(t,e.child,null,a),t.child.memoizedState=Tc(a),t.memoizedState=Ec,l);if(!(t.mode&1))return Yl(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,l=Error(K(419)),r=pu(l,r,void 0),Yl(e,t,a,r)}if(o=(a&e.childLanes)!==0,Mt||o){if(r=ht,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==l.retryLane&&(l.retryLane=i,Vn(e,i),yn(r,e,i,-1))}return ih(),r=pu(Error(K(421))),Yl(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=lk.bind(null,e),i._reactRetry=t,null):(e=l.treeContext,Qt=mr(i.nextSibling),Gt=t,Qe=!0,gn=null,e!==null&&(en[tn++]=On,en[tn++]=Fn,en[tn++]=ns,On=e.id,Fn=e.overflow,ns=t),t=Zd(t,r.children),t.flags|=4096,t)}function sp(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),wc(e.return,t,n)}function mu(e,t,n,r,i){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=r,l.tail=n,l.tailMode=i)}function qx(e,t,n){var r=t.pendingProps,i=r.revealOrder,l=r.tail;if(Tt(e,t,r.children,n),r=qe.current,r&2)r=r&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&&sp(e,n,t);else if(e.tag===19)sp(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}r&=1}if(Be(qe,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Ha(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),mu(t,!1,i,n,l);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ha(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}mu(t,!0,n,null,l);break;case"together":mu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ya(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Qn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ss|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(K(153));if(t.child!==null){for(e=t.child,n=vr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=vr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function G1(e,t,n){switch(t.tag){case 3:Vx(t),Gs();break;case 5:vx(t);break;case 1:_t(t.type)&&$a(t);break;case 4:Vd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Be(Fa,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Be(qe,qe.current&1),t.flags|=128,null):n&t.child.childLanes?Qx(e,t,n):(Be(qe,qe.current&1),e=Qn(e,t,n),e!==null?e.sibling:null);Be(qe,qe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return qx(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Be(qe,qe.current),r)break;return null;case 22:case 23:return t.lanes=0,Hx(e,t,n)}return Qn(e,t,n)}var Gx,Pc,Kx,Yx;Gx=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}};Pc=function(){};Kx=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Kr(Ln.current);var l=null;switch(n){case"input":i=Ju(e,i),r=Ju(e,r),l=[];break;case"select":i=Ke({},i,{value:void 0}),r=Ke({},r,{value:void 0}),l=[];break;case"textarea":i=ec(e,i),r=ec(e,r),l=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=za)}nc(n,r);var a;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var o=i[c];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Gi.hasOwnProperty(c)?l||(l=[]):(l=l||[]).push(c,null));for(c in r){var u=r[c];if(o=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&u!==o&&(u!=null||o!=null))if(c==="style")if(o){for(a in o)!o.hasOwnProperty(a)||u&&u.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in u)u.hasOwnProperty(a)&&o[a]!==u[a]&&(n||(n={}),n[a]=u[a])}else n||(l||(l=[]),l.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,o=o?o.__html:void 0,u!=null&&o!==u&&(l=l||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(l=l||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Gi.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&He("scroll",e),l||o===u||(l=[])):(l=l||[]).push(c,u))}n&&(l=l||[]).push("style",n);var c=l;(t.updateQueue=c)&&(t.flags|=4)}};Yx=function(e,t,n,r){n!==r&&(t.flags|=4)};function ji(e,t){if(!Qe)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 r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Nt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function K1(e,t,n){var r=t.pendingProps;switch(_d(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nt(t),null;case 1:return _t(t.type)&&Ma(),Nt(t),null;case 3:return r=t.stateNode,Ys(),We($t),We(Et),qd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Gl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,gn!==null&&($c(gn),gn=null))),Pc(e,t),Nt(t),null;case 5:Qd(t);var i=Kr(ll.current);if(n=t.type,e!==null&&t.stateNode!=null)Kx(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(K(166));return Nt(t),null}if(e=Kr(Ln.current),Gl(t)){r=t.stateNode,n=t.type;var l=t.memoizedProps;switch(r[Tn]=t,r[sl]=l,e=(t.mode&1)!==0,n){case"dialog":He("cancel",r),He("close",r);break;case"iframe":case"object":case"embed":He("load",r);break;case"video":case"audio":for(i=0;i<Ii.length;i++)He(Ii[i],r);break;case"source":He("error",r);break;case"img":case"image":case"link":He("error",r),He("load",r);break;case"details":He("toggle",r);break;case"input":ff(r,l),He("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!l.multiple},He("invalid",r);break;case"textarea":mf(r,l),He("invalid",r)}nc(n,l),i=null;for(var a in l)if(l.hasOwnProperty(a)){var o=l[a];a==="children"?typeof o=="string"?r.textContent!==o&&(l.suppressHydrationWarning!==!0&&ql(r.textContent,o,e),i=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(l.suppressHydrationWarning!==!0&&ql(r.textContent,o,e),i=["children",""+o]):Gi.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&He("scroll",r)}switch(n){case"input":Ol(r),pf(r,l,!0);break;case"textarea":Ol(r),gf(r);break;case"select":case"option":break;default:typeof l.onClick=="function"&&(r.onclick=za)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Sg(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Tn]=t,e[sl]=r,Gx(e,t,!1,!1),t.stateNode=e;e:{switch(a=rc(n,r),n){case"dialog":He("cancel",e),He("close",e),i=r;break;case"iframe":case"object":case"embed":He("load",e),i=r;break;case"video":case"audio":for(i=0;i<Ii.length;i++)He(Ii[i],e);i=r;break;case"source":He("error",e),i=r;break;case"img":case"image":case"link":He("error",e),He("load",e),i=r;break;case"details":He("toggle",e),i=r;break;case"input":ff(e,r),i=Ju(e,r),He("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Ke({},r,{value:void 0}),He("invalid",e);break;case"textarea":mf(e,r),i=ec(e,r),He("invalid",e);break;default:i=r}nc(n,i),o=i;for(l in o)if(o.hasOwnProperty(l)){var u=o[l];l==="style"?Eg(e,u):l==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&Ng(e,u)):l==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&Ki(e,u):typeof u=="number"&&Ki(e,""+u):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(Gi.hasOwnProperty(l)?u!=null&&l==="onScroll"&&He("scroll",e):u!=null&&bd(e,l,u,a))}switch(n){case"input":Ol(e),pf(e,r,!1);break;case"textarea":Ol(e),gf(e);break;case"option":r.value!=null&&e.setAttribute("value",""+jr(r.value));break;case"select":e.multiple=!!r.multiple,l=r.value,l!=null?Os(e,!!r.multiple,l,!1):r.defaultValue!=null&&Os(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=za)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Nt(t),null;case 6:if(e&&t.stateNode!=null)Yx(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(K(166));if(n=Kr(ll.current),Kr(Ln.current),Gl(t)){if(r=t.stateNode,n=t.memoizedProps,r[Tn]=t,(l=r.nodeValue!==n)&&(e=Gt,e!==null))switch(e.tag){case 3:ql(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ql(r.nodeValue,n,(e.mode&1)!==0)}l&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Tn]=t,t.stateNode=r}return Nt(t),null;case 13:if(We(qe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Qe&&Qt!==null&&t.mode&1&&!(t.flags&128))px(),Gs(),t.flags|=98560,l=!1;else if(l=Gl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!l)throw Error(K(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(K(317));l[Tn]=t}else Gs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Nt(t),l=!1}else gn!==null&&($c(gn),gn=null),l=!0;if(!l)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||qe.current&1?at===0&&(at=3):ih())),t.updateQueue!==null&&(t.flags|=4),Nt(t),null);case 4:return Ys(),Pc(e,t),e===null&&nl(t.stateNode.containerInfo),Nt(t),null;case 10:return Bd(t.type._context),Nt(t),null;case 17:return _t(t.type)&&Ma(),Nt(t),null;case 19:if(We(qe),l=t.memoizedState,l===null)return Nt(t),null;if(r=(t.flags&128)!==0,a=l.rendering,a===null)if(r)ji(l,!1);else{if(at!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Ha(e),a!==null){for(t.flags|=128,ji(l,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)l=n,e=r,l.flags&=14680066,a=l.alternate,a===null?(l.childLanes=0,l.lanes=e,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=a.childLanes,l.lanes=a.lanes,l.child=a.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=a.memoizedProps,l.memoizedState=a.memoizedState,l.updateQueue=a.updateQueue,l.type=a.type,e=a.dependencies,l.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Be(qe,qe.current&1|2),t.child}e=e.sibling}l.tail!==null&&et()>Xs&&(t.flags|=128,r=!0,ji(l,!1),t.lanes=4194304)}else{if(!r)if(e=Ha(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ji(l,!0),l.tail===null&&l.tailMode==="hidden"&&!a.alternate&&!Qe)return Nt(t),null}else 2*et()-l.renderingStartTime>Xs&&n!==1073741824&&(t.flags|=128,r=!0,ji(l,!1),t.lanes=4194304);l.isBackwards?(a.sibling=t.child,t.child=a):(n=l.last,n!==null?n.sibling=a:t.child=a,l.last=a)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=et(),t.sibling=null,n=qe.current,Be(qe,r?n&1|2:n&1),t):(Nt(t),null);case 22:case 23:return sh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Wt&1073741824&&(Nt(t),t.subtreeFlags&6&&(t.flags|=8192)):Nt(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function Y1(e,t){switch(_d(t),t.tag){case 1:return _t(t.type)&&Ma(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ys(),We($t),We(Et),qd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Qd(t),null;case 13:if(We(qe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));Gs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return We(qe),null;case 4:return Ys(),null;case 10:return Bd(t.type._context),null;case 22:case 23:return sh(),null;case 24:return null;default:return null}}var Jl=!1,Ct=!1,J1=typeof WeakSet=="function"?WeakSet:Set,te=null;function Ms(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Xe(e,t,r)}else n.current=null}function Rc(e,t,n){try{n()}catch(r){Xe(e,t,r)}}var ip=!1;function X1(e,t){if(fc=Aa,e=tx(),Md(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var a=0,o=-1,u=-1,c=0,h=0,d=e,f=null;t:for(;;){for(var m;d!==n||i!==0&&d.nodeType!==3||(o=a+i),d!==l||r!==0&&d.nodeType!==3||(u=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(m=d.firstChild)!==null;)f=d,d=m;for(;;){if(d===e)break t;if(f===n&&++c===i&&(o=a),f===l&&++h===r&&(u=a),(m=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=m}n=o===-1||u===-1?null:{start:o,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(pc={focusedElem:e,selectionRange:n},Aa=!1,te=t;te!==null;)if(t=te,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,te=e;else for(;te!==null;){t=te;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var g=p.memoizedProps,w=p.memoizedState,y=t.stateNode,x=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:fn(t.type,g),w);y.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(b){Xe(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,te=e;break}te=t.return}return p=ip,ip=!1,p}function Ui(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var l=i.destroy;i.destroy=void 0,l!==void 0&&Rc(t,n,l)}i=i.next}while(i!==r)}}function wo(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 r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Lc(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 Jx(e){var t=e.alternate;t!==null&&(e.alternate=null,Jx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Tn],delete t[sl],delete t[xc],delete t[D1],delete t[z1])),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 Xx(e){return e.tag===5||e.tag===3||e.tag===4}function lp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xx(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 Ac(e,t,n){var r=e.tag;if(r===5||r===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=za));else if(r!==4&&(e=e.child,e!==null))for(Ac(e,t,n),e=e.sibling;e!==null;)Ac(e,t,n),e=e.sibling}function Ic(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ic(e,t,n),e=e.sibling;e!==null;)Ic(e,t,n),e=e.sibling}var xt=null,pn=!1;function tr(e,t,n){for(n=n.child;n!==null;)Zx(e,t,n),n=n.sibling}function Zx(e,t,n){if(Rn&&typeof Rn.onCommitFiberUnmount=="function")try{Rn.onCommitFiberUnmount(fo,n)}catch{}switch(n.tag){case 5:Ct||Ms(n,t);case 6:var r=xt,i=pn;xt=null,tr(e,t,n),xt=r,pn=i,xt!==null&&(pn?(e=xt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):xt.removeChild(n.stateNode));break;case 18:xt!==null&&(pn?(e=xt,n=n.stateNode,e.nodeType===8?ou(e.parentNode,n):e.nodeType===1&&ou(e,n),Zi(e)):ou(xt,n.stateNode));break;case 4:r=xt,i=pn,xt=n.stateNode.containerInfo,pn=!0,tr(e,t,n),xt=r,pn=i;break;case 0:case 11:case 14:case 15:if(!Ct&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var l=i,a=l.destroy;l=l.tag,a!==void 0&&(l&2||l&4)&&Rc(n,t,a),i=i.next}while(i!==r)}tr(e,t,n);break;case 1:if(!Ct&&(Ms(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){Xe(n,t,o)}tr(e,t,n);break;case 21:tr(e,t,n);break;case 22:n.mode&1?(Ct=(r=Ct)||n.memoizedState!==null,tr(e,t,n),Ct=r):tr(e,t,n);break;default:tr(e,t,n)}}function ap(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new J1),t.forEach(function(r){var i=ak.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function hn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var l=e,a=t,o=a;e:for(;o!==null;){switch(o.tag){case 5:xt=o.stateNode,pn=!1;break e;case 3:xt=o.stateNode.containerInfo,pn=!0;break e;case 4:xt=o.stateNode.containerInfo,pn=!0;break e}o=o.return}if(xt===null)throw Error(K(160));Zx(l,a,i),xt=null,pn=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(c){Xe(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ey(t,e),t=t.sibling}function ey(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(hn(t,e),Nn(e),r&4){try{Ui(3,e,e.return),wo(3,e)}catch(g){Xe(e,e.return,g)}try{Ui(5,e,e.return)}catch(g){Xe(e,e.return,g)}}break;case 1:hn(t,e),Nn(e),r&512&&n!==null&&Ms(n,n.return);break;case 5:if(hn(t,e),Nn(e),r&512&&n!==null&&Ms(n,n.return),e.flags&32){var i=e.stateNode;try{Ki(i,"")}catch(g){Xe(e,e.return,g)}}if(r&4&&(i=e.stateNode,i!=null)){var l=e.memoizedProps,a=n!==null?n.memoizedProps:l,o=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{o==="input"&&l.type==="radio"&&l.name!=null&&kg(i,l),rc(o,a);var c=rc(o,l);for(a=0;a<u.length;a+=2){var h=u[a],d=u[a+1];h==="style"?Eg(i,d):h==="dangerouslySetInnerHTML"?Ng(i,d):h==="children"?Ki(i,d):bd(i,h,d,c)}switch(o){case"input":Xu(i,l);break;case"textarea":bg(i,l);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!l.multiple;var m=l.value;m!=null?Os(i,!!l.multiple,m,!1):f!==!!l.multiple&&(l.defaultValue!=null?Os(i,!!l.multiple,l.defaultValue,!0):Os(i,!!l.multiple,l.multiple?[]:"",!1))}i[sl]=l}catch(g){Xe(e,e.return,g)}}break;case 6:if(hn(t,e),Nn(e),r&4){if(e.stateNode===null)throw Error(K(162));i=e.stateNode,l=e.memoizedProps;try{i.nodeValue=l}catch(g){Xe(e,e.return,g)}}break;case 3:if(hn(t,e),Nn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Zi(t.containerInfo)}catch(g){Xe(e,e.return,g)}break;case 4:hn(t,e),Nn(e);break;case 13:hn(t,e),Nn(e),i=e.child,i.flags&8192&&(l=i.memoizedState!==null,i.stateNode.isHidden=l,!l||i.alternate!==null&&i.alternate.memoizedState!==null||(nh=et())),r&4&&ap(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(Ct=(c=Ct)||h,hn(t,e),Ct=c):hn(t,e),Nn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!h&&e.mode&1)for(te=e,h=e.child;h!==null;){for(d=te=h;te!==null;){switch(f=te,m=f.child,f.tag){case 0:case 11:case 14:case 15:Ui(4,f,f.return);break;case 1:Ms(f,f.return);var p=f.stateNode;if(typeof p.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(g){Xe(r,n,g)}}break;case 5:Ms(f,f.return);break;case 22:if(f.memoizedState!==null){up(d);continue}}m!==null?(m.return=f,te=m):up(d)}h=h.sibling}e:for(h=null,d=e;;){if(d.tag===5){if(h===null){h=d;try{i=d.stateNode,c?(l=i.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"):(o=d.stateNode,u=d.memoizedProps.style,a=u!=null&&u.hasOwnProperty("display")?u.display:null,o.style.display=Cg("display",a))}catch(g){Xe(e,e.return,g)}}}else if(d.tag===6){if(h===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(g){Xe(e,e.return,g)}}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;h===d&&(h=null),d=d.return}h===d&&(h=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:hn(t,e),Nn(e),r&4&&ap(e);break;case 21:break;default:hn(t,e),Nn(e)}}function Nn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Xx(n)){var r=n;break e}n=n.return}throw Error(K(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Ki(i,""),r.flags&=-33);var l=lp(e);Ic(e,l,i);break;case 3:case 4:var a=r.stateNode.containerInfo,o=lp(e);Ac(e,o,a);break;default:throw Error(K(161))}}catch(u){Xe(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Z1(e,t,n){te=e,ty(e)}function ty(e,t,n){for(var r=(e.mode&1)!==0;te!==null;){var i=te,l=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||Jl;if(!a){var o=i.alternate,u=o!==null&&o.memoizedState!==null||Ct;o=Jl;var c=Ct;if(Jl=a,(Ct=u)&&!c)for(te=i;te!==null;)a=te,u=a.child,a.tag===22&&a.memoizedState!==null?cp(i):u!==null?(u.return=a,te=u):cp(i);for(;l!==null;)te=l,ty(l),l=l.sibling;te=i,Jl=o,Ct=c}op(e)}else i.subtreeFlags&8772&&l!==null?(l.return=i,te=l):op(e)}}function op(e){for(;te!==null;){var t=te;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ct||wo(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ct)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:fn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var l=t.updateQueue;l!==null&&Qf(t,l,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Qf(t,a,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var h=c.memoizedState;if(h!==null){var d=h.dehydrated;d!==null&&Zi(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(K(163))}Ct||t.flags&512&&Lc(t)}catch(f){Xe(t,t.return,f)}}if(t===e){te=null;break}if(n=t.sibling,n!==null){n.return=t.return,te=n;break}te=t.return}}function up(e){for(;te!==null;){var t=te;if(t===e){te=null;break}var n=t.sibling;if(n!==null){n.return=t.return,te=n;break}te=t.return}}function cp(e){for(;te!==null;){var t=te;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{wo(4,t)}catch(u){Xe(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(u){Xe(t,i,u)}}var l=t.return;try{Lc(t)}catch(u){Xe(t,l,u)}break;case 5:var a=t.return;try{Lc(t)}catch(u){Xe(t,a,u)}}}catch(u){Xe(t,t.return,u)}if(t===e){te=null;break}var o=t.sibling;if(o!==null){o.return=t.return,te=o;break}te=t.return}}var ek=Math.ceil,Qa=Gn.ReactCurrentDispatcher,eh=Gn.ReactCurrentOwner,ln=Gn.ReactCurrentBatchConfig,Re=0,ht=null,it=null,wt=0,Wt=0,$s=Er(0),at=0,cl=null,ss=0,ko=0,th=0,Bi=null,zt=null,nh=0,Xs=1/0,$n=null,qa=!1,Dc=null,xr=null,Xl=!1,ur=null,Ga=0,Hi=0,zc=null,va=-1,ja=0;function Pt(){return Re&6?et():va!==-1?va:va=et()}function yr(e){return e.mode&1?Re&2&&wt!==0?wt&-wt:$1.transition!==null?(ja===0&&(ja=Og()),ja):(e=ze,e!==0||(e=window.event,e=e===void 0?16:Qg(e.type)),e):1}function yn(e,t,n,r){if(50<Hi)throw Hi=0,zc=null,Error(K(185));xl(e,n,r),(!(Re&2)||e!==ht)&&(e===ht&&(!(Re&2)&&(ko|=n),at===4&&ar(e,wt)),Ot(e,r),n===1&&Re===0&&!(t.mode&1)&&(Xs=et()+500,yo&&Tr()))}function Ot(e,t){var n=e.callbackNode;$w(e,t);var r=La(e,e===ht?wt:0);if(r===0)n!==null&&vf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&vf(n),t===1)e.tag===0?M1(dp.bind(null,e)):dx(dp.bind(null,e)),A1(function(){!(Re&6)&&Tr()}),n=null;else{switch(Fg(r)){case 1:n=Td;break;case 4:n=$g;break;case 16:n=Ra;break;case 536870912:n=_g;break;default:n=Ra}n=uy(n,ny.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ny(e,t){if(va=-1,ja=0,Re&6)throw Error(K(327));var n=e.callbackNode;if(Ws()&&e.callbackNode!==n)return null;var r=La(e,e===ht?wt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ka(e,r);else{t=r;var i=Re;Re|=2;var l=sy();(ht!==e||wt!==t)&&($n=null,Xs=et()+500,Xr(e,t));do try{rk();break}catch(o){ry(e,o)}while(!0);Ud(),Qa.current=l,Re=i,it!==null?t=0:(ht=null,wt=0,t=at)}if(t!==0){if(t===2&&(i=oc(e),i!==0&&(r=i,t=Mc(e,i))),t===1)throw n=cl,Xr(e,0),ar(e,r),Ot(e,et()),n;if(t===6)ar(e,r);else{if(i=e.current.alternate,!(r&30)&&!tk(i)&&(t=Ka(e,r),t===2&&(l=oc(e),l!==0&&(r=l,t=Mc(e,l))),t===1))throw n=cl,Xr(e,0),ar(e,r),Ot(e,et()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(K(345));case 2:Hr(e,zt,$n);break;case 3:if(ar(e,r),(r&130023424)===r&&(t=nh+500-et(),10<t)){if(La(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Pt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=gc(Hr.bind(null,e,zt,$n),t);break}Hr(e,zt,$n);break;case 4:if(ar(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-xn(r);l=1<<a,a=t[a],a>i&&(i=a),r&=~l}if(r=i,r=et()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ek(r/1960))-r,10<r){e.timeoutHandle=gc(Hr.bind(null,e,zt,$n),r);break}Hr(e,zt,$n);break;case 5:Hr(e,zt,$n);break;default:throw Error(K(329))}}}return Ot(e,et()),e.callbackNode===n?ny.bind(null,e):null}function Mc(e,t){var n=Bi;return e.current.memoizedState.isDehydrated&&(Xr(e,t).flags|=256),e=Ka(e,t),e!==2&&(t=zt,zt=n,t!==null&&$c(t)),e}function $c(e){zt===null?zt=e:zt.push.apply(zt,e)}function tk(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],l=i.getSnapshot;i=i.value;try{if(!wn(l(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ar(e,t){for(t&=~th,t&=~ko,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-xn(t),r=1<<n;e[n]=-1,t&=~r}}function dp(e){if(Re&6)throw Error(K(327));Ws();var t=La(e,0);if(!(t&1))return Ot(e,et()),null;var n=Ka(e,t);if(e.tag!==0&&n===2){var r=oc(e);r!==0&&(t=r,n=Mc(e,r))}if(n===1)throw n=cl,Xr(e,0),ar(e,t),Ot(e,et()),n;if(n===6)throw Error(K(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Hr(e,zt,$n),Ot(e,et()),null}function rh(e,t){var n=Re;Re|=1;try{return e(t)}finally{Re=n,Re===0&&(Xs=et()+500,yo&&Tr())}}function is(e){ur!==null&&ur.tag===0&&!(Re&6)&&Ws();var t=Re;Re|=1;var n=ln.transition,r=ze;try{if(ln.transition=null,ze=1,e)return e()}finally{ze=r,ln.transition=n,Re=t,!(Re&6)&&Tr()}}function sh(){Wt=$s.current,We($s)}function Xr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,L1(n)),it!==null)for(n=it.return;n!==null;){var r=n;switch(_d(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ma();break;case 3:Ys(),We($t),We(Et),qd();break;case 5:Qd(r);break;case 4:Ys();break;case 13:We(qe);break;case 19:We(qe);break;case 10:Bd(r.type._context);break;case 22:case 23:sh()}n=n.return}if(ht=e,it=e=vr(e.current,null),wt=Wt=t,at=0,cl=null,th=ko=ss=0,zt=Bi=null,Gr!==null){for(t=0;t<Gr.length;t++)if(n=Gr[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,l=n.pending;if(l!==null){var a=l.next;l.next=i,r.next=a}n.pending=r}Gr=null}return e}function ry(e,t){do{var n=it;try{if(Ud(),ga.current=Va,Wa){for(var r=Ge.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Wa=!1}if(rs=0,dt=lt=Ge=null,Fi=!1,al=0,eh.current=null,n===null||n.return===null){at=1,cl=t,it=null;break}e:{var l=e,a=n.return,o=n,u=t;if(t=wt,o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,h=o,d=h.tag;if(!(h.mode&1)&&(d===0||d===11||d===15)){var f=h.alternate;f?(h.updateQueue=f.updateQueue,h.memoizedState=f.memoizedState,h.lanes=f.lanes):(h.updateQueue=null,h.memoizedState=null)}var m=Xf(a);if(m!==null){m.flags&=-257,Zf(m,a,o,l,t),m.mode&1&&Jf(l,c,t),t=m,u=c;var p=t.updateQueue;if(p===null){var g=new Set;g.add(u),t.updateQueue=g}else p.add(u);break e}else{if(!(t&1)){Jf(l,c,t),ih();break e}u=Error(K(426))}}else if(Qe&&o.mode&1){var w=Xf(a);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Zf(w,a,o,l,t),Od(Js(u,o));break e}}l=u=Js(u,o),at!==4&&(at=2),Bi===null?Bi=[l]:Bi.push(l),l=a;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t;var y=Fx(l,u,t);Vf(l,y);break e;case 1:o=u;var x=l.type,v=l.stateNode;if(!(l.flags&128)&&(typeof x.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(xr===null||!xr.has(v)))){l.flags|=65536,t&=-t,l.lanes|=t;var b=Ux(l,o,t);Vf(l,b);break e}}l=l.return}while(l!==null)}ly(n)}catch(A){t=A,it===n&&n!==null&&(it=n=n.return);continue}break}while(!0)}function sy(){var e=Qa.current;return Qa.current=Va,e===null?Va:e}function ih(){(at===0||at===3||at===2)&&(at=4),ht===null||!(ss&268435455)&&!(ko&268435455)||ar(ht,wt)}function Ka(e,t){var n=Re;Re|=2;var r=sy();(ht!==e||wt!==t)&&($n=null,Xr(e,t));do try{nk();break}catch(i){ry(e,i)}while(!0);if(Ud(),Re=n,Qa.current=r,it!==null)throw Error(K(261));return ht=null,wt=0,at}function nk(){for(;it!==null;)iy(it)}function rk(){for(;it!==null&&!Tw();)iy(it)}function iy(e){var t=oy(e.alternate,e,Wt);e.memoizedProps=e.pendingProps,t===null?ly(e):it=t,eh.current=null}function ly(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Y1(n,t),n!==null){n.flags&=32767,it=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{at=6,it=null;return}}else if(n=K1(n,t,Wt),n!==null){it=n;return}if(t=t.sibling,t!==null){it=t;return}it=t=e}while(t!==null);at===0&&(at=5)}function Hr(e,t,n){var r=ze,i=ln.transition;try{ln.transition=null,ze=1,sk(e,t,n,r)}finally{ln.transition=i,ze=r}return null}function sk(e,t,n,r){do Ws();while(ur!==null);if(Re&6)throw Error(K(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(K(177));e.callbackNode=null,e.callbackPriority=0;var l=n.lanes|n.childLanes;if(_w(e,l),e===ht&&(it=ht=null,wt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Xl||(Xl=!0,uy(Ra,function(){return Ws(),null})),l=(n.flags&15990)!==0,n.subtreeFlags&15990||l){l=ln.transition,ln.transition=null;var a=ze;ze=1;var o=Re;Re|=4,eh.current=null,X1(e,n),ey(n,e),S1(pc),Aa=!!fc,pc=fc=null,e.current=n,Z1(n),Pw(),Re=o,ze=a,ln.transition=l}else e.current=n;if(Xl&&(Xl=!1,ur=e,Ga=i),l=e.pendingLanes,l===0&&(xr=null),Aw(n.stateNode),Ot(e,et()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(qa)throw qa=!1,e=Dc,Dc=null,e;return Ga&1&&e.tag!==0&&Ws(),l=e.pendingLanes,l&1?e===zc?Hi++:(Hi=0,zc=e):Hi=0,Tr(),null}function Ws(){if(ur!==null){var e=Fg(Ga),t=ln.transition,n=ze;try{if(ln.transition=null,ze=16>e?16:e,ur===null)var r=!1;else{if(e=ur,ur=null,Ga=0,Re&6)throw Error(K(331));var i=Re;for(Re|=4,te=e.current;te!==null;){var l=te,a=l.child;if(te.flags&16){var o=l.deletions;if(o!==null){for(var u=0;u<o.length;u++){var c=o[u];for(te=c;te!==null;){var h=te;switch(h.tag){case 0:case 11:case 15:Ui(8,h,l)}var d=h.child;if(d!==null)d.return=h,te=d;else for(;te!==null;){h=te;var f=h.sibling,m=h.return;if(Jx(h),h===c){te=null;break}if(f!==null){f.return=m,te=f;break}te=m}}}var p=l.alternate;if(p!==null){var g=p.child;if(g!==null){p.child=null;do{var w=g.sibling;g.sibling=null,g=w}while(g!==null)}}te=l}}if(l.subtreeFlags&2064&&a!==null)a.return=l,te=a;else e:for(;te!==null;){if(l=te,l.flags&2048)switch(l.tag){case 0:case 11:case 15:Ui(9,l,l.return)}var y=l.sibling;if(y!==null){y.return=l.return,te=y;break e}te=l.return}}var x=e.current;for(te=x;te!==null;){a=te;var v=a.child;if(a.subtreeFlags&2064&&v!==null)v.return=a,te=v;else e:for(a=x;te!==null;){if(o=te,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:wo(9,o)}}catch(A){Xe(o,o.return,A)}if(o===a){te=null;break e}var b=o.sibling;if(b!==null){b.return=o.return,te=b;break e}te=o.return}}if(Re=i,Tr(),Rn&&typeof Rn.onPostCommitFiberRoot=="function")try{Rn.onPostCommitFiberRoot(fo,e)}catch{}r=!0}return r}finally{ze=n,ln.transition=t}}return!1}function hp(e,t,n){t=Js(n,t),t=Fx(e,t,1),e=gr(e,t,1),t=Pt(),e!==null&&(xl(e,1,t),Ot(e,t))}function Xe(e,t,n){if(e.tag===3)hp(e,e,n);else for(;t!==null;){if(t.tag===3){hp(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(xr===null||!xr.has(r))){e=Js(n,e),e=Ux(t,e,1),t=gr(t,e,1),e=Pt(),t!==null&&(xl(t,1,e),Ot(t,e));break}}t=t.return}}function ik(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Pt(),e.pingedLanes|=e.suspendedLanes&n,ht===e&&(wt&n)===n&&(at===4||at===3&&(wt&130023424)===wt&&500>et()-nh?Xr(e,0):th|=n),Ot(e,t)}function ay(e,t){t===0&&(e.mode&1?(t=Bl,Bl<<=1,!(Bl&130023424)&&(Bl=4194304)):t=1);var n=Pt();e=Vn(e,t),e!==null&&(xl(e,t,n),Ot(e,n))}function lk(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ay(e,n)}function ak(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(K(314))}r!==null&&r.delete(t),ay(e,n)}var oy;oy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||$t.current)Mt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Mt=!1,G1(e,t,n);Mt=!!(e.flags&131072)}else Mt=!1,Qe&&t.flags&1048576&&hx(t,Oa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ya(e,t),e=t.pendingProps;var i=qs(t,Et.current);Hs(t,n),i=Kd(null,t,r,e,i,n);var l=Yd();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,_t(r)?(l=!0,$a(t)):l=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Wd(t),i.updater=jo,t.stateNode=i,i._reactInternals=t,bc(t,r,e,n),t=Cc(null,t,r,!0,l,n)):(t.tag=0,Qe&&l&&$d(t),Tt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ya(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=uk(r),e=fn(r,e),i){case 0:t=Nc(null,t,r,e,n);break e;case 1:t=np(null,t,r,e,n);break e;case 11:t=ep(null,t,r,e,n);break e;case 14:t=tp(null,t,r,fn(r.type,e),n);break e}throw Error(K(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:fn(r,i),Nc(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:fn(r,i),np(e,t,r,i,n);case 3:e:{if(Vx(t),e===null)throw Error(K(387));r=t.pendingProps,l=t.memoizedState,i=l.element,yx(e,t),Ba(t,r,null,n);var a=t.memoizedState;if(r=a.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){i=Js(Error(K(423)),t),t=rp(e,t,r,n,i);break e}else if(r!==i){i=Js(Error(K(424)),t),t=rp(e,t,r,n,i);break e}else for(Qt=mr(t.stateNode.containerInfo.firstChild),Gt=t,Qe=!0,gn=null,n=gx(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Gs(),r===i){t=Qn(e,t,n);break e}Tt(e,t,r,n)}t=t.child}return t;case 5:return vx(t),e===null&&jc(t),r=t.type,i=t.pendingProps,l=e!==null?e.memoizedProps:null,a=i.children,mc(r,i)?a=null:l!==null&&mc(r,l)&&(t.flags|=32),Wx(e,t),Tt(e,t,a,n),t.child;case 6:return e===null&&jc(t),null;case 13:return Qx(e,t,n);case 4:return Vd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ks(t,null,r,n):Tt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:fn(r,i),ep(e,t,r,i,n);case 7:return Tt(e,t,t.pendingProps,n),t.child;case 8:return Tt(e,t,t.pendingProps.children,n),t.child;case 12:return Tt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,l=t.memoizedProps,a=i.value,Be(Fa,r._currentValue),r._currentValue=a,l!==null)if(wn(l.value,a)){if(l.children===i.children&&!$t.current){t=Qn(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var o=l.dependencies;if(o!==null){a=l.child;for(var u=o.firstContext;u!==null;){if(u.context===r){if(l.tag===1){u=Un(-1,n&-n),u.tag=2;var c=l.updateQueue;if(c!==null){c=c.shared;var h=c.pending;h===null?u.next=u:(u.next=h.next,h.next=u),c.pending=u}}l.lanes|=n,u=l.alternate,u!==null&&(u.lanes|=n),wc(l.return,n,t),o.lanes|=n;break}u=u.next}}else if(l.tag===10)a=l.type===t.type?null:l.child;else if(l.tag===18){if(a=l.return,a===null)throw Error(K(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),wc(a,n,t),a=l.sibling}else a=l.child;if(a!==null)a.return=l;else for(a=l;a!==null;){if(a===t){a=null;break}if(l=a.sibling,l!==null){l.return=a.return,a=l;break}a=a.return}l=a}Tt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Hs(t,n),i=an(i),r=r(i),t.flags|=1,Tt(e,t,r,n),t.child;case 14:return r=t.type,i=fn(r,t.pendingProps),i=fn(r.type,i),tp(e,t,r,i,n);case 15:return Bx(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:fn(r,i),ya(e,t),t.tag=1,_t(r)?(e=!0,$a(t)):e=!1,Hs(t,n),Ox(t,r,i),bc(t,r,i,n),Cc(null,t,r,!0,e,n);case 19:return qx(e,t,n);case 22:return Hx(e,t,n)}throw Error(K(156,t.tag))};function uy(e,t){return Mg(e,t)}function ok(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rn(e,t,n,r){return new ok(e,t,n,r)}function lh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function uk(e){if(typeof e=="function")return lh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Nd)return 11;if(e===Cd)return 14}return 2}function vr(e,t){var n=e.alternate;return n===null?(n=rn(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 wa(e,t,n,r,i,l){var a=2;if(r=e,typeof e=="function")lh(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Es:return Zr(n.children,i,l,t);case Sd:a=8,i|=8;break;case qu:return e=rn(12,n,t,i|2),e.elementType=qu,e.lanes=l,e;case Gu:return e=rn(13,n,t,i),e.elementType=Gu,e.lanes=l,e;case Ku:return e=rn(19,n,t,i),e.elementType=Ku,e.lanes=l,e;case vg:return bo(n,i,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case xg:a=10;break e;case yg:a=9;break e;case Nd:a=11;break e;case Cd:a=14;break e;case sr:a=16,r=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=rn(a,n,t,i),t.elementType=e,t.type=r,t.lanes=l,t}function Zr(e,t,n,r){return e=rn(7,e,r,t),e.lanes=n,e}function bo(e,t,n,r){return e=rn(22,e,r,t),e.elementType=vg,e.lanes=n,e.stateNode={isHidden:!1},e}function gu(e,t,n){return e=rn(6,e,null,t),e.lanes=n,e}function xu(e,t,n){return t=rn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ck(e,t,n,r,i){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=Jo(0),this.expirationTimes=Jo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jo(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function ah(e,t,n,r,i,l,a,o,u){return e=new ck(e,t,n,o,u),t===1?(t=1,l===!0&&(t|=8)):t=0,l=rn(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wd(l),e}function dk(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Cs,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function cy(e){if(!e)return wr;e=e._reactInternals;e:{if(cs(e)!==e||e.tag!==1)throw Error(K(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(_t(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(K(171))}if(e.tag===1){var n=e.type;if(_t(n))return cx(e,n,t)}return t}function dy(e,t,n,r,i,l,a,o,u){return e=ah(n,r,!0,e,i,l,a,o,u),e.context=cy(null),n=e.current,r=Pt(),i=yr(n),l=Un(r,i),l.callback=t??null,gr(n,l,i),e.current.lanes=i,xl(e,i,r),Ot(e,r),e}function So(e,t,n,r){var i=t.current,l=Pt(),a=yr(i);return n=cy(n),t.context===null?t.context=n:t.pendingContext=n,t=Un(l,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=gr(i,t,a),e!==null&&(yn(e,i,a,l),ma(e,i,a)),a}function Ya(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 fp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function oh(e,t){fp(e,t),(e=e.alternate)&&fp(e,t)}function hk(){return null}var hy=typeof reportError=="function"?reportError:function(e){console.error(e)};function uh(e){this._internalRoot=e}No.prototype.render=uh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(K(409));So(e,t,null,null)};No.prototype.unmount=uh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;is(function(){So(null,e,null,null)}),t[Wn]=null}};function No(e){this._internalRoot=e}No.prototype.unstable_scheduleHydration=function(e){if(e){var t=Hg();e={blockedOn:null,target:e,priority:t};for(var n=0;n<lr.length&&t!==0&&t<lr[n].priority;n++);lr.splice(n,0,e),n===0&&Vg(e)}};function ch(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Co(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function pp(){}function fk(e,t,n,r,i){if(i){if(typeof r=="function"){var l=r;r=function(){var c=Ya(a);l.call(c)}}var a=dy(t,r,e,0,null,!1,!1,"",pp);return e._reactRootContainer=a,e[Wn]=a.current,nl(e.nodeType===8?e.parentNode:e),is(),a}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var o=r;r=function(){var c=Ya(u);o.call(c)}}var u=ah(e,0,!1,null,null,!1,!1,"",pp);return e._reactRootContainer=u,e[Wn]=u.current,nl(e.nodeType===8?e.parentNode:e),is(function(){So(t,u,n,r)}),u}function Eo(e,t,n,r,i){var l=n._reactRootContainer;if(l){var a=l;if(typeof i=="function"){var o=i;i=function(){var u=Ya(a);o.call(u)}}So(t,a,e,i)}else a=fk(n,t,e,i,r);return Ya(a)}Ug=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ai(t.pendingLanes);n!==0&&(Pd(t,n|1),Ot(t,et()),!(Re&6)&&(Xs=et()+500,Tr()))}break;case 13:is(function(){var r=Vn(e,1);if(r!==null){var i=Pt();yn(r,e,1,i)}}),oh(e,1)}};Rd=function(e){if(e.tag===13){var t=Vn(e,134217728);if(t!==null){var n=Pt();yn(t,e,134217728,n)}oh(e,134217728)}};Bg=function(e){if(e.tag===13){var t=yr(e),n=Vn(e,t);if(n!==null){var r=Pt();yn(n,e,t,r)}oh(e,t)}};Hg=function(){return ze};Wg=function(e,t){var n=ze;try{return ze=e,t()}finally{ze=n}};ic=function(e,t,n){switch(t){case"input":if(Xu(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 r=n[t];if(r!==e&&r.form===e.form){var i=xo(r);if(!i)throw Error(K(90));wg(r),Xu(r,i)}}}break;case"textarea":bg(e,n);break;case"select":t=n.value,t!=null&&Os(e,!!n.multiple,t,!1)}};Rg=rh;Lg=is;var pk={usingClientEntryPoint:!1,Events:[vl,Ls,xo,Tg,Pg,rh]},wi={findFiberByHostInstance:qr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},mk={bundleType:wi.bundleType,version:wi.version,rendererPackageName:wi.rendererPackageName,rendererConfig:wi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Gn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Dg(e),e===null?null:e.stateNode},findFiberByHostInstance:wi.findFiberByHostInstance||hk,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 Zl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zl.isDisabled&&Zl.supportsFiber)try{fo=Zl.inject(mk),Rn=Zl}catch{}}Jt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=pk;Jt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ch(t))throw Error(K(200));return dk(e,t,null,n)};Jt.createRoot=function(e,t){if(!ch(e))throw Error(K(299));var n=!1,r="",i=hy;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=ah(e,1,!1,null,null,n,!1,r,i),e[Wn]=t.current,nl(e.nodeType===8?e.parentNode:e),new uh(t)};Jt.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(K(188)):(e=Object.keys(e).join(","),Error(K(268,e)));return e=Dg(t),e=e===null?null:e.stateNode,e};Jt.flushSync=function(e){return is(e)};Jt.hydrate=function(e,t,n){if(!Co(t))throw Error(K(200));return Eo(null,e,t,!0,n)};Jt.hydrateRoot=function(e,t,n){if(!ch(e))throw Error(K(405));var r=n!=null&&n.hydratedSources||null,i=!1,l="",a=hy;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=dy(t,null,e,1,n??null,i,!1,l,a),e[Wn]=t.current,nl(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new No(t)};Jt.render=function(e,t,n){if(!Co(t))throw Error(K(200));return Eo(null,e,t,!1,n)};Jt.unmountComponentAtNode=function(e){if(!Co(e))throw Error(K(40));return e._reactRootContainer?(is(function(){Eo(null,null,e,!1,function(){e._reactRootContainer=null,e[Wn]=null})}),!0):!1};Jt.unstable_batchedUpdates=rh;Jt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Co(n))throw Error(K(200));if(e==null||e._reactInternals===void 0)throw Error(K(38));return Eo(e,t,n,!1,r)};Jt.version="18.3.1-next-f1338f8080-20240426";function fy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(fy)}catch(e){console.error(e)}}fy(),fg.exports=Jt;var Pr=fg.exports;const gk=gd(Pr),xk=tg({__proto__:null,default:gk},[Pr]);var py,mp=Pr;py=mp.createRoot,mp.hydrateRoot;/**
41
41
  * @remix-run/router v1.21.0
42
42
  *
43
43
  * Copyright (c) Remix Software Inc.
@@ -46,8 +46,8 @@ Error generating stack: `+l.message+`
46
46
  * LICENSE.md file in the root directory of this source tree.
47
47
  *
48
48
  * @license MIT
49
- */function Ve(){return Ve=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ve.apply(this,arguments)}var st;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(st||(st={}));const pp="popstate";function fk(e){e===void 0&&(e={});function t(r,i){let{pathname:l,search:a,hash:o}=r.location;return dl("",{pathname:l,search:a,hash:o},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:is(i)}return mk(t,n,null,e)}function we(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Xs(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function pk(){return Math.random().toString(36).substr(2,8)}function mp(e,t){return{usr:e.state,key:e.key,idx:t}}function dl(e,t,n,r){return n===void 0&&(n=null),Ve({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Rr(t):t,{state:n,key:t&&t.key||r||pk()})}function is(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Rr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function mk(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:l=!1}=r,a=i.history,o=st.Pop,u=null,c=h();c==null&&(c=0,a.replaceState(Ve({},a.state,{idx:c}),""));function h(){return(a.state||{idx:null}).idx}function d(){o=st.Pop;let w=h(),y=w==null?null:w-c;c=w,u&&u({action:o,location:g.location,delta:y})}function f(w,y){o=st.Push;let x=dl(g.location,w,y);c=h()+1;let v=mp(x,c),b=g.createHref(x);try{a.pushState(v,"",b)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;i.location.assign(b)}l&&u&&u({action:o,location:g.location,delta:1})}function m(w,y){o=st.Replace;let x=dl(g.location,w,y);c=h();let v=mp(x,c),b=g.createHref(x);a.replaceState(v,"",b),l&&u&&u({action:o,location:g.location,delta:0})}function p(w){let y=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof w=="string"?w:is(w);return x=x.replace(/ $/,"%20"),we(y,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,y)}let g={get action(){return o},get location(){return e(i,a)},listen(w){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(pp,d),u=w,()=>{i.removeEventListener(pp,d),u=null}},createHref(w){return t(i,w)},createURL:p,encodeLocation(w){let y=p(w);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:f,replace:m,go(w){return a.go(w)}};return g}var Me;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Me||(Me={}));const gk=new Set(["lazy","caseSensitive","path","id","index","children"]);function xk(e){return e.index===!0}function Ja(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,l)=>{let a=[...n,String(l)],o=typeof i.id=="string"?i.id:a.join("-");if(we(i.index!==!0||!i.children,"Cannot specify children on an index route"),we(!r[o],'Found a route id collision on id "'+o+`". Route id's must be globally unique within Data Router usages`),xk(i)){let u=Ve({},i,t(i),{id:o});return r[o]=u,u}else{let u=Ve({},i,t(i),{id:o,children:void 0});return r[o]=u,i.children&&(u.children=Ja(i.children,t,a,r)),u}})}function Wr(e,t,n){return n===void 0&&(n="/"),ka(e,t,n,!1)}function ka(e,t,n,r){let i=typeof t=="string"?Rr(t):t,l=wn(i.pathname||"/",n);if(l==null)return null;let a=hy(e);vk(a);let o=null;for(let u=0;o==null&&u<a.length;++u){let c=Rk(l);o=Tk(a[u],c,r)}return o}function yk(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function hy(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(l,a,o)=>{let u={relativePath:o===void 0?l.path||"":o,caseSensitive:l.caseSensitive===!0,childrenIndex:a,route:l};u.relativePath.startsWith("/")&&(we(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=Bn([r,u.relativePath]),h=n.concat(u);l.children&&l.children.length>0&&(we(l.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),hy(l.children,t,h,c)),!(l.path==null&&!l.index)&&t.push({path:c,score:Ck(c,l.index),routesMeta:h})};return e.forEach((l,a)=>{var o;if(l.path===""||!((o=l.path)!=null&&o.includes("?")))i(l,a);else for(let u of fy(l.path))i(l,a,u)}),t}function fy(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return i?[l,""]:[l];let a=fy(r.join("/")),o=[];return o.push(...a.map(u=>u===""?l:[l,u].join("/"))),i&&o.push(...a),o.map(u=>e.startsWith("/")&&u===""?"/":u)}function vk(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Ek(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const jk=/^:[\w-]+$/,wk=3,kk=2,bk=1,Sk=10,Nk=-2,gp=e=>e==="*";function Ck(e,t){let n=e.split("/"),r=n.length;return n.some(gp)&&(r+=Nk),t&&(r+=kk),n.filter(i=>!gp(i)).reduce((i,l)=>i+(jk.test(l)?wk:l===""?bk:Sk),r)}function Ek(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function Tk(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},l="/",a=[];for(let o=0;o<r.length;++o){let u=r[o],c=o===r.length-1,h=l==="/"?t:t.slice(l.length)||"/",d=Xa({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},h),f=u.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Xa({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},h)),!d)return null;Object.assign(i,d.params),a.push({params:i,pathname:Bn([l,d.pathname]),pathnameBase:Ik(Bn([l,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(l=Bn([l,d.pathnameBase]))}return a}function Xa(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Pk(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let l=i[0],a=l.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:r.reduce((c,h,d)=>{let{paramName:f,isOptional:m}=h;if(f==="*"){let g=o[d]||"";a=l.slice(0,l.length-g.length).replace(/(.)\/+$/,"$1")}const p=o[d];return m&&!p?c[f]=void 0:c[f]=(p||"").replace(/%2F/g,"/"),c},{}),pathname:l,pathnameBase:a,pattern:e}}function Pk(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Xs(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 r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,u)=>(r.push({paramName:o,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Rk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Xs(!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 wn(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Lk(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Rr(e):e;return{pathname:n?n.startsWith("/")?n:Ak(n,t):t,search:Dk(r),hash:zk(i)}}function Ak(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function xu(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. 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 py(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ch(e,t){let n=py(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function dh(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Rr(e):(i=Ve({},e),we(!i.pathname||!i.pathname.includes("?"),xu("?","pathname","search",i)),we(!i.pathname||!i.pathname.includes("#"),xu("#","pathname","hash",i)),we(!i.search||!i.search.includes("#"),xu("#","search","hash",i)));let l=e===""||i.pathname==="",a=l?"/":i.pathname,o;if(a==null)o=n;else{let d=t.length-1;if(!r&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}o=d>=0?t[d]:"/"}let u=Lk(i,o),c=a&&a!=="/"&&a.endsWith("/"),h=(l||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||h)&&(u.pathname+="/"),u}const Bn=e=>e.join("/").replace(/\/\/+/g,"/"),Ik=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Dk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,zk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Za{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function To(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const my=["post","put","patch","delete"],Mk=new Set(my),$k=["get",...my],_k=new Set($k),Ok=new Set([301,302,303,307,308]),Fk=new Set([307,308]),yu={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Uk={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ks={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},hh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Bk=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),gy="remix-router-transitions";function Hk(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;we(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let P=e.detectErrorBoundary;i=z=>({hasErrorBoundary:P(z)})}else i=Bk;let l={},a=Ja(e.routes,i,void 0,l),o,u=e.basename||"/",c=e.dataStrategy||qk,h=e.patchRoutesOnNavigation,d=Ve({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),f=null,m=new Set,p=null,g=null,w=null,y=e.hydrationData!=null,x=Wr(a,e.history.location,u),v=null;if(x==null&&!h){let P=Dt(404,{pathname:e.history.location.pathname}),{matches:z,route:$}=Ep(a);x=z,v={[$.id]:P}}x&&!e.hydrationData&&Il(x,a,e.history.location.pathname).active&&(x=null);let b;if(x)if(x.some(P=>P.route.lazy))b=!1;else if(!x.some(P=>P.route.loader))b=!0;else if(d.v7_partialHydration){let P=e.hydrationData?e.hydrationData.loaderData:null,z=e.hydrationData?e.hydrationData.errors:null;if(z){let $=x.findIndex(H=>z[H.route.id]!==void 0);b=x.slice(0,$+1).every(H=>!_c(H.route,P,z))}else b=x.every($=>!_c($.route,P,z))}else b=e.hydrationData!=null;else if(b=!1,x=[],d.v7_partialHydration){let P=Il(null,a,e.history.location.pathname);P.active&&P.matches&&(x=P.matches)}let A,k={historyAction:e.history.action,location:e.history.location,matches:x,initialized:b,navigation:yu,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||v,fetchers:new Map,blockers:new Map},E=st.Pop,T=!1,I,C=!1,R=new Map,L=null,M=!1,U=!1,D=[],q=new Set,J=new Map,B=0,X=-1,S=new Map,ae=new Set,O=new Map,N=new Map,F=new Set,Z=new Map,ce=new Map,Te;function tt(){if(f=e.history.listen(P=>{let{action:z,location:$,delta:H}=P;if(Te){Te(),Te=void 0;return}Xs(ce.size===0||H!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ne=ms({currentLocation:k.location,nextLocation:$,historyAction:z});if(ne&&H!=null){let oe=new Promise(xe=>{Te=xe});e.history.go(H*-1),_r(ne,{state:"blocked",location:$,proceed(){_r(ne,{state:"proceeding",proceed:void 0,reset:void 0,location:$}),oe.then(()=>e.history.go(H))},reset(){let xe=new Map(k.blockers);xe.set(ne,ks),V({blockers:xe})}});return}return Zt(z,$)}),n){a0(t,R);let P=()=>o0(t,R);t.addEventListener("pagehide",P),L=()=>t.removeEventListener("pagehide",P)}return k.initialized||Zt(st.Pop,k.location,{initialHydration:!0}),A}function W(){f&&f(),L&&L(),m.clear(),I&&I.abort(),k.fetchers.forEach((P,z)=>pe(z)),k.blockers.forEach((P,z)=>Zn(z))}function ge(P){return m.add(P),()=>m.delete(P)}function V(P,z){z===void 0&&(z={}),k=Ve({},k,P);let $=[],H=[];d.v7_fetcherPersist&&k.fetchers.forEach((ne,oe)=>{ne.state==="idle"&&(F.has(oe)?H.push(oe):$.push(oe))}),[...m].forEach(ne=>ne(k,{deletedFetchers:H,viewTransitionOpts:z.viewTransitionOpts,flushSync:z.flushSync===!0})),d.v7_fetcherPersist&&($.forEach(ne=>k.fetchers.delete(ne)),H.forEach(ne=>pe(ne)))}function de(P,z,$){var H,ne;let{flushSync:oe}=$===void 0?{}:$,xe=k.actionData!=null&&k.navigation.formMethod!=null&&pn(k.navigation.formMethod)&&k.navigation.state==="loading"&&((H=P.state)==null?void 0:H._isRedirect)!==!0,se;z.actionData?Object.keys(z.actionData).length>0?se=z.actionData:se=null:xe?se=k.actionData:se=null;let le=z.loaderData?Np(k.loaderData,z.loaderData,z.matches||[],z.errors):k.loaderData,re=k.blockers;re.size>0&&(re=new Map(re),re.forEach((Pe,gt)=>re.set(gt,ks)));let ue=T===!0||k.navigation.formMethod!=null&&pn(k.navigation.formMethod)&&((ne=P.state)==null?void 0:ne._isRedirect)!==!0;o&&(a=o,o=void 0),M||E===st.Pop||(E===st.Push?e.history.push(P,P.state):E===st.Replace&&e.history.replace(P,P.state));let Se;if(E===st.Pop){let Pe=R.get(k.location.pathname);Pe&&Pe.has(P.pathname)?Se={currentLocation:k.location,nextLocation:P}:R.has(P.pathname)&&(Se={currentLocation:P,nextLocation:k.location})}else if(C){let Pe=R.get(k.location.pathname);Pe?Pe.add(P.pathname):(Pe=new Set([P.pathname]),R.set(k.location.pathname,Pe)),Se={currentLocation:k.location,nextLocation:P}}V(Ve({},z,{actionData:se,loaderData:le,historyAction:E,location:P,initialized:!0,navigation:yu,revalidation:"idle",restoreScrollPosition:nf(P,z.matches||k.matches),preventScrollReset:ue,blockers:re}),{viewTransitionOpts:Se,flushSync:oe===!0}),E=st.Pop,T=!1,C=!1,M=!1,U=!1,D=[]}async function ve(P,z){if(typeof P=="number"){e.history.go(P);return}let $=$c(k.location,k.matches,u,d.v7_prependBasename,P,d.v7_relativeSplatPath,z==null?void 0:z.fromRouteId,z==null?void 0:z.relative),{path:H,submission:ne,error:oe}=xp(d.v7_normalizeFormMethod,!1,$,z),xe=k.location,se=dl(k.location,H,z&&z.state);se=Ve({},se,e.history.encodeLocation(se));let le=z&&z.replace!=null?z.replace:void 0,re=st.Push;le===!0?re=st.Replace:le===!1||ne!=null&&pn(ne.formMethod)&&ne.formAction===k.location.pathname+k.location.search&&(re=st.Replace);let ue=z&&"preventScrollReset"in z?z.preventScrollReset===!0:void 0,Se=(z&&z.flushSync)===!0,Pe=ms({currentLocation:xe,nextLocation:se,historyAction:re});if(Pe){_r(Pe,{state:"blocked",location:se,proceed(){_r(Pe,{state:"proceeding",proceed:void 0,reset:void 0,location:se}),ve(P,z)},reset(){let gt=new Map(k.blockers);gt.set(Pe,ks),V({blockers:gt})}});return}return await Zt(re,se,{submission:ne,pendingError:oe,preventScrollReset:ue,replace:z&&z.replace,enableViewTransition:z&&z.viewTransition,flushSync:Se})}function ct(){if(ci(),V({revalidation:"loading"}),k.navigation.state!=="submitting"){if(k.navigation.state==="idle"){Zt(k.historyAction,k.location,{startUninterruptedRevalidation:!0});return}Zt(E||k.historyAction,k.navigation.location,{overrideNavigation:k.navigation,enableViewTransition:C===!0})}}async function Zt(P,z,$){I&&I.abort(),I=null,E=P,M=($&&$.startUninterruptedRevalidation)===!0,Dj(k.location,k.matches),T=($&&$.preventScrollReset)===!0,C=($&&$.enableViewTransition)===!0;let H=o||a,ne=$&&$.overrideNavigation,oe=Wr(H,z,u),xe=($&&$.flushSync)===!0,se=Il(oe,H,z.pathname);if(se.active&&se.matches&&(oe=se.matches),!oe){let{error:Ue,notFoundMatches:De,route:Ye}=mt(z.pathname);de(z,{matches:De,loaderData:{},errors:{[Ye.id]:Ue}},{flushSync:xe});return}if(k.initialized&&!U&&Zk(k.location,z)&&!($&&$.submission&&pn($.submission.formMethod))){de(z,{matches:oe},{flushSync:xe});return}I=new AbortController;let le=js(e.history,z,I.signal,$&&$.submission),re;if($&&$.pendingError)re=[Vr(oe).route.id,{type:Me.error,error:$.pendingError}];else if($&&$.submission&&pn($.submission.formMethod)){let Ue=await ee(le,z,$.submission,oe,se.active,{replace:$.replace,flushSync:xe});if(Ue.shortCircuited)return;if(Ue.pendingActionResult){let[De,Ye]=Ue.pendingActionResult;if(Vt(Ye)&&To(Ye.error)&&Ye.error.status===404){I=null,de(z,{matches:Ue.matches,loaderData:{},errors:{[De]:Ye.error}});return}}oe=Ue.matches||oe,re=Ue.pendingActionResult,ne=vu(z,$.submission),xe=!1,se.active=!1,le=js(e.history,le.url,le.signal)}let{shortCircuited:ue,matches:Se,loaderData:Pe,errors:gt}=await Ce(le,z,oe,se.active,ne,$&&$.submission,$&&$.fetcherSubmission,$&&$.replace,$&&$.initialHydration===!0,xe,re);ue||(I=null,de(z,Ve({matches:Se||oe},Cp(re),{loaderData:Pe,errors:gt})))}async function ee(P,z,$,H,ne,oe){oe===void 0&&(oe={}),ci();let xe=i0(z,$);if(V({navigation:xe},{flushSync:oe.flushSync===!0}),ne){let re=await Dl(H,z.pathname,P.signal);if(re.type==="aborted")return{shortCircuited:!0};if(re.type==="error"){let ue=Vr(re.partialMatches).route.id;return{matches:re.partialMatches,pendingActionResult:[ue,{type:Me.error,error:re.error}]}}else if(re.matches)H=re.matches;else{let{notFoundMatches:ue,error:Se,route:Pe}=mt(z.pathname);return{matches:ue,pendingActionResult:[Pe.id,{type:Me.error,error:Se}]}}}let se,le=Di(H,z);if(!le.route.action&&!le.route.lazy)se={type:Me.error,error:Dt(405,{method:P.method,pathname:z.pathname,routeId:le.route.id})};else if(se=(await Mr("action",k,P,[le],H,null))[le.route.id],P.signal.aborted)return{shortCircuited:!0};if(Kr(se)){let re;return oe&&oe.replace!=null?re=oe.replace:re=kp(se.response.headers.get("Location"),new URL(P.url),u)===k.location.pathname+k.location.search,await zn(P,se,!0,{submission:$,replace:re}),{shortCircuited:!0}}if(ur(se))throw Dt(400,{type:"defer-action"});if(Vt(se)){let re=Vr(H,le.route.id);return(oe&&oe.replace)!==!0&&(E=st.Push),{matches:H,pendingActionResult:[re.route.id,se]}}return{matches:H,pendingActionResult:[le.route.id,se]}}async function Ce(P,z,$,H,ne,oe,xe,se,le,re,ue){let Se=ne||vu(z,oe),Pe=oe||xe||Pp(Se),gt=!M&&(!d.v7_partialHydration||!le);if(H){if(gt){let Je=Ze(ue);V(Ve({navigation:Se},Je!==void 0?{actionData:Je}:{}),{flushSync:re})}let Ae=await Dl($,z.pathname,P.signal);if(Ae.type==="aborted")return{shortCircuited:!0};if(Ae.type==="error"){let Je=Vr(Ae.partialMatches).route.id;return{matches:Ae.partialMatches,loaderData:{},errors:{[Je]:Ae.error}}}else if(Ae.matches)$=Ae.matches;else{let{error:Je,notFoundMatches:xs,route:fi}=mt(z.pathname);return{matches:xs,loaderData:{},errors:{[fi.id]:Je}}}}let Ue=o||a,[De,Ye]=vp(e.history,k,$,Pe,z,d.v7_partialHydration&&le===!0,d.v7_skipActionErrorRevalidation,U,D,q,F,O,ae,Ue,u,ue);if(bn(Ae=>!($&&$.some(Je=>Je.route.id===Ae))||De&&De.some(Je=>Je.route.id===Ae)),X=++B,De.length===0&&Ye.length===0){let Ae=Bt();return de(z,Ve({matches:$,loaderData:{},errors:ue&&Vt(ue[1])?{[ue[0]]:ue[1].error}:null},Cp(ue),Ae?{fetchers:new Map(k.fetchers)}:{}),{flushSync:re}),{shortCircuited:!0}}if(gt){let Ae={};if(!H){Ae.navigation=Se;let Je=Ze(ue);Je!==void 0&&(Ae.actionData=Je)}Ye.length>0&&(Ae.fetchers=zr(Ye)),V(Ae,{flushSync:re})}Ye.forEach(Ae=>{Ee(Ae.key),Ae.controller&&J.set(Ae.key,Ae.controller)});let gs=()=>Ye.forEach(Ae=>Ee(Ae.key));I&&I.signal.addEventListener("abort",gs);let{loaderResults:di,fetcherResults:Mn}=await Al(k,$,De,Ye,P);if(P.signal.aborted)return{shortCircuited:!0};I&&I.signal.removeEventListener("abort",gs),Ye.forEach(Ae=>J.delete(Ae.key));let Sn=ea(di);if(Sn)return await zn(P,Sn.result,!0,{replace:se}),{shortCircuited:!0};if(Sn=ea(Mn),Sn)return ae.add(Sn.key),await zn(P,Sn.result,!0,{replace:se}),{shortCircuited:!0};let{loaderData:Wo,errors:hi}=Sp(k,$,di,ue,Ye,Mn,Z);Z.forEach((Ae,Je)=>{Ae.subscribe(xs=>{(xs||Ae.done)&&Z.delete(Je)})}),d.v7_partialHydration&&le&&k.errors&&(hi=Ve({},k.errors,hi));let Or=Bt(),zl=Xn(X),Ml=Or||zl||Ye.length>0;return Ve({matches:$,loaderData:Wo,errors:hi},Ml?{fetchers:new Map(k.fetchers)}:{})}function Ze(P){if(P&&!Vt(P[1]))return{[P[0]]:P[1].data};if(k.actionData)return Object.keys(k.actionData).length===0?null:k.actionData}function zr(P){return P.forEach(z=>{let $=k.fetchers.get(z.key),H=ki(void 0,$?$.data:void 0);k.fetchers.set(z.key,H)}),new Map(k.fetchers)}function Rl(P,z,$,H){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Ee(P);let ne=(H&&H.flushSync)===!0,oe=o||a,xe=$c(k.location,k.matches,u,d.v7_prependBasename,$,d.v7_relativeSplatPath,z,H==null?void 0:H.relative),se=Wr(oe,xe,u),le=Il(se,oe,xe);if(le.active&&le.matches&&(se=le.matches),!se){G(P,z,Dt(404,{pathname:xe}),{flushSync:ne});return}let{path:re,submission:ue,error:Se}=xp(d.v7_normalizeFormMethod,!0,xe,H);if(Se){G(P,z,Se,{flushSync:ne});return}let Pe=Di(se,re),gt=(H&&H.preventScrollReset)===!0;if(ue&&pn(ue.formMethod)){Ll(P,z,re,Pe,se,le.active,ne,gt,ue);return}O.set(P,{routeId:z,path:re}),Ho(P,z,re,Pe,se,le.active,ne,gt,ue)}async function Ll(P,z,$,H,ne,oe,xe,se,le){ci(),O.delete(P);function re(nt){if(!nt.route.action&&!nt.route.lazy){let ys=Dt(405,{method:le.formMethod,pathname:$,routeId:z});return G(P,z,ys,{flushSync:xe}),!0}return!1}if(!oe&&re(H))return;let ue=k.fetchers.get(P);_(P,l0(le,ue),{flushSync:xe});let Se=new AbortController,Pe=js(e.history,$,Se.signal,le);if(oe){let nt=await Dl(ne,$,Pe.signal);if(nt.type==="aborted")return;if(nt.type==="error"){G(P,z,nt.error,{flushSync:xe});return}else if(nt.matches){if(ne=nt.matches,H=Di(ne,$),re(H))return}else{G(P,z,Dt(404,{pathname:$}),{flushSync:xe});return}}J.set(P,Se);let gt=B,De=(await Mr("action",k,Pe,[H],ne,P))[H.route.id];if(Pe.signal.aborted){J.get(P)===Se&&J.delete(P);return}if(d.v7_fetcherPersist&&F.has(P)){if(Kr(De)||Vt(De)){_(P,nr(void 0));return}}else{if(Kr(De))if(J.delete(P),X>gt){_(P,nr(void 0));return}else return ae.add(P),_(P,ki(le)),zn(Pe,De,!1,{fetcherSubmission:le,preventScrollReset:se});if(Vt(De)){G(P,z,De.error);return}}if(ur(De))throw Dt(400,{type:"defer-action"});let Ye=k.navigation.location||k.location,gs=js(e.history,Ye,Se.signal),di=o||a,Mn=k.navigation.state!=="idle"?Wr(di,k.navigation.location,u):k.matches;we(Mn,"Didn't find any matches after fetcher action");let Sn=++B;S.set(P,Sn);let Wo=ki(le,De.data);k.fetchers.set(P,Wo);let[hi,Or]=vp(e.history,k,Mn,le,Ye,!1,d.v7_skipActionErrorRevalidation,U,D,q,F,O,ae,di,u,[H.route.id,De]);Or.filter(nt=>nt.key!==P).forEach(nt=>{let ys=nt.key,rf=k.fetchers.get(ys),$j=ki(void 0,rf?rf.data:void 0);k.fetchers.set(ys,$j),Ee(ys),nt.controller&&J.set(ys,nt.controller)}),V({fetchers:new Map(k.fetchers)});let zl=()=>Or.forEach(nt=>Ee(nt.key));Se.signal.addEventListener("abort",zl);let{loaderResults:Ml,fetcherResults:Ae}=await Al(k,Mn,hi,Or,gs);if(Se.signal.aborted)return;Se.signal.removeEventListener("abort",zl),S.delete(P),J.delete(P),Or.forEach(nt=>J.delete(nt.key));let Je=ea(Ml);if(Je)return zn(gs,Je.result,!1,{preventScrollReset:se});if(Je=ea(Ae),Je)return ae.add(Je.key),zn(gs,Je.result,!1,{preventScrollReset:se});let{loaderData:xs,errors:fi}=Sp(k,Mn,Ml,void 0,Or,Ae,Z);if(k.fetchers.has(P)){let nt=nr(De.data);k.fetchers.set(P,nt)}Xn(Sn),k.navigation.state==="loading"&&Sn>X?(we(E,"Expected pending action"),I&&I.abort(),de(k.navigation.location,{matches:Mn,loaderData:xs,errors:fi,fetchers:new Map(k.fetchers)})):(V({errors:fi,loaderData:Np(k.loaderData,xs,Mn,fi),fetchers:new Map(k.fetchers)}),U=!1)}async function Ho(P,z,$,H,ne,oe,xe,se,le){let re=k.fetchers.get(P);_(P,ki(le,re?re.data:void 0),{flushSync:xe});let ue=new AbortController,Se=js(e.history,$,ue.signal);if(oe){let De=await Dl(ne,$,Se.signal);if(De.type==="aborted")return;if(De.type==="error"){G(P,z,De.error,{flushSync:xe});return}else if(De.matches)ne=De.matches,H=Di(ne,$);else{G(P,z,Dt(404,{pathname:$}),{flushSync:xe});return}}J.set(P,ue);let Pe=B,Ue=(await Mr("loader",k,Se,[H],ne,P))[H.route.id];if(ur(Ue)&&(Ue=await fh(Ue,Se.signal,!0)||Ue),J.get(P)===ue&&J.delete(P),!Se.signal.aborted){if(F.has(P)){_(P,nr(void 0));return}if(Kr(Ue))if(X>Pe){_(P,nr(void 0));return}else{ae.add(P),await zn(Se,Ue,!1,{preventScrollReset:se});return}if(Vt(Ue)){G(P,z,Ue.error);return}we(!ur(Ue),"Unhandled fetcher deferred data"),_(P,nr(Ue.data))}}async function zn(P,z,$,H){let{submission:ne,fetcherSubmission:oe,preventScrollReset:xe,replace:se}=H===void 0?{}:H;z.response.headers.has("X-Remix-Revalidate")&&(U=!0);let le=z.response.headers.get("Location");we(le,"Expected a Location header on the redirect Response"),le=kp(le,new URL(P.url),u);let re=dl(k.location,le,{_isRedirect:!0});if(n){let De=!1;if(z.response.headers.has("X-Remix-Reload-Document"))De=!0;else if(hh.test(le)){const Ye=e.history.createURL(le);De=Ye.origin!==t.location.origin||wn(Ye.pathname,u)==null}if(De){se?t.location.replace(le):t.location.assign(le);return}}I=null;let ue=se===!0||z.response.headers.has("X-Remix-Replace")?st.Replace:st.Push,{formMethod:Se,formAction:Pe,formEncType:gt}=k.navigation;!ne&&!oe&&Se&&Pe&&gt&&(ne=Pp(k.navigation));let Ue=ne||oe;if(Fk.has(z.response.status)&&Ue&&pn(Ue.formMethod))await Zt(ue,re,{submission:Ve({},Ue,{formAction:le}),preventScrollReset:xe||T,enableViewTransition:$?C:void 0});else{let De=vu(re,ne);await Zt(ue,re,{overrideNavigation:De,fetcherSubmission:oe,preventScrollReset:xe||T,enableViewTransition:$?C:void 0})}}async function Mr(P,z,$,H,ne,oe){let xe,se={};try{xe=await Gk(c,P,z,$,H,ne,oe,l,i)}catch(le){return H.forEach(re=>{se[re.route.id]={type:Me.error,error:le}}),se}for(let[le,re]of Object.entries(xe))if(e0(re)){let ue=re.result;se[le]={type:Me.redirect,response:Jk(ue,$,le,ne,u,d.v7_relativeSplatPath)}}else se[le]=await Yk(re);return se}async function Al(P,z,$,H,ne){let oe=P.matches,xe=Mr("loader",P,ne,$,z,null),se=Promise.all(H.map(async ue=>{if(ue.matches&&ue.match&&ue.controller){let Pe=(await Mr("loader",P,js(e.history,ue.path,ue.controller.signal),[ue.match],ue.matches,ue.key))[ue.match.route.id];return{[ue.key]:Pe}}else return Promise.resolve({[ue.key]:{type:Me.error,error:Dt(404,{pathname:ue.path})}})})),le=await xe,re=(await se).reduce((ue,Se)=>Object.assign(ue,Se),{});return await Promise.all([r0(z,le,ne.signal,oe,P.loaderData),s0(z,re,H)]),{loaderResults:le,fetcherResults:re}}function ci(){U=!0,D.push(...bn()),O.forEach((P,z)=>{J.has(z)&&q.add(z),Ee(z)})}function _(P,z,$){$===void 0&&($={}),k.fetchers.set(P,z),V({fetchers:new Map(k.fetchers)},{flushSync:($&&$.flushSync)===!0})}function G(P,z,$,H){H===void 0&&(H={});let ne=Vr(k.matches,z);pe(P),V({errors:{[ne.route.id]:$},fetchers:new Map(k.fetchers)},{flushSync:(H&&H.flushSync)===!0})}function fe(P){return d.v7_fetcherPersist&&(N.set(P,(N.get(P)||0)+1),F.has(P)&&F.delete(P)),k.fetchers.get(P)||Uk}function pe(P){let z=k.fetchers.get(P);J.has(P)&&!(z&&z.state==="loading"&&S.has(P))&&Ee(P),O.delete(P),S.delete(P),ae.delete(P),F.delete(P),q.delete(P),k.fetchers.delete(P)}function bt(P){if(d.v7_fetcherPersist){let z=(N.get(P)||0)-1;z<=0?(N.delete(P),F.add(P)):N.set(P,z)}else pe(P);V({fetchers:new Map(k.fetchers)})}function Ee(P){let z=J.get(P);z&&(z.abort(),J.delete(P))}function pt(P){for(let z of P){let $=fe(z),H=nr($.data);k.fetchers.set(z,H)}}function Bt(){let P=[],z=!1;for(let $ of ae){let H=k.fetchers.get($);we(H,"Expected fetcher: "+$),H.state==="loading"&&(ae.delete($),P.push($),z=!0)}return pt(P),z}function Xn(P){let z=[];for(let[$,H]of S)if(H<P){let ne=k.fetchers.get($);we(ne,"Expected fetcher: "+$),ne.state==="loading"&&(Ee($),S.delete($),z.push($))}return pt(z),z.length>0}function $r(P,z){let $=k.blockers.get(P)||ks;return ce.get(P)!==z&&ce.set(P,z),$}function Zn(P){k.blockers.delete(P),ce.delete(P)}function _r(P,z){let $=k.blockers.get(P)||ks;we($.state==="unblocked"&&z.state==="blocked"||$.state==="blocked"&&z.state==="blocked"||$.state==="blocked"&&z.state==="proceeding"||$.state==="blocked"&&z.state==="unblocked"||$.state==="proceeding"&&z.state==="unblocked","Invalid blocker state transition: "+$.state+" -> "+z.state);let H=new Map(k.blockers);H.set(P,z),V({blockers:H})}function ms(P){let{currentLocation:z,nextLocation:$,historyAction:H}=P;if(ce.size===0)return;ce.size>1&&Xs(!1,"A router only supports one blocker at a time");let ne=Array.from(ce.entries()),[oe,xe]=ne[ne.length-1],se=k.blockers.get(oe);if(!(se&&se.state==="proceeding")&&xe({currentLocation:z,nextLocation:$,historyAction:H}))return oe}function mt(P){let z=Dt(404,{pathname:P}),$=o||a,{matches:H,route:ne}=Ep($);return bn(),{notFoundMatches:H,route:ne,error:z}}function bn(P){let z=[];return Z.forEach(($,H)=>{(!P||P(H))&&($.cancel(),z.push(H),Z.delete(H))}),z}function cn(P,z,$){if(p=P,w=z,g=$||null,!y&&k.navigation===yu){y=!0;let H=nf(k.location,k.matches);H!=null&&V({restoreScrollPosition:H})}return()=>{p=null,w=null,g=null}}function tf(P,z){return g&&g(P,z.map(H=>yk(H,k.loaderData)))||P.key}function Dj(P,z){if(p&&w){let $=tf(P,z);p[$]=w()}}function nf(P,z){if(p){let $=tf(P,z),H=p[$];if(typeof H=="number")return H}return null}function Il(P,z,$){if(h)if(P){if(Object.keys(P[0].params).length>0)return{active:!0,matches:ka(z,$,u,!0)}}else return{active:!0,matches:ka(z,$,u,!0)||[]};return{active:!1,matches:null}}async function Dl(P,z,$){if(!h)return{type:"success",matches:P};let H=P;for(;;){let ne=o==null,oe=o||a,xe=l;try{await h({path:z,matches:H,patch:(re,ue)=>{$.aborted||wp(re,ue,oe,xe,i)}})}catch(re){return{type:"error",error:re,partialMatches:H}}finally{ne&&!$.aborted&&(a=[...a])}if($.aborted)return{type:"aborted"};let se=Wr(oe,z,u);if(se)return{type:"success",matches:se};let le=ka(oe,z,u,!0);if(!le||H.length===le.length&&H.every((re,ue)=>re.route.id===le[ue].route.id))return{type:"success",matches:null};H=le}}function zj(P){l={},o=Ja(P,i,void 0,l)}function Mj(P,z){let $=o==null;wp(P,z,o||a,l,i),$&&(a=[...a],V({}))}return A={get basename(){return u},get future(){return d},get state(){return k},get routes(){return a},get window(){return t},initialize:tt,subscribe:ge,enableScrollRestoration:cn,navigate:ve,fetch:Rl,revalidate:ct,createHref:P=>e.history.createHref(P),encodeLocation:P=>e.history.encodeLocation(P),getFetcher:fe,deleteFetcher:bt,dispose:W,getBlocker:$r,deleteBlocker:Zn,patchRoutes:Mj,_internalFetchControllers:J,_internalActiveDeferreds:Z,_internalSetRoutes:zj},A}function Wk(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function $c(e,t,n,r,i,l,a,o){let u,c;if(a){u=[];for(let d of t)if(u.push(d),d.route.id===a){c=d;break}}else u=t,c=t[t.length-1];let h=dh(i||".",ch(u,l),wn(e.pathname,n)||e.pathname,o==="path");if(i==null&&(h.search=e.search,h.hash=e.hash),(i==null||i===""||i===".")&&c){let d=ph(h.search);if(c.route.index&&!d)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&d){let f=new URLSearchParams(h.search),m=f.getAll("index");f.delete("index"),m.filter(g=>g).forEach(g=>f.append("index",g));let p=f.toString();h.search=p?"?"+p:""}}return r&&n!=="/"&&(h.pathname=h.pathname==="/"?n:Bn([n,h.pathname])),is(h)}function xp(e,t,n,r){if(!r||!Wk(r))return{path:n};if(r.formMethod&&!n0(r.formMethod))return{path:n,error:Dt(405,{method:r.formMethod})};let i=()=>({path:n,error:Dt(400,{type:"invalid-body"})}),l=r.formMethod||"get",a=e?l.toUpperCase():l.toLowerCase(),o=vy(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!pn(a))return i();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,p)=>{let[g,w]=p;return""+m+g+"="+w+`
50
- `},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:o,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!pn(a))return i();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:o,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return i()}}}we(typeof FormData=="function","FormData is not available in this environment");let u,c;if(r.formData)u=Oc(r.formData),c=r.formData;else if(r.body instanceof FormData)u=Oc(r.body),c=r.body;else if(r.body instanceof URLSearchParams)u=r.body,c=bp(u);else if(r.body==null)u=new URLSearchParams,c=new FormData;else try{u=new URLSearchParams(r.body),c=bp(u)}catch{return i()}let h={formMethod:a,formAction:o,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(pn(h.formMethod))return{path:n,submission:h};let d=Rr(n);return t&&d.search&&ph(d.search)&&u.append("index",""),d.search="?"+u,{path:is(d),submission:h}}function yp(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(i=>i.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function vp(e,t,n,r,i,l,a,o,u,c,h,d,f,m,p,g){let w=g?Vt(g[1])?g[1].error:g[1].data:void 0,y=e.createURL(t.location),x=e.createURL(i),v=n;l&&t.errors?v=yp(n,Object.keys(t.errors)[0],!0):g&&Vt(g[1])&&(v=yp(n,g[0]));let b=g?g[1].statusCode:void 0,A=a&&b&&b>=400,k=v.filter((T,I)=>{let{route:C}=T;if(C.lazy)return!0;if(C.loader==null)return!1;if(l)return _c(C,t.loaderData,t.errors);if(Vk(t.loaderData,t.matches[I],T)||u.some(M=>M===T.route.id))return!0;let R=t.matches[I],L=T;return jp(T,Ve({currentUrl:y,currentParams:R.params,nextUrl:x,nextParams:L.params},r,{actionResult:w,actionStatus:b,defaultShouldRevalidate:A?!1:o||y.pathname+y.search===x.pathname+x.search||y.search!==x.search||xy(R,L)}))}),E=[];return d.forEach((T,I)=>{if(l||!n.some(U=>U.route.id===T.routeId)||h.has(I))return;let C=Wr(m,T.path,p);if(!C){E.push({key:I,routeId:T.routeId,path:T.path,matches:null,match:null,controller:null});return}let R=t.fetchers.get(I),L=Di(C,T.path),M=!1;f.has(I)?M=!1:c.has(I)?(c.delete(I),M=!0):R&&R.state!=="idle"&&R.data===void 0?M=o:M=jp(L,Ve({currentUrl:y,currentParams:t.matches[t.matches.length-1].params,nextUrl:x,nextParams:n[n.length-1].params},r,{actionResult:w,actionStatus:b,defaultShouldRevalidate:A?!1:o})),M&&E.push({key:I,routeId:T.routeId,path:T.path,matches:C,match:L,controller:new AbortController})}),[k,E]}function _c(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function Vk(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function xy(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function jp(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function wp(e,t,n,r,i){var l;let a;if(e){let c=r[e];we(c,"No route found to patch children into: routeId = "+e),c.children||(c.children=[]),a=c.children}else a=n;let o=t.filter(c=>!a.some(h=>yy(c,h))),u=Ja(o,i,[e||"_","patch",String(((l=a)==null?void 0:l.length)||"0")],r);a.push(...u)}function yy(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var i;return(i=t.children)==null?void 0:i.some(l=>yy(n,l))}):!1}async function Qk(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];we(i,"No route found in manifest");let l={};for(let a in r){let u=i[a]!==void 0&&a!=="hasErrorBoundary";Xs(!u,'Route "'+i.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!u&&!gk.has(a)&&(l[a]=r[a])}Object.assign(i,l),Object.assign(i,Ve({},t(i),{lazy:void 0}))}async function qk(e){let{matches:t}=e,n=t.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,l,a)=>Object.assign(i,{[n[a].route.id]:l}),{})}async function Gk(e,t,n,r,i,l,a,o,u,c){let h=l.map(m=>m.route.lazy?Qk(m.route,u,o):void 0),d=l.map((m,p)=>{let g=h[p],w=i.some(x=>x.route.id===m.route.id);return Ve({},m,{shouldLoad:w,resolve:async x=>(x&&r.method==="GET"&&(m.route.lazy||m.route.loader)&&(w=!0),w?Kk(t,r,m,g,x,c):Promise.resolve({type:Me.data,result:void 0}))})}),f=await e({matches:d,request:r,params:l[0].params,fetcherKey:a,context:c});try{await Promise.all(h)}catch{}return f}async function Kk(e,t,n,r,i,l){let a,o,u=c=>{let h,d=new Promise((p,g)=>h=g);o=()=>h(),t.signal.addEventListener("abort",o);let f=p=>typeof c!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):c({request:t,params:n.params,context:l},...p!==void 0?[p]:[]),m=(async()=>{try{return{type:"data",result:await(i?i(g=>f(g)):f())}}catch(p){return{type:"error",result:p}}})();return Promise.race([m,d])};try{let c=n.route[e];if(r)if(c){let h,[d]=await Promise.all([u(c).catch(f=>{h=f}),r]);if(h!==void 0)throw h;a=d}else if(await r,c=n.route[e],c)a=await u(c);else if(e==="action"){let h=new URL(t.url),d=h.pathname+h.search;throw Dt(405,{method:t.method,pathname:d,routeId:n.route.id})}else return{type:Me.data,result:void 0};else if(c)a=await u(c);else{let h=new URL(t.url),d=h.pathname+h.search;throw Dt(404,{pathname:d})}we(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(c){return{type:Me.error,result:c}}finally{o&&t.signal.removeEventListener("abort",o)}return a}async function Yk(e){let{result:t,type:n}=e;if(jy(t)){let c;try{let h=t.headers.get("Content-Type");h&&/\bapplication\/json\b/.test(h)?t.body==null?c=null:c=await t.json():c=await t.text()}catch(h){return{type:Me.error,error:h}}return n===Me.error?{type:Me.error,error:new Za(t.status,t.statusText,c),statusCode:t.status,headers:t.headers}:{type:Me.data,data:c,statusCode:t.status,headers:t.headers}}if(n===Me.error){if(Tp(t)){var r;if(t.data instanceof Error){var i;return{type:Me.error,error:t.data,statusCode:(i=t.init)==null?void 0:i.status}}t=new Za(((r=t.init)==null?void 0:r.status)||500,void 0,t.data)}return{type:Me.error,error:t,statusCode:To(t)?t.status:void 0}}if(t0(t)){var l,a;return{type:Me.deferred,deferredData:t,statusCode:(l=t.init)==null?void 0:l.status,headers:((a=t.init)==null?void 0:a.headers)&&new Headers(t.init.headers)}}if(Tp(t)){var o,u;return{type:Me.data,data:t.data,statusCode:(o=t.init)==null?void 0:o.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}}return{type:Me.data,data:t}}function Jk(e,t,n,r,i,l){let a=e.headers.get("Location");if(we(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!hh.test(a)){let o=r.slice(0,r.findIndex(u=>u.route.id===n)+1);a=$c(new URL(t.url),o,i,!0,a,l),e.headers.set("Location",a)}return e}function kp(e,t,n){if(hh.test(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r),l=wn(i.pathname,n)!=null;if(i.origin===t.origin&&l)return i.pathname+i.search+i.hash}return e}function js(e,t,n,r){let i=e.createURL(vy(t)).toString(),l={signal:n};if(r&&pn(r.formMethod)){let{formMethod:a,formEncType:o}=r;l.method=a.toUpperCase(),o==="application/json"?(l.headers=new Headers({"Content-Type":o}),l.body=JSON.stringify(r.json)):o==="text/plain"?l.body=r.text:o==="application/x-www-form-urlencoded"&&r.formData?l.body=Oc(r.formData):l.body=r.formData}return new Request(i,l)}function Oc(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function bp(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Xk(e,t,n,r,i){let l={},a=null,o,u=!1,c={},h=n&&Vt(n[1])?n[1].error:void 0;return e.forEach(d=>{if(!(d.route.id in t))return;let f=d.route.id,m=t[f];if(we(!Kr(m),"Cannot handle redirect results in processLoaderData"),Vt(m)){let p=m.error;h!==void 0&&(p=h,h=void 0),a=a||{};{let g=Vr(e,f);a[g.route.id]==null&&(a[g.route.id]=p)}l[f]=void 0,u||(u=!0,o=To(m.error)?m.error.status:500),m.headers&&(c[f]=m.headers)}else ur(m)?(r.set(f,m.deferredData),l[f]=m.deferredData.data,m.statusCode!=null&&m.statusCode!==200&&!u&&(o=m.statusCode),m.headers&&(c[f]=m.headers)):(l[f]=m.data,m.statusCode&&m.statusCode!==200&&!u&&(o=m.statusCode),m.headers&&(c[f]=m.headers))}),h!==void 0&&n&&(a={[n[0]]:h},l[n[0]]=void 0),{loaderData:l,errors:a,statusCode:o||200,loaderHeaders:c}}function Sp(e,t,n,r,i,l,a){let{loaderData:o,errors:u}=Xk(t,n,r,a);return i.forEach(c=>{let{key:h,match:d,controller:f}=c,m=l[h];if(we(m,"Did not find corresponding fetcher result"),!(f&&f.signal.aborted))if(Vt(m)){let p=Vr(e.matches,d==null?void 0:d.route.id);u&&u[p.route.id]||(u=Ve({},u,{[p.route.id]:m.error})),e.fetchers.delete(h)}else if(Kr(m))we(!1,"Unhandled fetcher revalidation redirect");else if(ur(m))we(!1,"Unhandled fetcher deferred data");else{let p=nr(m.data);e.fetchers.set(h,p)}}),{loaderData:o,errors:u}}function Np(e,t,n,r){let i=Ve({},t);for(let l of n){let a=l.route.id;if(t.hasOwnProperty(a)?t[a]!==void 0&&(i[a]=t[a]):e[a]!==void 0&&l.route.loader&&(i[a]=e[a]),r&&r.hasOwnProperty(a))break}return i}function Cp(e){return e?Vt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Vr(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Ep(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Dt(e,t){let{pathname:n,routeId:r,method:i,type:l,message:a}=t===void 0?{}:t,o="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(o="Bad Request",i&&n&&r?u="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":l==="defer-action"?u="defer() is not supported in actions":l==="invalid-body"&&(u="Unable to encode submission body")):e===403?(o="Forbidden",u='Route "'+r+'" does not match URL "'+n+'"'):e===404?(o="Not Found",u='No route matches URL "'+n+'"'):e===405&&(o="Method Not Allowed",i&&n&&r?u="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(u='Invalid request method "'+i.toUpperCase()+'"')),new Za(e||500,o,new Error(u),!0)}function ea(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(Kr(i))return{key:r,result:i}}}function vy(e){let t=typeof e=="string"?Rr(e):e;return is(Ve({},t,{hash:""}))}function Zk(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function e0(e){return jy(e.result)&&Ok.has(e.result.status)}function ur(e){return e.type===Me.deferred}function Vt(e){return e.type===Me.error}function Kr(e){return(e&&e.type)===Me.redirect}function Tp(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function t0(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function jy(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function n0(e){return _k.has(e.toLowerCase())}function pn(e){return Mk.has(e.toLowerCase())}async function r0(e,t,n,r,i){let l=Object.entries(t);for(let a=0;a<l.length;a++){let[o,u]=l[a],c=e.find(f=>(f==null?void 0:f.route.id)===o);if(!c)continue;let h=r.find(f=>f.route.id===c.route.id),d=h!=null&&!xy(h,c)&&(i&&i[c.route.id])!==void 0;ur(u)&&d&&await fh(u,n,!1).then(f=>{f&&(t[o]=f)})}}async function s0(e,t,n){for(let r=0;r<n.length;r++){let{key:i,routeId:l,controller:a}=n[r],o=t[i];e.find(c=>(c==null?void 0:c.route.id)===l)&&ur(o)&&(we(a,"Expected an AbortController for revalidating fetcher deferred result"),await fh(o,a.signal,!0).then(c=>{c&&(t[i]=c)}))}}async function fh(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Me.data,data:e.deferredData.unwrappedData}}catch(i){return{type:Me.error,error:i}}return{type:Me.data,data:e.deferredData.data}}}function ph(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Di(e,t){let n=typeof t=="string"?Rr(t).search:t.search;if(e[e.length-1].route.index&&ph(n||""))return e[e.length-1];let r=py(e);return r[r.length-1]}function Pp(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:l,json:a}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(l!=null)return{formMethod:t,formAction:n,formEncType:r,formData:l,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function vu(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function i0(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function ki(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function l0(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function nr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function a0(e,t){try{let n=e.sessionStorage.getItem(gy);if(n){let r=JSON.parse(n);for(let[i,l]of Object.entries(r||{}))l&&Array.isArray(l)&&t.set(i,new Set(l||[]))}}catch{}}function o0(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(gy,JSON.stringify(n))}catch(r){Xs(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
49
+ */function Ve(){return Ve=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ve.apply(this,arguments)}var st;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(st||(st={}));const gp="popstate";function yk(e){e===void 0&&(e={});function t(r,i){let{pathname:l,search:a,hash:o}=r.location;return dl("",{pathname:l,search:a,hash:o},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:ls(i)}return jk(t,n,null,e)}function we(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Zs(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function vk(){return Math.random().toString(36).substr(2,8)}function xp(e,t){return{usr:e.state,key:e.key,idx:t}}function dl(e,t,n,r){return n===void 0&&(n=null),Ve({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Rr(t):t,{state:n,key:t&&t.key||r||vk()})}function ls(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Rr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function jk(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:l=!1}=r,a=i.history,o=st.Pop,u=null,c=h();c==null&&(c=0,a.replaceState(Ve({},a.state,{idx:c}),""));function h(){return(a.state||{idx:null}).idx}function d(){o=st.Pop;let w=h(),y=w==null?null:w-c;c=w,u&&u({action:o,location:g.location,delta:y})}function f(w,y){o=st.Push;let x=dl(g.location,w,y);c=h()+1;let v=xp(x,c),b=g.createHref(x);try{a.pushState(v,"",b)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;i.location.assign(b)}l&&u&&u({action:o,location:g.location,delta:1})}function m(w,y){o=st.Replace;let x=dl(g.location,w,y);c=h();let v=xp(x,c),b=g.createHref(x);a.replaceState(v,"",b),l&&u&&u({action:o,location:g.location,delta:0})}function p(w){let y=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof w=="string"?w:ls(w);return x=x.replace(/ $/,"%20"),we(y,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,y)}let g={get action(){return o},get location(){return e(i,a)},listen(w){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(gp,d),u=w,()=>{i.removeEventListener(gp,d),u=null}},createHref(w){return t(i,w)},createURL:p,encodeLocation(w){let y=p(w);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:f,replace:m,go(w){return a.go(w)}};return g}var Me;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Me||(Me={}));const wk=new Set(["lazy","caseSensitive","path","id","index","children"]);function kk(e){return e.index===!0}function Ja(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,l)=>{let a=[...n,String(l)],o=typeof i.id=="string"?i.id:a.join("-");if(we(i.index!==!0||!i.children,"Cannot specify children on an index route"),we(!r[o],'Found a route id collision on id "'+o+`". Route id's must be globally unique within Data Router usages`),kk(i)){let u=Ve({},i,t(i),{id:o});return r[o]=u,u}else{let u=Ve({},i,t(i),{id:o,children:void 0});return r[o]=u,i.children&&(u.children=Ja(i.children,t,a,r)),u}})}function Vr(e,t,n){return n===void 0&&(n="/"),ka(e,t,n,!1)}function ka(e,t,n,r){let i=typeof t=="string"?Rr(t):t,l=kn(i.pathname||"/",n);if(l==null)return null;let a=my(e);Sk(a);let o=null;for(let u=0;o==null&&u<a.length;++u){let c=zk(l);o=Ik(a[u],c,r)}return o}function bk(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function my(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(l,a,o)=>{let u={relativePath:o===void 0?l.path||"":o,caseSensitive:l.caseSensitive===!0,childrenIndex:a,route:l};u.relativePath.startsWith("/")&&(we(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=Bn([r,u.relativePath]),h=n.concat(u);l.children&&l.children.length>0&&(we(l.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),my(l.children,t,h,c)),!(l.path==null&&!l.index)&&t.push({path:c,score:Lk(c,l.index),routesMeta:h})};return e.forEach((l,a)=>{var o;if(l.path===""||!((o=l.path)!=null&&o.includes("?")))i(l,a);else for(let u of gy(l.path))i(l,a,u)}),t}function gy(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return i?[l,""]:[l];let a=gy(r.join("/")),o=[];return o.push(...a.map(u=>u===""?l:[l,u].join("/"))),i&&o.push(...a),o.map(u=>e.startsWith("/")&&u===""?"/":u)}function Sk(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Ak(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Nk=/^:[\w-]+$/,Ck=3,Ek=2,Tk=1,Pk=10,Rk=-2,yp=e=>e==="*";function Lk(e,t){let n=e.split("/"),r=n.length;return n.some(yp)&&(r+=Rk),t&&(r+=Ek),n.filter(i=>!yp(i)).reduce((i,l)=>i+(Nk.test(l)?Ck:l===""?Tk:Pk),r)}function Ak(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function Ik(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},l="/",a=[];for(let o=0;o<r.length;++o){let u=r[o],c=o===r.length-1,h=l==="/"?t:t.slice(l.length)||"/",d=Xa({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},h),f=u.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Xa({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},h)),!d)return null;Object.assign(i,d.params),a.push({params:i,pathname:Bn([l,d.pathname]),pathnameBase:_k(Bn([l,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(l=Bn([l,d.pathnameBase]))}return a}function Xa(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Dk(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let l=i[0],a=l.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:r.reduce((c,h,d)=>{let{paramName:f,isOptional:m}=h;if(f==="*"){let g=o[d]||"";a=l.slice(0,l.length-g.length).replace(/(.)\/+$/,"$1")}const p=o[d];return m&&!p?c[f]=void 0:c[f]=(p||"").replace(/%2F/g,"/"),c},{}),pathname:l,pathnameBase:a,pattern:e}}function Dk(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Zs(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 r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,u)=>(r.push({paramName:o,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function zk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Zs(!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 kn(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Mk(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Rr(e):e;return{pathname:n?n.startsWith("/")?n:$k(n,t):t,search:Ok(r),hash:Fk(i)}}function $k(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function yu(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. 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 xy(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function dh(e,t){let n=xy(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function hh(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Rr(e):(i=Ve({},e),we(!i.pathname||!i.pathname.includes("?"),yu("?","pathname","search",i)),we(!i.pathname||!i.pathname.includes("#"),yu("#","pathname","hash",i)),we(!i.search||!i.search.includes("#"),yu("#","search","hash",i)));let l=e===""||i.pathname==="",a=l?"/":i.pathname,o;if(a==null)o=n;else{let d=t.length-1;if(!r&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}o=d>=0?t[d]:"/"}let u=Mk(i,o),c=a&&a!=="/"&&a.endsWith("/"),h=(l||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||h)&&(u.pathname+="/"),u}const Bn=e=>e.join("/").replace(/\/\/+/g,"/"),_k=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ok=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Fk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Za{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function To(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const yy=["post","put","patch","delete"],Uk=new Set(yy),Bk=["get",...yy],Hk=new Set(Bk),Wk=new Set([301,302,303,307,308]),Vk=new Set([307,308]),vu={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Qk={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},bs={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},fh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qk=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),vy="remix-router-transitions";function Gk(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;we(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let P=e.detectErrorBoundary;i=z=>({hasErrorBoundary:P(z)})}else i=qk;let l={},a=Ja(e.routes,i,void 0,l),o,u=e.basename||"/",c=e.dataStrategy||Xk,h=e.patchRoutesOnNavigation,d=Ve({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),f=null,m=new Set,p=null,g=null,w=null,y=e.hydrationData!=null,x=Vr(a,e.history.location,u),v=null;if(x==null&&!h){let P=Dt(404,{pathname:e.history.location.pathname}),{matches:z,route:$}=Pp(a);x=z,v={[$.id]:P}}x&&!e.hydrationData&&Il(x,a,e.history.location.pathname).active&&(x=null);let b;if(x)if(x.some(P=>P.route.lazy))b=!1;else if(!x.some(P=>P.route.loader))b=!0;else if(d.v7_partialHydration){let P=e.hydrationData?e.hydrationData.loaderData:null,z=e.hydrationData?e.hydrationData.errors:null;if(z){let $=x.findIndex(H=>z[H.route.id]!==void 0);b=x.slice(0,$+1).every(H=>!Oc(H.route,P,z))}else b=x.every($=>!Oc($.route,P,z))}else b=e.hydrationData!=null;else if(b=!1,x=[],d.v7_partialHydration){let P=Il(null,a,e.history.location.pathname);P.active&&P.matches&&(x=P.matches)}let A,k={historyAction:e.history.action,location:e.history.location,matches:x,initialized:b,navigation:vu,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||v,fetchers:new Map,blockers:new Map},E=st.Pop,T=!1,I,C=!1,R=new Map,L=null,M=!1,U=!1,D=[],q=new Set,J=new Map,B=0,X=-1,S=new Map,ae=new Set,O=new Map,N=new Map,F=new Set,Z=new Map,ce=new Map,Te;function tt(){if(f=e.history.listen(P=>{let{action:z,location:$,delta:H}=P;if(Te){Te(),Te=void 0;return}Zs(ce.size===0||H!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ne=gs({currentLocation:k.location,nextLocation:$,historyAction:z});if(ne&&H!=null){let oe=new Promise(xe=>{Te=xe});e.history.go(H*-1),Or(ne,{state:"blocked",location:$,proceed(){Or(ne,{state:"proceeding",proceed:void 0,reset:void 0,location:$}),oe.then(()=>e.history.go(H))},reset(){let xe=new Map(k.blockers);xe.set(ne,bs),Q({blockers:xe})}});return}return Zt(z,$)}),n){h0(t,R);let P=()=>f0(t,R);t.addEventListener("pagehide",P),L=()=>t.removeEventListener("pagehide",P)}return k.initialized||Zt(st.Pop,k.location,{initialHydration:!0}),A}function W(){f&&f(),L&&L(),m.clear(),I&&I.abort(),k.fetchers.forEach((P,z)=>pe(z)),k.blockers.forEach((P,z)=>er(z))}function ge(P){return m.add(P),()=>m.delete(P)}function Q(P,z){z===void 0&&(z={}),k=Ve({},k,P);let $=[],H=[];d.v7_fetcherPersist&&k.fetchers.forEach((ne,oe)=>{ne.state==="idle"&&(F.has(oe)?H.push(oe):$.push(oe))}),[...m].forEach(ne=>ne(k,{deletedFetchers:H,viewTransitionOpts:z.viewTransitionOpts,flushSync:z.flushSync===!0})),d.v7_fetcherPersist&&($.forEach(ne=>k.fetchers.delete(ne)),H.forEach(ne=>pe(ne)))}function de(P,z,$){var H,ne;let{flushSync:oe}=$===void 0?{}:$,xe=k.actionData!=null&&k.navigation.formMethod!=null&&mn(k.navigation.formMethod)&&k.navigation.state==="loading"&&((H=P.state)==null?void 0:H._isRedirect)!==!0,ie;z.actionData?Object.keys(z.actionData).length>0?ie=z.actionData:ie=null:xe?ie=k.actionData:ie=null;let le=z.loaderData?Ep(k.loaderData,z.loaderData,z.matches||[],z.errors):k.loaderData,re=k.blockers;re.size>0&&(re=new Map(re),re.forEach((Pe,gt)=>re.set(gt,bs)));let ue=T===!0||k.navigation.formMethod!=null&&mn(k.navigation.formMethod)&&((ne=P.state)==null?void 0:ne._isRedirect)!==!0;o&&(a=o,o=void 0),M||E===st.Pop||(E===st.Push?e.history.push(P,P.state):E===st.Replace&&e.history.replace(P,P.state));let Se;if(E===st.Pop){let Pe=R.get(k.location.pathname);Pe&&Pe.has(P.pathname)?Se={currentLocation:k.location,nextLocation:P}:R.has(P.pathname)&&(Se={currentLocation:P,nextLocation:k.location})}else if(C){let Pe=R.get(k.location.pathname);Pe?Pe.add(P.pathname):(Pe=new Set([P.pathname]),R.set(k.location.pathname,Pe)),Se={currentLocation:k.location,nextLocation:P}}Q(Ve({},z,{actionData:ie,loaderData:le,historyAction:E,location:P,initialized:!0,navigation:vu,revalidation:"idle",restoreScrollPosition:sf(P,z.matches||k.matches),preventScrollReset:ue,blockers:re}),{viewTransitionOpts:Se,flushSync:oe===!0}),E=st.Pop,T=!1,C=!1,M=!1,U=!1,D=[]}async function ve(P,z){if(typeof P=="number"){e.history.go(P);return}let $=_c(k.location,k.matches,u,d.v7_prependBasename,P,d.v7_relativeSplatPath,z==null?void 0:z.fromRouteId,z==null?void 0:z.relative),{path:H,submission:ne,error:oe}=vp(d.v7_normalizeFormMethod,!1,$,z),xe=k.location,ie=dl(k.location,H,z&&z.state);ie=Ve({},ie,e.history.encodeLocation(ie));let le=z&&z.replace!=null?z.replace:void 0,re=st.Push;le===!0?re=st.Replace:le===!1||ne!=null&&mn(ne.formMethod)&&ne.formAction===k.location.pathname+k.location.search&&(re=st.Replace);let ue=z&&"preventScrollReset"in z?z.preventScrollReset===!0:void 0,Se=(z&&z.flushSync)===!0,Pe=gs({currentLocation:xe,nextLocation:ie,historyAction:re});if(Pe){Or(Pe,{state:"blocked",location:ie,proceed(){Or(Pe,{state:"proceeding",proceed:void 0,reset:void 0,location:ie}),ve(P,z)},reset(){let gt=new Map(k.blockers);gt.set(Pe,bs),Q({blockers:gt})}});return}return await Zt(re,ie,{submission:ne,pendingError:oe,preventScrollReset:ue,replace:z&&z.replace,enableViewTransition:z&&z.viewTransition,flushSync:Se})}function ct(){if(ci(),Q({revalidation:"loading"}),k.navigation.state!=="submitting"){if(k.navigation.state==="idle"){Zt(k.historyAction,k.location,{startUninterruptedRevalidation:!0});return}Zt(E||k.historyAction,k.navigation.location,{overrideNavigation:k.navigation,enableViewTransition:C===!0})}}async function Zt(P,z,$){I&&I.abort(),I=null,E=P,M=($&&$.startUninterruptedRevalidation)===!0,Oj(k.location,k.matches),T=($&&$.preventScrollReset)===!0,C=($&&$.enableViewTransition)===!0;let H=o||a,ne=$&&$.overrideNavigation,oe=Vr(H,z,u),xe=($&&$.flushSync)===!0,ie=Il(oe,H,z.pathname);if(ie.active&&ie.matches&&(oe=ie.matches),!oe){let{error:Ue,notFoundMatches:De,route:Ye}=mt(z.pathname);de(z,{matches:De,loaderData:{},errors:{[Ye.id]:Ue}},{flushSync:xe});return}if(k.initialized&&!U&&s0(k.location,z)&&!($&&$.submission&&mn($.submission.formMethod))){de(z,{matches:oe},{flushSync:xe});return}I=new AbortController;let le=ws(e.history,z,I.signal,$&&$.submission),re;if($&&$.pendingError)re=[Qr(oe).route.id,{type:Me.error,error:$.pendingError}];else if($&&$.submission&&mn($.submission.formMethod)){let Ue=await ee(le,z,$.submission,oe,ie.active,{replace:$.replace,flushSync:xe});if(Ue.shortCircuited)return;if(Ue.pendingActionResult){let[De,Ye]=Ue.pendingActionResult;if(Vt(Ye)&&To(Ye.error)&&Ye.error.status===404){I=null,de(z,{matches:Ue.matches,loaderData:{},errors:{[De]:Ye.error}});return}}oe=Ue.matches||oe,re=Ue.pendingActionResult,ne=ju(z,$.submission),xe=!1,ie.active=!1,le=ws(e.history,le.url,le.signal)}let{shortCircuited:ue,matches:Se,loaderData:Pe,errors:gt}=await Ce(le,z,oe,ie.active,ne,$&&$.submission,$&&$.fetcherSubmission,$&&$.replace,$&&$.initialHydration===!0,xe,re);ue||(I=null,de(z,Ve({matches:Se||oe},Tp(re),{loaderData:Pe,errors:gt})))}async function ee(P,z,$,H,ne,oe){oe===void 0&&(oe={}),ci();let xe=c0(z,$);if(Q({navigation:xe},{flushSync:oe.flushSync===!0}),ne){let re=await Dl(H,z.pathname,P.signal);if(re.type==="aborted")return{shortCircuited:!0};if(re.type==="error"){let ue=Qr(re.partialMatches).route.id;return{matches:re.partialMatches,pendingActionResult:[ue,{type:Me.error,error:re.error}]}}else if(re.matches)H=re.matches;else{let{notFoundMatches:ue,error:Se,route:Pe}=mt(z.pathname);return{matches:ue,pendingActionResult:[Pe.id,{type:Me.error,error:Se}]}}}let ie,le=Di(H,z);if(!le.route.action&&!le.route.lazy)ie={type:Me.error,error:Dt(405,{method:P.method,pathname:z.pathname,routeId:le.route.id})};else if(ie=(await $r("action",k,P,[le],H,null))[le.route.id],P.signal.aborted)return{shortCircuited:!0};if(Yr(ie)){let re;return oe&&oe.replace!=null?re=oe.replace:re=Sp(ie.response.headers.get("Location"),new URL(P.url),u)===k.location.pathname+k.location.search,await zn(P,ie,!0,{submission:$,replace:re}),{shortCircuited:!0}}if(cr(ie))throw Dt(400,{type:"defer-action"});if(Vt(ie)){let re=Qr(H,le.route.id);return(oe&&oe.replace)!==!0&&(E=st.Push),{matches:H,pendingActionResult:[re.route.id,ie]}}return{matches:H,pendingActionResult:[le.route.id,ie]}}async function Ce(P,z,$,H,ne,oe,xe,ie,le,re,ue){let Se=ne||ju(z,oe),Pe=oe||xe||Lp(Se),gt=!M&&(!d.v7_partialHydration||!le);if(H){if(gt){let Je=Ze(ue);Q(Ve({navigation:Se},Je!==void 0?{actionData:Je}:{}),{flushSync:re})}let Ae=await Dl($,z.pathname,P.signal);if(Ae.type==="aborted")return{shortCircuited:!0};if(Ae.type==="error"){let Je=Qr(Ae.partialMatches).route.id;return{matches:Ae.partialMatches,loaderData:{},errors:{[Je]:Ae.error}}}else if(Ae.matches)$=Ae.matches;else{let{error:Je,notFoundMatches:ys,route:fi}=mt(z.pathname);return{matches:ys,loaderData:{},errors:{[fi.id]:Je}}}}let Ue=o||a,[De,Ye]=wp(e.history,k,$,Pe,z,d.v7_partialHydration&&le===!0,d.v7_skipActionErrorRevalidation,U,D,q,F,O,ae,Ue,u,ue);if(bn(Ae=>!($&&$.some(Je=>Je.route.id===Ae))||De&&De.some(Je=>Je.route.id===Ae)),X=++B,De.length===0&&Ye.length===0){let Ae=Bt();return de(z,Ve({matches:$,loaderData:{},errors:ue&&Vt(ue[1])?{[ue[0]]:ue[1].error}:null},Tp(ue),Ae?{fetchers:new Map(k.fetchers)}:{}),{flushSync:re}),{shortCircuited:!0}}if(gt){let Ae={};if(!H){Ae.navigation=Se;let Je=Ze(ue);Je!==void 0&&(Ae.actionData=Je)}Ye.length>0&&(Ae.fetchers=Mr(Ye)),Q(Ae,{flushSync:re})}Ye.forEach(Ae=>{Ee(Ae.key),Ae.controller&&J.set(Ae.key,Ae.controller)});let xs=()=>Ye.forEach(Ae=>Ee(Ae.key));I&&I.signal.addEventListener("abort",xs);let{loaderResults:di,fetcherResults:Mn}=await Al(k,$,De,Ye,P);if(P.signal.aborted)return{shortCircuited:!0};I&&I.signal.removeEventListener("abort",xs),Ye.forEach(Ae=>J.delete(Ae.key));let Sn=ea(di);if(Sn)return await zn(P,Sn.result,!0,{replace:ie}),{shortCircuited:!0};if(Sn=ea(Mn),Sn)return ae.add(Sn.key),await zn(P,Sn.result,!0,{replace:ie}),{shortCircuited:!0};let{loaderData:Vo,errors:hi}=Cp(k,$,di,ue,Ye,Mn,Z);Z.forEach((Ae,Je)=>{Ae.subscribe(ys=>{(ys||Ae.done)&&Z.delete(Je)})}),d.v7_partialHydration&&le&&k.errors&&(hi=Ve({},k.errors,hi));let Fr=Bt(),zl=Zn(X),Ml=Fr||zl||Ye.length>0;return Ve({matches:$,loaderData:Vo,errors:hi},Ml?{fetchers:new Map(k.fetchers)}:{})}function Ze(P){if(P&&!Vt(P[1]))return{[P[0]]:P[1].data};if(k.actionData)return Object.keys(k.actionData).length===0?null:k.actionData}function Mr(P){return P.forEach(z=>{let $=k.fetchers.get(z.key),H=ki(void 0,$?$.data:void 0);k.fetchers.set(z.key,H)}),new Map(k.fetchers)}function Rl(P,z,$,H){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Ee(P);let ne=(H&&H.flushSync)===!0,oe=o||a,xe=_c(k.location,k.matches,u,d.v7_prependBasename,$,d.v7_relativeSplatPath,z,H==null?void 0:H.relative),ie=Vr(oe,xe,u),le=Il(ie,oe,xe);if(le.active&&le.matches&&(ie=le.matches),!ie){G(P,z,Dt(404,{pathname:xe}),{flushSync:ne});return}let{path:re,submission:ue,error:Se}=vp(d.v7_normalizeFormMethod,!0,xe,H);if(Se){G(P,z,Se,{flushSync:ne});return}let Pe=Di(ie,re),gt=(H&&H.preventScrollReset)===!0;if(ue&&mn(ue.formMethod)){Ll(P,z,re,Pe,ie,le.active,ne,gt,ue);return}O.set(P,{routeId:z,path:re}),Wo(P,z,re,Pe,ie,le.active,ne,gt,ue)}async function Ll(P,z,$,H,ne,oe,xe,ie,le){ci(),O.delete(P);function re(nt){if(!nt.route.action&&!nt.route.lazy){let vs=Dt(405,{method:le.formMethod,pathname:$,routeId:z});return G(P,z,vs,{flushSync:xe}),!0}return!1}if(!oe&&re(H))return;let ue=k.fetchers.get(P);_(P,d0(le,ue),{flushSync:xe});let Se=new AbortController,Pe=ws(e.history,$,Se.signal,le);if(oe){let nt=await Dl(ne,$,Pe.signal);if(nt.type==="aborted")return;if(nt.type==="error"){G(P,z,nt.error,{flushSync:xe});return}else if(nt.matches){if(ne=nt.matches,H=Di(ne,$),re(H))return}else{G(P,z,Dt(404,{pathname:$}),{flushSync:xe});return}}J.set(P,Se);let gt=B,De=(await $r("action",k,Pe,[H],ne,P))[H.route.id];if(Pe.signal.aborted){J.get(P)===Se&&J.delete(P);return}if(d.v7_fetcherPersist&&F.has(P)){if(Yr(De)||Vt(De)){_(P,rr(void 0));return}}else{if(Yr(De))if(J.delete(P),X>gt){_(P,rr(void 0));return}else return ae.add(P),_(P,ki(le)),zn(Pe,De,!1,{fetcherSubmission:le,preventScrollReset:ie});if(Vt(De)){G(P,z,De.error);return}}if(cr(De))throw Dt(400,{type:"defer-action"});let Ye=k.navigation.location||k.location,xs=ws(e.history,Ye,Se.signal),di=o||a,Mn=k.navigation.state!=="idle"?Vr(di,k.navigation.location,u):k.matches;we(Mn,"Didn't find any matches after fetcher action");let Sn=++B;S.set(P,Sn);let Vo=ki(le,De.data);k.fetchers.set(P,Vo);let[hi,Fr]=wp(e.history,k,Mn,le,Ye,!1,d.v7_skipActionErrorRevalidation,U,D,q,F,O,ae,di,u,[H.route.id,De]);Fr.filter(nt=>nt.key!==P).forEach(nt=>{let vs=nt.key,lf=k.fetchers.get(vs),Bj=ki(void 0,lf?lf.data:void 0);k.fetchers.set(vs,Bj),Ee(vs),nt.controller&&J.set(vs,nt.controller)}),Q({fetchers:new Map(k.fetchers)});let zl=()=>Fr.forEach(nt=>Ee(nt.key));Se.signal.addEventListener("abort",zl);let{loaderResults:Ml,fetcherResults:Ae}=await Al(k,Mn,hi,Fr,xs);if(Se.signal.aborted)return;Se.signal.removeEventListener("abort",zl),S.delete(P),J.delete(P),Fr.forEach(nt=>J.delete(nt.key));let Je=ea(Ml);if(Je)return zn(xs,Je.result,!1,{preventScrollReset:ie});if(Je=ea(Ae),Je)return ae.add(Je.key),zn(xs,Je.result,!1,{preventScrollReset:ie});let{loaderData:ys,errors:fi}=Cp(k,Mn,Ml,void 0,Fr,Ae,Z);if(k.fetchers.has(P)){let nt=rr(De.data);k.fetchers.set(P,nt)}Zn(Sn),k.navigation.state==="loading"&&Sn>X?(we(E,"Expected pending action"),I&&I.abort(),de(k.navigation.location,{matches:Mn,loaderData:ys,errors:fi,fetchers:new Map(k.fetchers)})):(Q({errors:fi,loaderData:Ep(k.loaderData,ys,Mn,fi),fetchers:new Map(k.fetchers)}),U=!1)}async function Wo(P,z,$,H,ne,oe,xe,ie,le){let re=k.fetchers.get(P);_(P,ki(le,re?re.data:void 0),{flushSync:xe});let ue=new AbortController,Se=ws(e.history,$,ue.signal);if(oe){let De=await Dl(ne,$,Se.signal);if(De.type==="aborted")return;if(De.type==="error"){G(P,z,De.error,{flushSync:xe});return}else if(De.matches)ne=De.matches,H=Di(ne,$);else{G(P,z,Dt(404,{pathname:$}),{flushSync:xe});return}}J.set(P,ue);let Pe=B,Ue=(await $r("loader",k,Se,[H],ne,P))[H.route.id];if(cr(Ue)&&(Ue=await ph(Ue,Se.signal,!0)||Ue),J.get(P)===ue&&J.delete(P),!Se.signal.aborted){if(F.has(P)){_(P,rr(void 0));return}if(Yr(Ue))if(X>Pe){_(P,rr(void 0));return}else{ae.add(P),await zn(Se,Ue,!1,{preventScrollReset:ie});return}if(Vt(Ue)){G(P,z,Ue.error);return}we(!cr(Ue),"Unhandled fetcher deferred data"),_(P,rr(Ue.data))}}async function zn(P,z,$,H){let{submission:ne,fetcherSubmission:oe,preventScrollReset:xe,replace:ie}=H===void 0?{}:H;z.response.headers.has("X-Remix-Revalidate")&&(U=!0);let le=z.response.headers.get("Location");we(le,"Expected a Location header on the redirect Response"),le=Sp(le,new URL(P.url),u);let re=dl(k.location,le,{_isRedirect:!0});if(n){let De=!1;if(z.response.headers.has("X-Remix-Reload-Document"))De=!0;else if(fh.test(le)){const Ye=e.history.createURL(le);De=Ye.origin!==t.location.origin||kn(Ye.pathname,u)==null}if(De){ie?t.location.replace(le):t.location.assign(le);return}}I=null;let ue=ie===!0||z.response.headers.has("X-Remix-Replace")?st.Replace:st.Push,{formMethod:Se,formAction:Pe,formEncType:gt}=k.navigation;!ne&&!oe&&Se&&Pe&&gt&&(ne=Lp(k.navigation));let Ue=ne||oe;if(Vk.has(z.response.status)&&Ue&&mn(Ue.formMethod))await Zt(ue,re,{submission:Ve({},Ue,{formAction:le}),preventScrollReset:xe||T,enableViewTransition:$?C:void 0});else{let De=ju(re,ne);await Zt(ue,re,{overrideNavigation:De,fetcherSubmission:oe,preventScrollReset:xe||T,enableViewTransition:$?C:void 0})}}async function $r(P,z,$,H,ne,oe){let xe,ie={};try{xe=await Zk(c,P,z,$,H,ne,oe,l,i)}catch(le){return H.forEach(re=>{ie[re.route.id]={type:Me.error,error:le}}),ie}for(let[le,re]of Object.entries(xe))if(i0(re)){let ue=re.result;ie[le]={type:Me.redirect,response:n0(ue,$,le,ne,u,d.v7_relativeSplatPath)}}else ie[le]=await t0(re);return ie}async function Al(P,z,$,H,ne){let oe=P.matches,xe=$r("loader",P,ne,$,z,null),ie=Promise.all(H.map(async ue=>{if(ue.matches&&ue.match&&ue.controller){let Pe=(await $r("loader",P,ws(e.history,ue.path,ue.controller.signal),[ue.match],ue.matches,ue.key))[ue.match.route.id];return{[ue.key]:Pe}}else return Promise.resolve({[ue.key]:{type:Me.error,error:Dt(404,{pathname:ue.path})}})})),le=await xe,re=(await ie).reduce((ue,Se)=>Object.assign(ue,Se),{});return await Promise.all([o0(z,le,ne.signal,oe,P.loaderData),u0(z,re,H)]),{loaderResults:le,fetcherResults:re}}function ci(){U=!0,D.push(...bn()),O.forEach((P,z)=>{J.has(z)&&q.add(z),Ee(z)})}function _(P,z,$){$===void 0&&($={}),k.fetchers.set(P,z),Q({fetchers:new Map(k.fetchers)},{flushSync:($&&$.flushSync)===!0})}function G(P,z,$,H){H===void 0&&(H={});let ne=Qr(k.matches,z);pe(P),Q({errors:{[ne.route.id]:$},fetchers:new Map(k.fetchers)},{flushSync:(H&&H.flushSync)===!0})}function fe(P){return d.v7_fetcherPersist&&(N.set(P,(N.get(P)||0)+1),F.has(P)&&F.delete(P)),k.fetchers.get(P)||Qk}function pe(P){let z=k.fetchers.get(P);J.has(P)&&!(z&&z.state==="loading"&&S.has(P))&&Ee(P),O.delete(P),S.delete(P),ae.delete(P),F.delete(P),q.delete(P),k.fetchers.delete(P)}function bt(P){if(d.v7_fetcherPersist){let z=(N.get(P)||0)-1;z<=0?(N.delete(P),F.add(P)):N.set(P,z)}else pe(P);Q({fetchers:new Map(k.fetchers)})}function Ee(P){let z=J.get(P);z&&(z.abort(),J.delete(P))}function pt(P){for(let z of P){let $=fe(z),H=rr($.data);k.fetchers.set(z,H)}}function Bt(){let P=[],z=!1;for(let $ of ae){let H=k.fetchers.get($);we(H,"Expected fetcher: "+$),H.state==="loading"&&(ae.delete($),P.push($),z=!0)}return pt(P),z}function Zn(P){let z=[];for(let[$,H]of S)if(H<P){let ne=k.fetchers.get($);we(ne,"Expected fetcher: "+$),ne.state==="loading"&&(Ee($),S.delete($),z.push($))}return pt(z),z.length>0}function _r(P,z){let $=k.blockers.get(P)||bs;return ce.get(P)!==z&&ce.set(P,z),$}function er(P){k.blockers.delete(P),ce.delete(P)}function Or(P,z){let $=k.blockers.get(P)||bs;we($.state==="unblocked"&&z.state==="blocked"||$.state==="blocked"&&z.state==="blocked"||$.state==="blocked"&&z.state==="proceeding"||$.state==="blocked"&&z.state==="unblocked"||$.state==="proceeding"&&z.state==="unblocked","Invalid blocker state transition: "+$.state+" -> "+z.state);let H=new Map(k.blockers);H.set(P,z),Q({blockers:H})}function gs(P){let{currentLocation:z,nextLocation:$,historyAction:H}=P;if(ce.size===0)return;ce.size>1&&Zs(!1,"A router only supports one blocker at a time");let ne=Array.from(ce.entries()),[oe,xe]=ne[ne.length-1],ie=k.blockers.get(oe);if(!(ie&&ie.state==="proceeding")&&xe({currentLocation:z,nextLocation:$,historyAction:H}))return oe}function mt(P){let z=Dt(404,{pathname:P}),$=o||a,{matches:H,route:ne}=Pp($);return bn(),{notFoundMatches:H,route:ne,error:z}}function bn(P){let z=[];return Z.forEach(($,H)=>{(!P||P(H))&&($.cancel(),z.push(H),Z.delete(H))}),z}function dn(P,z,$){if(p=P,w=z,g=$||null,!y&&k.navigation===vu){y=!0;let H=sf(k.location,k.matches);H!=null&&Q({restoreScrollPosition:H})}return()=>{p=null,w=null,g=null}}function rf(P,z){return g&&g(P,z.map(H=>bk(H,k.loaderData)))||P.key}function Oj(P,z){if(p&&w){let $=rf(P,z);p[$]=w()}}function sf(P,z){if(p){let $=rf(P,z),H=p[$];if(typeof H=="number")return H}return null}function Il(P,z,$){if(h)if(P){if(Object.keys(P[0].params).length>0)return{active:!0,matches:ka(z,$,u,!0)}}else return{active:!0,matches:ka(z,$,u,!0)||[]};return{active:!1,matches:null}}async function Dl(P,z,$){if(!h)return{type:"success",matches:P};let H=P;for(;;){let ne=o==null,oe=o||a,xe=l;try{await h({path:z,matches:H,patch:(re,ue)=>{$.aborted||bp(re,ue,oe,xe,i)}})}catch(re){return{type:"error",error:re,partialMatches:H}}finally{ne&&!$.aborted&&(a=[...a])}if($.aborted)return{type:"aborted"};let ie=Vr(oe,z,u);if(ie)return{type:"success",matches:ie};let le=ka(oe,z,u,!0);if(!le||H.length===le.length&&H.every((re,ue)=>re.route.id===le[ue].route.id))return{type:"success",matches:null};H=le}}function Fj(P){l={},o=Ja(P,i,void 0,l)}function Uj(P,z){let $=o==null;bp(P,z,o||a,l,i),$&&(a=[...a],Q({}))}return A={get basename(){return u},get future(){return d},get state(){return k},get routes(){return a},get window(){return t},initialize:tt,subscribe:ge,enableScrollRestoration:dn,navigate:ve,fetch:Rl,revalidate:ct,createHref:P=>e.history.createHref(P),encodeLocation:P=>e.history.encodeLocation(P),getFetcher:fe,deleteFetcher:bt,dispose:W,getBlocker:_r,deleteBlocker:er,patchRoutes:Uj,_internalFetchControllers:J,_internalActiveDeferreds:Z,_internalSetRoutes:Fj},A}function Kk(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function _c(e,t,n,r,i,l,a,o){let u,c;if(a){u=[];for(let d of t)if(u.push(d),d.route.id===a){c=d;break}}else u=t,c=t[t.length-1];let h=hh(i||".",dh(u,l),kn(e.pathname,n)||e.pathname,o==="path");if(i==null&&(h.search=e.search,h.hash=e.hash),(i==null||i===""||i===".")&&c){let d=mh(h.search);if(c.route.index&&!d)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&d){let f=new URLSearchParams(h.search),m=f.getAll("index");f.delete("index"),m.filter(g=>g).forEach(g=>f.append("index",g));let p=f.toString();h.search=p?"?"+p:""}}return r&&n!=="/"&&(h.pathname=h.pathname==="/"?n:Bn([n,h.pathname])),ls(h)}function vp(e,t,n,r){if(!r||!Kk(r))return{path:n};if(r.formMethod&&!a0(r.formMethod))return{path:n,error:Dt(405,{method:r.formMethod})};let i=()=>({path:n,error:Dt(400,{type:"invalid-body"})}),l=r.formMethod||"get",a=e?l.toUpperCase():l.toLowerCase(),o=ky(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!mn(a))return i();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,p)=>{let[g,w]=p;return""+m+g+"="+w+`
50
+ `},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:o,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!mn(a))return i();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:o,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return i()}}}we(typeof FormData=="function","FormData is not available in this environment");let u,c;if(r.formData)u=Fc(r.formData),c=r.formData;else if(r.body instanceof FormData)u=Fc(r.body),c=r.body;else if(r.body instanceof URLSearchParams)u=r.body,c=Np(u);else if(r.body==null)u=new URLSearchParams,c=new FormData;else try{u=new URLSearchParams(r.body),c=Np(u)}catch{return i()}let h={formMethod:a,formAction:o,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(mn(h.formMethod))return{path:n,submission:h};let d=Rr(n);return t&&d.search&&mh(d.search)&&u.append("index",""),d.search="?"+u,{path:ls(d),submission:h}}function jp(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(i=>i.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function wp(e,t,n,r,i,l,a,o,u,c,h,d,f,m,p,g){let w=g?Vt(g[1])?g[1].error:g[1].data:void 0,y=e.createURL(t.location),x=e.createURL(i),v=n;l&&t.errors?v=jp(n,Object.keys(t.errors)[0],!0):g&&Vt(g[1])&&(v=jp(n,g[0]));let b=g?g[1].statusCode:void 0,A=a&&b&&b>=400,k=v.filter((T,I)=>{let{route:C}=T;if(C.lazy)return!0;if(C.loader==null)return!1;if(l)return Oc(C,t.loaderData,t.errors);if(Yk(t.loaderData,t.matches[I],T)||u.some(M=>M===T.route.id))return!0;let R=t.matches[I],L=T;return kp(T,Ve({currentUrl:y,currentParams:R.params,nextUrl:x,nextParams:L.params},r,{actionResult:w,actionStatus:b,defaultShouldRevalidate:A?!1:o||y.pathname+y.search===x.pathname+x.search||y.search!==x.search||jy(R,L)}))}),E=[];return d.forEach((T,I)=>{if(l||!n.some(U=>U.route.id===T.routeId)||h.has(I))return;let C=Vr(m,T.path,p);if(!C){E.push({key:I,routeId:T.routeId,path:T.path,matches:null,match:null,controller:null});return}let R=t.fetchers.get(I),L=Di(C,T.path),M=!1;f.has(I)?M=!1:c.has(I)?(c.delete(I),M=!0):R&&R.state!=="idle"&&R.data===void 0?M=o:M=kp(L,Ve({currentUrl:y,currentParams:t.matches[t.matches.length-1].params,nextUrl:x,nextParams:n[n.length-1].params},r,{actionResult:w,actionStatus:b,defaultShouldRevalidate:A?!1:o})),M&&E.push({key:I,routeId:T.routeId,path:T.path,matches:C,match:L,controller:new AbortController})}),[k,E]}function Oc(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function Yk(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function jy(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function kp(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function bp(e,t,n,r,i){var l;let a;if(e){let c=r[e];we(c,"No route found to patch children into: routeId = "+e),c.children||(c.children=[]),a=c.children}else a=n;let o=t.filter(c=>!a.some(h=>wy(c,h))),u=Ja(o,i,[e||"_","patch",String(((l=a)==null?void 0:l.length)||"0")],r);a.push(...u)}function wy(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var i;return(i=t.children)==null?void 0:i.some(l=>wy(n,l))}):!1}async function Jk(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];we(i,"No route found in manifest");let l={};for(let a in r){let u=i[a]!==void 0&&a!=="hasErrorBoundary";Zs(!u,'Route "'+i.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!u&&!wk.has(a)&&(l[a]=r[a])}Object.assign(i,l),Object.assign(i,Ve({},t(i),{lazy:void 0}))}async function Xk(e){let{matches:t}=e,n=t.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,l,a)=>Object.assign(i,{[n[a].route.id]:l}),{})}async function Zk(e,t,n,r,i,l,a,o,u,c){let h=l.map(m=>m.route.lazy?Jk(m.route,u,o):void 0),d=l.map((m,p)=>{let g=h[p],w=i.some(x=>x.route.id===m.route.id);return Ve({},m,{shouldLoad:w,resolve:async x=>(x&&r.method==="GET"&&(m.route.lazy||m.route.loader)&&(w=!0),w?e0(t,r,m,g,x,c):Promise.resolve({type:Me.data,result:void 0}))})}),f=await e({matches:d,request:r,params:l[0].params,fetcherKey:a,context:c});try{await Promise.all(h)}catch{}return f}async function e0(e,t,n,r,i,l){let a,o,u=c=>{let h,d=new Promise((p,g)=>h=g);o=()=>h(),t.signal.addEventListener("abort",o);let f=p=>typeof c!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):c({request:t,params:n.params,context:l},...p!==void 0?[p]:[]),m=(async()=>{try{return{type:"data",result:await(i?i(g=>f(g)):f())}}catch(p){return{type:"error",result:p}}})();return Promise.race([m,d])};try{let c=n.route[e];if(r)if(c){let h,[d]=await Promise.all([u(c).catch(f=>{h=f}),r]);if(h!==void 0)throw h;a=d}else if(await r,c=n.route[e],c)a=await u(c);else if(e==="action"){let h=new URL(t.url),d=h.pathname+h.search;throw Dt(405,{method:t.method,pathname:d,routeId:n.route.id})}else return{type:Me.data,result:void 0};else if(c)a=await u(c);else{let h=new URL(t.url),d=h.pathname+h.search;throw Dt(404,{pathname:d})}we(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(c){return{type:Me.error,result:c}}finally{o&&t.signal.removeEventListener("abort",o)}return a}async function t0(e){let{result:t,type:n}=e;if(by(t)){let c;try{let h=t.headers.get("Content-Type");h&&/\bapplication\/json\b/.test(h)?t.body==null?c=null:c=await t.json():c=await t.text()}catch(h){return{type:Me.error,error:h}}return n===Me.error?{type:Me.error,error:new Za(t.status,t.statusText,c),statusCode:t.status,headers:t.headers}:{type:Me.data,data:c,statusCode:t.status,headers:t.headers}}if(n===Me.error){if(Rp(t)){var r;if(t.data instanceof Error){var i;return{type:Me.error,error:t.data,statusCode:(i=t.init)==null?void 0:i.status}}t=new Za(((r=t.init)==null?void 0:r.status)||500,void 0,t.data)}return{type:Me.error,error:t,statusCode:To(t)?t.status:void 0}}if(l0(t)){var l,a;return{type:Me.deferred,deferredData:t,statusCode:(l=t.init)==null?void 0:l.status,headers:((a=t.init)==null?void 0:a.headers)&&new Headers(t.init.headers)}}if(Rp(t)){var o,u;return{type:Me.data,data:t.data,statusCode:(o=t.init)==null?void 0:o.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}}return{type:Me.data,data:t}}function n0(e,t,n,r,i,l){let a=e.headers.get("Location");if(we(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!fh.test(a)){let o=r.slice(0,r.findIndex(u=>u.route.id===n)+1);a=_c(new URL(t.url),o,i,!0,a,l),e.headers.set("Location",a)}return e}function Sp(e,t,n){if(fh.test(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r),l=kn(i.pathname,n)!=null;if(i.origin===t.origin&&l)return i.pathname+i.search+i.hash}return e}function ws(e,t,n,r){let i=e.createURL(ky(t)).toString(),l={signal:n};if(r&&mn(r.formMethod)){let{formMethod:a,formEncType:o}=r;l.method=a.toUpperCase(),o==="application/json"?(l.headers=new Headers({"Content-Type":o}),l.body=JSON.stringify(r.json)):o==="text/plain"?l.body=r.text:o==="application/x-www-form-urlencoded"&&r.formData?l.body=Fc(r.formData):l.body=r.formData}return new Request(i,l)}function Fc(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Np(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function r0(e,t,n,r,i){let l={},a=null,o,u=!1,c={},h=n&&Vt(n[1])?n[1].error:void 0;return e.forEach(d=>{if(!(d.route.id in t))return;let f=d.route.id,m=t[f];if(we(!Yr(m),"Cannot handle redirect results in processLoaderData"),Vt(m)){let p=m.error;h!==void 0&&(p=h,h=void 0),a=a||{};{let g=Qr(e,f);a[g.route.id]==null&&(a[g.route.id]=p)}l[f]=void 0,u||(u=!0,o=To(m.error)?m.error.status:500),m.headers&&(c[f]=m.headers)}else cr(m)?(r.set(f,m.deferredData),l[f]=m.deferredData.data,m.statusCode!=null&&m.statusCode!==200&&!u&&(o=m.statusCode),m.headers&&(c[f]=m.headers)):(l[f]=m.data,m.statusCode&&m.statusCode!==200&&!u&&(o=m.statusCode),m.headers&&(c[f]=m.headers))}),h!==void 0&&n&&(a={[n[0]]:h},l[n[0]]=void 0),{loaderData:l,errors:a,statusCode:o||200,loaderHeaders:c}}function Cp(e,t,n,r,i,l,a){let{loaderData:o,errors:u}=r0(t,n,r,a);return i.forEach(c=>{let{key:h,match:d,controller:f}=c,m=l[h];if(we(m,"Did not find corresponding fetcher result"),!(f&&f.signal.aborted))if(Vt(m)){let p=Qr(e.matches,d==null?void 0:d.route.id);u&&u[p.route.id]||(u=Ve({},u,{[p.route.id]:m.error})),e.fetchers.delete(h)}else if(Yr(m))we(!1,"Unhandled fetcher revalidation redirect");else if(cr(m))we(!1,"Unhandled fetcher deferred data");else{let p=rr(m.data);e.fetchers.set(h,p)}}),{loaderData:o,errors:u}}function Ep(e,t,n,r){let i=Ve({},t);for(let l of n){let a=l.route.id;if(t.hasOwnProperty(a)?t[a]!==void 0&&(i[a]=t[a]):e[a]!==void 0&&l.route.loader&&(i[a]=e[a]),r&&r.hasOwnProperty(a))break}return i}function Tp(e){return e?Vt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Qr(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Pp(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Dt(e,t){let{pathname:n,routeId:r,method:i,type:l,message:a}=t===void 0?{}:t,o="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(o="Bad Request",i&&n&&r?u="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":l==="defer-action"?u="defer() is not supported in actions":l==="invalid-body"&&(u="Unable to encode submission body")):e===403?(o="Forbidden",u='Route "'+r+'" does not match URL "'+n+'"'):e===404?(o="Not Found",u='No route matches URL "'+n+'"'):e===405&&(o="Method Not Allowed",i&&n&&r?u="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(u='Invalid request method "'+i.toUpperCase()+'"')),new Za(e||500,o,new Error(u),!0)}function ea(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(Yr(i))return{key:r,result:i}}}function ky(e){let t=typeof e=="string"?Rr(e):e;return ls(Ve({},t,{hash:""}))}function s0(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function i0(e){return by(e.result)&&Wk.has(e.result.status)}function cr(e){return e.type===Me.deferred}function Vt(e){return e.type===Me.error}function Yr(e){return(e&&e.type)===Me.redirect}function Rp(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function l0(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function by(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function a0(e){return Hk.has(e.toLowerCase())}function mn(e){return Uk.has(e.toLowerCase())}async function o0(e,t,n,r,i){let l=Object.entries(t);for(let a=0;a<l.length;a++){let[o,u]=l[a],c=e.find(f=>(f==null?void 0:f.route.id)===o);if(!c)continue;let h=r.find(f=>f.route.id===c.route.id),d=h!=null&&!jy(h,c)&&(i&&i[c.route.id])!==void 0;cr(u)&&d&&await ph(u,n,!1).then(f=>{f&&(t[o]=f)})}}async function u0(e,t,n){for(let r=0;r<n.length;r++){let{key:i,routeId:l,controller:a}=n[r],o=t[i];e.find(c=>(c==null?void 0:c.route.id)===l)&&cr(o)&&(we(a,"Expected an AbortController for revalidating fetcher deferred result"),await ph(o,a.signal,!0).then(c=>{c&&(t[i]=c)}))}}async function ph(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Me.data,data:e.deferredData.unwrappedData}}catch(i){return{type:Me.error,error:i}}return{type:Me.data,data:e.deferredData.data}}}function mh(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Di(e,t){let n=typeof t=="string"?Rr(t).search:t.search;if(e[e.length-1].route.index&&mh(n||""))return e[e.length-1];let r=xy(e);return r[r.length-1]}function Lp(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:l,json:a}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(l!=null)return{formMethod:t,formAction:n,formEncType:r,formData:l,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function ju(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function c0(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function ki(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function d0(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function rr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function h0(e,t){try{let n=e.sessionStorage.getItem(vy);if(n){let r=JSON.parse(n);for(let[i,l]of Object.entries(r||{}))l&&Array.isArray(l)&&t.set(i,new Set(l||[]))}}catch{}}function f0(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(vy,JSON.stringify(n))}catch(r){Zs(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
51
51
  * React Router v6.28.0
52
52
  *
53
53
  * Copyright (c) Remix Software Inc.
@@ -56,7 +56,7 @@ Error generating stack: `+l.message+`
56
56
  * LICENSE.md file in the root directory of this source tree.
57
57
  *
58
58
  * @license MIT
59
- */function Zs(){return Zs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zs.apply(this,arguments)}const wl=j.createContext(null),mh=j.createContext(null),Lr=j.createContext(null),gh=j.createContext(null),Gn=j.createContext({outlet:null,matches:[],isDataRoute:!1}),wy=j.createContext(null);function u0(e,t){let{relative:n}=t===void 0?{}:t;kl()||we(!1);let{basename:r,navigator:i}=j.useContext(Lr),{hash:l,pathname:a,search:o}=Po(e,{relative:n}),u=a;return r!=="/"&&(u=a==="/"?r:Bn([r,a])),i.createHref({pathname:u,search:o,hash:l})}function kl(){return j.useContext(gh)!=null}function Kn(){return kl()||we(!1),j.useContext(gh).location}function ky(e){j.useContext(Lr).static||j.useLayoutEffect(e)}function ut(){let{isDataRoute:e}=j.useContext(Gn);return e?k0():c0()}function c0(){kl()||we(!1);let e=j.useContext(wl),{basename:t,future:n,navigator:r}=j.useContext(Lr),{matches:i}=j.useContext(Gn),{pathname:l}=Kn(),a=JSON.stringify(ch(i,n.v7_relativeSplatPath)),o=j.useRef(!1);return ky(()=>{o.current=!0}),j.useCallback(function(c,h){if(h===void 0&&(h={}),!o.current)return;if(typeof c=="number"){r.go(c);return}let d=dh(c,JSON.parse(a),l,h.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Bn([t,d.pathname])),(h.replace?r.replace:r.push)(d,h.state,h)},[t,r,a,l,e])}const d0=j.createContext(null);function h0(e){let t=j.useContext(Gn).outlet;return t&&j.createElement(d0.Provider,{value:e},t)}function li(){let{matches:e}=j.useContext(Gn),t=e[e.length-1];return t?t.params:{}}function Po(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=j.useContext(Lr),{matches:i}=j.useContext(Gn),{pathname:l}=Kn(),a=JSON.stringify(ch(i,r.v7_relativeSplatPath));return j.useMemo(()=>dh(e,JSON.parse(a),l,n==="path"),[e,a,l,n])}function f0(e,t,n,r){kl()||we(!1);let{navigator:i}=j.useContext(Lr),{matches:l}=j.useContext(Gn),a=l[l.length-1],o=a?a.params:{};a&&a.pathname;let u=a?a.pathnameBase:"/";a&&a.route;let c=Kn(),h;h=c;let d=h.pathname||"/",f=d;if(u!=="/"){let g=u.replace(/^\//,"").split("/");f="/"+d.replace(/^\//,"").split("/").slice(g.length).join("/")}let m=Wr(e,{pathname:f});return y0(m&&m.map(g=>Object.assign({},g,{params:Object.assign({},o,g.params),pathname:Bn([u,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?u:Bn([u,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),l,n,r)}function p0(){let e=j0(),t=To(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),n?j.createElement("pre",{style:i},n):null,null)}const m0=j.createElement(p0,null);class g0 extends j.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?j.createElement(Gn.Provider,{value:this.props.routeContext},j.createElement(wy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function x0(e){let{routeContext:t,match:n,children:r}=e,i=j.useContext(wl);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),j.createElement(Gn.Provider,{value:t},r)}function y0(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var l;if(!n)return null;if(n.errors)e=n.matches;else if((l=r)!=null&&l.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=(i=n)==null?void 0:i.errors;if(o!=null){let h=a.findIndex(d=>d.route.id&&(o==null?void 0:o[d.route.id])!==void 0);h>=0||we(!1),a=a.slice(0,Math.min(a.length,h+1))}let u=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h<a.length;h++){let d=a[h];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=h),d.route.id){let{loaderData:f,errors:m}=n,p=d.route.loader&&f[d.route.id]===void 0&&(!m||m[d.route.id]===void 0);if(d.route.lazy||p){u=!0,c>=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((h,d,f)=>{let m,p=!1,g=null,w=null;n&&(m=o&&d.route.id?o[d.route.id]:void 0,g=d.route.errorElement||m0,u&&(c<0&&f===0?(b0("route-fallback"),p=!0,w=null):c===f&&(p=!0,w=d.route.hydrateFallbackElement||null)));let y=t.concat(a.slice(0,f+1)),x=()=>{let v;return m?v=g:p?v=w:d.route.Component?v=j.createElement(d.route.Component,null):d.route.element?v=d.route.element:v=h,j.createElement(x0,{match:d,routeContext:{outlet:h,matches:y,isDataRoute:n!=null},children:v})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?j.createElement(g0,{location:n.location,revalidation:n.revalidation,component:g,error:m,children:x(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):x()},null)}var by=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(by||{}),Sy=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}(Sy||{});function Ny(e){let t=j.useContext(wl);return t||we(!1),t}function Cy(e){let t=j.useContext(mh);return t||we(!1),t}function v0(e){let t=j.useContext(Gn);return t||we(!1),t}function Ey(e){let t=v0(),n=t.matches[t.matches.length-1];return n.route.id||we(!1),n.route.id}function j0(){var e;let t=j.useContext(wy),n=Cy(),r=Ey();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}let w0=0;function xh(e){let{router:t,basename:n}=Ny(by.UseBlocker),r=Cy(Sy.UseBlocker),[i,l]=j.useState(""),a=j.useCallback(o=>{if(typeof e!="function")return!!e;if(n==="/")return e(o);let{currentLocation:u,nextLocation:c,historyAction:h}=o;return e({currentLocation:Zs({},u,{pathname:wn(u.pathname,n)||u.pathname}),nextLocation:Zs({},c,{pathname:wn(c.pathname,n)||c.pathname}),historyAction:h})},[n,e]);return j.useEffect(()=>{let o=String(++w0);return l(o),()=>t.deleteBlocker(o)},[t]),j.useEffect(()=>{i!==""&&t.getBlocker(i,a)},[t,i,a]),i&&r.blockers.has(i)?r.blockers.get(i):ks}function k0(){let{router:e}=Ny(),t=Ey(),n=j.useRef(!1);return ky(()=>{n.current=!0}),j.useCallback(function(i,l){l===void 0&&(l={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Zs({fromRouteId:t},l)))},[e,t])}const Rp={};function b0(e,t,n){Rp[e]||(Rp[e]=!0)}const Lp={};function S0(e,t){Lp[t]||(Lp[t]=!0,console.warn(t))}const ws=(e,t,n)=>S0(e,"⚠️ React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function N0(e,t){e!=null&&e.v7_startTransition||ws("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),!(e!=null&&e.v7_relativeSplatPath)&&(!t||!t.v7_relativeSplatPath)&&ws("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"),t&&(t.v7_fetcherPersist||ws("v7_fetcherPersist","The persistence behavior of fetchers is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"),t.v7_normalizeFormMethod||ws("v7_normalizeFormMethod","Casing of `formMethod` fields is being normalized to uppercase in v7","https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"),t.v7_partialHydration||ws("v7_partialHydration","`RouterProvider` hydration behavior is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_partialhydration"),t.v7_skipActionErrorRevalidation||ws("v7_skipActionErrorRevalidation","The revalidation behavior after 4xx/5xx `action` responses is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation"))}function C0(e){return h0(e.context)}function E0(e){let{basename:t="/",children:n=null,location:r,navigationType:i=st.Pop,navigator:l,static:a=!1,future:o}=e;kl()&&we(!1);let u=t.replace(/^\/*/,"/"),c=j.useMemo(()=>({basename:u,navigator:l,static:a,future:Zs({v7_relativeSplatPath:!1},o)}),[u,o,l,a]);typeof r=="string"&&(r=Rr(r));let{pathname:h="/",search:d="",hash:f="",state:m=null,key:p="default"}=r,g=j.useMemo(()=>{let w=wn(h,u);return w==null?null:{location:{pathname:w,search:d,hash:f,state:m,key:p},navigationType:i}},[u,h,d,f,m,p,i]);return g==null?null:j.createElement(Lr.Provider,{value:c},j.createElement(gh.Provider,{children:n,value:g}))}new Promise(()=>{});function T0(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:j.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:j.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:j.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
59
+ */function ei(){return ei=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ei.apply(this,arguments)}const wl=j.createContext(null),gh=j.createContext(null),Lr=j.createContext(null),xh=j.createContext(null),Kn=j.createContext({outlet:null,matches:[],isDataRoute:!1}),Sy=j.createContext(null);function p0(e,t){let{relative:n}=t===void 0?{}:t;kl()||we(!1);let{basename:r,navigator:i}=j.useContext(Lr),{hash:l,pathname:a,search:o}=Po(e,{relative:n}),u=a;return r!=="/"&&(u=a==="/"?r:Bn([r,a])),i.createHref({pathname:u,search:o,hash:l})}function kl(){return j.useContext(xh)!=null}function Yn(){return kl()||we(!1),j.useContext(xh).location}function Ny(e){j.useContext(Lr).static||j.useLayoutEffect(e)}function ut(){let{isDataRoute:e}=j.useContext(Kn);return e?E0():m0()}function m0(){kl()||we(!1);let e=j.useContext(wl),{basename:t,future:n,navigator:r}=j.useContext(Lr),{matches:i}=j.useContext(Kn),{pathname:l}=Yn(),a=JSON.stringify(dh(i,n.v7_relativeSplatPath)),o=j.useRef(!1);return Ny(()=>{o.current=!0}),j.useCallback(function(c,h){if(h===void 0&&(h={}),!o.current)return;if(typeof c=="number"){r.go(c);return}let d=hh(c,JSON.parse(a),l,h.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Bn([t,d.pathname])),(h.replace?r.replace:r.push)(d,h.state,h)},[t,r,a,l,e])}const g0=j.createContext(null);function x0(e){let t=j.useContext(Kn).outlet;return t&&j.createElement(g0.Provider,{value:e},t)}function ai(){let{matches:e}=j.useContext(Kn),t=e[e.length-1];return t?t.params:{}}function Po(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=j.useContext(Lr),{matches:i}=j.useContext(Kn),{pathname:l}=Yn(),a=JSON.stringify(dh(i,r.v7_relativeSplatPath));return j.useMemo(()=>hh(e,JSON.parse(a),l,n==="path"),[e,a,l,n])}function y0(e,t,n,r){kl()||we(!1);let{navigator:i}=j.useContext(Lr),{matches:l}=j.useContext(Kn),a=l[l.length-1],o=a?a.params:{};a&&a.pathname;let u=a?a.pathnameBase:"/";a&&a.route;let c=Yn(),h;h=c;let d=h.pathname||"/",f=d;if(u!=="/"){let g=u.replace(/^\//,"").split("/");f="/"+d.replace(/^\//,"").split("/").slice(g.length).join("/")}let m=Vr(e,{pathname:f});return b0(m&&m.map(g=>Object.assign({},g,{params:Object.assign({},o,g.params),pathname:Bn([u,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?u:Bn([u,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),l,n,r)}function v0(){let e=N0(),t=To(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),n?j.createElement("pre",{style:i},n):null,null)}const j0=j.createElement(v0,null);class w0 extends j.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?j.createElement(Kn.Provider,{value:this.props.routeContext},j.createElement(Sy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function k0(e){let{routeContext:t,match:n,children:r}=e,i=j.useContext(wl);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),j.createElement(Kn.Provider,{value:t},r)}function b0(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var l;if(!n)return null;if(n.errors)e=n.matches;else if((l=r)!=null&&l.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=(i=n)==null?void 0:i.errors;if(o!=null){let h=a.findIndex(d=>d.route.id&&(o==null?void 0:o[d.route.id])!==void 0);h>=0||we(!1),a=a.slice(0,Math.min(a.length,h+1))}let u=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h<a.length;h++){let d=a[h];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=h),d.route.id){let{loaderData:f,errors:m}=n,p=d.route.loader&&f[d.route.id]===void 0&&(!m||m[d.route.id]===void 0);if(d.route.lazy||p){u=!0,c>=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((h,d,f)=>{let m,p=!1,g=null,w=null;n&&(m=o&&d.route.id?o[d.route.id]:void 0,g=d.route.errorElement||j0,u&&(c<0&&f===0?(T0("route-fallback"),p=!0,w=null):c===f&&(p=!0,w=d.route.hydrateFallbackElement||null)));let y=t.concat(a.slice(0,f+1)),x=()=>{let v;return m?v=g:p?v=w:d.route.Component?v=j.createElement(d.route.Component,null):d.route.element?v=d.route.element:v=h,j.createElement(k0,{match:d,routeContext:{outlet:h,matches:y,isDataRoute:n!=null},children:v})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?j.createElement(w0,{location:n.location,revalidation:n.revalidation,component:g,error:m,children:x(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):x()},null)}var Cy=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Cy||{}),Ey=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}(Ey||{});function Ty(e){let t=j.useContext(wl);return t||we(!1),t}function Py(e){let t=j.useContext(gh);return t||we(!1),t}function S0(e){let t=j.useContext(Kn);return t||we(!1),t}function Ry(e){let t=S0(),n=t.matches[t.matches.length-1];return n.route.id||we(!1),n.route.id}function N0(){var e;let t=j.useContext(Sy),n=Py(),r=Ry();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}let C0=0;function yh(e){let{router:t,basename:n}=Ty(Cy.UseBlocker),r=Py(Ey.UseBlocker),[i,l]=j.useState(""),a=j.useCallback(o=>{if(typeof e!="function")return!!e;if(n==="/")return e(o);let{currentLocation:u,nextLocation:c,historyAction:h}=o;return e({currentLocation:ei({},u,{pathname:kn(u.pathname,n)||u.pathname}),nextLocation:ei({},c,{pathname:kn(c.pathname,n)||c.pathname}),historyAction:h})},[n,e]);return j.useEffect(()=>{let o=String(++C0);return l(o),()=>t.deleteBlocker(o)},[t]),j.useEffect(()=>{i!==""&&t.getBlocker(i,a)},[t,i,a]),i&&r.blockers.has(i)?r.blockers.get(i):bs}function E0(){let{router:e}=Ty(),t=Ry(),n=j.useRef(!1);return Ny(()=>{n.current=!0}),j.useCallback(function(i,l){l===void 0&&(l={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,ei({fromRouteId:t},l)))},[e,t])}const Ap={};function T0(e,t,n){Ap[e]||(Ap[e]=!0)}const Ip={};function P0(e,t){Ip[t]||(Ip[t]=!0,console.warn(t))}const ks=(e,t,n)=>P0(e,"⚠️ React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function R0(e,t){e!=null&&e.v7_startTransition||ks("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),!(e!=null&&e.v7_relativeSplatPath)&&(!t||!t.v7_relativeSplatPath)&&ks("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"),t&&(t.v7_fetcherPersist||ks("v7_fetcherPersist","The persistence behavior of fetchers is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"),t.v7_normalizeFormMethod||ks("v7_normalizeFormMethod","Casing of `formMethod` fields is being normalized to uppercase in v7","https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"),t.v7_partialHydration||ks("v7_partialHydration","`RouterProvider` hydration behavior is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_partialhydration"),t.v7_skipActionErrorRevalidation||ks("v7_skipActionErrorRevalidation","The revalidation behavior after 4xx/5xx `action` responses is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation"))}function L0(e){return x0(e.context)}function A0(e){let{basename:t="/",children:n=null,location:r,navigationType:i=st.Pop,navigator:l,static:a=!1,future:o}=e;kl()&&we(!1);let u=t.replace(/^\/*/,"/"),c=j.useMemo(()=>({basename:u,navigator:l,static:a,future:ei({v7_relativeSplatPath:!1},o)}),[u,o,l,a]);typeof r=="string"&&(r=Rr(r));let{pathname:h="/",search:d="",hash:f="",state:m=null,key:p="default"}=r,g=j.useMemo(()=>{let w=kn(h,u);return w==null?null:{location:{pathname:w,search:d,hash:f,state:m,key:p},navigationType:i}},[u,h,d,f,m,p,i]);return g==null?null:j.createElement(Lr.Provider,{value:c},j.createElement(xh.Provider,{children:n,value:g}))}new Promise(()=>{});function I0(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:j.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:j.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:j.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
60
60
  * React Router DOM v6.28.0
61
61
  *
62
62
  * Copyright (c) Remix Software Inc.
@@ -65,7 +65,7 @@ Error generating stack: `+l.message+`
65
65
  * LICENSE.md file in the root directory of this source tree.
66
66
  *
67
67
  * @license MIT
68
- */function ei(){return ei=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ei.apply(this,arguments)}function Ty(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,l;for(l=0;l<r.length;l++)i=r[l],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function P0(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function R0(e,t){return e.button===0&&(!t||t==="_self")&&!P0(e)}function Fc(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function L0(e,t){let n=Fc(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(l=>{n.append(i,l)})}),n}const A0=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],I0=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],D0="6";try{window.__reactRouterVersion=D0}catch{}function z0(e,t){return Hk({basename:t==null?void 0:t.basename,future:ei({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:fk({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||M0(),routes:e,mapRouteProperties:T0,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function M0(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=ei({},t,{errors:$0(t.errors)})),t}function $0(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new Za(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let l=window[i.__subType];if(typeof l=="function")try{let a=new l(i.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let l=new Error(i.message);l.stack="",n[r]=l}}else n[r]=i;return n}const Py=j.createContext({isTransitioning:!1}),_0=j.createContext(new Map),O0="startTransition",Ap=ew[O0],F0="flushSync",Ip=hk[F0];function U0(e){Ap?Ap(e):e()}function bi(e){Ip?Ip(e):e()}class B0{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function H0(e){let{fallbackElement:t,router:n,future:r}=e,[i,l]=j.useState(n.state),[a,o]=j.useState(),[u,c]=j.useState({isTransitioning:!1}),[h,d]=j.useState(),[f,m]=j.useState(),[p,g]=j.useState(),w=j.useRef(new Map),{v7_startTransition:y}=r||{},x=j.useCallback(T=>{y?U0(T):T()},[y]),v=j.useCallback((T,I)=>{let{deletedFetchers:C,flushSync:R,viewTransitionOpts:L}=I;C.forEach(U=>w.current.delete(U)),T.fetchers.forEach((U,D)=>{U.data!==void 0&&w.current.set(D,U.data)});let M=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!L||M){R?bi(()=>l(T)):x(()=>l(T));return}if(R){bi(()=>{f&&(h&&h.resolve(),f.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let U=n.window.document.startViewTransition(()=>{bi(()=>l(T))});U.finished.finally(()=>{bi(()=>{d(void 0),m(void 0),o(void 0),c({isTransitioning:!1})})}),bi(()=>m(U));return}f?(h&&h.resolve(),f.skipTransition(),g({state:T,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(o(T),c({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[n.window,f,h,w,x]);j.useLayoutEffect(()=>n.subscribe(v),[n,v]),j.useEffect(()=>{u.isTransitioning&&!u.flushSync&&d(new B0)},[u]),j.useEffect(()=>{if(h&&a&&n.window){let T=a,I=h.promise,C=n.window.document.startViewTransition(async()=>{x(()=>l(T)),await I});C.finished.finally(()=>{d(void 0),m(void 0),o(void 0),c({isTransitioning:!1})}),m(C)}},[x,a,h,n.window]),j.useEffect(()=>{h&&a&&i.location.key===a.location.key&&h.resolve()},[h,f,i.location,a]),j.useEffect(()=>{!u.isTransitioning&&p&&(o(p.state),c({isTransitioning:!0,flushSync:!1,currentLocation:p.currentLocation,nextLocation:p.nextLocation}),g(void 0))},[u.isTransitioning,p]),j.useEffect(()=>{},[]);let b=j.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:T=>n.navigate(T),push:(T,I,C)=>n.navigate(T,{state:I,preventScrollReset:C==null?void 0:C.preventScrollReset}),replace:(T,I,C)=>n.navigate(T,{replace:!0,state:I,preventScrollReset:C==null?void 0:C.preventScrollReset})}),[n]),A=n.basename||"/",k=j.useMemo(()=>({router:n,navigator:b,static:!1,basename:A}),[n,b,A]),E=j.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return j.useEffect(()=>N0(r,n.future),[r,n.future]),j.createElement(j.Fragment,null,j.createElement(wl.Provider,{value:k},j.createElement(mh.Provider,{value:i},j.createElement(_0.Provider,{value:w.current},j.createElement(Py.Provider,{value:u},j.createElement(E0,{basename:A,location:i.location,navigationType:i.historyAction,navigator:b,future:E},i.initialized||n.future.v7_partialHydration?j.createElement(W0,{routes:n.routes,future:n.future,state:i}):t))))),null)}const W0=j.memo(V0);function V0(e){let{routes:t,future:n,state:r}=e;return f0(t,void 0,r,n)}const Q0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",q0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ye=j.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:l,replace:a,state:o,target:u,to:c,preventScrollReset:h,viewTransition:d}=t,f=Ty(t,A0),{basename:m}=j.useContext(Lr),p,g=!1;if(typeof c=="string"&&q0.test(c)&&(p=c,Q0))try{let v=new URL(window.location.href),b=c.startsWith("//")?new URL(v.protocol+c):new URL(c),A=wn(b.pathname,m);b.origin===v.origin&&A!=null?c=A+b.search+b.hash:g=!0}catch{}let w=u0(c,{relative:i}),y=Y0(c,{replace:a,state:o,target:u,preventScrollReset:h,relative:i,viewTransition:d});function x(v){r&&r(v),v.defaultPrevented||y(v)}return j.createElement("a",ei({},f,{href:p||w,onClick:g||l?r:x,ref:n,target:u}))}),G0=j.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:l="",end:a=!1,style:o,to:u,viewTransition:c,children:h}=t,d=Ty(t,I0),f=Po(u,{relative:d.relative}),m=Kn(),p=j.useContext(mh),{navigator:g,basename:w}=j.useContext(Lr),y=p!=null&&J0(f)&&c===!0,x=g.encodeLocation?g.encodeLocation(f).pathname:f.pathname,v=m.pathname,b=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;i||(v=v.toLowerCase(),b=b?b.toLowerCase():null,x=x.toLowerCase()),b&&w&&(b=wn(b,w)||b);const A=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let k=v===x||!a&&v.startsWith(x)&&v.charAt(A)==="/",E=b!=null&&(b===x||!a&&b.startsWith(x)&&b.charAt(x.length)==="/"),T={isActive:k,isPending:E,isTransitioning:y},I=k?r:void 0,C;typeof l=="function"?C=l(T):C=[l,k?"active":null,E?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let R=typeof o=="function"?o(T):o;return j.createElement(ye,ei({},d,{"aria-current":I,className:C,ref:n,style:R,to:u,viewTransition:c}),typeof h=="function"?h(T):h)});var Uc;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Uc||(Uc={}));var Dp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Dp||(Dp={}));function K0(e){let t=j.useContext(wl);return t||we(!1),t}function Y0(e,t){let{target:n,replace:r,state:i,preventScrollReset:l,relative:a,viewTransition:o}=t===void 0?{}:t,u=ut(),c=Kn(),h=Po(e,{relative:a});return j.useCallback(d=>{if(R0(d,n)){d.preventDefault();let f=r!==void 0?r:is(c)===is(h);u(e,{replace:f,state:i,preventScrollReset:l,relative:a,viewTransition:o})}},[c,u,h,r,i,n,e,l,a,o])}function yh(e){let t=j.useRef(Fc(e)),n=j.useRef(!1),r=Kn(),i=j.useMemo(()=>L0(r.search,n.current?null:t.current),[r.search]),l=ut(),a=j.useCallback((o,u)=>{const c=Fc(typeof o=="function"?o(i):o);n.current=!0,l("?"+c,u)},[l,i]);return[i,a]}function J0(e,t){t===void 0&&(t={});let n=j.useContext(Py);n==null&&we(!1);let{basename:r}=K0(Uc.useViewTransitionState),i=Po(e,{relative:t.relative});if(!n.isTransitioning)return!1;let l=wn(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=wn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Xa(i.pathname,a)!=null||Xa(i.pathname,l)!=null}class eo extends Error{constructor(t,n){super(n),this.status=t}}const Bc="qa-studio:server-down";async function X0(){try{return(await fetch("/api/health",{cache:"no-store"})).ok}catch{return!1}}async function ie(e,t,n){let r;try{r=await fetch(t,{method:e,headers:n===void 0?void 0:{"Content-Type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)})}catch{throw window.dispatchEvent(new Event(Bc)),new eo(0,"Agent Studio server is not reachable. Is it running?")}if(r.status===204)return;const i=await r.json().catch(()=>({}));if(!r.ok)throw new eo(r.status,Array.isArray(i.message)?i.message.join(", "):i.message??r.statusText);return i}const _e=encodeURIComponent,ju=e=>Object.entries(e).filter(([,t])=>t!==void 0&&t!=="").map(([t,n])=>`${_e(t)}=${_e(String(n))}`).join("&"),Q={dashboard:()=>ie("GET","/api/dashboard"),specs:()=>ie("GET","/api/specs"),spec:e=>ie("GET",`/api/specs/${_e(e)}`),createSpec:(e,t)=>ie("POST","/api/specs",{file:e,content:t}),saveSpec:(e,t,n)=>ie("PUT",`/api/specs/${_e(e)}`,{content:t,baseMtime:n}),deleteSpec:e=>ie("DELETE",`/api/specs/${_e(e)}`),mapping:()=>ie("GET","/api/mapping"),mappingPage:e=>ie("GET",`/api/mapping/page?${ju(e)}`),jobs:()=>ie("GET","/api/jobs"),jobsPage:e=>ie("GET",`/api/jobs?${ju(e)}`),job:e=>ie("GET",`/api/jobs/${e}`),agentRun:(e,t)=>ie("GET",`/api/jobs/${e}/agents/${t}`),createJob:e=>ie("POST","/api/jobs",e),cancelJob:e=>ie("POST",`/api/jobs/${e}/cancel`),approveJob:e=>ie("POST",`/api/jobs/${e}/approve`),rerunFailedJob:e=>ie("POST",`/api/jobs/${e}/rerun-failed`),rejectJob:(e,t)=>ie("POST",`/api/jobs/${e}/reject`,{reason:t}),answerJob:(e,t)=>ie("POST",`/api/jobs/${e}/answer`,{answers:t}),jobRequirement:e=>ie("GET",`/api/jobs/${e}/requirement`),settings:()=>ie("GET","/api/settings"),saveSettings:e=>ie("PUT","/api/settings",e),usage:e=>ie("GET",`/api/usage?days=${e}`),searchTestCases:e=>ie("POST","/api/test-cases/search",e),testRuns:e=>ie("GET",`/api/test-runs?${ju(e)}`),claudeMd:()=>ie("GET","/api/project/claude-md"),uploadClaudeMd:e=>ie("POST","/api/project/claude-md",{content:e}),resetPlan:e=>ie("GET",`/api/project/reset/plan${e?`?terms=${_e(e)}`:""}`),resetProject:e=>ie("POST","/api/project/reset",e),updateStatus:()=>ie("GET","/api/update"),startUpdate:()=>ie("POST","/api/update"),claudeStatus:()=>ie("GET","/api/claude/status"),claudeTest:()=>ie("POST","/api/claude/test"),agentPrompts:()=>ie("GET","/api/agents/prompts"),saveAgentPrompt:(e,t)=>ie("PUT",`/api/agents/prompts/${_e(e)}`,{instructions:t}),resetAgentPrompt:e=>ie("DELETE",`/api/agents/prompts/${_e(e)}`),saveAgentModel:(e,t)=>ie("PUT",`/api/agents/prompts/${_e(e)}/model`,{model:t}),resetAgentModel:e=>ie("DELETE",`/api/agents/prompts/${_e(e)}/model`),skills:()=>ie("GET","/api/agents/skills"),customAgents:()=>ie("GET","/api/agents/custom"),customAgent:e=>ie("GET",`/api/agents/custom/${_e(e)}`),createCustomAgent:e=>ie("POST","/api/agents/custom",e),saveCustomAgent:(e,t,n)=>ie("PUT",`/api/agents/custom/${_e(e)}`,{...t,baseUpdatedAt:n}),deleteCustomAgent:e=>ie("DELETE",`/api/agents/custom/${_e(e)}`),previewCustomAgent:(e,t)=>ie("POST",e?`/api/agents/custom/${_e(e)}/preview`:"/api/agents/custom/preview",t),exportProject:async(e={})=>{const t=new URLSearchParams;e.jobs&&t.set("jobs","1"),e.chats&&t.set("chats","1");const n=t.toString(),r=await fetch(`/api/project/export${n?`?${n}`:""}`);if(!r.ok)throw new eo(r.status,(await r.json().catch(()=>({}))).message??r.statusText);return r.blob()},importProject:(e,t={})=>ie("POST","/api/project/import",{zip:e,jobs:!!t.jobs,chats:!!t.chats}),claudeMdSections:()=>ie("GET","/api/project/claude-md/sections"),saveAgentSkills:(e,t)=>ie("PUT",`/api/agents/prompts/${_e(e)}/skills`,{skills:t}),pipelines:()=>ie("GET","/api/pipelines"),pipeline:e=>ie("GET",`/api/pipelines/${_e(e)}`),createPipeline:e=>ie("POST","/api/pipelines",e),savePipeline:(e,t,n)=>ie("PUT",`/api/pipelines/${_e(e)}`,{...t,baseUpdatedAt:n}),deletePipeline:e=>ie("DELETE",`/api/pipelines/${_e(e)}`),chatCommands:(e=!1)=>ie("GET",`/api/chat/commands${e?"?refresh=1":""}`),chats:()=>ie("GET","/api/chat/sessions"),chat:e=>ie("GET",`/api/chat/sessions/${_e(e)}`),createChat:e=>ie("POST","/api/chat/sessions",e),updateChat:(e,t)=>ie("PATCH",`/api/chat/sessions/${_e(e)}`,t),deleteChat:e=>ie("DELETE",`/api/chat/sessions/${_e(e)}`),uploadChatFile:(e,t)=>ie("POST",`/api/chat/sessions/${_e(e)}/attachments`,t),sendChat:(e,t,n)=>ie("POST",`/api/chat/sessions/${_e(e)}/messages`,{text:t,attachmentIds:n}),answerChatPermission:(e,t,n)=>ie("POST",`/api/chat/sessions/${_e(e)}/permissions/${_e(t)}`,{decision:n}),stopChat:e=>ie("POST",`/api/chat/sessions/${_e(e)}/stop`),previewAgentPrompt:(e,t)=>ie("POST",`/api/agents/prompts/${_e(e)}/preview`,t)};function Z0(e,t,n){const r=new EventSource(`/api/jobs/${e}/stream`);for(const i of["job","agent","log"])r.addEventListener(i,l=>t(JSON.parse(l.data)));return r.onerror=()=>{r.close(),n()},()=>r.close()}function eb(e,t){const n=new EventSource(`/api/chat/sessions/${encodeURIComponent(e)}/stream`);for(const r of["session","message"])n.addEventListener(r,i=>t(JSON.parse(i.data)));return()=>n.close()}const vh=e=>`/api/jobs/${e}/report/`,Hc=["passed","failed","cancelled","interrupted"],tb=`# Spec title
68
+ */function ti(){return ti=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ti.apply(this,arguments)}function Ly(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,l;for(l=0;l<r.length;l++)i=r[l],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function D0(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function z0(e,t){return e.button===0&&(!t||t==="_self")&&!D0(e)}function Uc(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function M0(e,t){let n=Uc(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(l=>{n.append(i,l)})}),n}const $0=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],_0=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],O0="6";try{window.__reactRouterVersion=O0}catch{}function F0(e,t){return Gk({basename:t==null?void 0:t.basename,future:ti({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:yk({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||U0(),routes:e,mapRouteProperties:I0,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function U0(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=ti({},t,{errors:B0(t.errors)})),t}function B0(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new Za(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let l=window[i.__subType];if(typeof l=="function")try{let a=new l(i.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let l=new Error(i.message);l.stack="",n[r]=l}}else n[r]=i;return n}const Ay=j.createContext({isTransitioning:!1}),H0=j.createContext(new Map),W0="startTransition",Dp=iw[W0],V0="flushSync",zp=xk[V0];function Q0(e){Dp?Dp(e):e()}function bi(e){zp?zp(e):e()}class q0{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function G0(e){let{fallbackElement:t,router:n,future:r}=e,[i,l]=j.useState(n.state),[a,o]=j.useState(),[u,c]=j.useState({isTransitioning:!1}),[h,d]=j.useState(),[f,m]=j.useState(),[p,g]=j.useState(),w=j.useRef(new Map),{v7_startTransition:y}=r||{},x=j.useCallback(T=>{y?Q0(T):T()},[y]),v=j.useCallback((T,I)=>{let{deletedFetchers:C,flushSync:R,viewTransitionOpts:L}=I;C.forEach(U=>w.current.delete(U)),T.fetchers.forEach((U,D)=>{U.data!==void 0&&w.current.set(D,U.data)});let M=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!L||M){R?bi(()=>l(T)):x(()=>l(T));return}if(R){bi(()=>{f&&(h&&h.resolve(),f.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let U=n.window.document.startViewTransition(()=>{bi(()=>l(T))});U.finished.finally(()=>{bi(()=>{d(void 0),m(void 0),o(void 0),c({isTransitioning:!1})})}),bi(()=>m(U));return}f?(h&&h.resolve(),f.skipTransition(),g({state:T,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(o(T),c({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[n.window,f,h,w,x]);j.useLayoutEffect(()=>n.subscribe(v),[n,v]),j.useEffect(()=>{u.isTransitioning&&!u.flushSync&&d(new q0)},[u]),j.useEffect(()=>{if(h&&a&&n.window){let T=a,I=h.promise,C=n.window.document.startViewTransition(async()=>{x(()=>l(T)),await I});C.finished.finally(()=>{d(void 0),m(void 0),o(void 0),c({isTransitioning:!1})}),m(C)}},[x,a,h,n.window]),j.useEffect(()=>{h&&a&&i.location.key===a.location.key&&h.resolve()},[h,f,i.location,a]),j.useEffect(()=>{!u.isTransitioning&&p&&(o(p.state),c({isTransitioning:!0,flushSync:!1,currentLocation:p.currentLocation,nextLocation:p.nextLocation}),g(void 0))},[u.isTransitioning,p]),j.useEffect(()=>{},[]);let b=j.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:T=>n.navigate(T),push:(T,I,C)=>n.navigate(T,{state:I,preventScrollReset:C==null?void 0:C.preventScrollReset}),replace:(T,I,C)=>n.navigate(T,{replace:!0,state:I,preventScrollReset:C==null?void 0:C.preventScrollReset})}),[n]),A=n.basename||"/",k=j.useMemo(()=>({router:n,navigator:b,static:!1,basename:A}),[n,b,A]),E=j.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return j.useEffect(()=>R0(r,n.future),[r,n.future]),j.createElement(j.Fragment,null,j.createElement(wl.Provider,{value:k},j.createElement(gh.Provider,{value:i},j.createElement(H0.Provider,{value:w.current},j.createElement(Ay.Provider,{value:u},j.createElement(A0,{basename:A,location:i.location,navigationType:i.historyAction,navigator:b,future:E},i.initialized||n.future.v7_partialHydration?j.createElement(K0,{routes:n.routes,future:n.future,state:i}):t))))),null)}const K0=j.memo(Y0);function Y0(e){let{routes:t,future:n,state:r}=e;return y0(t,void 0,r,n)}const J0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",X0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ye=j.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:l,replace:a,state:o,target:u,to:c,preventScrollReset:h,viewTransition:d}=t,f=Ly(t,$0),{basename:m}=j.useContext(Lr),p,g=!1;if(typeof c=="string"&&X0.test(c)&&(p=c,J0))try{let v=new URL(window.location.href),b=c.startsWith("//")?new URL(v.protocol+c):new URL(c),A=kn(b.pathname,m);b.origin===v.origin&&A!=null?c=A+b.search+b.hash:g=!0}catch{}let w=p0(c,{relative:i}),y=tb(c,{replace:a,state:o,target:u,preventScrollReset:h,relative:i,viewTransition:d});function x(v){r&&r(v),v.defaultPrevented||y(v)}return j.createElement("a",ti({},f,{href:p||w,onClick:g||l?r:x,ref:n,target:u}))}),Z0=j.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:l="",end:a=!1,style:o,to:u,viewTransition:c,children:h}=t,d=Ly(t,_0),f=Po(u,{relative:d.relative}),m=Yn(),p=j.useContext(gh),{navigator:g,basename:w}=j.useContext(Lr),y=p!=null&&nb(f)&&c===!0,x=g.encodeLocation?g.encodeLocation(f).pathname:f.pathname,v=m.pathname,b=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;i||(v=v.toLowerCase(),b=b?b.toLowerCase():null,x=x.toLowerCase()),b&&w&&(b=kn(b,w)||b);const A=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let k=v===x||!a&&v.startsWith(x)&&v.charAt(A)==="/",E=b!=null&&(b===x||!a&&b.startsWith(x)&&b.charAt(x.length)==="/"),T={isActive:k,isPending:E,isTransitioning:y},I=k?r:void 0,C;typeof l=="function"?C=l(T):C=[l,k?"active":null,E?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let R=typeof o=="function"?o(T):o;return j.createElement(ye,ti({},d,{"aria-current":I,className:C,ref:n,style:R,to:u,viewTransition:c}),typeof h=="function"?h(T):h)});var Bc;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Bc||(Bc={}));var Mp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Mp||(Mp={}));function eb(e){let t=j.useContext(wl);return t||we(!1),t}function tb(e,t){let{target:n,replace:r,state:i,preventScrollReset:l,relative:a,viewTransition:o}=t===void 0?{}:t,u=ut(),c=Yn(),h=Po(e,{relative:a});return j.useCallback(d=>{if(z0(d,n)){d.preventDefault();let f=r!==void 0?r:ls(c)===ls(h);u(e,{replace:f,state:i,preventScrollReset:l,relative:a,viewTransition:o})}},[c,u,h,r,i,n,e,l,a,o])}function vh(e){let t=j.useRef(Uc(e)),n=j.useRef(!1),r=Yn(),i=j.useMemo(()=>M0(r.search,n.current?null:t.current),[r.search]),l=ut(),a=j.useCallback((o,u)=>{const c=Uc(typeof o=="function"?o(i):o);n.current=!0,l("?"+c,u)},[l,i]);return[i,a]}function nb(e,t){t===void 0&&(t={});let n=j.useContext(Ay);n==null&&we(!1);let{basename:r}=eb(Bc.useViewTransitionState),i=Po(e,{relative:t.relative});if(!n.isTransitioning)return!1;let l=kn(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=kn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Xa(i.pathname,a)!=null||Xa(i.pathname,l)!=null}class eo extends Error{constructor(t,n){super(n),this.status=t}}const Hc="qa-studio:server-down";async function rb(){try{return(await fetch("/api/health",{cache:"no-store"})).ok}catch{return!1}}async function se(e,t,n){let r;try{r=await fetch(t,{method:e,headers:n===void 0?void 0:{"Content-Type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)})}catch{throw window.dispatchEvent(new Event(Hc)),new eo(0,"Agent Studio server is not reachable. Is it running?")}if(r.status===204)return;const i=await r.json().catch(()=>({}));if(!r.ok)throw new eo(r.status,Array.isArray(i.message)?i.message.join(", "):i.message??r.statusText);return i}const _e=encodeURIComponent,wu=e=>Object.entries(e).filter(([,t])=>t!==void 0&&t!=="").map(([t,n])=>`${_e(t)}=${_e(String(n))}`).join("&"),V={dashboard:()=>se("GET","/api/dashboard"),specs:()=>se("GET","/api/specs"),spec:e=>se("GET",`/api/specs/${_e(e)}`),createSpec:(e,t)=>se("POST","/api/specs",{file:e,content:t}),saveSpec:(e,t,n)=>se("PUT",`/api/specs/${_e(e)}`,{content:t,baseMtime:n}),deleteSpec:e=>se("DELETE",`/api/specs/${_e(e)}`),mapping:()=>se("GET","/api/mapping"),mappingPage:e=>se("GET",`/api/mapping/page?${wu(e)}`),jobs:()=>se("GET","/api/jobs"),jobsPage:e=>se("GET",`/api/jobs?${wu(e)}`),job:e=>se("GET",`/api/jobs/${e}`),agentRun:(e,t)=>se("GET",`/api/jobs/${e}/agents/${t}`),createJob:e=>se("POST","/api/jobs",e),cancelJob:e=>se("POST",`/api/jobs/${e}/cancel`),approveJob:e=>se("POST",`/api/jobs/${e}/approve`),rerunFailedJob:e=>se("POST",`/api/jobs/${e}/rerun-failed`),rejectJob:(e,t)=>se("POST",`/api/jobs/${e}/reject`,{reason:t}),answerJob:(e,t)=>se("POST",`/api/jobs/${e}/answer`,{answers:t}),jobRequirement:e=>se("GET",`/api/jobs/${e}/requirement`),jobInput:e=>se("GET",`/api/jobs/${e}/input`),settings:()=>se("GET","/api/settings"),saveSettings:e=>se("PUT","/api/settings",e),usage:e=>se("GET",`/api/usage?days=${e}`),searchTestCases:e=>se("POST","/api/test-cases/search",e),testRuns:e=>se("GET",`/api/test-runs?${wu(e)}`),claudeMd:()=>se("GET","/api/project/claude-md"),uploadClaudeMd:e=>se("POST","/api/project/claude-md",{content:e}),resetPlan:e=>se("GET",`/api/project/reset/plan${e?`?terms=${_e(e)}`:""}`),resetProject:e=>se("POST","/api/project/reset",e),updateStatus:()=>se("GET","/api/update"),startUpdate:()=>se("POST","/api/update"),claudeStatus:()=>se("GET","/api/claude/status"),claudeTest:()=>se("POST","/api/claude/test"),agentPrompts:()=>se("GET","/api/agents/prompts"),saveAgentPrompt:(e,t)=>se("PUT",`/api/agents/prompts/${_e(e)}`,{instructions:t}),resetAgentPrompt:e=>se("DELETE",`/api/agents/prompts/${_e(e)}`),saveAgentModel:(e,t)=>se("PUT",`/api/agents/prompts/${_e(e)}/model`,{model:t}),resetAgentModel:e=>se("DELETE",`/api/agents/prompts/${_e(e)}/model`),skills:()=>se("GET","/api/agents/skills"),customAgents:()=>se("GET","/api/agents/custom"),customAgent:e=>se("GET",`/api/agents/custom/${_e(e)}`),createCustomAgent:e=>se("POST","/api/agents/custom",e),saveCustomAgent:(e,t,n)=>se("PUT",`/api/agents/custom/${_e(e)}`,{...t,baseUpdatedAt:n}),deleteCustomAgent:e=>se("DELETE",`/api/agents/custom/${_e(e)}`),previewCustomAgent:(e,t)=>se("POST",e?`/api/agents/custom/${_e(e)}/preview`:"/api/agents/custom/preview",t),exportProject:async(e={})=>{const t=new URLSearchParams;e.jobs&&t.set("jobs","1"),e.chats&&t.set("chats","1");const n=t.toString(),r=await fetch(`/api/project/export${n?`?${n}`:""}`);if(!r.ok)throw new eo(r.status,(await r.json().catch(()=>({}))).message??r.statusText);return r.blob()},importProject:(e,t={})=>se("POST","/api/project/import",{zip:e,jobs:!!t.jobs,chats:!!t.chats}),claudeMdSections:()=>se("GET","/api/project/claude-md/sections"),saveAgentSkills:(e,t)=>se("PUT",`/api/agents/prompts/${_e(e)}/skills`,{skills:t}),pipelines:()=>se("GET","/api/pipelines"),pipeline:e=>se("GET",`/api/pipelines/${_e(e)}`),createPipeline:e=>se("POST","/api/pipelines",e),savePipeline:(e,t,n)=>se("PUT",`/api/pipelines/${_e(e)}`,{...t,baseUpdatedAt:n}),deletePipeline:e=>se("DELETE",`/api/pipelines/${_e(e)}`),chatCommands:(e=!1)=>se("GET",`/api/chat/commands${e?"?refresh=1":""}`),chats:()=>se("GET","/api/chat/sessions"),chat:e=>se("GET",`/api/chat/sessions/${_e(e)}`),createChat:e=>se("POST","/api/chat/sessions",e),updateChat:(e,t)=>se("PATCH",`/api/chat/sessions/${_e(e)}`,t),deleteChat:e=>se("DELETE",`/api/chat/sessions/${_e(e)}`),uploadChatFile:(e,t)=>se("POST",`/api/chat/sessions/${_e(e)}/attachments`,t),sendChat:(e,t,n)=>se("POST",`/api/chat/sessions/${_e(e)}/messages`,{text:t,attachmentIds:n}),answerChatPermission:(e,t,n)=>se("POST",`/api/chat/sessions/${_e(e)}/permissions/${_e(t)}`,{decision:n}),stopChat:e=>se("POST",`/api/chat/sessions/${_e(e)}/stop`),previewAgentPrompt:(e,t)=>se("POST",`/api/agents/prompts/${_e(e)}/preview`,t)};function sb(e,t,n){const r=new EventSource(`/api/jobs/${e}/stream`);for(const i of["job","agent","log"])r.addEventListener(i,l=>t(JSON.parse(l.data)));return r.onerror=()=>{r.close(),n()},()=>r.close()}function ib(e,t){const n=new EventSource(`/api/chat/sessions/${encodeURIComponent(e)}/stream`);for(const r of["session","message"])n.addEventListener(r,i=>t(JSON.parse(i.data)));return()=>n.close()}const jh=e=>`/api/jobs/${e}/report/`,Wc=["passed","failed","cancelled","interrupted"],lb=`# Spec title
69
69
  Tags: smoke
70
70
  Preconditions: describe the initial state
71
71
 
@@ -73,9 +73,9 @@ Preconditions: describe the initial state
73
73
  1. Step 1
74
74
  2. Step 2
75
75
  3. Expected result
76
- `,Wc="agent-studio:data-changed",nb=()=>window.dispatchEvent(new Event(Wc));function Ry(e){j.useEffect(()=>(window.addEventListener(Wc,e),()=>window.removeEventListener(Wc,e)),[e])}function $e(e,t=[]){const[n,r]=j.useState(null),[i,l]=j.useState(null),[a,o]=j.useState(0);j.useEffect(()=>{let c=!0;return e().then(h=>c&&(r(h),l(null))).catch(h=>c&&l(h.message)),()=>{c=!1}},[...t,a]);const u=j.useCallback(()=>o(c=>c+1),[]);return Ry(u),{data:n,error:i,reload:u}}const Ly=j.createContext({specs:[],mapping:[],refresh:()=>{}}),un=()=>j.useContext(Ly);function rb(){const[e,t]=j.useState([]),[n,r]=j.useState([]),i=j.useCallback(()=>{Promise.all([Q.specs(),Q.mapping()]).then(([l,a])=>{t(l),r(a)}).catch(()=>{})},[]);return j.useEffect(()=>{i();const l=setInterval(i,15e3);return()=>clearInterval(l)},[i]),Ry(i),{specs:e,mapping:n,refresh:i}}function sb(e){const[t,n]=j.useState(null),[r,i]=j.useState([]),[l,a]=j.useState([]),[o,u]=j.useState(null),[c,h]=j.useState({}),[d,f]=j.useState(null),[m,p]=j.useState(null),g=j.useRef(!1),[w,y]=j.useState(0),x=j.useCallback(()=>y(b=>b+1),[]),v=j.useCallback(async()=>{const b=await Q.job(e);return p(b.pending??null),n(b.job),i(b.agentRuns),a(b.testResults),u(b.pipeline??null),b},[e]);return j.useEffect(()=>{let b=!0,A=null,k=null;g.current=!1;const E=()=>{h({}),A=Z0(e,T=>{b&&(T.type==="job"?(n(T.job),T.job.status==="waiting"?v():p(null),Hc.includes(T.job.status)&&!g.current&&(g.current=!0,v())):T.type==="agent"?i(I=>{const C=I.findIndex(L=>L.id===T.run.id);if(C<0)return[...I,T.run].sort((L,M)=>L.seq-M.seq);const R=I.slice();return R[C]=T.run,R}):h(I=>({...I,[T.runId]:(I[T.runId]??"")+T.chunk})))},()=>{b&&!g.current&&(k=setTimeout(E,2e3))})};return v().then(()=>b&&E()).catch(T=>b&&f(T.message)),()=>{b=!1,A==null||A(),k&&clearTimeout(k)}},[e,v,w]),{job:t,runs:r,results:l,pipeline:o,pending:m,logs:c,error:d,refetch:v,reconnect:x}}function ib(){const[e,t]=j.useState(()=>{try{return localStorage.getItem("qa-studio.theme")??"light"}catch{return"light"}});return j.useEffect(()=>{document.documentElement.dataset.theme=e;try{localStorage.setItem("qa-studio.theme",e)}catch{}},[e]),[e,()=>t(n=>n==="dark"?"light":"dark")]}function lb(e,t){const[n,r]=j.useState(e);return j.useEffect(()=>{const i=setTimeout(()=>r(e),t);return()=>clearTimeout(i)},[e,t]),n}function ke({size:e=18,children:t,...n}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n,children:t})}const ab=e=>s.jsxs(ke,{...e,children:[s.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"2"}),s.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"2"}),s.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"2"}),s.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"2"})]}),wr=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),s.jsx("path",{d:"M14 3v5h5M9 13h6M9 17h4"})]}),jh=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7"}),s.jsx("path",{d:"M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7"})]}),ft=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M7 4.5v15a1 1 0 0 0 1.5.86l12-7.5a1 1 0 0 0 0-1.72l-12-7.5A1 1 0 0 0 7 4.5z"})}),ob=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M7 4.5v15a1 1 0 0 0 1.5.86l12-7.5a1 1 0 0 0 0-1.72l-12-7.5A1 1 0 0 0 7 4.5z",fill:"currentColor",stroke:"none"})}),ub=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M10 3.5l1.6 4.4a2 2 0 0 0 1.2 1.2L17.2 10.7l-4.4 1.6a2 2 0 0 0-1.2 1.2L10 17.9l-1.6-4.4a2 2 0 0 0-1.2-1.2L2.8 10.7l4.4-1.6a2 2 0 0 0 1.2-1.2z"}),s.jsx("path",{d:"M18.5 14.5l.7 1.8 1.8.7-1.8.7-.7 1.8-.7-1.8-1.8-.7 1.8-.7z"})]}),Ro=e=>s.jsxs(ke,{...e,children:[s.jsx("circle",{cx:"11",cy:"11",r:"7"}),s.jsx("path",{d:"m20 20-3.5-3.5"})]}),qt=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M12 5v14M5 12h14"})}),ti=({open:e,...t})=>s.jsx(ke,{...t,style:{transform:e?"rotate(90deg)":void 0,transition:"transform .15s"},children:s.jsx("path",{d:"m9 6 6 6-6 6"})}),wh=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"m5 12 5 5 9-10"})}),kr=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M6 6l12 12M18 6 6 18"})}),cb=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M4 7h16M4 12h16M4 17h16"})}),Ay=e=>s.jsxs(ke,{...e,children:[s.jsx("circle",{cx:"12",cy:"12",r:"9"}),s.jsx("path",{d:"m15.5 8.5-2 5-5 2 2-5z"})]}),kh=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"m4 20 12-12M14 4l1 2 2 1-2 1-1 2-1-2-2-1 2-1zM19 11l.6 1.4L21 13l-1.4.6L19 15l-.6-1.4L17 13l1.4-.6z"})}),bh=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M12 3 5 6v6c0 4.5 3 7.5 7 9 4-1.5 7-4.5 7-9V6z"}),s.jsx("path",{d:"m9 12 2 2 4-4"})]}),Iy=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M19.5 12.5 12 20l-7.5-7.5a4.5 4.5 0 0 1 6.4-6.4l1.1 1.1 1.1-1.1a4.5 4.5 0 0 1 6.4 6.4z"}),s.jsx("path",{d:"M12 10v5M9.5 12.5h5"})]}),db=e=>s.jsxs(ke,{...e,children:[s.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"3"}),s.jsx("path",{d:"m7 9 3 3-3 3M13 15h4"})]}),Dy=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5z"})}),zy=e=>s.jsxs(ke,{...e,children:[s.jsx("circle",{cx:"12",cy:"12",r:"4"}),s.jsx("path",{d:"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"})]}),Yn=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M20 11a8 8 0 0 0-14.5-4.5L4 8M4 4v4h4M4 13a8 8 0 0 0 14.5 4.5L20 16M20 20v-4h-4"})}),My=e=>s.jsx(ke,{...e,children:s.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),Ar=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M4 7h16M10 11v6M14 11v6M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12M9 7V4h6v3"})}),cs=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M5 3h11l3 3v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"}),s.jsx("path",{d:"M7 3v6h8V3M7 21v-7h10v7"})]}),$y=e=>s.jsxs(ke,{...e,children:[s.jsx("circle",{cx:"7",cy:"7",r:"3"}),s.jsx("circle",{cx:"17",cy:"17",r:"3"}),s.jsx("path",{d:"M10 7h4a3 3 0 0 1 3 3v4M7 10v4a3 3 0 0 0 3 3h4"})]}),hb=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M4 6h9M17 6h3M4 12h3M11 12h9M4 18h11M19 18h1"}),s.jsx("circle",{cx:"15",cy:"6",r:"2"}),s.jsx("circle",{cx:"9",cy:"12",r:"2"}),s.jsx("circle",{cx:"17",cy:"18",r:"2"})]}),fb=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M19 12H5M11 18l-6-6 6-6"})}),Lo=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M12 16V4M7 9l5-5 5 5M4 16v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3"})}),Sh=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20V3H6.5A2.5 2.5 0 0 0 4 5.5z"}),s.jsx("path",{d:"M4 19.5A2.5 2.5 0 0 0 6.5 22H20v-5"})]}),pb=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M9 6h11M9 12h11M9 18h11"}),s.jsx("path",{d:"M4 6l1 1 2-2M4 12l1 1 2-2M4 18l1 1 2-2"})]}),Nh=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M14 4h6v6M20 4l-9 9"}),s.jsx("path",{d:"M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"})]}),hl=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M12 20h9"}),s.jsx("path",{d:"M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z"})]}),ls=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M17 2l4 4-4 4"}),s.jsx("path",{d:"M3 11v-1a4 4 0 0 1 4-4h14"}),s.jsx("path",{d:"M7 22l-4-4 4-4"}),s.jsx("path",{d:"M21 13v1a4 4 0 0 1-4 4H3"})]}),_y=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M12 14l4-4"}),s.jsx("path",{d:"M3.3 19a9 9 0 1 1 17.4 0"})]}),mb=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M4 5h16l-6 8v5l-4 2v-7z"})}),gb=e=>s.jsxs(ke,{...e,children:[s.jsx("rect",{x:"5",y:"11",width:"14",height:"10",rx:"2"}),s.jsx("path",{d:"M8 11V8a4 4 0 0 1 8 0v3"})]}),Oy=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"m21 11.5-8.6 8.6a5.5 5.5 0 0 1-7.8-7.8l8.6-8.6a3.7 3.7 0 0 1 5.2 5.2l-8.6 8.6a1.8 1.8 0 0 1-2.6-2.6l7.9-7.9"})}),xb=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),Ch=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M20 12a8 8 0 0 1-11.6 7.1L4 20l1-4.1A8 8 0 1 1 20 12z"}),s.jsx("path",{d:"M8.5 12h.01M12 12h.01M15.5 12h.01"})]}),yb=/^[A-Z][A-Z0-9]*(-[A-Z0-9]+)+$/;function vb(e){return typeof e=="string"&&yb.test(e)}function jb(e){const t={title:"",tags:[],preconditions:"",tcs:[],warnings:[]},n=new Set;return e.split(/\r?\n/).forEach((r,i)=>{const l=r.trim(),a=i+1;let o;const u=t.tcs[t.tcs.length-1];if(!t.title&&(o=l.match(/^#\s+(.+)$/)))t.title=o[1].trim();else if(o=l.match(/^tags\s*:\s*(.*)$/i)){const c=o[1].split(",").map(h=>h.trim()).filter(Boolean);u?u.tags=c:t.tags=c}else if(u&&(o=l.match(/^technique\s*:\s*(.*)$/i)))u.technique=o[1].trim()||null;else if(o=l.match(/^preconditions\s*:\s*(.*)$/i))t.preconditions=o[1].trim();else if(o=l.match(/^##\s+(.*)$/)){const c=o[1].match(/^(\S+?)\s*:\s*(.+)$/);c&&vb(c[1])?(n.has(c[1])&&t.warnings.push(`Line ${a}: duplicate TC-ID ${c[1]} in spec`),n.add(c[1]),t.tcs.push({id:c[1],title:c[2].trim(),line:a,tags:[],technique:null})):t.warnings.push(`Line ${a}: heading "${l}" does not match "## <TC-ID>: <name>"`)}}),t}const zp=e=>e===null||e===""?[]:e.replace(/\r\n/g,`
76
+ `,Vc="agent-studio:data-changed",ab=()=>window.dispatchEvent(new Event(Vc));function Iy(e){j.useEffect(()=>(window.addEventListener(Vc,e),()=>window.removeEventListener(Vc,e)),[e])}function $e(e,t=[]){const[n,r]=j.useState(null),[i,l]=j.useState(null),[a,o]=j.useState(0);j.useEffect(()=>{let c=!0;return e().then(h=>c&&(r(h),l(null))).catch(h=>c&&l(h.message)),()=>{c=!1}},[...t,a]);const u=j.useCallback(()=>o(c=>c+1),[]);return Iy(u),{data:n,error:i,reload:u}}const Dy=j.createContext({specs:[],mapping:[],refresh:()=>{}}),cn=()=>j.useContext(Dy);function ob(){const[e,t]=j.useState([]),[n,r]=j.useState([]),i=j.useCallback(()=>{Promise.all([V.specs(),V.mapping()]).then(([l,a])=>{t(l),r(a)}).catch(()=>{})},[]);return j.useEffect(()=>{i();const l=setInterval(i,15e3);return()=>clearInterval(l)},[i]),Iy(i),{specs:e,mapping:n,refresh:i}}function ub(e){const[t,n]=j.useState(null),[r,i]=j.useState([]),[l,a]=j.useState([]),[o,u]=j.useState(null),[c,h]=j.useState({}),[d,f]=j.useState(null),[m,p]=j.useState(null),g=j.useRef(!1),[w,y]=j.useState(0),x=j.useCallback(()=>y(b=>b+1),[]),v=j.useCallback(async()=>{const b=await V.job(e);return p(b.pending??null),n(b.job),i(b.agentRuns),a(b.testResults),u(b.pipeline??null),b},[e]);return j.useEffect(()=>{let b=!0,A=null,k=null;g.current=!1;const E=()=>{h({}),A=sb(e,T=>{b&&(T.type==="job"?(n(T.job),T.job.status==="waiting"?v():p(null),Wc.includes(T.job.status)&&!g.current&&(g.current=!0,v())):T.type==="agent"?i(I=>{const C=I.findIndex(L=>L.id===T.run.id);if(C<0)return[...I,T.run].sort((L,M)=>L.seq-M.seq);const R=I.slice();return R[C]=T.run,R}):h(I=>({...I,[T.runId]:(I[T.runId]??"")+T.chunk})))},()=>{b&&!g.current&&(k=setTimeout(E,2e3))})};return v().then(()=>b&&E()).catch(T=>b&&f(T.message)),()=>{b=!1,A==null||A(),k&&clearTimeout(k)}},[e,v,w]),{job:t,runs:r,results:l,pipeline:o,pending:m,logs:c,error:d,refetch:v,reconnect:x}}function cb(){const[e,t]=j.useState(()=>{try{return localStorage.getItem("qa-studio.theme")??"light"}catch{return"light"}});return j.useEffect(()=>{document.documentElement.dataset.theme=e;try{localStorage.setItem("qa-studio.theme",e)}catch{}},[e]),[e,()=>t(n=>n==="dark"?"light":"dark")]}function db(e,t){const[n,r]=j.useState(e);return j.useEffect(()=>{const i=setTimeout(()=>r(e),t);return()=>clearTimeout(i)},[e,t]),n}function ke({size:e=18,children:t,...n}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n,children:t})}const hb=e=>s.jsxs(ke,{...e,children:[s.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"2"}),s.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"2"}),s.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"2"}),s.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"2"})]}),qn=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),s.jsx("path",{d:"M14 3v5h5M9 13h6M9 17h4"})]}),wh=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7"}),s.jsx("path",{d:"M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7"})]}),ft=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M7 4.5v15a1 1 0 0 0 1.5.86l12-7.5a1 1 0 0 0 0-1.72l-12-7.5A1 1 0 0 0 7 4.5z"})}),fb=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M7 4.5v15a1 1 0 0 0 1.5.86l12-7.5a1 1 0 0 0 0-1.72l-12-7.5A1 1 0 0 0 7 4.5z",fill:"currentColor",stroke:"none"})}),pb=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M10 3.5l1.6 4.4a2 2 0 0 0 1.2 1.2L17.2 10.7l-4.4 1.6a2 2 0 0 0-1.2 1.2L10 17.9l-1.6-4.4a2 2 0 0 0-1.2-1.2L2.8 10.7l4.4-1.6a2 2 0 0 0 1.2-1.2z"}),s.jsx("path",{d:"M18.5 14.5l.7 1.8 1.8.7-1.8.7-.7 1.8-.7-1.8-1.8-.7 1.8-.7z"})]}),Ro=e=>s.jsxs(ke,{...e,children:[s.jsx("circle",{cx:"11",cy:"11",r:"7"}),s.jsx("path",{d:"m20 20-3.5-3.5"})]}),qt=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M12 5v14M5 12h14"})}),ni=({open:e,...t})=>s.jsx(ke,{...t,style:{transform:e?"rotate(90deg)":void 0,transition:"transform .15s"},children:s.jsx("path",{d:"m9 6 6 6-6 6"})}),kh=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"m5 12 5 5 9-10"})}),kr=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M6 6l12 12M18 6 6 18"})}),mb=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M4 7h16M4 12h16M4 17h16"})}),zy=e=>s.jsxs(ke,{...e,children:[s.jsx("circle",{cx:"12",cy:"12",r:"9"}),s.jsx("path",{d:"m15.5 8.5-2 5-5 2 2-5z"})]}),Lo=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"m4 20 12-12M14 4l1 2 2 1-2 1-1 2-1-2-2-1 2-1zM19 11l.6 1.4L21 13l-1.4.6L19 15l-.6-1.4L17 13l1.4-.6z"})}),bh=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M12 3 5 6v6c0 4.5 3 7.5 7 9 4-1.5 7-4.5 7-9V6z"}),s.jsx("path",{d:"m9 12 2 2 4-4"})]}),My=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M19.5 12.5 12 20l-7.5-7.5a4.5 4.5 0 0 1 6.4-6.4l1.1 1.1 1.1-1.1a4.5 4.5 0 0 1 6.4 6.4z"}),s.jsx("path",{d:"M12 10v5M9.5 12.5h5"})]}),gb=e=>s.jsxs(ke,{...e,children:[s.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"3"}),s.jsx("path",{d:"m7 9 3 3-3 3M13 15h4"})]}),$y=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5z"})}),_y=e=>s.jsxs(ke,{...e,children:[s.jsx("circle",{cx:"12",cy:"12",r:"4"}),s.jsx("path",{d:"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"})]}),Jn=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M20 11a8 8 0 0 0-14.5-4.5L4 8M4 4v4h4M4 13a8 8 0 0 0 14.5 4.5L20 16M20 20v-4h-4"})}),Oy=e=>s.jsx(ke,{...e,children:s.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),Ar=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M4 7h16M10 11v6M14 11v6M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12M9 7V4h6v3"})}),ds=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M5 3h11l3 3v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"}),s.jsx("path",{d:"M7 3v6h8V3M7 21v-7h10v7"})]}),Fy=e=>s.jsxs(ke,{...e,children:[s.jsx("circle",{cx:"7",cy:"7",r:"3"}),s.jsx("circle",{cx:"17",cy:"17",r:"3"}),s.jsx("path",{d:"M10 7h4a3 3 0 0 1 3 3v4M7 10v4a3 3 0 0 0 3 3h4"})]}),xb=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M4 6h9M17 6h3M4 12h3M11 12h9M4 18h11M19 18h1"}),s.jsx("circle",{cx:"15",cy:"6",r:"2"}),s.jsx("circle",{cx:"9",cy:"12",r:"2"}),s.jsx("circle",{cx:"17",cy:"18",r:"2"})]}),yb=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M19 12H5M11 18l-6-6 6-6"})}),Ao=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M12 16V4M7 9l5-5 5 5M4 16v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3"})}),Sh=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20V3H6.5A2.5 2.5 0 0 0 4 5.5z"}),s.jsx("path",{d:"M4 19.5A2.5 2.5 0 0 0 6.5 22H20v-5"})]}),vb=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M9 6h11M9 12h11M9 18h11"}),s.jsx("path",{d:"M4 6l1 1 2-2M4 12l1 1 2-2M4 18l1 1 2-2"})]}),Nh=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M14 4h6v6M20 4l-9 9"}),s.jsx("path",{d:"M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"})]}),hl=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M12 20h9"}),s.jsx("path",{d:"M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z"})]}),as=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M17 2l4 4-4 4"}),s.jsx("path",{d:"M3 11v-1a4 4 0 0 1 4-4h14"}),s.jsx("path",{d:"M7 22l-4-4 4-4"}),s.jsx("path",{d:"M21 13v1a4 4 0 0 1-4 4H3"})]}),Uy=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M12 14l4-4"}),s.jsx("path",{d:"M3.3 19a9 9 0 1 1 17.4 0"})]}),jb=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M4 5h16l-6 8v5l-4 2v-7z"})}),wb=e=>s.jsxs(ke,{...e,children:[s.jsx("rect",{x:"5",y:"11",width:"14",height:"10",rx:"2"}),s.jsx("path",{d:"M8 11V8a4 4 0 0 1 8 0v3"})]}),By=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"m21 11.5-8.6 8.6a5.5 5.5 0 0 1-7.8-7.8l8.6-8.6a3.7 3.7 0 0 1 5.2 5.2l-8.6 8.6a1.8 1.8 0 0 1-2.6-2.6l7.9-7.9"})}),kb=e=>s.jsx(ke,{...e,children:s.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),Ch=e=>s.jsxs(ke,{...e,children:[s.jsx("path",{d:"M20 12a8 8 0 0 1-11.6 7.1L4 20l1-4.1A8 8 0 1 1 20 12z"}),s.jsx("path",{d:"M8.5 12h.01M12 12h.01M15.5 12h.01"})]}),bb=/^[A-Z][A-Z0-9]*(-[A-Z0-9]+)+$/;function Sb(e){return typeof e=="string"&&bb.test(e)}function Nb(e){const t={title:"",tags:[],preconditions:"",tcs:[],warnings:[]},n=new Set;return e.split(/\r?\n/).forEach((r,i)=>{const l=r.trim(),a=i+1;let o;const u=t.tcs[t.tcs.length-1];if(!t.title&&(o=l.match(/^#\s+(.+)$/)))t.title=o[1].trim();else if(o=l.match(/^tags\s*:\s*(.*)$/i)){const c=o[1].split(",").map(h=>h.trim()).filter(Boolean);u?u.tags=c:t.tags=c}else if(u&&(o=l.match(/^technique\s*:\s*(.*)$/i)))u.technique=o[1].trim()||null;else if(o=l.match(/^preconditions\s*:\s*(.*)$/i))t.preconditions=o[1].trim();else if(o=l.match(/^##\s+(.*)$/)){const c=o[1].match(/^(\S+?)\s*:\s*(.+)$/);c&&Sb(c[1])?(n.has(c[1])&&t.warnings.push(`Line ${a}: duplicate TC-ID ${c[1]} in spec`),n.add(c[1]),t.tcs.push({id:c[1],title:c[2].trim(),line:a,tags:[],technique:null})):t.warnings.push(`Line ${a}: heading "${l}" does not match "## <TC-ID>: <name>"`)}}),t}const $p=e=>e===null||e===""?[]:e.replace(/\r\n/g,`
77
77
  `).split(`
78
- `);function wb(e,t){const n=zp(e),r=zp(t),i=Array.from({length:n.length+1},()=>new Array(r.length+1).fill(0));for(let u=n.length-1;u>=0;u--)for(let c=r.length-1;c>=0;c--)i[u][c]=n[u]===r[c]?i[u+1][c+1]+1:Math.max(i[u+1][c],i[u][c+1]);const l=[];let a=0,o=0;for(;a<n.length&&o<r.length;)n[a]===r[o]?(l.push({type:"same",text:n[a]}),a++,o++):i[a+1][o]>=i[a][o+1]?l.push({type:"del",text:n[a++]}):l.push({type:"add",text:r[o++]});for(;a<n.length;)l.push({type:"del",text:n[a++]});for(;o<r.length;)l.push({type:"add",text:r[o++]});return l}const Ne={explorer:{label:"QA Explorer",llm:!0,description:"Verifies each test case in a real browser"},generator:{label:"QA Script Generator",llm:!0,description:"Generates the Playwright script from the exploration results"},validator:{label:"QA Validator",llm:!1,description:"Runs the script with repeat-each=3, retries=0"},healer:{label:"QA Script Healer",llm:!0,description:"Fixes script errors (never assertions) and flags app bugs"},runner:{label:"QA Test Runner",llm:!1,description:"Runs Playwright tests"},specwriter:{label:"QA Test Case Writer",llm:!0,description:"Turns a BA requirement into a spec file with test cases"},contextwriter:{label:"Context Writer",llm:!0,description:"Rewrites the project context in CLAUDE.md and removes the old project's"},custom:{label:"Custom agent",llm:!0,description:"An agent created on the Agents page"}},Ao={explore:["explorer"],generate:["explorer","generator","validator"],heal:["healer","validator"],spec:["specwriter"],testrun:["runner"],context:["contextwriter"]},Eh=["validator","healer"],Mp=500,kb=5,bb=120,Sb=2e3,wu=5e4,Fy=20,Nb=[10,20,50,100],Cb={maxHealRounds:2},$p=10,Th=[{id:"opus",label:"Opus — most capable, highest cost"},{id:"sonnet",label:"Sonnet — balanced"},{id:"haiku",label:"Haiku — fastest, cheapest"}],Eb=["specFile","testFile","jobDir"],Tb={mode:"scoped",browser:!1,editTests:!1,editSpecs:!1,typecheck:!1,deniedCommands:[],protectedPaths:[]},Uy=["git push","git reset --hard","rm -rf","curl","wget","cat .env","type .env"],By=["qa-studio",".git",".claude","node_modules"],Pb=2e3;Th.map(e=>e.id);const Ph=e=>`custom:${e}`,bl=e=>e.startsWith("custom:")?e.slice(7):null,Rb=["first","last"],ds=e=>typeof e=="string"?{kind:"agent",agent:e}:e,Vc=80,Qc=500,ba=20,Sa=10,fl=10,Lb=3,to=3,_p=100,Ab=Object.keys(Ne).filter(e=>e!=="custom"),Io=e=>e.flatMap(t=>t.kind==="agent"?[t.agent]:Io(t.steps.map(ds))),Hy=e=>e.kind==="agent"?0:1+Math.max(0,...e.steps.map(t=>Hy(ds(t))));function Wy(e){if(e.kind==="agent")return 1;const t=e.steps.map(a=>Wy(ds(a))),n=e.maxIterations,r=t.reduce((a,o)=>a+o,0);if(e.endsWhen==="last")return n*r;const[i=0,...l]=t;return n*i+Math.max(0,n-1)*l.reduce((a,o)=>a+o,0)}const Ib=new Set(["explorer","generator","validator","healer","runner","specwriter"]),Db=e=>Io(e).find(t=>Ib.has(t))??null;function zb(e,t){const n=[];if(!e||typeof e!="object")return{ok:!1,errors:["Body must be an object"]};const r=e,i=typeof r.name=="string"?r.name.trim():"";i?i.length>Vc&&n.push(`Name is longer than ${Vc} characters`):n.push("Name is required");const l=r.description===void 0||r.description===null?"":r.description;typeof l!="string"?n.push("Description must be text"):l.length>Qc&&n.push(`Description is longer than ${Qc} characters`);let a;if(r.workDir!==void 0&&r.workDir!==null)if(typeof r.workDir!="string")n.push("Working directory must be text");else{const h=r.workDir.trim();h&&(/^([A-Za-z]:[\\/]|\/)/.test(h)?a=/^([A-Za-z]:[\\/]|\/)$/.test(h)?h:h.replace(/[\\/]+$/,""):n.push("Working directory must be an absolute path (e.g. D:\\my-app)"))}const o=h=>typeof h!="string"?`unknown agent ${JSON.stringify(h)}`:bl(h)!==null||Ab.includes(h)?null:`unknown agent ${JSON.stringify(h)}`,u=(h,d,f)=>{if(f>to)return n.push(`${d}: loops can be nested at most ${to} levels deep`),null;const m=h.maxIterations;let p=!0;if((typeof m!="number"||!Number.isInteger(m)||m<1||m>fl)&&(n.push(`${d}: maximum loop count must be a whole number from 1 to ${fl}`),p=!1),h.endsWhen!==void 0&&!Rb.includes(h.endsWhen)&&(n.push(`${d}: ends when must be "first" or "last"`),p=!1),!Array.isArray(h.steps)||h.steps.length===0)return n.push(`${d}: drop at least one agent into the loop`),null;h.steps.length>Sa&&(n.push(`${d}: a loop has at most ${Sa} entries`),p=!1);const g=[],w=new Set;return h.steps.slice(0,Sa).forEach((y,x)=>{if(typeof y=="string"){const b=o(y);b?w.add(b):g.push(y);return}const v=y;if(v&&typeof v=="object"&&v.kind==="loop"){const b=u(v,`${d} › loop ${x+1}`,f+1);b?g.push(b):p=!1;return}if(v&&typeof v=="object"&&v.kind==="agent"){const b=o(v.agent);b?w.add(b):g.push(v.agent);return}w.add(`unknown agent ${JSON.stringify(y)}`)}),w.forEach(y=>n.push(`${d}: ${y}`)),!p||w.size?null:{kind:"loop",steps:g,maxIterations:m,...h.endsWhen==="last"?{endsWhen:"last"}:{}}},c=[];return Array.isArray(r.steps)?(r.steps.length===0&&n.push("Add at least one agent to the pipeline"),r.steps.length>ba&&n.push(`A pipeline has at most ${ba} blocks`),r.steps.slice(0,ba).forEach((h,d)=>{const f=`Block ${d+1}`,m=h;if(!m||typeof m!="object")return void n.push(`${f}: must be an object`);if(m.kind==="agent"){const p=o(m.agent);if(p)return void n.push(`${f}: ${p}`);c.push({kind:"agent",agent:m.agent})}else if(m.kind==="loop"){const p=u(m,f,1);if(!p)return;const g=Wy(p);if(Hy(p)>1&&g>_p)return void n.push(`${f}: these nested loops could take up to ${g} agent runs (at most ${_p}); lower the maximum iterations`);c.push(p)}else n.push(`${f}: kind must be "agent" or "loop"`)})):n.push("steps must be a list"),c.findIndex(h=>Io([h]).includes("specwriter")),n.length?{ok:!1,errors:n}:{ok:!0,value:{name:i,description:l.trim(),steps:c,...a?{workDir:a}:{}}}}function Mb(e){const t=Math.max(1,Math.min(fl,e+1));return[{id:"explore",name:"Explore",description:"Verify each test case in a real browser.",steps:[{kind:"agent",agent:"explorer"}]},{id:"generate",name:"Generate",description:"Explore the spec, generate the script, then validate and heal until it passes.",steps:[{kind:"agent",agent:"explorer"},{kind:"agent",agent:"generator"},{kind:"loop",steps:["validator","healer"],maxIterations:t}]},{id:"heal",name:"Heal",description:"Fix a failing script, then validate it.",steps:[{kind:"loop",steps:["validator","healer"],maxIterations:t}]},{id:"spec",name:"Write spec",description:"Turn a BA requirement into a spec file.",steps:[{kind:"agent",agent:"specwriter"}]},{id:"testrun",name:"Test run",description:"Run all tests, one spec, one test case or a picked selection.",steps:[{kind:"agent",agent:"runner"}]},{id:"context",name:"Project context",description:"Rewrite the project context in CLAUDE.md.",steps:[{kind:"agent",agent:"contextwriter"}]}]}const Op=[{id:"default",label:"Default"},{id:"fable",label:"Fable"},{id:"opus",label:"Opus"},{id:"sonnet",label:"Sonnet"},{id:"haiku",label:"Haiku"}],Yr=["default","low","medium","high","xhigh","max"],no=[{id:"manual",label:"Ask every time",description:"Like the terminal: Claude asks before editing files or running commands"},{id:"acceptEdits",label:"Accept edits",description:"File edits run without asking; commands and other actions ask you first"},{id:"plan",label:"Plan (read-only)",description:"Claude can read and search but not edit files or run commands"},{id:"auto",label:"Auto",description:"Claude Code decides which actions are safe to run"},{id:"bypassPermissions",label:"Bypass permissions",description:"Every tool runs without asking (use with care)"}];function ta(e,t){const n=t.toLowerCase();if(!n)return e;const r=i=>{const l=i.name.toLowerCase();return l.startsWith(n)||l.slice(l.indexOf(":")+1).startsWith(n)?0:l.includes(n)?1:i.description.toLowerCase().includes(n)?2:3};return e.map((i,l)=>({i,idx:l,r:r(i)})).filter(i=>i.r<3).sort((i,l)=>i.r-l.r||i.idx-l.idx).map(i=>i.i)}const Vy={mode:"scoped",browser:!1,editTests:!1,editSpecs:!1,typecheck:!1,deniedCommands:[],protectedPaths:[]},ku={...Vy,mode:"full",typecheck:!0,deniedCommands:[...Uy],protectedPaths:[...By]},$b=`# Planner Agent — Instructions
78
+ `);function Cb(e,t){const n=$p(e),r=$p(t),i=Array.from({length:n.length+1},()=>new Array(r.length+1).fill(0));for(let u=n.length-1;u>=0;u--)for(let c=r.length-1;c>=0;c--)i[u][c]=n[u]===r[c]?i[u+1][c+1]+1:Math.max(i[u+1][c],i[u][c+1]);const l=[];let a=0,o=0;for(;a<n.length&&o<r.length;)n[a]===r[o]?(l.push({type:"same",text:n[a]}),a++,o++):i[a+1][o]>=i[a][o+1]?l.push({type:"del",text:n[a++]}):l.push({type:"add",text:r[o++]});for(;a<n.length;)l.push({type:"del",text:n[a++]});for(;o<r.length;)l.push({type:"add",text:r[o++]});return l}const Ne={explorer:{label:"QA Explorer",llm:!0,description:"Verifies each test case in a real browser"},generator:{label:"QA Script Generator",llm:!0,description:"Generates the Playwright script from the exploration results"},validator:{label:"QA Validator",llm:!1,description:"Runs the script with repeat-each=3, retries=0"},healer:{label:"QA Script Healer",llm:!0,description:"Fixes script errors (never assertions) and flags app bugs"},runner:{label:"QA Test Runner",llm:!1,description:"Runs Playwright tests"},specwriter:{label:"QA Test Case Writer",llm:!0,description:"Turns a BA requirement into a spec file with test cases"},contextwriter:{label:"Context Writer",llm:!0,description:"Rewrites the project context in CLAUDE.md and removes the old project's"},custom:{label:"Custom agent",llm:!0,description:"An agent created on the Agents page"}},Io={explore:["explorer"],generate:["explorer","generator","validator"],heal:["healer","validator"],spec:["specwriter"],testrun:["runner"],context:["contextwriter"]},Eh=["validator","healer"],_p=500,Eb=5,Tb=120,Pb=2e3,ku=5e4,Hy=20,Rb=[10,20,50,100],Lb={maxHealRounds:2},Op=10,Th=[{id:"opus",label:"Opus — most capable, highest cost"},{id:"sonnet",label:"Sonnet — balanced"},{id:"haiku",label:"Haiku — fastest, cheapest"}],Ab=["specFile","testFile","jobDir"],Ib={mode:"scoped",browser:!1,editTests:!1,editSpecs:!1,typecheck:!1,deniedCommands:[],protectedPaths:[]},Wy=["git push","git reset --hard","rm -rf","curl","wget","cat .env","type .env"],Vy=["qa-studio",".git",".claude","node_modules"],Db=2e3;Th.map(e=>e.id);const Ph=e=>`custom:${e}`,bl=e=>e.startsWith("custom:")?e.slice(7):null,zb=["first","last"],hs=e=>typeof e=="string"?{kind:"agent",agent:e}:e,Qc=80,qc=500,ba=20,Sa=10,fl=10,Mb=3,to=3,Fp=100,$b=Object.keys(Ne).filter(e=>e!=="custom"),Do=e=>e.flatMap(t=>t.kind==="agent"?[t.agent]:Do(t.steps.map(hs))),Qy=e=>e.kind==="agent"?0:1+Math.max(0,...e.steps.map(t=>Qy(hs(t))));function qy(e){if(e.kind==="agent")return 1;const t=e.steps.map(a=>qy(hs(a))),n=e.maxIterations,r=t.reduce((a,o)=>a+o,0);if(e.endsWhen==="last")return n*r;const[i=0,...l]=t;return n*i+Math.max(0,n-1)*l.reduce((a,o)=>a+o,0)}const _b=new Set(["explorer","generator","validator","healer","runner","specwriter"]),Ob=e=>Do(e).find(t=>_b.has(t))??null;function Fb(e,t){const n=[];if(!e||typeof e!="object")return{ok:!1,errors:["Body must be an object"]};const r=e,i=typeof r.name=="string"?r.name.trim():"";i?i.length>Qc&&n.push(`Name is longer than ${Qc} characters`):n.push("Name is required");const l=r.description===void 0||r.description===null?"":r.description;typeof l!="string"?n.push("Description must be text"):l.length>qc&&n.push(`Description is longer than ${qc} characters`);let a;if(r.workDir!==void 0&&r.workDir!==null)if(typeof r.workDir!="string")n.push("Working directory must be text");else{const h=r.workDir.trim();h&&(/^([A-Za-z]:[\\/]|\/)/.test(h)?a=/^([A-Za-z]:[\\/]|\/)$/.test(h)?h:h.replace(/[\\/]+$/,""):n.push("Working directory must be an absolute path (e.g. D:\\my-app)"))}const o=h=>typeof h!="string"?`unknown agent ${JSON.stringify(h)}`:bl(h)!==null||$b.includes(h)?null:`unknown agent ${JSON.stringify(h)}`,u=(h,d,f)=>{if(f>to)return n.push(`${d}: loops can be nested at most ${to} levels deep`),null;const m=h.maxIterations;let p=!0;if((typeof m!="number"||!Number.isInteger(m)||m<1||m>fl)&&(n.push(`${d}: maximum loop count must be a whole number from 1 to ${fl}`),p=!1),h.endsWhen!==void 0&&!zb.includes(h.endsWhen)&&(n.push(`${d}: ends when must be "first" or "last"`),p=!1),!Array.isArray(h.steps)||h.steps.length===0)return n.push(`${d}: drop at least one agent into the loop`),null;h.steps.length>Sa&&(n.push(`${d}: a loop has at most ${Sa} entries`),p=!1);const g=[],w=new Set;return h.steps.slice(0,Sa).forEach((y,x)=>{if(typeof y=="string"){const b=o(y);b?w.add(b):g.push(y);return}const v=y;if(v&&typeof v=="object"&&v.kind==="loop"){const b=u(v,`${d} › loop ${x+1}`,f+1);b?g.push(b):p=!1;return}if(v&&typeof v=="object"&&v.kind==="agent"){const b=o(v.agent);b?w.add(b):g.push(v.agent);return}w.add(`unknown agent ${JSON.stringify(y)}`)}),w.forEach(y=>n.push(`${d}: ${y}`)),!p||w.size?null:{kind:"loop",steps:g,maxIterations:m,...h.endsWhen==="last"?{endsWhen:"last"}:{}}},c=[];return Array.isArray(r.steps)?(r.steps.length===0&&n.push("Add at least one agent to the pipeline"),r.steps.length>ba&&n.push(`A pipeline has at most ${ba} blocks`),r.steps.slice(0,ba).forEach((h,d)=>{const f=`Block ${d+1}`,m=h;if(!m||typeof m!="object")return void n.push(`${f}: must be an object`);if(m.kind==="agent"){const p=o(m.agent);if(p)return void n.push(`${f}: ${p}`);c.push({kind:"agent",agent:m.agent})}else if(m.kind==="loop"){const p=u(m,f,1);if(!p)return;const g=qy(p);if(Qy(p)>1&&g>Fp)return void n.push(`${f}: these nested loops could take up to ${g} agent runs (at most ${Fp}); lower the maximum iterations`);c.push(p)}else n.push(`${f}: kind must be "agent" or "loop"`)})):n.push("steps must be a list"),c.findIndex(h=>Do([h]).includes("specwriter")),n.length?{ok:!1,errors:n}:{ok:!0,value:{name:i,description:l.trim(),steps:c,...a?{workDir:a}:{}}}}function Ub(e){const t=Math.max(1,Math.min(fl,e+1));return[{id:"explore",name:"Explore",description:"Verify each test case in a real browser.",steps:[{kind:"agent",agent:"explorer"}]},{id:"generate",name:"Generate",description:"Explore the spec, generate the script, then validate and heal until it passes.",steps:[{kind:"agent",agent:"explorer"},{kind:"agent",agent:"generator"},{kind:"loop",steps:["validator","healer"],maxIterations:t}]},{id:"heal",name:"Heal",description:"Fix a failing script, then validate it.",steps:[{kind:"loop",steps:["validator","healer"],maxIterations:t}]},{id:"spec",name:"Write spec",description:"Turn a BA requirement into a spec file.",steps:[{kind:"agent",agent:"specwriter"}]},{id:"testrun",name:"Test run",description:"Run all tests, one spec, one test case or a picked selection.",steps:[{kind:"agent",agent:"runner"}]},{id:"context",name:"Project context",description:"Rewrite the project context in CLAUDE.md.",steps:[{kind:"agent",agent:"contextwriter"}]}]}const Up=[{id:"default",label:"Default"},{id:"fable",label:"Fable"},{id:"opus",label:"Opus"},{id:"sonnet",label:"Sonnet"},{id:"haiku",label:"Haiku"}],Jr=["default","low","medium","high","xhigh","max"],no=[{id:"manual",label:"Ask every time",description:"Like the terminal: Claude asks before editing files or running commands"},{id:"acceptEdits",label:"Accept edits",description:"File edits run without asking; commands and other actions ask you first"},{id:"plan",label:"Plan (read-only)",description:"Claude can read and search but not edit files or run commands"},{id:"auto",label:"Auto",description:"Claude Code decides which actions are safe to run"},{id:"bypassPermissions",label:"Bypass permissions",description:"Every tool runs without asking (use with care)"}];function ta(e,t){const n=t.toLowerCase();if(!n)return e;const r=i=>{const l=i.name.toLowerCase();return l.startsWith(n)||l.slice(l.indexOf(":")+1).startsWith(n)?0:l.includes(n)?1:i.description.toLowerCase().includes(n)?2:3};return e.map((i,l)=>({i,idx:l,r:r(i)})).filter(i=>i.r<3).sort((i,l)=>i.r-l.r||i.idx-l.idx).map(i=>i.i)}const Gy={mode:"scoped",browser:!1,editTests:!1,editSpecs:!1,typecheck:!1,deniedCommands:[],protectedPaths:[]},bu={...Gy,mode:"full",typecheck:!0,deniedCommands:[...Wy],protectedPaths:[...Vy]},Bb=`# Planner Agent — Instructions
79
79
 
80
80
  ## 1. Persona
81
81
 
@@ -136,7 +136,7 @@ Ask the questions that matter, get the human's answers, and turn the request int
136
136
  - Do not write or change code.
137
137
  - Keep the solution minimal: no features, refactors or dependencies the request does not need.
138
138
  - \`status\` is \`passed\` when you wrote questions or a final solution. Use \`failed\` only when the request cannot be planned (for example, it contradicts the codebase), and say why in \`failure\`.
139
- `,_b=`# Coding Agent — Instructions
139
+ `,Hb=`# Coding Agent — Instructions
140
140
 
141
141
  ## 1. Persona
142
142
 
@@ -192,7 +192,7 @@ Implement the **approved solution** with minimal, readable, correct and type-saf
192
192
  - **Notes for Unit Test agent:** new or changed behavior that needs tests (units, branches, edge and error cases).
193
193
 
194
194
  \`status\`: \`passed\` when the solution (or every CRITICAL/REQUIRED finding) is implemented and the checks pass, otherwise \`failed\`.
195
- `,Ob=`# Unit Test Agent
195
+ `,Wb=`# Unit Test Agent
196
196
 
197
197
  ## Persona
198
198
 
@@ -270,7 +270,7 @@ Own the unit tests for the change. Review the existing tests, update or add test
270
270
  - Are all tests deterministic and independent?
271
271
  - Is every branch of the changed code exercised?
272
272
  - Is there at least one edge case and one error case per unit?
273
- `,Fb=`# Code Review Agent
273
+ `,Vb=`# Code Review Agent
274
274
 
275
275
  ## Persona
276
276
 
@@ -357,63 +357,61 @@ Any CRITICAL or REQUIRED finding, or any failed check → \`"status": "failed"\`
357
357
  - Is the verdict consistent with the Rule?
358
358
  - Did I check every checklist category?
359
359
  - Is every Must-fix item specific enough for the Coding agent to act on without asking?
360
- `,qc=[{id:"planner",label:"Planner",agent:{name:"Planner",description:"Asks the open questions, takes the answers and writes the solution",instructions:$b,model:"sonnet",permissions:Vy,review:"human"}},{id:"coding",label:"Coding",agent:{name:"Coding",description:"Implements the approved solution; never writes tests",instructions:_b,model:"opus",permissions:ku,review:"auto"}},{id:"unit-test",label:"Unit Test",agent:{name:"Unit Test",description:"Tests the diff with 100% line and branch coverage and runs the suite",instructions:Ob,model:"sonnet",permissions:ku,review:"auto"}},{id:"code-review",label:"Code Review",agent:{name:"Code Review",description:"Solution-architect review: CRITICAL/REQUIRED go back to Coding, OPTIONAL noted for later",instructions:Fb,model:"sonnet",permissions:ku,review:"auto"}}];function Ub(e){const t=qc.find(r=>r.id===e);if(!t)throw new Error(`Unknown agent template: ${e}`);const n=t.agent.permissions;return{...t.agent,skills:[],claudeMdSections:[],permissions:{...n,deniedCommands:[...n.deniedCommands],protectedPaths:[...n.protectedPaths]}}}function yt({status:e,children:t}){return e?s.jsx("span",{className:`badge ${e}`,children:t??e}):s.jsx("span",{className:"badge",children:"—"})}function An({status:e}){return s.jsx(yt,{status:e,children:e==="passed"?"done":e==="waiting"?"waiting for review":void 0})}function ni({status:e,children:t,title:n}){return e?s.jsxs("span",{className:`pill ${e}`,title:n,children:[s.jsx("i",{}),t??e]}):s.jsx("span",{className:"pill",children:"—"})}function Le({error:e}){return e?s.jsx("div",{className:"error-box",role:"alert",children:e}):null}function kn({value:e,onChange:t,items:n}){return s.jsx("div",{className:"tabs",role:"tablist",children:n.map(r=>s.jsx("button",{role:"tab","aria-selected":e===r.id,className:`tab ${e===r.id?"active":""}`,onClick:()=>t(r.id),children:r.label},r.id))})}const Qy={explorer:Ay,generator:kh,validator:bh,healer:Iy,runner:db,specwriter:hl,contextwriter:Sh,custom:hl};function Ft({agent:e,size:t=36}){const n=Qy[e];return s.jsx("span",{className:`agent-icon ${e}`,style:{width:t,height:t,borderRadius:t/3},title:Ne[e].label,children:s.jsx(n,{size:Math.round(t*.5)})})}function Bb({agents:e}){return s.jsx("span",{className:"row",style:{gap:0},children:e.map(t=>{const n=Qy[t.agent];return s.jsx("span",{className:`agent-chip agent-icon ${t.agent} ${t.status}`,title:`${Ne[t.agent].label}: ${t.status}`,children:s.jsx(n,{size:12})},t.id)})})}function Rt(e){if(!e)return"—";const t=new Date(e),n=(Date.now()-t.getTime())/1e3;return n<60?"just now":n<3600?`${Math.floor(n/60)} min ago`:n<86400?`${Math.floor(n/3600)} h ago`:t.toLocaleString("en-US",{hour12:!1})}function br(e,t){if(!e)return"—";const n=(t?Date.parse(t):Date.now())-Date.parse(e);if(n<1e3)return`${Math.max(n,0)} ms`;const r=Math.round(n/1e3);return r<60?`${r}s`:`${Math.floor(r/60)}m ${r%60}s`}const Sr={explore:"Explore",generate:"Generate",heal:"Heal",spec:"Write spec",testrun:"Test run",context:"Project context",custom:"Custom agent",pipeline:"Pipeline"};function qy(e){var t;return e.label??((t=Ne[e.agent])==null?void 0:t.label)??e.agent}function sn(e){return e==null?"—":e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(e<1e4?1:0)}k`:`${(e/1e6).toFixed(2)}M`}function Kt(e){return e==null?"—":e>0&&e<.01?"<$0.01":`$${e.toFixed(2)}`}function Hb({onClose:e,onNewSpec:t}){const n=ut(),{specs:r}=un(),i=$e(()=>Q.jobs()),[l,a]=j.useState(""),[o,u]=j.useState(0),c=m=>{e(),n(m)},h=j.useMemo(()=>{const m=[{group:"Actions",key:"new",label:"Create new spec",text:"new spec create",icon:s.jsx(qt,{size:16}),run:t},{group:"Actions",key:"runall",label:"Run all tests",text:"run all tests",icon:s.jsx(ft,{size:16}),run:()=>void Q.createJob({type:"testrun",repeatEach:1}).then(g=>c(`/runs/${g.id}`))},...r.map(g=>({group:"Specs",key:`s-${g.file}`,label:s.jsxs(s.Fragment,{children:[g.file," ",s.jsx("span",{className:"muted small",children:g.parsed.title})]}),text:`${g.file} ${g.parsed.title}`,icon:s.jsx(wr,{size:16}),run:()=>c(`/specs/${g.file}`)})),...r.flatMap(g=>g.parsed.tcs.map(w=>({group:"Test case",key:`t-${g.file}-${w.id}`,label:s.jsxs(s.Fragment,{children:[s.jsx("code",{children:w.id})," ",w.title]}),text:`${w.id} ${w.title} ${g.file}`,icon:s.jsx(wr,{size:16}),run:()=>c(`/specs/${g.file}`)}))),...(i.data??[]).slice(0,20).map(g=>({group:"Jobs",key:`j-${g.id}`,label:s.jsxs(s.Fragment,{children:["#",g.id," ",Sr[g.type]," · ",g.target," ",s.jsx(An,{status:g.status})]}),text:`#${g.id} ${g.type} ${g.target} ${g.status}`,icon:s.jsx(ft,{size:16}),run:()=>c(`/runs/${g.id}`)}))],p=l.trim().toLowerCase();return p?m.filter(g=>g.text.toLowerCase().includes(p)):m},[l,r,i.data]);j.useEffect(()=>u(0),[l]);const d=m=>{var p;m.key==="ArrowDown"?(m.preventDefault(),u(g=>Math.min(g+1,h.length-1))):m.key==="ArrowUp"?(m.preventDefault(),u(g=>Math.max(g-1,0))):m.key==="Enter"&&((p=h[o])==null||p.run())};let f="";return s.jsx("div",{className:"overlay",onClick:e,children:s.jsxs("div",{className:"palette",onClick:m=>m.stopPropagation(),role:"dialog","aria-label":"Command palette",children:[s.jsx("input",{autoFocus:!0,placeholder:"Search specs, test cases, jobs, actions…",value:l,onChange:m=>a(m.target.value),onKeyDown:d}),s.jsxs("ul",{role:"listbox",children:[h.map((m,p)=>{const g=m.group!==f;return f=m.group,s.jsxs("div",{children:[g&&s.jsx("li",{className:"group",children:m.group}),s.jsxs("li",{role:"option","aria-selected":p===o,className:p===o?"active":"",onMouseEnter:()=>u(p),onClick:m.run,children:[m.icon,s.jsx("span",{children:m.label})]})]},m.key)}),h.length===0&&s.jsx("li",{className:"group",children:"No results"})]})]})})}const Gy=j.createContext(async()=>!1),In=()=>j.useContext(Gy);function Wb({children:e}){const[t,n]=j.useState([]),r=j.useRef(1),i=j.useCallback(u=>{const c=r.current++;return new Promise(h=>n(d=>[...d,{...u,id:c,resolve:h}]))},[]),l=t[0],a=j.useCallback(u=>{n(c=>{var h;return(h=c[0])==null||h.resolve(u),c.slice(1)})},[]),o=j.useMemo(()=>i,[i]);return s.jsxs(Gy.Provider,{value:o,children:[e,l&&Pr.createPortal(s.jsx(Vb,{opts:l,onClose:a},l.id),document.body)]})}function Vb({opts:e,onClose:t}){const n=j.useRef(null),r=j.useRef(null),i=j.useRef(null);return j.useEffect(()=>{var a;(a=(e.danger?r:i).current)==null||a.focus();const l=o=>{var u,c;if(o.key==="Escape"&&(o.stopPropagation(),t(!1)),o.key==="Tab"){const h=[...((u=n.current)==null?void 0:u.querySelectorAll("button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), a[href]"))??[]],d=h.indexOf(document.activeElement);o.preventDefault(),(c=h[(d+(o.shiftKey?-1:1)+h.length)%h.length])==null||c.focus()}};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[e.danger,t]),s.jsx("div",{className:"overlay confirm-overlay",onClick:()=>t(!1),children:s.jsx("div",{ref:n,className:"modal confirm-modal",role:"alertdialog","aria-modal":"true","aria-labelledby":"confirm-title","aria-describedby":"confirm-msg",onClick:l=>l.stopPropagation(),children:s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"confirm-head",children:[e.danger&&s.jsx("span",{className:"confirm-icon","aria-hidden":"true",children:s.jsx(Ar,{size:18})}),s.jsxs("div",{children:[s.jsx("h3",{id:"confirm-title",children:e.title}),e.message&&s.jsx("div",{id:"confirm-msg",className:"confirm-msg",children:e.message})]})]}),s.jsxs("div",{className:"confirm-actions",children:[s.jsx("button",{ref:r,type:"button",className:"btn ghost",onClick:()=>t(!1),children:e.cancelLabel??"Cancel"}),s.jsx("button",{ref:i,type:"button",className:`btn ${e.danger?"btn-danger-solid":""}`,onClick:()=>t(!0),children:e.confirmLabel??(e.danger?"Delete":"OK")})]})]})})})}function Rh(e,t){const n=In(),r=j.useRef(!1),i=j.useRef(t);i.current=t,j.useEffect(()=>{e.state!=="blocked"||r.current||(r.current=!0,n(i.current).then(l=>{r.current=!1,l?e.proceed():e.reset()}))},[e,n])}const Ky=j.createContext(e=>e),Qb=()=>j.useContext(Ky);function qb({children:e}){const[t,n]=j.useState(0),r=j.useCallback(i=>(n(l=>l+1),i.finally(()=>n(l=>l-1))),[]);return s.jsxs(Ky.Provider,{value:r,children:[e,t>0&&Pr.createPortal(s.jsx("div",{className:"loading-bar",role:"progressbar","aria-label":"Loading"}),document.body)]})}const Si=()=>{},Yy=j.createContext({show:Si,info:Si,success:Si,warning:Si,error:Si}),Ir=()=>j.useContext(Yy);function Gb({children:e}){const[t,n]=j.useState([]),r=j.useRef(1),i=j.useCallback(o=>n(u=>u.filter(c=>c.id!==o)),[]),l=j.useCallback((o,u)=>{const c=(u==null?void 0:u.kind)??"info",h={id:r.current++,kind:c,message:o,duration:(u==null?void 0:u.duration)??(c==="error"?6e3:3500)};n(d=>[...d,h].slice(-4))},[]),a=j.useMemo(()=>({show:l,info:o=>l(o,{kind:"info"}),success:o=>l(o,{kind:"success"}),warning:o=>l(o,{kind:"warning"}),error:o=>l(o,{kind:"error"})}),[l]);return s.jsxs(Yy.Provider,{value:a,children:[e,Pr.createPortal(s.jsx("div",{className:"toasts",role:"region","aria-label":"Notifications",children:t.map(o=>s.jsx(Kb,{item:o,onClose:()=>i(o.id)},o.id))}),document.body)]})}function Kb({item:e,onClose:t}){const[n,r]=j.useState(!1);return j.useEffect(()=>{if(n)return;const i=setTimeout(t,e.duration);return()=>clearTimeout(i)},[n,e.duration,t]),s.jsxs("div",{className:`toast ${e.kind}`,role:e.kind==="error"?"alert":"status",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[s.jsx("span",{className:"toast-icon","aria-hidden":"true",children:e.kind==="success"?s.jsx(wh,{size:14}):e.kind==="error"?s.jsx(kr,{size:14}):e.kind==="warning"?"!":"i"}),s.jsx("span",{className:"toast-msg",children:e.message}),s.jsx("button",{className:"toast-close",onClick:t,"aria-label":"Dismiss notification",children:s.jsx(kr,{size:13})})]})}const Yb=15*60*1e3,Jb=2e3,Xb=5*60*1e3;async function Zb(){try{const e=await fetch("/api/update",{cache:"no-store"});return e.status===404?"other":e.ok?await e.json():null}catch{return null}}function eS(){const[e,t]=j.useState(null),[n,r]=j.useState(null),[i,l]=j.useState(null),a=j.useCallback(()=>{Q.updateStatus().then(t).catch(()=>{})},[]);if(j.useEffect(()=>{a();const u=setInterval(a,Yb);return window.addEventListener("focus",a),()=>{clearInterval(u),window.removeEventListener("focus",a)}},[a]),j.useEffect(()=>{if(!n)return;const u=Date.now();let c=!1;const h=setInterval(()=>{Zb().then(d=>{if(!d)return void(c=!0);if(d==="other"||d.current===n)return window.location.reload();(c||Date.now()-u>Xb)&&(r(null),t(d),d.error||l("The update did not finish. Run the command below in a terminal, then restart Agent Studio."))})},Jb);return()=>clearInterval(h)},[n]),!(e!=null&&e.required)&&!n)return null;const o=async()=>{l(null);try{const u=await Q.startUpdate();r(u.latest)}catch(u){l(u.message)}};return s.jsx("div",{className:"overlay update-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"update-title",children:s.jsx("div",{className:"modal",children:s.jsx("div",{className:"modal-body",children:n?s.jsxs(s.Fragment,{children:[s.jsxs("h3",{id:"update-title",children:["Updating to v",n," ..."]}),s.jsx("p",{className:"muted",children:"Installing and restarting Agent Studio. Progress is shown in the terminal where it runs; this page reloads by itself."})]}):s.jsxs(s.Fragment,{children:[s.jsx("h3",{id:"update-title",children:"Update required"}),s.jsxs("p",{children:["Agent Studio ",s.jsxs("b",{children:["v",e.latest]})," is available (you have v",e.current,"). Update to keep using the app."]}),(i||e.error)&&s.jsxs("div",{className:"error-box",role:"alert",children:[i||e.error,s.jsx("pre",{className:"update-cmd",children:e.command})]}),s.jsx("div",{className:"confirm-actions",children:s.jsxs("button",{className:"btn",onClick:()=>void o(),children:[s.jsx(Yn,{size:14})," Update and restart"]})})]})})})})}const Jy=j.createContext({refreshClaude:()=>{},openNewSpec:()=>{},openPalette:()=>{},theme:"light",toggleTheme:()=>{},crumbSlot:null,extraSlot:null}),hs=()=>j.useContext(Jy);function tS(){try{return localStorage.getItem("qa-studio.sidebar")==="collapsed"}catch{return!1}}const nS=.6,bu="Agent Studio (v0.1.8)";function rS(e,t){j.useLayoutEffect(()=>{const n=e.current,r=t.current;if(!n||!r)return;const i=()=>{r.style.zoom="";const o=getComputedStyle(n),u=n.clientHeight-parseFloat(o.paddingTop)-parseFloat(o.paddingBottom),c=r.scrollHeight,h=c>u&&u>0?Math.max(nS,u/c):1;r.style.zoom=h<1?h.toFixed(3):""};i();const l=new ResizeObserver(i);l.observe(n);const a=new MutationObserver(i);return a.observe(r,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),a.disconnect()}},[e,t])}function sS({collapsed:e,mobileOpen:t,onCloseMobile:n}){var y;const r=j.useRef(null),i=j.useRef(null);rS(r,i);const{specs:l,mapping:a}=un(),{openPalette:o}=hs(),u=Kn(),c=$e(()=>Q.jobs(),[u.pathname]),{reload:h}=c,d=(c.data??[]).some(x=>x.status==="queued"||x.status==="running"||x.status==="waiting");j.useEffect(()=>{if(!d)return;const x=setInterval(h,5e3);return()=>clearInterval(x)},[d,h]);const f=(c.data??[]).filter(x=>x.status==="running"||x.status==="queued").length,m=(c.data??[]).filter(x=>x.status==="waiting").length;j.useEffect(()=>(document.title=m?`● ${bu}`:bu,()=>{document.title=bu}),[m]);const p=a.filter(x=>x.status!=="orphan"&&x.testFile).length,g=a.filter(x=>x.status!=="orphan").length,w=(x,v,b,A,k,E)=>s.jsxs(G0,{to:x,end:k,className:({isActive:T})=>`side-link ${T&&!(E&&u.pathname.startsWith(E))?"active":""}`,title:e?b:void 0,children:[v,s.jsx("span",{className:"side-label",children:b}),A!==void 0&&s.jsx("span",{className:"count",children:A})]});return s.jsx("aside",{ref:r,id:"app-sidebar",className:`sidebar ${e?"collapsed":""} ${t?"mobile-open":""}`,"aria-label":"Main menu",children:s.jsxs("div",{ref:i,className:"side-inner",children:[s.jsxs("div",{className:"side-head",children:[s.jsx("span",{className:"logo",children:s.jsx(bh,{size:18})}),s.jsx("h2",{className:"side-label",children:"Agent Studio"}),s.jsx("button",{className:"side-close",onClick:n,"aria-label":"Close menu",children:s.jsx(kr,{size:18})})]}),s.jsxs("button",{className:"side-search",onClick:o,"aria-label":"Search (Ctrl+K)",children:[s.jsx(Ro,{size:16}),s.jsx("span",{className:"side-label",children:"Search"}),s.jsx("span",{className:"kbd side-label",children:"⌘K"})]}),s.jsx("div",{className:"side-group side-label",children:"Overview"}),s.jsxs("nav",{className:"side-nav","aria-label":"Overview",children:[w("/",s.jsx(ab,{size:17}),"Overview",void 0,!0),w("/chat",s.jsx(Ch,{size:17}),"Claude chat")]}),s.jsx("div",{className:"side-group side-label",children:"Specification"}),s.jsxs("nav",{className:"side-nav","aria-label":"Specification",children:[w("/specs",s.jsx(wr,{size:17}),"Specification",l.length,!1,"/specs/from-requirement"),w("/specs/from-requirement",s.jsx(hl,{size:17}),"Generator")]}),s.jsx("div",{className:"side-group side-label",children:"Testing"}),s.jsxs("nav",{className:"side-nav","aria-label":"Testing",children:[w("/mapping",s.jsx(jh,{size:17}),"Test cases",g?`${p}/${g}`:0),w("/test-runs",s.jsx(pb,{size:17}),"Test runs"),w("/runs",s.jsx(ft,{size:17}),"Recent runs",m?`${m} waiting`:f?`${f} running`:((y=c.data)==null?void 0:y.length)??0)]}),s.jsx("div",{className:"side-group side-label",children:"Settings"}),s.jsxs("nav",{className:"side-nav","aria-label":"Settings",children:[w("/agents",s.jsx($y,{size:17}),"Agents"),w("/usage",s.jsx(_y,{size:17}),"Claude usage"),w("/project",s.jsx(Sh,{size:17}),"Project"),w("/settings",s.jsx(hb,{size:17}),"Settings")]})]})})}function iS({setCrumbSlot:e,setExtraSlot:t,menuOpen:n,onMenu:r}){const{theme:i,toggleTheme:l,openPalette:a}=hs();return s.jsxs("header",{className:"topbar",children:[s.jsx("button",{className:"menu-btn",onClick:r,"aria-label":"Open menu","aria-expanded":n,"aria-controls":"app-sidebar",children:s.jsx(cb,{size:20})}),s.jsx("div",{className:"topbar-crumbs",ref:e}),s.jsx("div",{className:"topbar-spacer"}),s.jsx("div",{className:"topbar-extra",ref:t}),s.jsxs("button",{className:"top-search",onClick:a,"aria-label":"Search specs, TC-ID (Ctrl+K)",children:[s.jsx(Ro,{size:15}),s.jsx("span",{children:"Search specs, TC-ID…"})]}),s.jsx("button",{className:"theme-btn",onClick:l,title:"Toggle light/dark theme","aria-label":"Toggle light/dark theme",children:i==="dark"?s.jsx(zy,{size:17}):s.jsx(Dy,{size:17})})]})}const lS=/^[a-z0-9][a-z0-9_-]*$/;function aS({initial:e,onClose:t}){const n=ut(),{refresh:r}=un(),[i,l]=j.useState((e==null?void 0:e.name)??""),[a,o]=j.useState(null),u=async c=>{c.preventDefault();const h=i.trim().replace(/\.md$/,"");if(!lS.test(h))return o('Name may only contain lowercase letters, digits, "-" or "_", and must start with a letter or digit.');try{await Q.createSpec(`${h}.md`,(e==null?void 0:e.content)??tb),r(),t(),n(`/specs/${h}.md`)}catch(d){o(d.message)}};return s.jsx("div",{className:"overlay",onClick:t,children:s.jsx("form",{className:"modal",onClick:c=>c.stopPropagation(),onSubmit:u,children:s.jsxs("div",{className:"modal-body",children:[s.jsx("h3",{style:{margin:0},children:e!=null&&e.content?"Import spec":"New spec"}),s.jsxs("div",{className:"row",children:[s.jsx("input",{className:"input grow",autoFocus:!0,placeholder:"spec-name",value:i,onChange:c=>l(c.target.value),"aria-label":"Spec name"}),s.jsx("span",{className:"muted",children:".md"})]}),s.jsx(Le,{error:a}),s.jsxs("div",{className:"row",style:{justifyContent:"flex-end"},children:[s.jsx("button",{type:"button",className:"btn ghost",onClick:t,children:"Cancel"}),s.jsx("button",{type:"submit",className:"btn",children:e!=null&&e.content?"Import":"Create spec"})]})]})})})}function oS(e){const[t,n]=j.useState(!1);return j.useEffect(()=>{const r=()=>n(!0);return window.addEventListener(Bc,r),()=>window.removeEventListener(Bc,r)},[]),j.useEffect(()=>{if(!t)return;let r=!1;const i=setInterval(()=>{X0().then(l=>{l&&!r&&(n(!1),e())})},3e3);return()=>{r=!0,clearInterval(i)}},[t,e]),t}function uS(){var k;const e=rb(),[t,n]=ib(),[r,i]=j.useState(!1),[l,a]=j.useState(null),[o,u]=j.useState(tS),[c,h]=j.useState(!1),{pathname:d}=Kn();j.useEffect(()=>h(!1),[d]);const[f,m]=j.useState(null),[p,g]=j.useState(null),[w,y]=j.useState(null),x=j.useCallback(()=>{Q.claudeStatus().then(y).catch(()=>{})},[]),{refresh:v}=e,b=oS(j.useCallback(()=>{v(),x()},[v,x]));j.useEffect(()=>{x();const E=setInterval(x,5*6e4);return()=>clearInterval(E)},[x]),j.useEffect(()=>{try{localStorage.setItem("qa-studio.sidebar",o?"collapsed":"open")}catch{}},[o]),j.useEffect(()=>{const E=T=>{(T.ctrlKey||T.metaKey)&&T.key.toLowerCase()==="k"&&(T.preventDefault(),i(I=>!I)),T.key==="Escape"&&(i(!1),a(null),h(!1))};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[]);const A=j.useMemo(()=>({openNewSpec:E=>a(E??{}),openPalette:()=>i(!0),theme:t,toggleTheme:n,crumbSlot:f,extraSlot:p,refreshClaude:x}),[t,n,f,p,x]);return s.jsx(Ly.Provider,{value:e,children:s.jsx(Jy.Provider,{value:A,children:s.jsx(Gb,{children:s.jsx(qb,{children:s.jsxs(Wb,{children:[s.jsxs("div",{className:`shell ${o?"side-collapsed":""}`,children:[s.jsx(sS,{collapsed:o,mobileOpen:c,onCloseMobile:()=>h(!1)}),c&&s.jsx("div",{className:"side-backdrop",onClick:()=>h(!1),"aria-hidden":"true"}),s.jsx("button",{className:"side-toggle-dot",onClick:()=>u(E=>!E),"aria-label":o?"Expand menu":"Collapse menu",title:o?"Expand menu":"Collapse menu",children:s.jsx("span",{style:{display:"inline-flex",transform:o?void 0:"rotate(180deg)"},children:s.jsx(ti,{size:10})})}),s.jsxs("div",{className:"main",children:[s.jsx(iS,{setCrumbSlot:m,setExtraSlot:g,menuOpen:c,onMenu:()=>h(!0)}),b&&s.jsxs("div",{className:"claude-banner",role:"alert",children:[s.jsx("b",{children:"Agent Studio server is not running."})," Start it with ",s.jsx("code",{children:"npm run studio:start"})," in the repo folder; this page reconnects by itself."]}),!b&&(w==null?void 0:w.state)==="not-ready"&&s.jsxs("div",{className:"claude-banner",role:"alert",children:[s.jsx("b",{children:"Claude Code is not ready:"})," ",w.binary.ok?w.version.ok?(k=w.test)==null?void 0:k.message:w.version.detail:w.binary.detail,". Built-in agents (explore, generate, heal, spec generator, project context) cannot run. ",s.jsx(ye,{to:"/settings#claude",children:"Fix it in Settings"})]}),s.jsx("div",{className:"content",children:s.jsx(C0,{})})]})]}),r&&s.jsx(Hb,{onClose:()=>i(!1),onNewSpec:()=>(i(!1),a({}))}),l&&s.jsx(aS,{initial:l,onClose:()=>a(null)}),s.jsx(eS,{})]})})})})})}function ot({items:e}){const{crumbSlot:t}=hs();return t?Pr.createPortal(s.jsx("nav",{className:"crumbs","aria-label":"Breadcrumb",children:e.map((n,r)=>s.jsxs("span",{className:"crumb",children:[r>0&&s.jsx("span",{className:"sep",children:"/"}),n.to?s.jsx(ye,{to:n.to,children:n.label}):s.jsx("span",{className:"current",children:n.label}),n.count!==void 0&&s.jsx("span",{className:"pill-count",children:n.count})]},r))}),t):null}function cS({children:e}){const{extraSlot:t}=hs();return t?Pr.createPortal(e,t):null}function dS(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const hS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pS={};function Fp(e,t){return(pS.jsx?fS:hS).test(e)}const mS=/[ \t\n\f\r]/g;function gS(e){return typeof e=="object"?e.type==="text"?Up(e.value):!1:Up(e)}function Up(e){return e.replace(mS,"")===""}class Sl{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Sl.prototype.normal={};Sl.prototype.property={};Sl.prototype.space=void 0;function Xy(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Sl(n,r,t)}function Gc(e){return e.toLowerCase()}class Ut{constructor(t,n){this.attribute=n,this.property=t}}Ut.prototype.attribute="";Ut.prototype.booleanish=!1;Ut.prototype.boolean=!1;Ut.prototype.commaOrSpaceSeparated=!1;Ut.prototype.commaSeparated=!1;Ut.prototype.defined=!1;Ut.prototype.mustUseProperty=!1;Ut.prototype.number=!1;Ut.prototype.overloadedBoolean=!1;Ut.prototype.property="";Ut.prototype.spaceSeparated=!1;Ut.prototype.space=void 0;let xS=0;const me=fs(),rt=fs(),Kc=fs(),Y=fs(),Oe=fs(),Zr=fs(),Ht=fs();function fs(){return 2**++xS}const Yc=Object.freeze(Object.defineProperty({__proto__:null,boolean:me,booleanish:rt,commaOrSpaceSeparated:Ht,commaSeparated:Zr,number:Y,overloadedBoolean:Kc,spaceSeparated:Oe},Symbol.toStringTag,{value:"Module"})),Su=Object.keys(Yc);class Lh extends Ut{constructor(t,n,r,i){let l=-1;if(super(t,n),Bp(this,"space",i),typeof r=="number")for(;++l<Su.length;){const a=Su[l];Bp(this,Su[l],(r&Yc[a])===Yc[a])}}}Lh.prototype.defined=!0;function Bp(e,t,n){n&&(e[t]=n)}function ai(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const l=new Lh(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[Gc(r)]=r,n[Gc(l.attribute)]=r}return new Sl(t,n,e.space)}const Zy=ai({properties:{ariaActiveDescendant:null,ariaAtomic:rt,ariaAutoComplete:null,ariaBusy:rt,ariaChecked:rt,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:Oe,ariaCurrent:null,ariaDescribedBy:Oe,ariaDetails:null,ariaDisabled:rt,ariaDropEffect:Oe,ariaErrorMessage:null,ariaExpanded:rt,ariaFlowTo:Oe,ariaGrabbed:rt,ariaHasPopup:null,ariaHidden:rt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Oe,ariaLevel:Y,ariaLive:null,ariaModal:rt,ariaMultiLine:rt,ariaMultiSelectable:rt,ariaOrientation:null,ariaOwns:Oe,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:rt,ariaReadOnly:rt,ariaRelevant:null,ariaRequired:rt,ariaRoleDescription:Oe,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:rt,ariaSetSize:Y,ariaSort:null,ariaValueMax:Y,ariaValueMin:Y,ariaValueNow:Y,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function ev(e,t){return t in e?e[t]:t}function tv(e,t){return ev(e,t.toLowerCase())}const yS=ai({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Zr,acceptCharset:Oe,accessKey:Oe,action:null,allow:null,allowFullScreen:me,allowPaymentRequest:me,allowUserMedia:me,alpha:me,alt:null,as:null,async:me,autoCapitalize:null,autoComplete:Oe,autoFocus:me,autoPlay:me,blocking:Oe,capture:null,charSet:null,checked:me,cite:null,className:Oe,closedBy:null,colorSpace:null,cols:Y,colSpan:Y,command:null,commandFor:null,content:null,contentEditable:rt,controls:me,controlsList:Oe,coords:Y|Zr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:me,defer:me,dir:null,dirName:null,disabled:me,download:Kc,draggable:rt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:me,formTarget:null,headers:Oe,height:Y,hidden:Kc,high:Y,href:null,hrefLang:null,htmlFor:Oe,httpEquiv:Oe,id:null,imageSizes:null,imageSrcSet:null,inert:me,inputMode:null,integrity:null,is:null,isMap:me,itemId:null,itemProp:Oe,itemRef:Oe,itemScope:me,itemType:Oe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:me,low:Y,manifest:null,max:null,maxLength:Y,media:null,method:null,min:null,minLength:Y,multiple:me,muted:me,name:null,nonce:null,noModule:me,noValidate:me,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:me,optimum:Y,pattern:null,ping:Oe,placeholder:null,playsInline:me,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:me,referrerPolicy:null,rel:Oe,required:me,reversed:me,rows:Y,rowSpan:Y,sandbox:Oe,scope:null,scoped:me,seamless:me,selected:me,shadowRootClonable:me,shadowRootCustomElementRegistry:me,shadowRootDelegatesFocus:me,shadowRootMode:null,shadowRootSerializable:me,shape:null,size:Y,sizes:null,slot:null,span:Y,spellCheck:rt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Y,step:null,style:null,tabIndex:Y,target:null,title:null,translate:null,type:null,typeMustMatch:me,useMap:null,value:rt,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Oe,axis:null,background:null,bgColor:null,border:Y,borderColor:null,bottomMargin:Y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:me,declare:me,event:null,face:null,frame:null,frameBorder:null,hSpace:Y,leftMargin:Y,link:null,longDesc:null,lowSrc:null,marginHeight:Y,marginWidth:Y,noResize:me,noHref:me,noShade:me,noWrap:me,object:null,profile:null,prompt:null,rev:null,rightMargin:Y,rules:null,scheme:null,scrolling:rt,standby:null,summary:null,text:null,topMargin:Y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Y,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:me,disablePictureInPicture:me,disableRemotePlayback:me,exportParts:Zr,part:Oe,prefix:null,property:null,results:Y,security:null,unselectable:null},space:"html",transform:tv}),vS=ai({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ht,accentHeight:Y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Y,amplitude:Y,arabicForm:null,ascent:Y,attributeName:null,attributeType:null,azimuth:Y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Y,by:null,calcMode:null,capHeight:Y,className:Oe,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Y,diffuseConstant:Y,direction:null,display:null,dur:null,divisor:Y,dominantBaseline:null,download:me,dx:null,dy:null,edgeMode:null,editable:null,elevation:Y,enableBackground:null,end:null,event:null,exponent:Y,externalResourcesRequired:null,fill:null,fillOpacity:Y,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Zr,g2:Zr,glyphName:Zr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Y,horizOriginX:Y,horizOriginY:Y,id:null,ideographic:Y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Y,k:Y,k1:Y,k2:Y,k3:Y,k4:Y,kernelMatrix:Ht,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Y,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Y,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Y,overlineThickness:Y,paintOrder:null,panose1:null,path:null,pathLength:Y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Oe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ht,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ht,rev:Ht,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ht,requiredFeatures:Ht,requiredFonts:Ht,requiredFormats:Ht,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Y,specularExponent:Y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Y,strikethroughThickness:Y,string:null,stroke:null,strokeDashArray:Ht,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Y,strokeOpacity:Y,strokeWidth:null,style:null,surfaceScale:Y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ht,tabIndex:Y,tableValues:null,target:null,targetX:Y,targetY:Y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ht,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Y,underlineThickness:Y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Y,values:null,vAlphabetic:Y,vMathematical:Y,vectorEffect:null,vHanging:Y,vIdeographic:Y,version:null,vertAdvY:Y,vertOriginX:Y,vertOriginY:Y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ev}),nv=ai({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),rv=ai({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:tv}),sv=ai({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),jS={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},wS=/[A-Z]/g,Hp=/-[a-z]/g,kS=/^data[-\w.:]+$/i;function bS(e,t){const n=Gc(t);let r=t,i=Ut;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&kS.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(Hp,NS);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!Hp.test(l)){let a=l.replace(wS,SS);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Lh}return new i(r,t)}function SS(e){return"-"+e.toLowerCase()}function NS(e){return e.charAt(1).toUpperCase()}const CS=Xy([Zy,yS,nv,rv,sv],"html"),Ah=Xy([Zy,vS,nv,rv,sv],"svg");function ES(e){return e.join(" ").trim()}var Wp=/\/\*(?:[^*]|\*(?!\/))*\*\//g,TS=/\n/g,PS=/^\s*/,RS=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,LS=/^:\s*/,AS=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,IS=/^[;\s]*/,DS=`
361
- `,Vp="/",Qp="*",Ni="",zS="comment",MS="declaration";function $S(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(p){var g=p.match(TS);g&&(n+=g.length);var w=p.lastIndexOf(DS);r=~w?p.length-w:r+p.length}function l(){var p={line:n,column:r};return function(g){return g.position=new a(p),c(),g}}function a(p){this.start=p,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(p){var g=new Error(t.source+":"+n+":"+r+": "+p);if(g.reason=p,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function u(p){var g=p.exec(e);if(g){var w=g[0];return i(w),e=e.slice(w.length),g}}function c(){u(PS)}function h(p){for(var g;g=d();)p.push(g);return p}function d(){var p=l();if(!(Vp!=e.charAt(0)||Qp!=e.charAt(1))){for(var g=2;Ni!=e.charAt(g)&&(Qp!=e.charAt(g)||Vp!=e.charAt(g+1));)++g;if(g+=2,Ni===e.charAt(g-1))return o("End of comment missing");var w=e.slice(2,g-2);return r+=2,i(w),e=e.slice(g),r+=2,p({type:zS,comment:w})}}function f(){var p=l(),g=u(RS);if(g){if(d(),!u(LS))return o("property missing ':'");var w=u(AS),y=p({type:MS,property:g[0].replace(Wp,Ni).trim(),value:w?w[0].replace(Wp,Ni).trim():Ni});return u(IS),y}}function m(){var p=[];h(p);for(var g;g=f();)p.push(g),h(p);return p}return c(),m()}function _S(e,t){let n=null;if(!e||typeof e!="string")return n;const r=$S(e),i=typeof t=="function";return r.forEach(l=>{if(l.type!=="declaration")return;const{property:a,value:o}=l;i?t(a,o,l):o&&(n=n??{},n[a]=o)}),n}const iv=lv("end"),Ih=lv("start");function lv(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function OS(e){const t=Ih(e),n=iv(e);if(t&&n)return{start:t,end:n}}function Wi(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?qp(e.position):"start"in e||"end"in e?qp(e):"line"in e||"column"in e?Jc(e):""}function Jc(e){return Gp(e&&e.line)+":"+Gp(e&&e.column)}function qp(e){return Jc(e&&e.start)+"-"+Jc(e&&e.end)}function Gp(e){return e&&typeof e=="number"?e:1}class Do extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",l={},a=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?i=t:!l.cause&&t&&(a=!0,i=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?l.ruleId=r:(l.source=r.slice(0,u),l.ruleId=r.slice(u+1))}if(!l.place&&l.ancestors){const u=l.ancestors[l.ancestors.length-1];u&&(l.place=u.position)}const o=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=Wi(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=a&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Object.defineProperties(Do.prototype,{file:{configurable:!0,enumerable:!0,value:"",writable:!0},name:{configurable:!0,enumerable:!0,value:"",writable:!0},reason:{configurable:!0,enumerable:!0,value:"",writable:!0},message:{configurable:!0,enumerable:!0,value:"",writable:!0},stack:{configurable:!0,enumerable:!0,value:"",writable:!0},column:{configurable:!0,enumerable:!0,writable:!0},line:{configurable:!0,enumerable:!0,writable:!0},ancestors:{configurable:!0,enumerable:!0,writable:!0},cause:{configurable:!0,enumerable:!0,writable:!0},fatal:{configurable:!0,enumerable:!0,writable:!0},place:{configurable:!0,enumerable:!0,writable:!0},ruleId:{configurable:!0,enumerable:!0,writable:!0},source:{configurable:!0,enumerable:!0,writable:!0}});const Dh={}.hasOwnProperty,FS=new Map,US=/[A-Z]/g,BS=/-([a-z])/g,HS=new Set(["table","tbody","thead","tfoot","tr"]),WS=new Set(["td","th"]),av="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function VS(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=ZS(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=XS(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ah:CS,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=ov(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function ov(e,t,n){if(t.type==="element")return QS(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return qS(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return KS(e,t,n);if(t.type==="mdxjsEsm")return GS(e,t);if(t.type==="root")return YS(e,t,n);if(t.type==="text")return JS(e,t)}function QS(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ah,e.schema=i),e.ancestors.push(t);const l=cv(e,t.tagName,!1),a=eN(e,t);let o=Mh(e,t);return HS.has(t.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!gS(u):!0})),uv(e,a,l,t),zh(a,o),e.ancestors.pop(),e.schema=r,e.create(t,l,a,n)}function qS(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}pl(e,t.position)}function GS(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);pl(e,t.position)}function KS(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ah,e.schema=i),e.ancestors.push(t);const l=t.name===null?e.Fragment:cv(e,t.name,!0),a=tN(e,t),o=Mh(e,t);return uv(e,a,l,t),zh(a,o),e.ancestors.pop(),e.schema=r,e.create(t,l,a,n)}function YS(e,t,n){const r={};return zh(r,Mh(e,t)),e.create(t,e.Fragment,r,n)}function JS(e,t){return t.value}function uv(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function zh(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function XS(e,t,n){return r;function r(i,l,a,o){const c=Array.isArray(a.children)?n:t;return o?c(l,a,o):c(l,a)}}function ZS(e,t){return n;function n(r,i,l,a){const o=Array.isArray(l.children),u=Ih(r);return t(i,l,a,o,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function eN(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Dh.call(t.properties,i)){const l=nN(e,i,t.properties[i]);if(l){const[a,o]=l;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&WS.has(t.tagName)?r=o:n[a]=o}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function tN(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const a=l.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else pl(e,t.position);else{const{name:i}=r;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,l=e.evaluater.evaluateExpression(o.expression)}else pl(e,t.position);else l=r.value===null?!0:r.value;n[i]=l}return n}function Mh(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:FS;for(;++r<t.children.length;){const l=t.children[r];let a;if(e.passKeys){const u=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(u){const c=i.get(u)||0;a=u+"-"+c,i.set(u,c+1)}}const o=ov(e,l,a);o!==void 0&&n.push(o)}return n}function nN(e,t,n){if(n==null||typeof n=="number"&&Number.isNaN(n))return;const r=bS(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?dS(n):ES(n)),r.property==="style"?["style",typeof n=="object"?e.stylePropertyNameCase==="dom"?n:sN(n):rN(e,String(n))]:[e.elementAttributeNameCase==="react"&&r.space?jS[r.property]||r.property:r.attribute,n]}function rN(e,t){const n={};try{_S(t,function(r,i){if(r&&i){let l=r;l.slice(0,2)!=="--"&&(l=l.toLowerCase(),e.stylePropertyNameCase==="dom"&&(l.slice(0,4)==="-ms-"&&(l=l.slice(1)),l=l.replace(BS,aN))),n[l]=i}})}catch(r){if(e.ignoreInvalidStyle)return{};const i=r,l=new Do("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=av+"#cannot-parse-style-attribute",l}return n}function cv(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let l=-1,a;for(;++l<i.length;){const o=Fp(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(l&&o.type==="Literal"),optional:!1}:o}r=a}else r=Fp(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Dh.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);pl(e)}function pl(e,t){const n=new Do("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=av+"#cannot-handle-mdx-estrees-without-createevaluater",n}function sN(e){const t={};let n;for(n in e)Dh.call(e,n)&&(t[iN(n)]=e[n]);return t}function iN(e){if(e.slice(0,2)==="--")return e;let t=e.replace(US,lN);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function lN(e){return"-"+e.toLowerCase()}function aN(e,t){return t.toUpperCase()}const Nu={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},oN={};function zo(e,t){const n=oN,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return dv(e,r,i)}function dv(e,t,n){if(uN(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Kp(e.children,t,n)}return Array.isArray(e)?Kp(e,t,n):""}function Kp(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=dv(e[i],t,n);return r.join("")}function uN(e){return!!(e&&typeof e=="object")}const Yp=document.createElement("i");function $h(e){const t="&"+e+";";Yp.innerHTML=t;const n=Yp.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function yn(e,t,n,r){const i=e.length;let l=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);l<r.length;)a=r.slice(l,l+1e4),a.unshift(t,0),e.splice(...a),l+=1e4,t+=1e4}function nn(e,t){return e.length>0?(yn(e,e.length,0,t),e):t}const Jp={}.hasOwnProperty;function hv(e){const t={};let n=-1;for(;++n<e.length;)cN(t,e[n]);return t}function cN(e,t){let n;for(n in t){const i=(Jp.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let a;if(l)for(a in l){Jp.call(i,a)||(i[a]=[]);const o=l[a];dN(i[a],Array.isArray(o)?o:o?[o]:[])}}}function dN(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);yn(e,0,0,r)}function fv(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function vn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const vt=Dr(/[A-Za-z]/),jt=Dr(/[\dA-Za-z]/),hN=Dr(/[#-'*+\--9=?A-Z^-~]/);function ro(e){return e!==null&&(e<32||e===127)}const Xc=Dr(/\d/),fN=Dr(/[\dA-Fa-f]/),pv=Dr(/[!-/:-@[-`{-~]/);function he(e){return e!==null&&e<-2}function Fe(e){return e!==null&&(e<0||e===32)}function je(e){return e===-2||e===-1||e===32}const Nl=Dr(new RegExp("\\p{P}|\\p{S}","u")),as=Dr(/\s/);function Dr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function oi(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const l=e.charCodeAt(n);let a="";if(l===37&&jt(e.charCodeAt(n+1))&&jt(e.charCodeAt(n+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(a=String.fromCharCode(l));else if(l>55295&&l<57344){const o=e.charCodeAt(n+1);l<56320&&o>56319&&o<57344?(a=String.fromCharCode(l,o),i=1):a="�"}else a=String.fromCharCode(l);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Ie(e,t,n,r){const i=r?r-1:1/0;let l=0;return a;function a(u){return je(u)?(e.enter(n),o(u)):t(u)}function o(u){return je(u)&&l++<i?(e.consume(u),o):(e.exit(n),t(u))}}function mv(e,t,n,r,i,l){let a=0;return o;function o(h){return je(h)?(e.enter(r),u(h)):c(h)}function u(h){return je(h)&&a<l?(e.consume(h),a++,u):(e.exit(r),c(h))}function c(h){return a>=i?t(h):n(h)}}const pN={tokenize:mN};function mN(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Ie(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),l(o)}function l(o){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return he(o)?(e.consume(o),e.exit("chunkText"),l):(e.consume(o),a)}}let so=class{constructor(){this.index=new Map,this.map=[]}add(t,n,r){Xp(this,t,n,r,!1)}addBefore(t,n,r){Xp(this,t,n,r,!0)}consume(t){if(this.map.sort(function(l,a){return l[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const l of i)t.push(l);i=r.pop()}this.map.length=0,this.index.clear()}};function Xp(e,t,n,r,i){if(n===0&&r.length===0)return;const l=e.index.get(t);if(l){l[1]+=n,i?(r.push(...l[2]),l[2]=r):l[2].push(...r);return}const a=[t,n,r];e.map.push(a),e.index.set(t,a)}const gN={tokenize:xN},Zp={tokenize:yN};function xN(e){const t=this,n=[];let r=0,i,l,a;return o;function o(v){if(r<n.length){const b=n[r];return t.containerState=b[1],e.attempt(b[0].continuation,u,c)(v)}return c(v)}function u(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&x();const b=t.events.length;let A=b,k;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){k=t.events[A][1].end;break}y(r);let E=b;for(;E<t.events.length;)t.events[E][1].end={...k},E++;const T=new so;return T.add(A+1,0,t.events.slice(b)),T.add(b,E-b,[]),T.consume(t.events),c(v)}return o(v)}function c(v){if(r===n.length){if(!i)return f(v);if(i.currentConstruct&&i.currentConstruct.concrete)return p(v);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Zp,h,d)(v)}function h(v){return i&&x(),y(r),f(v)}function d(v){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,p(v)}function f(v){return t.containerState={},e.attempt(Zp,m,p)(v)}function m(v){return r++,n.push([t.currentConstruct,t.containerState]),f(v)}function p(v){if(v===null){i&&x(),y(0),e.consume(v);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),g(v)}function g(v){if(v===null){w(e.exit("chunkFlow"),!0),y(0),e.consume(v);return}return he(v)?(e.consume(v),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(v),g)}function w(v,b){const A=t.sliceStream(v);if(b&&A.push(null),v.previous=l,l&&(l.next=v),l=v,i.defineSkip(v.start),i.write(A),t.parser.lazy[v.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<a&&(!i.events[k][1].end||i.events[k][1].end.offset>a))return;const E=t.events.length;let T=E,I,C;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(I){C=t.events[T][1].end;break}I=!0}for(y(r),k=E;k<t.events.length;)t.events[k][1].end={...C},k++;const R=new so;R.add(T+1,0,t.events.slice(E)),R.add(E,k-E,[]),R.consume(t.events)}}function y(v){let b=n.length;for(;b-- >v;){const A=n[b];t.containerState=A[1],A[0].exit.call(t,e)}n.length=v}function x(){i.write([null]),l=void 0,i=void 0,t.containerState._closeFlow=void 0}}function yN(e,t,n){return Ie(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Nr(e){if(e===null||Fe(e)||as(e))return 1;if(Nl(e))return 2}function Mo(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const Zc={name:"attention",resolveAll:vN,tokenize:jN};function vN(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;const l=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,a={...e[i][1].end},o={...e[n][1].start};em(a,-l),em(o,l);const u={type:l>1?"strongSequence":"emphasisSequence",start:a,end:{...e[i][1].end}},c={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:o},h={type:l>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},d={type:l>1?"strong":"emphasis",start:{...u.start},end:{...c.end}};e[i][1].end={...u.start},e[n][1].start={...c.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=nn(r,[["enter",e[i][1],t],["exit",e[i][1],t]])),r=nn(r,[["enter",d,t],["enter",u,t],["exit",u,t],["enter",h,t]]),r=nn(r,Mo(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=nn(r,[["exit",h,t],["enter",c,t],["exit",c,t],["exit",d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=nn(r,[["enter",e[n][1],t],["exit",e[n][1],t]])),yn(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function jN(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Nr(r);let l;return a;function a(u){return l=u,e.enter("attentionSequence"),o(u)}function o(u){if(u===l)return e.consume(u),o;const c=e.exit("attentionSequence"),h=Nr(u),d=!h||h===2&&i||n.includes(u)&&u!==42&&u!==95,f=!i||i===2&&h||n.includes(r)&&r!==42&&r!==95;return c._open=!!(l===42?d:d&&(i||!f)),c._close=!!(l===42?f:f&&(h||!d)),t(u)}}function em(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const wN={name:"autolink",tokenize:kN};function kN(e,t,n){let r=0;return i;function i(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(m){return vt(m)?(e.consume(m),a):m===64?n(m):c(m)}function a(m){return m===43||m===45||m===46||jt(m)?(r=1,o(m)):c(m)}function o(m){return m===58?(e.consume(m),r=0,u):(m===43||m===45||m===46||jt(m))&&r++<32?(e.consume(m),o):(r=0,c(m))}function u(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||ro(m)?n(m):(e.consume(m),u)}function c(m){return m===64?(e.consume(m),h):hN(m)?(e.consume(m),c):n(m)}function h(m){return jt(m)?d(m):n(m)}function d(m){return m===46?(e.consume(m),r=0,h):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):f(m)}function f(m){if((m===45||jt(m))&&r++<63){const p=m===45?f:d;return e.consume(m),p}return n(m)}}const Cl={partial:!0,tokenize:bN};function bN(e,t,n){return r;function r(l){return je(l)?Ie(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||he(l)?t(l):n(l)}}const gv={continuation:{tokenize:NN},exit:CN,name:"blockQuote",tokenize:SN};function SN(e,t,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),l}return n(a)}function l(a){return je(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function NN(e,t,n){const r=this;return i;function i(a){return je(a)?Ie(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):l(a)}function l(a){return e.attempt(gv,t,n)(a)}}function CN(e){e.exit("blockQuote")}const xv={name:"characterEscape",tokenize:EN};function EN(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return pv(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const yv={name:"characterReference",tokenize:TN};function TN(e,t,n){const r=this;let i=0,l,a;return o;function o(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),u}function u(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),l=31,a=jt,h(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,a=fN,h):(e.enter("characterReferenceValue"),l=7,a=Xc,h(d))}function h(d){if(d===59&&i){const f=e.exit("characterReferenceValue");return a===jt&&!$h(r.sliceSerialize(f))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(d)&&i++<l?(e.consume(d),h):n(d)}}const ed={partial:!0,tokenize:PN};function PN(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l)}function l(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const tm={concrete:!0,name:"codeFenced",tokenize:RN};function RN(e,t,n){const r=this,i={partial:!0,tokenize:A};let l=0,a=0,o;return u;function u(k){return c(k)}function c(k){const E=r.events[r.events.length-1];return l=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,o=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(k)}function h(k){return k===o?(a++,e.consume(k),h):a<3?n(k):(e.exit("codeFencedFenceSequence"),je(k)?Ie(e,d,"whitespace")(k):d(k))}function d(k){return k===null||he(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(ed,g,b)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(k))}function f(k){return k===null||he(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(k)):je(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ie(e,m,"whitespace")(k)):k===96&&k===o?n(k):(e.consume(k),f)}function m(k){return k===null||he(k)?d(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===null||he(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(k)):k===96&&k===o?n(k):(e.consume(k),p)}function g(k){return e.attempt(i,b,w)(k)}function w(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),y}function y(k){return l>0&&je(k)?Ie(e,x,"linePrefix",l+1)(k):x(k)}function x(k){return k===null||he(k)?e.check(ed,g,b)(k):(e.enter("codeFlowValue"),v(k))}function v(k){return k===null||he(k)?(e.exit("codeFlowValue"),x(k)):(e.consume(k),v)}function b(k){return e.exit("codeFenced"),t(k)}function A(k,E,T){let I=0;return C;function C(D){return k.enter("lineEnding"),k.consume(D),k.exit("lineEnding"),R}function R(D){return k.enter("codeFencedFence"),je(D)?Ie(k,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):L(D)}function L(D){return D===o?(k.enter("codeFencedFenceSequence"),M(D)):T(D)}function M(D){return D===o?(I++,k.consume(D),M):I>=a?(k.exit("codeFencedFenceSequence"),je(D)?Ie(k,U,"whitespace")(D):U(D)):T(D)}function U(D){return D===null||he(D)?(k.exit("codeFencedFence"),E(D)):T(D)}}}const Cu={name:"codeIndented",tokenize:AN},LN={partial:!0,tokenize:IN};function AN(e,t,n){return r;function r(o){return e.enter("codeIndented"),mv(e,i,n,"linePrefix",4,4)(o)}function i(o){return o===null?a(o):he(o)?e.attempt(LN,i,a)(o):(e.enter("codeFlowValue"),l(o))}function l(o){return o===null||he(o)?(e.exit("codeFlowValue"),i(o)):(e.consume(o),l)}function a(o){return e.exit("codeIndented"),t(o)}}function IN(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):he(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):mv(e,t,l,"linePrefix",4,4)(a)}function l(a){return he(a)?i(a):n(a)}}const DN={name:"codeText",previous:MN,resolve:zN,tokenize:$N};function zN(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function MN(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function $N(e,t,n){let r=0,i,l;return a;function a(d){return e.enter("codeText"),e.enter("codeTextSequence"),o(d)}function o(d){return d===96?(e.consume(d),r++,o):(e.exit("codeTextSequence"),u(d))}function u(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),u):d===96?(l=e.enter("codeTextSequence"),i=0,h(d)):he(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||he(d)?(e.exit("codeTextData"),u(d)):(e.consume(d),c)}function h(d){return d===96?(e.consume(d),i++,h):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(l.type="codeTextData",c(d))}}class _N{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ci(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ci(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ci(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ci(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ci(this.left,n.reverse())}}}function Ci(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function vv(e){const t={};let n=-1,r,i,l,a,o,u,c;const h=new _N(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,l=0,l<u.length&&u[l][1].type==="lineEndingBlank"&&(l+=2),l<u.length&&u[l][1].type==="content"))for(;++l<u.length&&u[l][1].type!=="content";)u[l][1].type==="chunkText"&&(u[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,ON(h,n)),n=t[n],c=!0);else if(r[1]._container){for(l=n,i=void 0;l--;)if(a=h.get(l),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=l);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...h.get(i)[1].start},o=h.slice(i,n),o.unshift(r),h.splice(i,n-i+1,o))}}return yn(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!c}function ON(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const l=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,u=[],c={};let h,d,f=-1,m=n,p=0,g=0;const w=[g];for(;m;){for(;e.get(++i)[1]!==m;);l.push(i),m._tokenizer||(h=r.sliceStream(m),m.next||h.push(null),d&&a.defineSkip(m.start),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(h),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=n;++f<o.length;)o[f][0]==="exit"&&o[f-1][0]==="enter"&&o[f][1].type===o[f-1][1].type&&o[f][1].start.line!==o[f][1].end.line&&(g=f+1,w.push(g),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(a.events=[],m?(m._tokenizer=void 0,m.previous=void 0):w.pop(),f=w.length;f--;){const y=o.slice(w[f],w[f+1]),x=l.pop();u.push([x,x+y.length-1]),e.splice(x,2,y)}for(u.reverse(),f=-1;++f<u.length;)c[p+u[f][0]]=p+u[f][1],p+=u[f][1]-u[f][0]-1;return c}const FN={resolve:BN,tokenize:HN},UN={partial:!0,tokenize:WN};function BN(e){return vv(e),e}function HN(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?l(o):he(o)?e.check(UN,a,l)(o):(e.consume(o),i)}function l(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function a(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function WN(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ie(e,l,"linePrefix")}function l(a){if(a===null||he(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function jv(e,t,n,r,i,l,a,o,u){const c=u||Number.POSITIVE_INFINITY;let h=0;return d;function d(y){return y===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(y),e.exit(l),f):y===null||y===32||y===41||ro(y)?n(y):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),g(y))}function f(y){return y===62?(e.enter(l),e.consume(y),e.exit(l),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(o),f(y)):y===null||y===60||he(y)?n(y):(e.consume(y),y===92?p:m)}function p(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function g(y){return!h&&(y===null||y===41||Fe(y))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(y)):h<c&&y===40?(e.consume(y),h++,g):y===41?(e.consume(y),h--,g):y===null||y===32||y===40||ro(y)?n(y):(e.consume(y),y===92?w:g)}function w(y){return y===40||y===41||y===92?(e.consume(y),g):g(y)}}function wv(e,t,n,r,i,l){const a=this;let o=0,u;return c;function c(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),e.enter(l),h}function h(m){return o>999||m===null||m===91||m===93&&!u||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(m):m===93?(e.exit(l),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):he(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||he(m)||o++>999?(e.exit("chunkString"),h(m)):(e.consume(m),u||(u=!je(m)),m===92?f:d)}function f(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function kv(e,t,n,r,i,l){let a;return o;function o(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),a=f===40?41:f,u):n(f)}function u(f){return f===a?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(l),c(f))}function c(f){return f===a?(e.exit(l),u(a)):f===null?n(f):he(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Ie(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===a||f===null||he(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?d:h)}function d(f){return f===a||f===92?(e.consume(f),h):h(f)}}function Vi(e,t){let n;return r;function r(i){return he(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):je(i)?Ie(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const VN={name:"definition",tokenize:qN},QN={partial:!0,tokenize:GN};function qN(e,t,n){const r=this;let i;return l;function l(m){return e.enter("definition"),a(m)}function a(m){return wv.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return i=vn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),u):n(m)}function u(m){return Fe(m)?Vi(e,c)(m):c(m)}function c(m){return jv(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function h(m){return e.attempt(QN,d,d)(m)}function d(m){return je(m)?Ie(e,f,"whitespace")(m):f(m)}function f(m){return m===null||he(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function GN(e,t,n){return r;function r(o){return Fe(o)?Vi(e,i)(o):n(o)}function i(o){return kv(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function l(o){return je(o)?Ie(e,a,"whitespace")(o):a(o)}function a(o){return o===null||he(o)?t(o):n(o)}}const KN={name:"hardBreakEscape",tokenize:YN};function YN(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return he(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const JN={name:"headingAtx",resolve:XN,tokenize:ZN};function XN(e,t){let n=e.length-2,r=3;if(e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r){const i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"};yn(e,r,n-r+1,[["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t]])}return e}function ZN(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),l(h)}function l(h){return e.enter("atxHeadingSequence"),a(h)}function a(h){return h===35&&r++<6?(e.consume(h),a):h===null||Fe(h)?(e.exit("atxHeadingSequence"),o(h)):n(h)}function o(h){return h===35?(e.enter("atxHeadingSequence"),u(h)):h===null||he(h)?(e.exit("atxHeading"),t(h)):je(h)?Ie(e,o,"whitespace")(h):(e.enter("atxHeadingText"),c(h))}function u(h){return h===35?(e.consume(h),u):(e.exit("atxHeadingSequence"),o(h))}function c(h){return h===null||h===35||Fe(h)?(e.exit("atxHeadingText"),o(h)):(e.consume(h),c)}}const bv=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],td=["pre","script","style","textarea"],eC={concrete:!0,name:"htmlFlow",resolveTo:nC,tokenize:rC},tC={partial:!0,tokenize:sC};function nC(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function rC(e,t,n){const r=this;let i,l,a,o,u;return c;function c(N){return h(N)}function h(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),d}function d(N){return N===33?(e.consume(N),f):N===47?(e.consume(N),l=!0,g):N===63?(e.consume(N),i=3,r.interrupt?t:S):vt(N)?(e.consume(N),a=String.fromCharCode(N),w):n(N)}function f(N){return N===45?(e.consume(N),i=2,m):N===91?(e.consume(N),i=5,o=0,p):vt(N)?(e.consume(N),i=4,r.interrupt?t:S):n(N)}function m(N){return N===45?(e.consume(N),r.interrupt?t:S):n(N)}function p(N){const F="CDATA[";return N===F.charCodeAt(o++)?(e.consume(N),o===F.length?r.interrupt?t:L:p):n(N)}function g(N){return vt(N)?(e.consume(N),a=String.fromCharCode(N),w):n(N)}function w(N){if(N===null||N===47||N===62||Fe(N)){const F=N===47,Z=a.toLowerCase();return!F&&!l&&td.includes(Z)?(i=1,r.interrupt?t(N):L(N)):bv.includes(a.toLowerCase())?(i=6,F?(e.consume(N),y):r.interrupt?t(N):L(N)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):l?x(N):v(N))}return N===45||jt(N)?(e.consume(N),a+=String.fromCharCode(N),w):n(N)}function y(N){return N===62?(e.consume(N),r.interrupt?t:L):n(N)}function x(N){return je(N)?(e.consume(N),x):C(N)}function v(N){return N===47?(e.consume(N),C):N===58||N===95||vt(N)?(e.consume(N),b):je(N)?(e.consume(N),v):C(N)}function b(N){return N===45||N===46||N===58||N===95||jt(N)?(e.consume(N),b):A(N)}function A(N){return N===61?(e.consume(N),k):je(N)?(e.consume(N),A):v(N)}function k(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),u=N,E):je(N)?(e.consume(N),k):T(N)}function E(N){return N===u?(e.consume(N),u=null,I):N===null||he(N)?n(N):(e.consume(N),E)}function T(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||Fe(N)?A(N):(e.consume(N),T)}function I(N){return N===47||N===62||je(N)?v(N):n(N)}function C(N){return N===62?(e.consume(N),R):n(N)}function R(N){return N===null||he(N)?L(N):je(N)?(e.consume(N),R):n(N)}function L(N){return N===45&&i===2?(e.consume(N),q):N===60&&i===1?(e.consume(N),J):N===62&&i===4?(e.consume(N),ae):N===63&&i===3?(e.consume(N),S):N===93&&i===5?(e.consume(N),X):he(N)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(tC,O,M)(N)):N===null||he(N)?(e.exit("htmlFlowData"),M(N)):(e.consume(N),L)}function M(N){return e.check(ed,U,O)(N)}function U(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),D}function D(N){return N===null||he(N)?M(N):(e.enter("htmlFlowData"),L(N))}function q(N){return N===45?(e.consume(N),S):L(N)}function J(N){return N===47?(e.consume(N),a="",B):L(N)}function B(N){if(N===62){const F=a.toLowerCase();return td.includes(F)?(e.consume(N),ae):L(N)}return vt(N)&&a.length<8?(e.consume(N),a+=String.fromCharCode(N),B):L(N)}function X(N){return N===93?(e.consume(N),S):L(N)}function S(N){return N===62?(e.consume(N),ae):N===45&&i===2?(e.consume(N),S):L(N)}function ae(N){return N===null||he(N)?(e.exit("htmlFlowData"),O(N)):(e.consume(N),ae)}function O(N){return e.exit("htmlFlow"),t(N)}}function sC(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Cl,t,n)}}const iC={name:"htmlText",tokenize:lC};function lC(e,t,n){const r=this;let i,l,a;return o;function o(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),u}function u(S){return S===33?(e.consume(S),c):S===47?(e.consume(S),A):S===63?(e.consume(S),v):vt(S)?(e.consume(S),T):n(S)}function c(S){return S===45?(e.consume(S),h):S===91?(e.consume(S),l=0,p):vt(S)?(e.consume(S),x):n(S)}function h(S){return S===45?(e.consume(S),m):n(S)}function d(S){return S===null?n(S):S===45?(e.consume(S),f):he(S)?(a=d,J(S)):(e.consume(S),d)}function f(S){return S===45?(e.consume(S),m):d(S)}function m(S){return S===62?q(S):S===45?f(S):d(S)}function p(S){const ae="CDATA[";return S===ae.charCodeAt(l++)?(e.consume(S),l===ae.length?g:p):n(S)}function g(S){return S===null?n(S):S===93?(e.consume(S),w):he(S)?(a=g,J(S)):(e.consume(S),g)}function w(S){return S===93?(e.consume(S),y):g(S)}function y(S){return S===62?q(S):S===93?(e.consume(S),y):g(S)}function x(S){return S===null||S===62?q(S):he(S)?(a=x,J(S)):(e.consume(S),x)}function v(S){return S===null?n(S):S===63?(e.consume(S),b):he(S)?(a=v,J(S)):(e.consume(S),v)}function b(S){return S===62?q(S):v(S)}function A(S){return vt(S)?(e.consume(S),k):n(S)}function k(S){return S===45||jt(S)?(e.consume(S),k):E(S)}function E(S){return he(S)?(a=E,J(S)):je(S)?(e.consume(S),E):q(S)}function T(S){return S===45||jt(S)?(e.consume(S),T):S===47||S===62||Fe(S)?I(S):n(S)}function I(S){return S===47?(e.consume(S),q):S===58||S===95||vt(S)?(e.consume(S),C):he(S)?(a=I,J(S)):je(S)?(e.consume(S),I):q(S)}function C(S){return S===45||S===46||S===58||S===95||jt(S)?(e.consume(S),C):R(S)}function R(S){return S===61?(e.consume(S),L):he(S)?(a=R,J(S)):je(S)?(e.consume(S),R):I(S)}function L(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),i=S,M):he(S)?(a=L,J(S)):je(S)?(e.consume(S),L):(e.consume(S),U)}function M(S){return S===i?(e.consume(S),i=void 0,D):S===null?n(S):he(S)?(a=M,J(S)):(e.consume(S),M)}function U(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||Fe(S)?I(S):(e.consume(S),U)}function D(S){return S===47||S===62||Fe(S)?I(S):n(S)}function q(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),t):n(S)}function J(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),B}function B(S){return je(S)?Ie(e,X,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):X(S)}function X(S){return e.enter("htmlTextData"),a(S)}}const _h={name:"labelEnd",resolveAll:cC,resolveTo:dC,tokenize:hC},aC={tokenize:fC},oC={tokenize:pC},uC={tokenize:mC};function cC(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&yn(e,0,e.length,n),e}function dC(e,t){let n=e.length,r=0,i,l,a;for(;n--;){const h=e[n][1];if(i){if(h.type==="link"||h.type==="labelLink"&&h._inactive)break;e[n][0]==="enter"&&h.type==="labelLink"&&(h._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(h.type==="labelImage"||h.type==="labelLink")&&!h._balanced&&(i=n,h.type!=="labelLink")){r=2;break}}else h.type==="labelEnd"&&(l=n)}const o={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[i][1].start},end:{...e[l][1].end}},c={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[l-2][1].start}};return a=[["enter",o,t],["enter",u,t]],a=nn(a,e.slice(i+1,i+r+3)),a=nn(a,[["enter",c,t]]),a=nn(a,Mo(t.parser.constructs.insideSpan.null,e.slice(i+r+4,l-3),t)),a=nn(a,[["exit",c,t],e[l-2],e[l-1],["exit",u,t]]),a=nn(a,e.slice(l+1)),a=nn(a,[["exit",o,t]]),yn(e,i,e.length,a),e}function hC(e,t,n){const r=this,i=r._labelStarts;let l,a;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();l=i[i.length-1]}return o;function o(f){return l?l._inactive?d(f):(a=r.parser.defined.includes(vn(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),u):n(f)}function u(f){return f===40?e.attempt(aC,h,a?h:d)(f):f===91?e.attempt(oC,h,a?c:d)(f):a?h(f):d(f)}function c(f){return e.attempt(uC,h,d)(f)}function h(f){return i.pop(),t(f)}function d(f){return l._balanced=!0,n(f)}}function fC(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return Fe(d)?Vi(e,l)(d):l(d)}function l(d){return d===41?h(d):jv(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return Fe(d)?Vi(e,u)(d):h(d)}function o(d){return n(d)}function u(d){return d===34||d===39||d===40?kv(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):h(d)}function c(d){return Fe(d)?Vi(e,h)(d):h(d)}function h(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function pC(e,t,n){const r=this;return i;function i(o){return wv.call(r,e,l,a,"reference","referenceMarker","referenceString")(o)}function l(o){return r.parser.defined.includes(vn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function mC(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const gC={name:"labelStartImage",resolveAll:_h.resolveAll,tokenize:xC};function xC(e,t,n){const r=this;let i;return l;function l(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),a}function a(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),i=e.exit("labelImage"),o):n(u)}function o(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(u))}}const yC={name:"labelStartLink",resolveAll:_h.resolveAll,tokenize:vC};function vC(e,t,n){const r=this;let i;return l;function l(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),i=e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(o))}}const Eu={name:"lineEnding",tokenize:jC};function jC(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ie(e,t,"linePrefix")}}const Na={name:"thematicBreak",tokenize:wC};function wC(e,t,n){let r=0,i;return l;function l(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,o(c)}function o(c){return c===i?(e.enter("thematicBreakSequence"),u(c)):r>=3&&(c===null||he(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),je(c)?Ie(e,o,"whitespace")(c):o(c))}}const It={continuation:{tokenize:NC},exit:EC,name:"list",tokenize:SC},kC={partial:!0,tokenize:TC},bC={partial:!0,tokenize:CC};function SC(e,t,n){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(m){const p=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Xc(m)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Na,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(m)}return n(m)}function u(m){return Xc(m)&&++a<10?(e.consume(m),u):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(Cl,r.interrupt?n:h,e.attempt(kC,f,d))}function h(m){return r.containerState.initialBlankLine=!0,l++,f(m)}function d(m){return je(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),f):n(m)}function f(m){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function NC(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Cl,i,l);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ie(e,t,"listItemIndent",r.containerState.size+1)(o)}function l(o){return r.containerState.furtherBlankLines||!je(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(bC,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ie(e,e.attempt(It,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function CC(e,t,n){const r=this;return Ie(e,i,"listItemIndent",r.containerState.size+1);function i(l){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(l):n(l)}}function EC(e){e.exit(this.containerState.type)}function TC(e,t,n){const r=this;return Ie(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const a=r.events[r.events.length-1];return!je(l)&&a&&a[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const nm={name:"setextUnderline",resolveTo:PC,tokenize:RC};function PC(e,t){const n=new so;let r=e.length,i,l,a;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){i=r;break}e[r][1].type==="paragraph"&&(l=r)}else e[r][1].type==="content"&&n.add(r,1,[]),!a&&e[r][1].type==="definition"&&(a=r);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",a?(n.add(l,0,[["enter",o,t]]),n.add(a+1,0,[["exit",e[i][1],t]]),e[i][1].end={...e[a][1].end}):e[i][1]=o,n.add(e.length,0,[["exit",o,t]]),n.consume(e),e}function RC(e,t,n){const r=this;let i;return l;function l(c){let h=r.events.length,d;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){d=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===i?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),je(c)?Ie(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||he(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const LC={tokenize:AC};function AC(e){const t=this,n=e.attempt(Cl,r,e.attempt(this.parser.constructs.flowInitial,i,Ie(e,e.attempt(this.parser.constructs.flow,i,e.attempt(FN,i)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const IC={resolveAll:Nv()},DC=Sv("string"),zC=Sv("text");function Sv(e){return{resolveAll:Nv(e==="text"?MC:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],l=n.attempt(i,a,o);return a;function a(h){return c(h)?l(h):o(h)}function o(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),u}function u(h){return c(h)?(n.exit("data"),l(h)):(n.consume(h),u)}function c(h){if(h===null)return!0;const d=i[h];let f=-1;if(d)for(;++f<d.length;){const m=d[f];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function Nv(e){return t;function t(n,r){let i=-1,l;for(;++i<=n.length;)l===void 0?n[i]&&n[i][1].type==="data"&&(l=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==l+2&&(n[l][1].end=n[i-1][1].end,n.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(n,r):n}}function MC(e,t){const n=new so;let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const i=e[r-1][1],l=t.sliceStream(i);let a=l.length,o=-1,u=0,c;for(;a--;){const h=l[a];if(typeof h=="string"){for(o=h.length;h.charCodeAt(o-1)===32;)u++,o--;if(o)break;o=-1}else if(h===-2)c=!0,u++;else if(h!==-1){a++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(u=0),u){const h={type:r===e.length||c||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:i.start._bufferIndex+o,_index:i.start._index+a,line:i.end.line,column:i.end.column-u,offset:i.end.offset-u},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):n.add(r,0,[["enter",h,t],["exit",h,t]])}r++}return n.consume(e),e}const $C={42:It,43:It,45:It,48:It,49:It,50:It,51:It,52:It,53:It,54:It,55:It,56:It,57:It,62:gv},_C={91:VN},OC={[-2]:Cu,[-1]:Cu,32:Cu},FC={35:JN,42:Na,45:[nm,Na],60:eC,61:nm,95:Na,96:tm,126:tm},UC={38:yv,92:xv},BC={[-5]:Eu,[-4]:Eu,[-3]:Eu,33:gC,38:yv,42:Zc,60:[wN,iC],91:yC,92:[KN,xv],93:_h,95:Zc,96:DN},HC={null:[Zc,IC]},WC={null:[42,95]},VC={null:[]},QC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:WC,contentInitial:_C,disable:VC,document:$C,flow:FC,flowInitial:OC,insideSpan:HC,string:UC,text:BC},Symbol.toStringTag,{value:"Module"}));function qC(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},l=[];let a=[],o=[];const u={attempt:E(A),check:E(k),consume:x,enter:v,exit:b,interrupt:E(k,{interrupt:!0})},c={code:null,containerState:{},defineSkip:g,events:[],now:p,parser:e,previous:null,sliceSerialize:f,sliceStream:m,write:d};let h=t.tokenize.call(c,u);return t.resolveAll&&l.push(t),c;function d(R){return a=nn(a,R),w(),a[a.length-1]!==null?[]:(T(t,0),c.events=Mo(l,c.events,c),c.events)}function f(R,L){return KC(m(R),L)}function m(R){return GC(a,R)}function p(){const{_bufferIndex:R,_index:L,line:M,column:U,offset:D}=r;return{_bufferIndex:R,_index:L,line:M,column:U,offset:D}}function g(R){i[R.line]=R.column,C()}function w(){for(;r._index<a.length;){const R=a[r._index];if(typeof R=="string"){const L=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===L&&r._bufferIndex<R.length;)y(R.charCodeAt(r._bufferIndex))}else y(R)}}function y(R){h=h(R)}function x(R){he(R)?(r.line++,r.column=1,r.offset+=R===-3?2:1,C()):R!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=R}function v(R,L){const M=L||{};return M.type=R,M.start=p(),c.events.push(["enter",M,c]),o.push(M),M}function b(R){const L=o.pop();return L.end=p(),c.events.push(["exit",L,c]),L}function A(R,L){T(R,L.from)}function k(R,L){L.restore()}function E(R,L){return M;function M(U,D,q){let J,B,X,S;return Array.isArray(U)?O(U):"tokenize"in U?O([U]):ae(U);function ae(ce){return Te;function Te(tt){const W=tt!==null&&ce[tt],ge=tt!==null&&ce.null,V=[...Array.isArray(W)?W:W?[W]:[],...Array.isArray(ge)?ge:ge?[ge]:[]];return O(V)(tt)}}function O(ce){return J=ce,B=0,ce.length===0?q:N(ce[B])}function N(ce){return Te;function Te(tt){return S=I(),X=ce,ce.partial||(c.currentConstruct=ce),ce.name&&c.parser.constructs.disable.null.includes(ce.name)?Z():ce.tokenize.call(L?Object.assign(Object.create(c),L):c,u,F,Z)(tt)}}function F(ce){return R(X,S),D}function Z(ce){return S.restore(),++B<J.length?N(J[B]):q}}}function T(R,L){R.resolveAll&&!l.includes(R)&&l.push(R),R.resolve&&yn(c.events,L,c.events.length-L,R.resolve(c.events.slice(L),c)),R.resolveTo&&(c.events=R.resolveTo(c.events,c))}function I(){const R=p(),L=c.previous,M=c.currentConstruct,U=c.events.length,D=Array.from(o);return{from:U,restore:q};function q(){r=R,c.previous=L,c.currentConstruct=M,c.events.length=U,o=D,C()}}function C(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function GC(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,l=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,l)];else{if(a=e.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}l>0&&a.push(e[i].slice(0,l))}return a}function KC(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const l=e[n];let a;if(typeof l=="string")a=l;else switch(l){case-5:{a="\r";break}case-4:{a=`
360
+ `,Gc=[{id:"planner",label:"Planner",agent:{name:"Planner",description:"Asks the open questions, takes the answers and writes the solution",instructions:Bb,model:"sonnet",permissions:Gy,review:"human"}},{id:"coding",label:"Coding",agent:{name:"Coding",description:"Implements the approved solution; never writes tests",instructions:Hb,model:"opus",permissions:bu,review:"auto"}},{id:"unit-test",label:"Unit Test",agent:{name:"Unit Test",description:"Tests the diff with 100% line and branch coverage and runs the suite",instructions:Wb,model:"sonnet",permissions:bu,review:"auto"}},{id:"code-review",label:"Code Review",agent:{name:"Code Review",description:"Solution-architect review: CRITICAL/REQUIRED go back to Coding, OPTIONAL noted for later",instructions:Vb,model:"sonnet",permissions:bu,review:"auto"}}];function Qb(e){const t=Gc.find(r=>r.id===e);if(!t)throw new Error(`Unknown agent template: ${e}`);const n=t.agent.permissions;return{...t.agent,skills:[],claudeMdSections:[],permissions:{...n,deniedCommands:[...n.deniedCommands],protectedPaths:[...n.protectedPaths]}}}function yt({status:e,children:t}){return e?s.jsx("span",{className:`badge ${e}`,children:t??e}):s.jsx("span",{className:"badge",children:"—"})}function An({status:e}){return s.jsx(yt,{status:e,children:e==="passed"?"done":e==="waiting"?"waiting for review":void 0})}function ri({status:e,children:t,title:n}){return e?s.jsxs("span",{className:`pill ${e}`,title:n,children:[s.jsx("i",{}),t??e]}):s.jsx("span",{className:"pill",children:"—"})}function Le({error:e}){return e?s.jsx("div",{className:"error-box",role:"alert",children:e}):null}function un({value:e,onChange:t,items:n}){return s.jsx("div",{className:"tabs",role:"tablist",children:n.map(r=>s.jsx("button",{role:"tab","aria-selected":e===r.id,className:`tab ${e===r.id?"active":""}`,onClick:()=>t(r.id),children:r.label},r.id))})}const Ky={explorer:zy,generator:Lo,validator:bh,healer:My,runner:gb,specwriter:hl,contextwriter:Sh,custom:hl};function Ft({agent:e,size:t=36}){const n=Ky[e];return s.jsx("span",{className:`agent-icon ${e}`,style:{width:t,height:t,borderRadius:t/3},title:Ne[e].label,children:s.jsx(n,{size:Math.round(t*.5)})})}function qb({agents:e}){return s.jsx("span",{className:"row",style:{gap:0},children:e.map(t=>{const n=Ky[t.agent];return s.jsx("span",{className:`agent-chip agent-icon ${t.agent} ${t.status}`,title:`${Ne[t.agent].label}: ${t.status}`,children:s.jsx(n,{size:12})},t.id)})})}function Rt(e){if(!e)return"—";const t=new Date(e),n=(Date.now()-t.getTime())/1e3;return n<60?"just now":n<3600?`${Math.floor(n/60)} min ago`:n<86400?`${Math.floor(n/3600)} h ago`:t.toLocaleString("en-US",{hour12:!1})}function br(e,t){if(!e)return"—";const n=(t?Date.parse(t):Date.now())-Date.parse(e);if(n<1e3)return`${Math.max(n,0)} ms`;const r=Math.round(n/1e3);return r<60?`${r}s`:`${Math.floor(r/60)}m ${r%60}s`}const Sr={explore:"Explore",generate:"Generate",heal:"Heal",spec:"Write spec",testrun:"Test run",context:"Project context",custom:"Custom agent",pipeline:"Pipeline"};function Yy(e){var t;return e.label??((t=Ne[e.agent])==null?void 0:t.label)??e.agent}function sn(e){return e==null?"—":e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(e<1e4?1:0)}k`:`${(e/1e6).toFixed(2)}M`}function Kt(e){return e==null?"—":e>0&&e<.01?"<$0.01":`$${e.toFixed(2)}`}function Gb({onClose:e,onNewSpec:t}){const n=ut(),{specs:r}=cn(),i=$e(()=>V.jobs()),[l,a]=j.useState(""),[o,u]=j.useState(0),c=m=>{e(),n(m)},h=j.useMemo(()=>{const m=[{group:"Actions",key:"new",label:"Create new spec",text:"new spec create",icon:s.jsx(qt,{size:16}),run:t},{group:"Actions",key:"runall",label:"Run all tests",text:"run all tests",icon:s.jsx(ft,{size:16}),run:()=>void V.createJob({type:"testrun",repeatEach:1}).then(g=>c(`/runs/${g.id}`))},...r.map(g=>({group:"Specs",key:`s-${g.file}`,label:s.jsxs(s.Fragment,{children:[g.file," ",s.jsx("span",{className:"muted small",children:g.parsed.title})]}),text:`${g.file} ${g.parsed.title}`,icon:s.jsx(qn,{size:16}),run:()=>c(`/specs/${g.file}`)})),...r.flatMap(g=>g.parsed.tcs.map(w=>({group:"Test case",key:`t-${g.file}-${w.id}`,label:s.jsxs(s.Fragment,{children:[s.jsx("code",{children:w.id})," ",w.title]}),text:`${w.id} ${w.title} ${g.file}`,icon:s.jsx(qn,{size:16}),run:()=>c(`/specs/${g.file}`)}))),...(i.data??[]).slice(0,20).map(g=>({group:"Jobs",key:`j-${g.id}`,label:s.jsxs(s.Fragment,{children:["#",g.id," ",Sr[g.type]," · ",g.target," ",s.jsx(An,{status:g.status})]}),text:`#${g.id} ${g.type} ${g.target} ${g.status}`,icon:s.jsx(ft,{size:16}),run:()=>c(`/runs/${g.id}`)}))],p=l.trim().toLowerCase();return p?m.filter(g=>g.text.toLowerCase().includes(p)):m},[l,r,i.data]);j.useEffect(()=>u(0),[l]);const d=m=>{var p;m.key==="ArrowDown"?(m.preventDefault(),u(g=>Math.min(g+1,h.length-1))):m.key==="ArrowUp"?(m.preventDefault(),u(g=>Math.max(g-1,0))):m.key==="Enter"&&((p=h[o])==null||p.run())};let f="";return s.jsx("div",{className:"overlay",onClick:e,children:s.jsxs("div",{className:"palette",onClick:m=>m.stopPropagation(),role:"dialog","aria-label":"Command palette",children:[s.jsx("input",{autoFocus:!0,placeholder:"Search specs, test cases, jobs, actions…",value:l,onChange:m=>a(m.target.value),onKeyDown:d}),s.jsxs("ul",{role:"listbox",children:[h.map((m,p)=>{const g=m.group!==f;return f=m.group,s.jsxs("div",{children:[g&&s.jsx("li",{className:"group",children:m.group}),s.jsxs("li",{role:"option","aria-selected":p===o,className:p===o?"active":"",onMouseEnter:()=>u(p),onClick:m.run,children:[m.icon,s.jsx("span",{children:m.label})]})]},m.key)}),h.length===0&&s.jsx("li",{className:"group",children:"No results"})]})]})})}const Jy=j.createContext(async()=>!1),In=()=>j.useContext(Jy);function Kb({children:e}){const[t,n]=j.useState([]),r=j.useRef(1),i=j.useCallback(u=>{const c=r.current++;return new Promise(h=>n(d=>[...d,{...u,id:c,resolve:h}]))},[]),l=t[0],a=j.useCallback(u=>{n(c=>{var h;return(h=c[0])==null||h.resolve(u),c.slice(1)})},[]),o=j.useMemo(()=>i,[i]);return s.jsxs(Jy.Provider,{value:o,children:[e,l&&Pr.createPortal(s.jsx(Yb,{opts:l,onClose:a},l.id),document.body)]})}function Yb({opts:e,onClose:t}){const n=j.useRef(null),r=j.useRef(null),i=j.useRef(null);return j.useEffect(()=>{var a;(a=(e.danger?r:i).current)==null||a.focus();const l=o=>{var u,c;if(o.key==="Escape"&&(o.stopPropagation(),t(!1)),o.key==="Tab"){const h=[...((u=n.current)==null?void 0:u.querySelectorAll("button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), a[href]"))??[]],d=h.indexOf(document.activeElement);o.preventDefault(),(c=h[(d+(o.shiftKey?-1:1)+h.length)%h.length])==null||c.focus()}};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[e.danger,t]),s.jsx("div",{className:"overlay confirm-overlay",onClick:()=>t(!1),children:s.jsx("div",{ref:n,className:"modal confirm-modal",role:"alertdialog","aria-modal":"true","aria-labelledby":"confirm-title","aria-describedby":"confirm-msg",onClick:l=>l.stopPropagation(),children:s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"confirm-head",children:[e.danger&&s.jsx("span",{className:"confirm-icon","aria-hidden":"true",children:s.jsx(Ar,{size:18})}),s.jsxs("div",{children:[s.jsx("h3",{id:"confirm-title",children:e.title}),e.message&&s.jsx("div",{id:"confirm-msg",className:"confirm-msg",children:e.message})]})]}),s.jsxs("div",{className:"confirm-actions",children:[s.jsx("button",{ref:r,type:"button",className:"btn ghost",onClick:()=>t(!1),children:e.cancelLabel??"Cancel"}),s.jsx("button",{ref:i,type:"button",className:`btn ${e.danger?"btn-danger-solid":""}`,onClick:()=>t(!0),children:e.confirmLabel??(e.danger?"Delete":"OK")})]})]})})})}function Rh(e,t){const n=In(),r=j.useRef(!1),i=j.useRef(t);i.current=t,j.useEffect(()=>{e.state!=="blocked"||r.current||(r.current=!0,n(i.current).then(l=>{r.current=!1,l?e.proceed():e.reset()}))},[e,n])}const Xy=j.createContext(e=>e),Jb=()=>j.useContext(Xy);function Xb({children:e}){const[t,n]=j.useState(0),r=j.useCallback(i=>(n(l=>l+1),i.finally(()=>n(l=>l-1))),[]);return s.jsxs(Xy.Provider,{value:r,children:[e,t>0&&Pr.createPortal(s.jsx("div",{className:"loading-bar",role:"progressbar","aria-label":"Loading"}),document.body)]})}const Si=()=>{},Zy=j.createContext({show:Si,info:Si,success:Si,warning:Si,error:Si}),Ir=()=>j.useContext(Zy);function Zb({children:e}){const[t,n]=j.useState([]),r=j.useRef(1),i=j.useCallback(o=>n(u=>u.filter(c=>c.id!==o)),[]),l=j.useCallback((o,u)=>{const c=(u==null?void 0:u.kind)??"info",h={id:r.current++,kind:c,message:o,duration:(u==null?void 0:u.duration)??(c==="error"?6e3:3500)};n(d=>[...d,h].slice(-4))},[]),a=j.useMemo(()=>({show:l,info:o=>l(o,{kind:"info"}),success:o=>l(o,{kind:"success"}),warning:o=>l(o,{kind:"warning"}),error:o=>l(o,{kind:"error"})}),[l]);return s.jsxs(Zy.Provider,{value:a,children:[e,Pr.createPortal(s.jsx("div",{className:"toasts",role:"region","aria-label":"Notifications",children:t.map(o=>s.jsx(eS,{item:o,onClose:()=>i(o.id)},o.id))}),document.body)]})}function eS({item:e,onClose:t}){const[n,r]=j.useState(!1);return j.useEffect(()=>{if(n)return;const i=setTimeout(t,e.duration);return()=>clearTimeout(i)},[n,e.duration,t]),s.jsxs("div",{className:`toast ${e.kind}`,role:e.kind==="error"?"alert":"status",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[s.jsx("span",{className:"toast-icon","aria-hidden":"true",children:e.kind==="success"?s.jsx(kh,{size:14}):e.kind==="error"?s.jsx(kr,{size:14}):e.kind==="warning"?"!":"i"}),s.jsx("span",{className:"toast-msg",children:e.message}),s.jsx("button",{className:"toast-close",onClick:t,"aria-label":"Dismiss notification",children:s.jsx(kr,{size:13})})]})}const tS=15*60*1e3,nS=2e3,rS=5*60*1e3;async function sS(){try{const e=await fetch("/api/update",{cache:"no-store"});return e.status===404?"other":e.ok?await e.json():null}catch{return null}}function iS(){const[e,t]=j.useState(null),[n,r]=j.useState(null),[i,l]=j.useState(null),a=j.useCallback(()=>{V.updateStatus().then(t).catch(()=>{})},[]);if(j.useEffect(()=>{a();const u=setInterval(a,tS);return window.addEventListener("focus",a),()=>{clearInterval(u),window.removeEventListener("focus",a)}},[a]),j.useEffect(()=>{if(!n)return;const u=Date.now();let c=!1;const h=setInterval(()=>{sS().then(d=>{if(!d)return void(c=!0);if(d==="other"||d.current===n)return window.location.reload();(c||Date.now()-u>rS)&&(r(null),t(d),d.error||l("The update did not finish. Run the command below in a terminal, then restart Agent Studio."))})},nS);return()=>clearInterval(h)},[n]),!(e!=null&&e.required)&&!n)return null;const o=async()=>{l(null);try{const u=await V.startUpdate();r(u.latest)}catch(u){l(u.message)}};return s.jsx("div",{className:"overlay update-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"update-title",children:s.jsx("div",{className:"modal",children:s.jsx("div",{className:"modal-body",children:n?s.jsxs(s.Fragment,{children:[s.jsxs("h3",{id:"update-title",children:["Updating to v",n," ..."]}),s.jsx("p",{className:"muted",children:"Installing and restarting Agent Studio. Progress is shown in the terminal where it runs; this page reloads by itself."})]}):s.jsxs(s.Fragment,{children:[s.jsx("h3",{id:"update-title",children:"Update required"}),s.jsxs("p",{children:["Agent Studio ",s.jsxs("b",{children:["v",e.latest]})," is available (you have v",e.current,"). Update to keep using the app."]}),(i||e.error)&&s.jsxs("div",{className:"error-box",role:"alert",children:[i||e.error,s.jsx("pre",{className:"update-cmd",children:e.command})]}),s.jsx("div",{className:"confirm-actions",children:s.jsxs("button",{className:"btn",onClick:()=>void o(),children:[s.jsx(Jn,{size:14})," Update and restart"]})})]})})})})}const ev=j.createContext({refreshClaude:()=>{},openNewSpec:()=>{},openPalette:()=>{},theme:"light",toggleTheme:()=>{},crumbSlot:null,extraSlot:null}),fs=()=>j.useContext(ev);function lS(){try{return localStorage.getItem("qa-studio.sidebar")==="collapsed"}catch{return!1}}const aS=.6,Su="Agent Studio (v0.1.10)";function oS(e,t){j.useLayoutEffect(()=>{const n=e.current,r=t.current;if(!n||!r)return;const i=()=>{r.style.zoom="";const o=getComputedStyle(n),u=n.clientHeight-parseFloat(o.paddingTop)-parseFloat(o.paddingBottom),c=r.scrollHeight,h=c>u&&u>0?Math.max(aS,u/c):1;r.style.zoom=h<1?h.toFixed(3):""};i();const l=new ResizeObserver(i);l.observe(n);const a=new MutationObserver(i);return a.observe(r,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),a.disconnect()}},[e,t])}function uS({collapsed:e,mobileOpen:t,onCloseMobile:n}){var y;const r=j.useRef(null),i=j.useRef(null);oS(r,i);const{specs:l,mapping:a}=cn(),{openPalette:o}=fs(),u=Yn(),c=$e(()=>V.jobs(),[u.pathname]),{reload:h}=c,d=(c.data??[]).some(x=>x.status==="queued"||x.status==="running"||x.status==="waiting");j.useEffect(()=>{if(!d)return;const x=setInterval(h,5e3);return()=>clearInterval(x)},[d,h]);const f=(c.data??[]).filter(x=>x.status==="running"||x.status==="queued").length,m=(c.data??[]).filter(x=>x.status==="waiting").length;j.useEffect(()=>(document.title=m?`● ${Su}`:Su,()=>{document.title=Su}),[m]);const p=a.filter(x=>x.status!=="orphan"&&x.testFile).length,g=a.filter(x=>x.status!=="orphan").length,w=(x,v,b,A,k,E)=>s.jsxs(Z0,{to:x,end:k,className:({isActive:T})=>`side-link ${T&&!(E&&u.pathname.startsWith(E))?"active":""}`,title:e?b:void 0,children:[v,s.jsx("span",{className:"side-label",children:b}),A!==void 0&&s.jsx("span",{className:"count",children:A})]});return s.jsx("aside",{ref:r,id:"app-sidebar",className:`sidebar ${e?"collapsed":""} ${t?"mobile-open":""}`,"aria-label":"Main menu",children:s.jsxs("div",{ref:i,className:"side-inner",children:[s.jsxs("div",{className:"side-head",children:[s.jsx("span",{className:"logo",children:s.jsx(bh,{size:18})}),s.jsx("h2",{className:"side-label",children:"Agent Studio"}),s.jsx("button",{className:"side-close",onClick:n,"aria-label":"Close menu",children:s.jsx(kr,{size:18})})]}),s.jsxs("button",{className:"side-search",onClick:o,"aria-label":"Search (Ctrl+K)",children:[s.jsx(Ro,{size:16}),s.jsx("span",{className:"side-label",children:"Search"}),s.jsx("span",{className:"kbd side-label",children:"⌘K"})]}),s.jsx("div",{className:"side-group side-label",children:"Overview"}),s.jsxs("nav",{className:"side-nav","aria-label":"Overview",children:[w("/",s.jsx(hb,{size:17}),"Overview",void 0,!0),w("/chat",s.jsx(Ch,{size:17}),"Claude chat")]}),s.jsx("div",{className:"side-group side-label",children:"Specification"}),s.jsxs("nav",{className:"side-nav","aria-label":"Specification",children:[w("/specs",s.jsx(qn,{size:17}),"Specification",l.length,!1,"/specs/from-requirement"),w("/specs/from-requirement",s.jsx(hl,{size:17}),"Generator")]}),s.jsx("div",{className:"side-group side-label",children:"Testing"}),s.jsxs("nav",{className:"side-nav","aria-label":"Testing",children:[w("/mapping",s.jsx(wh,{size:17}),"Test cases",g?`${p}/${g}`:0),w("/test-runs",s.jsx(vb,{size:17}),"Test runs"),w("/runs",s.jsx(ft,{size:17}),"Recent runs",m?`${m} waiting`:f?`${f} running`:((y=c.data)==null?void 0:y.length)??0)]}),s.jsx("div",{className:"side-group side-label",children:"Settings"}),s.jsxs("nav",{className:"side-nav","aria-label":"Settings",children:[w("/agents",s.jsx(Fy,{size:17}),"Agents"),w("/usage",s.jsx(Uy,{size:17}),"Claude usage"),w("/project",s.jsx(Sh,{size:17}),"Project"),w("/settings",s.jsx(xb,{size:17}),"Settings")]})]})})}function cS({setCrumbSlot:e,setExtraSlot:t,menuOpen:n,onMenu:r}){const{theme:i,toggleTheme:l,openPalette:a}=fs();return s.jsxs("header",{className:"topbar",children:[s.jsx("button",{className:"menu-btn",onClick:r,"aria-label":"Open menu","aria-expanded":n,"aria-controls":"app-sidebar",children:s.jsx(mb,{size:20})}),s.jsx("div",{className:"topbar-crumbs",ref:e}),s.jsx("div",{className:"topbar-spacer"}),s.jsx("div",{className:"topbar-extra",ref:t}),s.jsxs("button",{className:"top-search",onClick:a,"aria-label":"Search specs, TC-ID (Ctrl+K)",children:[s.jsx(Ro,{size:15}),s.jsx("span",{children:"Search specs, TC-ID…"})]}),s.jsx("button",{className:"theme-btn",onClick:l,title:"Toggle light/dark theme","aria-label":"Toggle light/dark theme",children:i==="dark"?s.jsx(_y,{size:17}):s.jsx($y,{size:17})})]})}const dS=/^[a-z0-9][a-z0-9_-]*$/;function hS({initial:e,onClose:t}){const n=ut(),{refresh:r}=cn(),[i,l]=j.useState((e==null?void 0:e.name)??""),[a,o]=j.useState(null),u=async c=>{c.preventDefault();const h=i.trim().replace(/\.md$/,"");if(!dS.test(h))return o('Name may only contain lowercase letters, digits, "-" or "_", and must start with a letter or digit.');try{await V.createSpec(`${h}.md`,(e==null?void 0:e.content)??lb),r(),t(),n(`/specs/${h}.md`)}catch(d){o(d.message)}};return s.jsx("div",{className:"overlay",onClick:t,children:s.jsx("form",{className:"modal",onClick:c=>c.stopPropagation(),onSubmit:u,children:s.jsxs("div",{className:"modal-body",children:[s.jsx("h3",{style:{margin:0},children:e!=null&&e.content?"Import spec":"New spec"}),s.jsxs("div",{className:"row",children:[s.jsx("input",{className:"input grow",autoFocus:!0,placeholder:"spec-name",value:i,onChange:c=>l(c.target.value),"aria-label":"Spec name"}),s.jsx("span",{className:"muted",children:".md"})]}),s.jsx(Le,{error:a}),s.jsxs("div",{className:"row",style:{justifyContent:"flex-end"},children:[s.jsx("button",{type:"button",className:"btn ghost",onClick:t,children:"Cancel"}),s.jsx("button",{type:"submit",className:"btn",children:e!=null&&e.content?"Import":"Create spec"})]})]})})})}function fS(e){const[t,n]=j.useState(!1);return j.useEffect(()=>{const r=()=>n(!0);return window.addEventListener(Hc,r),()=>window.removeEventListener(Hc,r)},[]),j.useEffect(()=>{if(!t)return;let r=!1;const i=setInterval(()=>{rb().then(l=>{l&&!r&&(n(!1),e())})},3e3);return()=>{r=!0,clearInterval(i)}},[t,e]),t}function pS(){var k;const e=ob(),[t,n]=cb(),[r,i]=j.useState(!1),[l,a]=j.useState(null),[o,u]=j.useState(lS),[c,h]=j.useState(!1),{pathname:d}=Yn();j.useEffect(()=>h(!1),[d]);const[f,m]=j.useState(null),[p,g]=j.useState(null),[w,y]=j.useState(null),x=j.useCallback(()=>{V.claudeStatus().then(y).catch(()=>{})},[]),{refresh:v}=e,b=fS(j.useCallback(()=>{v(),x()},[v,x]));j.useEffect(()=>{x();const E=setInterval(x,5*6e4);return()=>clearInterval(E)},[x]),j.useEffect(()=>{try{localStorage.setItem("qa-studio.sidebar",o?"collapsed":"open")}catch{}},[o]),j.useEffect(()=>{const E=T=>{(T.ctrlKey||T.metaKey)&&T.key.toLowerCase()==="k"&&(T.preventDefault(),i(I=>!I)),T.key==="Escape"&&(i(!1),a(null),h(!1))};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[]);const A=j.useMemo(()=>({openNewSpec:E=>a(E??{}),openPalette:()=>i(!0),theme:t,toggleTheme:n,crumbSlot:f,extraSlot:p,refreshClaude:x}),[t,n,f,p,x]);return s.jsx(Dy.Provider,{value:e,children:s.jsx(ev.Provider,{value:A,children:s.jsx(Zb,{children:s.jsx(Xb,{children:s.jsxs(Kb,{children:[s.jsxs("div",{className:`shell ${o?"side-collapsed":""}`,children:[s.jsx(uS,{collapsed:o,mobileOpen:c,onCloseMobile:()=>h(!1)}),c&&s.jsx("div",{className:"side-backdrop",onClick:()=>h(!1),"aria-hidden":"true"}),s.jsx("button",{className:"side-toggle-dot",onClick:()=>u(E=>!E),"aria-label":o?"Expand menu":"Collapse menu",title:o?"Expand menu":"Collapse menu",children:s.jsx("span",{style:{display:"inline-flex",transform:o?void 0:"rotate(180deg)"},children:s.jsx(ni,{size:10})})}),s.jsxs("div",{className:"main",children:[s.jsx(cS,{setCrumbSlot:m,setExtraSlot:g,menuOpen:c,onMenu:()=>h(!0)}),b&&s.jsxs("div",{className:"claude-banner",role:"alert",children:[s.jsx("b",{children:"Agent Studio server is not running."})," Start it with ",s.jsx("code",{children:"npm run studio:start"})," in the repo folder; this page reconnects by itself."]}),!b&&(w==null?void 0:w.state)==="not-ready"&&s.jsxs("div",{className:"claude-banner",role:"alert",children:[s.jsx("b",{children:"Claude Code is not ready:"})," ",w.binary.ok?w.version.ok?(k=w.test)==null?void 0:k.message:w.version.detail:w.binary.detail,". Built-in agents (explore, generate, heal, spec generator, project context) cannot run. ",s.jsx(ye,{to:"/settings#claude",children:"Fix it in Settings"})]}),s.jsx("div",{className:"content",children:s.jsx(L0,{})})]})]}),r&&s.jsx(Gb,{onClose:()=>i(!1),onNewSpec:()=>(i(!1),a({}))}),l&&s.jsx(hS,{initial:l,onClose:()=>a(null)}),s.jsx(iS,{})]})})})})})}function ot({items:e}){const{crumbSlot:t}=fs();return t?Pr.createPortal(s.jsx("nav",{className:"crumbs","aria-label":"Breadcrumb",children:e.map((n,r)=>s.jsxs("span",{className:"crumb",children:[r>0&&s.jsx("span",{className:"sep",children:"/"}),n.to?s.jsx(ye,{to:n.to,children:n.label}):s.jsx("span",{className:"current",children:n.label}),n.count!==void 0&&s.jsx("span",{className:"pill-count",children:n.count})]},r))}),t):null}function mS({children:e}){const{extraSlot:t}=fs();return t?Pr.createPortal(e,t):null}function gS(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const xS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vS={};function Bp(e,t){return(vS.jsx?yS:xS).test(e)}const jS=/[ \t\n\f\r]/g;function wS(e){return typeof e=="object"?e.type==="text"?Hp(e.value):!1:Hp(e)}function Hp(e){return e.replace(jS,"")===""}class Sl{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Sl.prototype.normal={};Sl.prototype.property={};Sl.prototype.space=void 0;function tv(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Sl(n,r,t)}function Kc(e){return e.toLowerCase()}class Ut{constructor(t,n){this.attribute=n,this.property=t}}Ut.prototype.attribute="";Ut.prototype.booleanish=!1;Ut.prototype.boolean=!1;Ut.prototype.commaOrSpaceSeparated=!1;Ut.prototype.commaSeparated=!1;Ut.prototype.defined=!1;Ut.prototype.mustUseProperty=!1;Ut.prototype.number=!1;Ut.prototype.overloadedBoolean=!1;Ut.prototype.property="";Ut.prototype.spaceSeparated=!1;Ut.prototype.space=void 0;let kS=0;const me=ps(),rt=ps(),Yc=ps(),Y=ps(),Oe=ps(),es=ps(),Ht=ps();function ps(){return 2**++kS}const Jc=Object.freeze(Object.defineProperty({__proto__:null,boolean:me,booleanish:rt,commaOrSpaceSeparated:Ht,commaSeparated:es,number:Y,overloadedBoolean:Yc,spaceSeparated:Oe},Symbol.toStringTag,{value:"Module"})),Nu=Object.keys(Jc);class Lh extends Ut{constructor(t,n,r,i){let l=-1;if(super(t,n),Wp(this,"space",i),typeof r=="number")for(;++l<Nu.length;){const a=Nu[l];Wp(this,Nu[l],(r&Jc[a])===Jc[a])}}}Lh.prototype.defined=!0;function Wp(e,t,n){n&&(e[t]=n)}function oi(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const l=new Lh(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[Kc(r)]=r,n[Kc(l.attribute)]=r}return new Sl(t,n,e.space)}const nv=oi({properties:{ariaActiveDescendant:null,ariaAtomic:rt,ariaAutoComplete:null,ariaBusy:rt,ariaChecked:rt,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:Oe,ariaCurrent:null,ariaDescribedBy:Oe,ariaDetails:null,ariaDisabled:rt,ariaDropEffect:Oe,ariaErrorMessage:null,ariaExpanded:rt,ariaFlowTo:Oe,ariaGrabbed:rt,ariaHasPopup:null,ariaHidden:rt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Oe,ariaLevel:Y,ariaLive:null,ariaModal:rt,ariaMultiLine:rt,ariaMultiSelectable:rt,ariaOrientation:null,ariaOwns:Oe,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:rt,ariaReadOnly:rt,ariaRelevant:null,ariaRequired:rt,ariaRoleDescription:Oe,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:rt,ariaSetSize:Y,ariaSort:null,ariaValueMax:Y,ariaValueMin:Y,ariaValueNow:Y,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function rv(e,t){return t in e?e[t]:t}function sv(e,t){return rv(e,t.toLowerCase())}const bS=oi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:es,acceptCharset:Oe,accessKey:Oe,action:null,allow:null,allowFullScreen:me,allowPaymentRequest:me,allowUserMedia:me,alpha:me,alt:null,as:null,async:me,autoCapitalize:null,autoComplete:Oe,autoFocus:me,autoPlay:me,blocking:Oe,capture:null,charSet:null,checked:me,cite:null,className:Oe,closedBy:null,colorSpace:null,cols:Y,colSpan:Y,command:null,commandFor:null,content:null,contentEditable:rt,controls:me,controlsList:Oe,coords:Y|es,crossOrigin:null,data:null,dateTime:null,decoding:null,default:me,defer:me,dir:null,dirName:null,disabled:me,download:Yc,draggable:rt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:me,formTarget:null,headers:Oe,height:Y,hidden:Yc,high:Y,href:null,hrefLang:null,htmlFor:Oe,httpEquiv:Oe,id:null,imageSizes:null,imageSrcSet:null,inert:me,inputMode:null,integrity:null,is:null,isMap:me,itemId:null,itemProp:Oe,itemRef:Oe,itemScope:me,itemType:Oe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:me,low:Y,manifest:null,max:null,maxLength:Y,media:null,method:null,min:null,minLength:Y,multiple:me,muted:me,name:null,nonce:null,noModule:me,noValidate:me,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:me,optimum:Y,pattern:null,ping:Oe,placeholder:null,playsInline:me,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:me,referrerPolicy:null,rel:Oe,required:me,reversed:me,rows:Y,rowSpan:Y,sandbox:Oe,scope:null,scoped:me,seamless:me,selected:me,shadowRootClonable:me,shadowRootCustomElementRegistry:me,shadowRootDelegatesFocus:me,shadowRootMode:null,shadowRootSerializable:me,shape:null,size:Y,sizes:null,slot:null,span:Y,spellCheck:rt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Y,step:null,style:null,tabIndex:Y,target:null,title:null,translate:null,type:null,typeMustMatch:me,useMap:null,value:rt,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Oe,axis:null,background:null,bgColor:null,border:Y,borderColor:null,bottomMargin:Y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:me,declare:me,event:null,face:null,frame:null,frameBorder:null,hSpace:Y,leftMargin:Y,link:null,longDesc:null,lowSrc:null,marginHeight:Y,marginWidth:Y,noResize:me,noHref:me,noShade:me,noWrap:me,object:null,profile:null,prompt:null,rev:null,rightMargin:Y,rules:null,scheme:null,scrolling:rt,standby:null,summary:null,text:null,topMargin:Y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Y,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:me,disablePictureInPicture:me,disableRemotePlayback:me,exportParts:es,part:Oe,prefix:null,property:null,results:Y,security:null,unselectable:null},space:"html",transform:sv}),SS=oi({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ht,accentHeight:Y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Y,amplitude:Y,arabicForm:null,ascent:Y,attributeName:null,attributeType:null,azimuth:Y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Y,by:null,calcMode:null,capHeight:Y,className:Oe,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Y,diffuseConstant:Y,direction:null,display:null,dur:null,divisor:Y,dominantBaseline:null,download:me,dx:null,dy:null,edgeMode:null,editable:null,elevation:Y,enableBackground:null,end:null,event:null,exponent:Y,externalResourcesRequired:null,fill:null,fillOpacity:Y,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:es,g2:es,glyphName:es,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Y,horizOriginX:Y,horizOriginY:Y,id:null,ideographic:Y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Y,k:Y,k1:Y,k2:Y,k3:Y,k4:Y,kernelMatrix:Ht,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Y,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Y,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Y,overlineThickness:Y,paintOrder:null,panose1:null,path:null,pathLength:Y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Oe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ht,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ht,rev:Ht,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ht,requiredFeatures:Ht,requiredFonts:Ht,requiredFormats:Ht,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Y,specularExponent:Y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Y,strikethroughThickness:Y,string:null,stroke:null,strokeDashArray:Ht,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Y,strokeOpacity:Y,strokeWidth:null,style:null,surfaceScale:Y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ht,tabIndex:Y,tableValues:null,target:null,targetX:Y,targetY:Y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ht,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Y,underlineThickness:Y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Y,values:null,vAlphabetic:Y,vMathematical:Y,vectorEffect:null,vHanging:Y,vIdeographic:Y,version:null,vertAdvY:Y,vertOriginX:Y,vertOriginY:Y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:rv}),iv=oi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),lv=oi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:sv}),av=oi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),NS={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},CS=/[A-Z]/g,Vp=/-[a-z]/g,ES=/^data[-\w.:]+$/i;function TS(e,t){const n=Kc(t);let r=t,i=Ut;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ES.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(Vp,RS);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!Vp.test(l)){let a=l.replace(CS,PS);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Lh}return new i(r,t)}function PS(e){return"-"+e.toLowerCase()}function RS(e){return e.charAt(1).toUpperCase()}const LS=tv([nv,bS,iv,lv,av],"html"),Ah=tv([nv,SS,iv,lv,av],"svg");function AS(e){return e.join(" ").trim()}var Qp=/\/\*(?:[^*]|\*(?!\/))*\*\//g,IS=/\n/g,DS=/^\s*/,zS=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,MS=/^:\s*/,$S=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,_S=/^[;\s]*/,OS=`
361
+ `,qp="/",Gp="*",Ni="",FS="comment",US="declaration";function BS(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(p){var g=p.match(IS);g&&(n+=g.length);var w=p.lastIndexOf(OS);r=~w?p.length-w:r+p.length}function l(){var p={line:n,column:r};return function(g){return g.position=new a(p),c(),g}}function a(p){this.start=p,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(p){var g=new Error(t.source+":"+n+":"+r+": "+p);if(g.reason=p,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function u(p){var g=p.exec(e);if(g){var w=g[0];return i(w),e=e.slice(w.length),g}}function c(){u(DS)}function h(p){for(var g;g=d();)p.push(g);return p}function d(){var p=l();if(!(qp!=e.charAt(0)||Gp!=e.charAt(1))){for(var g=2;Ni!=e.charAt(g)&&(Gp!=e.charAt(g)||qp!=e.charAt(g+1));)++g;if(g+=2,Ni===e.charAt(g-1))return o("End of comment missing");var w=e.slice(2,g-2);return r+=2,i(w),e=e.slice(g),r+=2,p({type:FS,comment:w})}}function f(){var p=l(),g=u(zS);if(g){if(d(),!u(MS))return o("property missing ':'");var w=u($S),y=p({type:US,property:g[0].replace(Qp,Ni).trim(),value:w?w[0].replace(Qp,Ni).trim():Ni});return u(_S),y}}function m(){var p=[];h(p);for(var g;g=f();)p.push(g),h(p);return p}return c(),m()}function HS(e,t){let n=null;if(!e||typeof e!="string")return n;const r=BS(e),i=typeof t=="function";return r.forEach(l=>{if(l.type!=="declaration")return;const{property:a,value:o}=l;i?t(a,o,l):o&&(n=n??{},n[a]=o)}),n}const ov=uv("end"),Ih=uv("start");function uv(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function WS(e){const t=Ih(e),n=ov(e);if(t&&n)return{start:t,end:n}}function Wi(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Kp(e.position):"start"in e||"end"in e?Kp(e):"line"in e||"column"in e?Xc(e):""}function Xc(e){return Yp(e&&e.line)+":"+Yp(e&&e.column)}function Kp(e){return Xc(e&&e.start)+"-"+Xc(e&&e.end)}function Yp(e){return e&&typeof e=="number"?e:1}class zo extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",l={},a=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?i=t:!l.cause&&t&&(a=!0,i=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?l.ruleId=r:(l.source=r.slice(0,u),l.ruleId=r.slice(u+1))}if(!l.place&&l.ancestors){const u=l.ancestors[l.ancestors.length-1];u&&(l.place=u.position)}const o=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=Wi(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=a&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Object.defineProperties(zo.prototype,{file:{configurable:!0,enumerable:!0,value:"",writable:!0},name:{configurable:!0,enumerable:!0,value:"",writable:!0},reason:{configurable:!0,enumerable:!0,value:"",writable:!0},message:{configurable:!0,enumerable:!0,value:"",writable:!0},stack:{configurable:!0,enumerable:!0,value:"",writable:!0},column:{configurable:!0,enumerable:!0,writable:!0},line:{configurable:!0,enumerable:!0,writable:!0},ancestors:{configurable:!0,enumerable:!0,writable:!0},cause:{configurable:!0,enumerable:!0,writable:!0},fatal:{configurable:!0,enumerable:!0,writable:!0},place:{configurable:!0,enumerable:!0,writable:!0},ruleId:{configurable:!0,enumerable:!0,writable:!0},source:{configurable:!0,enumerable:!0,writable:!0}});const Dh={}.hasOwnProperty,VS=new Map,QS=/[A-Z]/g,qS=/-([a-z])/g,GS=new Set(["table","tbody","thead","tfoot","tr"]),KS=new Set(["td","th"]),cv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function YS(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=sN(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=rN(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ah:LS,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=dv(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function dv(e,t,n){if(t.type==="element")return JS(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return XS(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return eN(e,t,n);if(t.type==="mdxjsEsm")return ZS(e,t);if(t.type==="root")return tN(e,t,n);if(t.type==="text")return nN(e,t)}function JS(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ah,e.schema=i),e.ancestors.push(t);const l=fv(e,t.tagName,!1),a=iN(e,t);let o=Mh(e,t);return GS.has(t.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!wS(u):!0})),hv(e,a,l,t),zh(a,o),e.ancestors.pop(),e.schema=r,e.create(t,l,a,n)}function XS(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}pl(e,t.position)}function ZS(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);pl(e,t.position)}function eN(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ah,e.schema=i),e.ancestors.push(t);const l=t.name===null?e.Fragment:fv(e,t.name,!0),a=lN(e,t),o=Mh(e,t);return hv(e,a,l,t),zh(a,o),e.ancestors.pop(),e.schema=r,e.create(t,l,a,n)}function tN(e,t,n){const r={};return zh(r,Mh(e,t)),e.create(t,e.Fragment,r,n)}function nN(e,t){return t.value}function hv(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function zh(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function rN(e,t,n){return r;function r(i,l,a,o){const c=Array.isArray(a.children)?n:t;return o?c(l,a,o):c(l,a)}}function sN(e,t){return n;function n(r,i,l,a){const o=Array.isArray(l.children),u=Ih(r);return t(i,l,a,o,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function iN(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Dh.call(t.properties,i)){const l=aN(e,i,t.properties[i]);if(l){const[a,o]=l;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&KS.has(t.tagName)?r=o:n[a]=o}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function lN(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const a=l.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else pl(e,t.position);else{const{name:i}=r;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,l=e.evaluater.evaluateExpression(o.expression)}else pl(e,t.position);else l=r.value===null?!0:r.value;n[i]=l}return n}function Mh(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:VS;for(;++r<t.children.length;){const l=t.children[r];let a;if(e.passKeys){const u=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(u){const c=i.get(u)||0;a=u+"-"+c,i.set(u,c+1)}}const o=dv(e,l,a);o!==void 0&&n.push(o)}return n}function aN(e,t,n){if(n==null||typeof n=="number"&&Number.isNaN(n))return;const r=TS(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?gS(n):AS(n)),r.property==="style"?["style",typeof n=="object"?e.stylePropertyNameCase==="dom"?n:uN(n):oN(e,String(n))]:[e.elementAttributeNameCase==="react"&&r.space?NS[r.property]||r.property:r.attribute,n]}function oN(e,t){const n={};try{HS(t,function(r,i){if(r&&i){let l=r;l.slice(0,2)!=="--"&&(l=l.toLowerCase(),e.stylePropertyNameCase==="dom"&&(l.slice(0,4)==="-ms-"&&(l=l.slice(1)),l=l.replace(qS,hN))),n[l]=i}})}catch(r){if(e.ignoreInvalidStyle)return{};const i=r,l=new zo("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=cv+"#cannot-parse-style-attribute",l}return n}function fv(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let l=-1,a;for(;++l<i.length;){const o=Bp(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(l&&o.type==="Literal"),optional:!1}:o}r=a}else r=Bp(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Dh.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);pl(e)}function pl(e,t){const n=new zo("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=cv+"#cannot-handle-mdx-estrees-without-createevaluater",n}function uN(e){const t={};let n;for(n in e)Dh.call(e,n)&&(t[cN(n)]=e[n]);return t}function cN(e){if(e.slice(0,2)==="--")return e;let t=e.replace(QS,dN);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function dN(e){return"-"+e.toLowerCase()}function hN(e,t){return t.toUpperCase()}const Cu={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},fN={};function Mo(e,t){const n=fN,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return pv(e,r,i)}function pv(e,t,n){if(pN(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Jp(e.children,t,n)}return Array.isArray(e)?Jp(e,t,n):""}function Jp(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=pv(e[i],t,n);return r.join("")}function pN(e){return!!(e&&typeof e=="object")}const Xp=document.createElement("i");function $h(e){const t="&"+e+";";Xp.innerHTML=t;const n=Xp.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function vn(e,t,n,r){const i=e.length;let l=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);l<r.length;)a=r.slice(l,l+1e4),a.unshift(t,0),e.splice(...a),l+=1e4,t+=1e4}function nn(e,t){return e.length>0?(vn(e,e.length,0,t),e):t}const Zp={}.hasOwnProperty;function mv(e){const t={};let n=-1;for(;++n<e.length;)mN(t,e[n]);return t}function mN(e,t){let n;for(n in t){const i=(Zp.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let a;if(l)for(a in l){Zp.call(i,a)||(i[a]=[]);const o=l[a];gN(i[a],Array.isArray(o)?o:o?[o]:[])}}}function gN(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);vn(e,0,0,r)}function gv(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function jn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const vt=Dr(/[A-Za-z]/),jt=Dr(/[\dA-Za-z]/),xN=Dr(/[#-'*+\--9=?A-Z^-~]/);function ro(e){return e!==null&&(e<32||e===127)}const Zc=Dr(/\d/),yN=Dr(/[\dA-Fa-f]/),xv=Dr(/[!-/:-@[-`{-~]/);function he(e){return e!==null&&e<-2}function Fe(e){return e!==null&&(e<0||e===32)}function je(e){return e===-2||e===-1||e===32}const Nl=Dr(new RegExp("\\p{P}|\\p{S}","u")),os=Dr(/\s/);function Dr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ui(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const l=e.charCodeAt(n);let a="";if(l===37&&jt(e.charCodeAt(n+1))&&jt(e.charCodeAt(n+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(a=String.fromCharCode(l));else if(l>55295&&l<57344){const o=e.charCodeAt(n+1);l<56320&&o>56319&&o<57344?(a=String.fromCharCode(l,o),i=1):a="�"}else a=String.fromCharCode(l);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Ie(e,t,n,r){const i=r?r-1:1/0;let l=0;return a;function a(u){return je(u)?(e.enter(n),o(u)):t(u)}function o(u){return je(u)&&l++<i?(e.consume(u),o):(e.exit(n),t(u))}}function yv(e,t,n,r,i,l){let a=0;return o;function o(h){return je(h)?(e.enter(r),u(h)):c(h)}function u(h){return je(h)&&a<l?(e.consume(h),a++,u):(e.exit(r),c(h))}function c(h){return a>=i?t(h):n(h)}}const vN={tokenize:jN};function jN(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Ie(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),l(o)}function l(o){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return he(o)?(e.consume(o),e.exit("chunkText"),l):(e.consume(o),a)}}let so=class{constructor(){this.index=new Map,this.map=[]}add(t,n,r){em(this,t,n,r,!1)}addBefore(t,n,r){em(this,t,n,r,!0)}consume(t){if(this.map.sort(function(l,a){return l[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const l of i)t.push(l);i=r.pop()}this.map.length=0,this.index.clear()}};function em(e,t,n,r,i){if(n===0&&r.length===0)return;const l=e.index.get(t);if(l){l[1]+=n,i?(r.push(...l[2]),l[2]=r):l[2].push(...r);return}const a=[t,n,r];e.map.push(a),e.index.set(t,a)}const wN={tokenize:kN},tm={tokenize:bN};function kN(e){const t=this,n=[];let r=0,i,l,a;return o;function o(v){if(r<n.length){const b=n[r];return t.containerState=b[1],e.attempt(b[0].continuation,u,c)(v)}return c(v)}function u(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&x();const b=t.events.length;let A=b,k;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){k=t.events[A][1].end;break}y(r);let E=b;for(;E<t.events.length;)t.events[E][1].end={...k},E++;const T=new so;return T.add(A+1,0,t.events.slice(b)),T.add(b,E-b,[]),T.consume(t.events),c(v)}return o(v)}function c(v){if(r===n.length){if(!i)return f(v);if(i.currentConstruct&&i.currentConstruct.concrete)return p(v);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(tm,h,d)(v)}function h(v){return i&&x(),y(r),f(v)}function d(v){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,p(v)}function f(v){return t.containerState={},e.attempt(tm,m,p)(v)}function m(v){return r++,n.push([t.currentConstruct,t.containerState]),f(v)}function p(v){if(v===null){i&&x(),y(0),e.consume(v);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),g(v)}function g(v){if(v===null){w(e.exit("chunkFlow"),!0),y(0),e.consume(v);return}return he(v)?(e.consume(v),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(v),g)}function w(v,b){const A=t.sliceStream(v);if(b&&A.push(null),v.previous=l,l&&(l.next=v),l=v,i.defineSkip(v.start),i.write(A),t.parser.lazy[v.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<a&&(!i.events[k][1].end||i.events[k][1].end.offset>a))return;const E=t.events.length;let T=E,I,C;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(I){C=t.events[T][1].end;break}I=!0}for(y(r),k=E;k<t.events.length;)t.events[k][1].end={...C},k++;const R=new so;R.add(T+1,0,t.events.slice(E)),R.add(E,k-E,[]),R.consume(t.events)}}function y(v){let b=n.length;for(;b-- >v;){const A=n[b];t.containerState=A[1],A[0].exit.call(t,e)}n.length=v}function x(){i.write([null]),l=void 0,i=void 0,t.containerState._closeFlow=void 0}}function bN(e,t,n){return Ie(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Nr(e){if(e===null||Fe(e)||os(e))return 1;if(Nl(e))return 2}function $o(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const ed={name:"attention",resolveAll:SN,tokenize:NN};function SN(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;const l=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,a={...e[i][1].end},o={...e[n][1].start};nm(a,-l),nm(o,l);const u={type:l>1?"strongSequence":"emphasisSequence",start:a,end:{...e[i][1].end}},c={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:o},h={type:l>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},d={type:l>1?"strong":"emphasis",start:{...u.start},end:{...c.end}};e[i][1].end={...u.start},e[n][1].start={...c.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=nn(r,[["enter",e[i][1],t],["exit",e[i][1],t]])),r=nn(r,[["enter",d,t],["enter",u,t],["exit",u,t],["enter",h,t]]),r=nn(r,$o(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=nn(r,[["exit",h,t],["enter",c,t],["exit",c,t],["exit",d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=nn(r,[["enter",e[n][1],t],["exit",e[n][1],t]])),vn(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function NN(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Nr(r);let l;return a;function a(u){return l=u,e.enter("attentionSequence"),o(u)}function o(u){if(u===l)return e.consume(u),o;const c=e.exit("attentionSequence"),h=Nr(u),d=!h||h===2&&i||n.includes(u)&&u!==42&&u!==95,f=!i||i===2&&h||n.includes(r)&&r!==42&&r!==95;return c._open=!!(l===42?d:d&&(i||!f)),c._close=!!(l===42?f:f&&(h||!d)),t(u)}}function nm(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const CN={name:"autolink",tokenize:EN};function EN(e,t,n){let r=0;return i;function i(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(m){return vt(m)?(e.consume(m),a):m===64?n(m):c(m)}function a(m){return m===43||m===45||m===46||jt(m)?(r=1,o(m)):c(m)}function o(m){return m===58?(e.consume(m),r=0,u):(m===43||m===45||m===46||jt(m))&&r++<32?(e.consume(m),o):(r=0,c(m))}function u(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||ro(m)?n(m):(e.consume(m),u)}function c(m){return m===64?(e.consume(m),h):xN(m)?(e.consume(m),c):n(m)}function h(m){return jt(m)?d(m):n(m)}function d(m){return m===46?(e.consume(m),r=0,h):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):f(m)}function f(m){if((m===45||jt(m))&&r++<63){const p=m===45?f:d;return e.consume(m),p}return n(m)}}const Cl={partial:!0,tokenize:TN};function TN(e,t,n){return r;function r(l){return je(l)?Ie(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||he(l)?t(l):n(l)}}const vv={continuation:{tokenize:RN},exit:LN,name:"blockQuote",tokenize:PN};function PN(e,t,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),l}return n(a)}function l(a){return je(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function RN(e,t,n){const r=this;return i;function i(a){return je(a)?Ie(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):l(a)}function l(a){return e.attempt(vv,t,n)(a)}}function LN(e){e.exit("blockQuote")}const jv={name:"characterEscape",tokenize:AN};function AN(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return xv(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const wv={name:"characterReference",tokenize:IN};function IN(e,t,n){const r=this;let i=0,l,a;return o;function o(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),u}function u(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),l=31,a=jt,h(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,a=yN,h):(e.enter("characterReferenceValue"),l=7,a=Zc,h(d))}function h(d){if(d===59&&i){const f=e.exit("characterReferenceValue");return a===jt&&!$h(r.sliceSerialize(f))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(d)&&i++<l?(e.consume(d),h):n(d)}}const td={partial:!0,tokenize:DN};function DN(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l)}function l(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const rm={concrete:!0,name:"codeFenced",tokenize:zN};function zN(e,t,n){const r=this,i={partial:!0,tokenize:A};let l=0,a=0,o;return u;function u(k){return c(k)}function c(k){const E=r.events[r.events.length-1];return l=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,o=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(k)}function h(k){return k===o?(a++,e.consume(k),h):a<3?n(k):(e.exit("codeFencedFenceSequence"),je(k)?Ie(e,d,"whitespace")(k):d(k))}function d(k){return k===null||he(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(td,g,b)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(k))}function f(k){return k===null||he(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(k)):je(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ie(e,m,"whitespace")(k)):k===96&&k===o?n(k):(e.consume(k),f)}function m(k){return k===null||he(k)?d(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===null||he(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(k)):k===96&&k===o?n(k):(e.consume(k),p)}function g(k){return e.attempt(i,b,w)(k)}function w(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),y}function y(k){return l>0&&je(k)?Ie(e,x,"linePrefix",l+1)(k):x(k)}function x(k){return k===null||he(k)?e.check(td,g,b)(k):(e.enter("codeFlowValue"),v(k))}function v(k){return k===null||he(k)?(e.exit("codeFlowValue"),x(k)):(e.consume(k),v)}function b(k){return e.exit("codeFenced"),t(k)}function A(k,E,T){let I=0;return C;function C(D){return k.enter("lineEnding"),k.consume(D),k.exit("lineEnding"),R}function R(D){return k.enter("codeFencedFence"),je(D)?Ie(k,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):L(D)}function L(D){return D===o?(k.enter("codeFencedFenceSequence"),M(D)):T(D)}function M(D){return D===o?(I++,k.consume(D),M):I>=a?(k.exit("codeFencedFenceSequence"),je(D)?Ie(k,U,"whitespace")(D):U(D)):T(D)}function U(D){return D===null||he(D)?(k.exit("codeFencedFence"),E(D)):T(D)}}}const Eu={name:"codeIndented",tokenize:$N},MN={partial:!0,tokenize:_N};function $N(e,t,n){return r;function r(o){return e.enter("codeIndented"),yv(e,i,n,"linePrefix",4,4)(o)}function i(o){return o===null?a(o):he(o)?e.attempt(MN,i,a)(o):(e.enter("codeFlowValue"),l(o))}function l(o){return o===null||he(o)?(e.exit("codeFlowValue"),i(o)):(e.consume(o),l)}function a(o){return e.exit("codeIndented"),t(o)}}function _N(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):he(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):yv(e,t,l,"linePrefix",4,4)(a)}function l(a){return he(a)?i(a):n(a)}}const ON={name:"codeText",previous:UN,resolve:FN,tokenize:BN};function FN(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function UN(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function BN(e,t,n){let r=0,i,l;return a;function a(d){return e.enter("codeText"),e.enter("codeTextSequence"),o(d)}function o(d){return d===96?(e.consume(d),r++,o):(e.exit("codeTextSequence"),u(d))}function u(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),u):d===96?(l=e.enter("codeTextSequence"),i=0,h(d)):he(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||he(d)?(e.exit("codeTextData"),u(d)):(e.consume(d),c)}function h(d){return d===96?(e.consume(d),i++,h):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(l.type="codeTextData",c(d))}}class HN{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ci(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ci(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ci(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ci(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ci(this.left,n.reverse())}}}function Ci(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function kv(e){const t={};let n=-1,r,i,l,a,o,u,c;const h=new HN(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,l=0,l<u.length&&u[l][1].type==="lineEndingBlank"&&(l+=2),l<u.length&&u[l][1].type==="content"))for(;++l<u.length&&u[l][1].type!=="content";)u[l][1].type==="chunkText"&&(u[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,WN(h,n)),n=t[n],c=!0);else if(r[1]._container){for(l=n,i=void 0;l--;)if(a=h.get(l),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=l);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...h.get(i)[1].start},o=h.slice(i,n),o.unshift(r),h.splice(i,n-i+1,o))}}return vn(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!c}function WN(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const l=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,u=[],c={};let h,d,f=-1,m=n,p=0,g=0;const w=[g];for(;m;){for(;e.get(++i)[1]!==m;);l.push(i),m._tokenizer||(h=r.sliceStream(m),m.next||h.push(null),d&&a.defineSkip(m.start),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(h),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=n;++f<o.length;)o[f][0]==="exit"&&o[f-1][0]==="enter"&&o[f][1].type===o[f-1][1].type&&o[f][1].start.line!==o[f][1].end.line&&(g=f+1,w.push(g),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(a.events=[],m?(m._tokenizer=void 0,m.previous=void 0):w.pop(),f=w.length;f--;){const y=o.slice(w[f],w[f+1]),x=l.pop();u.push([x,x+y.length-1]),e.splice(x,2,y)}for(u.reverse(),f=-1;++f<u.length;)c[p+u[f][0]]=p+u[f][1],p+=u[f][1]-u[f][0]-1;return c}const VN={resolve:qN,tokenize:GN},QN={partial:!0,tokenize:KN};function qN(e){return kv(e),e}function GN(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?l(o):he(o)?e.check(QN,a,l)(o):(e.consume(o),i)}function l(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function a(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function KN(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ie(e,l,"linePrefix")}function l(a){if(a===null||he(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function bv(e,t,n,r,i,l,a,o,u){const c=u||Number.POSITIVE_INFINITY;let h=0;return d;function d(y){return y===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(y),e.exit(l),f):y===null||y===32||y===41||ro(y)?n(y):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),g(y))}function f(y){return y===62?(e.enter(l),e.consume(y),e.exit(l),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(o),f(y)):y===null||y===60||he(y)?n(y):(e.consume(y),y===92?p:m)}function p(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function g(y){return!h&&(y===null||y===41||Fe(y))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(y)):h<c&&y===40?(e.consume(y),h++,g):y===41?(e.consume(y),h--,g):y===null||y===32||y===40||ro(y)?n(y):(e.consume(y),y===92?w:g)}function w(y){return y===40||y===41||y===92?(e.consume(y),g):g(y)}}function Sv(e,t,n,r,i,l){const a=this;let o=0,u;return c;function c(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),e.enter(l),h}function h(m){return o>999||m===null||m===91||m===93&&!u||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(m):m===93?(e.exit(l),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):he(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||he(m)||o++>999?(e.exit("chunkString"),h(m)):(e.consume(m),u||(u=!je(m)),m===92?f:d)}function f(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function Nv(e,t,n,r,i,l){let a;return o;function o(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),a=f===40?41:f,u):n(f)}function u(f){return f===a?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(l),c(f))}function c(f){return f===a?(e.exit(l),u(a)):f===null?n(f):he(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Ie(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===a||f===null||he(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?d:h)}function d(f){return f===a||f===92?(e.consume(f),h):h(f)}}function Vi(e,t){let n;return r;function r(i){return he(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):je(i)?Ie(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const YN={name:"definition",tokenize:XN},JN={partial:!0,tokenize:ZN};function XN(e,t,n){const r=this;let i;return l;function l(m){return e.enter("definition"),a(m)}function a(m){return Sv.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return i=jn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),u):n(m)}function u(m){return Fe(m)?Vi(e,c)(m):c(m)}function c(m){return bv(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function h(m){return e.attempt(JN,d,d)(m)}function d(m){return je(m)?Ie(e,f,"whitespace")(m):f(m)}function f(m){return m===null||he(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function ZN(e,t,n){return r;function r(o){return Fe(o)?Vi(e,i)(o):n(o)}function i(o){return Nv(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function l(o){return je(o)?Ie(e,a,"whitespace")(o):a(o)}function a(o){return o===null||he(o)?t(o):n(o)}}const eC={name:"hardBreakEscape",tokenize:tC};function tC(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return he(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const nC={name:"headingAtx",resolve:rC,tokenize:sC};function rC(e,t){let n=e.length-2,r=3;if(e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r){const i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"};vn(e,r,n-r+1,[["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t]])}return e}function sC(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),l(h)}function l(h){return e.enter("atxHeadingSequence"),a(h)}function a(h){return h===35&&r++<6?(e.consume(h),a):h===null||Fe(h)?(e.exit("atxHeadingSequence"),o(h)):n(h)}function o(h){return h===35?(e.enter("atxHeadingSequence"),u(h)):h===null||he(h)?(e.exit("atxHeading"),t(h)):je(h)?Ie(e,o,"whitespace")(h):(e.enter("atxHeadingText"),c(h))}function u(h){return h===35?(e.consume(h),u):(e.exit("atxHeadingSequence"),o(h))}function c(h){return h===null||h===35||Fe(h)?(e.exit("atxHeadingText"),o(h)):(e.consume(h),c)}}const Cv=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],nd=["pre","script","style","textarea"],iC={concrete:!0,name:"htmlFlow",resolveTo:aC,tokenize:oC},lC={partial:!0,tokenize:uC};function aC(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function oC(e,t,n){const r=this;let i,l,a,o,u;return c;function c(N){return h(N)}function h(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),d}function d(N){return N===33?(e.consume(N),f):N===47?(e.consume(N),l=!0,g):N===63?(e.consume(N),i=3,r.interrupt?t:S):vt(N)?(e.consume(N),a=String.fromCharCode(N),w):n(N)}function f(N){return N===45?(e.consume(N),i=2,m):N===91?(e.consume(N),i=5,o=0,p):vt(N)?(e.consume(N),i=4,r.interrupt?t:S):n(N)}function m(N){return N===45?(e.consume(N),r.interrupt?t:S):n(N)}function p(N){const F="CDATA[";return N===F.charCodeAt(o++)?(e.consume(N),o===F.length?r.interrupt?t:L:p):n(N)}function g(N){return vt(N)?(e.consume(N),a=String.fromCharCode(N),w):n(N)}function w(N){if(N===null||N===47||N===62||Fe(N)){const F=N===47,Z=a.toLowerCase();return!F&&!l&&nd.includes(Z)?(i=1,r.interrupt?t(N):L(N)):Cv.includes(a.toLowerCase())?(i=6,F?(e.consume(N),y):r.interrupt?t(N):L(N)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):l?x(N):v(N))}return N===45||jt(N)?(e.consume(N),a+=String.fromCharCode(N),w):n(N)}function y(N){return N===62?(e.consume(N),r.interrupt?t:L):n(N)}function x(N){return je(N)?(e.consume(N),x):C(N)}function v(N){return N===47?(e.consume(N),C):N===58||N===95||vt(N)?(e.consume(N),b):je(N)?(e.consume(N),v):C(N)}function b(N){return N===45||N===46||N===58||N===95||jt(N)?(e.consume(N),b):A(N)}function A(N){return N===61?(e.consume(N),k):je(N)?(e.consume(N),A):v(N)}function k(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),u=N,E):je(N)?(e.consume(N),k):T(N)}function E(N){return N===u?(e.consume(N),u=null,I):N===null||he(N)?n(N):(e.consume(N),E)}function T(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||Fe(N)?A(N):(e.consume(N),T)}function I(N){return N===47||N===62||je(N)?v(N):n(N)}function C(N){return N===62?(e.consume(N),R):n(N)}function R(N){return N===null||he(N)?L(N):je(N)?(e.consume(N),R):n(N)}function L(N){return N===45&&i===2?(e.consume(N),q):N===60&&i===1?(e.consume(N),J):N===62&&i===4?(e.consume(N),ae):N===63&&i===3?(e.consume(N),S):N===93&&i===5?(e.consume(N),X):he(N)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(lC,O,M)(N)):N===null||he(N)?(e.exit("htmlFlowData"),M(N)):(e.consume(N),L)}function M(N){return e.check(td,U,O)(N)}function U(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),D}function D(N){return N===null||he(N)?M(N):(e.enter("htmlFlowData"),L(N))}function q(N){return N===45?(e.consume(N),S):L(N)}function J(N){return N===47?(e.consume(N),a="",B):L(N)}function B(N){if(N===62){const F=a.toLowerCase();return nd.includes(F)?(e.consume(N),ae):L(N)}return vt(N)&&a.length<8?(e.consume(N),a+=String.fromCharCode(N),B):L(N)}function X(N){return N===93?(e.consume(N),S):L(N)}function S(N){return N===62?(e.consume(N),ae):N===45&&i===2?(e.consume(N),S):L(N)}function ae(N){return N===null||he(N)?(e.exit("htmlFlowData"),O(N)):(e.consume(N),ae)}function O(N){return e.exit("htmlFlow"),t(N)}}function uC(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Cl,t,n)}}const cC={name:"htmlText",tokenize:dC};function dC(e,t,n){const r=this;let i,l,a;return o;function o(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),u}function u(S){return S===33?(e.consume(S),c):S===47?(e.consume(S),A):S===63?(e.consume(S),v):vt(S)?(e.consume(S),T):n(S)}function c(S){return S===45?(e.consume(S),h):S===91?(e.consume(S),l=0,p):vt(S)?(e.consume(S),x):n(S)}function h(S){return S===45?(e.consume(S),m):n(S)}function d(S){return S===null?n(S):S===45?(e.consume(S),f):he(S)?(a=d,J(S)):(e.consume(S),d)}function f(S){return S===45?(e.consume(S),m):d(S)}function m(S){return S===62?q(S):S===45?f(S):d(S)}function p(S){const ae="CDATA[";return S===ae.charCodeAt(l++)?(e.consume(S),l===ae.length?g:p):n(S)}function g(S){return S===null?n(S):S===93?(e.consume(S),w):he(S)?(a=g,J(S)):(e.consume(S),g)}function w(S){return S===93?(e.consume(S),y):g(S)}function y(S){return S===62?q(S):S===93?(e.consume(S),y):g(S)}function x(S){return S===null||S===62?q(S):he(S)?(a=x,J(S)):(e.consume(S),x)}function v(S){return S===null?n(S):S===63?(e.consume(S),b):he(S)?(a=v,J(S)):(e.consume(S),v)}function b(S){return S===62?q(S):v(S)}function A(S){return vt(S)?(e.consume(S),k):n(S)}function k(S){return S===45||jt(S)?(e.consume(S),k):E(S)}function E(S){return he(S)?(a=E,J(S)):je(S)?(e.consume(S),E):q(S)}function T(S){return S===45||jt(S)?(e.consume(S),T):S===47||S===62||Fe(S)?I(S):n(S)}function I(S){return S===47?(e.consume(S),q):S===58||S===95||vt(S)?(e.consume(S),C):he(S)?(a=I,J(S)):je(S)?(e.consume(S),I):q(S)}function C(S){return S===45||S===46||S===58||S===95||jt(S)?(e.consume(S),C):R(S)}function R(S){return S===61?(e.consume(S),L):he(S)?(a=R,J(S)):je(S)?(e.consume(S),R):I(S)}function L(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),i=S,M):he(S)?(a=L,J(S)):je(S)?(e.consume(S),L):(e.consume(S),U)}function M(S){return S===i?(e.consume(S),i=void 0,D):S===null?n(S):he(S)?(a=M,J(S)):(e.consume(S),M)}function U(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||Fe(S)?I(S):(e.consume(S),U)}function D(S){return S===47||S===62||Fe(S)?I(S):n(S)}function q(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),t):n(S)}function J(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),B}function B(S){return je(S)?Ie(e,X,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):X(S)}function X(S){return e.enter("htmlTextData"),a(S)}}const _h={name:"labelEnd",resolveAll:mC,resolveTo:gC,tokenize:xC},hC={tokenize:yC},fC={tokenize:vC},pC={tokenize:jC};function mC(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&vn(e,0,e.length,n),e}function gC(e,t){let n=e.length,r=0,i,l,a;for(;n--;){const h=e[n][1];if(i){if(h.type==="link"||h.type==="labelLink"&&h._inactive)break;e[n][0]==="enter"&&h.type==="labelLink"&&(h._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(h.type==="labelImage"||h.type==="labelLink")&&!h._balanced&&(i=n,h.type!=="labelLink")){r=2;break}}else h.type==="labelEnd"&&(l=n)}const o={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[i][1].start},end:{...e[l][1].end}},c={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[l-2][1].start}};return a=[["enter",o,t],["enter",u,t]],a=nn(a,e.slice(i+1,i+r+3)),a=nn(a,[["enter",c,t]]),a=nn(a,$o(t.parser.constructs.insideSpan.null,e.slice(i+r+4,l-3),t)),a=nn(a,[["exit",c,t],e[l-2],e[l-1],["exit",u,t]]),a=nn(a,e.slice(l+1)),a=nn(a,[["exit",o,t]]),vn(e,i,e.length,a),e}function xC(e,t,n){const r=this,i=r._labelStarts;let l,a;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();l=i[i.length-1]}return o;function o(f){return l?l._inactive?d(f):(a=r.parser.defined.includes(jn(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),u):n(f)}function u(f){return f===40?e.attempt(hC,h,a?h:d)(f):f===91?e.attempt(fC,h,a?c:d)(f):a?h(f):d(f)}function c(f){return e.attempt(pC,h,d)(f)}function h(f){return i.pop(),t(f)}function d(f){return l._balanced=!0,n(f)}}function yC(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return Fe(d)?Vi(e,l)(d):l(d)}function l(d){return d===41?h(d):bv(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return Fe(d)?Vi(e,u)(d):h(d)}function o(d){return n(d)}function u(d){return d===34||d===39||d===40?Nv(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):h(d)}function c(d){return Fe(d)?Vi(e,h)(d):h(d)}function h(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function vC(e,t,n){const r=this;return i;function i(o){return Sv.call(r,e,l,a,"reference","referenceMarker","referenceString")(o)}function l(o){return r.parser.defined.includes(jn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function jC(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const wC={name:"labelStartImage",resolveAll:_h.resolveAll,tokenize:kC};function kC(e,t,n){const r=this;let i;return l;function l(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),a}function a(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),i=e.exit("labelImage"),o):n(u)}function o(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(u))}}const bC={name:"labelStartLink",resolveAll:_h.resolveAll,tokenize:SC};function SC(e,t,n){const r=this;let i;return l;function l(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),i=e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(o))}}const Tu={name:"lineEnding",tokenize:NC};function NC(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ie(e,t,"linePrefix")}}const Na={name:"thematicBreak",tokenize:CC};function CC(e,t,n){let r=0,i;return l;function l(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,o(c)}function o(c){return c===i?(e.enter("thematicBreakSequence"),u(c)):r>=3&&(c===null||he(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),je(c)?Ie(e,o,"whitespace")(c):o(c))}}const It={continuation:{tokenize:RC},exit:AC,name:"list",tokenize:PC},EC={partial:!0,tokenize:IC},TC={partial:!0,tokenize:LC};function PC(e,t,n){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(m){const p=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Zc(m)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Na,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(m)}return n(m)}function u(m){return Zc(m)&&++a<10?(e.consume(m),u):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(Cl,r.interrupt?n:h,e.attempt(EC,f,d))}function h(m){return r.containerState.initialBlankLine=!0,l++,f(m)}function d(m){return je(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),f):n(m)}function f(m){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function RC(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Cl,i,l);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ie(e,t,"listItemIndent",r.containerState.size+1)(o)}function l(o){return r.containerState.furtherBlankLines||!je(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(TC,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ie(e,e.attempt(It,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function LC(e,t,n){const r=this;return Ie(e,i,"listItemIndent",r.containerState.size+1);function i(l){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(l):n(l)}}function AC(e){e.exit(this.containerState.type)}function IC(e,t,n){const r=this;return Ie(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const a=r.events[r.events.length-1];return!je(l)&&a&&a[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const sm={name:"setextUnderline",resolveTo:DC,tokenize:zC};function DC(e,t){const n=new so;let r=e.length,i,l,a;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){i=r;break}e[r][1].type==="paragraph"&&(l=r)}else e[r][1].type==="content"&&n.add(r,1,[]),!a&&e[r][1].type==="definition"&&(a=r);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",a?(n.add(l,0,[["enter",o,t]]),n.add(a+1,0,[["exit",e[i][1],t]]),e[i][1].end={...e[a][1].end}):e[i][1]=o,n.add(e.length,0,[["exit",o,t]]),n.consume(e),e}function zC(e,t,n){const r=this;let i;return l;function l(c){let h=r.events.length,d;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){d=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===i?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),je(c)?Ie(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||he(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const MC={tokenize:$C};function $C(e){const t=this,n=e.attempt(Cl,r,e.attempt(this.parser.constructs.flowInitial,i,Ie(e,e.attempt(this.parser.constructs.flow,i,e.attempt(VN,i)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const _C={resolveAll:Tv()},OC=Ev("string"),FC=Ev("text");function Ev(e){return{resolveAll:Tv(e==="text"?UC:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],l=n.attempt(i,a,o);return a;function a(h){return c(h)?l(h):o(h)}function o(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),u}function u(h){return c(h)?(n.exit("data"),l(h)):(n.consume(h),u)}function c(h){if(h===null)return!0;const d=i[h];let f=-1;if(d)for(;++f<d.length;){const m=d[f];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function Tv(e){return t;function t(n,r){let i=-1,l;for(;++i<=n.length;)l===void 0?n[i]&&n[i][1].type==="data"&&(l=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==l+2&&(n[l][1].end=n[i-1][1].end,n.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(n,r):n}}function UC(e,t){const n=new so;let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const i=e[r-1][1],l=t.sliceStream(i);let a=l.length,o=-1,u=0,c;for(;a--;){const h=l[a];if(typeof h=="string"){for(o=h.length;h.charCodeAt(o-1)===32;)u++,o--;if(o)break;o=-1}else if(h===-2)c=!0,u++;else if(h!==-1){a++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(u=0),u){const h={type:r===e.length||c||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:i.start._bufferIndex+o,_index:i.start._index+a,line:i.end.line,column:i.end.column-u,offset:i.end.offset-u},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):n.add(r,0,[["enter",h,t],["exit",h,t]])}r++}return n.consume(e),e}const BC={42:It,43:It,45:It,48:It,49:It,50:It,51:It,52:It,53:It,54:It,55:It,56:It,57:It,62:vv},HC={91:YN},WC={[-2]:Eu,[-1]:Eu,32:Eu},VC={35:nC,42:Na,45:[sm,Na],60:iC,61:sm,95:Na,96:rm,126:rm},QC={38:wv,92:jv},qC={[-5]:Tu,[-4]:Tu,[-3]:Tu,33:wC,38:wv,42:ed,60:[CN,cC],91:bC,92:[eC,jv],93:_h,95:ed,96:ON},GC={null:[ed,_C]},KC={null:[42,95]},YC={null:[]},JC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:KC,contentInitial:HC,disable:YC,document:BC,flow:VC,flowInitial:WC,insideSpan:GC,string:QC,text:qC},Symbol.toStringTag,{value:"Module"}));function XC(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},l=[];let a=[],o=[];const u={attempt:E(A),check:E(k),consume:x,enter:v,exit:b,interrupt:E(k,{interrupt:!0})},c={code:null,containerState:{},defineSkip:g,events:[],now:p,parser:e,previous:null,sliceSerialize:f,sliceStream:m,write:d};let h=t.tokenize.call(c,u);return t.resolveAll&&l.push(t),c;function d(R){return a=nn(a,R),w(),a[a.length-1]!==null?[]:(T(t,0),c.events=$o(l,c.events,c),c.events)}function f(R,L){return eE(m(R),L)}function m(R){return ZC(a,R)}function p(){const{_bufferIndex:R,_index:L,line:M,column:U,offset:D}=r;return{_bufferIndex:R,_index:L,line:M,column:U,offset:D}}function g(R){i[R.line]=R.column,C()}function w(){for(;r._index<a.length;){const R=a[r._index];if(typeof R=="string"){const L=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===L&&r._bufferIndex<R.length;)y(R.charCodeAt(r._bufferIndex))}else y(R)}}function y(R){h=h(R)}function x(R){he(R)?(r.line++,r.column=1,r.offset+=R===-3?2:1,C()):R!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=R}function v(R,L){const M=L||{};return M.type=R,M.start=p(),c.events.push(["enter",M,c]),o.push(M),M}function b(R){const L=o.pop();return L.end=p(),c.events.push(["exit",L,c]),L}function A(R,L){T(R,L.from)}function k(R,L){L.restore()}function E(R,L){return M;function M(U,D,q){let J,B,X,S;return Array.isArray(U)?O(U):"tokenize"in U?O([U]):ae(U);function ae(ce){return Te;function Te(tt){const W=tt!==null&&ce[tt],ge=tt!==null&&ce.null,Q=[...Array.isArray(W)?W:W?[W]:[],...Array.isArray(ge)?ge:ge?[ge]:[]];return O(Q)(tt)}}function O(ce){return J=ce,B=0,ce.length===0?q:N(ce[B])}function N(ce){return Te;function Te(tt){return S=I(),X=ce,ce.partial||(c.currentConstruct=ce),ce.name&&c.parser.constructs.disable.null.includes(ce.name)?Z():ce.tokenize.call(L?Object.assign(Object.create(c),L):c,u,F,Z)(tt)}}function F(ce){return R(X,S),D}function Z(ce){return S.restore(),++B<J.length?N(J[B]):q}}}function T(R,L){R.resolveAll&&!l.includes(R)&&l.push(R),R.resolve&&vn(c.events,L,c.events.length-L,R.resolve(c.events.slice(L),c)),R.resolveTo&&(c.events=R.resolveTo(c.events,c))}function I(){const R=p(),L=c.previous,M=c.currentConstruct,U=c.events.length,D=Array.from(o);return{from:U,restore:q};function q(){r=R,c.previous=L,c.currentConstruct=M,c.events.length=U,o=D,C()}}function C(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function ZC(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,l=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,l)];else{if(a=e.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}l>0&&a.push(e[i].slice(0,l))}return a}function eE(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const l=e[n];let a;if(typeof l=="string")a=l;else switch(l){case-5:{a="\r";break}case-4:{a=`
362
362
  `;break}case-3:{a=`\r
363
- `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(l)}i=l===-2,r.push(a)}return r.join("")}function YC(e){const r={constructs:hv([QC,...(e||{}).extensions||[]]),content:i(pN),defined:[],document:i(gN),flow:i(LC),lazy:{},string:i(DC),text:i(zC)};return r;function i(l){return a;function a(o){return qC(r,l,o)}}}function JC(e){for(;!vv(e););return e}const rm=/[\0\t\n\r]/g;function XC(){let e=1,t="",n=!0,r;return i;function i(l,a,o){l=t+(typeof l=="string"?l.toString():new TextDecoder(a||void 0).decode(l));const u=[];let c=0;for(t="",n&&(l.charCodeAt(0)===65279&&c++,n=void 0);c<l.length;){rm.lastIndex=c;const h=rm.exec(l),d=h&&h.index!==void 0?h.index:l.length,f=l.charCodeAt(d);if(!h){t=l.slice(c);break}if(f===10&&c===d&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<d&&(u.push(l.slice(c,d)),e+=d-c),f){case 0:{u.push(65533),e++;break}case 9:{const m=Math.ceil(e/4)*4;for(u.push(-2);e++<m;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}c=d+1}return o&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const ZC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function eE(e){return e.replace(ZC,tE)}function tE(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),l=i===120||i===88;return fv(n.slice(l?2:1),l?16:10)}return $h(n)||e}const Cv={}.hasOwnProperty;function nE(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),rE(n)(JC(YC(n).document().write(XC()(e,t,!0))))}function rE(e){const t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Rl),autolinkProtocol:C,autolinkEmail:C,atxHeading:a(ee),blockQuote:a(V),characterEscape:C,characterReference:C,codeFenced:a(de),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(de,o),codeText:a(ve,o),codeTextData:C,data:C,codeFlowValue:C,definition:a(ct),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Zt),hardBreakEscape:a(Ce),hardBreakTrailing:a(Ce),htmlFlow:a(Ze,o),htmlFlowData:C,htmlText:a(Ze,o),htmlTextData:C,image:a(zr),label:o,link:a(Rl),listItem:a(Ho),listItemValue:m,listOrdered:a(Ll,f),listUnordered:a(Ll),paragraph:a(zn),reference:F,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ee),strong:a(Mr),thematicBreak:a(ci)},exit:{atxHeading:c(),atxHeadingSequence:k,autolink:c(),autolinkEmail:ge,autolinkProtocol:W,blockQuote:c(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:Te,characterReference:tt,codeFenced:c(y),codeFencedFence:w,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:R,codeIndented:c(x),codeText:c(q),codeTextData:R,data:R,definition:c(),definitionDestinationString:A,definitionLabelString:v,definitionTitleString:b,emphasis:c(),hardBreakEscape:c(M),hardBreakTrailing:c(M),htmlFlow:c(U),htmlFlowData:R,htmlText:c(D),htmlTextData:R,image:c(B),label:S,labelText:X,lineEnding:L,link:c(J),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Z,resourceDestinationString:ae,resourceTitleString:O,resource:N,setextHeading:c(I),setextHeadingLineSequence:T,setextHeadingText:E,strong:c(),thematicBreak:c()}};Ev(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(_){let G={type:"root",children:[],position:void 0};const fe={stack:[G],tokenStack:[],config:t,enter:u,exit:h,buffer:o,resume:d,data:n},pe=[],bt=[];let Ee=-1;for(;++Ee<_.length;)if(bt.push(_[Ee]),_[Ee][1].type==="listOrdered"||_[Ee][1].type==="listUnordered")if(_[Ee][0]==="enter")pe.push(bt.length-1);else{const pt=pe.pop();l(bt,pt)}for(_=bt,Ee=-1;++Ee<_.length;){const pt=t[_[Ee][0]];_[Ee][0]==="enter"&&t.beforeEnter.length>0&&i(t.beforeEnter,{...fe,sliceSerialize:_[Ee][2].sliceSerialize},_[Ee][1]),Cv.call(pt,_[Ee][1].type)&&pt[_[Ee][1].type].call({...fe,sliceSerialize:_[Ee][2].sliceSerialize},_[Ee][1]),_[Ee][0]==="exit"&&t.afterExit.length>0&&i(t.afterExit,{...fe,sliceSerialize:_[Ee][2].sliceSerialize},_[Ee][1])}if(fe.tokenStack.length>0){const pt=fe.tokenStack[fe.tokenStack.length-1];(pt[1]||sm).call(fe,void 0,pt[0])}for(G.position={start:tr(_.length>0?_[0][1].start:{line:1,column:1,offset:0}),end:tr(_.length>0?_[_.length-2][1].end:{line:1,column:1,offset:0})},Ee=-1;++Ee<t.transforms.length;)G=t.transforms[Ee](G)||G;return G}function i(_,G,fe){let pe=-1;for(;++pe<_.length;)_[pe].call(G,fe)}function l(_,G){const fe=_.length-1;let pe=G-1,bt=-1,Ee=!1,pt,Bt,Xn,$r;const Zn=[];for(;++pe<=fe;){const mt=_[pe];switch(mt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{mt[0]==="enter"?bt++:bt--,$r=void 0;break}case"lineEndingBlank":{mt[0]==="enter"&&(pt&&!$r&&!bt&&!Xn&&(Xn=pe),$r=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:$r=void 0}if(!bt&&mt[0]==="enter"&&mt[1].type==="listItemPrefix"||bt===-1&&mt[0]==="exit"&&(mt[1].type==="listUnordered"||mt[1].type==="listOrdered")){if(pt){let bn=pe;for(Bt=void 0;bn--;){const cn=_[bn];if(cn[1].type==="lineEnding"||cn[1].type==="lineEndingBlank"){if(cn[0]==="exit")continue;Bt&&(_[Bt][1].type="lineEndingBlank",Ee=!0),cn[1].type="lineEnding",Bt=bn}else if(!(cn[1].type==="linePrefix"||cn[1].type==="blockQuotePrefix"||cn[1].type==="blockQuotePrefixWhitespace"||cn[1].type==="blockQuoteMarker"||cn[1].type==="listItemIndent"))break}Xn&&(!Bt||Xn<Bt)&&(pt._spread=!0),pt.end=Object.assign({},Bt?_[Bt][1].start:mt[1].end),Zn.push({at:Bt||pe,event:["exit",pt,mt[2]]})}if(mt[1].type==="listItemPrefix"){const bn={type:"listItem",_spread:!1,start:Object.assign({},mt[1].start),end:void 0};pt=bn,Zn.push({at:pe,event:["enter",bn,mt[2]]}),Xn=void 0,$r=!0}}}const _r=_.splice(G);let ms=0;for(pe=-1;++pe<_r.length;){for(;ms<Zn.length&&Zn[ms].at===G+pe;)_.push(Zn[ms++].event);_.push(_r[pe])}_[G][1]._spread=Ee}function a(_,G){return fe;function fe(pe){u.call(this,_(pe),pe),G&&G.call(this,pe)}}function o(){this.stack.push({type:"fragment",children:[]})}function u(_,G,fe){this.stack[this.stack.length-1].children.push(_),this.stack.push(_),this.tokenStack.push([G,fe||void 0]),_.position={start:tr(G.start),end:void 0}}function c(_){return G;function G(fe){_&&_.call(this,fe),h.call(this,fe)}}function h(_,G){const fe=this.stack.pop(),pe=this.tokenStack.pop();if(!pe)throw new Error("Cannot close `"+_.type+"` ("+Wi({start:_.start,end:_.end})+"): it’s not open");pe[0].type!==_.type&&(G?G.call(this,_,pe[0]):(pe[1]||sm).call(this,_,pe[0])),fe.position.end=tr(_.end)}function d(){return zo(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function m(_){if(this.data.expectingFirstListItemValue){const G=this.stack[this.stack.length-2];G.start=Number.parseInt(this.sliceSerialize(_),10),this.data.expectingFirstListItemValue=void 0}}function p(){const _=this.resume(),G=this.stack[this.stack.length-1];G.lang=_}function g(){const _=this.resume(),G=this.stack[this.stack.length-1];G.meta=_}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const _=this.resume(),G=this.stack[this.stack.length-1];G.value=_.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const _=this.resume(),G=this.stack[this.stack.length-1];G.value=_.replace(/(\r?\n|\r)$/g,"")}function v(_){const G=this.resume(),fe=this.stack[this.stack.length-1];fe.label=G,fe.identifier=vn(this.sliceSerialize(_)).toLowerCase()}function b(){const _=this.resume(),G=this.stack[this.stack.length-1];G.title=_}function A(){const _=this.resume(),G=this.stack[this.stack.length-1];G.url=_}function k(_){const G=this.stack[this.stack.length-1];if(!G.depth){const fe=this.sliceSerialize(_).length;G.depth=fe}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function T(_){const G=this.stack[this.stack.length-1];G.depth=this.sliceSerialize(_).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function C(_){const fe=this.stack[this.stack.length-1].children;let pe=fe[fe.length-1];(!pe||pe.type!=="text")&&(pe=Al(),pe.position={start:tr(_.start),end:void 0},fe.push(pe)),this.stack.push(pe)}function R(_){const G=this.stack.pop();G.value+=this.sliceSerialize(_),G.position.end=tr(_.end)}function L(_){const G=this.stack[this.stack.length-1];if(this.data.atHardBreak){const fe=G.children[G.children.length-1];fe.position.end=tr(_.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(G.type)&&(C.call(this,_),R.call(this,_))}function M(){this.data.atHardBreak=!0}function U(){const _=this.resume(),G=this.stack[this.stack.length-1];G.value=_}function D(){const _=this.resume(),G=this.stack[this.stack.length-1];G.value=_}function q(){const _=this.resume(),G=this.stack[this.stack.length-1];G.value=_}function J(){const _=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";_.type+="Reference",_.referenceType=G,delete _.url,delete _.title}else delete _.identifier,delete _.label;this.data.referenceType=void 0}function B(){const _=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";_.type+="Reference",_.referenceType=G,delete _.url,delete _.title}else delete _.identifier,delete _.label;this.data.referenceType=void 0}function X(_){const G=this.sliceSerialize(_),fe=this.stack[this.stack.length-2];fe.label=eE(G),fe.identifier=vn(G).toLowerCase()}function S(){const _=this.stack[this.stack.length-1],G=this.resume(),fe=this.stack[this.stack.length-1];if(this.data.inReference=!0,fe.type==="link"){const pe=_.children;fe.children=pe}else fe.alt=G}function ae(){const _=this.resume(),G=this.stack[this.stack.length-1];G.url=_}function O(){const _=this.resume(),G=this.stack[this.stack.length-1];G.title=_}function N(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function Z(_){const G=this.resume(),fe=this.stack[this.stack.length-1];fe.label=G,fe.identifier=vn(this.sliceSerialize(_)).toLowerCase(),this.data.referenceType="full"}function ce(_){this.data.characterReferenceType=_.type}function Te(_){const G=this.sliceSerialize(_),fe=this.data.characterReferenceType;let pe;fe?(pe=fv(G,fe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):pe=$h(G);const bt=this.stack[this.stack.length-1];bt.value+=pe}function tt(_){const G=this.stack.pop();G.position.end=tr(_.end)}function W(_){R.call(this,_);const G=this.stack[this.stack.length-1];G.url=this.sliceSerialize(_)}function ge(_){R.call(this,_);const G=this.stack[this.stack.length-1];G.url="mailto:"+this.sliceSerialize(_)}function V(){return{type:"blockquote",children:[],position:void 0}}function de(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function ve(){return{type:"inlineCode",value:"",position:void 0}}function ct(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function Zt(){return{type:"emphasis",children:[],position:void 0}}function ee(){return{type:"heading",depth:0,children:[],position:void 0}}function Ce(){return{type:"break",position:void 0}}function Ze(){return{type:"html",value:"",position:void 0}}function zr(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function Rl(){return{type:"link",title:null,url:"",children:[],position:void 0}}function Ll(_){return{type:"list",ordered:_.type==="listOrdered",start:null,spread:_._spread,children:[],position:void 0}}function Ho(_){return{type:"listItem",spread:_._spread,checked:null,children:[],position:void 0}}function zn(){return{type:"paragraph",children:[],position:void 0}}function Mr(){return{type:"strong",children:[],position:void 0}}function Al(){return{type:"text",value:"",position:void 0}}function ci(){return{type:"thematicBreak",position:void 0}}}function tr(e){return{line:e.line,column:e.column,offset:e.offset}}function Ev(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Ev(e,r):sE(e,r)}}function sE(e,t){let n;for(n in t)if(Cv.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"afterExit":case"beforeEnter":{const r=t[n];r&&e[n].push(r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function sm(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Wi({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Wi({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Wi({start:t.start,end:t.end})+") is still open")}function iE(e){const t=this;t.parser=n;function n(r){return nE(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function lE(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function aE(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
364
- `}]}function oE(e,t){const n=t.value?t.value+`
365
- `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function uE(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cE(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dE(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=oi(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=l+1,o+=1,e.footnoteCounts.set(r,o);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function hE(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fE(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Tv(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function pE(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Tv(e,t);const i={src:oi(r.url||"")};t.alt!==null&&t.alt!==void 0&&(i.alt=t.alt),r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,l),e.applyData(t,l)}function mE(e,t){const n={src:oi(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function gE(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function xE(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Tv(e,t);const i={href:oi(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function yE(e,t){const n={href:oi(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function vE(e,t,n){const r=e.all(t),i=n?jE(n):Pv(t),l={},a=[];if(typeof t.checked=="boolean"){const h=r[0];let d;h&&h.type==="element"&&h.tagName==="p"?d=h:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const h=r[o];(i||o!==0||h.type!=="element"||h.tagName!=="p")&&a.push({type:"text",value:`
363
+ `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(l)}i=l===-2,r.push(a)}return r.join("")}function tE(e){const r={constructs:mv([JC,...(e||{}).extensions||[]]),content:i(vN),defined:[],document:i(wN),flow:i(MC),lazy:{},string:i(OC),text:i(FC)};return r;function i(l){return a;function a(o){return XC(r,l,o)}}}function nE(e){for(;!kv(e););return e}const im=/[\0\t\n\r]/g;function rE(){let e=1,t="",n=!0,r;return i;function i(l,a,o){l=t+(typeof l=="string"?l.toString():new TextDecoder(a||void 0).decode(l));const u=[];let c=0;for(t="",n&&(l.charCodeAt(0)===65279&&c++,n=void 0);c<l.length;){im.lastIndex=c;const h=im.exec(l),d=h&&h.index!==void 0?h.index:l.length,f=l.charCodeAt(d);if(!h){t=l.slice(c);break}if(f===10&&c===d&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<d&&(u.push(l.slice(c,d)),e+=d-c),f){case 0:{u.push(65533),e++;break}case 9:{const m=Math.ceil(e/4)*4;for(u.push(-2);e++<m;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}c=d+1}return o&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const sE=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function iE(e){return e.replace(sE,lE)}function lE(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),l=i===120||i===88;return gv(n.slice(l?2:1),l?16:10)}return $h(n)||e}const Pv={}.hasOwnProperty;function aE(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),oE(n)(nE(tE(n).document().write(rE()(e,t,!0))))}function oE(e){const t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Rl),autolinkProtocol:C,autolinkEmail:C,atxHeading:a(ee),blockQuote:a(Q),characterEscape:C,characterReference:C,codeFenced:a(de),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(de,o),codeText:a(ve,o),codeTextData:C,data:C,codeFlowValue:C,definition:a(ct),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Zt),hardBreakEscape:a(Ce),hardBreakTrailing:a(Ce),htmlFlow:a(Ze,o),htmlFlowData:C,htmlText:a(Ze,o),htmlTextData:C,image:a(Mr),label:o,link:a(Rl),listItem:a(Wo),listItemValue:m,listOrdered:a(Ll,f),listUnordered:a(Ll),paragraph:a(zn),reference:F,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ee),strong:a($r),thematicBreak:a(ci)},exit:{atxHeading:c(),atxHeadingSequence:k,autolink:c(),autolinkEmail:ge,autolinkProtocol:W,blockQuote:c(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:Te,characterReference:tt,codeFenced:c(y),codeFencedFence:w,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:R,codeIndented:c(x),codeText:c(q),codeTextData:R,data:R,definition:c(),definitionDestinationString:A,definitionLabelString:v,definitionTitleString:b,emphasis:c(),hardBreakEscape:c(M),hardBreakTrailing:c(M),htmlFlow:c(U),htmlFlowData:R,htmlText:c(D),htmlTextData:R,image:c(B),label:S,labelText:X,lineEnding:L,link:c(J),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Z,resourceDestinationString:ae,resourceTitleString:O,resource:N,setextHeading:c(I),setextHeadingLineSequence:T,setextHeadingText:E,strong:c(),thematicBreak:c()}};Rv(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(_){let G={type:"root",children:[],position:void 0};const fe={stack:[G],tokenStack:[],config:t,enter:u,exit:h,buffer:o,resume:d,data:n},pe=[],bt=[];let Ee=-1;for(;++Ee<_.length;)if(bt.push(_[Ee]),_[Ee][1].type==="listOrdered"||_[Ee][1].type==="listUnordered")if(_[Ee][0]==="enter")pe.push(bt.length-1);else{const pt=pe.pop();l(bt,pt)}for(_=bt,Ee=-1;++Ee<_.length;){const pt=t[_[Ee][0]];_[Ee][0]==="enter"&&t.beforeEnter.length>0&&i(t.beforeEnter,{...fe,sliceSerialize:_[Ee][2].sliceSerialize},_[Ee][1]),Pv.call(pt,_[Ee][1].type)&&pt[_[Ee][1].type].call({...fe,sliceSerialize:_[Ee][2].sliceSerialize},_[Ee][1]),_[Ee][0]==="exit"&&t.afterExit.length>0&&i(t.afterExit,{...fe,sliceSerialize:_[Ee][2].sliceSerialize},_[Ee][1])}if(fe.tokenStack.length>0){const pt=fe.tokenStack[fe.tokenStack.length-1];(pt[1]||lm).call(fe,void 0,pt[0])}for(G.position={start:nr(_.length>0?_[0][1].start:{line:1,column:1,offset:0}),end:nr(_.length>0?_[_.length-2][1].end:{line:1,column:1,offset:0})},Ee=-1;++Ee<t.transforms.length;)G=t.transforms[Ee](G)||G;return G}function i(_,G,fe){let pe=-1;for(;++pe<_.length;)_[pe].call(G,fe)}function l(_,G){const fe=_.length-1;let pe=G-1,bt=-1,Ee=!1,pt,Bt,Zn,_r;const er=[];for(;++pe<=fe;){const mt=_[pe];switch(mt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{mt[0]==="enter"?bt++:bt--,_r=void 0;break}case"lineEndingBlank":{mt[0]==="enter"&&(pt&&!_r&&!bt&&!Zn&&(Zn=pe),_r=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:_r=void 0}if(!bt&&mt[0]==="enter"&&mt[1].type==="listItemPrefix"||bt===-1&&mt[0]==="exit"&&(mt[1].type==="listUnordered"||mt[1].type==="listOrdered")){if(pt){let bn=pe;for(Bt=void 0;bn--;){const dn=_[bn];if(dn[1].type==="lineEnding"||dn[1].type==="lineEndingBlank"){if(dn[0]==="exit")continue;Bt&&(_[Bt][1].type="lineEndingBlank",Ee=!0),dn[1].type="lineEnding",Bt=bn}else if(!(dn[1].type==="linePrefix"||dn[1].type==="blockQuotePrefix"||dn[1].type==="blockQuotePrefixWhitespace"||dn[1].type==="blockQuoteMarker"||dn[1].type==="listItemIndent"))break}Zn&&(!Bt||Zn<Bt)&&(pt._spread=!0),pt.end=Object.assign({},Bt?_[Bt][1].start:mt[1].end),er.push({at:Bt||pe,event:["exit",pt,mt[2]]})}if(mt[1].type==="listItemPrefix"){const bn={type:"listItem",_spread:!1,start:Object.assign({},mt[1].start),end:void 0};pt=bn,er.push({at:pe,event:["enter",bn,mt[2]]}),Zn=void 0,_r=!0}}}const Or=_.splice(G);let gs=0;for(pe=-1;++pe<Or.length;){for(;gs<er.length&&er[gs].at===G+pe;)_.push(er[gs++].event);_.push(Or[pe])}_[G][1]._spread=Ee}function a(_,G){return fe;function fe(pe){u.call(this,_(pe),pe),G&&G.call(this,pe)}}function o(){this.stack.push({type:"fragment",children:[]})}function u(_,G,fe){this.stack[this.stack.length-1].children.push(_),this.stack.push(_),this.tokenStack.push([G,fe||void 0]),_.position={start:nr(G.start),end:void 0}}function c(_){return G;function G(fe){_&&_.call(this,fe),h.call(this,fe)}}function h(_,G){const fe=this.stack.pop(),pe=this.tokenStack.pop();if(!pe)throw new Error("Cannot close `"+_.type+"` ("+Wi({start:_.start,end:_.end})+"): it’s not open");pe[0].type!==_.type&&(G?G.call(this,_,pe[0]):(pe[1]||lm).call(this,_,pe[0])),fe.position.end=nr(_.end)}function d(){return Mo(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function m(_){if(this.data.expectingFirstListItemValue){const G=this.stack[this.stack.length-2];G.start=Number.parseInt(this.sliceSerialize(_),10),this.data.expectingFirstListItemValue=void 0}}function p(){const _=this.resume(),G=this.stack[this.stack.length-1];G.lang=_}function g(){const _=this.resume(),G=this.stack[this.stack.length-1];G.meta=_}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const _=this.resume(),G=this.stack[this.stack.length-1];G.value=_.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const _=this.resume(),G=this.stack[this.stack.length-1];G.value=_.replace(/(\r?\n|\r)$/g,"")}function v(_){const G=this.resume(),fe=this.stack[this.stack.length-1];fe.label=G,fe.identifier=jn(this.sliceSerialize(_)).toLowerCase()}function b(){const _=this.resume(),G=this.stack[this.stack.length-1];G.title=_}function A(){const _=this.resume(),G=this.stack[this.stack.length-1];G.url=_}function k(_){const G=this.stack[this.stack.length-1];if(!G.depth){const fe=this.sliceSerialize(_).length;G.depth=fe}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function T(_){const G=this.stack[this.stack.length-1];G.depth=this.sliceSerialize(_).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function C(_){const fe=this.stack[this.stack.length-1].children;let pe=fe[fe.length-1];(!pe||pe.type!=="text")&&(pe=Al(),pe.position={start:nr(_.start),end:void 0},fe.push(pe)),this.stack.push(pe)}function R(_){const G=this.stack.pop();G.value+=this.sliceSerialize(_),G.position.end=nr(_.end)}function L(_){const G=this.stack[this.stack.length-1];if(this.data.atHardBreak){const fe=G.children[G.children.length-1];fe.position.end=nr(_.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(G.type)&&(C.call(this,_),R.call(this,_))}function M(){this.data.atHardBreak=!0}function U(){const _=this.resume(),G=this.stack[this.stack.length-1];G.value=_}function D(){const _=this.resume(),G=this.stack[this.stack.length-1];G.value=_}function q(){const _=this.resume(),G=this.stack[this.stack.length-1];G.value=_}function J(){const _=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";_.type+="Reference",_.referenceType=G,delete _.url,delete _.title}else delete _.identifier,delete _.label;this.data.referenceType=void 0}function B(){const _=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";_.type+="Reference",_.referenceType=G,delete _.url,delete _.title}else delete _.identifier,delete _.label;this.data.referenceType=void 0}function X(_){const G=this.sliceSerialize(_),fe=this.stack[this.stack.length-2];fe.label=iE(G),fe.identifier=jn(G).toLowerCase()}function S(){const _=this.stack[this.stack.length-1],G=this.resume(),fe=this.stack[this.stack.length-1];if(this.data.inReference=!0,fe.type==="link"){const pe=_.children;fe.children=pe}else fe.alt=G}function ae(){const _=this.resume(),G=this.stack[this.stack.length-1];G.url=_}function O(){const _=this.resume(),G=this.stack[this.stack.length-1];G.title=_}function N(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function Z(_){const G=this.resume(),fe=this.stack[this.stack.length-1];fe.label=G,fe.identifier=jn(this.sliceSerialize(_)).toLowerCase(),this.data.referenceType="full"}function ce(_){this.data.characterReferenceType=_.type}function Te(_){const G=this.sliceSerialize(_),fe=this.data.characterReferenceType;let pe;fe?(pe=gv(G,fe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):pe=$h(G);const bt=this.stack[this.stack.length-1];bt.value+=pe}function tt(_){const G=this.stack.pop();G.position.end=nr(_.end)}function W(_){R.call(this,_);const G=this.stack[this.stack.length-1];G.url=this.sliceSerialize(_)}function ge(_){R.call(this,_);const G=this.stack[this.stack.length-1];G.url="mailto:"+this.sliceSerialize(_)}function Q(){return{type:"blockquote",children:[],position:void 0}}function de(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function ve(){return{type:"inlineCode",value:"",position:void 0}}function ct(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function Zt(){return{type:"emphasis",children:[],position:void 0}}function ee(){return{type:"heading",depth:0,children:[],position:void 0}}function Ce(){return{type:"break",position:void 0}}function Ze(){return{type:"html",value:"",position:void 0}}function Mr(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function Rl(){return{type:"link",title:null,url:"",children:[],position:void 0}}function Ll(_){return{type:"list",ordered:_.type==="listOrdered",start:null,spread:_._spread,children:[],position:void 0}}function Wo(_){return{type:"listItem",spread:_._spread,checked:null,children:[],position:void 0}}function zn(){return{type:"paragraph",children:[],position:void 0}}function $r(){return{type:"strong",children:[],position:void 0}}function Al(){return{type:"text",value:"",position:void 0}}function ci(){return{type:"thematicBreak",position:void 0}}}function nr(e){return{line:e.line,column:e.column,offset:e.offset}}function Rv(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Rv(e,r):uE(e,r)}}function uE(e,t){let n;for(n in t)if(Pv.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"afterExit":case"beforeEnter":{const r=t[n];r&&e[n].push(r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function lm(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Wi({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Wi({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Wi({start:t.start,end:t.end})+") is still open")}function cE(e){const t=this;t.parser=n;function n(r){return aE(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function dE(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function hE(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
364
+ `}]}function fE(e,t){const n=t.value?t.value+`
365
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function pE(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mE(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gE(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=ui(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=l+1,o+=1,e.footnoteCounts.set(r,o);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function xE(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yE(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Lv(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function vE(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Lv(e,t);const i={src:ui(r.url||"")};t.alt!==null&&t.alt!==void 0&&(i.alt=t.alt),r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,l),e.applyData(t,l)}function jE(e,t){const n={src:ui(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function wE(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function kE(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Lv(e,t);const i={href:ui(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function bE(e,t){const n={href:ui(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function SE(e,t,n){const r=e.all(t),i=n?NE(n):Av(t),l={},a=[];if(typeof t.checked=="boolean"){const h=r[0];let d;h&&h.type==="element"&&h.tagName==="p"?d=h:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const h=r[o];(i||o!==0||h.type!=="element"||h.tagName!=="p")&&a.push({type:"text",value:`
366
366
  `}),h.type==="element"&&h.tagName==="p"&&!i?a.push(...h.children):a.push(h)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
367
- `});const c={type:"element",tagName:"li",properties:l,children:a};return e.patch(t,c),e.applyData(t,c)}function jE(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const{children:n}=e;let r=-1;for(;!t&&++r<n.length;)t=Pv(n[r])}return t}function Pv(e){const{spread:t}=e;return t??e.children.length>1}function wE(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function kE(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bE(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function SE(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function NE(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=Ih(t.children[1]),u=iv(t.children[t.children.length-1]);o&&u&&(a.position={start:o,end:u}),i.push(a)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)}function CE(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let u=-1;const c=[];for(;++u<o;){const d=t.children[u],f={},m=a?a[u]:void 0;m&&(f.align=m);let p={type:"element",tagName:l,properties:f,children:[]};d&&(p.children=e.all(d),e.patch(d,p),p=e.applyData(d,p)),c.push(p)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,h),e.applyData(t,h)}function EE(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const im=9,lm=32;function TE(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const l=[];for(;r;)l.push(am(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return l.push(am(t.slice(i),i>0,!1)),l.join("")}function am(e,t,n){let r=0,i=e.length;if(t){let l=e.codePointAt(r);for(;l===im||l===lm;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(i-1);for(;l===im||l===lm;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function PE(e,t){const n={type:"text",value:TE(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function RE(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const LE={blockquote:lE,break:aE,code:oE,delete:uE,emphasis:cE,footnoteReference:dE,heading:hE,html:fE,imageReference:pE,image:mE,inlineCode:gE,linkReference:xE,link:yE,listItem:vE,list:wE,paragraph:kE,root:bE,strong:SE,table:NE,tableCell:EE,tableRow:CE,text:PE,thematicBreak:RE,toml:na,yaml:na,definition:na,footnoteDefinition:na};function na(){}const Rv=-1,$o=0,Qi=1,io=2,Oh=3,Fh=4,Uh=5,Bh=6,Lv=7,Av=8,{defineProperty:AE}=Object,Iv=typeof self=="object"?self:globalThis,om=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Iv[e](t)},IE=(e,t)=>{const n=(i,l)=>(e.set(l,i),i),r=i=>{if(e.has(i))return e.get(i);const[l,a]=t[i];switch(l){case $o:case Rv:return n(a,i);case Qi:{const o=n([],i);for(const u of a)o.push(r(u));return o}case io:{const o=n({},i);for(const[u,c]of a){const h=r(u),d=r(c);h==="__proto__"?AE(o,h,{value:d,configurable:!0,enumerable:!0,writable:!0}):o[h]=d}return o}case Oh:return n(new Date(a),i);case Fh:{const{source:o,flags:u}=a;return n(new RegExp(o,u),i)}case Uh:{const o=n(new Map,i);for(const[u,c]of a)o.set(r(u),r(c));return o}case Bh:{const o=n(new Set,i);for(const u of a)o.add(r(u));return o}case Lv:{const{name:o,message:u}=a;return n(typeof Iv[o]=="function"?om(o,u):new Error(u),i)}case Av:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}case"-0":return-0}return n(om(l,a),i)};return r},um=e=>IE(new Map,e)(0),Hr="",{toString:DE}={},{keys:zE,is:ME}=Object,Ei=e=>{const t=typeof e;if(t!=="object"||!e)return[$o,t];const n=DE.call(e).slice(8,-1);switch(n){case"Array":return[Qi,Hr];case"Object":return[io,Hr];case"Date":return[Oh,Hr];case"RegExp":return[Fh,Hr];case"Map":return[Uh,Hr];case"Set":return[Bh,Hr];case"DataView":return[Qi,n]}return n.includes("Array")?[Qi,n]:e instanceof Error?[Lv,e.name||"Error"]:[io,n]},ra=([e,t])=>e===$o&&(t==="function"||t==="symbol"),$E=(e,t,n,r)=>{const i=(a,o)=>{const u=r.push(a)-1;return n.set(o,u),u},l=a=>{if(n.has(a))return n.get(a);let[o,u]=Ei(a);switch(o){case $o:{let h=a;switch(u){case"bigint":o=Av,h=a.toString();break;case"number":if(!a&&ME(a,-0))return r.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);h=null;break;case"undefined":return i([Rv],a)}return i([o,h],a)}case Qi:{if(u){let f=a;return u==="DataView"?f=new Uint8Array(a.buffer):u==="ArrayBuffer"&&(f=new Uint8Array(a)),i([u,[...f]],a)}const h=[],d=i([o,h],a);for(const f of a)h.push(l(f));return d}case io:{if(u)switch(u){case"BigInt":return i([u,a.toString()],a);case"Boolean":case"Number":case"String":return i([u,a.valueOf()],a)}if(t&&"toJSON"in a)return l(a.toJSON());const h=[],d=i([o,h],a);for(const f of zE(a))(e||!ra(Ei(a[f])))&&h.push([l(f),l(a[f])]);return d}case Oh:return i([o,isNaN(a.getTime())?Hr:a.toISOString()],a);case Fh:{const{source:h,flags:d}=a;return i([o,{source:h,flags:d}],a)}case Uh:{const h=[],d=i([o,h],a);for(const[f,m]of a)(e||!(ra(Ei(f))||ra(Ei(m))))&&h.push([l(f),l(m)]);return d}case Bh:{const h=[],d=i([o,h],a);for(const f of a)(e||!ra(Ei(f)))&&h.push(l(f));return d}}const{message:c}=a;return i([o,{name:u,message:c}],a)};return l},cm=(e,{json:t,lossy:n}={})=>{const r=[];return $E(!(t||n),!!t,new Map,r)(e),r},lo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?um(cm(e,t)):structuredClone(e):(e,t)=>um(cm(e,t));function _E(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function OE(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function FE(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||_E,r=e.options.footnoteBackLabel||OE,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[],u=[];let c=-1;for(;++c<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[c]);h&&(o[c]=e.all(h))}for(c=-1;++c<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[c]);if(!h)continue;const d=o[c],f=String(h.identifier).toUpperCase(),m=oi(f.toLowerCase());let p=0;const g=[],w=e.footnoteCounts.get(f);for(;w!==void 0&&++p<=w;){g.length>0&&g.push({type:"text",value:" "});let v=typeof n=="string"?n:n(c,p);typeof v=="string"&&(v={type:"text",value:v}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,p),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const y=d[d.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const v=y.children[y.children.length-1];v&&v.type==="text"?v.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...g)}else d.push(...g);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(d,!0)};e.patch(h,x),u.push(x)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...lo(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
367
+ `});const c={type:"element",tagName:"li",properties:l,children:a};return e.patch(t,c),e.applyData(t,c)}function NE(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const{children:n}=e;let r=-1;for(;!t&&++r<n.length;)t=Av(n[r])}return t}function Av(e){const{spread:t}=e;return t??e.children.length>1}function CE(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function EE(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function TE(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function PE(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function RE(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=Ih(t.children[1]),u=ov(t.children[t.children.length-1]);o&&u&&(a.position={start:o,end:u}),i.push(a)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)}function LE(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let u=-1;const c=[];for(;++u<o;){const d=t.children[u],f={},m=a?a[u]:void 0;m&&(f.align=m);let p={type:"element",tagName:l,properties:f,children:[]};d&&(p.children=e.all(d),e.patch(d,p),p=e.applyData(d,p)),c.push(p)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,h),e.applyData(t,h)}function AE(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const am=9,om=32;function IE(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const l=[];for(;r;)l.push(um(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return l.push(um(t.slice(i),i>0,!1)),l.join("")}function um(e,t,n){let r=0,i=e.length;if(t){let l=e.codePointAt(r);for(;l===am||l===om;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(i-1);for(;l===am||l===om;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function DE(e,t){const n={type:"text",value:IE(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function zE(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const ME={blockquote:dE,break:hE,code:fE,delete:pE,emphasis:mE,footnoteReference:gE,heading:xE,html:yE,imageReference:vE,image:jE,inlineCode:wE,linkReference:kE,link:bE,listItem:SE,list:CE,paragraph:EE,root:TE,strong:PE,table:RE,tableCell:AE,tableRow:LE,text:DE,thematicBreak:zE,toml:na,yaml:na,definition:na,footnoteDefinition:na};function na(){}const Iv=-1,_o=0,Qi=1,io=2,Oh=3,Fh=4,Uh=5,Bh=6,Dv=7,zv=8,{defineProperty:$E}=Object,Mv=typeof self=="object"?self:globalThis,cm=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Mv[e](t)},_E=(e,t)=>{const n=(i,l)=>(e.set(l,i),i),r=i=>{if(e.has(i))return e.get(i);const[l,a]=t[i];switch(l){case _o:case Iv:return n(a,i);case Qi:{const o=n([],i);for(const u of a)o.push(r(u));return o}case io:{const o=n({},i);for(const[u,c]of a){const h=r(u),d=r(c);h==="__proto__"?$E(o,h,{value:d,configurable:!0,enumerable:!0,writable:!0}):o[h]=d}return o}case Oh:return n(new Date(a),i);case Fh:{const{source:o,flags:u}=a;return n(new RegExp(o,u),i)}case Uh:{const o=n(new Map,i);for(const[u,c]of a)o.set(r(u),r(c));return o}case Bh:{const o=n(new Set,i);for(const u of a)o.add(r(u));return o}case Dv:{const{name:o,message:u}=a;return n(typeof Mv[o]=="function"?cm(o,u):new Error(u),i)}case zv:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}case"-0":return-0}return n(cm(l,a),i)};return r},dm=e=>_E(new Map,e)(0),Wr="",{toString:OE}={},{keys:FE,is:UE}=Object,Ei=e=>{const t=typeof e;if(t!=="object"||!e)return[_o,t];const n=OE.call(e).slice(8,-1);switch(n){case"Array":return[Qi,Wr];case"Object":return[io,Wr];case"Date":return[Oh,Wr];case"RegExp":return[Fh,Wr];case"Map":return[Uh,Wr];case"Set":return[Bh,Wr];case"DataView":return[Qi,n]}return n.includes("Array")?[Qi,n]:e instanceof Error?[Dv,e.name||"Error"]:[io,n]},ra=([e,t])=>e===_o&&(t==="function"||t==="symbol"),BE=(e,t,n,r)=>{const i=(a,o)=>{const u=r.push(a)-1;return n.set(o,u),u},l=a=>{if(n.has(a))return n.get(a);let[o,u]=Ei(a);switch(o){case _o:{let h=a;switch(u){case"bigint":o=zv,h=a.toString();break;case"number":if(!a&&UE(a,-0))return r.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);h=null;break;case"undefined":return i([Iv],a)}return i([o,h],a)}case Qi:{if(u){let f=a;return u==="DataView"?f=new Uint8Array(a.buffer):u==="ArrayBuffer"&&(f=new Uint8Array(a)),i([u,[...f]],a)}const h=[],d=i([o,h],a);for(const f of a)h.push(l(f));return d}case io:{if(u)switch(u){case"BigInt":return i([u,a.toString()],a);case"Boolean":case"Number":case"String":return i([u,a.valueOf()],a)}if(t&&"toJSON"in a)return l(a.toJSON());const h=[],d=i([o,h],a);for(const f of FE(a))(e||!ra(Ei(a[f])))&&h.push([l(f),l(a[f])]);return d}case Oh:return i([o,isNaN(a.getTime())?Wr:a.toISOString()],a);case Fh:{const{source:h,flags:d}=a;return i([o,{source:h,flags:d}],a)}case Uh:{const h=[],d=i([o,h],a);for(const[f,m]of a)(e||!(ra(Ei(f))||ra(Ei(m))))&&h.push([l(f),l(m)]);return d}case Bh:{const h=[],d=i([o,h],a);for(const f of a)(e||!ra(Ei(f)))&&h.push(l(f));return d}}const{message:c}=a;return i([o,{name:u,message:c}],a)};return l},hm=(e,{json:t,lossy:n}={})=>{const r=[];return BE(!(t||n),!!t,new Map,r)(e),r},lo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?dm(hm(e,t)):structuredClone(e):(e,t)=>dm(hm(e,t));function HE(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function WE(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function VE(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||HE,r=e.options.footnoteBackLabel||WE,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[],u=[];let c=-1;for(;++c<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[c]);h&&(o[c]=e.all(h))}for(c=-1;++c<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[c]);if(!h)continue;const d=o[c],f=String(h.identifier).toUpperCase(),m=ui(f.toLowerCase());let p=0;const g=[],w=e.footnoteCounts.get(f);for(;w!==void 0&&++p<=w;){g.length>0&&g.push({type:"text",value:" "});let v=typeof n=="string"?n:n(c,p);typeof v=="string"&&(v={type:"text",value:v}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,p),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const y=d[d.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const v=y.children[y.children.length-1];v&&v.type==="text"?v.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...g)}else d.push(...g);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(d,!0)};e.patch(h,x),u.push(x)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...lo(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
368
368
  `},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
369
- `}]}}const _o=function(e){if(e==null)return WE;if(typeof e=="function")return Oo(e);if(typeof e=="object")return Array.isArray(e)?UE(e):BE(e);if(typeof e=="string")return HE(e);throw new Error("Expected function, string, or object as test")};function UE(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=_o(e[n]);return Oo(r);function r(...i){let l=-1;for(;++l<t.length;)if(t[l].apply(this,i))return!0;return!1}}function BE(e){const t=e;return Oo(n);function n(r){const i=r;let l;for(l in e)if(i[l]!==t[l])return!1;return!0}}function HE(e){return Oo(t);function t(n){return n&&n.type===e}}function Oo(e){return t;function t(n,r,i){return!!(VE(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function WE(){return!0}function VE(e){return e!==null&&typeof e=="object"&&"type"in e}const Dv=[],QE=!0,qi=!1,nd="skip";function rd(e,t,n,r){if(!e||typeof e!="object")throw new Error("Unexpected value `"+e+"` for `tree`, expected node");let i=!0,l,a,o,u;if(typeof n=="function"||n&&typeof n=="object"?(l=t,a=n,r&&(i=!1)):(a=t,n&&(i=!1)),typeof a=="function")o=a;else if(a&&typeof a=="object"){if(!(a.enter===null||a.enter===void 0))if(typeof a.enter=="function")o=a.enter;else throw new Error("Unexpected value `"+a.enter+"` for `visitors.enter`, expected optional visitor");if(typeof a.exit=="function")u=a.exit;else throw new Error("Unexpected value `"+a.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw new Error("Unexpected value `"+a+"` for `enter` or `visitors`, expected visitor or object with visitors");const c=_o(l),h=i?1:-1;d(e,void 0,[])();function d(f,m,p){const g=f&&typeof f=="object"?f:{};if(typeof g.type=="string"){const y=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(w,"name",{value:"node ("+(f.type+(y?"<"+y+">":""))+")"})}return w;function w(){const y=!l||c(f,m,p[p.length-1]||void 0);let x=Dv;if(o&&y&&(x=dm(o(f,p,m)),x[0]===qi))return x;if("children"in f&&f.children){const v=f;if(v.children&&x[0]!==nd){let b=(i?-1:v.children.length)+h;const A=[...p,v];for(;b>-1&&b<v.children.length;){const k=v.children[b],E=d(k,b,A)();if(E[0]===qi)return E;b=typeof E[1]=="number"?E[1]:b+h}}}if(u&&y){const v=dm(u(f,p,m));if(v[0]===nd)throw new Error("Unexpected value `"+v[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(v[0]===qi||typeof v[1]=="number")return v}return x}}}function dm(e){return Array.isArray(e)?e:typeof e=="number"?[QE,e]:e==null?Dv:[e]}function Fo(e,t,n,r){let i,l,a;l=t,a=n,typeof l=="function"?rd(e,i,sd(l),a):rd(e,i,qE(l),a)}function qE(e){return!e||typeof e!="object"?e:{enter:typeof e.enter=="function"?sd(e.enter):e.enter,exit:typeof e.exit=="function"?sd(e.exit):e.exit}}function sd(e){return t;function t(n,r,i){return e(n,i,r[r.length-1])}}const id={}.hasOwnProperty,GE={};function KE(e,t){const n=t||GE,r=new Map,i=new Map,l=new Map,a={...LE,...n.handlers},o={all:c,applyData:JE,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:a,one:u,options:n,patch:YE,wrap:ZE};return Fo(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const d=String(h.identifier).toUpperCase();h.type==="definition"?r.has(d)||r.set(d,h):i.has(d)||i.set(d,h)}}),o;function u(h,d){const{type:f}=h,m=o.handlers[f];if(id.call(o.handlers,f)&&m)return m(o,h,d);if(o.options.passThrough&&o.options.passThrough.includes(f)){if("children"in h){const{children:g,...w}=h;return{...lo(w),children:o.all(h)}}return lo(h)}return(o.options.unknownHandler||XE)(o,h,d)}function c(h){const d=[];if("children"in h){const f=h.children;let m=-1;for(;++m<f.length;){const p=o.one(f[m],h);if(p){if(m&&f[m-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=hm(p.value)),!Array.isArray(p)&&p.type==="element")){const g=p.children[0];g&&g.type==="text"&&(g.value=hm(g.value))}Array.isArray(p)?d.push(...p):d.push(p)}}}return d}}function YE(e,t){e.position&&(t.position=OS(e))}function JE(e,t){let n=t;if(e&&e.data){const{hChildren:r,hName:i,hProperties:l}=e.data;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const a="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:a}}n.type==="element"&&l&&Object.assign(n.properties,lo(l)),"children"in n&&n.children&&r!==null&&r!==void 0&&(n.children=r)}return n}function XE(e,t){const n=t.data||{},r="value"in t&&!(id.call(n,"hProperties")||id.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ZE(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
369
+ `}]}}const Oo=function(e){if(e==null)return KE;if(typeof e=="function")return Fo(e);if(typeof e=="object")return Array.isArray(e)?QE(e):qE(e);if(typeof e=="string")return GE(e);throw new Error("Expected function, string, or object as test")};function QE(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Oo(e[n]);return Fo(r);function r(...i){let l=-1;for(;++l<t.length;)if(t[l].apply(this,i))return!0;return!1}}function qE(e){const t=e;return Fo(n);function n(r){const i=r;let l;for(l in e)if(i[l]!==t[l])return!1;return!0}}function GE(e){return Fo(t);function t(n){return n&&n.type===e}}function Fo(e){return t;function t(n,r,i){return!!(YE(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function KE(){return!0}function YE(e){return e!==null&&typeof e=="object"&&"type"in e}const $v=[],JE=!0,qi=!1,rd="skip";function sd(e,t,n,r){if(!e||typeof e!="object")throw new Error("Unexpected value `"+e+"` for `tree`, expected node");let i=!0,l,a,o,u;if(typeof n=="function"||n&&typeof n=="object"?(l=t,a=n,r&&(i=!1)):(a=t,n&&(i=!1)),typeof a=="function")o=a;else if(a&&typeof a=="object"){if(!(a.enter===null||a.enter===void 0))if(typeof a.enter=="function")o=a.enter;else throw new Error("Unexpected value `"+a.enter+"` for `visitors.enter`, expected optional visitor");if(typeof a.exit=="function")u=a.exit;else throw new Error("Unexpected value `"+a.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw new Error("Unexpected value `"+a+"` for `enter` or `visitors`, expected visitor or object with visitors");const c=Oo(l),h=i?1:-1;d(e,void 0,[])();function d(f,m,p){const g=f&&typeof f=="object"?f:{};if(typeof g.type=="string"){const y=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(w,"name",{value:"node ("+(f.type+(y?"<"+y+">":""))+")"})}return w;function w(){const y=!l||c(f,m,p[p.length-1]||void 0);let x=$v;if(o&&y&&(x=fm(o(f,p,m)),x[0]===qi))return x;if("children"in f&&f.children){const v=f;if(v.children&&x[0]!==rd){let b=(i?-1:v.children.length)+h;const A=[...p,v];for(;b>-1&&b<v.children.length;){const k=v.children[b],E=d(k,b,A)();if(E[0]===qi)return E;b=typeof E[1]=="number"?E[1]:b+h}}}if(u&&y){const v=fm(u(f,p,m));if(v[0]===rd)throw new Error("Unexpected value `"+v[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(v[0]===qi||typeof v[1]=="number")return v}return x}}}function fm(e){return Array.isArray(e)?e:typeof e=="number"?[JE,e]:e==null?$v:[e]}function Uo(e,t,n,r){let i,l,a;l=t,a=n,typeof l=="function"?sd(e,i,id(l),a):sd(e,i,XE(l),a)}function XE(e){return!e||typeof e!="object"?e:{enter:typeof e.enter=="function"?id(e.enter):e.enter,exit:typeof e.exit=="function"?id(e.exit):e.exit}}function id(e){return t;function t(n,r,i){return e(n,i,r[r.length-1])}}const ld={}.hasOwnProperty,ZE={};function eT(e,t){const n=t||ZE,r=new Map,i=new Map,l=new Map,a={...ME,...n.handlers},o={all:c,applyData:nT,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:a,one:u,options:n,patch:tT,wrap:sT};return Uo(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const d=String(h.identifier).toUpperCase();h.type==="definition"?r.has(d)||r.set(d,h):i.has(d)||i.set(d,h)}}),o;function u(h,d){const{type:f}=h,m=o.handlers[f];if(ld.call(o.handlers,f)&&m)return m(o,h,d);if(o.options.passThrough&&o.options.passThrough.includes(f)){if("children"in h){const{children:g,...w}=h;return{...lo(w),children:o.all(h)}}return lo(h)}return(o.options.unknownHandler||rT)(o,h,d)}function c(h){const d=[];if("children"in h){const f=h.children;let m=-1;for(;++m<f.length;){const p=o.one(f[m],h);if(p){if(m&&f[m-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=pm(p.value)),!Array.isArray(p)&&p.type==="element")){const g=p.children[0];g&&g.type==="text"&&(g.value=pm(g.value))}Array.isArray(p)?d.push(...p):d.push(p)}}}return d}}function tT(e,t){e.position&&(t.position=WS(e))}function nT(e,t){let n=t;if(e&&e.data){const{hChildren:r,hName:i,hProperties:l}=e.data;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const a="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:a}}n.type==="element"&&l&&Object.assign(n.properties,lo(l)),"children"in n&&n.children&&r!==null&&r!==void 0&&(n.children=r)}return n}function rT(e,t){const n=t.data||{},r="value"in t&&!(ld.call(n,"hProperties")||ld.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function sT(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
370
370
  `});++r<e.length;)r&&n.push({type:"text",value:`
371
371
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
372
- `}),n}function hm(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function fm(e,t){const n=KE(e,t),r=n.one(e,void 0),i=FE(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
373
- `},i),l}function eT(e,t){return e&&"run"in e?async function(n,r){const i=fm(n,{file:r,...t});await e.run(i,r)}:function(n,r){return fm(n,{file:r,...e||t})}}function pm(e){if(e)throw e}var Ca=Object.prototype.hasOwnProperty,zv=Object.prototype.toString,mm=Object.defineProperty,gm=Object.getOwnPropertyDescriptor,xm=function(t){return typeof Array.isArray=="function"?Array.isArray(t):zv.call(t)==="[object Array]"},ym=function(t){if(!t||zv.call(t)!=="[object Object]")return!1;var n=Ca.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ca.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Ca.call(t,i)},vm=function(t,n){mm&&n.name==="__proto__"?mm(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},jm=function(t,n){if(n==="__proto__")if(Ca.call(t,n)){if(gm)return gm(t,n).value}else return;return t[n]},tT=function e(){var t,n,r,i,l,a,o=arguments[0],u=1,c=arguments.length,h=!1;for(typeof o=="boolean"&&(h=o,o=arguments[1]||{},u=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});u<c;++u)if(t=arguments[u],t!=null)for(n in t)r=jm(o,n),i=jm(t,n),o!==i&&(h&&i&&(ym(i)||(l=xm(i)))?(l?(l=!1,a=r&&xm(r)?r:[]):a=r&&ym(r)?r:{},vm(o,{name:n,newValue:e(h,a,i)})):typeof i<"u"&&vm(o,{name:n,newValue:i}));return o};const Tu=md(tT);function ld(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function nT(){const e=[],t={run:n,use:r};return t;function n(...i){let l=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(u,...c){const h=e[++l];let d=-1;if(u){a(u);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,h?rT(h,o)(...c):a(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function rT(e,t){let n;return r;function r(...a){const o=e.length>a.length;let u;o&&a.push(i);try{u=e.apply(this,a)}catch(c){const h=c;if(o&&n)throw h;return i(h)}o||(u&&u.then&&typeof u.then=="function"?u.then(l,i):u instanceof Error?i(u):l(u))}function i(a,...o){n||(n=!0,t(a,...o))}function l(a){i(null,a)}}const En={basename:sT,dirname:iT,extname:lT,join:aT,sep:"/"};function sT(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');El(e);let n=0,r=-1,i=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else a<0&&(l=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function iT(e){if(El(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function lT(e){El(e);let t=e.length,n=-1,r=0,i=-1,l=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?i<0?i=t:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||n<0||l===0||l===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function aT(...e){let t=-1,n;for(;++t<e.length;)El(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":oT(n)}function oT(e){El(e);const t=e.codePointAt(0)===47;let n=uT(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function uT(e,t){let n="",r=0,i=-1,l=0,a=-1,o,u;for(;++a<=e.length;){if(a<e.length)o=e.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||l===1))if(i!==a-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=a,l=0;continue}}else if(n.length>0){n="",r=0,i=a,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,l=0}else o===46&&l>-1?l++:l=-1}return n}function El(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const cT={cwd:dT};function dT(){return"/"}function ad(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function hT(e){if(typeof e=="string")e=new URL(e);else if(!ad(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return fT(e)}function fT(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Pu=["history","path","basename","stem","extname","dirname"];class Mv{constructor(t){let n;t?ad(t)?n={path:t}:typeof t=="string"||pT(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":cT.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Pu.length;){const l=Pu[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let i;for(i in n)Pu.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?En.basename(this.path):void 0}set basename(t){Lu(t,"basename"),Ru(t,"basename"),this.path=En.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?En.dirname(this.path):void 0}set dirname(t){wm(this.basename,"dirname"),this.path=En.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?En.extname(this.path):void 0}set extname(t){if(Ru(t,"extname"),wm(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=En.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ad(t)&&(t=hT(t)),Lu(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?En.basename(this.path,this.extname):void 0}set stem(t){Lu(t,"stem"),Ru(t,"stem"),this.path=En.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Do(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Ru(e,t){if(e&&e.includes(En.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+En.sep+"`")}function Lu(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function wm(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function pT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mT=function(e){const r=this.constructor.prototype,i=r[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l},gT={}.hasOwnProperty;class Hh extends mT{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=nT()}copy(){const t=new Hh;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Tu(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Du("data",this.frozen),this.namespace[t]=n,this):gT.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Du("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=sa(t),r=this.parser||this.Parser;return Au("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Au("process",this.parser||this.Parser),Iu("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(l,a){const o=sa(t),u=r.parse(o);r.run(u,o,function(h,d,f){if(h||!d||!f)return c(h);const m=d,p=r.stringify(m,f);vT(p)?f.value=p:f.result=p,c(h,f)});function c(h,d){h||!d?a(h):l?l(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Au("processSync",this.parser||this.Parser),Iu("processSync",this.compiler||this.Compiler),this.process(t,i),bm("processSync","process",n),r;function i(l,a){n=!0,pm(l),r=a}}run(t,n,r){km(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(a,o){const u=sa(n);i.run(t,u,c);function c(h,d,f){const m=d||t;h?o(h):a?a(m):r(void 0,m,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,l),bm("runSync","run",r),i;function l(a,o){pm(a),i=o,r=!0}}stringify(t,n){this.freeze();const r=sa(n),i=this.compiler||this.Compiler;return Iu("stringify",i),km(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Du("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(c){if(typeof c=="function")u(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[h,...d]=c;u(h,d)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(c.plugins),c.settings&&(i.settings=Tu(!0,i.settings,c.settings))}function o(c){let h=-1;if(c!=null)if(Array.isArray(c))for(;++h<c.length;){const d=c[h];l(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function u(c,h){let d=-1,f=-1;for(;++d<r.length;)if(r[d][0]===c){f=d;break}if(f===-1)r.push([c,...h]);else if(h.length>0){let[m,...p]=h;const g=r[f][1];ld(g)&&ld(m)&&(m=Tu(!0,g,m)),r[f]=[c,m,...p]}}}}const xT=new Hh().freeze();function Au(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Iu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Du(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function km(e){if(!ld(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function bm(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function sa(e){return yT(e)?e:new Mv(e)}function yT(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function vT(e){return typeof e=="string"||jT(e)}function jT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const wT="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Sm=[],Nm={allowDangerousHtml:!0},kT=/^(https?|ircs?|mailto|xmpp)$/i,bT=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function ui(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,l=e.components,a=e.disallowedElements,o=e.rehypePlugins||Sm,u=e.remarkPlugins||Sm,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Nm}:Nm,h=e.skipHtml,d=e.unwrapDisallowed,f=e.urlTransform||ST,m=xT().use(iE).use(u).use(eT,c).use(o),p=new Mv;typeof r=="string"&&(p.value=r);for(const x of bT)Object.hasOwn(e,x.from)&&(""+x.from+(x.to?"use `"+x.to+"` instead":"remove it")+wT+x.id,void 0);const g=m.parse(p);let w=m.runSync(g,p);return i&&(w={type:"element",tagName:"div",properties:{className:i},children:w.type==="root"?w.children:[w]}),Fo(w,y),VS(w,{Fragment:s.Fragment,components:l,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function y(x,v,b){if(x.type==="raw"&&b&&typeof v=="number")return h?b.children.splice(v,1):b.children[v]={type:"text",value:x.value},v;if(x.type==="element"){let A;for(A in Nu)if(Object.hasOwn(Nu,A)&&Object.hasOwn(x.properties,A)){const k=x.properties[A],E=Nu[A];(E===null||E.includes(x.tagName))&&(x.properties[A]=f(String(k||""),A,x))}}if(x.type==="element"){let A=t?!t.includes(x.tagName):a?a.includes(x.tagName):!1;if(!A&&n&&typeof v=="number"&&(A=!n(x,v,b)),A&&b&&typeof v=="number")return d&&x.children?b.children.splice(v,1,...x.children):b.children.splice(v,1),v}}}function ST(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||kT.test(e.slice(0,t))?e:""}function NT(e,t){if(t<=7)return Array.from({length:t},(l,a)=>a+1);const n=[1],r=Math.max(2,e-1),i=Math.min(t-1,e+1);r>2&&n.push("…");for(let l=r;l<=i;l++)n.push(l);return i<t-1&&n.push("…"),n.push(t),n}function ps({page:e,pageSize:t,total:n,onPage:r,onPageSize:i,label:l="rows"}){const a=Math.max(1,Math.ceil(n/t)),o=n?(e-1)*t+1:0,u=Math.min(e*t,n);return s.jsxs("div",{className:"pagination",children:[s.jsx("span",{className:"muted small",children:n?`Showing ${o}–${u} of ${n} ${l}`:`0 ${l}`}),s.jsx("div",{className:"grow"}),s.jsxs("label",{className:"row small muted",style:{gap:6},children:["Rows per page",s.jsx("select",{className:"select sm",value:t,onChange:c=>i(Number(c.target.value)),"aria-label":"Rows per page",children:Nb.map(c=>s.jsx("option",{value:c,children:c},c))})]}),s.jsxs("nav",{className:"pager","aria-label":"Pagination",children:[s.jsx("button",{className:"pg-btn",onClick:()=>r(e-1),disabled:e<=1,"aria-label":"Previous page",children:s.jsx("span",{style:{display:"inline-flex",transform:"rotate(180deg)"},children:s.jsx(ti,{size:14})})}),NT(e,a).map((c,h)=>c==="…"?s.jsx("span",{className:"pg-gap",children:"…"},`e${h}`):s.jsx("button",{className:`pg-btn ${c===e?"active":""}`,onClick:()=>r(c),"aria-current":c===e?"page":void 0,children:c},c)),s.jsx("button",{className:"pg-btn",onClick:()=>r(e+1),disabled:e>=a,"aria-label":"Next page",children:s.jsx(ti,{size:14})})]})]})}function Tl(e=[],t=Fy){const[n,r]=j.useState(1),[i,l]=j.useState(t);return j.useEffect(()=>r(1),e),{page:n,setPage:r,pageSize:i,setPageSize:o=>{l(o),r(1)}}}function Wh(e,t=[],n=Fy){const r=Tl(t,n),i=Math.max(1,Math.ceil(e.length/r.pageSize)),l=Math.min(r.page,i);return{pageItems:j.useMemo(()=>e.slice((l-1)*r.pageSize,l*r.pageSize),[e,l,r.pageSize]),props:{page:l,pageSize:r.pageSize,total:e.length,onPage:r.setPage,onPageSize:r.setPageSize}}}const Pl=(e,t)=>{var r;const n=bl(e);return n?((r=t.find(i=>i.id===n))==null?void 0:r.name)??`${e} (deleted)`:Ne[e].label},Vh=e=>bl(e)?"custom":e,CT={pending:"not started",running:"running",passed:"passed",out:"out of iterations",stopped:"stopped"};function ET({nodes:e,agents:t,selected:n,onSelect:r,waitingRunId:i,finished:l}){const a=u=>{if(u.kind==="agent")return s.jsx($v,{node:u,label:Pl(u.ref,t),selected:n,onSelect:r,waitingRunId:i??null,finished:l},u.key);const c=u.passes.reduce((d,f)=>d+f,0),h=u.passes.length>1?`${u.passes.join(" + ")} iterations (one number per pass of the outer loop)`:`${c} iteration${c===1?"":"s"}`;return s.jsxs("div",{className:`ptl-loop ${u.state}`,children:[s.jsxs("div",{className:"ptl-loop-head",children:[s.jsx(ls,{size:13}),s.jsxs("b",{children:["Loop ×",u.step.maxIterations]}),s.jsxs("span",{className:"muted",children:["· until ",u.step.endsWhen==="last"?"last":"first"," passes"]}),s.jsx("span",{className:`ptl-state ${u.state}`,children:CT[u.state]})]}),s.jsx("div",{className:"ptl-row",children:u.children.map((d,f)=>o(d,f))}),s.jsx("div",{className:`ptl-return ${c?"":"idle"}`,title:`Ran ${h}; at most ${u.step.maxIterations} per pass`,children:s.jsxs("span",{children:["↺ ×",c]})})]},u.key)},o=(u,c)=>s.jsxs(j.Fragment,{children:[c>0&&s.jsx("span",{className:"ptl-arrow","aria-hidden":"true",children:"→"}),a(u)]},u.key);return s.jsx("div",{className:"ptl",role:"tablist","aria-label":"Agents",children:e.map((u,c)=>o(u,c))})}function $v({node:e,label:t,selected:n,onSelect:r,waitingRunId:i,finished:l}){const{runs:a}=e;if(!a.length)return s.jsxs("div",{className:"ptl-node ghost","aria-disabled":"true",title:l?"Skipped":"Not run yet",children:[s.jsx(Ft,{agent:Vh(e.ref),size:22}),s.jsx("span",{className:"ptl-name",children:t}),s.jsx("span",{className:`ptl-dot ${l?"skipped":"pending"}`})]});const o=a[a.length-1],u=a.some(h=>h.id===n),c=a.some(h=>h.id===i);return s.jsxs("div",{className:`ptl-node ${o.status} ${u?"selected":""} ${c?"waiting":""}`,children:[s.jsxs("button",{role:"tab","aria-selected":u,className:"ptl-main",onClick:()=>r((a.find(h=>h.id===n)??o).id),title:`${t} · ${a.length} run${a.length>1?"s":""}`,children:[s.jsx(Ft,{agent:o.agent,size:22}),s.jsx("span",{className:"ptl-name",children:t}),a.length>1&&s.jsxs("span",{className:"ptl-count",children:["×",a.length]})]}),s.jsx("span",{className:"ptl-runs",children:a.map((h,d)=>s.jsx("button",{type:"button",className:`ptl-dot ${h.id===i?"waiting":h.status} ${h.id===n?"on":""}`,onClick:()=>r(h.id),title:TT(h,t,d+1),"aria-label":`${t} run ${d+1}: ${h.status}`},h.id))}),a.length===1&&s.jsx("span",{className:"ptl-time",children:br(o.startedAt,o.finishedAt)})]})}function TT(e,t,n){const r=e.usage;return[`${t} #${n}: ${e.status}`,br(e.startedAt,e.finishedAt),e.turns!==null?`${e.turns} turns`:null,e.costUsd!==null?Kt(e.costUsd):null,r?`${sn(r.inputTokens+r.cacheReadTokens+r.cacheWriteTokens)} in / ${sn(r.outputTokens)} out`:null].filter(Boolean).join(" · ")}class Cm extends Error{}const PT=e=>e.ref??e.agent;function RT(e){return e.status==="passed"?!0:e.agent==="explorer"&&e.status==="failed"&&e.output!==null&&e.output!==void 0}function bs(e,t){return e.kind==="agent"?{kind:"ghost",key:t,ref:e.agent}:{kind:"loop",key:t,step:e,state:"pending",iterations:[e.steps.map((n,r)=>bs(ds(n),`${t}.${r}`))]}}function LT(e,t){let n=0;const r=(a,o)=>{const u=t[n];if(!u)return{node:{kind:"ghost",key:o,ref:a},flow:"open"};if(PT(u)!==a)throw new Cm;n++;const c=u.status!=="running"&&u.status!=="pending";return{node:{kind:"run",key:o,run:u},flow:c?RT(u)?"ok":"fail":"open"}},i=(a,o)=>a.kind==="agent"?r(a.agent,o):l(a,o),l=(a,o)=>{const u=a.steps.map(ds),c=a.endsWhen==="last",h=[],d=f=>({kind:"loop",key:o,step:a,iterations:h,state:f});if(n>=t.length)return{node:bs(a,o),flow:"open"};for(let f=0;f<a.maxIterations;f++){const m=[];h.push(m);const p=`${o}i${f}`,g=y=>u.slice(y).forEach((x,v)=>m.push(bs(x,`${p}.${y+v}`)));if(c){for(let y=0;y<u.length;y++){const x=i(u[y],`${p}.${y}`);if(m.push(x.node),x.flow==="open")return g(y+1),{node:d("running"),flow:"open"};if(x.flow==="stop")return{node:d("stopped"),flow:"stop"};const v=y===u.length-1;if(v&&x.flow==="ok")return{node:d("passed"),flow:"ok"};if(!v&&x.flow==="fail")return{node:d("stopped"),flow:"stop"}}if(f<a.maxIterations-1&&n>=t.length)return h.push(u.map((y,x)=>bs(y,`${o}i${f+1}.${x}`))),{node:d("running"),flow:"open"};continue}const w=i(u[0],`${p}.0`);if(m.push(w.node),w.flow==="open")return{node:d("running"),flow:"open"};if(w.flow==="stop")return{node:d("stopped"),flow:"stop"};if(w.flow==="ok")return{node:d("passed"),flow:"ok"};if(f===a.maxIterations-1)break;for(let y=1;y<u.length;y++){const x=i(u[y],`${p}.${y}`);if(m.push(x.node),x.flow==="open")return g(y+1),{node:d("running"),flow:"open"};if(x.flow!=="ok")return{node:d("stopped"),flow:"stop"}}if(n>=t.length)return h.push([bs(u[0],`${o}i${f+1}.0`)]),{node:d("running"),flow:"open"}}return{node:d("out"),flow:"fail"}};try{const a=[];let o=!1;return e.forEach((u,c)=>{if(o){a.push(bs(u,`b${c}`));return}const h=i(u,`b${c}`);a.push(h.node),h.flow!=="ok"&&(o=!0)}),n===t.length?a:null}catch(a){if(a instanceof Cm)return null;throw a}}const _v=e=>e.some(t=>t.kind==="run"||t.kind==="loop"&&t.iterations.some(_v));function Ov(e){const t=e[0];if(t.kind!=="loop"){const a=t.kind==="run"?t.run.ref??t.run.agent:t.ref;return{kind:"agent",key:t.key,ref:a,runs:e.flatMap(o=>o.kind==="run"?[o.run]:[])}}const n=e.filter(a=>a.kind==="loop"),r=t.step.steps.length,i=[];for(let a=0;a<r;a++){const o=n.flatMap(u=>u.iterations.flatMap(c=>c[a]?[c[a]]:[]));o.length&&i.push(Ov(o))}const l=n[n.length-1];return{kind:"loop",key:t.key,step:t.step,state:l.state,passes:n.map(a=>a.iterations.filter(_v).length),children:i}}function AT(e){return e.map(t=>Ov([t]))}const IT=["Read(.env)","Read(**/.env)","Read(.env.local)","Read(**/.env.local)","WebFetch","WebSearch"];function DT(e,t){const n=Ao[e].filter(i=>!ao(e)||!Eh.includes(i));let r=0;for(const i of t)i.agent===n[r]&&r++;return n.slice(r)}function zT(e,t){const n=o=>o.ref??o.agent,r=(o,u)=>({kind:"agent",key:u,agent:Vh(o),name:Pl(o,e.agents),description:o.startsWith("custom:")?"Custom agent":Ne[o].description}),i=(o,u)=>o.kind==="agent"?r(o.agent,u):{kind:"loop",key:u,maxIterations:o.maxIterations,items:o.steps.map((c,h)=>i(ds(c),`${u}-${h}`))},l=[];let a=0;return e.pipeline.steps.forEach((o,u)=>{if(o.kind==="agent"){a<t.length?a++:l.push(i(o,`s${u}`));return}if(a<t.length){const c=new Set(Io([o]));for(;a<t.length&&c.has(n(t[a]));)a++;return}l.push(i(o,`s${u}`))}),l}const ao=e=>e==="generate"||e==="heal";function MT(e,t){if(!ao(e.type))return{linear:t,loop:[]};const n=t.findIndex(r=>Eh.includes(r.agent));return n<0?{linear:t,loop:[]}:{linear:t.slice(0,n),loop:t.slice(n)}}function Em(e,t){const n=t.filter(i=>i.agent===e.agent&&i.label===e.label),r=qy(e);return n.length>1?`${r} #${n.indexOf(e)+1}`:r}function $T(){var tt;const e=Number(li().id),t=ut(),[n]=yh(),r=n.get("result")?Number(n.get("result")):null,{refresh:i}=un(),{job:l,runs:a,results:o,pipeline:u,pending:c,logs:h,error:d,refetch:f,reconnect:m}=sb(e),p=(l==null?void 0:l.status)==="waiting"?c:null,[g,w]=j.useState(null),y=j.useRef(!1),x=j.useRef(!1),[v,b]=j.useState(null);if(j.useEffect(()=>{if(y.current||a.length===0)return;const W=a.find(ge=>ge.status==="running");w((W??a[a.length-1]).id)},[a]),j.useEffect(()=>{if(x.current||!r||o.length===0)return;const W=o.find(ge=>ge.id===r);W!=null&&W.agentRunId&&(y.current=!0,x.current=!0,w(W.agentRunId))},[r,o]),j.useEffect(()=>{p&&(y.current=!0,w(p.runId))},[p==null?void 0:p.runId]),j.useEffect(()=>{l&&Hc.includes(l.status)&&i()},[l==null?void 0:l.status]),!Number.isInteger(e)||e<=0)return s.jsx(Le,{error:"Invalid job id"});const A=a.find(W=>W.id===g)??null,k=l&&l.type in Ao?DT(l.type,a):[],E=l?Hc.includes(l.status):!1,T=(l==null?void 0:l.type)==="pipeline"&&u?LT(u.pipeline.steps,a):null,I=(l==null?void 0:l.type)==="pipeline"&&u&&!T?zT(u,a):[],C=(l==null?void 0:l.args.maxHealRounds)??Cb.maxHealRounds,{linear:R,loop:L}=l?MT(l,a):{linear:a,loop:[]},M=L.filter(W=>W.agent==="healer").length,U=(l==null?void 0:l.type)==="heal"?["healer","validator"]:["validator","healer"],D=L[L.length-1],q=D?E?D.agent==="validator"&&D.status==="passed"?"passed":M>=C?"out":"stopped":"running":"pending",J=W=>{y.current=!0,w(W)},B=W=>s.jsx(UT,{run:W,label:Em(W,a),selected:g===W.id,waiting:(p==null?void 0:p.runId)===W.id,onSelect:()=>J(W.id)},W.id),X=(W,ge,V,de,ve)=>s.jsx(BT,{agent:W,finished:E,note:V,name:de,description:ve},ge),S=W=>W.kind==="agent"?X(W.agent,W.key,void 0,W.name,W.description):s.jsxs("div",{className:"loop-group idle","aria-label":`Loop ×${W.maxIterations}`,children:[s.jsxs("div",{className:"loop-head",children:[s.jsx(ls,{size:14}),s.jsxs("span",{children:["Loop ×",W.maxIterations]})]}),s.jsx("div",{className:"loop-body",children:W.items.map((ge,V)=>s.jsxs(j.Fragment,{children:[V>0&&s.jsx("span",{className:"connector"}),S(ge)]},ge.key))})]},W.key),ae=a.some(W=>{var ge;return W.agent==="runner"&&((ge=W.output)==null?void 0:ge.htmlReport)}),O=async W=>{if(!l)return;const ge=o.filter(ve=>(ve.status==="failed"||ve.status==="flaky")&&ve.specFile&&ve.tcId).map(ve=>({spec:ve.specFile,tcId:ve.tcId})),V=`${l.args.name??`Test run #${l.id}`} (${W?"failed re-run":"re-run"})`;if(!l.args.selection&&!W){try{const ve=await Q.createJob({type:"testrun",name:V,...l.target!=="all"?{spec:l.target}:{},...l.args.tcId?{tcId:l.args.tcId}:{},repeatEach:l.args.repeatEach??1,...l.args.retries!==void 0?{retries:l.args.retries}:{},htmlReport:l.args.htmlReport});t(`/runs/${ve.id}`)}catch(ve){b(ve.message)}return}let de=l.args.selection??ge;if(W){const ve=new Set(ge.map(ct=>`${ct.spec}#${ct.tcId}`));de=de.filter(ct=>ve.has(`${ct.spec}#${ct.tcId}`))}de=[...new Map(de.map(ve=>[`${ve.spec}#${ve.tcId}`,ve])).values()],t("/test-runs/new",{state:{name:V,selection:de,retries:l.args.retries}})},N=o.some(W=>W.status==="failed"||W.status==="flaky"),F=async()=>{b(null);try{await Q.rerunFailedJob(e),m()}catch(W){b(W.message)}},Z=async()=>{try{const W=await Q.createJob({type:"generate",spec:l.target});t(`/runs/${W.id}`)}catch(W){b(W.message)}},ce=l&&(l.type==="testrun"||l.type==="heal"||l.type==="generate")&&E?[...new Set(o.filter(W=>W.status==="failed"&&W.specFile).map(W=>W.specFile))]:[],Te=async W=>{try{const ge=await Q.createJob({type:"heal",spec:W,sourceJobId:e});t(`/runs/${ge.id}`)}catch(ge){b(ge.message)}};return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Testing"},{label:"Recent runs",to:"/runs"},{label:`Job #${e}`}]}),s.jsx(Le,{error:d??v}),l&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"row between",style:{marginBottom:6},children:[s.jsxs("div",{className:"row",children:[s.jsxs("h1",{className:"page-title",children:[Sr[l.type]," ·"," ",l.type==="testrun"?l.args.name:l.type==="context"?s.jsx(ye,{to:"/project",children:"CLAUDE.md"}):l.type==="custom"||l.type==="pipeline"?[l.type==="pipeline"?l.args.pipelineName:l.args.customAgentName,l.target.endsWith(".md")?l.target:null].filter(Boolean).join(" · ")||l.target:l.target.endsWith(".md")?s.jsx(ye,{to:`/specs/${l.target}`,children:l.target}):l.target]}),s.jsx(An,{status:l.status})]}),s.jsxs("div",{className:"row",children:[ae&&s.jsxs("a",{className:"btn ghost",href:vh(e),target:"_blank",rel:"noreferrer",title:"Playwright HTML report (new tab)",children:[s.jsx(Nh,{size:14})," HTML report"]}),l.type==="testrun"&&E&&s.jsxs(s.Fragment,{children:[N&&s.jsxs("button",{className:"btn ghost",onClick:()=>void O(!0),title:"New test run with only the failed test cases",children:[s.jsx(ft,{size:14})," Re-run failed"]}),s.jsxs("button",{className:"btn ghost",onClick:()=>void O(!1),title:"New test run with the same test cases",children:[s.jsx(ft,{size:14})," Re-run"]})]}),(l.type==="pipeline"||l.type==="generate"||l.type==="heal")&&(l.status==="failed"||l.status==="cancelled"||l.status==="interrupted")&&s.jsxs("button",{className:"btn ghost",onClick:()=>void F(),title:"Run this job again from the step that stopped it: the earlier steps are not run again, their outputs are reused",children:[s.jsx(ft,{size:14})," Re-run failed"]}),l.type==="context"&&l.status==="passed"&&s.jsxs(ye,{className:"btn ghost",to:"/project",children:[s.jsx(wr,{size:15})," View CLAUDE.md"]}),l.type==="spec"&&l.status==="passed"&&s.jsxs(s.Fragment,{children:[s.jsxs(ye,{className:"btn ghost",to:`/specs/${l.target}`,children:[s.jsx(wr,{size:15})," Open spec"]}),s.jsxs("button",{className:"btn",onClick:()=>void Z(),title:"QA Explorer → QA Script Generator → QA Validator ⇄ QA Script Healer on the new spec",children:[s.jsx(kh,{size:15})," Generate tests"]})]}),ce.map(W=>s.jsxs("button",{className:"btn",onClick:()=>void Te(W),title:"QA Script Healer fixes the scripts of failing tests, then QA Validator re-runs them",children:[s.jsx(Iy,{size:15})," Heal ",W]},W)),!E&&s.jsxs("button",{className:"btn danger",onClick:()=>void Q.cancelJob(e).catch(W=>b(W.message)),children:[s.jsx(My,{size:14})," Cancel"]})]})]}),s.jsxs("div",{className:"muted small",style:{marginBottom:14},children:["Started ",Rt(l.startedAt??l.createdAt)," · ",br(l.startedAt,l.finishedAt),l.args.tcId&&` · ${l.args.tcId}`,l.args.repeatEach&&` · repeat ${l.args.repeatEach}×`,l.args.retries!==void 0&&` · retries ${l.args.retries}`,l.args.selection&&` · ${l.args.selection.length} test case${l.args.selection.length===1?"":"s"}`,l.type==="testrun"&&(l.args.htmlReport?" · line + HTML report":" · line report"),ao(l.type)&&` · max ${C} heal round${C===1?"":"s"}`,l.args.sourceJobId&&s.jsxs(s.Fragment,{children:[" ","· from ",s.jsxs(ye,{to:`/runs/${l.args.sourceJobId}`,children:["job #",l.args.sourceJobId]})]}),l.summary&&s.jsxs(s.Fragment,{children:[" · ",l.summary]})]}),l.warning&&s.jsxs("div",{className:"warn-box",children:["⚠ ",l.warning]}),T&&u?s.jsx(ET,{nodes:AT(T),agents:u.agents,selected:g,onSelect:J,waitingRunId:(p==null?void 0:p.runId)??null,finished:E}):s.jsxs("div",{className:"timeline",role:"tablist","aria-label":"Agents",children:[R.map((W,ge)=>s.jsxs(j.Fragment,{children:[ge>0&&s.jsx("span",{className:`connector ${R[ge-1].status==="passed"?"done":""}`}),B(W)]},W.id)),k.map((W,ge)=>s.jsxs(j.Fragment,{children:[(R.length>0||ge>0)&&s.jsx("span",{className:"connector"}),X(W,`g-${W}-${ge}`)]},`ghost-${W}-${ge}`)),I.map((W,ge)=>s.jsxs(j.Fragment,{children:[(R.length>0||ge>0)&&s.jsx("span",{className:"connector"}),S(W)]},W.key)),ao(l.type)&&s.jsxs(s.Fragment,{children:[(R.length>0||k.length>0)&&s.jsx("span",{className:`connector ${((tt=R[R.length-1])==null?void 0:tt.status)==="passed"?"done":""}`}),s.jsxs("div",{className:`ptl-loop ${q}`,"aria-label":"Validator and Healer loop",children:[s.jsxs("div",{className:"ptl-loop-head",children:[s.jsx(ls,{size:13}),s.jsx("b",{children:"Validate ⇄ Heal loop"}),s.jsxs("span",{className:"muted",children:["· max ",C]}),s.jsxs("span",{className:`ptl-state ${q}`,title:"Healer rounds used / maximum (Settings)",children:["heal round ",M,"/",C]})]}),s.jsx("div",{className:"ptl-row",children:U.map((W,ge)=>{const V=L.filter(de=>de.agent===W);return s.jsxs(j.Fragment,{children:[ge>0&&s.jsx("span",{className:"ptl-arrow","aria-hidden":"true",children:"→"}),s.jsx($v,{node:{kind:"agent",key:`loop-${W}`,ref:W,runs:V},label:V[0]?qy(V[0]):Ne[W].label,selected:g,onSelect:J,waitingRunId:(p==null?void 0:p.runId)??null,finished:E})]},W)})}),s.jsx("div",{className:`ptl-return ${M?"":"idle"}`,title:`QA Validator fails → QA Script Healer fixes → back to QA Validator. Stops when tests pass, the QA Script Healer reports an app bug or gives up, or after ${C} heal round${C===1?"":"s"}.`,children:s.jsxs("span",{children:["↺ ×",M]})})]})]})]}),p&&s.jsx(FT,{jobId:e,label:p.label,questions:p.questions??[],onDone:()=>void f()},`review-${p.runId}`),A?s.jsx(HT,{jobId:e,job:l,run:A,label:Em(A,a),log:h[A.id]??"",results:o.filter(W=>W.agentRunId===A.id),highlightResultId:r,reviewing:(p==null?void 0:p.runId)===A.id},A.id):s.jsx("div",{className:"card pad muted",children:"Waiting for the first agent to start…"})]})]})}const $s=-1,_T=e=>Object.fromEntries(e.map(t=>[t.id,Math.max(t.options.findIndex(n=>n.recommended),t.options.length?0:$s)]));function OT({questions:e,choice:t,other:n,onChoice:r,onOther:i}){return s.jsx("ol",{className:"question-list",children:e.map(l=>s.jsx("li",{className:"question",children:s.jsxs("fieldset",{children:[s.jsx("legend",{children:l.question}),l.options.map((a,o)=>s.jsxs("label",{className:`question-option ${t[l.id]===o?"on":""}`,children:[s.jsx("input",{type:"radio",name:`q-${l.id}`,checked:t[l.id]===o,onChange:()=>r(l.id,o)}),s.jsxs("span",{children:[s.jsx("b",{children:a.label}),a.recommended&&s.jsx("span",{className:"chip ok small",children:"Recommended"}),a.description&&s.jsx("span",{className:"muted small question-desc",children:a.description})]})]},o)),s.jsxs("label",{className:`question-option ${t[l.id]===$s?"on":""}`,children:[s.jsx("input",{type:"radio",name:`q-${l.id}`,checked:t[l.id]===$s,onChange:()=>r(l.id,$s)}),s.jsxs("span",{className:"question-other",children:[s.jsx("b",{children:"Other"}),s.jsx("input",{className:"input",maxLength:Pb,placeholder:"Type your answer",value:n[l.id]??"",onFocus:()=>r(l.id,$s),onChange:a=>i(l.id,a.target.value),"aria-label":`Other answer to: ${l.question}`})]})]})]})},l.id))})}function FT({jobId:e,label:t,questions:n,onDone:r}){const i=In(),[l,a]=j.useState(()=>_T(n)),[o,u]=j.useState({}),c=n.length>0,h=n.map(v=>{var b;return{id:v.id,answer:l[v.id]===$s?(o[v.id]??"").trim():((b=v.options[l[v.id]])==null?void 0:b.label)??""}}),d=h.filter(v=>!v.answer).length,[f,m]=j.useState(""),[p,g]=j.useState(!1),[w,y]=j.useState(null),x=async v=>{g(!0);try{await v(),r()}catch(b){y(b.message)}finally{g(!1)}};return s.jsxs("div",{className:"review-panel",role:"region","aria-label":"Review",children:[s.jsx("b",{children:c?`${t} has ${n.length} question${n.length>1?"s":""} for you.`:`${t} is waiting for your review.`}),s.jsx("span",{className:"muted small",children:c?`Pick an option or type your own answer. Sending runs ${t} again with your answers. Reject ends the pipeline.`:"Approve to continue the pipeline with this result. Reject ends the pipeline."}),c&&s.jsx(OT,{questions:n,choice:l,other:o,onChoice:(v,b)=>a(A=>({...A,[v]:b})),onOther:(v,b)=>u(A=>({...A,[v]:b}))}),s.jsx("textarea",{className:"input",rows:2,maxLength:Sb,placeholder:"Reason (optional, saved with a rejection)",value:f,onChange:v=>m(v.target.value),"aria-label":"Reject reason"}),s.jsx(Le,{error:w}),s.jsxs("div",{className:"row",style:{justifyContent:"flex-end"},children:[s.jsx("button",{className:"btn danger",disabled:p,onClick:async()=>{await i({title:`Reject the output of ${t}?`,message:"The pipeline ends here and the job is marked failed.",confirmLabel:"Reject",danger:!0})&&await x(()=>Q.rejectJob(e,f.trim()||void 0))},children:"Reject"}),c?s.jsx("button",{className:"btn",disabled:p||d>0,title:d?'Type an answer for every "Other"':void 0,onClick:()=>void x(()=>Q.answerJob(e,h)),children:"Send answers"}):s.jsx("button",{className:"btn",disabled:p,onClick:()=>void x(()=>Q.approveJob(e)),children:"Approve"})]})]})}function UT({run:e,label:t,selected:n,waiting:r,onSelect:i}){const l=e.usage,a=r?"waiting":e.status,o=[`${t}: ${a}`,br(e.startedAt,e.finishedAt),e.turns!==null?`${e.turns} turns`:null,e.costUsd!==null?Kt(e.costUsd):null,l?`${sn(l.inputTokens+l.cacheReadTokens+l.cacheWriteTokens)} in / ${sn(l.outputTokens)} out`:null].filter(Boolean).join(" · ");return s.jsxs("div",{className:`ptl-node ${e.status} ${n?"selected":""} ${r?"waiting":""}`,children:[s.jsxs("button",{role:"tab","aria-selected":n,className:"ptl-main",onClick:i,title:o,children:[s.jsx(Ft,{agent:e.agent,size:22}),s.jsx("span",{className:"ptl-name",children:t}),s.jsx("span",{className:`ptl-dot ${a}`,"aria-label":a})]}),s.jsx("span",{className:"ptl-time",children:br(e.startedAt,e.finishedAt)})]})}function BT({agent:e,finished:t,note:n,name:r,description:i}){const l=r??Ne[e].label;return s.jsxs("div",{className:"ptl-node ghost","aria-disabled":"true",title:`${l}: ${t?"skipped":"not run yet"} · ${n??i??Ne[e].description}`,children:[s.jsx(Ft,{agent:e,size:22}),s.jsx("span",{className:"ptl-name",children:l}),s.jsx("span",{className:`ptl-dot ${t?"skipped":"pending"}`})]})}function HT({jobId:e,job:t,run:n,label:r,log:i,results:l,highlightResultId:a,reviewing:o}){const u=!!a&&l.some(y=>y.id===a),[c,h]=j.useState(u||o?"output":"log");j.useEffect(()=>{o&&h("output")},[o]);const[d,f]=j.useState(null),m=j.useRef(null),p=j.useRef(!0),g=!["running","pending"].includes(n.status);j.useEffect(()=>{g&&Q.agentRun(e,n.id).then(f).catch(()=>{})},[e,n.id,g]),j.useEffect(()=>{const y=m.current;y&&p.current&&(y.scrollTop=y.scrollHeight)},[i,c]),KT(m,c==="log");const w=i||(d==null?void 0:d.log)||"";return s.jsxs("div",{className:"card panel",children:[s.jsxs("div",{className:"panel-head",children:[s.jsx(Ft,{agent:n.agent,size:30}),s.jsxs("div",{className:"grow",children:[s.jsxs("div",{style:{fontWeight:600},children:[r," ",s.jsx(An,{status:n.status})]}),s.jsx("div",{className:"muted small",children:Ne[n.agent].description})]}),s.jsx(kn,{value:c,onChange:h,items:[{id:"log",label:"Log"},{id:"output",label:"Output"},{id:"perm",label:"Permissions"}]})]}),s.jsxs("div",{className:"panel-body",children:[c==="log"&&n.usage&&s.jsxs("div",{className:"muted small",style:{marginBottom:8},children:[n.usage.model??"model unknown"," · input ",sn(n.usage.inputTokens)," · output ",sn(n.usage.outputTokens)," · cache read"," ",sn(n.usage.cacheReadTokens)," · cache write ",sn(n.usage.cacheWriteTokens),n.costUsd!==null&&s.jsxs(s.Fragment,{children:[" · est. ",Kt(n.costUsd)]})]}),c==="log"&&s.jsx("pre",{className:"log",ref:m,onScroll:y=>{const x=y.currentTarget;p.current=x.scrollHeight-x.scrollTop-x.clientHeight<40},children:w?s.jsx(WT,{text:w}):n.status==="running"?"Waiting for output…":"(empty)"}),c==="output"&&s.jsx(QT,{jobId:t.id,run:n,full:d,results:l,highlightResultId:a}),c==="perm"&&s.jsx("div",{children:n.allowedTools?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"muted small",children:["Headless Claude Code with ",s.jsx("code",{children:"--permission-mode dontAsk"}),": any action outside the allow list is denied."]}),s.jsx("h4",{children:"Allowed"}),s.jsx("div",{className:"perm",children:n.allowedTools.map(y=>s.jsx("code",{children:y},y))}),s.jsx("h4",{children:"Explicitly denied"}),s.jsx("div",{className:"perm",children:IT.map(y=>s.jsx("code",{className:"deny",children:y},y))})]}):s.jsx("p",{className:"muted",children:"Non-LLM agent: runs Playwright Test directly (no shell) and cannot write any file other than the report."})})]})]})}function WT({text:e}){const t=j.useMemo(()=>e.split(`
374
- `),[e]);return s.jsx(s.Fragment,{children:t.map((n,r)=>{const i=/^\s*▶/.test(n)?"l-tool":/^\s*←/.test(n)?"l-ok":/^\s*✗|^\[(error|launch error)|^\[denied\]|✘|^\s*\d+\) \S|^\s*\d+ (failed|flaky)\b/.test(n)?"l-err":/^\[claude\]|^\[done\]|^⚠|^\$ /.test(n)?"l-meta":"";return s.jsxs("span",{className:i,children:[n,`
375
- `]},r)})})}function ia({before:e,after:t}){const n=j.useMemo(()=>wb(e,t),[e,t]);return n.some(r=>r.type!=="same")?s.jsx("pre",{className:"diff",children:n.map((r,i)=>s.jsxs("div",{className:r.type==="same"?"":r.type,children:[r.type==="add"?"+ ":r.type==="del"?"- ":" ",r.text]},i))}):s.jsx("p",{className:"muted",children:"Test file unchanged."})}function VT({results:e,highlightId:t}){const n=Wh(e),r=j.useRef(null),i=j.useRef(!1);return j.useEffect(()=>{if(!t)return;const l=e.findIndex(o=>o.id===t);if(l<0)return;const a=Math.floor(l/n.props.pageSize)+1;a!==n.props.page&&n.props.onPage(a)},[t,e,n.props.pageSize]),j.useEffect(()=>{t&&r.current&&!i.current&&(r.current.scrollIntoView({behavior:"smooth",block:"center"}),i.current=!0)},[t,n.pageItems]),s.jsxs("div",{className:"table-wrap",children:[s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"TC"}),s.jsx("th",{children:"Test"}),s.jsx("th",{children:"Status"}),s.jsx("th",{className:"num",children:"ms"}),s.jsx("th",{children:"Error"})]})}),s.jsx("tbody",{children:n.pageItems.map(l=>s.jsxs("tr",{ref:l.id===t?r:void 0,className:l.id===t?"row-highlight":void 0,children:[s.jsx("td",{children:l.tcId?s.jsx("code",{children:l.tcId}):"—"}),s.jsxs("td",{children:[l.title,s.jsx("div",{className:"muted small",children:l.testFile})]}),s.jsx("td",{children:s.jsx(yt,{status:l.status})}),s.jsx("td",{className:"num",children:l.durationMs}),s.jsxs("td",{style:{maxWidth:440},children:[l.error&&s.jsx("pre",{className:"mono",style:{margin:0,whiteSpace:"pre-wrap",color:"var(--fail)",maxHeight:140,overflow:"auto"},children:l.error}),l.attachments.filter(a=>a.name==="trace"&&a.path).map(a=>s.jsxs("div",{className:"muted small",children:["Trace: ",s.jsxs("code",{children:['npx playwright show-trace "',a.path,'"']})]},a.path))]})]},l.id))})]}),s.jsx(ps,{...n.props,label:"results"})]})}function Tm({jobId:e}){const[t,n]=j.useState(null);return j.useEffect(()=>{Q.jobRequirement(e).then(r=>n(r.requirement)).catch(()=>n(null))},[e]),t?s.jsxs("details",{style:{marginTop:12},children:[s.jsxs("summary",{children:["BA requirement (",t.length.toLocaleString()," characters)"]}),s.jsx("pre",{className:"mono",style:{whiteSpace:"pre-wrap",maxHeight:320,overflow:"auto",marginTop:8},children:t})]}):null}function QT({jobId:e,run:t,full:n,results:r,highlightResultId:i}){var a,o,u,c,h,d,f,m;if(t.status==="running"||t.status==="pending")return s.jsx("p",{className:"muted",children:"Agent is running; output will be available when it finishes."});if(t.agent==="custom"&&t.output){const p=t.output;return s.jsxs("div",{children:[s.jsxs("p",{className:"row",children:[s.jsx(yt,{status:p.status==="passed"?"passed":"failed"})," ",p.summary]}),s.jsx("div",{className:"md",children:s.jsx(ui,{children:p.details})}),!!((a=p.questions)!=null&&a.length)&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{children:"Questions asked"}),s.jsx("ol",{children:p.questions.map(g=>s.jsxs("li",{children:[g.question,s.jsx("ul",{children:g.options.map((w,y)=>s.jsxs("li",{children:[w.label,w.recommended?" (recommended)":"",w.description?s.jsxs("span",{className:"muted",children:[" · ",w.description]}):null]},y))})]},g.id))})]}),!!((o=p.answered)!=null&&o.length)&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{children:"Your answers"}),s.jsx("ol",{children:p.answered.map(g=>s.jsxs("li",{children:[g.question,s.jsx("br",{}),"→ ",s.jsx("b",{children:g.answer})]},g.id))})]})]})}if(t.agent==="validator"||t.agent==="runner"){const p=t.output;return s.jsxs("div",{children:[p&&s.jsxs("p",{className:"row",children:[s.jsx(yt,{status:p.passed?"passed":"failed"}),Object.entries(p.counts).map(([g,w])=>s.jsxs("span",{className:"row",style:{gap:4},children:[s.jsx(yt,{status:g,children:w})," ",g]},g)),s.jsx("code",{className:"muted",children:p.command}),p.htmlReport&&s.jsxs("a",{href:vh(t.jobId),target:"_blank",rel:"noreferrer",children:[s.jsx(Nh,{size:13})," Open HTML report"]})]}),!p&&s.jsx("p",{className:"muted",children:"No report."}),r.length>0&&s.jsx(VT,{results:r,highlightId:i})]})}if(!t.output)return s.jsxs("div",{children:[s.jsx("p",{className:"muted",children:"The agent did not write a result file. See the Log tab for details."}),t.agent==="specwriter"&&s.jsx(Tm,{jobId:e})]});if(t.agent==="contextwriter"){const p=t.output,g=(w,y)=>y!=null&&y.length?s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:w}),s.jsx("dd",{children:s.jsx("ul",{style:{margin:0,paddingLeft:18},children:y.map((x,v)=>s.jsx("li",{children:x},v))})})]}):null;return s.jsxs("div",{children:[s.jsx("p",{children:p.summary}),s.jsxs("dl",{className:"kv",style:{marginBottom:12},children:[g("Added / updated",p.added),g("Removed (old project)",p.removed),g("Notes added",p.notes),g("Security issues (notes not applied)",Array.isArray(p.security)?p.security.map(w=>typeof w=="string"?w:`"${w.note}" (${w.reason})`):void 0),g("Check these",p.warnings),p.failure?s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:"Failed because"}),s.jsx("dd",{children:p.failure})]}):null]}),n?s.jsx(ia,{before:n.fileBefore,after:n.fileAfter}):s.jsx("p",{className:"muted",children:"Loading diff…"})]})}if(t.agent==="specwriter"){const p=t.output,g=(w,y)=>y!=null&&y.length?s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:w}),s.jsx("dd",{children:s.jsx("ul",{style:{margin:0,paddingLeft:18},children:y.map((x,v)=>s.jsx("li",{children:x},v))})})]}):null;return s.jsxs("div",{children:[s.jsx("p",{children:p.summary}),s.jsxs("dl",{className:"kv",style:{marginBottom:12},children:[s.jsx("dt",{children:"Spec"}),s.jsx("dd",{children:s.jsx(ye,{to:`/specs/${p.specFile}`,children:s.jsxs("code",{children:["specs/",p.specFile]})})}),s.jsx("dt",{children:"Test cases"}),s.jsx("dd",{children:(u=p.tcIds)==null?void 0:u.map(w=>s.jsx("code",{style:{marginRight:6},children:w},w))}),g("Assumptions",p.assumptions),g("Questions for the BA",p.questions)]}),n?s.jsx(ia,{before:n.fileBefore,after:n.fileAfter}):s.jsx("p",{className:"muted",children:"Loading spec…"}),s.jsx(Tm,{jobId:e})]})}if(t.agent==="explorer"){const p=t.output;return s.jsxs("div",{children:[s.jsxs("p",{className:"row",children:[s.jsx(yt,{status:p.status})," ",p.summary]}),((c=p.environment)==null?void 0:c.ready)===!1&&s.jsxs("div",{className:"warn-box",style:{marginBottom:12},children:[s.jsx("b",{children:"Environment/setup not ready, pipeline stopped:"}),s.jsx("ul",{style:{margin:"6px 0 0"},children:((h=p.environment.issues)!=null&&h.length?p.environment.issues:["no details"]).map((g,w)=>s.jsx("li",{children:g},w))})]}),((d=p.environment)==null?void 0:d.ready)!==!1&&p.cases.some(g=>g.status==="failed")&&s.jsxs("p",{className:"muted small",children:["Failed cases: ",p.cases.filter(g=>g.status==="failed").map(g=>g.id).join(", ")," (possible app bugs). A Generate job does not stop here: it still writes their tests, asserting the expected result."]}),s.jsx("div",{className:"table-wrap",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Case"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Evidence"})]})}),s.jsx("tbody",{children:p.cases.map(g=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("code",{children:g.id})}),s.jsx("td",{children:s.jsx(yt,{status:g.status})}),s.jsx("td",{className:"small",style:{whiteSpace:"pre-wrap"},children:g.evidence})]},g.id))})]})}),p.assertions.length>0&&s.jsxs("details",{style:{marginTop:12},children:[s.jsxs("summary",{children:["Verified assertions (",p.assertions.length,")"]}),s.jsx("div",{className:"table-wrap",style:{marginTop:8},children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Case"}),s.jsx("th",{children:"Expression"}),s.jsx("th",{children:"Expected"}),s.jsx("th",{children:"Observed"})]})}),s.jsx("tbody",{children:p.assertions.map((g,w)=>s.jsxs("tr",{children:[s.jsx("td",{children:g.case}),s.jsx("td",{children:s.jsx("code",{style:{whiteSpace:"pre-wrap"},children:g.expression})}),s.jsx("td",{className:"small",children:g.expected}),s.jsx("td",{className:"small",children:g.observed})]},w))})]})})]}),p.bugs.length>0&&s.jsxs("div",{className:"warn-box",children:[s.jsx("b",{children:"Potential bugs:"}),s.jsx("ul",{style:{margin:"6px 0 0"},children:p.bugs.map((g,w)=>s.jsx("li",{children:g},w))})]})]})}if(t.agent==="generator"){const p=t.output;return s.jsxs("div",{children:[s.jsxs("dl",{className:"kv",style:{marginBottom:12},children:[s.jsx("dt",{children:"File test"}),s.jsx("dd",{children:s.jsx("code",{children:p.testFile})}),s.jsx("dt",{children:"Test case"}),s.jsx("dd",{children:(f=p.tcIds)==null?void 0:f.map(g=>s.jsx("code",{style:{marginRight:6},children:g},g))}),p.pomChanges&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:"Page Object"}),s.jsx("dd",{children:p.pomChanges})]}),p.notes&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:"Notes"}),s.jsx("dd",{children:p.notes})]})]}),n?s.jsx(ia,{before:n.fileBefore,after:n.fileAfter}):s.jsx("p",{className:"muted",children:"Loading diff…"})]})}const l=t.output;return s.jsxs("div",{children:[s.jsxs("p",{className:"row",children:[s.jsx(yt,{status:l.outcome})," ",l.diagnosis]}),((m=l.changes)==null?void 0:m.length)>0&&s.jsx("ul",{children:l.changes.map((p,g)=>s.jsx("li",{children:p},g))}),n?s.jsx(ia,{before:n.fileBefore,after:n.fileAfter}):s.jsx("p",{className:"muted",children:"Loading diff…"})]})}const qT=32,GT=240;function KT(e,t){j.useEffect(()=>{const n=e.current;if(!t||!n)return;const r=n.closest(".content"),i=r&&getComputedStyle(r).overflowY!=="visible"?r:null,l=()=>{const u=n.getBoundingClientRect(),c=i?i.clientHeight-(u.top-i.getBoundingClientRect().top+i.scrollTop):window.innerHeight-(u.top+window.scrollY);n.style.maxHeight=`${Math.max(GT,Math.floor(c-qT))}px`};l(),window.addEventListener("resize",l);const a=typeof ResizeObserver>"u"?null:new ResizeObserver(l),o=(i??document.body).firstElementChild;return a&&o&&a.observe(o),()=>{window.removeEventListener("resize",l),a==null||a.disconnect(),n.style.maxHeight=""}},[e,t])}const YT=["all","mapped","missing","stale","orphan"],zu=e=>e.charAt(0).toUpperCase()+e.slice(1);function JT(){const e=ut(),{specs:t,refresh:n}=un(),[r,i]=j.useState("all"),[l,a]=j.useState(""),[o,u]=j.useState(null),c=Tl([r,l]),{data:h,error:d,reload:f}=$e(()=>Q.mappingPage({page:c.page,pageSize:c.pageSize,status:r==="all"?void 0:r,spec:l||void 0}),[c.page,c.pageSize,r,l]),m=(h==null?void 0:h.items)??[],p=async g=>{try{const w=await Q.createJob(g);e(`/runs/${w.id}`)}catch(w){u(w.message)}};return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Testing"},{label:"Test cases"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Test cases"}),s.jsx("p",{className:"page-sub",children:"Test case ↔ Playwright test traceability."})]})}),s.jsxs("div",{className:"toolbar",children:[s.jsx(kn,{value:r,onChange:i,items:YT.map(g=>({id:g,label:s.jsxs(s.Fragment,{children:[g==="all"?"All":zu(g)," ",s.jsx("span",{className:"tab-count",children:(h==null?void 0:h.counts[g])??0})]})}))}),s.jsx("div",{className:"grow"}),s.jsxs("select",{className:"select",value:l,onChange:g=>a(g.target.value),"aria-label":"Filter by spec",children:[s.jsx("option",{value:"",children:"All specs"}),t.map(g=>s.jsx("option",{value:g.file,children:g.file},g.file))]}),s.jsxs("button",{className:"btn ghost",onClick:()=>{n(),f()},children:[s.jsx(Yn,{size:14})," Refresh"]})]}),s.jsx(Le,{error:d??o}),s.jsxs("div",{className:"table-wrap table-fit",children:[s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Spec"}),s.jsx("th",{children:"TC"}),s.jsx("th",{children:"TC name"}),s.jsx("th",{children:"Test file"}),s.jsx("th",{children:"Mapping"}),s.jsx("th",{children:"Last result"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:m.map((g,w)=>s.jsxs("tr",{children:[s.jsx("td",{children:g.specFile?s.jsx(ye,{to:`/specs/${g.specFile}`,className:"mono",children:g.specFile}):s.jsx("span",{className:"muted",children:"—"})}),s.jsx("td",{children:g.tcId?s.jsx("code",{children:g.tcId}):"—"}),s.jsx("td",{children:g.tcTitle??g.testTitle??"—"}),s.jsx("td",{children:g.testFile?s.jsxs("code",{children:[g.testFile,":",g.testLine]}):s.jsx("span",{className:"muted",children:"—"})}),s.jsx("td",{children:s.jsx(yt,{status:g.status,children:zu(g.status)})}),s.jsx("td",{children:g.lastResult?s.jsx(ye,{to:`/runs/${g.lastResult.jobId}`,title:Rt(g.lastResult.at),children:s.jsx(yt,{status:g.lastResult.status,children:zu(g.lastResult.status)})}):s.jsx(yt,{status:null})}),s.jsx("td",{style:{textAlign:"right"},children:g.testFile&&g.tcId&&g.specFile&&g.status!=="orphan"&&s.jsxs("button",{className:"btn ghost sm",onClick:()=>void p({type:"testrun",spec:g.specFile,tcId:g.tcId}),children:[s.jsx(ft,{size:12})," Run"]})})]},`${g.specFile??"__none"}-${g.tcId}-${g.testLine}-${w}`))})]}),h&&m.length===0&&s.jsx("p",{className:"muted pad",children:"No rows match the filter."}),h&&s.jsx(ps,{page:c.page,pageSize:c.pageSize,total:h.total,onPage:c.setPage,onPageSize:c.setPageSize,label:"test cases"})]})]})}const la=(e,t)=>t?Math.round(e/t*100):0;function XT(){const e=ut(),{openNewSpec:t}=hs(),{specs:n,refresh:r}=un(),i=$e(()=>Q.dashboard()),l=$e(()=>Q.jobs()),[a,o]=j.useState(null),u=i.data,c=n.reduce((p,g)=>p+g.parsed.tcs.length,0),h=l.data??[],d=h[0],f=(u==null?void 0:u.failing)??[],m=()=>void Q.createJob({type:"testrun",repeatEach:1}).then(p=>{r(),e(`/runs/${p.id}`)}).catch(p=>o(p.message));return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Overview"}]}),s.jsx(Le,{error:i.error??l.error??a}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Overview"}),s.jsx("p",{className:"page-sub",children:"Test coverage and run health across all specs."})]}),s.jsxs("div",{className:"row",children:[s.jsxs("button",{className:"btn ghost",onClick:()=>t(),children:[s.jsx(qt,{size:15})," New spec"]}),s.jsxs("button",{className:"btn",onClick:m,children:[s.jsx(ft,{size:13})," Run all specs"]})]})]}),s.jsxs("div",{className:"stats",children:[s.jsxs("div",{className:"stat",children:[s.jsxs("div",{className:"stat-head",children:[s.jsx("span",{children:"Coverage"}),s.jsx("span",{className:"stat-icon",children:s.jsx(jh,{size:16})})]}),s.jsxs("div",{className:"stat-value",children:[la((u==null?void 0:u.coverage.mapped)??0,(u==null?void 0:u.coverage.total)??0),"%",s.jsxs("small",{children:[(u==null?void 0:u.coverage.mapped)??0," / ",(u==null?void 0:u.coverage.total)??0," TC"]})]}),s.jsx("div",{className:"progress",children:s.jsx("i",{style:{width:`${la((u==null?void 0:u.coverage.mapped)??0,(u==null?void 0:u.coverage.total)??0)}%`}})})]}),s.jsxs("div",{className:"stat",children:[s.jsxs("div",{className:"stat-head",children:[s.jsx("span",{children:"Pass rate"}),s.jsx("span",{className:"stat-icon ok",children:s.jsx(bh,{size:16})})]}),s.jsxs("div",{className:"stat-value",children:[la((u==null?void 0:u.passRate.passed)??0,(u==null?void 0:u.passRate.total)??0),"%",s.jsxs("small",{children:[(u==null?void 0:u.passRate.passed)??0," / ",(u==null?void 0:u.passRate.total)??0," TC"]})]}),s.jsx("div",{className:"progress ok",children:s.jsx("i",{style:{width:`${la((u==null?void 0:u.passRate.passed)??0,(u==null?void 0:u.passRate.total)??0)}%`}})})]}),s.jsxs("div",{className:"stat",children:[s.jsxs("div",{className:"stat-head",children:[s.jsx("span",{children:"Specs"}),s.jsx("span",{className:"stat-icon info",children:s.jsx(wr,{size:16})})]}),s.jsxs("div",{className:"stat-value",children:[n.length,s.jsxs("small",{children:[c," test cases"]})]}),s.jsx(ye,{to:"/specs",className:"stat-link",children:"Manage specs →"})]}),s.jsxs("div",{className:"stat",children:[s.jsxs("div",{className:"stat-head",children:[s.jsx("span",{children:"Recent runs"}),s.jsx("span",{className:"stat-icon warn",children:s.jsx(ft,{size:14})})]}),s.jsxs("div",{className:"stat-value",children:[h.length,s.jsx("small",{children:"runs"})]}),s.jsxs("div",{className:"muted small",children:["Last run: ",Rt((d==null?void 0:d.finishedAt)??(d==null?void 0:d.startedAt)??(d==null?void 0:d.createdAt))]})]})]}),s.jsxs("div",{className:"overview-grid",children:[s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Recent runs"}),s.jsx(ye,{to:"/runs",className:"card-link",children:"View all"})]}),s.jsxs("table",{className:"flat",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Run"}),s.jsx("th",{children:"Spec"}),s.jsx("th",{children:"Result"}),s.jsx("th",{className:"num",children:"Duration"})]})}),s.jsx("tbody",{children:h.slice(0,5).map(p=>s.jsxs("tr",{onClick:()=>e(`/runs/${p.id}`),style:{cursor:"pointer"},children:[s.jsxs("td",{className:"mono",children:["#",p.id]}),s.jsxs("td",{children:[p.target,p.args.tcId?s.jsxs("span",{className:"muted small",children:[" · ",p.args.tcId]}):null]}),s.jsx("td",{children:s.jsx(ni,{status:p.status,title:p.summary??void 0,children:p.summary&&p.summary.length<=24?p.summary:p.status})}),s.jsx("td",{className:"num muted",children:br(p.startedAt,p.finishedAt)})]},p.id))})]}),l.data&&h.length===0&&s.jsx("p",{className:"muted pad",children:"No runs yet."})]}),s.jsxs("div",{className:"card pad",children:[s.jsx("h3",{className:"card-title",children:"Pipeline agents"}),s.jsxs("p",{className:"muted small",style:{margin:"2px 0 14px"},children:["Runs with ",s.jsx("span",{className:"accent-text",children:"Claude Code"})," — no API key needed."]}),s.jsx("ol",{className:"agent-steps",children:["explorer","generator","validator","healer"].map((p,g)=>s.jsxs("li",{title:Ne[p].description,children:[s.jsx("span",{className:"step-num",children:g+1}),Ne[p].label,p==="healer"&&s.jsx("span",{className:"muted small accent-soft-text",children:"≤ 2 loops"})]},p))})]})]}),f.length>0&&s.jsxs("div",{className:"card",style:{marginTop:18},children:[s.jsx("div",{className:"card-head",children:s.jsxs("h3",{children:["Failing tests (",f.length,")"]})}),s.jsx("table",{className:"flat",children:s.jsx("tbody",{children:f.map(p=>s.jsxs("tr",{onClick:()=>e(`/runs/${p.jobId}${p.id?`?result=${p.id}`:""}`),style:{cursor:"pointer"},title:"Open this failed test in Recent runs",children:[s.jsxs("td",{children:[s.jsx("div",{children:p.title}),s.jsx("div",{className:"mono small",style:{color:"var(--fail)"},children:(p.error??"").split(`
376
- `)[0].slice(0,160)})]}),s.jsx("td",{className:"num",children:s.jsxs(ye,{to:`/runs/${p.jobId}${p.id?`?result=${p.id}`:""}`,onClick:g=>g.stopPropagation(),children:["#",p.jobId]})})]},`${p.jobId}-${p.title}`))})})]}),s.jsxs("div",{className:"card",style:{marginTop:18},children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Specs at a glance"}),s.jsx(ye,{to:"/specs",className:"card-link",children:"Open Specs page"})]}),s.jsxs("div",{className:"glance",children:[((u==null?void 0:u.specs)??[]).map(p=>s.jsxs(ye,{to:`/specs/${p.file}`,className:"glance-row",children:[s.jsx("span",{className:"file-icon muted-icon",children:s.jsx(wr,{size:16})}),s.jsxs("div",{className:"grow",children:[s.jsx("div",{className:"mono strong",children:p.file}),s.jsx("div",{className:"muted small",children:p.title||"—"})]}),s.jsxs("span",{className:"muted small",children:[p.tcCount," test cases"]}),s.jsxs("span",{className:`chip ${p.mappedCount<p.tcCount?"warn":""}`,children:[p.mappedCount,"/",p.tcCount," mapped"]})]},p.file)),u&&u.specs.length===0&&s.jsx("p",{className:"muted pad",children:"No specs yet."})]})]})]})}function Pm({value:e,mode:t}){const[n,r]=j.useState({...e}),i=(a,o)=>{e[a]=o,r({...e})},l=t==="export"?[{key:"jobs",title:"Jobs",hint:"Agent logs, test results, Claude usage and HTML reports. Can make the zip large."},{key:"chats",title:"Chat history",hint:"Chat messages and uploaded files."}]:[{key:"jobs",title:"Jobs",hint:"Replaces the current job history with the one in the zip."},{key:"chats",title:"Chat history",hint:"Adds the chats in the zip; a chat with the same id is replaced."}];return s.jsxs("fieldset",{className:"transfer-options",children:[s.jsx("legend",{children:t==="export"?"Also include":"Also import (if the zip has it)"}),l.map(a=>s.jsxs("label",{className:`transfer-option${n[a.key]?" on":""}`,children:[s.jsx("input",{type:"checkbox",className:"check-box",checked:n[a.key],onChange:o=>i(a.key,o.target.checked)}),s.jsxs("span",{className:"transfer-option-text",children:[s.jsx("span",{className:"transfer-option-title",children:a.title}),s.jsx("span",{className:"transfer-option-hint",children:a.hint})]})]},a.key))]})}function ZT({onImported:e}){const t=Ir(),n=In(),r=Qb(),i=j.useRef(null),[l,a]=j.useState(!1),o=async h=>{a(!0);try{await r(h())}catch(d){t.error(d.message)}finally{a(!1)}},u=async()=>{const h={jobs:!1,chats:!1};await n({title:"Export project",message:s.jsxs(s.Fragment,{children:["Specs, tests, Playwright config, CLAUDE.md, Claude skills, settings, agents and pipelines are exported as a zip. Saved browser logins are never included.",s.jsx(Pm,{value:h,mode:"export"})]}),confirmLabel:"Export"})&&await o(async()=>{const f=URL.createObjectURL(await Q.exportProject(h)),m=document.createElement("a");m.href=f,m.download=`agent-studio-export-${new Date().toISOString().slice(0,10)}.zip`,m.click(),URL.revokeObjectURL(f);const p=[h.jobs&&"jobs",h.chats&&"chats"].filter(Boolean).join(" and ");t.success(p?`Project exported with ${p}`:"Project exported")})},c=async h=>{const d={jobs:!1,chats:!1};await n({title:`Import ${h.name}?`,message:s.jsxs(s.Fragment,{children:["Specs, tests, Playwright config, CLAUDE.md and Claude skills in the zip overwrite the files with the same name. Settings, all agents (built-in instructions and custom agents) and pipelines are replaced. Jobs and chats are kept unless ticked below.",s.jsx(Pm,{value:d,mode:"import"})]}),confirmLabel:"Import",danger:!0})&&await o(async()=>{const m=await new Promise((y,x)=>{const v=new FileReader;v.onload=()=>y(String(v.result)),v.onerror=()=>x(v.error),v.readAsDataURL(h)}),p=await Q.importProject(m.slice(m.indexOf(",")+1),d);nb(),e==null||e();const g=[`${p.files} files`,`${p.agents} custom agents`,`${p.pipelines} custom pipelines`,`${p.instructions} built-in agent instructions`];p.jobs!==null&&g.push(`${p.jobs} jobs`),p.chats!==null&&g.push(`${p.chats} chats`);const w=[d.jobs&&p.jobs===null&&"jobs",d.chats&&p.chats===null&&"chats"].filter(Boolean).join(" or ");t.success(`Imported ${g.slice(0,-1).join(", ")} and ${g[g.length-1]}${w?` (the zip has no ${w})`:""}`)})};return s.jsxs("span",{className:"row",children:[s.jsxs("button",{type:"button",className:"btn",onClick:()=>{var h;return(h=i.current)==null?void 0:h.click()},disabled:l,title:"Import a project zip exported from Agent Studio",children:[s.jsx(Lo,{size:15})," Import"]}),s.jsxs("button",{type:"button",className:"btn",onClick:()=>void u(),disabled:l,title:"Export specs, tests, Playwright config, CLAUDE.md, Claude skills, settings, agents and pipelines (optionally jobs and chats) as a zip",children:[s.jsx(cs,{size:15})," Export"]}),s.jsx("input",{ref:i,type:"file",accept:".zip",hidden:!0,onChange:h=>{var f;const d=(f=h.target.files)==null?void 0:f[0];h.target.value="",d&&c(d)}})]})}async function Fv(){const e=await Q.claudeMd();if(e.content===null)return;const t=URL.createObjectURL(new Blob([e.content],{type:"text/markdown"})),n=document.createElement("a");n.href=t,n.download=`CLAUDE-${new Date().toISOString().slice(0,10)}.md`,n.click(),setTimeout(()=>URL.revokeObjectURL(t),1e3)}function eP(){var v,b,A,k;const e=ut(),t=In(),n=Ir(),r=$e(()=>Q.claudeMd()),i=$e(()=>Q.jobsPage({page:1,pageSize:1,type:"context"})),[l,a]=j.useState(""),[o,u]=j.useState("rendered"),[c,h]=j.useState(!1),[d,f]=j.useState(null),m=(v=i.data)==null?void 0:v.items[0],p=j.useRef(null),[g,w]=j.useState(null),y=async E=>{if(!E)return;if(!/\.md$/i.test(E.name))return f("Choose a Markdown (.md) file.");const T=await E.text();if(!await t({title:"Replace CLAUDE.md?",message:`CLAUDE.md is replaced with ${E.name}. The current file is backed up first.`,confirmLabel:"Replace",danger:!0})){p.current&&(p.current.value="");return}try{const C=await Q.uploadClaudeMd(T);n.success("CLAUDE.md replaced"),w(`CLAUDE.md replaced with ${E.name}.${C.backup?` Previous version backed up to ${C.backup}.`:""}`),f(null),r.reload()}catch(C){f(C.message)}finally{p.current&&(p.current.value="")}},x=async E=>{E.preventDefault(),h(!0);try{const T=await Q.createJob({type:"context",...l.trim()?{notes:l.trim()}:{}});e(`/runs/${T.id}`)}catch(T){f(T.message),h(!1)}};return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Project"}]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Project"}),s.jsx("p",{className:"page-sub",children:"Project context (CLAUDE.md), import / export and reset."})]}),s.jsxs("span",{className:"row",children:[s.jsx(ZT,{onImported:r.reload}),s.jsxs(ye,{className:"btn danger",to:"/project/reset",title:"Remove this project's specs, tests, results and context; you choose what and see the list first",children:[s.jsx(Ar,{size:14})," Reset"]})]})]}),s.jsxs("div",{className:"overview-grid project-grid",children:[s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head row between",children:[s.jsxs("h3",{children:["CLAUDE.md"," ",((b=r.data)==null?void 0:b.mtimeMs)&&s.jsxs("span",{className:"muted small",style:{fontWeight:400},children:["· modified ",Rt(new Date(r.data.mtimeMs).toISOString())]})]}),s.jsxs("span",{className:"row",children:[s.jsx("button",{className:"btn ghost sm",onClick:()=>void Fv(),disabled:!((A=r.data)!=null&&A.content),children:"Download"}),s.jsxs("button",{className:"btn ghost sm",onClick:()=>{var E;return(E=p.current)==null?void 0:E.click()},title:"Replace CLAUDE.md with a file, e.g. this project's saved context",children:[s.jsx(Lo,{size:13})," Upload"]}),s.jsx("input",{ref:p,type:"file",accept:".md,text/markdown",hidden:!0,onChange:E=>{var T;return void y((T=E.target.files)==null?void 0:T[0])}}),s.jsx(kn,{value:o,onChange:u,items:[{id:"rendered",label:"Preview"},{id:"source",label:"Source"}]})]})]}),g&&s.jsx("div",{className:"ok-box",style:{margin:12},children:g}),s.jsx(Le,{error:r.error}),r.data&&r.data.content===null&&s.jsx("p",{className:"muted pad",children:"There is no CLAUDE.md at the repo root yet. The Context Writer will create one."}),((k=r.data)==null?void 0:k.content)&&(o==="rendered"?s.jsx("div",{className:"pad md claude-md",children:s.jsx(ui,{children:r.data.content.replace(/<!--[\s\S]*?-->/g,"")})}):s.jsx("pre",{className:"mono pad claude-md",style:{margin:0,whiteSpace:"pre-wrap"},children:r.data.content}))]}),s.jsxs("form",{className:"card pad req-form project-writer",onSubmit:x,children:[s.jsxs("div",{className:"row",children:[s.jsx(Ft,{agent:"contextwriter",size:36}),s.jsxs("div",{children:[s.jsx("b",{children:"Context Writer"}),s.jsx("div",{className:"muted small",children:"LLM agent (Claude Code), may only edit CLAUDE.md"})]})]}),s.jsxs("label",{children:["Notes about this project (optional)",s.jsx("textarea",{className:"input",style:{minHeight:120},value:l,onChange:E=>a(E.target.value),placeholder:"e.g. <App name>: customer portal. Roles: admin, customer. Login with email + password. Test ids use data-testid."})]}),s.jsx(Le,{error:d}),s.jsxs("div",{className:"row between",children:[s.jsx("span",{className:"muted small",children:m?s.jsxs(s.Fragment,{children:["Last update: ",s.jsxs(ye,{to:`/runs/${m.id}`,children:["job #",m.id]})," ",s.jsx(An,{status:m.status})," ",Rt(m.finishedAt??m.createdAt)]}):"Never updated by Agent Studio"}),s.jsxs("button",{type:"submit",className:"btn",disabled:c,children:[s.jsx(Sh,{size:15})," ",c?"Starting…":"Update CLAUDE.md"]})]})]})]})]})}const Rm=e=>e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(1)} MB`;function tP({mentions:e,title:t}){const n=j.useMemo(()=>{const r=new Map;for(const i of e)r.set(i.file,[...r.get(i.file)??[],i]);return[...r.entries()]},[e]);return e.length?s.jsxs("details",{className:"rt-mentions",children:[s.jsxs("summary",{children:[t,": ",e.length," line",e.length===1?"":"s"," in ",n.length," file",n.length===1?"":"s"]}),s.jsx("p",{className:"muted small",children:"These files are not changed by the reset (source code, docs). Review and edit them by hand."}),n.map(([r,i])=>s.jsxs("div",{className:"rt-file",children:[s.jsx("code",{children:r}),i.map(l=>s.jsxs("div",{className:"rt-line",children:[s.jsx("span",{className:"muted",children:l.line})," ",l.text]},`${l.line}-${l.text}`))]},r))]}):s.jsx("p",{className:"muted small",children:"No other file mentions the project."})}function nP(){const{refresh:e}=un(),[t,n]=j.useState(null),[r,i]=j.useState(new Set),[l,a]=j.useState(""),[o,u]=j.useState(!0),[c,h]=j.useState(!1),[d,f]=j.useState(null),[m,p]=j.useState(null),g=async()=>{try{const E=await Q.resetPlan();n(E),i(T=>T.size?T:new Set(E.categories.filter(I=>I.defaultOn).map(I=>I.id))),f(null)}catch(E){f(E.message)}};j.useEffect(()=>{g()},[]);const w=E=>i(T=>{const I=new Set(T);return I.has(E)?I.delete(E):I.add(E),I}),y=async()=>{if(t){h(!0);try{const E=await Q.resetProject({categories:[...r],confirm:l,backup:o});p(E),a(""),e(),await g()}catch(E){f(E.message)}finally{h(!1)}}},x=E=>i(new Set(E&&t?t.categories.map(T=>T.id):[])),v=(t==null?void 0:t.categories.filter(E=>r.has(E.id)))??[],b=v.reduce((E,T)=>E+(T.id==="prompts"?0:T.fileCount),0),A=v.reduce((E,T)=>E+(T.bytes??0),0),k=t&&l===t.confirmWord&&r.size>0&&!t.busy&&!c;return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Project",to:"/project"},{label:"Reset project template"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Reset project template"}),s.jsxs("p",{className:"page-sub",children:["Strip everything that belongs to the current project so this repository can be cloned and reused for another one. With ",s.jsx("b",{children:"Backup data"})," on, specs, tests, CLAUDE.md and chat history are backed up first; results and logs are always deleted for good."]})]})}),m&&s.jsxs("div",{className:"ok-box",children:[s.jsx("b",{children:"Project reset."})," ",Object.entries(m.removed).map(([E,T])=>{var I;return`${((I=t==null?void 0:t.categories.find(C=>C.id===E))==null?void 0:I.label)??E}: ${T}`}).join(" · "),m.backupDir&&s.jsxs(s.Fragment,{children:[s.jsx("br",{}),"Backup of the removed files (specs, tests, CLAUDE.md, chat history…): ",s.jsx("code",{children:m.backupDir})]}),!m.backupDir&&s.jsxs(s.Fragment,{children:[s.jsx("br",{}),"No backup was made: removed items were deleted permanently."]}),s.jsx("br",{}),"Next: add specs for the new project, then ",s.jsx(ye,{to:"/project",children:"update CLAUDE.md"})," with the Context Writer or upload the project's CLAUDE.md.",m.mentions.length>0&&s.jsx("div",{style:{marginTop:8},children:s.jsx(tP,{mentions:m.mentions,title:"Still mentioned"})})]}),s.jsx(Le,{error:d}),(t==null?void 0:t.busy)&&s.jsx("div",{className:"warn-box",children:"A job is queued, running or waiting for review. Wait for it to finish (or cancel it) before resetting."}),t&&s.jsxs("div",{className:"overview-grid rt-grid",children:[s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head row between",children:[s.jsxs("h3",{children:["What to reset"," ",s.jsxs("span",{className:"muted small",style:{fontWeight:400},children:["· ",r.size," of ",t.categories.length," selected"]})]}),s.jsxs("span",{className:"row",children:[s.jsx("button",{className:"btn ghost sm",onClick:()=>x(r.size<t.categories.length),children:r.size<t.categories.length?"Select all":"Select none"}),s.jsxs("button",{className:"btn ghost sm",onClick:()=>void g(),children:[s.jsx(Yn,{size:13})," Refresh"]})]})]}),t.categories.map(E=>s.jsxs("label",{className:`rt-cat ${r.has(E.id)?"on":""}`,children:[s.jsx("input",{type:"checkbox",checked:r.has(E.id),onChange:()=>w(E.id)}),s.jsxs("span",{className:"grow",children:[s.jsxs("span",{className:"rt-cat-head",children:[s.jsx("b",{children:E.label}),s.jsxs("span",{className:"muted small",children:[E.fileCount," ",E.id==="prompts"?"custom":`file${E.fileCount===1?"":"s"}`,E.bytes?` · ${Rm(E.bytes)}`:""]}),s.jsx("span",{className:`rt-tag ${E.backedUp&&o?"":"gone"}`,children:E.backedUp&&o?"backed up":"deleted for good"})]}),s.jsx("span",{className:"muted small",children:E.description}),E.note&&s.jsx("span",{className:"small",children:E.note}),E.files.length>0&&s.jsxs("details",{className:"rt-files",children:[s.jsx("summary",{className:"small",children:"Show files"}),E.files.map(T=>s.jsx("code",{children:T},T)),E.fileCount>E.files.length&&s.jsxs("span",{className:"muted small",children:["…and ",E.fileCount-E.files.length," more"]})]})]})]},E.id))]}),s.jsxs("div",{className:"card pad danger-zone rt-panel",children:[s.jsx("h3",{className:"card-title",children:"Reset"}),s.jsxs("div",{className:"rt-summary small",children:[s.jsx("b",{children:r.size})," item",r.size===1?"":"s"," · ",s.jsx("b",{children:b})," file",b===1?"":"s",A?s.jsxs(s.Fragment,{children:[" · ",Rm(A)]}):null]}),s.jsxs("label",{className:"small row",style:{gap:8,alignItems:"center"},children:[s.jsx("input",{type:"checkbox",checked:o,onChange:E=>u(E.target.checked)}),s.jsx("b",{children:"Backup data"})]}),!o&&s.jsx("div",{className:"warn-box small",style:{margin:0},children:"Backup is off: the selected items are deleted permanently and cannot be restored."}),s.jsxs("p",{className:"muted small",style:{margin:0},children:["Keep this project's context? ",s.jsx("button",{className:"link-btn",onClick:()=>void Fv(),children:"Download CLAUDE.md"})," first and upload it again later on the Project page."]}),s.jsxs("label",{className:"small",style:{display:"grid",gap:6},children:[s.jsxs("span",{children:["Type ",s.jsx("b",{children:t.confirmWord})," to confirm"]}),s.jsx("input",{className:"input mono",value:l,onChange:E=>a(E.target.value),"aria-label":"Confirmation word",autoComplete:"off"})]}),s.jsxs("button",{className:"btn danger-solid",disabled:!k,onClick:()=>void y(),children:[s.jsx(Ar,{size:14})," ",c?"Resetting…":`Reset ${r.size} item${r.size===1?"":"s"}`]})]})]})]})}const rP=/^[a-z0-9][a-z0-9_-]*$/;function sP(e){return e.replace(/\.(md|txt)$/i,"").toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/đ/g,"d").replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,60)}function iP(){const e=ut(),{specs:t}=un(),[n,r]=j.useState(""),[i,l]=j.useState(""),[a,o]=j.useState(!1),[u,c]=j.useState(!1),[h,d]=j.useState(null),f=j.useRef(null),m=n.trim().replace(/\.md$/,""),p=`${m}.md`,g=t.some(v=>v.file===p),w=i.length>wu,y=async v=>{if(v){if(!/\.(md|txt)$/i.test(v.name))return d("Only .md or .txt files can be loaded. Copy text from Word/Confluence and paste it instead.");l(await v.text()),m||r(sP(v.name)),d(null)}},x=async v=>{if(v.preventDefault(),!rP.test(m))return d('Spec name may only contain lowercase letters, digits, "-" or "_", and must start with a letter or digit.');if(!i.trim())return d("Paste the requirement first.");if(w)return d(`The requirement is longer than ${wu.toLocaleString()} characters.`);if(g&&!a)return d(`specs/${p} already exists. Choose another name or tick "Overwrite".`);c(!0);try{const b=await Q.createJob({type:"spec",spec:p,requirement:i,...g?{overwrite:!0}:{}});e(`/runs/${b.id}`)}catch(b){d(b.message),c(!1)}};return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Specification"},{label:"Generator"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Generator"}),s.jsx("p",{className:"page-sub",children:"Paste a BA requirement or user story. The QA Test Case Writer agent turns it into a spec with test cases, which you then review and run."})]})}),s.jsxs("div",{className:"overview-grid",children:[s.jsxs("form",{className:"card pad req-form",onSubmit:x,children:[s.jsxs("label",{children:["Spec name",s.jsxs("span",{className:"row",children:[s.jsx("input",{className:"input grow",placeholder:"e.g. login",value:n,onChange:v=>r(v.target.value),"aria-describedby":"spec-name-help"}),s.jsx("span",{className:"muted",children:".md"})]}),s.jsxs("span",{id:"spec-name-help",className:"muted small",style:{fontWeight:400},children:["Saved as ",s.jsxs("code",{children:["specs/",m||"<name>",".md"]})]})]}),g&&s.jsxs("label",{className:"row",style:{display:"flex",fontWeight:400},children:[s.jsx("input",{type:"checkbox",checked:a,onChange:v=>o(v.target.checked)}),s.jsxs("span",{children:[s.jsxs("b",{children:["specs/",p]})," already exists: overwrite it (existing TC-IDs are kept where they still apply)"]})]}),s.jsxs("label",{children:[s.jsxs("span",{className:"row between",children:[s.jsx("span",{children:"Requirement"}),s.jsxs("button",{type:"button",className:"btn ghost",onClick:()=>{var v;return(v=f.current)==null?void 0:v.click()},children:[s.jsx(Lo,{size:14})," Load .md / .txt"]})]}),s.jsx("textarea",{className:"input",value:i,onChange:v=>l(v.target.value),placeholder:`As a <role>, I want to <action> so that <benefit>.
377
-
378
- Business rules:
379
- - <rule, limits, ranges>
380
-
381
- Acceptance criteria:
382
- - Given ... when ... then ...
383
- - ...`,"aria-label":"Requirement text"}),s.jsxs("span",{className:`small ${w?"":"muted"}`,style:{fontWeight:400,color:w?"var(--fail)":void 0},children:[i.length.toLocaleString()," / ",wu.toLocaleString()," characters"]})]}),s.jsx("input",{ref:f,type:"file",accept:".md,.txt,text/markdown,text/plain",hidden:!0,onChange:v=>{var b;return void y((b=v.target.files)==null?void 0:b[0])}}),s.jsx(Le,{error:h}),s.jsx("div",{className:"row",style:{justifyContent:"flex-end"},children:s.jsxs("button",{type:"submit",className:"btn",disabled:u,children:[s.jsx(hl,{size:15})," ",u?"Starting…":"Generate spec"]})})]}),s.jsxs("div",{className:"card pad",children:[s.jsxs("div",{className:"row",style:{marginBottom:12},children:[s.jsx(Ft,{agent:"specwriter",size:36}),s.jsxs("div",{children:[s.jsx("b",{children:"How it works"}),s.jsx("div",{className:"muted small",children:"QA Test Case Writer agent (Claude Code)"})]})]}),s.jsxs("ol",{className:"req-steps",children:[s.jsx("li",{children:"The requirement is saved with the job. The agent reads it, plus existing specs for style."}),s.jsxs("li",{children:["It writes ",s.jsxs("code",{children:["specs/",m||"<name>",".md"]})," with one ",s.jsx("code",{children:"## TC-…"})," per behaviour, designed with equivalence partitioning, boundary values, decision tables, state transitions and use cases, always adding edge and security cases."]}),s.jsxs("li",{children:["Each test case gets a test level tag (",s.jsx("b",{children:"IT"}),", ",s.jsx("b",{children:"ST"}),", ",s.jsx("b",{children:"SIT"}),", ",s.jsx("b",{children:"UAT"}),") plus type tags (smoke, negative, boundary, security…) and its design technique."]}),s.jsx("li",{children:"Its assumptions and open questions for the BA are listed in the job output."}),s.jsxs("li",{children:["Review the spec in the editor, then run ",s.jsx("b",{children:"Generate tests"}),"."]})]}),s.jsxs("p",{className:"muted small",style:{marginTop:14},children:["The agent can only write that spec file. It does not open a browser and does not invent credentials. Accounts come from ",s.jsx("code",{children:".env"})," when tests are generated."]})]})]})]})}function lP(){const e=ut(),[t,n]=j.useState("all"),r=Tl([t]),{data:i,error:l,reload:a}=$e(()=>Q.jobsPage({page:r.page,pageSize:r.pageSize,type:t==="all"?void 0:t}),[r.page,r.pageSize,t]),[o,u]=j.useState(null),c=((i==null?void 0:i.items)??[]).some(d=>d.status==="queued"||d.status==="running");j.useEffect(()=>{if(!c)return;const d=setInterval(a,2e3);return()=>clearInterval(d)},[c,a]);const h=(i==null?void 0:i.items)??[];return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Testing"},{label:"Recent runs"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Recent runs"}),s.jsx("p",{className:"page-sub",children:"Explore, generate, run and heal jobs with their agent timeline."})]})}),s.jsxs("div",{className:"row between",style:{marginBottom:14},children:[s.jsx(kn,{value:t,onChange:n,items:["all","testrun","generate","explore","heal","spec","context"].map(d=>({id:d,label:d==="all"?"All":Sr[d]}))}),s.jsx("div",{className:"row",children:s.jsxs("button",{className:"btn dark",onClick:()=>void Q.createJob({type:"testrun",repeatEach:1}).then(d=>e(`/runs/${d.id}`)).catch(d=>u(d.message)),children:[s.jsx(ft,{size:14})," Run all tests"]})})]}),s.jsx(Le,{error:l??o}),s.jsxs("div",{className:"table-wrap",children:[s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Job"}),s.jsx("th",{children:"Agents"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Result"}),s.jsx("th",{children:"Started"}),s.jsx("th",{children:"Duration"})]})}),s.jsx("tbody",{children:h.map(d=>s.jsxs("tr",{onClick:()=>e(`/runs/${d.id}`),style:{cursor:"pointer"},children:[s.jsx("td",{children:s.jsxs("div",{className:"file-cell",children:[s.jsx("span",{className:"file-icon",children:s.jsx(ft,{size:14})}),s.jsxs("div",{children:[s.jsxs("div",{children:["#",d.id," ",Sr[d.type]]}),s.jsxs("div",{className:"sub",children:[d.args.name??d.target,d.args.tcId?` · ${d.args.tcId}`:"",d.args.repeatEach&&d.args.repeatEach>1?` · ${d.args.repeatEach}×`:""]})]})]})}),s.jsx("td",{children:s.jsx(Bb,{agents:d.agents})}),s.jsxs("td",{children:[s.jsx(An,{status:d.status}),d.warning&&s.jsx("span",{title:d.warning,style:{color:"var(--warn)"},children:" ⚠"})]}),s.jsx("td",{className:"muted small",children:d.summary??"—"}),s.jsx("td",{className:"muted small",children:Rt(d.startedAt??d.createdAt)}),s.jsx("td",{className:"muted small",children:br(d.startedAt,d.finishedAt)})]},d.id))})]}),i&&h.length===0&&s.jsx("p",{className:"muted",style:{padding:16},children:"No jobs yet."}),i&&s.jsx(ps,{page:r.page,pageSize:r.pageSize,total:i.total,onPage:r.setPage,onPageSize:r.setPageSize,label:"jobs"})]})]})}function Lm(e){return e.replace(/\.md$/i,"").toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/đ/g,"d").replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+|-+$/g,"")||"spec"}function aP(e){const t=e.filter(r=>r.lastResult);if(!t.length)return null;const n=t.filter(r=>r.lastResult.status==="passed").length;return n===t.length?{status:"passed",label:`${n}/${t.length} passed`}:{status:"failed",label:`${t.length-n}/${t.length} failed`}}function oP(){const e=ut(),{openNewSpec:t}=hs(),{specs:n,mapping:r,refresh:i}=un(),[l,a]=j.useState("all"),[o,u]=j.useState(""),[c,h]=j.useState(new Set),[d,f]=j.useState(!1),[m,p]=j.useState(null),g=j.useRef(null),w=j.useMemo(()=>n.map(R=>{const L=r.filter(U=>U.specFile===R.file&&U.status!=="orphan"),M=new Set(L.filter(U=>U.testFile).map(U=>U.tcId)).size;return{spec:R,mapped:M,total:R.parsed.tcs.length,last:aP(L)}}),[n,r]),y=R=>R.total>0&&R.mapped>=R.total,x=[...new Set(n.flatMap(R=>R.parsed.tags))].sort(),v=o.trim().toLowerCase(),b=w.filter(R=>(l==="all"||(l==="mapped"?y(R):!y(R)))&&(!v||`${R.spec.file} ${R.spec.parsed.title} ${R.spec.parsed.tags.join(" ")}`.toLowerCase().includes(v))&&(c.size===0||R.spec.parsed.tags.some(L=>c.has(L)))),A=Wh(b,[l,o,c]),k=w.reduce((R,L)=>R+L.total,0),E=w.reduce((R,L)=>R+Math.max(L.total-L.mapped,0),0),T=async R=>{const L=R.filter(U=>/\.md$/i.test(U.name));if(!L.length)return p("Only .md files are accepted");if(L.length===1){t({name:Lm(L[0].name),content:await L[0].text()});return}const M=[];for(const U of L)try{await Q.createSpec(`${Lm(U.name)}.md`,await U.text())}catch(D){M.push(`${U.name}: ${D.message}`)}i(),p(M.length?M.join(`
384
- `):null)},I=R=>{T([...R.target.files??[]]),R.target.value=""},C=R=>void Q.createJob({type:"testrun",spec:R,repeatEach:1}).then(L=>e(`/runs/${L.id}`)).catch(L=>p(L.message));return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Specification"},{label:"Specs"}]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Specs"}),s.jsx("p",{className:"page-sub",children:"Markdown specs and the test cases mapped to Playwright scripts."})]}),s.jsxs("div",{className:"row",children:[s.jsxs("button",{className:"btn ghost",onClick:()=>{var R;return(R=g.current)==null?void 0:R.click()},children:[s.jsx(Lo,{size:15})," Import .md"]}),s.jsx("input",{ref:g,type:"file",accept:".md,text/markdown",multiple:!0,hidden:!0,onChange:I}),s.jsxs(ye,{className:"btn ghost",to:"/specs/from-requirement",title:"QA Test Case Writer agent drafts the spec from a BA requirement",children:[s.jsx(hl,{size:15})," Generator"]}),s.jsxs("button",{className:"btn",onClick:()=>t(),children:[s.jsx(qt,{size:15})," New spec"]})]})]}),s.jsx(Le,{error:m}),s.jsxs("div",{className:"toolbar",children:[s.jsx(kn,{value:l,onChange:a,items:[{id:"all",label:s.jsxs(s.Fragment,{children:["All ",s.jsx("span",{className:"tab-count",children:w.length})]})},{id:"mapped",label:s.jsxs(s.Fragment,{children:["Mapped ",s.jsx("span",{className:"tab-count",children:w.filter(y).length})]})},{id:"needs",label:s.jsxs(s.Fragment,{children:["Needs mapping ",s.jsx("span",{className:"tab-count",children:w.filter(R=>!y(R)).length})]})}]}),s.jsx("div",{className:"grow"}),s.jsxs("label",{className:"search-input",children:[s.jsx(Ro,{size:15}),s.jsx("input",{value:o,onChange:R=>u(R.target.value),placeholder:"Search by file, title or tag","aria-label":"Search specs"})]}),s.jsxs("div",{className:"menu-wrap",children:[s.jsxs("button",{className:`btn ghost ${c.size?"on":""}`,onClick:()=>f(R=>!R),"aria-expanded":d,children:[s.jsx(mb,{size:15})," Tags",c.size?` (${c.size})`:""]}),d&&s.jsxs("div",{className:"menu",onMouseLeave:()=>f(!1),children:[x.length===0&&s.jsx("div",{className:"muted small pad-sm",children:"No tags yet"}),x.map(R=>s.jsxs("label",{className:"menu-item",children:[s.jsx("input",{type:"checkbox",className:"check-box",checked:c.has(R),onChange:()=>h(L=>{const M=new Set(L);return M.has(R)?M.delete(R):M.add(R),M})}),R]},R)),c.size>0&&s.jsx("button",{className:"btn ghost sm",style:{margin:6},onClick:()=>h(new Set),children:"Clear"})]})]})]}),s.jsxs("div",{className:"table-wrap table-fit",children:[s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Spec"}),s.jsx("th",{children:"Tags"}),s.jsx("th",{className:"num",children:"Test cases"}),s.jsx("th",{children:"Coverage"}),s.jsx("th",{children:"Last result"}),s.jsx("th",{className:"num",children:"Actions"})]})}),s.jsx("tbody",{children:A.pageItems.map(({spec:R,mapped:L,total:M,last:U})=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsxs(ye,{to:`/specs/${R.file}`,className:"file-cell",children:[s.jsx("span",{className:"file-icon",children:s.jsx(wr,{size:16})}),s.jsxs("div",{children:[s.jsx("div",{className:"strong",children:R.parsed.title||R.file}),s.jsxs("div",{className:"sub mono",children:[R.file,R.parsed.warnings.length>0&&s.jsxs("span",{style:{color:"var(--warn)"},children:[" · ⚠ ",R.parsed.warnings.length]})]})]})]})}),s.jsx("td",{children:R.parsed.tags.map(D=>s.jsx("span",{className:"tag",children:D},D))}),s.jsx("td",{className:"num",children:M}),s.jsx("td",{children:s.jsxs("div",{className:"cov",children:[s.jsx("span",{className:"progress",children:s.jsx("i",{style:{width:`${M?L/M*100:0}%`}})}),s.jsxs("span",{className:"small",children:[L,"/",M]})]})}),s.jsx("td",{children:U?s.jsx(ni,{status:U.status,children:U.label}):s.jsx(ni,{status:null})}),s.jsx("td",{className:"num",children:s.jsxs("div",{className:"row",style:{justifyContent:"flex-end",flexWrap:"nowrap",gap:6},children:[s.jsx(ye,{to:`/specs/${R.file}`,className:"btn ghost sm",children:"Open"}),s.jsx("button",{className:"btn ghost sm icon",onClick:()=>C(R.file),disabled:L===0,title:L?`Run ${R.file}`:"Spec has no test file yet","aria-label":`Run ${R.file}`,children:s.jsx(ft,{size:12})})]})})]},R.file))})]}),b.length===0&&s.jsx("p",{className:"muted pad",children:w.length?"No specs match the filter.":"No specs yet."}),b.length>0&&s.jsx(ps,{...A.props,label:"specs"}),s.jsxs("div",{className:"table-foot",children:[s.jsxs("span",{children:[w.length," specs · ",k," test cases"]}),s.jsx("span",{children:E?`${E} test cases need mapping`:"All test cases mapped"})]})]})]})}function uP({value:e,onChange:t}){const n=j.useRef(null),r=e.split(`
385
- `).length;return s.jsxs("div",{className:"line-editor",children:[s.jsx("div",{className:"gutter",ref:n,"aria-hidden":"true",children:Array.from({length:r},(i,l)=>s.jsx("div",{children:l+1},l))}),s.jsx("textarea",{value:e,onChange:i=>t(i.target.value),onScroll:i=>{n.current&&(n.current.scrollTop=i.currentTarget.scrollTop)},spellCheck:!1,wrap:"off","aria-label":"Spec content (markdown)"})]})}const Uv=/^(given|when|then|and|but)\b[: ]?\s*(.*)$/i,cP=/^\s*(tags|technique)\s*:/i;function dP(e){let t="given";return e.map(n=>{const r=n.trim().match(Uv),i=r[1].toLowerCase(),l=i==="and"||i==="but";return l||(t=i),{keyword:r[1][0].toUpperCase()+r[1].slice(1).toLowerCase(),kw:t,continuation:l,text:r[2].trim()}})}function hP({text:e}){return s.jsx(ui,{components:{p:({children:t})=>s.jsx(s.Fragment,{children:t})},children:e})}function fP({lines:e}){return s.jsx("ol",{className:"gherkin-steps",children:dP(e).map((t,n)=>s.jsxs("li",{className:`gherkin-step kw-${t.kw}${t.continuation?" continuation":""}`,children:[s.jsx("span",{className:"gherkin-kw",children:t.keyword})," ",s.jsx("span",{className:"gherkin-text",children:s.jsx(hP,{text:t.text})})]},n))})}function pP(e){const t=[];for(const n of e.split(/\r?\n/)){if(cP.test(n))continue;const r=Uv.test(n.trim()),i=t[t.length-1];i&&i.gherkin===r?i.lines.push(n):t.push({gherkin:r,lines:[n]})}return t}function mP({text:e}){return s.jsx(s.Fragment,{children:pP(e).map((t,n)=>{if(t.gherkin)return s.jsx(fP,{lines:t.lines},n);const r=t.lines.join(`
386
- `).trim();return r?s.jsx("div",{className:"md",children:s.jsx(ui,{children:r})},n):null})})}function gP({content:e,parsed:t}){var l;const n=e.split(/\r?\n/),r=((l=t.tcs[0])==null?void 0:l.line)??n.length+1,i=n.slice(0,r-1).filter(a=>!/^\s*#\s+/.test(a)&&!/^\s*(tags|preconditions)\s*:/i.test(a)).join(`
387
- `).trim();return s.jsxs("div",{className:"spec-preview",children:[s.jsx("h2",{children:t.title||"Untitled spec"}),(t.tags.length>0||t.preconditions)&&s.jsxs("p",{className:"meta",children:[t.tags.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"Tags:"})," ",t.tags.join(", ")]}),t.tags.length>0&&t.preconditions&&" · ",t.preconditions&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"Preconditions:"})," ",t.preconditions]})]}),i&&s.jsx("div",{className:"md",children:s.jsx(ui,{children:i})}),t.tcs.map((a,o)=>{var h;const u=((h=t.tcs[o+1])==null?void 0:h.line)??n.length+1,c=n.slice(a.line,u-1).join(`
388
- `).trim();return s.jsxs("div",{className:"tc-card",children:[s.jsxs("div",{className:"tc-card-head",children:[s.jsx("span",{className:"tc-chip",children:a.id}),s.jsx("b",{children:a.title}),a.tags.map(d=>s.jsx("span",{className:"tag",children:d},d)),a.technique&&s.jsxs("span",{className:"muted small",children:["Technique: ",a.technique]})]}),c&&s.jsx(mP,{text:c})]},`${a.id}-${o}`)})]})}function xP(){const{file:e=""}=li(),t=ut(),{refresh:n,mapping:r}=un(),i=In(),l=Ir(),[a,o]=j.useState(""),[u,c]=j.useState(""),[h,d]=j.useState(),[f,m]=j.useState(!1),[p,g]=j.useState(null),[w,y]=j.useState(null),[x,v]=j.useState(!1),[b,A]=j.useState(1),[k,E]=j.useState("split"),T=j.useRef(!1),I=$e(()=>Q.jobs(),[e]),C=f&&a!==u,R=j.useMemo(()=>jb(a),[a]),L=r.filter(F=>F.specFile===e&&F.status!=="orphan"),M=new Set(L.filter(F=>F.testFile).map(F=>F.tcId)),U=L.filter(F=>F.lastResult),D=U.filter(F=>F.lastResult.status==="passed").length,q=(I.data??[]).filter(F=>F.target===e).slice(0,5),J=j.useCallback(async()=>{try{const F=await Q.spec(e);o(F.content),c(F.content),d(F.mtimeMs),m(!0),g(null)}catch(F){g(F.message)}},[e]);j.useEffect(()=>{m(!1),T.current=!1,J()},[J]);const B=xh(({currentLocation:F,nextLocation:Z})=>C&&!T.current&&F.pathname!==Z.pathname);Rh(B,{title:"Leave with unsaved changes?",message:"Your edits to this spec are not saved and will be lost.",confirmLabel:"Discard changes",danger:!0}),j.useEffect(()=>{const F=Z=>{C&&Z.preventDefault()};return window.addEventListener("beforeunload",F),()=>window.removeEventListener("beforeunload",F)},[C]);const X=j.useCallback(async(F=!1)=>{v(!0),y(null);try{const Z=await Q.saveSpec(e,a,F?void 0:h);return c(a),d(Z.mtimeMs),g(null),y("Saved."),n(),!0}catch(Z){return Z instanceof eo&&Z.status===409&&await i({title:"Spec changed on disk",message:`${Z.message} Overwrite it with your current edits?`,confirmLabel:"Overwrite",danger:!0})?(v(!1),X(!0)):(g(Z.message),!1)}finally{v(!1)}},[a,e,h,n,i]);j.useEffect(()=>{const F=Z=>{(Z.ctrlKey||Z.metaKey)&&Z.key.toLowerCase()==="s"&&(Z.preventDefault(),C&&X())};return window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)},[C,X]);const S=async F=>{if(!(C&&!await X()))try{const Z=await Q.createJob(F);T.current=!0,t(`/runs/${Z.id}`)}catch(Z){g(Z.message)}},ae=async()=>{if(await i({title:`Delete ${e}?`,message:"The spec file is removed. Its test file in tests/e2e (if any) is NOT deleted. This cannot be undone.",confirmLabel:"Delete spec",danger:!0}))try{await Q.deleteSpec(e),T.current=!0,n(),l.success(`Deleted ${e}`),t("/specs")}catch(Z){g(Z.message)}},O=R.tcs.length===0,N=Wh(R.tcs,[e]);return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Specification"},{label:"Specs",to:"/specs"},{label:e}]}),s.jsxs(cS,{children:[s.jsxs("span",{className:"chip",children:["Coverage ",M.size,"/",R.tcs.length]}),s.jsxs("span",{className:`chip ${D<U.length?"fail":"ok"}`,children:["Pass rate ",D,"/",U.length]})]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{className:"row",style:{alignItems:"flex-start",flexWrap:"nowrap"},children:[s.jsx("button",{className:"btn ghost icon square",onClick:()=>t("/specs"),"aria-label":"Back to specs list",title:"Back to Specs",children:s.jsx(fb,{size:16})}),s.jsxs("div",{children:[s.jsxs("h1",{className:"page-title",children:[R.title||e," ",C&&s.jsx("span",{className:"badge stale",children:"unsaved"})]}),s.jsxs("p",{className:"page-sub row",style:{gap:6},children:[s.jsx("span",{className:"mono",children:e}),R.tags.map(F=>s.jsxs("span",{children:["· ",s.jsx("span",{className:"tag",children:F})]},F))]})]})]}),s.jsxs("div",{className:"row",children:[s.jsxs("button",{className:"btn ghost",onClick:()=>void X(),disabled:!C||x,title:"Ctrl+S",children:[s.jsx(cs,{size:15})," Save"]}),s.jsx("button",{className:"btn ghost icon square",onClick:()=>void(async()=>{C&&!await i({title:"Discard unsaved changes?",message:"Reloading replaces your edits with the file on disk.",confirmLabel:"Discard & reload",danger:!0})||await J()})(),disabled:x,title:"Reload from disk","aria-label":"Reload from disk",children:s.jsx(Yn,{size:15})}),s.jsx("button",{className:"btn danger icon square",onClick:()=>void ae(),disabled:x,title:"Delete spec","aria-label":"Delete spec",children:s.jsx(Ar,{size:15})})]})]}),s.jsxs("div",{className:"pipeline-bar",children:[s.jsxs("div",{className:"pipeline-steps",title:"Runs with Claude Code, no API key needed",children:[s.jsx("b",{children:"Pipeline"}),s.jsx("span",{className:"step",children:Ne.explorer.label}),"→",s.jsx("span",{className:"step",children:Ne.generator.label}),"→",s.jsx("span",{className:"step",children:Ne.validator.label}),"→",s.jsxs("span",{className:"step",children:[Ne.healer.label," ≤ 2"]})]}),s.jsx("div",{className:"grow"}),s.jsxs("button",{className:"btn ghost",onClick:()=>void S({type:"explore",spec:e}),disabled:x||O,children:[s.jsx(Ay,{size:15})," Explore"]}),s.jsxs("button",{className:"btn",onClick:()=>void S({type:"generate",spec:e}),disabled:x||O,children:[s.jsx(kh,{size:15})," Generate"]}),s.jsx("select",{className:"select",value:b,onChange:F=>A(Number(F.target.value)),"aria-label":"Repeat count",children:[1,2,3,5,10].map(F=>s.jsxs("option",{value:F,children:[F,"×"]},F))}),s.jsxs("button",{className:"btn dark",onClick:()=>void S({type:"testrun",spec:e,repeatEach:b}),disabled:x||M.size===0,title:M.size?"":"Spec has no test file yet",children:[s.jsx(ft,{size:13})," Run"]})]}),s.jsx(Le,{error:p}),w&&s.jsx("div",{className:"info-box",children:w}),f&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Spec content"}),s.jsx(kn,{value:k,onChange:E,items:[{id:"editor",label:"Editor"},{id:"split",label:"Split"},{id:"preview",label:"Preview"}]})]}),s.jsxs("div",{className:`spec-body ${k}`,children:[k!=="preview"&&s.jsx(uP,{value:a,onChange:o}),k!=="editor"&&s.jsx(gP,{content:a,parsed:R})]})]}),R.warnings.map(F=>s.jsxs("div",{className:"warn-box",children:["⚠ ",F]},F)),s.jsxs("div",{className:"card",style:{marginTop:18},children:[s.jsx("div",{className:"card-head",children:s.jsxs("h3",{children:["Test cases ",s.jsxs("span",{className:"muted",children:["(",R.tcs.length,")"]})]})}),s.jsxs("table",{className:"flat",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"TC-ID"}),s.jsx("th",{children:"Name"}),s.jsx("th",{children:"Mapping"}),s.jsx("th",{children:"Last result"}),s.jsx("th",{className:"num",children:"Actions"})]})}),s.jsx("tbody",{children:N.pageItems.map(F=>{const Z=L.find(Te=>Te.tcId===F.id),ce=Z==null?void 0:Z.lastResult;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("code",{className:"strong",children:F.id})}),s.jsx("td",{children:F.title}),s.jsx("td",{children:Z!=null&&Z.testFile?s.jsxs("span",{className:"map-link",title:`${Z.testFile}:${Z.testLine??""}`,children:[s.jsx(jh,{size:13}),s.jsx("code",{children:Z.testFile.split("/").pop()}),Z.status==="stale"&&s.jsx(yt,{status:"stale"})]}):s.jsx(yt,{status:(Z==null?void 0:Z.status)??"missing"})}),s.jsx("td",{children:ce?s.jsx(ye,{to:`/runs/${ce.jobId}`,children:s.jsx(ni,{status:ce.status,children:ce.status.charAt(0).toUpperCase()+ce.status.slice(1)})}):s.jsx(ni,{status:null})}),s.jsx("td",{className:"num",children:s.jsxs("div",{className:"tc-actions",children:[s.jsx("button",{className:"btn ghost icon tc-action gen",disabled:x,title:M.has(F.id)?`Regenerate the test of ${F.id} only (Explorer → Generator → Validator)`:`Generate a test for ${F.id} only (Explorer → Generator → Validator)`,"aria-label":`Generate ${F.id}`,onClick:()=>void S({type:"generate",spec:e,tcId:F.id}),children:s.jsx(ub,{size:16})}),s.jsx("button",{className:"btn ghost icon tc-action run",disabled:!M.has(F.id)||x,title:M.has(F.id)?`Run ${F.id}`:"TC has no test yet, run Generate","aria-label":`Run ${F.id}`,onClick:()=>void S({type:"testrun",spec:e,tcId:F.id,repeatEach:b}),children:s.jsx(ob,{size:14})})]})})]},`${F.id}-${F.line}`)})})]}),O&&s.jsx("p",{className:"muted pad",children:"No test cases yet. Add a heading like “## TC-XXX-001: Name”."}),!O&&s.jsx(ps,{...N.props,label:"test cases"})]}),q.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"Recent jobs for this spec"}),s.jsx("div",{className:"row",children:q.map(F=>s.jsxs(ye,{to:`/runs/${F.id}`,className:"card pad row",style:{padding:"8px 12px"},children:["#",F.id," ",F.type," ",s.jsx(An,{status:F.status})]},F.id))})]})]})]})}const yP={settings:"path set below",env:"QA_STUDIO_CLAUDE_BIN",path:"found on PATH"};function Mu({label:e,check:t,pending:n}){const r=t?t.ok?"ok":"fail":"pending";return s.jsxs("div",{className:`cc-row ${r}`,children:[s.jsx("span",{className:"cc-mark","aria-hidden":"true",children:r==="ok"?s.jsx(wh,{size:13}):r==="fail"?s.jsx(kr,{size:13}):"?"}),s.jsx("span",{className:"cc-label",children:e}),s.jsx("span",{className:"cc-detail",children:t?t.detail:n})]})}function vP({status:e}){const t=e.binary.ok?e.version.ok?e.test&&!e.test.ok?e.test.hint:null:"version":"path";return!t&&e.state!=="unverified"?null:s.jsxs("div",{className:"cc-guide",children:[t==="path"&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"Install Claude Code, or tell Agent Studio where it is"}),s.jsxs("ol",{children:[s.jsxs("li",{children:["Install it: in PowerShell ",s.jsx("code",{children:"irm https://claude.ai/install.ps1 | iex"}),", or with Node.js ",s.jsx("code",{children:"npm install -g @anthropic-ai/claude-code"}),"."]}),s.jsxs("li",{children:["Open a new terminal and check: ",s.jsx("code",{children:"claude --version"}),"."]}),s.jsxs("li",{children:["If Agent Studio still cannot find it, paste the full path of ",s.jsx("code",{children:"claude.exe"})," below (find it with ",s.jsx("code",{children:"where.exe claude"}),"; for an npm install use the"," ",s.jsx("code",{children:"claude.exe"})," inside ",s.jsx("code",{children:"node_modules\\@anthropic-ai\\claude-code\\bin"}),", not ",s.jsx("code",{children:"claude.cmd"}),")."]})]})]}),t==="version"&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"The binary was found but does not start"}),s.jsxs("ol",{children:[s.jsxs("li",{children:["Run ",s.jsxs("code",{children:[e.binary.detail," --version"]})," in a terminal to see the error."]}),s.jsx("li",{children:"Reinstall or update Claude Code, or point the path below to a working claude.exe."})]})]}),t==="login"&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"Log Claude Code in"}),s.jsxs("ol",{children:[s.jsxs("li",{children:["In a terminal run ",s.jsx("code",{children:"claude"}),", type ",s.jsx("code",{children:"/login"})," and sign in with your Claude account (or a Console API key)."]}),s.jsxs("li",{children:["Using an API key instead: set ",s.jsx("code",{children:"ANTHROPIC_API_KEY"})," in the environment that starts Agent Studio (not only in ",s.jsx("code",{children:".env"}),"), then restart Agent Studio."]}),s.jsx("li",{children:"Come back and run the test prompt again."})]})]}),t==="network"&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"Claude Code did not answer"}),s.jsxs("ol",{children:[s.jsx("li",{children:"Check the internet connection, proxy or VPN of this machine."}),s.jsxs("li",{children:["Run ",s.jsx("code",{children:'claude -p "hi"'})," in a terminal to see the error, then test again."]})]})]}),t==="other"&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"Claude Code returned an error"}),s.jsxs("ol",{children:[s.jsxs("li",{children:["Run ",s.jsx("code",{children:'claude -p "hi"'})," in a terminal from the repo folder to see the full message."]}),s.jsxs("li",{children:["Check usage limits with ",s.jsx("code",{children:"/usage"})," in Claude Code, then test again."]})]})]}),!t&&e.state==="unverified"&&s.jsxs("span",{children:["Claude Code is installed. Run the ",s.jsx("b",{children:"test prompt"})," once to confirm it is logged in and can answer (one short request on the smallest model; on a subscription it only counts toward usage limits)."]})]})}function jP({onChange:e}){const[t,n]=j.useState(null),[r,i]=j.useState(!1),[l,a]=j.useState(!1),[o,u]=j.useState(""),[c,h]=j.useState(null),d=async()=>{i(!0);try{const g=await Q.claudeStatus();n(g),u(w=>w||g.configuredPath),h(null),e==null||e()}catch(g){h(g.message)}finally{i(!1)}};j.useEffect(()=>{d()},[]);const f=async()=>{a(!0);try{await Q.claudeTest(),await d()}catch(g){h(g.message)}finally{a(!1)}},m=async g=>{try{await Q.saveSettings({claudeBin:g}),u(g),h(null),await d()}catch(w){h(w.message)}},p=(t==null?void 0:t.state)==="ready"?"Ready":(t==null?void 0:t.state)==="unverified"?"Installed, not verified":t?"Not ready":"Checking…";return s.jsxs("div",{className:"pad cc",children:[s.jsxs("div",{className:"row between",children:[s.jsxs("div",{children:[s.jsx("b",{children:"Claude Code"})," ",s.jsxs("span",{className:`cc-state ${(t==null?void 0:t.state)??"pending"}`,children:[s.jsx("i",{})," ",p]}),s.jsx("div",{className:"muted small",children:"The QA Explorer, QA Script Generator, QA Script Healer, QA Test Case Writer and Context Writer run through headless Claude Code (claude.exe)."})]}),s.jsxs("span",{className:"row",children:[s.jsxs("button",{className:"btn ghost sm",onClick:()=>void d(),disabled:r||l,children:[s.jsx(Yn,{size:13})," ",r?"Checking…":"Check again"]}),s.jsx("button",{className:"btn sm",onClick:()=>void f(),disabled:l||!(t!=null&&t.binary.ok)||!(t!=null&&t.version.ok),title:"Sends one short prompt through Claude Code",children:l?"Testing… (up to 2 min)":"Run test prompt"})]})]}),s.jsx(Le,{error:c}),t&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"cc-checks",children:[s.jsx(Mu,{label:"Binary",check:t.binary}),s.jsx(Mu,{label:"Starts",check:t.version}),s.jsx(Mu,{label:"Logged in & answers",check:t.test?{ok:t.test.ok,detail:`${t.test.message} · ${Rt(t.test.at)}${t.test.model?` · ${t.test.model}`:""}${t.test.costUsd!==null?` · ${Kt(t.test.costUsd)}`:""}`}:null,pending:"Not tested yet for this binary"})]}),t.source&&s.jsxs("div",{className:"muted small",children:["Using ",yP[t.source],"."]}),s.jsx(vP,{status:t})]}),s.jsxs("div",{className:"cc-path",children:[s.jsxs("label",{htmlFor:"claude-bin",className:"small",style:{fontWeight:600},children:["Path to claude.exe ",s.jsx("span",{className:"muted",style:{fontWeight:400},children:"(leave empty to use QA_STUDIO_CLAUDE_BIN or PATH)"})]}),s.jsxs("div",{className:"row",children:[s.jsx("input",{id:"claude-bin",className:"input grow mono",placeholder:"C:\\Users\\<you>\\.local\\bin\\claude.exe",value:o,onChange:g=>u(g.target.value)}),s.jsxs("button",{className:"btn ghost sm",onClick:()=>void m(o),disabled:o===((t==null?void 0:t.configuredPath)??""),children:[s.jsx(cs,{size:13})," Save path"]}),(t==null?void 0:t.configuredPath)&&s.jsx("button",{className:"btn ghost sm",onClick:()=>void m(""),children:"Use automatic"})]})]})]})}function wP(){const{data:e,error:t,reload:n}=$e(()=>Q.settings()),[r,i]=j.useState(null),[l,a]=j.useState(null),[o,u]=j.useState(!1);j.useEffect(()=>{e&&i(e.settings.maxHealRounds)},[e]);const c=e==null?void 0:e.settings.maxHealRounds,h=r!==null&&r!==c,d=async()=>{if(r!==null)try{await Q.saveSettings({maxHealRounds:r}),a(null),u(!0),setTimeout(()=>u(!1),2e3),n()}catch(f){a(f.message)}};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"setting-row",children:[s.jsxs("div",{children:[s.jsx("b",{children:"Maximum heal rounds"}),s.jsxs("div",{className:"muted small",children:["QA Validator fails → QA Script Healer fixes → back to QA Validator. The loop stops when tests pass, the QA Script Healer reports an app bug or gives up, or after this many heal rounds (prevents an infinite loop). 0 turns the QA Script Healer off. Default ",(e==null?void 0:e.defaults.maxHealRounds)??2,". Applies to jobs queued after saving."]}),s.jsx(Le,{error:t??l})]}),s.jsxs("span",{className:"row",children:[s.jsx("input",{className:"input",type:"number",min:0,max:$p,step:1,style:{width:80},value:r??"",onChange:f=>i(f.target.value===""?null:Math.max(0,Math.min($p,Math.round(Number(f.target.value))))),"aria-label":"Maximum heal rounds"}),s.jsxs("button",{className:"btn",disabled:!h,onClick:()=>void d(),children:[s.jsx(cs,{size:14})," ",o?"Saved":"Save"]})]})]}),s.jsxs("div",{className:"setting-row",children:[s.jsxs("div",{children:[s.jsx("b",{children:"Playwright HTML report"}),s.jsx("div",{className:"muted small",children:"Default for new test runs. The line reporter is always on; when this is on, runs also write the HTML report (traces, screenshots), which opens from the run page. Each run can override it."})]}),s.jsxs("label",{className:"switch",children:[s.jsx("input",{type:"checkbox",checked:(e==null?void 0:e.settings.htmlReport)??!0,disabled:!e,onChange:f=>void Q.saveSettings({htmlReport:f.target.checked}).then(n,m=>a(m.message))}),s.jsx("span",{children:e!=null&&e.settings.htmlReport?"On":"Off"})]})]})]})}function kP(){const{theme:e,toggleTheme:t,refreshClaude:n}=hs();return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"General"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Settings"}),s.jsx("p",{className:"page-sub",children:"Pipeline settings are saved in Agent Studio; appearance is stored in this browser."})]})}),s.jsxs("div",{className:"card",style:{marginBottom:12},id:"claude",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"LLM runtime"})}),s.jsx(jP,{onChange:n})]}),s.jsxs("div",{className:"settings-grid",children:[s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"Pipeline"})}),s.jsx(wP,{})]}),s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"Appearance"})}),s.jsxs("div",{className:"setting-row",children:[s.jsxs("div",{children:[s.jsx("b",{children:"Theme"}),s.jsx("div",{className:"muted small",children:"Light or dark theme."})]}),s.jsxs("button",{className:"btn ghost",onClick:t,children:[e==="dark"?s.jsx(zy,{size:15}):s.jsx(Dy,{size:15})," ",e==="dark"?"Dark":"Light"]})]}),s.jsxs("div",{className:"setting-row",children:[s.jsxs("div",{children:[s.jsx("b",{children:"Keyboard shortcuts"}),s.jsx("div",{className:"muted small",children:"Search / command palette, save spec."})]}),s.jsxs("span",{className:"row small",children:[s.jsx("span",{className:"kbd-light",children:"Ctrl K"}),s.jsx("span",{className:"kbd-light",children:"Ctrl S"})]})]})]})]})]})}function Bv({title:e,onStart:t,onClose:n,specRequired:r,newSpec:i,promptOnly:l,specAgent:a}){var A,k,E;const o=ut(),u=$e(()=>Q.specs()),[c,h]=j.useState(""),[d,f]=j.useState(""),[m,p]=j.useState(null),[g,w]=j.useState(!1);j.useEffect(()=>{const T=I=>I.key==="Escape"&&n();return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[n]);const y=async()=>{w(!0);try{let T=c.trim();i&&T&&!T.endsWith(".md")&&(T=`${T}.md`);const I=await t(T,d);o(`/runs/${I.id}`)}catch(T){p(T.message),w(!1)}},x=r?"Spec":"Spec (optional)",v=l?c?"Prompt (optional)":"Prompt":"Input (optional)",b=r?!!c.trim():l?!!c.trim()||!!d.trim():!0;return s.jsx("div",{className:"overlay",onClick:n,children:s.jsx("div",{className:"modal",role:"dialog","aria-modal":"true","aria-label":e,onClick:T=>T.stopPropagation(),children:s.jsxs("div",{className:"modal-body",style:{display:"grid",gap:12},children:[s.jsx("h3",{style:{margin:0},children:e}),s.jsx(Le,{error:m??u.error}),s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:x}),i?s.jsxs(s.Fragment,{children:[s.jsx("input",{className:"input",list:"run-dialog-specs",value:c,onChange:T=>h(T.target.value),placeholder:"new-spec.md"}),s.jsx("datalist",{id:"run-dialog-specs",children:(A=u.data)==null?void 0:A.map(T=>s.jsx("option",{value:T.file},T.file))})]}):s.jsxs("select",{className:"input",value:c,onChange:T=>h(T.target.value),children:[s.jsx("option",{value:"",children:r?"Select a spec…":l?"No spec (prompt only)":"No spec"}),(k=u.data)==null?void 0:k.map(T=>s.jsx("option",{value:T.file,children:T.file},T.file))]}),l&&a&&!c&&s.jsxs("span",{className:"muted small",children:["Without a spec, the pipeline stops at the ",((E=Ne[a])==null?void 0:E.label)??a,"."]})]}),s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:v}),s.jsx("textarea",{className:"input",rows:6,value:d,onChange:T=>f(T.target.value),placeholder:i?"The requirement to turn into the spec":"What should the agents do this time?"})]}),s.jsxs("span",{className:"row",style:{justifyContent:"flex-end"},children:[s.jsx("button",{className:"btn ghost",onClick:n,children:"Cancel"}),s.jsxs("button",{className:"btn",onClick:()=>void y(),disabled:g||!b,children:[s.jsx(ft,{size:14})," Start job"]})]})]})})})}const $u=e=>{var t;return((t=e.steps[0])==null?void 0:t.kind)==="agent"&&e.steps[0].agent==="specwriter"},Hv=Object.keys(Ne).filter(e=>e!=="custom"),Am=Hv.filter(e=>Ne[e].llm),Im=Hv.filter(e=>!Ne[e].llm),Dm=Object.keys(Ao),bP=[{tone:"opus",label:"Opus"},{tone:"sonnet",label:"Sonnet"},{tone:"haiku",label:"Haiku"},{tone:"none",label:"No LLM"}];function Wv(e){const t=e.replace(/^QA\s+/,"").split(/\s+/).filter(Boolean);return t.length>1?t.map(n=>n[0].toUpperCase()).join("").slice(0,2):(t[0]??e).slice(0,2)}function SP(){var x,v,b,A,k,E,T;const e=Ir(),t=In(),n=ut(),[r,i]=yh(),l=r.get("tab")==="custom"?"custom":"default",a=I=>i(I==="custom"?{tab:"custom"}:{},{replace:!0}),o=$e(()=>Q.settings()),u=$e(()=>Q.agentPrompts()),c=$e(()=>Q.pipelines()),h=$e(()=>Q.customAgents()),[d,f]=j.useState(null),m=((x=o.data)==null?void 0:x.settings.maxHealRounds)??null,p=I=>{var C;return(C=u.data)==null?void 0:C.find(R=>R.agent===I)},g=I=>{var R,L,M;const C=bl(I);return C?((L=(R=h.data)==null?void 0:R.find(U=>U.id===C))==null?void 0:L.model)??"none":Ne[I].llm?((M=p(I))==null?void 0:M.model)??"none":"none"},w=async I=>{if(await t({title:`Delete the pipeline "${I.name}"?`,message:"The pipeline is removed for everyone using this Agent Studio. This cannot be undone.",confirmLabel:"Delete pipeline",danger:!0}))try{await Q.deletePipeline(I.id),e.success(`Pipeline "${I.name}" deleted`),c.reload()}catch(R){e.error(R.message)}},y=(v=c.data)==null?void 0:v.length;return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Agents"}]}),s.jsxs("div",{className:"page-head ap-page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Agents & pipelines"}),s.jsx("p",{className:"page-sub",children:"Agents are the building blocks. Pipelines chain them into jobs. All agents run through Claude Code; Playwright steps run without an LLM."})]}),s.jsxs("span",{className:"row",children:[s.jsxs(ye,{to:"/agents/custom/new",className:"btn ghost",children:[s.jsx(qt,{size:15})," New agent"]}),s.jsxs(ye,{to:"/agents/pipelines/new",className:"btn",children:[s.jsx(qt,{size:15})," New pipeline"]})]})]}),s.jsxs("div",{className:"card ap-card",children:[s.jsxs("div",{className:"ap-head",children:[s.jsxs("div",{className:"ap-head-title",children:[s.jsx("h3",{children:"Agents"}),s.jsxs("span",{className:"muted small",children:[Am.length," Built-in agents · ",((b=h.data)==null?void 0:b.length)??0," custom · ",Im.length," Playwright steps · click an agent to open its details"]})]}),s.jsx("span",{className:"ap-legend","aria-label":"Model colours",children:bP.map(I=>s.jsxs("span",{children:[s.jsx("i",{className:`tone-dot tone-${I.tone}`})," ",I.label]},I.tone))})]}),s.jsx(Le,{error:u.error}),s.jsx("div",{className:"ap-group-label",children:"Built-in agents"}),s.jsx("div",{className:"ap-grid",children:Am.map(I=>s.jsx(zm,{agent:I,tone:g(I),info:p(I)},I))}),s.jsx("div",{className:"ap-group-label",children:"Custom agents"}),s.jsx(Le,{error:h.error}),((A=h.data)==null?void 0:A.length)===0&&s.jsxs("p",{className:"ap-note",children:["No custom agents yet. Click ",s.jsx("b",{children:"New agent"})," to create one."]}),!!((k=h.data)!=null&&k.length)&&s.jsx("div",{className:"ap-grid",children:h.data.map(I=>s.jsxs(ye,{to:`/agents/custom/${I.id}`,className:"ap-agent","aria-label":`${I.name}: ${I.description||"Custom agent"}`,children:[s.jsx("span",{className:`ap-avatar tone-${I.model}`,children:Wv(I.name)}),s.jsxs("span",{className:"ap-agent-text",children:[s.jsxs("b",{children:[I.name,I.skills.length>0&&s.jsxs("span",{className:"ap-custom",title:`Skills: ${I.skills.join(", ")}`,children:[I.skills.length," skill",I.skills.length===1?"":"s"]})]}),s.jsx("span",{title:I.description,children:I.description||"Custom agent"})]}),s.jsx("span",{className:`ap-pill tone-${I.model}`,children:I.model[0].toUpperCase()+I.model.slice(1)}),s.jsx("span",{className:"ap-chevron","aria-hidden":"true",children:s.jsx(ti,{size:14})})]},I.id))}),s.jsx("div",{className:"ap-group-label",children:"Playwright steps · No LLM"}),s.jsx("div",{className:"ap-grid",children:Im.map(I=>s.jsx(zm,{agent:I,tone:"none"},I))})]}),s.jsxs("div",{className:"card ap-card",children:[s.jsxs("div",{className:"ap-head",children:[s.jsx("div",{className:"ap-head-title",children:s.jsx("h3",{children:"Pipelines"})}),s.jsx(kn,{value:l,onChange:a,items:[{id:"default",label:s.jsxs(s.Fragment,{children:["Default ",s.jsx("span",{className:"tab-count",children:Dm.length})]})},{id:"custom",label:s.jsxs(s.Fragment,{children:["Custom ",s.jsx("span",{className:"tab-count",children:y??"…"})]})}]})]}),l==="default"?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"ap-note",children:"Built-in job types. Duplicate one to start a custom pipeline. Loops repeat until the QA Validator passes or the round limit is reached."}),s.jsx("div",{className:"ap-rows",children:Dm.map(I=>s.jsxs("div",{className:"ap-row",children:[s.jsx("span",{className:"ap-row-name",children:Sr[I]}),s.jsx("span",{className:"ap-row-steps",children:s.jsx(NP,{type:I,maxRounds:m,toneOf:g})}),s.jsxs("span",{className:"ap-row-meta",children:[s.jsx(gb,{size:13})," Built-in"]}),s.jsx("span",{className:"ap-row-actions",children:s.jsx("button",{className:"btn ghost sm",onClick:()=>n(`/agents/pipelines/new?from=${I}`),"aria-label":`Duplicate ${Sr[I]}`,children:"Duplicate"})})]},I))})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"ap-note",children:"Your own pipelines. Each loop repeats its agents until the first one passes, or up to its maximum iterations."}),s.jsx(Le,{error:c.error}),((E=c.data)==null?void 0:E.length)===0&&s.jsxs("div",{className:"ap-empty",children:[s.jsx("p",{className:"muted",children:"No custom pipelines yet."}),s.jsxs(ye,{to:"/agents/pipelines/new",className:"btn sm",children:[s.jsx(qt,{size:14})," New pipeline"]})]}),s.jsx("div",{className:"ap-rows",children:(T=c.data)==null?void 0:T.map(I=>s.jsxs("div",{className:"ap-row",children:[s.jsxs("span",{className:"ap-row-name",children:[s.jsx(ye,{to:`/agents/pipelines/${I.id}`,children:I.name}),I.description&&s.jsx("span",{className:"muted small ap-row-desc",children:I.description})]}),s.jsx("span",{className:"ap-row-steps",children:s.jsx(CP,{steps:I.steps,toneOf:g,custom:h.data??[]})}),s.jsx("span",{className:"ap-row-meta",title:`Updated ${Rt(I.updatedAt)}`,children:Rt(I.updatedAt)}),s.jsxs("span",{className:"ap-row-actions",children:[s.jsx("button",{className:"btn sm",onClick:()=>f(I),"aria-label":`Run pipeline ${I.name}`,children:"Run"}),s.jsx(ye,{to:`/agents/pipelines/${I.id}`,className:"btn ghost sm","aria-label":`Edit pipeline ${I.name}`,children:"Edit"}),s.jsx("button",{className:"btn danger sm icon",onClick:()=>void w(I),"aria-label":`Delete pipeline ${I.name}`,title:"Delete",children:s.jsx(Ar,{size:14})})]})]},I.id))})]})]}),d&&s.jsx(Bv,{title:`Run ${d.name}`,specRequired:$u(d),promptOnly:!$u(d),specAgent:Db(d.steps),newSpec:$u(d),onClose:()=>f(null),onStart:(I,C)=>Q.createJob({type:"pipeline",pipelineId:d.id,...I?{spec:I}:{},...C.trim()?{input:C}:{}})})]})}function zm({agent:e,tone:t,info:n}){const r=Ne[e],i=(n==null?void 0:n.customized)||(n==null?void 0:n.modelCustomized);return s.jsxs(ye,{to:`/agents/${e}`,className:`ap-agent ${r.llm?"":"step"}`,"aria-label":`${r.label}: ${r.description}`,children:[s.jsx("span",{className:`ap-avatar tone-${t}`,children:Wv(r.label)}),s.jsxs("span",{className:"ap-agent-text",children:[s.jsxs("b",{children:[r.label,i&&s.jsx("span",{className:"ap-custom",title:n!=null&&n.customized?"Custom prompt":"Custom model",children:"custom"}),!!(n!=null&&n.skills.length)&&s.jsxs("span",{className:"ap-custom",title:`Skills: ${n.skills.join(", ")}`,children:[n.skills.length," skill",n.skills.length===1?"":"s"]})]}),s.jsx("span",{title:r.description,children:r.description})]}),s.jsx("span",{className:`ap-pill tone-${t}`,children:r.llm?n?n.model[0].toUpperCase()+n.model.slice(1):"…":"No LLM"}),s.jsx("span",{className:"ap-chevron","aria-hidden":"true",children:s.jsx(ti,{size:14})})]})}const od=(e,t)=>{var n;return((n=t.find(r=>Ph(r.id)===e))==null?void 0:n.review)==="human"};function Vv({agent:e,toneOf:t,custom:n}){const r=od(e,n);return s.jsxs("span",{className:`ap-chip tone-${t(e)}`,title:r?"Human review":void 0,children:[Pl(e,n),r&&" 👤"]})}const ud=()=>s.jsx("span",{className:"ap-arrow",children:"→"});function NP({type:e,maxRounds:t,toneOf:n}){const r=Ao[e],i=e==="generate"||e==="heal",l=i?r.filter(o=>!Eh.includes(o)):r,a=e==="heal"?["healer","validator"]:["validator","healer"];return s.jsxs(s.Fragment,{children:[l.map((o,u)=>s.jsxs(j.Fragment,{children:[u>0&&s.jsx(ud,{}),s.jsx(Vv,{agent:o,toneOf:n,custom:[]})]},o)),i&&s.jsxs(s.Fragment,{children:[l.length>0&&s.jsx(ud,{}),s.jsx(Qh,{agents:a,toneOf:n,custom:[],suffix:t===null?null:`max ${t} round${t===1?"":"s"}`,swap:!0})]})]})}function CP({steps:e,toneOf:t,custom:n}){return s.jsx(s.Fragment,{children:e.map((r,i)=>s.jsxs(j.Fragment,{children:[i>0&&s.jsx(ud,{}),r.kind==="agent"?s.jsx(Vv,{agent:r.agent,toneOf:t,custom:n}):s.jsx(Qh,{agents:r.steps,toneOf:t,custom:n,suffix:`max ${r.maxIterations}×${r.endsWhen==="last"?" · until last passes":""}`,endsWhen:r.endsWhen})]},i))})}function Qh({agents:e,toneOf:t,custom:n,suffix:r,swap:i,endsWhen:l}){return s.jsxs("span",{className:"ap-loop",title:`Repeats its agents; stops when the ${l==="last"?"last":"first"} one passes or the maximum is reached`,children:[s.jsx(ls,{size:12}),e.map((a,o)=>s.jsxs(j.Fragment,{children:[o>0&&(i?s.jsx("span",{className:"ap-loop-sep",children:"⇄"}):s.jsx("span",{className:"ap-loop-sep",children:"→"})),typeof a=="string"?s.jsxs("span",{className:`ap-loop-name tone-${t(a)}`,title:od(a,n)?"Human review":void 0,children:[Pl(a,n),od(a,n)&&" 👤"]}):s.jsx(Qh,{agents:a.steps,toneOf:t,custom:n,suffix:`max ${a.maxIterations}×${a.endsWhen==="last"?" · until last passes":""}`,endsWhen:a.endsWhen})]},o)),r&&s.jsx("span",{className:"ap-loop-max",children:r})]})}function Mm(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function EP(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function TP(e,t,n){const i=_o((n||{}).ignore||[]),l=PP(t);let a=-1;for(;++a<l.length;)rd(e,o);function o(c,h,d){if(c.type==="text"&&typeof d=="number")return u(c,h,d);if(i(c,d,h[h.length-1]))return nd}function u(c,h,d){const f=h[h.length-1],m=l[a][0],p=l[a][1];let g=0,w=!1,y=[];m.lastIndex=0;let x=m.exec(c.value);for(;x;){const b=x.index,A={index:x.index,input:x.input,stack:[...h,c]};let k=p(...x,A);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1)m.lastIndex=b+1;else{if(g!==b&&v({type:"text",value:c.value.slice(g,b)}),Array.isArray(k))for(const E of k)v(E);else k&&v(k);g=b+x[0].length,w=!0}if(!m.global)break;x=m.exec(c.value)}return w?(g<c.value.length&&v({type:"text",value:c.value.slice(g)}),f.children.splice(d,1,...y)):y=[c],d+y.length;function v(b){const A=y[y.length-1];A&&A.type==="text"&&b.type==="text"?A.value+=b.value:y.push(b)}}}function PP(e){if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const t=[],n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([RP(i[0]),LP(i[1])])}return t}function RP(e){return typeof e=="string"?new RegExp(EP(e),"g"):e}function LP(e){return typeof e=="function"?e:function(){return e}}const _u="phrasing",Ou=["autolink","link","image","label"];function AP(){return{transforms:[OP],enter:{literalAutolink:DP,literalAutolinkEmail:Fu,literalAutolinkHttp:Fu,literalAutolinkWww:Fu},exit:{literalAutolink:_P,literalAutolinkEmail:$P,literalAutolinkHttp:zP,literalAutolinkWww:MP}}}function IP(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:_u,notInConstruct:Ou},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:_u,notInConstruct:Ou},{character:":",before:"[ps]",after:"\\/",inConstruct:_u,notInConstruct:Ou}]}}function DP(e){this.enter({type:"link",title:null,url:"",children:[],position:void 0},e)}function Fu(e){this.config.enter.autolinkProtocol.call(this,e)}function zP(e){this.config.exit.autolinkProtocol.call(this,e)}function MP(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function $P(e){this.config.exit.autolinkEmail.call(this,e)}function _P(e){this.exit(e)}function OP(e){TP(e,[[new RegExp("(?<![\\da-z])(https?:\\/\\/|www(?=\\.))([\\w-]*\\.[\\w\\-.]*)([^\\t\\n\\r ]*)","gi"),FP],[new RegExp("(?<![\\w+\\-.@])xmpp:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)(\\/(?:[\\w\\-/]|\\.(?=[\\dA-Za-z]))*)?","g"),HP],[new RegExp("(?<![\\w+\\-.@])mailto:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),BP],[new RegExp("(?<![\\w+\\-.]|(?:^|[^\\d@A-Za-z])(?:mailto|xmpp):)([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),UP]],{ignore:["link","linkReference"]})}function FP(e,t,n,r,i){if(!QP(i))return!1;let l="";if(/^w/i.test(t)&&(n=t+n,t="",l="http://"),Nl(n.charCodeAt(0))||!WP(n))return!1;const a=VP(n+r),o={type:"link",title:null,url:l+t+a[0],children:[{type:"text",value:t+a[0],position:void 0}],position:void 0};return a[1]?[o,{type:"text",value:a[1],position:void 0}]:o}function UP(e,t,n){return/[\d\-_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n,position:void 0}],position:void 0}}function BP(e,t,n){if(/[\d\-_]$/.test(n))return!1;const r="mailto:"+t+"@"+n;return{type:"link",title:null,url:r,children:[{type:"text",value:r,position:void 0}],position:void 0}}function HP(e,t,n,r,i){if(/[\d\-_]$/.test(n)||r&&(!/[A-Za-z]$/.test(r)||i.input.charAt(i.index+e.length)==="@"))return!1;const l="xmpp:"+t+"@"+n+(r||"");return{type:"link",title:null,url:l,children:[{type:"text",value:l,position:void 0}],position:void 0}}function WP(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[\dA-Za-z]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[\dA-Za-z]/.test(t[t.length-2])))}function VP(e){let t=e.length;for(;t>0;){const a=e.charCodeAt(t-1);if(a===33||a===34||a===38||a===39||a===41||a===44||a===46||a===58||a===59||a===60||a===62||a===63||a===93||a===125)t--;else break}if(t===e.length)return[e,void 0];let n=e.slice(t);e=e.slice(0,t);let r=n.indexOf(")");const i=Mm(e,"(");let l=Mm(e,")");for(;r!==-1&&i>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function QP(e){const t=e.input.charCodeAt(e.index-1);return e.index===0||as(t)||Nl(t)}Qv.peek=tR;function qP(){this.buffer()}function GP(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function KP(){this.buffer()}function YP(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function JP(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function XP(e){this.exit(e)}function ZP(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function eR(e){this.exit(e)}function tR(){return"["}function Qv(e,t,n,r){const i=n.createTracker(r);let l=i.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return l+=i.move(n.safe(n.associationId(e),{after:"]",before:l})),o(),a(),l+=i.move("]"),l}function nR(){return{enter:{gfmFootnoteCallString:qP,gfmFootnoteCall:GP,gfmFootnoteDefinitionLabelString:KP,gfmFootnoteDefinition:YP},exit:{gfmFootnoteCallString:JP,gfmFootnoteCall:XP,gfmFootnoteDefinitionLabelString:ZP,gfmFootnoteDefinition:eR}}}function rR(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Qv},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,l,a){const o=l.createTracker(a);let u=o.move("[^");const c=l.enter("footnoteDefinition"),h=l.enter("label");return u+=o.move(l.safe(l.associationId(r),{before:u,after:"]"})),h(),u+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),u+=o.move((t?`
389
- `:" ")+l.indentLines(l.containerFlow(r,o.current()),t?qv:sR))),c(),u}}function sR(e,t,n){return t===0?e:qv(e,t,n)}function qv(e,t,n){return(n?"":" ")+e}const iR=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];qh.attention=cR;qh.peek=dR;function lR(){return{canContainEols:["delete"],enter:{strikethrough:oR},exit:{strikethrough:uR}}}function aR(){return{handlers:{delete:qh},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:iR}]}}function oR(e){this.enter({type:"delete",children:[],position:void 0},e)}function uR(e){this.exit(e)}function qh(e,t,n,r){const i=n.createTracker(r),l=n.stack.includes("strikethrough")?"~":"~~",a=n.enter("strikethrough");let o=i.move(l);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move(l),a(),o}function cR(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function dR(){return"~"}function hR(e){return e.length}function fR(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||hR,l=[],a=[],o=[],u=[];let c=0,h=-1;for(;++h<e.length;){const g=[],w=[];let y=-1;for(e[h].length>c&&(c=e[h].length);++y<e[h].length;){const x=pR(e[h][y]);if(n.alignDelimiters!==!1){const v=i(x);w[y]=v,(u[y]===void 0||v>u[y])&&(u[y]=v)}g.push(x)}a[h]=g,o[h]=w}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<c;)l[d]=$m(r[d]);else{const g=$m(r);for(;++d<c;)l[d]=g}d=-1;const f=[],m=[];for(;++d<c;){const g=l[d];let w="",y="";g===99?(w=":",y=":"):g===108?w=":":g===114&&(y=":");let x=n.alignDelimiters===!1?1:Math.max(1,u[d]-w.length-y.length);const v=w+"-".repeat(x)+y;n.alignDelimiters!==!1&&(x=w.length+x+y.length,x>u[d]&&(u[d]=x),m[d]=x),f[d]=v}a.splice(1,0,f),o.splice(1,0,m),h=-1;const p=[];for(;++h<a.length;){const g=a[h],w=o[h],y=n.fillRows===!1?Math.max(1,a[h===1?0:h].length):c;d=-1;const x=[];for(;++d<y;){const v=g[d]||"";let b="",A="";if(n.alignDelimiters!==!1){const k=u[d]-(w[d]||0),E=l[d];if(E===114)b=" ".repeat(k);else if(E===99){const T=k/2;k%2?(b=" ".repeat(T+.5),A=" ".repeat(T-.5)):(b=" ".repeat(T),A=b)}else A=" ".repeat(k)}n.delimiterStart!==!1&&!d&&x.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||d)&&x.push(" "),n.alignDelimiters!==!1&&x.push(b),x.push(v),n.alignDelimiters!==!1&&x.push(A),n.padding!==!1&&x.push(" "),(n.delimiterEnd!==!1||d!==y-1)&&x.push("|")}p.push(n.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return p.join(`
390
- `)}function pR(e){return e==null?"":String(e)}function $m(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const mR=_o(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function gR(e,t,n,r){const i=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const a=n.indentLines(n.containerFlow(e,l.current()),xR);return i(),a}function xR(e,t,n){return">"+(n?"":" ")+e}function yR(e,t){return _m(e,t.inConstruct,!0)&&!_m(e,t.notInConstruct,!1)}function _m(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Om(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){const l=n.unsafe[i];if(l.character===`
391
- `&&!l.before&&!l.after&&yR(n.stack,l))return/[\t ]/.test(r.before)?"":" "}return`\\
392
- `}function vR(e,t){const n=String(e);let r=n.indexOf(t),i=r,l=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++l>a&&(a=l):l=1,i=r+t.length,r=n.indexOf(t,i);return a}function jR(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^\n\r ]/.test(e.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function wR(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function kR(e,t,n,r){const i=wR(n),l=e.value||"";if(jR(e,n)){const d=n.enter("codeIndented"),f=n.indentLines(l,bR);return d(),f}const a=n.createTracker(r),o=i.repeat(Math.max(vR(l,i)+1,3)),u=n.enter("codeFenced"),c=i==="`"?"GraveAccent":"Tilde";let h=a.move(o);if(e.lang){const d=n.enter(`codeFencedLang${c}`);h+=a.move(n.safe(e.lang,{before:h,after:" ",encode:["`"],...a.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${c}`);h+=a.move(" "),h+=a.move(n.safe(e.meta,{before:h,after:`
372
+ `}),n}function pm(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function mm(e,t){const n=eT(e,t),r=n.one(e,void 0),i=VE(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
373
+ `},i),l}function iT(e,t){return e&&"run"in e?async function(n,r){const i=mm(n,{file:r,...t});await e.run(i,r)}:function(n,r){return mm(n,{file:r,...e||t})}}function gm(e){if(e)throw e}var Ca=Object.prototype.hasOwnProperty,_v=Object.prototype.toString,xm=Object.defineProperty,ym=Object.getOwnPropertyDescriptor,vm=function(t){return typeof Array.isArray=="function"?Array.isArray(t):_v.call(t)==="[object Array]"},jm=function(t){if(!t||_v.call(t)!=="[object Object]")return!1;var n=Ca.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ca.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Ca.call(t,i)},wm=function(t,n){xm&&n.name==="__proto__"?xm(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},km=function(t,n){if(n==="__proto__")if(Ca.call(t,n)){if(ym)return ym(t,n).value}else return;return t[n]},lT=function e(){var t,n,r,i,l,a,o=arguments[0],u=1,c=arguments.length,h=!1;for(typeof o=="boolean"&&(h=o,o=arguments[1]||{},u=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});u<c;++u)if(t=arguments[u],t!=null)for(n in t)r=km(o,n),i=km(t,n),o!==i&&(h&&i&&(jm(i)||(l=vm(i)))?(l?(l=!1,a=r&&vm(r)?r:[]):a=r&&jm(r)?r:{},wm(o,{name:n,newValue:e(h,a,i)})):typeof i<"u"&&wm(o,{name:n,newValue:i}));return o};const Pu=gd(lT);function ad(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function aT(){const e=[],t={run:n,use:r};return t;function n(...i){let l=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(u,...c){const h=e[++l];let d=-1;if(u){a(u);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,h?oT(h,o)(...c):a(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function oT(e,t){let n;return r;function r(...a){const o=e.length>a.length;let u;o&&a.push(i);try{u=e.apply(this,a)}catch(c){const h=c;if(o&&n)throw h;return i(h)}o||(u&&u.then&&typeof u.then=="function"?u.then(l,i):u instanceof Error?i(u):l(u))}function i(a,...o){n||(n=!0,t(a,...o))}function l(a){i(null,a)}}const En={basename:uT,dirname:cT,extname:dT,join:hT,sep:"/"};function uT(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');El(e);let n=0,r=-1,i=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else a<0&&(l=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function cT(e){if(El(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function dT(e){El(e);let t=e.length,n=-1,r=0,i=-1,l=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?i<0?i=t:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||n<0||l===0||l===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function hT(...e){let t=-1,n;for(;++t<e.length;)El(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":fT(n)}function fT(e){El(e);const t=e.codePointAt(0)===47;let n=pT(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function pT(e,t){let n="",r=0,i=-1,l=0,a=-1,o,u;for(;++a<=e.length;){if(a<e.length)o=e.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||l===1))if(i!==a-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=a,l=0;continue}}else if(n.length>0){n="",r=0,i=a,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,l=0}else o===46&&l>-1?l++:l=-1}return n}function El(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const mT={cwd:gT};function gT(){return"/"}function od(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function xT(e){if(typeof e=="string")e=new URL(e);else if(!od(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return yT(e)}function yT(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Ru=["history","path","basename","stem","extname","dirname"];class Ov{constructor(t){let n;t?od(t)?n={path:t}:typeof t=="string"||vT(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":mT.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ru.length;){const l=Ru[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let i;for(i in n)Ru.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?En.basename(this.path):void 0}set basename(t){Au(t,"basename"),Lu(t,"basename"),this.path=En.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?En.dirname(this.path):void 0}set dirname(t){bm(this.basename,"dirname"),this.path=En.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?En.extname(this.path):void 0}set extname(t){if(Lu(t,"extname"),bm(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=En.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){od(t)&&(t=xT(t)),Au(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?En.basename(this.path,this.extname):void 0}set stem(t){Au(t,"stem"),Lu(t,"stem"),this.path=En.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new zo(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Lu(e,t){if(e&&e.includes(En.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+En.sep+"`")}function Au(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function bm(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function vT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const jT=function(e){const r=this.constructor.prototype,i=r[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l},wT={}.hasOwnProperty;class Hh extends jT{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=aT()}copy(){const t=new Hh;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Pu(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(zu("data",this.frozen),this.namespace[t]=n,this):wT.call(this.namespace,t)&&this.namespace[t]||void 0:t?(zu("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=sa(t),r=this.parser||this.Parser;return Iu("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Iu("process",this.parser||this.Parser),Du("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(l,a){const o=sa(t),u=r.parse(o);r.run(u,o,function(h,d,f){if(h||!d||!f)return c(h);const m=d,p=r.stringify(m,f);ST(p)?f.value=p:f.result=p,c(h,f)});function c(h,d){h||!d?a(h):l?l(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Iu("processSync",this.parser||this.Parser),Du("processSync",this.compiler||this.Compiler),this.process(t,i),Nm("processSync","process",n),r;function i(l,a){n=!0,gm(l),r=a}}run(t,n,r){Sm(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(a,o){const u=sa(n);i.run(t,u,c);function c(h,d,f){const m=d||t;h?o(h):a?a(m):r(void 0,m,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,l),Nm("runSync","run",r),i;function l(a,o){gm(a),i=o,r=!0}}stringify(t,n){this.freeze();const r=sa(n),i=this.compiler||this.Compiler;return Du("stringify",i),Sm(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(zu("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(c){if(typeof c=="function")u(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[h,...d]=c;u(h,d)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(c.plugins),c.settings&&(i.settings=Pu(!0,i.settings,c.settings))}function o(c){let h=-1;if(c!=null)if(Array.isArray(c))for(;++h<c.length;){const d=c[h];l(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function u(c,h){let d=-1,f=-1;for(;++d<r.length;)if(r[d][0]===c){f=d;break}if(f===-1)r.push([c,...h]);else if(h.length>0){let[m,...p]=h;const g=r[f][1];ad(g)&&ad(m)&&(m=Pu(!0,g,m)),r[f]=[c,m,...p]}}}}const kT=new Hh().freeze();function Iu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Du(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function zu(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Sm(e){if(!ad(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Nm(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function sa(e){return bT(e)?e:new Ov(e)}function bT(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ST(e){return typeof e=="string"||NT(e)}function NT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const CT="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Cm=[],Em={allowDangerousHtml:!0},ET=/^(https?|ircs?|mailto|xmpp)$/i,TT=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function zr(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,l=e.components,a=e.disallowedElements,o=e.rehypePlugins||Cm,u=e.remarkPlugins||Cm,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Em}:Em,h=e.skipHtml,d=e.unwrapDisallowed,f=e.urlTransform||PT,m=kT().use(cE).use(u).use(iT,c).use(o),p=new Ov;typeof r=="string"&&(p.value=r);for(const x of TT)Object.hasOwn(e,x.from)&&(""+x.from+(x.to?"use `"+x.to+"` instead":"remove it")+CT+x.id,void 0);const g=m.parse(p);let w=m.runSync(g,p);return i&&(w={type:"element",tagName:"div",properties:{className:i},children:w.type==="root"?w.children:[w]}),Uo(w,y),YS(w,{Fragment:s.Fragment,components:l,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function y(x,v,b){if(x.type==="raw"&&b&&typeof v=="number")return h?b.children.splice(v,1):b.children[v]={type:"text",value:x.value},v;if(x.type==="element"){let A;for(A in Cu)if(Object.hasOwn(Cu,A)&&Object.hasOwn(x.properties,A)){const k=x.properties[A],E=Cu[A];(E===null||E.includes(x.tagName))&&(x.properties[A]=f(String(k||""),A,x))}}if(x.type==="element"){let A=t?!t.includes(x.tagName):a?a.includes(x.tagName):!1;if(!A&&n&&typeof v=="number"&&(A=!n(x,v,b)),A&&b&&typeof v=="number")return d&&x.children?b.children.splice(v,1,...x.children):b.children.splice(v,1),v}}}function PT(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||ET.test(e.slice(0,t))?e:""}function Tm(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function RT(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function LT(e,t,n){const i=Oo((n||{}).ignore||[]),l=AT(t);let a=-1;for(;++a<l.length;)sd(e,o);function o(c,h,d){if(c.type==="text"&&typeof d=="number")return u(c,h,d);if(i(c,d,h[h.length-1]))return rd}function u(c,h,d){const f=h[h.length-1],m=l[a][0],p=l[a][1];let g=0,w=!1,y=[];m.lastIndex=0;let x=m.exec(c.value);for(;x;){const b=x.index,A={index:x.index,input:x.input,stack:[...h,c]};let k=p(...x,A);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1)m.lastIndex=b+1;else{if(g!==b&&v({type:"text",value:c.value.slice(g,b)}),Array.isArray(k))for(const E of k)v(E);else k&&v(k);g=b+x[0].length,w=!0}if(!m.global)break;x=m.exec(c.value)}return w?(g<c.value.length&&v({type:"text",value:c.value.slice(g)}),f.children.splice(d,1,...y)):y=[c],d+y.length;function v(b){const A=y[y.length-1];A&&A.type==="text"&&b.type==="text"?A.value+=b.value:y.push(b)}}}function AT(e){if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const t=[],n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([IT(i[0]),DT(i[1])])}return t}function IT(e){return typeof e=="string"?new RegExp(RT(e),"g"):e}function DT(e){return typeof e=="function"?e:function(){return e}}const Mu="phrasing",$u=["autolink","link","image","label"];function zT(){return{transforms:[BT],enter:{literalAutolink:$T,literalAutolinkEmail:_u,literalAutolinkHttp:_u,literalAutolinkWww:_u},exit:{literalAutolink:UT,literalAutolinkEmail:FT,literalAutolinkHttp:_T,literalAutolinkWww:OT}}}function MT(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Mu,notInConstruct:$u},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Mu,notInConstruct:$u},{character:":",before:"[ps]",after:"\\/",inConstruct:Mu,notInConstruct:$u}]}}function $T(e){this.enter({type:"link",title:null,url:"",children:[],position:void 0},e)}function _u(e){this.config.enter.autolinkProtocol.call(this,e)}function _T(e){this.config.exit.autolinkProtocol.call(this,e)}function OT(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function FT(e){this.config.exit.autolinkEmail.call(this,e)}function UT(e){this.exit(e)}function BT(e){LT(e,[[new RegExp("(?<![\\da-z])(https?:\\/\\/|www(?=\\.))([\\w-]*\\.[\\w\\-.]*)([^\\t\\n\\r ]*)","gi"),HT],[new RegExp("(?<![\\w+\\-.@])xmpp:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)(\\/(?:[\\w\\-/]|\\.(?=[\\dA-Za-z]))*)?","g"),QT],[new RegExp("(?<![\\w+\\-.@])mailto:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),VT],[new RegExp("(?<![\\w+\\-.]|(?:^|[^\\d@A-Za-z])(?:mailto|xmpp):)([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),WT]],{ignore:["link","linkReference"]})}function HT(e,t,n,r,i){if(!KT(i))return!1;let l="";if(/^w/i.test(t)&&(n=t+n,t="",l="http://"),Nl(n.charCodeAt(0))||!qT(n))return!1;const a=GT(n+r),o={type:"link",title:null,url:l+t+a[0],children:[{type:"text",value:t+a[0],position:void 0}],position:void 0};return a[1]?[o,{type:"text",value:a[1],position:void 0}]:o}function WT(e,t,n){return/[\d\-_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n,position:void 0}],position:void 0}}function VT(e,t,n){if(/[\d\-_]$/.test(n))return!1;const r="mailto:"+t+"@"+n;return{type:"link",title:null,url:r,children:[{type:"text",value:r,position:void 0}],position:void 0}}function QT(e,t,n,r,i){if(/[\d\-_]$/.test(n)||r&&(!/[A-Za-z]$/.test(r)||i.input.charAt(i.index+e.length)==="@"))return!1;const l="xmpp:"+t+"@"+n+(r||"");return{type:"link",title:null,url:l,children:[{type:"text",value:l,position:void 0}],position:void 0}}function qT(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[\dA-Za-z]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[\dA-Za-z]/.test(t[t.length-2])))}function GT(e){let t=e.length;for(;t>0;){const a=e.charCodeAt(t-1);if(a===33||a===34||a===38||a===39||a===41||a===44||a===46||a===58||a===59||a===60||a===62||a===63||a===93||a===125)t--;else break}if(t===e.length)return[e,void 0];let n=e.slice(t);e=e.slice(0,t);let r=n.indexOf(")");const i=Tm(e,"(");let l=Tm(e,")");for(;r!==-1&&i>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function KT(e){const t=e.input.charCodeAt(e.index-1);return e.index===0||os(t)||Nl(t)}Fv.peek=sP;function YT(){this.buffer()}function JT(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function XT(){this.buffer()}function ZT(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function eP(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=jn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function tP(e){this.exit(e)}function nP(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=jn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function rP(e){this.exit(e)}function sP(){return"["}function Fv(e,t,n,r){const i=n.createTracker(r);let l=i.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return l+=i.move(n.safe(n.associationId(e),{after:"]",before:l})),o(),a(),l+=i.move("]"),l}function iP(){return{enter:{gfmFootnoteCallString:YT,gfmFootnoteCall:JT,gfmFootnoteDefinitionLabelString:XT,gfmFootnoteDefinition:ZT},exit:{gfmFootnoteCallString:eP,gfmFootnoteCall:tP,gfmFootnoteDefinitionLabelString:nP,gfmFootnoteDefinition:rP}}}function lP(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Fv},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,l,a){const o=l.createTracker(a);let u=o.move("[^");const c=l.enter("footnoteDefinition"),h=l.enter("label");return u+=o.move(l.safe(l.associationId(r),{before:u,after:"]"})),h(),u+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),u+=o.move((t?`
374
+ `:" ")+l.indentLines(l.containerFlow(r,o.current()),t?Uv:aP))),c(),u}}function aP(e,t,n){return t===0?e:Uv(e,t,n)}function Uv(e,t,n){return(n?"":" ")+e}const oP=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Wh.attention=fP;Wh.peek=pP;function uP(){return{canContainEols:["delete"],enter:{strikethrough:dP},exit:{strikethrough:hP}}}function cP(){return{handlers:{delete:Wh},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:oP}]}}function dP(e){this.enter({type:"delete",children:[],position:void 0},e)}function hP(e){this.exit(e)}function Wh(e,t,n,r){const i=n.createTracker(r),l=n.stack.includes("strikethrough")?"~":"~~",a=n.enter("strikethrough");let o=i.move(l);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move(l),a(),o}function fP(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function pP(){return"~"}function mP(e){return e.length}function gP(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||mP,l=[],a=[],o=[],u=[];let c=0,h=-1;for(;++h<e.length;){const g=[],w=[];let y=-1;for(e[h].length>c&&(c=e[h].length);++y<e[h].length;){const x=xP(e[h][y]);if(n.alignDelimiters!==!1){const v=i(x);w[y]=v,(u[y]===void 0||v>u[y])&&(u[y]=v)}g.push(x)}a[h]=g,o[h]=w}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<c;)l[d]=Pm(r[d]);else{const g=Pm(r);for(;++d<c;)l[d]=g}d=-1;const f=[],m=[];for(;++d<c;){const g=l[d];let w="",y="";g===99?(w=":",y=":"):g===108?w=":":g===114&&(y=":");let x=n.alignDelimiters===!1?1:Math.max(1,u[d]-w.length-y.length);const v=w+"-".repeat(x)+y;n.alignDelimiters!==!1&&(x=w.length+x+y.length,x>u[d]&&(u[d]=x),m[d]=x),f[d]=v}a.splice(1,0,f),o.splice(1,0,m),h=-1;const p=[];for(;++h<a.length;){const g=a[h],w=o[h],y=n.fillRows===!1?Math.max(1,a[h===1?0:h].length):c;d=-1;const x=[];for(;++d<y;){const v=g[d]||"";let b="",A="";if(n.alignDelimiters!==!1){const k=u[d]-(w[d]||0),E=l[d];if(E===114)b=" ".repeat(k);else if(E===99){const T=k/2;k%2?(b=" ".repeat(T+.5),A=" ".repeat(T-.5)):(b=" ".repeat(T),A=b)}else A=" ".repeat(k)}n.delimiterStart!==!1&&!d&&x.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||d)&&x.push(" "),n.alignDelimiters!==!1&&x.push(b),x.push(v),n.alignDelimiters!==!1&&x.push(A),n.padding!==!1&&x.push(" "),(n.delimiterEnd!==!1||d!==y-1)&&x.push("|")}p.push(n.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return p.join(`
375
+ `)}function xP(e){return e==null?"":String(e)}function Pm(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const yP=Oo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function vP(e,t,n,r){const i=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const a=n.indentLines(n.containerFlow(e,l.current()),jP);return i(),a}function jP(e,t,n){return">"+(n?"":" ")+e}function wP(e,t){return Rm(e,t.inConstruct,!0)&&!Rm(e,t.notInConstruct,!1)}function Rm(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Lm(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){const l=n.unsafe[i];if(l.character===`
376
+ `&&!l.before&&!l.after&&wP(n.stack,l))return/[\t ]/.test(r.before)?"":" "}return`\\
377
+ `}function kP(e,t){const n=String(e);let r=n.indexOf(t),i=r,l=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++l>a&&(a=l):l=1,i=r+t.length,r=n.indexOf(t,i);return a}function bP(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^\n\r ]/.test(e.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function SP(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function NP(e,t,n,r){const i=SP(n),l=e.value||"";if(bP(e,n)){const d=n.enter("codeIndented"),f=n.indentLines(l,CP);return d(),f}const a=n.createTracker(r),o=i.repeat(Math.max(kP(l,i)+1,3)),u=n.enter("codeFenced"),c=i==="`"?"GraveAccent":"Tilde";let h=a.move(o);if(e.lang){const d=n.enter(`codeFencedLang${c}`);h+=a.move(n.safe(e.lang,{before:h,after:" ",encode:["`"],...a.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${c}`);h+=a.move(" "),h+=a.move(n.safe(e.meta,{before:h,after:`
393
378
  `,encode:["`"],...a.current()})),d()}return h+=a.move(`
394
379
  `),l&&(h+=a.move(l+`
395
- `)),h+=a.move(o),u(),h}function bR(e,t,n){return(n?"":" ")+e}function Gh(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function SR(e,t,n,r){const i=Gh(n),l=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const u=n.createTracker(r);let c=u.move("[");return c+=u.move(n.safe(n.associationId(e),{before:c,after:"]",...u.current()})),c+=u.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(o=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":`
396
- `,...u.current()}))),o(),e.title&&(o=n.enter(`title${l}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),o()),a(),c}function NR(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function oo(e){const t=e.codePointAt(0);return t===void 0?"":String.fromCodePoint(t)}function Ws(e){const t=e.codePointAt(e.length-2);return t!==void 0&&t>65535?e.slice(-2):e.slice(-1)}function Gv(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Fm(e,t,n){const r=Nr(e),i=Nr(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function CR(e){if(e.charCodeAt(0)!==60)return;const t=e.charCodeAt(1);if(t===33){const o=e.charCodeAt(2);return o===45?2:o===91?5:vt(o)?4:void 0}if(t===63)return 3;const n=t===47,r=n?2:1;let i=r,l=e.charCodeAt(i);if(!vt(l))return;for(;l===45||jt(l);)l=e.charCodeAt(++i);const a=e.slice(r,i).toLowerCase();return!n&&l!==47&&td.includes(a)?1:bv.includes(a)?6:7}const Kv=new Map([["*",!1],["_",!0]]);function ER(e,t,n){const r=new Set;for(const l of e){const a=n.get(l);if(a&&l.attention&&t.some(o=>o.attention===l.attention))for(const o of a.tokens)r.add(o.attention)}const i=[];for(const l of e)l.attention&&r.delete(l.attention)&&i.push(l.attention);return i.reverse(),i}function Yv(e,t,n){const r=[],i=new Map,l=new Map;let a=0;for(;a<e.length;){if(!e[a].attention){a++;continue}const o=e[a].value.charAt(0),u=Kv.get(o);let c=a+1;for(;c<e.length&&e[c].attention&&e[c].value.charAt(0)===o;)c++;const h=a?e[a-1].value:t,d=Nr(h.charCodeAt(h.length-1)),f=Nr((c<e.length?e[c].value:n).charCodeAt(0)),m=!f||f===2&&!!d,p=!d||d===2&&!!f,g={tokens:e.slice(a,c),markers:[],start:0,end:0,open:u?m&&(!!d||!p):m,close:u?p&&(!!f||!m):p,split:u!==void 0};for(const w of g.tokens){i.set(w,[...g.tokens]),l.set(w,g);let y=w.value.length;for(;y--;)g.markers.push(w)}g.end=g.markers.length,r.push(g),a=c}for(PR(r,i),a=-1;++a<e.length;){const o=i.get(e[a]);if(o)return{attention:ER(e,o,l),index:a}}}function aa(e,t){const n=e[t?0:e.length-1];if(!n||n.attention)return;const r=t?oo(n.value):Ws(n.value),i=Gv(r.codePointAt(0));if(t)n.value=i+n.value.slice(r.length);else{let l=n.value.slice(0,n.value.length-r.length),a=0;for(;l.charCodeAt(l.length-1-a)===92;)a++;a%2&&(l+="\\"),n.value=l+i}}function TR(e,t,n,r,i){for(const l of n.attention){const a=t.get(l)||l.sequences[0];for(const o of l.sequences){if(o===a)continue;const u=new Map(t);u.set(l,o);const c=Uo(e,u,r,i),h=Yv(c,r,i);if(!h||h.index>n.index)return{chosen:u,mistake:h,tokens:c}}}}function PR(e,t){const n=new Map;for(const r of e){const i=r.tokens[0].value.charAt(0);let l=n.get(i);l||(l=[],n.set(i,l));let a=r.close?l.length:0;for(;a--&&r.start<r.end;){const o=l[a],u=o.end-o.start,c=r.end-r.start;if(r.split?(o.close||r.open)&&c%3&&!((u+c)%3):u!==o.markers.length||u!==c)continue;const h=r.split?u>1&&c>1?2:1:c,d=o.markers.slice(o.end-h,o.end),f=r.markers.slice(r.start,r.start+h),m=d[0],p=f[0];if(m===d[h-1]&&m.value.length===h&&p===f[h-1]&&p.value.length===h&&m.attention===p.attention)t.delete(m),t.delete(p);else{const g=[...new Set([...d,...f])];for(const w of g){const y=t.get(w);y&&y.push(...g)}}o.end-=h,r.start+=h,o.start===o.end&&l.splice(a,1),a=l.length}r.open&&r.start<r.end&&l.push(r)}}function RR(e,t,n){if(t.length===0)throw new Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(n.length===0)throw new Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(const i of n)if(!Number.isSafeInteger(i)||i<1)throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as size, expected positive integer");const r=[];for(const i of t){if(i.length!==1)throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected a single ascii character");if(!pv(i.charCodeAt(0)))throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected ascii punctuation");for(const l of n)r.push(i.repeat(l))}return r}function LR(e,t,n){const r=t.indexStack,i=e.children||[],l=[];let a=-1,o=n.before;r.push(-1);let u=t.createTracker(n);for(;++a<i.length;){const c=i[a];let h;if(r[r.length-1]=a,a+1<i.length){let m=t.handle.handlers[i[a+1].type];m&&m.peek&&(m=m.peek),h=m?oo(m(i[a+1],e,t,{before:"",after:"",...u.current()})):""}else h=n.after;const d=l[l.length-1];typeof d=="string"&&(o==="\r"||o===`
397
- `)&&c.type==="html"&&CR(c.value)!==7&&(l[l.length-1]=d.replace(/(\r?\n|\r)$/," "),o=" ",u=t.createTracker(n),u.move(Bo(l,n.before,n.after)));const f=t.handle.handlers[c.type];if(f&&f.attention){const m=Kh(c,f.attention,t,u);if(!m)continue;l.push(m),o=Ws(m.sequences[0])}else{const m=t.handle(c,e,t,{...u.current(),after:h,before:o});if(!m)continue;u.move(m),l.push(m),o=Ws(m)}}return r.pop(),l}function Kh(e,t,n,r){const{construct:i,markers:l,sizes:a}=t(e,n),o=RR(e.type,l,a),u=o[0],c=n.enter(i),h=n.createTracker(r.current());h.move(u);const d=LR(e,n,{...h.current(),before:u,after:u});if(c(),d.length!==0)return r.move(u),r.move(Bo(d,u,u)),r.move(u),{children:d,sequences:o}}function Um(e,t,n,r){let i=Uo(e,t,n,r),l=Yv(i,n,r);for(;l;){const a=TR(e,t,l,n,r);if(!a)return;t=a.chosen,i=a.tokens,l=a.mistake}return i}function Jv(e,t,n,r){let i=n,l=-1;for(;++l<e.length;){const a=e[l];if(typeof a=="string"){i="";continue}const o=l===e.length-1?r:"",u=a.sequences.find(function(c){const h=c.charAt(0);return h!==i.charAt(0)&&h!==o.charAt(0)||e.length===1&&Kv.has(h)&&c.length>n.length})||a.sequences[0];u!==a.sequences[0]&&t.set(a,u),Jv(a.children,t,u,u),i=u}}function Uo(e,t,n,r){const i=[];let l,a=Ws(n),o=-1;for(;++o<e.length;){const u=e[o];if(typeof u=="string"){const v={value:u,attention:void 0};l&&l===oo(u)&&aa([v],!0),l=void 0,i.push(v),v.value&&(a=Ws(v.value));continue}const c=t.get(u)||u.sequences[0],h=c.charAt(0),d=e[o+1],f=a,m=oo(d===void 0?r:typeof d=="string"?d:t.get(d)||d.sequences[0]),p=Uo(u.children,t,c,c),g=p[0].value,w=Fm(f.charCodeAt(f.length-1),g.charCodeAt(0),h);w.inside&&aa(p,!0);const y=Ws(p[p.length-1].value),x=Fm(m.charCodeAt(0),y.charCodeAt(y.length-1),h);x.inside&&aa(p,!1),w.outside&&f!==`
398
- `&&f!=="\r"&&aa(i,!1),x.outside&&(l=m),i.push({value:c,attention:u},...p,{value:c,attention:u}),a=c.charAt(c.length-1)}return i}function Bo(e,t,n){const r=new Map;Jv(e,r,t,n);const i=(r.size>0?Um(e,r,t,n):void 0)||Um(e,new Map,t,n)||Uo(e,new Map,t,n);let l="";for(const a of i)l+=a.value;return l}Yh.attention=Xv;Yh.peek=AR;function Yh(e,t,n,r){const i=n.enter("phrasing"),l=Kh(e,Xv,n,n.createTracker(r)),a=l?Bo([l],r.before,r.after):"";return i(),a}function Xv(e,t){return{construct:"emphasis",markers:NR(t)==="*"?["*","_"]:["_","*"],sizes:[1]}}function AR(e,t,n){return n.options.emphasis||"*"}function IR(e,t){let n=!1;return Fo(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,qi}),!!((!e.depth||e.depth<3)&&zo(e)&&(t.options.setext||n))}function DR(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(IR(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),m=n.containerPhrasing(e,{...l.current(),before:`
380
+ `)),h+=a.move(o),u(),h}function CP(e,t,n){return(n?"":" ")+e}function Vh(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function EP(e,t,n,r){const i=Vh(n),l=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const u=n.createTracker(r);let c=u.move("[");return c+=u.move(n.safe(n.associationId(e),{before:c,after:"]",...u.current()})),c+=u.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(o=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":`
381
+ `,...u.current()}))),o(),e.title&&(o=n.enter(`title${l}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),o()),a(),c}function TP(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function ao(e){const t=e.codePointAt(0);return t===void 0?"":String.fromCodePoint(t)}function Vs(e){const t=e.codePointAt(e.length-2);return t!==void 0&&t>65535?e.slice(-2):e.slice(-1)}function Bv(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Am(e,t,n){const r=Nr(e),i=Nr(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function PP(e){if(e.charCodeAt(0)!==60)return;const t=e.charCodeAt(1);if(t===33){const o=e.charCodeAt(2);return o===45?2:o===91?5:vt(o)?4:void 0}if(t===63)return 3;const n=t===47,r=n?2:1;let i=r,l=e.charCodeAt(i);if(!vt(l))return;for(;l===45||jt(l);)l=e.charCodeAt(++i);const a=e.slice(r,i).toLowerCase();return!n&&l!==47&&nd.includes(a)?1:Cv.includes(a)?6:7}const Hv=new Map([["*",!1],["_",!0]]);function RP(e,t,n){const r=new Set;for(const l of e){const a=n.get(l);if(a&&l.attention&&t.some(o=>o.attention===l.attention))for(const o of a.tokens)r.add(o.attention)}const i=[];for(const l of e)l.attention&&r.delete(l.attention)&&i.push(l.attention);return i.reverse(),i}function Wv(e,t,n){const r=[],i=new Map,l=new Map;let a=0;for(;a<e.length;){if(!e[a].attention){a++;continue}const o=e[a].value.charAt(0),u=Hv.get(o);let c=a+1;for(;c<e.length&&e[c].attention&&e[c].value.charAt(0)===o;)c++;const h=a?e[a-1].value:t,d=Nr(h.charCodeAt(h.length-1)),f=Nr((c<e.length?e[c].value:n).charCodeAt(0)),m=!f||f===2&&!!d,p=!d||d===2&&!!f,g={tokens:e.slice(a,c),markers:[],start:0,end:0,open:u?m&&(!!d||!p):m,close:u?p&&(!!f||!m):p,split:u!==void 0};for(const w of g.tokens){i.set(w,[...g.tokens]),l.set(w,g);let y=w.value.length;for(;y--;)g.markers.push(w)}g.end=g.markers.length,r.push(g),a=c}for(AP(r,i),a=-1;++a<e.length;){const o=i.get(e[a]);if(o)return{attention:RP(e,o,l),index:a}}}function ia(e,t){const n=e[t?0:e.length-1];if(!n||n.attention)return;const r=t?ao(n.value):Vs(n.value),i=Bv(r.codePointAt(0));if(t)n.value=i+n.value.slice(r.length);else{let l=n.value.slice(0,n.value.length-r.length),a=0;for(;l.charCodeAt(l.length-1-a)===92;)a++;a%2&&(l+="\\"),n.value=l+i}}function LP(e,t,n,r,i){for(const l of n.attention){const a=t.get(l)||l.sequences[0];for(const o of l.sequences){if(o===a)continue;const u=new Map(t);u.set(l,o);const c=Bo(e,u,r,i),h=Wv(c,r,i);if(!h||h.index>n.index)return{chosen:u,mistake:h,tokens:c}}}}function AP(e,t){const n=new Map;for(const r of e){const i=r.tokens[0].value.charAt(0);let l=n.get(i);l||(l=[],n.set(i,l));let a=r.close?l.length:0;for(;a--&&r.start<r.end;){const o=l[a],u=o.end-o.start,c=r.end-r.start;if(r.split?(o.close||r.open)&&c%3&&!((u+c)%3):u!==o.markers.length||u!==c)continue;const h=r.split?u>1&&c>1?2:1:c,d=o.markers.slice(o.end-h,o.end),f=r.markers.slice(r.start,r.start+h),m=d[0],p=f[0];if(m===d[h-1]&&m.value.length===h&&p===f[h-1]&&p.value.length===h&&m.attention===p.attention)t.delete(m),t.delete(p);else{const g=[...new Set([...d,...f])];for(const w of g){const y=t.get(w);y&&y.push(...g)}}o.end-=h,r.start+=h,o.start===o.end&&l.splice(a,1),a=l.length}r.open&&r.start<r.end&&l.push(r)}}function IP(e,t,n){if(t.length===0)throw new Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(n.length===0)throw new Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(const i of n)if(!Number.isSafeInteger(i)||i<1)throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as size, expected positive integer");const r=[];for(const i of t){if(i.length!==1)throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected a single ascii character");if(!xv(i.charCodeAt(0)))throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected ascii punctuation");for(const l of n)r.push(i.repeat(l))}return r}function DP(e,t,n){const r=t.indexStack,i=e.children||[],l=[];let a=-1,o=n.before;r.push(-1);let u=t.createTracker(n);for(;++a<i.length;){const c=i[a];let h;if(r[r.length-1]=a,a+1<i.length){let m=t.handle.handlers[i[a+1].type];m&&m.peek&&(m=m.peek),h=m?ao(m(i[a+1],e,t,{before:"",after:"",...u.current()})):""}else h=n.after;const d=l[l.length-1];typeof d=="string"&&(o==="\r"||o===`
382
+ `)&&c.type==="html"&&PP(c.value)!==7&&(l[l.length-1]=d.replace(/(\r?\n|\r)$/," "),o=" ",u=t.createTracker(n),u.move(Ho(l,n.before,n.after)));const f=t.handle.handlers[c.type];if(f&&f.attention){const m=Qh(c,f.attention,t,u);if(!m)continue;l.push(m),o=Vs(m.sequences[0])}else{const m=t.handle(c,e,t,{...u.current(),after:h,before:o});if(!m)continue;u.move(m),l.push(m),o=Vs(m)}}return r.pop(),l}function Qh(e,t,n,r){const{construct:i,markers:l,sizes:a}=t(e,n),o=IP(e.type,l,a),u=o[0],c=n.enter(i),h=n.createTracker(r.current());h.move(u);const d=DP(e,n,{...h.current(),before:u,after:u});if(c(),d.length!==0)return r.move(u),r.move(Ho(d,u,u)),r.move(u),{children:d,sequences:o}}function Im(e,t,n,r){let i=Bo(e,t,n,r),l=Wv(i,n,r);for(;l;){const a=LP(e,t,l,n,r);if(!a)return;t=a.chosen,i=a.tokens,l=a.mistake}return i}function Vv(e,t,n,r){let i=n,l=-1;for(;++l<e.length;){const a=e[l];if(typeof a=="string"){i="";continue}const o=l===e.length-1?r:"",u=a.sequences.find(function(c){const h=c.charAt(0);return h!==i.charAt(0)&&h!==o.charAt(0)||e.length===1&&Hv.has(h)&&c.length>n.length})||a.sequences[0];u!==a.sequences[0]&&t.set(a,u),Vv(a.children,t,u,u),i=u}}function Bo(e,t,n,r){const i=[];let l,a=Vs(n),o=-1;for(;++o<e.length;){const u=e[o];if(typeof u=="string"){const v={value:u,attention:void 0};l&&l===ao(u)&&ia([v],!0),l=void 0,i.push(v),v.value&&(a=Vs(v.value));continue}const c=t.get(u)||u.sequences[0],h=c.charAt(0),d=e[o+1],f=a,m=ao(d===void 0?r:typeof d=="string"?d:t.get(d)||d.sequences[0]),p=Bo(u.children,t,c,c),g=p[0].value,w=Am(f.charCodeAt(f.length-1),g.charCodeAt(0),h);w.inside&&ia(p,!0);const y=Vs(p[p.length-1].value),x=Am(m.charCodeAt(0),y.charCodeAt(y.length-1),h);x.inside&&ia(p,!1),w.outside&&f!==`
383
+ `&&f!=="\r"&&ia(i,!1),x.outside&&(l=m),i.push({value:c,attention:u},...p,{value:c,attention:u}),a=c.charAt(c.length-1)}return i}function Ho(e,t,n){const r=new Map;Vv(e,r,t,n);const i=(r.size>0?Im(e,r,t,n):void 0)||Im(e,new Map,t,n)||Bo(e,new Map,t,n);let l="";for(const a of i)l+=a.value;return l}qh.attention=Qv;qh.peek=zP;function qh(e,t,n,r){const i=n.enter("phrasing"),l=Qh(e,Qv,n,n.createTracker(r)),a=l?Ho([l],r.before,r.after):"";return i(),a}function Qv(e,t){return{construct:"emphasis",markers:TP(t)==="*"?["*","_"]:["_","*"],sizes:[1]}}function zP(e,t,n){return n.options.emphasis||"*"}function MP(e,t){let n=!1;return Uo(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,qi}),!!((!e.depth||e.depth<3)&&Mo(e)&&(t.options.setext||n))}function $P(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(MP(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),m=n.containerPhrasing(e,{...l.current(),before:`
399
384
  `,after:`
400
385
  `});return f(),d(),m+`
401
386
  `+(i===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(`
402
387
  `))+1))}const a="#".repeat(i),o=n.enter("headingAtx"),u=n.enter("phrasing");l.move(a+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
403
- `,...l.current()});const h=c.charCodeAt(0);return(h===9||h===32)&&(c=Gv(h)+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),u(),o(),c}Zv.peek=zR;function Zv(e){return e.value||""}function zR(){return"<"}ej.peek=MR;function ej(e,t,n,r){const i=Gh(n),l=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const u=n.createTracker(r);let c=u.move("![");return c+=u.move(n.safe(e.alt,{before:c,after:"]",...u.current()})),c+=u.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(o=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":")",...u.current()}))),o(),e.title&&(o=n.enter(`title${l}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),o()),c+=u.move(")"),a(),c}function MR(){return"!"}tj.peek=$R;function tj(e,t,n,r){const i=e.referenceType,l=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let u=o.move("![");const c=n.safe(e.alt,{before:u,after:"]",...o.current()});u+=o.move(c+"]["),a();const h=n.stack;n.stack=h.filter(function(f){return f!=="phrasing"}),a=n.enter("reference");const d=n.safe(n.associationId(e),{before:u,after:"]",...o.current()});return a(),n.stack=h,l(),i==="full"||!c||c!==d?u+=o.move(d+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function $R(){return"!"}nj.peek=_R;function nj(e,t,n){let r=e.value||"",i="`",l=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const a=n.unsafe[l],o=n.compilePattern(a);if(!a.atBreak)continue;let u;for(;u=o.exec(r);){let c=u.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(u.index+1)}}return i+r+i}function _R(){return"`"}function rj(e,t){const n=zo(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][+\-.a-z]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}sj.peek=OR;function sj(e,t,n,r){const i=Gh(n),l=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);if(rj(e,n)){const p=n.stack;n.stack=p.filter(function(y){return y!=="phrasing"});const g=n.enter("autolink");let w=a.move("<");return w+=a.move(n.containerPhrasing(e,{before:w,after:">",...a.current()})),w+=a.move(">"),g(),n.stack=p,w}const o=n.enter("link");let u=n.enter("label"),c=a.move("[");const h=n.containerPhrasing(e,{before:c,after:"](",...a.current()});c+=a.move(h),u(),c+=a.move("](");const d=/[\0- \u007F]/.test(e.url),f=r.before.charAt(r.before.length-1);let m=e.title||void 0;if(!m&&!d&&(f===`
404
- `||f==="\r")){let p=0;for(;p<h.length&&h.charCodeAt(p)!==93;)p+=h.charCodeAt(p)===92?2:1;h.charCodeAt(p+1)===58&&(m="")}return!e.url&&typeof m=="string"||d?(u=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(u=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:typeof m=="string"?" ":")",...a.current()}))),u(),typeof m=="string"&&(u=n.enter(`title${l}`),c+=a.move(" "+i),c+=a.move(n.safe(m,{before:c,after:i,...a.current()})),c+=a.move(i),u()),c+=a.move(")"),o(),c}function OR(e,t,n){return rj(e,n)?"<":"["}ij.peek=FR;function ij(e,t,n,r){const i=e.referenceType,l=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let u=o.move("[");const c=n.containerPhrasing(e,{before:u,after:"]",...o.current()});u+=o.move(c+"]["),a();const h=n.stack;n.stack=h.filter(function(f){return f!=="phrasing"}),a=n.enter("reference");const d=n.safe(n.associationId(e),{before:u,after:"]",...o.current()});return a(),n.stack=h,l(),i==="full"||!c||c!==d?u+=o.move(d+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function FR(){return"["}function Jh(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function UR(e){const t=Jh(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function BR(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function lj(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function HR(e,t,n,r){const i=n.enter("list"),l=n.bulletCurrent;let a=e.ordered?BR(n):Jh(n);const o=e.ordered?a==="."?")":".":UR(n);let u=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&h&&(!h.children||!h.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),lj(n)===a&&h){let d=-1;for(;++d<e.children.length;){const f=e.children[d];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(a=o),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=l,i(),c}function WR(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function VR(e,t,n,r){const i=WR(n);let l=n.bulletCurrent||Jh(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let a=l.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(l+" ".repeat(a-l.length)),o.shift(a);const u=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,o.current()),h);return u(),c;function h(d,f,m){return f?(m?"":" ".repeat(a))+d:(m?l:l+" ".repeat(a-l.length))+d}}function QR(e,t,n,r){const i=n.enter("paragraph"),l=n.enter("phrasing"),a=n.containerPhrasing(e,r);return l(),i(),a}function qR(e,t,n,r){if(!e.children.some(function(o){return mR(o)}))return n.containerFlow(e,r);const l=n.enter("phrasing"),a=n.containerPhrasing(e,r);return l(),a}function GR(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Xh.attention=aj;Xh.peek=KR;function Xh(e,t,n,r){const i=n.enter("phrasing"),l=Kh(e,aj,n,n.createTracker(r)),a=l?Bo([l],r.before,r.after):"";return i(),a}function aj(e,t){return{construct:"strong",markers:GR(t)==="*"?["*","_"]:["_","*"],sizes:[2]}}function KR(e,t,n){return n.options.strong||"*"}function YR(e,t,n,r){const i=t?t.children:[],l=n.indexStack[n.indexStack.length-1];return n.safe(e.value,{...r,afterNode:i[l+1],beforeNode:i[l-1]})}function JR(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function XR(e,t,n){const r=(lj(n)+(n.options.ruleSpaces?" ":"")).repeat(JR(n));return n.options.ruleSpaces?r.slice(0,-1):r}const cd={blockquote:gR,break:Om,code:kR,definition:SR,emphasis:Yh,hardBreak:Om,heading:DR,html:Zv,image:ej,imageReference:tj,inlineCode:nj,link:sj,linkReference:ij,list:HR,listItem:VR,paragraph:QR,root:qR,strong:Xh,text:YR,thematicBreak:XR};function ZR(){return{enter:{table:eL,tableData:Bm,tableHeader:Bm,tableRow:nL},exit:{codeText:rL,table:tL,tableData:Uu,tableHeader:Uu,tableRow:Uu}}}function eL(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[],position:void 0},e),this.data.inTable=!0}function tL(e){this.exit(e),this.data.inTable=void 0}function nL(e){this.enter({type:"tableRow",children:[],position:void 0},e)}function Uu(e){this.exit(e)}function Bm(e){this.enter({type:"tableCell",children:[],position:void 0},e)}function rL(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,sL));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function sL(e,t){return t==="|"?t:e}function iL(e){const t=e||{},{tableCellPadding:n,tablePipeAlign:r,stringLength:i}=t,l=n?" ":"|";return{handlers:{inlineCode:f,table:a,tableCell:u,tableRow:o},join:[lL],unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
388
+ `,...l.current()});const h=c.charCodeAt(0);return(h===9||h===32)&&(c=Bv(h)+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),u(),o(),c}qv.peek=_P;function qv(e){return e.value||""}function _P(){return"<"}Gv.peek=OP;function Gv(e,t,n,r){const i=Vh(n),l=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const u=n.createTracker(r);let c=u.move("![");return c+=u.move(n.safe(e.alt,{before:c,after:"]",...u.current()})),c+=u.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(o=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":")",...u.current()}))),o(),e.title&&(o=n.enter(`title${l}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),o()),c+=u.move(")"),a(),c}function OP(){return"!"}Kv.peek=FP;function Kv(e,t,n,r){const i=e.referenceType,l=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let u=o.move("![");const c=n.safe(e.alt,{before:u,after:"]",...o.current()});u+=o.move(c+"]["),a();const h=n.stack;n.stack=h.filter(function(f){return f!=="phrasing"}),a=n.enter("reference");const d=n.safe(n.associationId(e),{before:u,after:"]",...o.current()});return a(),n.stack=h,l(),i==="full"||!c||c!==d?u+=o.move(d+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function FP(){return"!"}Yv.peek=UP;function Yv(e,t,n){let r=e.value||"",i="`",l=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const a=n.unsafe[l],o=n.compilePattern(a);if(!a.atBreak)continue;let u;for(;u=o.exec(r);){let c=u.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(u.index+1)}}return i+r+i}function UP(){return"`"}function Jv(e,t){const n=Mo(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][+\-.a-z]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Xv.peek=BP;function Xv(e,t,n,r){const i=Vh(n),l=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);if(Jv(e,n)){const p=n.stack;n.stack=p.filter(function(y){return y!=="phrasing"});const g=n.enter("autolink");let w=a.move("<");return w+=a.move(n.containerPhrasing(e,{before:w,after:">",...a.current()})),w+=a.move(">"),g(),n.stack=p,w}const o=n.enter("link");let u=n.enter("label"),c=a.move("[");const h=n.containerPhrasing(e,{before:c,after:"](",...a.current()});c+=a.move(h),u(),c+=a.move("](");const d=/[\0- \u007F]/.test(e.url),f=r.before.charAt(r.before.length-1);let m=e.title||void 0;if(!m&&!d&&(f===`
389
+ `||f==="\r")){let p=0;for(;p<h.length&&h.charCodeAt(p)!==93;)p+=h.charCodeAt(p)===92?2:1;h.charCodeAt(p+1)===58&&(m="")}return!e.url&&typeof m=="string"||d?(u=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(u=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:typeof m=="string"?" ":")",...a.current()}))),u(),typeof m=="string"&&(u=n.enter(`title${l}`),c+=a.move(" "+i),c+=a.move(n.safe(m,{before:c,after:i,...a.current()})),c+=a.move(i),u()),c+=a.move(")"),o(),c}function BP(e,t,n){return Jv(e,n)?"<":"["}Zv.peek=HP;function Zv(e,t,n,r){const i=e.referenceType,l=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let u=o.move("[");const c=n.containerPhrasing(e,{before:u,after:"]",...o.current()});u+=o.move(c+"]["),a();const h=n.stack;n.stack=h.filter(function(f){return f!=="phrasing"}),a=n.enter("reference");const d=n.safe(n.associationId(e),{before:u,after:"]",...o.current()});return a(),n.stack=h,l(),i==="full"||!c||c!==d?u+=o.move(d+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function HP(){return"["}function Gh(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function WP(e){const t=Gh(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function VP(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function ej(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function QP(e,t,n,r){const i=n.enter("list"),l=n.bulletCurrent;let a=e.ordered?VP(n):Gh(n);const o=e.ordered?a==="."?")":".":WP(n);let u=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&h&&(!h.children||!h.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),ej(n)===a&&h){let d=-1;for(;++d<e.children.length;){const f=e.children[d];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(a=o),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=l,i(),c}function qP(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function GP(e,t,n,r){const i=qP(n);let l=n.bulletCurrent||Gh(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let a=l.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(l+" ".repeat(a-l.length)),o.shift(a);const u=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,o.current()),h);return u(),c;function h(d,f,m){return f?(m?"":" ".repeat(a))+d:(m?l:l+" ".repeat(a-l.length))+d}}function KP(e,t,n,r){const i=n.enter("paragraph"),l=n.enter("phrasing"),a=n.containerPhrasing(e,r);return l(),i(),a}function YP(e,t,n,r){if(!e.children.some(function(o){return yP(o)}))return n.containerFlow(e,r);const l=n.enter("phrasing"),a=n.containerPhrasing(e,r);return l(),a}function JP(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Kh.attention=tj;Kh.peek=XP;function Kh(e,t,n,r){const i=n.enter("phrasing"),l=Qh(e,tj,n,n.createTracker(r)),a=l?Ho([l],r.before,r.after):"";return i(),a}function tj(e,t){return{construct:"strong",markers:JP(t)==="*"?["*","_"]:["_","*"],sizes:[2]}}function XP(e,t,n){return n.options.strong||"*"}function ZP(e,t,n,r){const i=t?t.children:[],l=n.indexStack[n.indexStack.length-1];return n.safe(e.value,{...r,afterNode:i[l+1],beforeNode:i[l-1]})}function eR(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function tR(e,t,n){const r=(ej(n)+(n.options.ruleSpaces?" ":"")).repeat(eR(n));return n.options.ruleSpaces?r.slice(0,-1):r}const ud={blockquote:vP,break:Lm,code:NP,definition:EP,emphasis:qh,hardBreak:Lm,heading:$P,html:qv,image:Gv,imageReference:Kv,inlineCode:Yv,link:Xv,linkReference:Zv,list:QP,listItem:GP,paragraph:KP,root:YP,strong:Kh,text:ZP,thematicBreak:tR};function nR(){return{enter:{table:rR,tableData:Dm,tableHeader:Dm,tableRow:iR},exit:{codeText:lR,table:sR,tableData:Ou,tableHeader:Ou,tableRow:Ou}}}function rR(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[],position:void 0},e),this.data.inTable=!0}function sR(e){this.exit(e),this.data.inTable=void 0}function iR(e){this.enter({type:"tableRow",children:[],position:void 0},e)}function Ou(e){this.exit(e)}function Dm(e){this.enter({type:"tableCell",children:[],position:void 0},e)}function lR(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,aR));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function aR(e,t){return t==="|"?t:e}function oR(e){const t=e||{},{tableCellPadding:n,tablePipeAlign:r,stringLength:i}=t,l=n?" ":"|";return{handlers:{inlineCode:f,table:a,tableCell:u,tableRow:o},join:[uR],unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
405
390
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}]};function a(m,p,g,w){const y=h(m,g,w),x=y[0];if(x){let v=m.align?m.align.length:0,b=-1;if(!v)for(;++b<y.length;)y[b].length>v&&(v=y[b].length);for(;x.length<v;)x.push("")}return c(y,m.align)}function o(m,p,g,w){const y=d(m,g,w),x=c([y]);return x.slice(0,x.indexOf(`
406
- `))}function u(m,p,g,w){const y=g.enter("tableCell"),x=g.enter("phrasing"),v=g.containerPhrasing(m,{...w,before:l,after:l});return x(),y(),v}function c(m,p){return fR(m,{align:p,alignDelimiters:r,fillRows:!1,padding:n,stringLength:i})}function h(m,p,g){const{children:w}=m;let y=-1;const x=[],v=p.enter("table");for(;++y<w.length;)x[y]=d(w[y],p,g);return v(),x}function d(m,p,g){const{children:w}=m;let y=-1;const x=[],v=p.enter("tableRow");for(;++y<w.length;)x[y]=u(w[y],m,p,g);return v(),x}function f(m,p,g){const w=cd.inlineCode(m,p,g);if(!g.stack.includes("tableCell"))return w;const y=[];let x=0,v=w.indexOf("|");for(;v!==-1;){let b=v;for(;b>x&&w.charCodeAt(b-1)===92;)b--;y.push(w.slice(x,v)),(v-b)%2===0&&y.push("\\"),x=v,v=w.indexOf("|",v+1)}return y.push(w.slice(x)),y.join("")}}function lL(e,t,n,r){if(e.type==="table"&&n.type==="listItem"&&n.spread===!1&&(t.type==="definition"||t.type==="heading"&&aL(t,r)||t.type==="paragraph"||t.type==="table"))return 1}function aL(e,t){let n=!1;return Fo(e,function(r){if(r.type==="break"||"value"in r&&/\r?\n|\r/.test(r.value))return n=!0,qi}),!!((!e.depth||e.depth<3)&&zo(e)&&(t.options.setext||n))}function oL(){return{exit:{taskListCheckValueChecked:Hm,taskListCheckValueUnchecked:Hm,paragraph:cL}}}function uL(){return{handlers:{paragraph:dL},join:[hL]}}function Hm(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function cL(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let l=-1,a;for(;++l<i.length;){const o=i[l];if(o.type==="paragraph"){a=o;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start={...r.position.start}))}}this.exit(e)}function dL(e,t,n,r){if(!t||t.type!=="listItem"||oj(t)!==e)return cd.paragraph(e,t,n,r);const i="["+(t.checked?"x":" ")+"] ",l=n.createTracker(r);l.move(i);const a=cd.paragraph(e.children.length>0?e:{type:"paragraph",children:[{type:"text",value:" "}]},t,n,{...r,...l.current()});return i+a}function hL(e,t,n){if(!(e.type==="definition"&&n.type==="listItem"))return;const r=oj(n);if(r&&n.children.indexOf(e)<n.children.indexOf(r))return 0}function oj(e){if(typeof e.checked=="boolean")for(const t of e.children){if(t.type==="paragraph")return t;if(t.type!=="definition")return}}function fL(){return[AP(),nR(),lR(),ZR(),oL()]}function pL(e){return{extensions:[IP(),rR(e),aR(),iL(e),uL()]}}const mL={tokenize:wL,partial:!0},uj={tokenize:kL,partial:!0},cj={tokenize:bL,partial:!0},dj={tokenize:SL,partial:!0},gL={tokenize:NL,partial:!0},hj={name:"wwwAutolink",tokenize:vL,previous:pj},fj={name:"protocolAutolink",tokenize:jL,previous:mj},Jn={name:"emailAutolink",tokenize:yL,previous:gj},Dn={};function xL(){return{text:Dn}}let Fr=48;for(;Fr<123;)Dn[Fr]=Jn,Fr++,Fr===58?Fr=65:Fr===91&&(Fr=97);Dn[43]=Jn;Dn[45]=Jn;Dn[46]=Jn;Dn[95]=Jn;Dn[72]=[Jn,fj];Dn[104]=[Jn,fj];Dn[87]=[Jn,hj];Dn[119]=[Jn,hj];function yL(e,t,n){const r=this;let i,l;return a;function a(d){return!dd(d)||!gj.call(r,r.previous)||Zh(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(d))}function o(d){return dd(d)?(e.consume(d),o):d===64?(e.consume(d),u):n(d)}function u(d){return d===46?e.check(gL,h,c)(d):d===45||d===95||jt(d)?(l=!0,e.consume(d),u):h(d)}function c(d){return e.consume(d),i=!0,u}function h(d){return l&&i&&vt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function vL(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!pj.call(r,r.previous)||Zh(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(mL,e.attempt(uj,e.attempt(cj,l),n),n)(a))}function l(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function jL(e,t,n){const r=this;let i="",l=!1;return a;function a(d){return(d===72||d===104)&&mj.call(r,r.previous)&&!Zh(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),o):n(d)}function o(d){if(vt(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),o;if(d===58){const f=i.toLowerCase();if(f==="http"||f==="https")return e.consume(d),u}return n(d)}function u(d){return d===47?(e.consume(d),l?c:(l=!0,u)):n(d)}function c(d){return d===null||ro(d)||Fe(d)||as(d)||Nl(d)?n(d):e.attempt(uj,e.attempt(cj,h),n)(d)}function h(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function wL(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),l):n(a)}function l(a){return a===null?n(a):t(a)}}function kL(e,t,n){let r,i,l;return a;function a(c){return c===46||c===95?e.check(dj,u,o)(c):c===null||Fe(c)||as(c)||c!==45&&Nl(c)?u(c):(l=!0,e.consume(c),a)}function o(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),a}function u(c){return i||r||!l?n(c):t(c)}}function bL(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?l(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(dj,t,l)(a):a===null||Fe(a)||as(a)?t(a):(e.consume(a),i)}function l(a){return a===41&&r++,e.consume(a),i}}function SL(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),l):o===93?(e.consume(o),i):o===60||o===null||Fe(o)||as(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||Fe(o)||as(o)?t(o):r(o)}function l(o){return vt(o)?a(o):n(o)}function a(o){return o===59?(e.consume(o),r):vt(o)?(e.consume(o),a):n(o)}}function NL(e,t,n){return r;function r(l){return e.consume(l),i}function i(l){return jt(l)?n(l):t(l)}}function pj(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Fe(e)}function mj(e){return!vt(e)}function gj(e){return!(e===47||dd(e))}function dd(e){return e===43||e===45||e===46||e===95||jt(e)}function Zh(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const CL={tokenize:DL,partial:!0};function EL(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:LL,continuation:{tokenize:AL},exit:IL}},text:{91:{name:"gfmFootnoteCall",tokenize:RL},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:TL,resolveTo:PL}}}}function TL(e,t,n){const r=this;let i=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){a=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return o;function o(u){if(!a||!a._balanced)return n(u);const c=vn(r.sliceSerialize({start:a.end,end:r.now()}));return c.codePointAt(0)!==94||!l.includes(c.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function PL(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",l,t],["enter",a,t],["exit",a,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function RL(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,a;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),u}function u(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(d){if(l>999||d===93&&!a||d===null||d===91||Fe(d))return n(d);if(d===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return i.includes(vn(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return Fe(d)||(a=!0),l++,e.consume(d),d===92?h:c}function h(d){return d===91||d===92||d===93?(e.consume(d),l++,c):c(d)}}function LL(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,a=0,o;return u;function u(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):n(p)}function h(p){if(a>999||p===93&&!o||p===null||p===91||Fe(p))return n(p);if(p===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return l=vn(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return Fe(p)||(o=!0),a++,e.consume(p),p===92?d:h}function d(p){return p===91||p===92||p===93?(e.consume(p),a++,h):h(p)}function f(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(l)||i.push(l),Ie(e,m,"gfmFootnoteDefinitionWhitespace")):n(p)}function m(p){return t(p)}}function AL(e,t,n){return e.check(Cl,t,e.attempt(CL,t,n))}function IL(e){e.exit("gfmFootnoteDefinition")}function DL(e,t,n){const r=this;return Ie(e,i,"gfmFootnoteDefinitionIndent",5);function i(l){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(l):n(l)}}function zL(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,o){let u=-1;for(;++u<a.length;)if(a[u][0]==="enter"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._close){let c=u;for(;c--;)if(a[c][0]==="exit"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._open&&a[u][1].end.offset-a[u][1].start.offset===a[c][1].end.offset-a[c][1].start.offset){a[u][1].type="strikethroughSequence",a[c][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},a[c][1].start),end:Object.assign({},a[u][1].end)},d={type:"strikethroughText",start:Object.assign({},a[c][1].end),end:Object.assign({},a[u][1].start)},f=[["enter",h,o],["enter",a[c][1],o],["exit",a[c][1],o],["enter",d,o]],m=o.parser.constructs.insideSpan.null;m&&yn(f,f.length,0,Mo(m,a.slice(c+1,u),o)),yn(f,f.length,0,[["exit",d,o],["enter",a[u][1],o],["exit",a[u][1],o],["exit",h,o]]),yn(a,c-1,u-c+3,f),u=c+f.length-2;break}}for(u=-1;++u<a.length;)a[u][1].type==="strikethroughSequenceTemporary"&&(a[u][1].type="data");return a}function l(a,o,u){const c=this.previous,h=this.events;let d=0;return f;function f(p){return c===126&&h[h.length-1][1].type!=="characterEscape"?u(p):(a.enter("strikethroughSequenceTemporary"),m(p))}function m(p){const g=Nr(c);if(p===126)return d>1?u(p):(a.consume(p),d++,m);if(d<2&&!n)return u(p);const w=a.exit("strikethroughSequenceTemporary"),y=Nr(p);return w._open=!y||y===2&&!!g,w._close=!g||g===2&&!!y,o(p)}}}class ML{constructor(){this.map=[],this.index=new Map}add(t,n,r){$L(this,t,n,r)}consume(t){if(this.map.sort(function(l,a){return l[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const l of i)t.push(l);i=r.pop()}this.map.length=0,this.index.clear()}}function $L(e,t,n,r){if(n===0&&r.length===0)return;const i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}const l=[t,n,r];e.map.push(l),e.index.set(t,l)}function _L(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function OL(){return{flow:{null:{name:"table",tokenize:FL,resolveAll:UL}}}}function FL(e,t,n){const r=this;let i=0,l=0,a;return o;function o(C){let R=r.events.length-1;for(;R>-1;){const{type:U}=r.events[R][1];if(U==="lineEnding"||U==="linePrefix")R--;else break}const L=R>-1?r.events[R][1].type:null,M=L==="tableHead"||L==="tableRow"?k:u;return M===k&&r.parser.lazy[r.now().line]?n(C):M(C)}function u(C){return e.enter("tableHead"),e.enter("tableRow"),c(C)}function c(C){return C===124||(a=!0,l+=1),h(C)}function h(C){return C===null?n(C):he(C)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),m):n(C):je(C)?Ie(e,h,"whitespace")(C):(l+=1,a&&(a=!1,i+=1),C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),a=!0,h):(e.enter("data"),d(C)))}function d(C){return C===null||C===124||Fe(C)?(e.exit("data"),h(C)):(e.consume(C),C===92?f:d)}function f(C){return C===92||C===124?(e.consume(C),d):d(C)}function m(C){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(C):(e.enter("tableDelimiterRow"),a=!1,je(C)?Ie(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):p(C))}function p(C){return C===45||C===58?w(C):C===124?(a=!0,e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),g):A(C)}function g(C){return je(C)?Ie(e,w,"whitespace")(C):w(C)}function w(C){return C===58?(l+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),y):C===45?(l+=1,y(C)):C===null||he(C)?b(C):A(C)}function y(C){return C===45?(e.enter("tableDelimiterFiller"),x(C)):A(C)}function x(C){return C===45?(e.consume(C),x):C===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(C))}function v(C){return je(C)?Ie(e,b,"whitespace")(C):b(C)}function b(C){return C===124?p(C):C===null||he(C)?!a||i!==l?A(C):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(C)):A(C)}function A(C){return n(C)}function k(C){return e.enter("tableRow"),E(C)}function E(C){return C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),E):C===null||he(C)?(e.exit("tableRow"),t(C)):je(C)?Ie(e,E,"whitespace")(C):(e.enter("data"),T(C))}function T(C){return C===null||C===124||Fe(C)?(e.exit("data"),E(C)):(e.consume(C),C===92?I:T)}function I(C){return C===92||C===124?(e.consume(C),T):T(C)}}function UL(e,t){let n=-1,r=!0,i=0,l=[0,0,0,0],a=[0,0,0,0],o=!1,u=0,c,h,d;const f=new ML;for(;++n<e.length;){const m=e[n],p=m[1];m[0]==="enter"?p.type==="tableHead"?(o=!1,u!==0&&(Wm(f,t,u,c,h),h=void 0,u=0),c={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},f.add(n,0,[["enter",c,t]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,d=void 0,l=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,h={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},f.add(n,0,[["enter",h,t]])),i=p.type==="tableDelimiterRow"?2:h?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(l[1]!==0&&(a[0]=a[1],d=oa(f,t,l,i,void 0,d),l=[0,0,0,0]),a[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(a[0]=a[1],d=oa(f,t,l,i,void 0,d)),l=a,a=[l[1],n,0,0])):p.type==="tableHead"?(o=!0,u=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(u=n,l[1]!==0?(a[0]=a[1],d=oa(f,t,l,i,n,d)):a[1]!==0&&(d=oa(f,t,a,i,n,d)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(a[3]=n)}for(u!==0&&Wm(f,t,u,c,h),f.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=_L(t.events,n))}return e}function oa(e,t,n,r,i,l){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(l.end=Object.assign({},Ss(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const u=Ss(t.events,n[1]);if(l={type:a,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const c=Ss(t.events,n[2]),h=Ss(t.events,n[3]),d={type:o,start:Object.assign({},c),end:Object.assign({},h)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const f=t.events[n[2]],m=t.events[n[3]];if(f[1].end=Object.assign({},m[1].end),f[1].type="chunkText",f[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,g=n[3]-n[2]-1;e.add(p,g,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(l.end=Object.assign({},Ss(t.events,i)),e.add(i,0,[["exit",l,t]]),l=void 0),l}function Wm(e,t,n,r,i){const l=[],a=Ss(t.events,n);i&&(i.end=Object.assign({},a),l.push(["exit",i,t])),r.end=Object.assign({},a),l.push(["exit",r,t]),e.add(n+1,0,l)}function Ss(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const BL={name:"tasklistCheck",tokenize:WL};function HL(){return{text:{91:BL}}}function WL(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),l)}function l(u){return Fe(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),a):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),a):n(u)}function a(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(u)}function o(u){return he(u)?t(u):je(u)?e.check({tokenize:VL},t,n)(u):n(u)}}function VL(e,t,n){return Ie(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function QL(e){return hv([xL(),EL(),zL(e),OL(),HL()])}const qL={};function GL(e){const t=this,n=e||qL,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(QL(n)),l.push(fL()),a.push(pL(n))}const KL={builtin:"built-in",project:"project",user:"user",synced:"claude.ai",plugin:"",other:""},Bu=60;function YL(e,t){var h,d;const n=((h=t.catalog)==null?void 0:h.pipelines)??[],r=e.match(/^\/p:([a-z0-9-]+) (\S*)$/i);if(r){const f=n.find(p=>p.name===r[1].toLowerCase());if(!(f!=null&&f.runnable)||!/^[<[]spec\.md[>\]]/.test(f.argumentHint))return[];const m=r[2].toLowerCase();return t.specs.filter(p=>p.toLowerCase().startsWith(m)).slice(0,Bu).map(p=>({insert:`/p:${f.name} ${p} `,label:p,hint:"",description:"",badge:"spec"}))}const i=e.match(/^\/p:([a-z0-9-]*)$/i);if(i)return ta(n,i[1]).slice(0,Bu).map(f=>({insert:`/p:${f.name} `,label:`/p:${f.name}`,hint:f.argumentHint,description:f.label===f.description||!f.description?f.label:`${f.label} — ${f.description}`,badge:f.builtin?"built-in":"custom"}));const l=e.match(/^\/(\S*)$/);if(!l)return[];const a=l[1],o=ta(t.local.map(f=>({name:f.cmd.slice(1),description:f.help,l:f})),a).map(({l:f})=>({insert:`${f.cmd} `,label:f.cmd,hint:f.args,description:f.help,badge:"Agent Studio"})),u=n.length?ta([{name:"p:",description:"Run an Agent Studio pipeline"}],a).map(()=>({insert:"/p:",label:"/p:<pipeline>",hint:"",description:"Run an Agent Studio pipeline",badge:"Agent Studio"})):[],c=ta(((d=t.catalog)==null?void 0:d.commands)??[],a).map(f=>({insert:`/${f.name} `,label:`/${f.name}`,hint:f.argumentHint,description:f.description,badge:f.source==="plugin"?f.name.split(":")[0]:KL[f.source]}));return[...o,...u,...c].slice(0,Bu)}const xj="qa-studio.chat.settings",Vm={model:"default",effort:"default",permissionMode:"acceptEdits"};function JL(){try{return{...Vm,...JSON.parse(localStorage.getItem(xj)??"{}")}}catch{return Vm}}function XL(e){try{localStorage.setItem(xj,JSON.stringify(e))}catch{}}const hd=e=>typeof e=="number"?`$${e<.01&&e>0?e.toFixed(3):e.toFixed(2)}`:"",ZL=e=>typeof e=="number"?e<6e4?`${(e/1e3).toFixed(1)} s`:`${Math.floor(e/6e4)} min ${Math.round(e%6e4/1e3)} s`:"",eA=e=>e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(1)} MB`,uo=[{cmd:"/model",args:"<default|fable|opus|sonnet|haiku|full-id>",help:"Change the model"},{cmd:"/effort",args:`<${Yr.join("|")}>`,help:"Change the reasoning effort"},{cmd:"/mode",args:"<plan|acceptEdits|auto|bypassPermissions>",help:"Change the permission mode"},{cmd:"/new",args:"",help:"Start a new chat"},{cmd:"/help",args:"",help:"List the commands"}];function tA(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>t(String(r.result).replace(/^data:[^,]*,/,"")),r.onerror=()=>n(r.error??new Error("Could not read the file")),r.readAsDataURL(e)})}const yj=j.createContext(async()=>{}),nA={allowed:"Allowed",always:"Always allowed (saved to .claude/settings.local.json)",denied:"Denied",expired:"No longer waiting"};function rA({b:e}){const t=j.useContext(yj),[n,r]=j.useState(!1),i=a=>{r(!0),t(e.requestId,a).finally(()=>r(!1))},l=e.state==="pending";return s.jsxs("div",{className:`chat-perm ${e.state}`,role:l?"alertdialog":void 0,"aria-label":`Permission for ${e.toolName}`,children:[s.jsxs("div",{className:"chat-perm-head",children:[s.jsx("b",{children:l?`Allow Claude to use ${e.toolName}?`:e.toolName}),!l&&s.jsx("span",{className:`chat-perm-state ${e.state}`,children:nA[e.state]})]}),e.summary&&s.jsx("code",{className:"chat-perm-cmd",children:e.summary}),l&&e.reason&&s.jsx("div",{className:"muted small",children:e.reason}),e.input&&s.jsxs("details",{children:[s.jsx("summary",{className:"muted small",children:"Full input"}),s.jsx("pre",{children:e.input})]}),l&&s.jsxs("div",{className:"row chat-perm-actions",children:[s.jsx("button",{className:"btn sm",disabled:n,onClick:()=>i("allow"),autoFocus:!0,children:"Allow"}),e.canRemember&&s.jsx("button",{className:"btn ghost sm",disabled:n,onClick:()=>i("always"),title:"Allow now and don't ask again for this in this project (.claude/settings.local.json)",children:"Always allow"}),s.jsx("button",{className:"btn ghost sm chat-perm-deny",disabled:n,onClick:()=>i("deny"),children:"Deny"})]})]})}const sA=[GL],iA={table:({node:e,...t})=>s.jsx("div",{className:"chat-table-wrap",children:s.jsx("table",{...t})}),a:({node:e,...t})=>s.jsx("a",{...t,target:"_blank",rel:"noreferrer"})};function lA({b:e}){const t=e.done?e.isError?"error":"ok":"running";return s.jsxs("details",{className:`chat-tool ${t}`,children:[s.jsxs("summary",{children:[s.jsx("span",{className:"chat-tool-state",children:t==="running"?s.jsx("span",{className:"chat-spinner"}):t==="error"?s.jsx(kr,{size:12}):s.jsx(wh,{size:12})}),s.jsx("b",{children:e.name}),e.summary&&s.jsx("code",{className:"chat-tool-sum",children:e.summary})]}),e.input&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"chat-tool-label",children:"Input"}),s.jsx("pre",{children:e.input})]}),e.result!==void 0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"chat-tool-label",children:e.isError?"Error":"Result"}),s.jsx("pre",{children:e.result||"(empty)"})]})]})}function aA({b:e}){switch(e.kind){case"text":return s.jsx("div",{className:"chat-md",children:s.jsx(ui,{remarkPlugins:sA,components:iA,children:e.text})});case"thinking":return s.jsxs("details",{className:"chat-thinking",children:[s.jsx("summary",{children:"Thinking"}),s.jsx("div",{className:"chat-thinking-body",children:e.text})]});case"tool":return s.jsx(lA,{b:e});case"permission":return s.jsx(rA,{b:e});case"error":return s.jsx("div",{className:"error-box chat-error",role:"alert",children:e.text});case"notice":return s.jsx("div",{className:"chat-notice",children:e.text});case"job":return s.jsxs("div",{className:"chat-job",children:[s.jsxs("span",{children:["Started ",s.jsx("strong",{children:e.pipeline})," · ",s.jsx("code",{children:e.target})]}),s.jsxs(ye,{className:"btn ghost",to:`/runs/${e.jobId}`,children:["Open job #",e.jobId]})]})}}function vj({a:e,onRemove:t}){return s.jsxs("span",{className:"chat-att",title:e.path,children:[s.jsx(Oy,{size:12}),s.jsx("span",{className:"chat-att-name",children:e.name}),s.jsx("span",{className:"muted",children:eA(e.size)}),t&&s.jsx("button",{type:"button",className:"chat-att-x",onClick:t,"aria-label":`Remove ${e.name}`,children:s.jsx(kr,{size:11})})]})}function oA({m:e}){var n;if(e.role==="user"){const r=e.blocks.find(i=>i.kind==="text");return s.jsxs("div",{className:"chat-msg user",children:[s.jsxs("div",{className:"chat-bubble",children:[r&&r.kind==="text"&&s.jsx("div",{className:"chat-user-text",children:r.text}),!!((n=e.attachments)!=null&&n.length)&&s.jsx("div",{className:"chat-atts",children:e.attachments.map(i=>s.jsx(vj,{a:i},i.id))})]}),e.settings&&s.jsxs("div",{className:"chat-meta",children:[e.settings.model," · effort ",e.settings.effort," · ",e.settings.permissionMode]})]})}const t=[e.model,hd(e.costUsd),ZL(e.durationMs),e.turns?`${e.turns} turn${e.turns>1?"s":""}`:""].filter(Boolean);return s.jsxs("div",{className:"chat-msg assistant",children:[s.jsx("span",{className:"chat-avatar","aria-hidden":"true",children:s.jsx(Ch,{size:15})}),s.jsxs("div",{className:"chat-body",children:[e.blocks.map((r,i)=>s.jsx(aA,{b:r},i)),e.pending&&s.jsxs("div",{className:"chat-typing","aria-label":"Claude is working",children:[s.jsx("i",{}),s.jsx("i",{}),s.jsx("i",{})]}),!e.pending&&t.length>0&&s.jsx("div",{className:"chat-meta",children:t.join(" · ")})]})]})}function uA({settings:e,onSettings:t,busy:n,onSend:r,onStop:i,ensureSession:l,onSlash:a}){var ae;const o=Ir(),[u,c]=j.useState(""),[h,d]=j.useState([]),[f,m]=j.useState(0),[p,g]=j.useState(!1),w=j.useRef(null),y=j.useRef(null),[x,v]=j.useState(null),[b,A]=j.useState([]),[k,E]=j.useState(0),[T,I]=j.useState(null),C=j.useRef(!1),R=j.useRef(null);j.useEffect(()=>{!u.startsWith("/")||C.current||(C.current=!0,Q.chatCommands().then(v,()=>v(null)),Q.specs().then(O=>A(O.map(N=>N.file)),()=>A([])))},[u]),j.useEffect(()=>E(0),[u]),j.useLayoutEffect(()=>{const O=y.current;O&&(O.style.height="auto",O.style.height=`${Math.min(O.scrollHeight,260)}px`)},[u]);const L=async O=>{if(O.length){m(N=>N+O.length);try{const N=await l();for(const F of O)try{const Z=await tA(F),ce=await Q.uploadChatFile(N,{name:F.name||"pasted.png",mime:F.type||"application/octet-stream",data:Z});d(Te=>[...Te,ce])}catch(Z){o.error(`${F.name}: ${Z.message}`)}finally{m(Z=>Z-1)}}catch(N){m(0),o.error(N.message)}}},M=async()=>{const O=u.trim(),N=O.match(/^(\/[a-z]+)(?:\s+(.*))?$/i);if(N&&uo.some(F=>F.cmd===N[1].toLowerCase())){a(N[1].toLowerCase(),(N[2]??"").trim())&&c("");return}n||f||!O&&!h.length||await r(O,h)&&(c(""),d([]))},U=O=>{var F;const N=B[O];!N||N.disabled||(c(N.insert),E(0),(F=y.current)==null||F.focus())},D=O=>{if(B.length&&!O.nativeEvent.isComposing){const N=F=>{var ce,Te;O.preventDefault();const Z=(X+F+B.length)%B.length;E(Z),(Te=(ce=R.current)==null?void 0:ce.children[Z])==null||Te.scrollIntoView({block:"nearest"})};if(O.key==="ArrowDown")return N(1);if(O.key==="ArrowUp")return N(-1);if(O.key==="Escape")return O.preventDefault(),I(u);if(O.key==="Tab"||O.key==="Enter"&&!O.shiftKey&&B[X]&&B[X].insert.trim()!==u.trim())return O.preventDefault(),U(X)}O.key==="Enter"&&!O.shiftKey&&!O.nativeEvent.isComposing&&(O.preventDefault(),M()),O.key==="Escape"&&n&&i()},q=O=>{const N=[...O.clipboardData.files];N.length&&(O.preventDefault(),L(N))},J=O=>{O.preventDefault(),g(!1),L([...O.dataTransfer.files])},B=T===u?[]:YL(u,{local:uo,catalog:x,specs:b}),X=Math.min(k,Math.max(0,B.length-1)),S=Op.some(O=>O.id===e.model);return s.jsxs("div",{className:`chat-composer ${p?"dragging":""}`,onDragOver:O=>(O.preventDefault(),g(!0)),onDragLeave:()=>g(!1),onDrop:J,children:[B.length>0&&s.jsxs("div",{className:"chat-slash",role:"listbox",ref:R,children:[B.map((O,N)=>s.jsxs("button",{type:"button",role:"option","aria-selected":N===X,"aria-disabled":O.disabled,title:O.disabledReason??O.description,className:`chat-slash-item ${N===X?"active":""} ${O.disabled?"disabled":""}`,onMouseEnter:()=>E(N),onMouseDown:F=>F.preventDefault(),onClick:()=>U(N),children:[s.jsxs("code",{children:[O.label,O.hint&&s.jsxs("span",{className:"muted",children:[" ",O.hint]})]}),s.jsx("span",{className:"chat-slash-desc muted",children:O.description}),O.badge&&s.jsx("span",{className:"chat-slash-badge",children:O.badge})]},O.insert)),u.startsWith("/")&&!u.startsWith("/p:")&&(x==null?void 0:x.error)&&s.jsx("div",{className:"chat-slash-note muted",children:x.error})]}),(h.length>0||f>0)&&s.jsxs("div",{className:"chat-atts",children:[h.map(O=>s.jsx(vj,{a:O,onRemove:()=>d(N=>N.filter(F=>F.id!==O.id))},O.id)),f>0&&s.jsxs("span",{className:"chat-att muted",children:["Uploading ",f,"…"]})]}),s.jsx("textarea",{ref:y,className:"chat-input",rows:1,autoFocus:!0,placeholder:n?"Claude is answering… (Esc to stop)":"Message Claude Code - Enter to send, Shift+Enter for a new line, / for commands",value:u,onChange:O=>c(O.target.value),onKeyDown:D,onPaste:q,"aria-label":"Message"}),s.jsxs("div",{className:"chat-toolbar",children:[s.jsx("input",{ref:w,type:"file",multiple:!0,hidden:!0,onChange:O=>(L([...O.target.files??[]]),O.target.value="")}),s.jsx("button",{type:"button",className:"btn ghost icon square",onClick:()=>{var O;return(O=w.current)==null?void 0:O.click()},title:"Attach files (or paste / drop them)","aria-label":"Attach files",children:s.jsx(Oy,{size:16})}),s.jsxs("label",{className:"chat-select",title:"Model",children:[s.jsx("span",{children:"Model"}),s.jsxs("select",{value:e.model,onChange:O=>t({model:O.target.value}),"aria-label":"Model",children:[!S&&s.jsx("option",{value:e.model,children:e.model}),Op.map(O=>s.jsx("option",{value:O.id,children:O.label},O.id))]})]}),s.jsxs("label",{className:"chat-select chat-effort",title:"Reasoning effort: higher thinks longer (slower, more tokens). Default = Claude Code's own setting",children:[s.jsx("span",{children:"Effort"}),s.jsx("input",{type:"range",min:0,max:Yr.length-1,step:1,value:Math.max(0,Yr.indexOf(e.effort)),onChange:O=>t({effort:Yr[Number(O.target.value)]}),"aria-label":"Effort","aria-valuetext":e.effort,list:"chat-effort-ticks"}),s.jsx("datalist",{id:"chat-effort-ticks",children:Yr.map((O,N)=>s.jsx("option",{value:N},O))}),s.jsx("b",{className:"chat-effort-value",children:e.effort==="default"?"Default":e.effort})]}),s.jsxs("label",{className:"chat-select",title:(ae=no.find(O=>O.id===e.permissionMode))==null?void 0:ae.description,children:[s.jsx("span",{children:"Permissions"}),s.jsx("select",{value:e.permissionMode,onChange:O=>t({permissionMode:O.target.value}),"aria-label":"Permission mode",children:no.map(O=>s.jsx("option",{value:O.id,title:O.description,children:O.label},O.id))})]}),s.jsx("div",{className:"grow"}),n?s.jsxs("button",{type:"button",className:"btn danger sm",onClick:i,title:"Stop (Esc)",children:[s.jsx(My,{size:14})," Stop"]}):s.jsxs("button",{type:"button",className:"btn sm",onClick:()=>void M(),disabled:f>0||!u.trim()&&!h.length,"aria-label":"Send",children:[s.jsx(xb,{size:14})," Send"]})]})]})}function cA(){const{id:e}=li(),t=ut(),n=Ir(),r=In(),i=$e(()=>Q.chats(),[]),[l,a]=j.useState(null),[o,u]=j.useState(JL),[c,h]=j.useState(null),[d,f]=j.useState(null),m=j.useRef(null),p=j.useRef(!0),g=j.useRef(null),w=i.reload;j.useEffect(()=>{if(a(null),h(null),p.current=!0,!e)return;let L=!0;Q.chat(e).then(U=>L&&a(D=>D??U)).catch(U=>L&&h(U.message));const M=eb(e,U=>{L&&(U.type==="session"?(a(U.session),U.session.busy||w()):a(D=>D&&{...D,messages:D.messages.map(q=>q.id===U.message.id?U.message:q)}))});return()=>{L=!1,M()}},[e,w]),j.useLayoutEffect(()=>{const L=m.current;L&&p.current&&(L.scrollTop=L.scrollHeight)},[l]);const y=l?{model:l.model,effort:l.effort,permissionMode:l.permissionMode}:o,x=j.useCallback(async()=>{if(e)return e;g.current??(g.current=Q.createChat(o).then(L=>(a(L),t(`/chat/${L.id}`,{replace:!0}),w(),L.id)));try{return await g.current}finally{g.current=null}},[e,o,t,w]),v=async L=>{const M={...y,...L};if(u(M),XL(M),!!l){a({...l,...L});try{await Q.updateChat(l.id,L)}catch(U){n.error(U.message)}}},b=async(L,M)=>{try{const U=await x();p.current=!0;const D=await Q.sendChat(U,L,M.map(q=>q.id));return a(q=>q&&q.messages.length>D.messages.length?q:D),!0}catch(U){return n.error(U.message),!1}},A=j.useCallback(async(L,M)=>{if(e)try{await Q.answerChatPermission(e,L,M)}catch(U){n.error(U.message)}},[e,n]),k=()=>{l&&Q.stopChat(l.id).catch(L=>n.error(L.message))},E=(L,M)=>{var U;if(L==="/new")return t("/chat"),!0;if(L==="/help")return n.info(s.jsx("div",{children:uo.map(D=>s.jsxs("div",{children:[s.jsx("code",{children:D.cmd})," ",D.help]},D.cmd))})),!0;if(!M)return n.warning(`Usage: ${L} ${(U=uo.find(D=>D.cmd===L))==null?void 0:U.args}`),!1;if(L==="/model")return v({model:M}),n.success(`Model: ${M}`),!0;if(L==="/effort")return Yr.includes(M)?(v({effort:M}),n.success(`Effort: ${M}`),!0):(n.error(`Effort must be one of ${Yr.join(", ")}`),!1);if(L==="/mode"){const D=no.find(q=>q.id.toLowerCase()===M.toLowerCase());return D?(v({permissionMode:D.id}),n.success(`Permissions: ${D.label}`),!0):(n.error(`Mode must be one of ${no.map(q=>q.id).join(", ")}`),!1)}return!1},T=async L=>{if(await r({title:`Delete "${L.title}"?`,message:"The chat and its attachments are removed from Agent Studio. The Claude Code session itself stays in Claude Code’s history.",danger:!0,confirmLabel:"Delete"}))try{await Q.deleteChat(L.id),L.id===e&&t("/chat"),w()}catch(M){n.error(M.message)}},I=async()=>{if(!l||d===null)return;const L=d.trim();if(f(null),!(!L||L===l.title))try{a(await Q.updateChat(l.id,{title:L})),w()}catch(M){n.error(M.message)}},C=()=>{l&&navigator.clipboard.writeText(`claude --resume ${l.id}`).then(()=>n.success("Copied: run it in a terminal at the repo root to continue there")).catch(()=>n.error("Could not copy"))},R=i.data??[];return s.jsxs("div",{className:"chat-page",children:[s.jsx(ot,{items:[{label:"Claude chat",to:"/chat"},...l?[{label:l.title}]:[]]}),s.jsxs("aside",{className:"chat-list",children:[s.jsxs("button",{className:"btn chat-new",onClick:()=>t("/chat"),children:[s.jsx(qt,{size:15})," New chat"]}),s.jsxs("div",{className:"chat-list-items",children:[R.length===0&&s.jsx("p",{className:"muted small chat-list-empty",children:"No chats yet."}),R.map(L=>s.jsxs("div",{className:`chat-list-item ${L.id===e?"active":""}`,children:[s.jsxs(ye,{to:`/chat/${L.id}`,className:"chat-list-link",children:[s.jsxs("span",{className:"chat-list-title",children:[L.busy&&s.jsx("span",{className:"chat-dot",title:"Answering"}),L.title]}),s.jsxs("span",{className:"muted small",children:[Rt(L.updatedAt),L.costUsd>0&&` · ${hd(L.costUsd)}`]})]}),s.jsx("button",{className:"chat-list-del",onClick:()=>void T(L),"aria-label":`Delete ${L.title}`,title:"Delete chat",children:s.jsx(Ar,{size:13})})]},L.id))]})]}),s.jsxs("section",{className:"chat-main",children:[s.jsxs("header",{className:"chat-head",children:[l&&d!==null?s.jsx("input",{className:"input chat-rename",autoFocus:!0,value:d,onChange:L=>f(L.target.value),onBlur:()=>void I(),onKeyDown:L=>L.key==="Enter"?void I():L.key==="Escape"&&f(null),"aria-label":"Chat title"}):s.jsx("h1",{className:"chat-title",onDoubleClick:()=>l&&f(l.title),title:l?"Double-click to rename":void 0,children:(l==null?void 0:l.title)??"New chat"}),s.jsx("div",{className:"grow"}),l&&l.costUsd>0&&s.jsxs("span",{className:"muted small",children:["Total ",hd(l.costUsd)]}),(l==null?void 0:l.started)&&s.jsx("button",{className:"btn ghost sm",onClick:C,title:"Copy the command that continues this session in a terminal",children:s.jsx("code",{children:"claude --resume"})})]}),s.jsxs("div",{className:"chat-scroll",ref:m,onScroll:L=>p.current=L.currentTarget.scrollHeight-L.currentTarget.scrollTop-L.currentTarget.clientHeight<80,children:[c&&s.jsx("div",{className:"error-box",children:c}),!c&&(!l||l.messages.length===0)&&s.jsxs("div",{className:"chat-empty",children:[s.jsx("span",{className:"chat-empty-icon",children:s.jsx(Ch,{size:26})}),s.jsx("h2",{children:"Chat with Claude Code"}),s.jsxs("p",{className:"muted",children:["Runs Claude Code in this repository, like the terminal: it reads ",s.jsx("code",{children:"CLAUDE.md"}),", your skills and settings, and can edit files depending on the permission mode. Attach files with the paperclip, paste or drop them. Type ",s.jsx("code",{children:"/"})," for commands."]})]}),s.jsx(yj.Provider,{value:A,children:l==null?void 0:l.messages.map(L=>s.jsx(oA,{m:L},L.id))})]}),s.jsx(uA,{settings:y,onSettings:L=>void v(L),busy:!!(l!=null&&l.busy),onSend:b,onStop:k,ensureSession:x,onSlash:E})]})]})}const dA={name:"",description:"",instructions:"",model:"sonnet",skills:[],claudeMdSections:[],permissions:Tb,review:"auto"},hA=[{key:"browser",label:"Browser",hint:"Drive a real browser with playwright cli; gets the .env values (base URL, accounts)."},{key:"editTests",label:"Edit tests",hint:"Edit tests/e2e, tests/pages and tests/fixtures."},{key:"editSpecs",label:"Edit specs",hint:"Edit files in specs/."},{key:"typecheck",label:"Typecheck",hint:"Run npm run typecheck."}],Qm=e=>({name:e.name,description:e.description,instructions:e.instructions,model:e.model,skills:e.skills,claudeMdSections:e.claudeMdSections,permissions:e.permissions,review:e.review??"auto"}),qm=(e,t)=>e.includes(t)?e.filter(n=>n!==t):[...e,t],fA=[{id:"scoped",label:"Scoped",hint:"Read the repository; write only its job directory plus what the toggles allow."},{id:"full",label:"Full edit",hint:"Create and edit any file and run any shell command, except the denied commands and protected folders below."}],pA=[{key:"deniedCommands",label:"Denied commands",hint:"One command per line; it is blocked with any arguments (Bash(<command>:*)).",placeholder:`git push
407
- rm -rf`},{key:"protectedPaths",label:"Protected folders",hint:"One folder per line, relative to the repository root; the agent cannot edit or create files inside it (Edit(<folder>/**)).",placeholder:`qa-studio
408
- .git`}];function Gm(){var L,M,U;const{id:e}=li(),t=!e,n=ut(),r=Ir(),i=In(),l=$e(()=>e?Q.customAgent(e):Promise.resolve(null),[e]),a=$e(()=>Q.claudeMdSections()),o=$e(()=>Q.skills()),[u,c]=j.useState(dA),[h,d]=j.useState("instructions"),[f,m]=j.useState(null),[p,g]=j.useState(null),[w,y]=j.useState(!1),[x,v]=j.useState(!1);j.useEffect(()=>{l.data&&c(Qm(l.data))},[l.data]);const b=(D,q)=>c(J=>({...J,[D]:q})),A=D=>c(q=>{const J=q.permissions,B=D==="full"&&!J.deniedCommands.length&&!J.protectedPaths.length;return{...q,permissions:{...J,mode:D,...B?{deniedCommands:Uy,protectedPaths:By}:{}}}}),k=async D=>{const q=Ub(D);u.instructions.trim()&&u.instructions!==q.instructions&&!await i({title:`Load the ${qc.find(B=>B.id===D).label} template?`,message:"It replaces the instructions, description, model, review mode and permissions of this draft. Nothing is saved until you click Save.",confirmLabel:"Load template"})||(c(J=>({...J,name:t||!J.name.trim()?q.name:J.name,description:q.description,instructions:q.instructions,model:q.model,review:q.review,permissions:q.permissions})),d("instructions"),r.success(`Template loaded${t?"":": click Save to keep it"}`))},E=async()=>{var D;y(!0),g(null);try{const q=t?await Q.createCustomAgent(u):await Q.saveCustomAgent(e,u,(D=l.data)==null?void 0:D.updatedAt);r.success(t?`Agent "${q.name}" created`:`Agent "${q.name}" saved`),t?n(`/agents/custom/${q.id}`,{replace:!0}):l.reload()}catch(q){g(q.message)}finally{y(!1)}},T=async()=>{if(await i({title:`Delete the agent "${u.name}"?`,message:"Past jobs keep their results. This cannot be undone.",confirmLabel:"Delete agent",danger:!0}))try{await Q.deleteCustomAgent(e),r.success("Agent deleted"),n("/agents")}catch(q){r.error(q.message)}};j.useEffect(()=>{if(h!=="preview"&&h!=="permissions")return;let D=!0;const q=setTimeout(()=>{Q.previewCustomAgent(t?null:e,{agent:u}).then(J=>D&&(m(J),g(null))).catch(J=>D&&g(J.message))},300);return()=>{D=!1,clearTimeout(q)}},[h,u]);const I=!!l.data&&JSON.stringify(Qm(l.data))!==JSON.stringify(u),C=!w&&(t||!!l.data&&!l.error),R=u.claudeMdSections.filter(D=>a.data&&!a.data.includes(D));return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Agents",to:"/agents"},{label:t?"New agent":u.name||"…"}]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:t?"New agent":u.name}),s.jsx("p",{className:"page-sub",children:"A custom LLM agent. It runs through Claude Code with the tools you allow below; .env reads, WebFetch and WebSearch are always blocked."})]}),s.jsxs("span",{className:"row",children:[s.jsx(ye,{to:"/agents",className:"btn ghost",children:"Back"}),s.jsxs("select",{className:"input",style:{width:"auto"},value:"",onChange:D=>D.target.value&&void k(D.target.value),"aria-label":"Load template",title:"Fill this agent from a built-in SDLC template",children:[s.jsx("option",{value:"",children:"Load template…"}),qc.map(D=>s.jsx("option",{value:D.id,children:D.label},D.id))]}),!t&&s.jsxs("button",{className:"btn danger",onClick:()=>void T(),disabled:w,children:[s.jsx(Ar,{size:14})," Delete"]}),!t&&s.jsxs("button",{className:"btn ghost",onClick:()=>v(!0),disabled:I||!l.data,title:I?"Save your changes first":void 0,children:[s.jsx(ft,{size:14})," Run"]}),s.jsxs("button",{className:"btn",onClick:()=>void E(),disabled:!C,children:[t?s.jsx(qt,{size:14}):s.jsx(cs,{size:14})," ",t?"Create agent":"Save"]})]})]}),s.jsx(Le,{error:l.error??p}),s.jsxs("div",{className:"card pl-meta four",children:[s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:"Name"}),s.jsx("input",{className:"input",value:u.name,maxLength:80,onChange:D=>b("name",D.target.value),placeholder:"e.g. Accessibility reviewer"})]}),s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:"Description"}),s.jsx("input",{className:"input",value:u.description,maxLength:500,onChange:D=>b("description",D.target.value),placeholder:"Optional"})]}),s.jsxs("label",{className:"pl-field pl-from",children:[s.jsx("span",{children:"Model"}),s.jsx("select",{className:"input",value:u.model,onChange:D=>b("model",D.target.value),children:Th.map(D=>s.jsx("option",{value:D.id,children:D.label},D.id))})]}),s.jsxs("div",{className:"pl-field",children:[s.jsx("span",{children:"Review"}),s.jsx("div",{className:"seg",role:"radiogroup","aria-label":"Review mode",children:["auto","human"].map(D=>s.jsx("button",{type:"button",role:"radio","aria-checked":u.review===D,className:`seg-btn ${u.review===D?"on":""}`,onClick:()=>b("review",D),children:D==="auto"?"Auto":"Human"},D))}),s.jsx("span",{className:"muted small",children:u.review==="human"?"The pipeline pauses after this agent until someone approves or rejects its output.":"The pipeline goes on as soon as this agent finishes."})]})]}),s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"card-head row between",children:s.jsx(kn,{value:h,onChange:d,items:[{id:"instructions",label:"Instructions"},{id:"context",label:u.claudeMdSections.length?`CLAUDE.md (${u.claudeMdSections.length})`:"CLAUDE.md"},{id:"skills",label:u.skills.length?`Skills (${u.skills.length})`:"Skills"},{id:"preview",label:"Full prompt preview"},{id:"permissions",label:"Permissions"}]})}),h==="instructions"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("p",{className:"muted small",style:{margin:0},children:["Placeholders: ",Eb.map(D=>`{{${D}}}`).join(", "),". Agent Studio adds the fixed part (environment, tool rules, result file) after your instructions."]}),s.jsx("textarea",{className:"input prompt-editor",value:u.instructions,onChange:D=>b("instructions",D.target.value),spellCheck:!1,"aria-label":"Instructions"}),s.jsxs("span",{className:"muted small",children:[u.instructions.length.toLocaleString()," characters"]})]}),h==="context"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsx("p",{className:"muted small",style:{margin:0},children:"CLAUDE.md is always loaded. Pick the sections this agent must follow; the prompt names them explicitly."}),R.length>0&&s.jsx("div",{children:s.jsxs("span",{className:"chip warn",children:["Not in CLAUDE.md any more: ",R.join(", ")]})}),s.jsx(Le,{error:a.error}),((L=a.data)==null?void 0:L.length)===0&&s.jsx("p",{className:"muted",children:"CLAUDE.md has no sections yet."}),s.jsx("div",{className:"skill-list",children:[...a.data??[],...R].map(D=>s.jsxs("label",{className:`skill-item ${u.claudeMdSections.includes(D)?"on":""}`,children:[s.jsx("input",{type:"checkbox",checked:u.claudeMdSections.includes(D),onChange:()=>b("claudeMdSections",qm(u.claudeMdSections,D)),"aria-label":`Section ${D}`}),s.jsx("b",{children:D})]},D))})]}),h==="skills"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("p",{className:"muted small",style:{margin:0},children:["Claude Code skills from ",s.jsx("code",{children:".claude/skills/<name>/SKILL.md"}),". The agent loads the selected skills itself when it runs."]}),s.jsx(Le,{error:o.error}),((M=o.data)==null?void 0:M.length)===0&&s.jsx("p",{className:"muted",children:"No skills found in .claude/skills."}),s.jsx("div",{className:"skill-list",children:(U=o.data)==null?void 0:U.map(D=>{const q=u.skills.includes(D.name);return s.jsxs("label",{className:`skill-item ${q?"on":""} ${D.error&&!q?"invalid":""}`,title:D.error??D.dir,children:[s.jsx("input",{type:"checkbox",checked:q,disabled:!!D.error&&!q,onChange:()=>b("skills",qm(u.skills,D.name)),"aria-label":`Attach skill ${D.name}`}),s.jsx("b",{children:D.name}),s.jsx("span",{className:"skill-desc muted small",children:D.error??D.description})]},D.name)})})]}),h==="permissions"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("p",{className:"muted small",style:{margin:0},children:["Headless Claude Code with ",s.jsx("code",{children:"--permission-mode dontAsk"}),": anything outside the allow list is denied. The lists below follow your changes."]}),s.jsx("div",{className:"skill-list",children:fA.map(D=>s.jsxs("label",{className:`skill-item ${u.permissions.mode===D.id?"on":""}`,children:[s.jsx("input",{type:"radio",name:"permission-mode",checked:u.permissions.mode===D.id,onChange:()=>A(D.id)}),s.jsx("b",{children:D.label}),s.jsx("span",{className:"skill-desc muted small",children:D.hint})]},D.id))}),s.jsx("h4",{children:u.permissions.mode==="full"?"Options":"Allow"}),s.jsx("div",{className:"skill-list",children:hA.filter(D=>u.permissions.mode==="scoped"||D.key==="browser").map(D=>s.jsxs("label",{className:`skill-item ${u.permissions[D.key]?"on":""}`,children:[s.jsx("input",{type:"checkbox",checked:u.permissions[D.key],onChange:q=>b("permissions",{...u.permissions,[D.key]:q.target.checked})}),s.jsx("b",{children:D.label}),s.jsx("span",{className:"skill-desc muted small",children:D.hint})]},D.key))}),s.jsx("h4",{children:"Deny"}),u.permissions.mode==="full"&&s.jsx("p",{className:"muted small",style:{margin:0},children:"Command rules match the start of a command, so they are a guard rail, not a sandbox: an agent with full shell access can still reach a protected folder or .env another way. Use Full edit only for agents you trust."}),pA.map(D=>s.jsxs("label",{className:"pl-field",children:[s.jsxs("span",{children:[s.jsx("b",{children:D.label})," ",s.jsx("span",{className:"muted small",children:D.hint})]}),s.jsx("textarea",{className:"input",rows:4,spellCheck:!1,placeholder:D.placeholder,value:u.permissions[D.key].join(`
409
- `),onChange:q=>b("permissions",{...u.permissions,[D.key]:q.target.value.split(`
410
- `)}),"aria-label":D.label})]},D.key)),f&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{children:"Allowed"}),s.jsx("div",{className:"perm",children:f.allowedTools.map(D=>s.jsx("code",{children:D},D))}),s.jsx("h4",{children:"Denied"}),s.jsx("div",{className:"perm",children:f.disallowedTools.map(D=>s.jsx("code",{className:"deny",children:D},D))})]})]}),h==="preview"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsx("span",{className:"muted small",children:"What Claude Code receives, with your unsaved edits (updates as you type). Placeholders stay generic; secret values are never shown."}),f?s.jsxs("pre",{className:"prompt-preview",children:[f.instructionsPart,`
391
+ `))}function u(m,p,g,w){const y=g.enter("tableCell"),x=g.enter("phrasing"),v=g.containerPhrasing(m,{...w,before:l,after:l});return x(),y(),v}function c(m,p){return gP(m,{align:p,alignDelimiters:r,fillRows:!1,padding:n,stringLength:i})}function h(m,p,g){const{children:w}=m;let y=-1;const x=[],v=p.enter("table");for(;++y<w.length;)x[y]=d(w[y],p,g);return v(),x}function d(m,p,g){const{children:w}=m;let y=-1;const x=[],v=p.enter("tableRow");for(;++y<w.length;)x[y]=u(w[y],m,p,g);return v(),x}function f(m,p,g){const w=ud.inlineCode(m,p,g);if(!g.stack.includes("tableCell"))return w;const y=[];let x=0,v=w.indexOf("|");for(;v!==-1;){let b=v;for(;b>x&&w.charCodeAt(b-1)===92;)b--;y.push(w.slice(x,v)),(v-b)%2===0&&y.push("\\"),x=v,v=w.indexOf("|",v+1)}return y.push(w.slice(x)),y.join("")}}function uR(e,t,n,r){if(e.type==="table"&&n.type==="listItem"&&n.spread===!1&&(t.type==="definition"||t.type==="heading"&&cR(t,r)||t.type==="paragraph"||t.type==="table"))return 1}function cR(e,t){let n=!1;return Uo(e,function(r){if(r.type==="break"||"value"in r&&/\r?\n|\r/.test(r.value))return n=!0,qi}),!!((!e.depth||e.depth<3)&&Mo(e)&&(t.options.setext||n))}function dR(){return{exit:{taskListCheckValueChecked:zm,taskListCheckValueUnchecked:zm,paragraph:fR}}}function hR(){return{handlers:{paragraph:pR},join:[mR]}}function zm(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function fR(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let l=-1,a;for(;++l<i.length;){const o=i[l];if(o.type==="paragraph"){a=o;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start={...r.position.start}))}}this.exit(e)}function pR(e,t,n,r){if(!t||t.type!=="listItem"||nj(t)!==e)return ud.paragraph(e,t,n,r);const i="["+(t.checked?"x":" ")+"] ",l=n.createTracker(r);l.move(i);const a=ud.paragraph(e.children.length>0?e:{type:"paragraph",children:[{type:"text",value:" "}]},t,n,{...r,...l.current()});return i+a}function mR(e,t,n){if(!(e.type==="definition"&&n.type==="listItem"))return;const r=nj(n);if(r&&n.children.indexOf(e)<n.children.indexOf(r))return 0}function nj(e){if(typeof e.checked=="boolean")for(const t of e.children){if(t.type==="paragraph")return t;if(t.type!=="definition")return}}function gR(){return[zT(),iP(),uP(),nR(),dR()]}function xR(e){return{extensions:[MT(),lP(e),cP(),oR(e),hR()]}}const yR={tokenize:SR,partial:!0},rj={tokenize:NR,partial:!0},sj={tokenize:CR,partial:!0},ij={tokenize:ER,partial:!0},vR={tokenize:TR,partial:!0},lj={name:"wwwAutolink",tokenize:kR,previous:oj},aj={name:"protocolAutolink",tokenize:bR,previous:uj},Xn={name:"emailAutolink",tokenize:wR,previous:cj},Dn={};function jR(){return{text:Dn}}let Ur=48;for(;Ur<123;)Dn[Ur]=Xn,Ur++,Ur===58?Ur=65:Ur===91&&(Ur=97);Dn[43]=Xn;Dn[45]=Xn;Dn[46]=Xn;Dn[95]=Xn;Dn[72]=[Xn,aj];Dn[104]=[Xn,aj];Dn[87]=[Xn,lj];Dn[119]=[Xn,lj];function wR(e,t,n){const r=this;let i,l;return a;function a(d){return!cd(d)||!cj.call(r,r.previous)||Yh(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(d))}function o(d){return cd(d)?(e.consume(d),o):d===64?(e.consume(d),u):n(d)}function u(d){return d===46?e.check(vR,h,c)(d):d===45||d===95||jt(d)?(l=!0,e.consume(d),u):h(d)}function c(d){return e.consume(d),i=!0,u}function h(d){return l&&i&&vt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function kR(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!oj.call(r,r.previous)||Yh(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(yR,e.attempt(rj,e.attempt(sj,l),n),n)(a))}function l(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function bR(e,t,n){const r=this;let i="",l=!1;return a;function a(d){return(d===72||d===104)&&uj.call(r,r.previous)&&!Yh(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),o):n(d)}function o(d){if(vt(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),o;if(d===58){const f=i.toLowerCase();if(f==="http"||f==="https")return e.consume(d),u}return n(d)}function u(d){return d===47?(e.consume(d),l?c:(l=!0,u)):n(d)}function c(d){return d===null||ro(d)||Fe(d)||os(d)||Nl(d)?n(d):e.attempt(rj,e.attempt(sj,h),n)(d)}function h(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function SR(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),l):n(a)}function l(a){return a===null?n(a):t(a)}}function NR(e,t,n){let r,i,l;return a;function a(c){return c===46||c===95?e.check(ij,u,o)(c):c===null||Fe(c)||os(c)||c!==45&&Nl(c)?u(c):(l=!0,e.consume(c),a)}function o(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),a}function u(c){return i||r||!l?n(c):t(c)}}function CR(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?l(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(ij,t,l)(a):a===null||Fe(a)||os(a)?t(a):(e.consume(a),i)}function l(a){return a===41&&r++,e.consume(a),i}}function ER(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),l):o===93?(e.consume(o),i):o===60||o===null||Fe(o)||os(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||Fe(o)||os(o)?t(o):r(o)}function l(o){return vt(o)?a(o):n(o)}function a(o){return o===59?(e.consume(o),r):vt(o)?(e.consume(o),a):n(o)}}function TR(e,t,n){return r;function r(l){return e.consume(l),i}function i(l){return jt(l)?n(l):t(l)}}function oj(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Fe(e)}function uj(e){return!vt(e)}function cj(e){return!(e===47||cd(e))}function cd(e){return e===43||e===45||e===46||e===95||jt(e)}function Yh(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const PR={tokenize:$R,partial:!0};function RR(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:DR,continuation:{tokenize:zR},exit:MR}},text:{91:{name:"gfmFootnoteCall",tokenize:IR},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:LR,resolveTo:AR}}}}function LR(e,t,n){const r=this;let i=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){a=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return o;function o(u){if(!a||!a._balanced)return n(u);const c=jn(r.sliceSerialize({start:a.end,end:r.now()}));return c.codePointAt(0)!==94||!l.includes(c.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function AR(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",l,t],["enter",a,t],["exit",a,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function IR(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,a;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),u}function u(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(d){if(l>999||d===93&&!a||d===null||d===91||Fe(d))return n(d);if(d===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return i.includes(jn(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return Fe(d)||(a=!0),l++,e.consume(d),d===92?h:c}function h(d){return d===91||d===92||d===93?(e.consume(d),l++,c):c(d)}}function DR(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,a=0,o;return u;function u(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):n(p)}function h(p){if(a>999||p===93&&!o||p===null||p===91||Fe(p))return n(p);if(p===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return l=jn(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return Fe(p)||(o=!0),a++,e.consume(p),p===92?d:h}function d(p){return p===91||p===92||p===93?(e.consume(p),a++,h):h(p)}function f(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(l)||i.push(l),Ie(e,m,"gfmFootnoteDefinitionWhitespace")):n(p)}function m(p){return t(p)}}function zR(e,t,n){return e.check(Cl,t,e.attempt(PR,t,n))}function MR(e){e.exit("gfmFootnoteDefinition")}function $R(e,t,n){const r=this;return Ie(e,i,"gfmFootnoteDefinitionIndent",5);function i(l){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(l):n(l)}}function _R(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,o){let u=-1;for(;++u<a.length;)if(a[u][0]==="enter"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._close){let c=u;for(;c--;)if(a[c][0]==="exit"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._open&&a[u][1].end.offset-a[u][1].start.offset===a[c][1].end.offset-a[c][1].start.offset){a[u][1].type="strikethroughSequence",a[c][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},a[c][1].start),end:Object.assign({},a[u][1].end)},d={type:"strikethroughText",start:Object.assign({},a[c][1].end),end:Object.assign({},a[u][1].start)},f=[["enter",h,o],["enter",a[c][1],o],["exit",a[c][1],o],["enter",d,o]],m=o.parser.constructs.insideSpan.null;m&&vn(f,f.length,0,$o(m,a.slice(c+1,u),o)),vn(f,f.length,0,[["exit",d,o],["enter",a[u][1],o],["exit",a[u][1],o],["exit",h,o]]),vn(a,c-1,u-c+3,f),u=c+f.length-2;break}}for(u=-1;++u<a.length;)a[u][1].type==="strikethroughSequenceTemporary"&&(a[u][1].type="data");return a}function l(a,o,u){const c=this.previous,h=this.events;let d=0;return f;function f(p){return c===126&&h[h.length-1][1].type!=="characterEscape"?u(p):(a.enter("strikethroughSequenceTemporary"),m(p))}function m(p){const g=Nr(c);if(p===126)return d>1?u(p):(a.consume(p),d++,m);if(d<2&&!n)return u(p);const w=a.exit("strikethroughSequenceTemporary"),y=Nr(p);return w._open=!y||y===2&&!!g,w._close=!g||g===2&&!!y,o(p)}}}class OR{constructor(){this.map=[],this.index=new Map}add(t,n,r){FR(this,t,n,r)}consume(t){if(this.map.sort(function(l,a){return l[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const l of i)t.push(l);i=r.pop()}this.map.length=0,this.index.clear()}}function FR(e,t,n,r){if(n===0&&r.length===0)return;const i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}const l=[t,n,r];e.map.push(l),e.index.set(t,l)}function UR(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function BR(){return{flow:{null:{name:"table",tokenize:HR,resolveAll:WR}}}}function HR(e,t,n){const r=this;let i=0,l=0,a;return o;function o(C){let R=r.events.length-1;for(;R>-1;){const{type:U}=r.events[R][1];if(U==="lineEnding"||U==="linePrefix")R--;else break}const L=R>-1?r.events[R][1].type:null,M=L==="tableHead"||L==="tableRow"?k:u;return M===k&&r.parser.lazy[r.now().line]?n(C):M(C)}function u(C){return e.enter("tableHead"),e.enter("tableRow"),c(C)}function c(C){return C===124||(a=!0,l+=1),h(C)}function h(C){return C===null?n(C):he(C)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),m):n(C):je(C)?Ie(e,h,"whitespace")(C):(l+=1,a&&(a=!1,i+=1),C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),a=!0,h):(e.enter("data"),d(C)))}function d(C){return C===null||C===124||Fe(C)?(e.exit("data"),h(C)):(e.consume(C),C===92?f:d)}function f(C){return C===92||C===124?(e.consume(C),d):d(C)}function m(C){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(C):(e.enter("tableDelimiterRow"),a=!1,je(C)?Ie(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):p(C))}function p(C){return C===45||C===58?w(C):C===124?(a=!0,e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),g):A(C)}function g(C){return je(C)?Ie(e,w,"whitespace")(C):w(C)}function w(C){return C===58?(l+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),y):C===45?(l+=1,y(C)):C===null||he(C)?b(C):A(C)}function y(C){return C===45?(e.enter("tableDelimiterFiller"),x(C)):A(C)}function x(C){return C===45?(e.consume(C),x):C===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(C))}function v(C){return je(C)?Ie(e,b,"whitespace")(C):b(C)}function b(C){return C===124?p(C):C===null||he(C)?!a||i!==l?A(C):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(C)):A(C)}function A(C){return n(C)}function k(C){return e.enter("tableRow"),E(C)}function E(C){return C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),E):C===null||he(C)?(e.exit("tableRow"),t(C)):je(C)?Ie(e,E,"whitespace")(C):(e.enter("data"),T(C))}function T(C){return C===null||C===124||Fe(C)?(e.exit("data"),E(C)):(e.consume(C),C===92?I:T)}function I(C){return C===92||C===124?(e.consume(C),T):T(C)}}function WR(e,t){let n=-1,r=!0,i=0,l=[0,0,0,0],a=[0,0,0,0],o=!1,u=0,c,h,d;const f=new OR;for(;++n<e.length;){const m=e[n],p=m[1];m[0]==="enter"?p.type==="tableHead"?(o=!1,u!==0&&(Mm(f,t,u,c,h),h=void 0,u=0),c={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},f.add(n,0,[["enter",c,t]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,d=void 0,l=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,h={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},f.add(n,0,[["enter",h,t]])),i=p.type==="tableDelimiterRow"?2:h?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(l[1]!==0&&(a[0]=a[1],d=la(f,t,l,i,void 0,d),l=[0,0,0,0]),a[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(a[0]=a[1],d=la(f,t,l,i,void 0,d)),l=a,a=[l[1],n,0,0])):p.type==="tableHead"?(o=!0,u=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(u=n,l[1]!==0?(a[0]=a[1],d=la(f,t,l,i,n,d)):a[1]!==0&&(d=la(f,t,a,i,n,d)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(a[3]=n)}for(u!==0&&Mm(f,t,u,c,h),f.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=UR(t.events,n))}return e}function la(e,t,n,r,i,l){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(l.end=Object.assign({},Ss(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const u=Ss(t.events,n[1]);if(l={type:a,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const c=Ss(t.events,n[2]),h=Ss(t.events,n[3]),d={type:o,start:Object.assign({},c),end:Object.assign({},h)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const f=t.events[n[2]],m=t.events[n[3]];if(f[1].end=Object.assign({},m[1].end),f[1].type="chunkText",f[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,g=n[3]-n[2]-1;e.add(p,g,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(l.end=Object.assign({},Ss(t.events,i)),e.add(i,0,[["exit",l,t]]),l=void 0),l}function Mm(e,t,n,r,i){const l=[],a=Ss(t.events,n);i&&(i.end=Object.assign({},a),l.push(["exit",i,t])),r.end=Object.assign({},a),l.push(["exit",r,t]),e.add(n+1,0,l)}function Ss(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const VR={name:"tasklistCheck",tokenize:qR};function QR(){return{text:{91:VR}}}function qR(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),l)}function l(u){return Fe(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),a):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),a):n(u)}function a(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(u)}function o(u){return he(u)?t(u):je(u)?e.check({tokenize:GR},t,n)(u):n(u)}}function GR(e,t,n){return Ie(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function KR(e){return mv([jR(),RR(),_R(e),BR(),QR()])}const YR={};function dj(e){const t=this,n=e||YR,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(KR(n)),l.push(gR()),a.push(xR(n))}const Jh=[dj],Xh={table:({node:e,...t})=>s.jsx("div",{className:"table-wrap md-table",children:s.jsx("table",{...t})}),a:({node:e,...t})=>s.jsx("a",{...t,target:"_blank",rel:"noreferrer"})};function $m({children:e,className:t}){return s.jsx("div",{className:t?`md ${t}`:"md",children:s.jsx(zr,{remarkPlugins:Jh,components:Xh,children:e})})}function hj({preview:e}){const[t,n]=j.useState("rendered"),[r,...i]=e.fixedPart.split(`
392
+ `);return s.jsxs("div",{style:{display:"grid",gap:8},children:[s.jsx("div",{children:s.jsx(un,{value:t,onChange:n,items:[{id:"rendered",label:"Rendered"},{id:"raw",label:"Raw"}]})}),t==="raw"?s.jsxs("pre",{className:"prompt-preview",children:[e.instructionsPart,`
411
393
 
412
- `,f.fixedPart.split(`
413
- `).map((D,q)=>s.jsxs("span",{className:q===0?"fixed-head":"fixed",children:[D,`
414
- `]},q))]}):!p&&s.jsx("p",{className:"muted",children:"Building preview…"})]})]}),x&&e&&s.jsx(Bv,{title:"Run agent",onClose:()=>v(!1),onStart:(D,q)=>Q.createJob({type:"custom",agentId:e,...D?{spec:D}:{},...q.trim()?{input:q}:{}})})]})}const mA=["Read(.env)","Read(**/.env)","Read(.env.local)","Read(**/.env.local)","WebFetch","WebSearch"],gA={validator:{command:"playwright test tests/e2e/<spec>.spec.ts --project=chrome --repeat-each=3 --retries=0 --reporter=line,json",notes:["Runs after the QA Script Generator and after each QA Script Healer round (QA Validator ⇄ QA Script Healer loop, max rounds in Settings).","Passes only when every repetition passes: catches flaky scripts before they are accepted."]},runner:{command:"playwright test [files] [--grep <TC-IDs>] --project=chrome --repeat-each=<n> --reporter=line,json[,html]",notes:["Used by Run tests and Test runs.",'The HTML reporter is added when the run has "HTML report" on (default in Settings).']}};function xA(){const e=li().agent,t=Ne[e];return t?t.llm?s.jsx(jA,{agent:e}):s.jsx(yA,{agent:e}):s.jsx(Le,{error:`Unknown agent: ${e}`})}function jj({agent:e,extra:t}){const n=Ne[e];return s.jsxs(s.Fragment,{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Agents",to:"/agents"},{label:n.label}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{className:"row",style:{alignItems:"flex-start"},children:[s.jsx(Ft,{agent:e,size:44}),s.jsxs("div",{children:[s.jsxs("h1",{className:"page-title",children:[n.label," ",t]}),s.jsxs("p",{className:"page-sub",children:[n.description," · ",n.llm?"LLM agent (Claude Code)":"Deterministic step"]})]})]})})]})}function yA({agent:e}){const t=gA[e];return s.jsxs("section",{children:[s.jsx(jj,{agent:e}),s.jsxs("div",{className:"card pad",children:[s.jsx("p",{className:"muted",children:"This step has no prompt: it runs Playwright Test directly (no shell, no LLM). It cannot write any file other than its report."}),t&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{children:"Command"}),s.jsx("pre",{className:"prompt-preview",children:t.command}),s.jsx("ul",{children:t.notes.map(n=>s.jsx("li",{children:n},n))})]})]})]})}function vA({info:e,onSaved:t}){const[n,r]=j.useState(!1),[i,l]=j.useState(null),a=async u=>{if(u!==e.model){r(!0);try{await Q.saveAgentModel(e.agent,u),l(null),t()}catch(c){l(c.message)}finally{r(!1)}}},o=async()=>{r(!0);try{await Q.resetAgentModel(e.agent),l(null),t()}catch(u){l(u.message)}finally{r(!1)}};return s.jsxs("div",{className:"row",style:{gap:10,margin:"4px 0 14px"},children:[s.jsx("span",{className:"muted small",children:"Model:"}),s.jsx("select",{className:"select",value:e.model,disabled:n,onChange:u=>void a(u.target.value),"aria-label":`${Ne[e.agent].label} model`,children:Th.map(u=>s.jsx("option",{value:u.id,title:u.label,children:u.label},u.id))}),s.jsx(yt,{status:e.modelCustomized?"stale":"neutral",children:e.modelCustomized?"custom model":"default model"}),e.modelCustomized&&s.jsxs("button",{type:"button",className:"btn ghost sm",disabled:n,onClick:()=>void o(),title:"Use the default model",children:[s.jsx(Yn,{size:12})," Reset"]}),s.jsx(Le,{error:i})]})}function jA({agent:e}){var L;const{specs:t}=un(),n=In(),r=$e(()=>Q.agentPrompts(),[e]),i=(L=r.data)==null?void 0:L.find(M=>M.agent===e),[l,a]=j.useState(null),[o,u]=j.useState("instructions"),[c,h]=j.useState(""),[d,f]=j.useState(null),[m,p]=j.useState(null),[g,w]=j.useState(null),[y,x]=j.useState(null),[v,b]=j.useState(!1),A=j.useRef(null);j.useEffect(()=>{i&&l===null&&a(i.instructions)},[i,l]),j.useEffect(()=>a(null),[e]);const k=i!==void 0&&l!==null&&l!==i.instructions,E=i!==void 0&&l!==null&&l.trim()!==i.defaultInstructions.trim(),T=xh(({currentLocation:M,nextLocation:U})=>k&&M.pathname!==U.pathname);Rh(T,{title:"Discard the unsaved instructions?",message:"Your edits to this prompt will be lost.",confirmLabel:"Discard",danger:!0}),j.useEffect(()=>{if(o!=="preview"||l===null)return;const M=setTimeout(()=>{Q.previewAgentPrompt(e,{instructions:l,...c?{spec:c}:{}}).then(U=>(f(U),p(null))).catch(U=>p(U.message))},300);return()=>clearTimeout(M)},[o,l,c,e]);const I=async()=>{if(l!==null){b(!0);try{const M=await Q.saveAgentPrompt(e,l);a(M.instructions),r.reload(),w(null),x(M.customized?"Saved. New jobs use these instructions.":"Saved: same as the default, so the default is used.")}catch(M){w(M.message)}finally{b(!1)}}},C=async()=>{if(await n({title:`Reset the ${Ne[e].label} instructions?`,message:"Your custom instructions are replaced with the built-in default. New jobs use the default.",confirmLabel:"Reset to default",danger:!0})){b(!0);try{const U=await Q.resetAgentPrompt(e);a(U.instructions),r.reload(),w(null),x("Reset to the default instructions.")}catch(U){w(U.message)}finally{b(!1)}}},R=M=>{const U=A.current;if(!U||l===null)return;const D=`{{${M}}}`,q=l.slice(0,U.selectionStart)+D+l.slice(U.selectionEnd),J=U.selectionStart+D.length;a(q),requestAnimationFrame(()=>(U.focus(),U.setSelectionRange(J,J)))};return s.jsxs("section",{children:[s.jsx(jj,{agent:e,extra:i&&(i.customized?s.jsx(yt,{status:"stale",children:"custom instructions"}):s.jsx(yt,{status:"neutral",children:"default instructions"}))}),i&&s.jsx(vA,{info:i,onSaved:r.reload}),s.jsx(Le,{error:r.error??g}),y&&!k&&s.jsx("div",{className:"ok-box",children:y}),s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head row between",children:[s.jsx(kn,{value:o,onChange:u,items:[{id:"instructions",label:k?"Instructions •":"Instructions"},{id:"skills",label:i!=null&&i.skills.length?`Skills (${i.skills.length})`:"Skills"},{id:"preview",label:"Full prompt preview"},{id:"permissions",label:"Permissions"}]}),s.jsxs("span",{className:"row",children:[s.jsxs("button",{className:"btn ghost",onClick:()=>void C(),disabled:v||!(i!=null&&i.customized),title:"Use the built-in instructions",children:[s.jsx(Yn,{size:14})," Reset to default"]}),s.jsxs("button",{className:"btn",onClick:()=>void I(),disabled:v||!k,children:[s.jsx(cs,{size:14})," Save"]})]})]}),o==="instructions"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("p",{className:"muted small",style:{margin:0},children:["The agent's role and working rules. Agent Studio appends a fixed part to every prompt: input files, the ",s.jsx("code",{children:".env"})," environment, tool rules and the output JSON the pipeline reads. That part cannot be edited here; see ",s.jsx("b",{children:"Full prompt preview"}),". Project rules shared by all agents live in"," ",s.jsx(ye,{to:"/project",children:"CLAUDE.md"}),". Changes apply to jobs that start after saving."]}),i&&s.jsxs("div",{className:"ph-list","aria-label":"Insert placeholder",children:[s.jsx("span",{className:"muted small",children:"Insert:"}),Object.entries(i.placeholders).map(([M,U])=>s.jsx("button",{type:"button",className:"chip",title:U,onClick:()=>R(M),children:`{{${M}}}`},M))]}),s.jsx("textarea",{ref:A,className:"input prompt-editor",value:l??"",onChange:M=>(a(M.target.value),x(null)),spellCheck:!1,"aria-label":`${Ne[e].label} instructions`,disabled:l===null}),s.jsxs("div",{className:"row between muted small",children:[s.jsxs("span",{children:[(l==null?void 0:l.length.toLocaleString())??0," characters",E?" · differs from the default":" · same as the default"]}),k&&s.jsx("button",{type:"button",className:"link-btn",onClick:()=>a(i.instructions),children:"Discard changes"})]})]}),o==="skills"&&i&&s.jsx(wA,{info:i,onSaved:()=>(r.reload(),f(null))}),o==="preview"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("div",{className:"row between",children:[s.jsxs("span",{className:"muted small",children:["What Claude Code receives",k?" (with your unsaved edits)":"",". Generic shows placeholders; pick a spec to see a real job with .env values (passwords and accounts masked)."]}),s.jsxs("select",{className:"select",value:c,onChange:M=>h(M.target.value),"aria-label":"Sample spec",children:[s.jsx("option",{value:"",children:"Generic (placeholders, no project data)"}),t.map(M=>s.jsx("option",{value:M.file,children:M.file},M.file))]})]}),s.jsx(Le,{error:m}),d?s.jsxs("pre",{className:"prompt-preview",children:[d.instructionsPart,`
394
+ `,e.fixedPart.split(`
395
+ `).map((l,a)=>s.jsxs("span",{className:a===0?"fixed-head":"fixed",children:[l,`
396
+ `]},a))]}):s.jsxs("div",{className:"prompt-rendered",children:[s.jsx($m,{children:e.instructionsPart}),e.fixedPart&&s.jsxs("div",{className:"prompt-rendered-fixed",children:[s.jsx("div",{className:"prompt-rendered-fixed-head",children:r.replace(/^-+\s*|\s*-+$/g,"")||"Fixed part"}),s.jsx($m,{children:i.join(`
397
+ `)})]})]})]})}function JR(e,t){if(t<=7)return Array.from({length:t},(l,a)=>a+1);const n=[1],r=Math.max(2,e-1),i=Math.min(t-1,e+1);r>2&&n.push("…");for(let l=r;l<=i;l++)n.push(l);return i<t-1&&n.push("…"),n.push(t),n}function ms({page:e,pageSize:t,total:n,onPage:r,onPageSize:i,label:l="rows"}){const a=Math.max(1,Math.ceil(n/t)),o=n?(e-1)*t+1:0,u=Math.min(e*t,n);return s.jsxs("div",{className:"pagination",children:[s.jsx("span",{className:"muted small",children:n?`Showing ${o}–${u} of ${n} ${l}`:`0 ${l}`}),s.jsx("div",{className:"grow"}),s.jsxs("label",{className:"row small muted",style:{gap:6},children:["Rows per page",s.jsx("select",{className:"select sm",value:t,onChange:c=>i(Number(c.target.value)),"aria-label":"Rows per page",children:Rb.map(c=>s.jsx("option",{value:c,children:c},c))})]}),s.jsxs("nav",{className:"pager","aria-label":"Pagination",children:[s.jsx("button",{className:"pg-btn",onClick:()=>r(e-1),disabled:e<=1,"aria-label":"Previous page",children:s.jsx("span",{style:{display:"inline-flex",transform:"rotate(180deg)"},children:s.jsx(ni,{size:14})})}),JR(e,a).map((c,h)=>c==="…"?s.jsx("span",{className:"pg-gap",children:"…"},`e${h}`):s.jsx("button",{className:`pg-btn ${c===e?"active":""}`,onClick:()=>r(c),"aria-current":c===e?"page":void 0,children:c},c)),s.jsx("button",{className:"pg-btn",onClick:()=>r(e+1),disabled:e>=a,"aria-label":"Next page",children:s.jsx(ni,{size:14})})]})]})}function Tl(e=[],t=Hy){const[n,r]=j.useState(1),[i,l]=j.useState(t);return j.useEffect(()=>r(1),e),{page:n,setPage:r,pageSize:i,setPageSize:o=>{l(o),r(1)}}}function Zh(e,t=[],n=Hy){const r=Tl(t,n),i=Math.max(1,Math.ceil(e.length/r.pageSize)),l=Math.min(r.page,i);return{pageItems:j.useMemo(()=>e.slice((l-1)*r.pageSize,l*r.pageSize),[e,l,r.pageSize]),props:{page:l,pageSize:r.pageSize,total:e.length,onPage:r.setPage,onPageSize:r.setPageSize}}}const Pl=(e,t)=>{var r;const n=bl(e);return n?((r=t.find(i=>i.id===n))==null?void 0:r.name)??`${e} (deleted)`:Ne[e].label},ef=e=>bl(e)?"custom":e,XR={pending:"not started",running:"running",passed:"passed",out:"out of iterations",stopped:"stopped"};function ZR({nodes:e,agents:t,selected:n,onSelect:r,waitingRunId:i,finished:l}){const a=u=>{if(u.kind==="agent")return s.jsx(fj,{node:u,label:Pl(u.ref,t),selected:n,onSelect:r,waitingRunId:i??null,finished:l},u.key);const c=u.passes.reduce((d,f)=>d+f,0),h=u.passes.length>1?`${u.passes.join(" + ")} iterations (one number per pass of the outer loop)`:`${c} iteration${c===1?"":"s"}`;return s.jsxs("div",{className:`ptl-loop ${u.state}`,children:[s.jsxs("div",{className:"ptl-loop-head",children:[s.jsx(as,{size:13}),s.jsxs("b",{children:["Loop ×",u.step.maxIterations]}),s.jsxs("span",{className:"muted",children:["· until ",u.step.endsWhen==="last"?"last":"first"," passes"]}),s.jsx("span",{className:`ptl-state ${u.state}`,children:XR[u.state]})]}),s.jsx("div",{className:"ptl-row",children:u.children.map((d,f)=>o(d,f))}),s.jsx("div",{className:`ptl-return ${c?"":"idle"}`,title:`Ran ${h}; at most ${u.step.maxIterations} per pass`,children:s.jsxs("span",{children:["↺ ×",c]})})]},u.key)},o=(u,c)=>s.jsxs(j.Fragment,{children:[c>0&&s.jsx("span",{className:"ptl-arrow","aria-hidden":"true",children:"→"}),a(u)]},u.key);return s.jsx("div",{className:"ptl",role:"tablist","aria-label":"Agents",children:e.map((u,c)=>o(u,c))})}function fj({node:e,label:t,selected:n,onSelect:r,waitingRunId:i,finished:l}){const{runs:a}=e;if(!a.length)return s.jsxs("div",{className:"ptl-node ghost","aria-disabled":"true",title:l?"Skipped":"Not run yet",children:[s.jsx(Ft,{agent:ef(e.ref),size:22}),s.jsx("span",{className:"ptl-name",children:t}),s.jsx("span",{className:`ptl-dot ${l?"skipped":"pending"}`})]});const o=a[a.length-1],u=a.some(h=>h.id===n),c=a.some(h=>h.id===i);return s.jsxs("div",{className:`ptl-node ${o.status} ${u?"selected":""} ${c?"waiting":""}`,children:[s.jsxs("button",{role:"tab","aria-selected":u,className:"ptl-main",onClick:()=>r((a.find(h=>h.id===n)??o).id),title:`${t} · ${a.length} run${a.length>1?"s":""}`,children:[s.jsx(Ft,{agent:o.agent,size:22}),s.jsx("span",{className:"ptl-name",children:t}),a.length>1&&s.jsxs("span",{className:"ptl-count",children:["×",a.length]})]}),s.jsx("span",{className:"ptl-runs",children:a.map((h,d)=>s.jsx("button",{type:"button",className:`ptl-dot ${h.id===i?"waiting":h.status} ${h.id===n?"on":""}`,onClick:()=>r(h.id),title:eL(h,t,d+1),"aria-label":`${t} run ${d+1}: ${h.status}`},h.id))}),a.length===1&&s.jsx("span",{className:"ptl-time",children:br(o.startedAt,o.finishedAt)})]})}function eL(e,t,n){const r=e.usage;return[`${t} #${n}: ${e.status}`,br(e.startedAt,e.finishedAt),e.turns!==null?`${e.turns} turns`:null,e.costUsd!==null?Kt(e.costUsd):null,r?`${sn(r.inputTokens+r.cacheReadTokens+r.cacheWriteTokens)} in / ${sn(r.outputTokens)} out`:null].filter(Boolean).join(" · ")}class _m extends Error{}const tL=e=>e.ref??e.agent;function nL(e){return e.status==="passed"?!0:e.agent==="explorer"&&e.status==="failed"&&e.output!==null&&e.output!==void 0}function Ns(e,t){return e.kind==="agent"?{kind:"ghost",key:t,ref:e.agent}:{kind:"loop",key:t,step:e,state:"pending",iterations:[e.steps.map((n,r)=>Ns(hs(n),`${t}.${r}`))]}}function rL(e,t){let n=0;const r=(a,o)=>{const u=t[n];if(!u)return{node:{kind:"ghost",key:o,ref:a},flow:"open"};if(tL(u)!==a)throw new _m;n++;const c=u.status!=="running"&&u.status!=="pending";return{node:{kind:"run",key:o,run:u},flow:c?nL(u)?"ok":"fail":"open"}},i=(a,o)=>a.kind==="agent"?r(a.agent,o):l(a,o),l=(a,o)=>{const u=a.steps.map(hs),c=a.endsWhen==="last",h=[],d=f=>({kind:"loop",key:o,step:a,iterations:h,state:f});if(n>=t.length)return{node:Ns(a,o),flow:"open"};for(let f=0;f<a.maxIterations;f++){const m=[];h.push(m);const p=`${o}i${f}`,g=y=>u.slice(y).forEach((x,v)=>m.push(Ns(x,`${p}.${y+v}`)));if(c){for(let y=0;y<u.length;y++){const x=i(u[y],`${p}.${y}`);if(m.push(x.node),x.flow==="open")return g(y+1),{node:d("running"),flow:"open"};if(x.flow==="stop")return{node:d("stopped"),flow:"stop"};const v=y===u.length-1;if(v&&x.flow==="ok")return{node:d("passed"),flow:"ok"};if(!v&&x.flow==="fail")return{node:d("stopped"),flow:"stop"}}if(f<a.maxIterations-1&&n>=t.length)return h.push(u.map((y,x)=>Ns(y,`${o}i${f+1}.${x}`))),{node:d("running"),flow:"open"};continue}const w=i(u[0],`${p}.0`);if(m.push(w.node),w.flow==="open")return{node:d("running"),flow:"open"};if(w.flow==="stop")return{node:d("stopped"),flow:"stop"};if(w.flow==="ok")return{node:d("passed"),flow:"ok"};if(f===a.maxIterations-1)break;for(let y=1;y<u.length;y++){const x=i(u[y],`${p}.${y}`);if(m.push(x.node),x.flow==="open")return g(y+1),{node:d("running"),flow:"open"};if(x.flow!=="ok")return{node:d("stopped"),flow:"stop"}}if(n>=t.length)return h.push([Ns(u[0],`${o}i${f+1}.0`)]),{node:d("running"),flow:"open"}}return{node:d("out"),flow:"fail"}};try{const a=[];let o=!1;return e.forEach((u,c)=>{if(o){a.push(Ns(u,`b${c}`));return}const h=i(u,`b${c}`);a.push(h.node),h.flow!=="ok"&&(o=!0)}),n===t.length?a:null}catch(a){if(a instanceof _m)return null;throw a}}const pj=e=>e.some(t=>t.kind==="run"||t.kind==="loop"&&t.iterations.some(pj));function mj(e){const t=e[0];if(t.kind!=="loop"){const a=t.kind==="run"?t.run.ref??t.run.agent:t.ref;return{kind:"agent",key:t.key,ref:a,runs:e.flatMap(o=>o.kind==="run"?[o.run]:[])}}const n=e.filter(a=>a.kind==="loop"),r=t.step.steps.length,i=[];for(let a=0;a<r;a++){const o=n.flatMap(u=>u.iterations.flatMap(c=>c[a]?[c[a]]:[]));o.length&&i.push(mj(o))}const l=n[n.length-1];return{kind:"loop",key:t.key,step:t.step,state:l.state,passes:n.map(a=>a.iterations.filter(pj).length),children:i}}function sL(e){return e.map(t=>mj([t]))}const iL=["Read(.env)","Read(**/.env)","Read(.env.local)","Read(**/.env.local)","WebFetch","WebSearch"];function lL(e,t){const n=Io[e].filter(i=>!oo(e)||!Eh.includes(i));let r=0;for(const i of t)i.agent===n[r]&&r++;return n.slice(r)}function aL(e,t){const n=o=>o.ref??o.agent,r=(o,u)=>({kind:"agent",key:u,agent:ef(o),name:Pl(o,e.agents),description:o.startsWith("custom:")?"Custom agent":Ne[o].description}),i=(o,u)=>o.kind==="agent"?r(o.agent,u):{kind:"loop",key:u,maxIterations:o.maxIterations,items:o.steps.map((c,h)=>i(hs(c),`${u}-${h}`))},l=[];let a=0;return e.pipeline.steps.forEach((o,u)=>{if(o.kind==="agent"){a<t.length?a++:l.push(i(o,`s${u}`));return}if(a<t.length){const c=new Set(Do([o]));for(;a<t.length&&c.has(n(t[a]));)a++;return}l.push(i(o,`s${u}`))}),l}const oo=e=>e==="generate"||e==="heal";function oL(e,t){if(!oo(e.type))return{linear:t,loop:[]};const n=t.findIndex(r=>Eh.includes(r.agent));return n<0?{linear:t,loop:[]}:{linear:t.slice(0,n),loop:t.slice(n)}}function Om(e,t){const n=t.filter(i=>i.agent===e.agent&&i.label===e.label),r=Yy(e);return n.length>1?`${r} #${n.indexOf(e)+1}`:r}function uL(){var tt;const e=Number(ai().id),t=ut(),[n]=vh(),r=n.get("result")?Number(n.get("result")):null,{refresh:i}=cn(),{job:l,runs:a,results:o,pipeline:u,pending:c,logs:h,error:d,refetch:f,reconnect:m}=ub(e),p=(l==null?void 0:l.status)==="waiting"?c:null,[g,w]=j.useState(null),y=j.useRef(!1),x=j.useRef(!1),[v,b]=j.useState(null);if(j.useEffect(()=>{if(y.current||a.length===0)return;const W=a.find(ge=>ge.status==="running");w((W??a[a.length-1]).id)},[a]),j.useEffect(()=>{if(x.current||!r||o.length===0)return;const W=o.find(ge=>ge.id===r);W!=null&&W.agentRunId&&(y.current=!0,x.current=!0,w(W.agentRunId))},[r,o]),j.useEffect(()=>{p&&(y.current=!0,w(p.runId))},[p==null?void 0:p.runId]),j.useEffect(()=>{l&&Wc.includes(l.status)&&i()},[l==null?void 0:l.status]),!Number.isInteger(e)||e<=0)return s.jsx(Le,{error:"Invalid job id"});const A=a.find(W=>W.id===g)??null,k=l&&l.type in Io?lL(l.type,a):[],E=l?Wc.includes(l.status):!1,T=(l==null?void 0:l.type)==="pipeline"&&u?rL(u.pipeline.steps,a):null,I=(l==null?void 0:l.type)==="pipeline"&&u&&!T?aL(u,a):[],C=(l==null?void 0:l.args.maxHealRounds)??Lb.maxHealRounds,{linear:R,loop:L}=l?oL(l,a):{linear:a,loop:[]},M=L.filter(W=>W.agent==="healer").length,U=(l==null?void 0:l.type)==="heal"?["healer","validator"]:["validator","healer"],D=L[L.length-1],q=D?E?D.agent==="validator"&&D.status==="passed"?"passed":M>=C?"out":"stopped":"running":"pending",J=W=>{y.current=!0,w(W)},B=W=>s.jsx(fL,{run:W,label:Om(W,a),selected:g===W.id,waiting:(p==null?void 0:p.runId)===W.id,onSelect:()=>J(W.id)},W.id),X=(W,ge,Q,de,ve)=>s.jsx(pL,{agent:W,finished:E,note:Q,name:de,description:ve},ge),S=W=>W.kind==="agent"?X(W.agent,W.key,void 0,W.name,W.description):s.jsxs("div",{className:"loop-group idle","aria-label":`Loop ×${W.maxIterations}`,children:[s.jsxs("div",{className:"loop-head",children:[s.jsx(as,{size:14}),s.jsxs("span",{children:["Loop ×",W.maxIterations]})]}),s.jsx("div",{className:"loop-body",children:W.items.map((ge,Q)=>s.jsxs(j.Fragment,{children:[Q>0&&s.jsx("span",{className:"connector"}),S(ge)]},ge.key))})]},W.key),ae=a.some(W=>{var ge;return W.agent==="runner"&&((ge=W.output)==null?void 0:ge.htmlReport)}),O=async W=>{if(!l)return;const ge=o.filter(ve=>(ve.status==="failed"||ve.status==="flaky")&&ve.specFile&&ve.tcId).map(ve=>({spec:ve.specFile,tcId:ve.tcId})),Q=`${l.args.name??`Test run #${l.id}`} (${W?"failed re-run":"re-run"})`;if(!l.args.selection&&!W){try{const ve=await V.createJob({type:"testrun",name:Q,...l.target!=="all"?{spec:l.target}:{},...l.args.tcId?{tcId:l.args.tcId}:{},repeatEach:l.args.repeatEach??1,...l.args.retries!==void 0?{retries:l.args.retries}:{},htmlReport:l.args.htmlReport});t(`/runs/${ve.id}`)}catch(ve){b(ve.message)}return}let de=l.args.selection??ge;if(W){const ve=new Set(ge.map(ct=>`${ct.spec}#${ct.tcId}`));de=de.filter(ct=>ve.has(`${ct.spec}#${ct.tcId}`))}de=[...new Map(de.map(ve=>[`${ve.spec}#${ve.tcId}`,ve])).values()],t("/test-runs/new",{state:{name:Q,selection:de,retries:l.args.retries}})},N=o.some(W=>W.status==="failed"||W.status==="flaky"),F=async()=>{b(null);try{await V.rerunFailedJob(e),m()}catch(W){b(W.message)}},Z=async()=>{try{const W=await V.createJob({type:"generate",spec:l.target});t(`/runs/${W.id}`)}catch(W){b(W.message)}},ce=l&&(l.type==="testrun"||l.type==="heal"||l.type==="generate")&&E?[...new Set(o.filter(W=>W.status==="failed"&&W.specFile).map(W=>W.specFile))]:[],Te=async W=>{try{const ge=await V.createJob({type:"heal",spec:W,sourceJobId:e});t(`/runs/${ge.id}`)}catch(ge){b(ge.message)}};return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Testing"},{label:"Recent runs",to:"/runs"},{label:`Job #${e}`}]}),s.jsx(Le,{error:d??v}),l&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"row between",style:{marginBottom:6},children:[s.jsxs("div",{className:"row",children:[s.jsxs("h1",{className:"page-title",children:[Sr[l.type]," ·"," ",l.type==="testrun"?l.args.name:l.type==="context"?s.jsx(ye,{to:"/project",children:"CLAUDE.md"}):l.type==="custom"||l.type==="pipeline"?[l.type==="pipeline"?l.args.pipelineName:l.args.customAgentName,l.target.endsWith(".md")?l.target:null].filter(Boolean).join(" · ")||l.target:l.target.endsWith(".md")?s.jsx(ye,{to:`/specs/${l.target}`,children:l.target}):l.target]}),s.jsx(An,{status:l.status})]}),s.jsxs("div",{className:"row",children:[ae&&s.jsxs("a",{className:"btn ghost",href:jh(e),target:"_blank",rel:"noreferrer",title:"Playwright HTML report (new tab)",children:[s.jsx(Nh,{size:14})," HTML report"]}),l.type==="testrun"&&E&&s.jsxs(s.Fragment,{children:[N&&s.jsxs("button",{className:"btn ghost",onClick:()=>void O(!0),title:"New test run with only the failed test cases",children:[s.jsx(ft,{size:14})," Re-run failed"]}),s.jsxs("button",{className:"btn ghost",onClick:()=>void O(!1),title:"New test run with the same test cases",children:[s.jsx(ft,{size:14})," Re-run"]})]}),(l.type==="pipeline"||l.type==="generate"||l.type==="heal")&&(l.status==="failed"||l.status==="cancelled"||l.status==="interrupted")&&s.jsxs("button",{className:"btn ghost",onClick:()=>void F(),title:"Run this job again from the step that stopped it: the earlier steps are not run again, their outputs are reused",children:[s.jsx(ft,{size:14})," Re-run failed"]}),l.type==="context"&&l.status==="passed"&&s.jsxs(ye,{className:"btn ghost",to:"/project",children:[s.jsx(qn,{size:15})," View CLAUDE.md"]}),l.type==="spec"&&l.status==="passed"&&s.jsxs(s.Fragment,{children:[s.jsxs(ye,{className:"btn ghost",to:`/specs/${l.target}`,children:[s.jsx(qn,{size:15})," Open spec"]}),s.jsxs("button",{className:"btn",onClick:()=>void Z(),title:"QA Explorer → QA Script Generator → QA Validator ⇄ QA Script Healer on the new spec",children:[s.jsx(Lo,{size:15})," Generate tests"]})]}),ce.map(W=>s.jsxs("button",{className:"btn",onClick:()=>void Te(W),title:"QA Script Healer fixes the scripts of failing tests, then QA Validator re-runs them",children:[s.jsx(My,{size:15})," Heal ",W]},W)),!E&&s.jsxs("button",{className:"btn danger",onClick:()=>void V.cancelJob(e).catch(W=>b(W.message)),children:[s.jsx(Oy,{size:14})," Cancel"]})]})]}),s.jsxs("div",{className:"muted small",style:{marginBottom:14},children:["Started ",Rt(l.startedAt??l.createdAt)," · ",br(l.startedAt,l.finishedAt),l.args.tcId&&` · ${l.args.tcId}`,l.args.repeatEach&&` · repeat ${l.args.repeatEach}×`,l.args.retries!==void 0&&` · retries ${l.args.retries}`,l.args.selection&&` · ${l.args.selection.length} test case${l.args.selection.length===1?"":"s"}`,l.type==="testrun"&&(l.args.htmlReport?" · line + HTML report":" · line report"),oo(l.type)&&` · max ${C} heal round${C===1?"":"s"}`,l.args.sourceJobId&&s.jsxs(s.Fragment,{children:[" ","· from ",s.jsxs(ye,{to:`/runs/${l.args.sourceJobId}`,children:["job #",l.args.sourceJobId]})]}),l.summary&&s.jsxs(s.Fragment,{children:[" · ",l.summary]})]}),l.warning&&s.jsxs("div",{className:"warn-box",children:["⚠ ",l.warning]}),(l.type==="pipeline"||l.type==="custom")&&s.jsx(yL,{job:l}),T&&u?s.jsx(ZR,{nodes:sL(T),agents:u.agents,selected:g,onSelect:J,waitingRunId:(p==null?void 0:p.runId)??null,finished:E}):s.jsxs("div",{className:"timeline",role:"tablist","aria-label":"Agents",children:[R.map((W,ge)=>s.jsxs(j.Fragment,{children:[ge>0&&s.jsx("span",{className:`connector ${R[ge-1].status==="passed"?"done":""}`}),B(W)]},W.id)),k.map((W,ge)=>s.jsxs(j.Fragment,{children:[(R.length>0||ge>0)&&s.jsx("span",{className:"connector"}),X(W,`g-${W}-${ge}`)]},`ghost-${W}-${ge}`)),I.map((W,ge)=>s.jsxs(j.Fragment,{children:[(R.length>0||ge>0)&&s.jsx("span",{className:"connector"}),S(W)]},W.key)),oo(l.type)&&s.jsxs(s.Fragment,{children:[(R.length>0||k.length>0)&&s.jsx("span",{className:`connector ${((tt=R[R.length-1])==null?void 0:tt.status)==="passed"?"done":""}`}),s.jsxs("div",{className:`ptl-loop ${q}`,"aria-label":"Validator and Healer loop",children:[s.jsxs("div",{className:"ptl-loop-head",children:[s.jsx(as,{size:13}),s.jsx("b",{children:"Validate ⇄ Heal loop"}),s.jsxs("span",{className:"muted",children:["· max ",C]}),s.jsxs("span",{className:`ptl-state ${q}`,title:"Healer rounds used / maximum (Settings)",children:["heal round ",M,"/",C]})]}),s.jsx("div",{className:"ptl-row",children:U.map((W,ge)=>{const Q=L.filter(de=>de.agent===W);return s.jsxs(j.Fragment,{children:[ge>0&&s.jsx("span",{className:"ptl-arrow","aria-hidden":"true",children:"→"}),s.jsx(fj,{node:{kind:"agent",key:`loop-${W}`,ref:W,runs:Q},label:Q[0]?Yy(Q[0]):Ne[W].label,selected:g,onSelect:J,waitingRunId:(p==null?void 0:p.runId)??null,finished:E})]},W)})}),s.jsx("div",{className:`ptl-return ${M?"":"idle"}`,title:`QA Validator fails → QA Script Healer fixes → back to QA Validator. Stops when tests pass, the QA Script Healer reports an app bug or gives up, or after ${C} heal round${C===1?"":"s"}.`,children:s.jsxs("span",{children:["↺ ×",M]})})]})]})]}),p&&s.jsx(hL,{jobId:e,label:p.label,questions:p.questions??[],onDone:()=>void f()},`review-${p.runId}`),A?s.jsx(mL,{jobId:e,job:l,run:A,label:Om(A,a),log:h[A.id]??"",results:o.filter(W=>W.agentRunId===A.id),highlightResultId:r,reviewing:(p==null?void 0:p.runId)===A.id},A.id):s.jsx("div",{className:"card pad muted",children:"Waiting for the first agent to start…"})]})]})}const _s=-1,cL=e=>Object.fromEntries(e.map(t=>[t.id,Math.max(t.options.findIndex(n=>n.recommended),t.options.length?0:_s)]));function dL({questions:e,choice:t,other:n,onChoice:r,onOther:i}){return s.jsx("ol",{className:"question-list",children:e.map(l=>s.jsx("li",{className:"question",children:s.jsxs("fieldset",{children:[s.jsx("legend",{children:l.question}),l.options.map((a,o)=>s.jsxs("label",{className:`question-option ${t[l.id]===o?"on":""}`,children:[s.jsx("input",{type:"radio",name:`q-${l.id}`,checked:t[l.id]===o,onChange:()=>r(l.id,o)}),s.jsxs("span",{children:[s.jsx("b",{children:a.label}),a.recommended&&s.jsx("span",{className:"chip ok small",children:"Recommended"}),a.description&&s.jsx("span",{className:"muted small question-desc",children:a.description})]})]},o)),s.jsxs("label",{className:`question-option ${t[l.id]===_s?"on":""}`,children:[s.jsx("input",{type:"radio",name:`q-${l.id}`,checked:t[l.id]===_s,onChange:()=>r(l.id,_s)}),s.jsxs("span",{className:"question-other",children:[s.jsx("b",{children:"Other"}),s.jsx("input",{className:"input",maxLength:Db,placeholder:"Type your answer",value:n[l.id]??"",onFocus:()=>r(l.id,_s),onChange:a=>i(l.id,a.target.value),"aria-label":`Other answer to: ${l.question}`})]})]})]})},l.id))})}function hL({jobId:e,label:t,questions:n,onDone:r}){const i=In(),[l,a]=j.useState(()=>cL(n)),[o,u]=j.useState({}),c=n.length>0,h=n.map(v=>{var b;return{id:v.id,answer:l[v.id]===_s?(o[v.id]??"").trim():((b=v.options[l[v.id]])==null?void 0:b.label)??""}}),d=h.filter(v=>!v.answer).length,[f,m]=j.useState(""),[p,g]=j.useState(!1),[w,y]=j.useState(null),x=async v=>{g(!0);try{await v(),r()}catch(b){y(b.message)}finally{g(!1)}};return s.jsxs("div",{className:"review-panel",role:"region","aria-label":"Review",children:[s.jsx("b",{children:c?`${t} has ${n.length} question${n.length>1?"s":""} for you.`:`${t} is waiting for your review.`}),s.jsx("span",{className:"muted small",children:c?`Pick an option or type your own answer. Sending runs ${t} again with your answers. Reject ends the pipeline.`:"Approve to continue the pipeline with this result. Reject ends the pipeline."}),c&&s.jsx(dL,{questions:n,choice:l,other:o,onChoice:(v,b)=>a(A=>({...A,[v]:b})),onOther:(v,b)=>u(A=>({...A,[v]:b}))}),s.jsx("textarea",{className:"input",rows:2,maxLength:Pb,placeholder:"Reason (optional, saved with a rejection)",value:f,onChange:v=>m(v.target.value),"aria-label":"Reject reason"}),s.jsx(Le,{error:w}),s.jsxs("div",{className:"row",style:{justifyContent:"flex-end"},children:[s.jsx("button",{className:"btn danger",disabled:p,onClick:async()=>{await i({title:`Reject the output of ${t}?`,message:"The pipeline ends here and the job is marked failed.",confirmLabel:"Reject",danger:!0})&&await x(()=>V.rejectJob(e,f.trim()||void 0))},children:"Reject"}),c?s.jsx("button",{className:"btn",disabled:p||d>0,title:d?'Type an answer for every "Other"':void 0,onClick:()=>void x(()=>V.answerJob(e,h)),children:"Send answers"}):s.jsx("button",{className:"btn",disabled:p,onClick:()=>void x(()=>V.approveJob(e)),children:"Approve"})]})]})}function fL({run:e,label:t,selected:n,waiting:r,onSelect:i}){const l=e.usage,a=r?"waiting":e.status,o=[`${t}: ${a}`,br(e.startedAt,e.finishedAt),e.turns!==null?`${e.turns} turns`:null,e.costUsd!==null?Kt(e.costUsd):null,l?`${sn(l.inputTokens+l.cacheReadTokens+l.cacheWriteTokens)} in / ${sn(l.outputTokens)} out`:null].filter(Boolean).join(" · ");return s.jsxs("div",{className:`ptl-node ${e.status} ${n?"selected":""} ${r?"waiting":""}`,children:[s.jsxs("button",{role:"tab","aria-selected":n,className:"ptl-main",onClick:i,title:o,children:[s.jsx(Ft,{agent:e.agent,size:22}),s.jsx("span",{className:"ptl-name",children:t}),s.jsx("span",{className:`ptl-dot ${a}`,"aria-label":a})]}),s.jsx("span",{className:"ptl-time",children:br(e.startedAt,e.finishedAt)})]})}function pL({agent:e,finished:t,note:n,name:r,description:i}){const l=r??Ne[e].label;return s.jsxs("div",{className:"ptl-node ghost","aria-disabled":"true",title:`${l}: ${t?"skipped":"not run yet"} · ${n??i??Ne[e].description}`,children:[s.jsx(Ft,{agent:e,size:22}),s.jsx("span",{className:"ptl-name",children:l}),s.jsx("span",{className:`ptl-dot ${t?"skipped":"pending"}`})]})}function mL({jobId:e,job:t,run:n,label:r,log:i,results:l,highlightResultId:a,reviewing:o}){const u=!!a&&l.some(y=>y.id===a),[c,h]=j.useState(u||o?"output":"log");j.useEffect(()=>{o&&h("output")},[o]);const[d,f]=j.useState(null),m=j.useRef(null),p=j.useRef(!0),g=!["running","pending"].includes(n.status);j.useEffect(()=>{g&&V.agentRun(e,n.id).then(f).catch(()=>{})},[e,n.id,g]),j.useEffect(()=>{const y=m.current;y&&p.current&&(y.scrollTop=y.scrollHeight)},[i,c]),kL(m,c==="log");const w=i||(d==null?void 0:d.log)||"";return s.jsxs("div",{className:"card panel",children:[s.jsxs("div",{className:"panel-head",children:[s.jsx(Ft,{agent:n.agent,size:30}),s.jsxs("div",{className:"grow",children:[s.jsxs("div",{style:{fontWeight:600},children:[r," ",s.jsx(An,{status:n.status})]}),s.jsx("div",{className:"muted small",children:Ne[n.agent].description})]}),s.jsx(un,{value:c,onChange:h,items:[{id:"log",label:"Log"},{id:"output",label:"Output"},{id:"perm",label:"Permissions"}]})]}),s.jsxs("div",{className:"panel-body",children:[c==="log"&&n.usage&&s.jsxs("div",{className:"muted small",style:{marginBottom:8},children:[n.usage.model??"model unknown"," · input ",sn(n.usage.inputTokens)," · output ",sn(n.usage.outputTokens)," · cache read"," ",sn(n.usage.cacheReadTokens)," · cache write ",sn(n.usage.cacheWriteTokens),n.costUsd!==null&&s.jsxs(s.Fragment,{children:[" · est. ",Kt(n.costUsd)]})]}),c==="log"&&s.jsx("pre",{className:"log",ref:m,onScroll:y=>{const x=y.currentTarget;p.current=x.scrollHeight-x.scrollTop-x.clientHeight<40},children:w?s.jsx(gL,{text:w}):n.status==="running"?"Waiting for output…":"(empty)"}),c==="output"&&s.jsx(vL,{jobId:t.id,run:n,full:d,results:l,highlightResultId:a}),c==="perm"&&s.jsx("div",{children:n.allowedTools?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"muted small",children:["Headless Claude Code with ",s.jsx("code",{children:"--permission-mode dontAsk"}),": any action outside the allow list is denied."]}),s.jsx("h4",{children:"Allowed"}),s.jsx("div",{className:"perm",children:n.allowedTools.map(y=>s.jsx("code",{children:y},y))}),s.jsx("h4",{children:"Explicitly denied"}),s.jsx("div",{className:"perm",children:iL.map(y=>s.jsx("code",{className:"deny",children:y},y))})]}):s.jsx("p",{className:"muted",children:"Non-LLM agent: runs Playwright Test directly (no shell) and cannot write any file other than the report."})})]})]})}function gL({text:e}){const t=j.useMemo(()=>e.split(`
398
+ `),[e]);return s.jsx(s.Fragment,{children:t.map((n,r)=>{const i=/^\s*▶/.test(n)?"l-tool":/^\s*←/.test(n)?"l-ok":/^\s*✗|^\[(error|launch error)|^\[denied\]|✘|^\s*\d+\) \S|^\s*\d+ (failed|flaky)\b/.test(n)?"l-err":/^\[claude\]|^\[done\]|^⚠|^\$ /.test(n)?"l-meta":"";return s.jsxs("span",{className:i,children:[n,`
399
+ `]},r)})})}function aa({before:e,after:t}){const n=j.useMemo(()=>Cb(e,t),[e,t]);return n.some(r=>r.type!=="same")?s.jsx("pre",{className:"diff",children:n.map((r,i)=>s.jsxs("div",{className:r.type==="same"?"":r.type,children:[r.type==="add"?"+ ":r.type==="del"?"- ":" ",r.text]},i))}):s.jsx("p",{className:"muted",children:"Test file unchanged."})}function xL({results:e,highlightId:t}){const n=Zh(e),r=j.useRef(null),i=j.useRef(!1);return j.useEffect(()=>{if(!t)return;const l=e.findIndex(o=>o.id===t);if(l<0)return;const a=Math.floor(l/n.props.pageSize)+1;a!==n.props.page&&n.props.onPage(a)},[t,e,n.props.pageSize]),j.useEffect(()=>{t&&r.current&&!i.current&&(r.current.scrollIntoView({behavior:"smooth",block:"center"}),i.current=!0)},[t,n.pageItems]),s.jsxs("div",{className:"table-wrap",children:[s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"TC"}),s.jsx("th",{children:"Test"}),s.jsx("th",{children:"Status"}),s.jsx("th",{className:"num",children:"ms"}),s.jsx("th",{children:"Error"})]})}),s.jsx("tbody",{children:n.pageItems.map(l=>s.jsxs("tr",{ref:l.id===t?r:void 0,className:l.id===t?"row-highlight":void 0,children:[s.jsx("td",{children:l.tcId?s.jsx("code",{children:l.tcId}):"—"}),s.jsxs("td",{children:[l.title,s.jsx("div",{className:"muted small",children:l.testFile})]}),s.jsx("td",{children:s.jsx(yt,{status:l.status})}),s.jsx("td",{className:"num",children:l.durationMs}),s.jsxs("td",{style:{maxWidth:440},children:[l.error&&s.jsx("pre",{className:"mono",style:{margin:0,whiteSpace:"pre-wrap",color:"var(--fail)",maxHeight:140,overflow:"auto"},children:l.error}),l.attachments.filter(a=>a.name==="trace"&&a.path).map(a=>s.jsxs("div",{className:"muted small",children:["Trace: ",s.jsxs("code",{children:['npx playwright show-trace "',a.path,'"']})]},a.path))]})]},l.id))})]}),s.jsx(ms,{...n.props,label:"results"})]})}function Fm({jobId:e}){const[t,n]=j.useState(null);return j.useEffect(()=>{V.jobRequirement(e).then(r=>n(r.requirement)).catch(()=>n(null))},[e]),t?s.jsxs("details",{style:{marginTop:12},children:[s.jsxs("summary",{children:["BA requirement (",t.length.toLocaleString()," characters)"]}),s.jsx("pre",{className:"mono",style:{whiteSpace:"pre-wrap",maxHeight:320,overflow:"auto",marginTop:8},children:t})]}):null}function yL({job:e}){const t=e.target.endsWith(".md")?e.target:null,[n,r]=j.useState(void 0),[i,l]=j.useState(void 0);j.useEffect(()=>{V.jobInput(e.id).then(o=>{var u;return r(((u=o.input)==null?void 0:u.trim())||null)}).catch(()=>r(null))},[e.id]);const a=()=>{t&&i===void 0&&V.spec(t).then(o=>l(o.content)).catch(()=>l(null))};return n===void 0||!t&&!n?null:s.jsxs("div",{className:"card job-input",children:[t&&s.jsxs("details",{onToggle:o=>o.currentTarget.open&&a(),children:[s.jsxs("summary",{children:[s.jsx(qn,{size:14})," ",s.jsx("b",{children:"Spec"})," ",s.jsx(ye,{to:`/specs/${t}`,onClick:o=>o.stopPropagation(),children:t})]}),s.jsxs("div",{className:"job-input-body",children:[s.jsx("p",{className:"muted small",children:"Current version of the file: it may have changed since this job started."}),i===void 0?s.jsx("p",{className:"muted",children:"Loading spec…"}):i===null?s.jsx("p",{className:"muted",children:"Spec not found (renamed or deleted)."}):s.jsx("div",{className:"md",children:s.jsx(zr,{remarkPlugins:Jh,components:Xh,children:i.replace(/<!--[\s\S]*?-->/g,"")})})]})]}),n&&s.jsxs("details",{open:!t,children:[s.jsxs("summary",{children:[s.jsx(Lo,{size:14})," ",s.jsx("b",{children:"Prompt"})," ",s.jsxs("span",{className:"muted small",children:["(",n.length.toLocaleString()," characters)"]})]}),s.jsx("div",{className:"job-input-body",children:s.jsx("pre",{className:"mono job-input-prompt",children:n})})]})]})}function vL({jobId:e,run:t,full:n,results:r,highlightResultId:i}){var a,o,u,c,h,d,f,m;if(t.status==="running"||t.status==="pending")return s.jsx("p",{className:"muted",children:"Agent is running; output will be available when it finishes."});if(t.agent==="custom"&&t.output){const p=t.output;return s.jsxs("div",{children:[s.jsxs("p",{className:"row",children:[s.jsx(yt,{status:p.status==="passed"?"passed":"failed"})," ",p.summary]}),s.jsx("div",{className:"md",children:s.jsx(zr,{remarkPlugins:Jh,components:Xh,children:p.details})}),!!((a=p.questions)!=null&&a.length)&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{children:"Questions asked"}),s.jsx("ol",{children:p.questions.map(g=>s.jsxs("li",{children:[g.question,s.jsx("ul",{children:g.options.map((w,y)=>s.jsxs("li",{children:[w.label,w.recommended?" (recommended)":"",w.description?s.jsxs("span",{className:"muted",children:[" · ",w.description]}):null]},y))})]},g.id))})]}),!!((o=p.answered)!=null&&o.length)&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{children:"Your answers"}),s.jsx("ol",{children:p.answered.map(g=>s.jsxs("li",{children:[g.question,s.jsx("br",{}),"→ ",s.jsx("b",{children:g.answer})]},g.id))})]})]})}if(t.agent==="validator"||t.agent==="runner"){const p=t.output;return s.jsxs("div",{children:[p&&s.jsxs("p",{className:"row",children:[s.jsx(yt,{status:p.passed?"passed":"failed"}),Object.entries(p.counts).map(([g,w])=>s.jsxs("span",{className:"row",style:{gap:4},children:[s.jsx(yt,{status:g,children:w})," ",g]},g)),s.jsx("code",{className:"muted",children:p.command}),p.htmlReport&&s.jsxs("a",{href:jh(t.jobId),target:"_blank",rel:"noreferrer",children:[s.jsx(Nh,{size:13})," Open HTML report"]})]}),!p&&s.jsx("p",{className:"muted",children:"No report."}),r.length>0&&s.jsx(xL,{results:r,highlightId:i})]})}if(!t.output)return s.jsxs("div",{children:[s.jsx("p",{className:"muted",children:"The agent did not write a result file. See the Log tab for details."}),t.agent==="specwriter"&&s.jsx(Fm,{jobId:e})]});if(t.agent==="contextwriter"){const p=t.output,g=(w,y)=>y!=null&&y.length?s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:w}),s.jsx("dd",{children:s.jsx("ul",{style:{margin:0,paddingLeft:18},children:y.map((x,v)=>s.jsx("li",{children:x},v))})})]}):null;return s.jsxs("div",{children:[s.jsx("p",{children:p.summary}),s.jsxs("dl",{className:"kv",style:{marginBottom:12},children:[g("Added / updated",p.added),g("Removed (old project)",p.removed),g("Notes added",p.notes),g("Security issues (notes not applied)",Array.isArray(p.security)?p.security.map(w=>typeof w=="string"?w:`"${w.note}" (${w.reason})`):void 0),g("Check these",p.warnings),p.failure?s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:"Failed because"}),s.jsx("dd",{children:p.failure})]}):null]}),n?s.jsx(aa,{before:n.fileBefore,after:n.fileAfter}):s.jsx("p",{className:"muted",children:"Loading diff…"})]})}if(t.agent==="specwriter"){const p=t.output,g=(w,y)=>y!=null&&y.length?s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:w}),s.jsx("dd",{children:s.jsx("ul",{style:{margin:0,paddingLeft:18},children:y.map((x,v)=>s.jsx("li",{children:x},v))})})]}):null;return s.jsxs("div",{children:[s.jsx("p",{children:p.summary}),s.jsxs("dl",{className:"kv",style:{marginBottom:12},children:[s.jsx("dt",{children:"Spec"}),s.jsx("dd",{children:s.jsx(ye,{to:`/specs/${p.specFile}`,children:s.jsxs("code",{children:["specs/",p.specFile]})})}),s.jsx("dt",{children:"Test cases"}),s.jsx("dd",{children:(u=p.tcIds)==null?void 0:u.map(w=>s.jsx("code",{style:{marginRight:6},children:w},w))}),g("Assumptions",p.assumptions),g("Questions for the BA",p.questions)]}),n?s.jsx(aa,{before:n.fileBefore,after:n.fileAfter}):s.jsx("p",{className:"muted",children:"Loading spec…"}),s.jsx(Fm,{jobId:e})]})}if(t.agent==="explorer"){const p=t.output;return s.jsxs("div",{children:[s.jsxs("p",{className:"row",children:[s.jsx(yt,{status:p.status})," ",p.summary]}),((c=p.environment)==null?void 0:c.ready)===!1&&s.jsxs("div",{className:"warn-box",style:{marginBottom:12},children:[s.jsx("b",{children:"Environment/setup not ready, pipeline stopped:"}),s.jsx("ul",{style:{margin:"6px 0 0"},children:((h=p.environment.issues)!=null&&h.length?p.environment.issues:["no details"]).map((g,w)=>s.jsx("li",{children:g},w))})]}),((d=p.environment)==null?void 0:d.ready)!==!1&&p.cases.some(g=>g.status==="failed")&&s.jsxs("p",{className:"muted small",children:["Failed cases: ",p.cases.filter(g=>g.status==="failed").map(g=>g.id).join(", ")," (possible app bugs). A Generate job does not stop here: it still writes their tests, asserting the expected result."]}),s.jsx("div",{className:"table-wrap",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Case"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Evidence"})]})}),s.jsx("tbody",{children:p.cases.map(g=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("code",{children:g.id})}),s.jsx("td",{children:s.jsx(yt,{status:g.status})}),s.jsx("td",{className:"small",style:{whiteSpace:"pre-wrap"},children:g.evidence})]},g.id))})]})}),p.assertions.length>0&&s.jsxs("details",{style:{marginTop:12},children:[s.jsxs("summary",{children:["Verified assertions (",p.assertions.length,")"]}),s.jsx("div",{className:"table-wrap",style:{marginTop:8},children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Case"}),s.jsx("th",{children:"Expression"}),s.jsx("th",{children:"Expected"}),s.jsx("th",{children:"Observed"})]})}),s.jsx("tbody",{children:p.assertions.map((g,w)=>s.jsxs("tr",{children:[s.jsx("td",{children:g.case}),s.jsx("td",{children:s.jsx("code",{style:{whiteSpace:"pre-wrap"},children:g.expression})}),s.jsx("td",{className:"small",children:g.expected}),s.jsx("td",{className:"small",children:g.observed})]},w))})]})})]}),p.bugs.length>0&&s.jsxs("div",{className:"warn-box",children:[s.jsx("b",{children:"Potential bugs:"}),s.jsx("ul",{style:{margin:"6px 0 0"},children:p.bugs.map((g,w)=>s.jsx("li",{children:g},w))})]})]})}if(t.agent==="generator"){const p=t.output;return s.jsxs("div",{children:[s.jsxs("dl",{className:"kv",style:{marginBottom:12},children:[s.jsx("dt",{children:"File test"}),s.jsx("dd",{children:s.jsx("code",{children:p.testFile})}),s.jsx("dt",{children:"Test case"}),s.jsx("dd",{children:(f=p.tcIds)==null?void 0:f.map(g=>s.jsx("code",{style:{marginRight:6},children:g},g))}),p.pomChanges&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:"Page Object"}),s.jsx("dd",{children:p.pomChanges})]}),p.notes&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:"Notes"}),s.jsx("dd",{children:p.notes})]})]}),n?s.jsx(aa,{before:n.fileBefore,after:n.fileAfter}):s.jsx("p",{className:"muted",children:"Loading diff…"})]})}const l=t.output;return s.jsxs("div",{children:[s.jsxs("p",{className:"row",children:[s.jsx(yt,{status:l.outcome})," ",l.diagnosis]}),((m=l.changes)==null?void 0:m.length)>0&&s.jsx("ul",{children:l.changes.map((p,g)=>s.jsx("li",{children:p},g))}),n?s.jsx(aa,{before:n.fileBefore,after:n.fileAfter}):s.jsx("p",{className:"muted",children:"Loading diff…"})]})}const jL=32,wL=240;function kL(e,t){j.useEffect(()=>{const n=e.current;if(!t||!n)return;const r=n.closest(".content"),i=r&&getComputedStyle(r).overflowY!=="visible"?r:null,l=()=>{const u=n.getBoundingClientRect(),c=i?i.clientHeight-(u.top-i.getBoundingClientRect().top+i.scrollTop):window.innerHeight-(u.top+window.scrollY);n.style.maxHeight=`${Math.max(wL,Math.floor(c-jL))}px`};l(),window.addEventListener("resize",l);const a=typeof ResizeObserver>"u"?null:new ResizeObserver(l),o=(i??document.body).firstElementChild;return a&&o&&a.observe(o),()=>{window.removeEventListener("resize",l),a==null||a.disconnect(),n.style.maxHeight=""}},[e,t])}const bL=["all","mapped","missing","stale","orphan"],Fu=e=>e.charAt(0).toUpperCase()+e.slice(1);function SL(){const e=ut(),{specs:t,refresh:n}=cn(),[r,i]=j.useState("all"),[l,a]=j.useState(""),[o,u]=j.useState(null),c=Tl([r,l]),{data:h,error:d,reload:f}=$e(()=>V.mappingPage({page:c.page,pageSize:c.pageSize,status:r==="all"?void 0:r,spec:l||void 0}),[c.page,c.pageSize,r,l]),m=(h==null?void 0:h.items)??[],p=async g=>{try{const w=await V.createJob(g);e(`/runs/${w.id}`)}catch(w){u(w.message)}};return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Testing"},{label:"Test cases"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Test cases"}),s.jsx("p",{className:"page-sub",children:"Test case ↔ Playwright test traceability."})]})}),s.jsxs("div",{className:"toolbar",children:[s.jsx(un,{value:r,onChange:i,items:bL.map(g=>({id:g,label:s.jsxs(s.Fragment,{children:[g==="all"?"All":Fu(g)," ",s.jsx("span",{className:"tab-count",children:(h==null?void 0:h.counts[g])??0})]})}))}),s.jsx("div",{className:"grow"}),s.jsxs("select",{className:"select",value:l,onChange:g=>a(g.target.value),"aria-label":"Filter by spec",children:[s.jsx("option",{value:"",children:"All specs"}),t.map(g=>s.jsx("option",{value:g.file,children:g.file},g.file))]}),s.jsxs("button",{className:"btn ghost",onClick:()=>{n(),f()},children:[s.jsx(Jn,{size:14})," Refresh"]})]}),s.jsx(Le,{error:d??o}),s.jsxs("div",{className:"table-wrap table-fit",children:[s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Spec"}),s.jsx("th",{children:"TC"}),s.jsx("th",{children:"TC name"}),s.jsx("th",{children:"Test file"}),s.jsx("th",{children:"Mapping"}),s.jsx("th",{children:"Last result"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:m.map((g,w)=>s.jsxs("tr",{children:[s.jsx("td",{children:g.specFile?s.jsx(ye,{to:`/specs/${g.specFile}`,className:"mono",children:g.specFile}):s.jsx("span",{className:"muted",children:"—"})}),s.jsx("td",{children:g.tcId?s.jsx("code",{children:g.tcId}):"—"}),s.jsx("td",{children:g.tcTitle??g.testTitle??"—"}),s.jsx("td",{children:g.testFile?s.jsxs("code",{children:[g.testFile,":",g.testLine]}):s.jsx("span",{className:"muted",children:"—"})}),s.jsx("td",{children:s.jsx(yt,{status:g.status,children:Fu(g.status)})}),s.jsx("td",{children:g.lastResult?s.jsx(ye,{to:`/runs/${g.lastResult.jobId}`,title:Rt(g.lastResult.at),children:s.jsx(yt,{status:g.lastResult.status,children:Fu(g.lastResult.status)})}):s.jsx(yt,{status:null})}),s.jsx("td",{style:{textAlign:"right"},children:g.testFile&&g.tcId&&g.specFile&&g.status!=="orphan"&&s.jsxs("button",{className:"btn ghost sm",onClick:()=>void p({type:"testrun",spec:g.specFile,tcId:g.tcId}),children:[s.jsx(ft,{size:12})," Run"]})})]},`${g.specFile??"__none"}-${g.tcId}-${g.testLine}-${w}`))})]}),h&&m.length===0&&s.jsx("p",{className:"muted pad",children:"No rows match the filter."}),h&&s.jsx(ms,{page:c.page,pageSize:c.pageSize,total:h.total,onPage:c.setPage,onPageSize:c.setPageSize,label:"test cases"})]})]})}const oa=(e,t)=>t?Math.round(e/t*100):0;function NL(){const e=ut(),{openNewSpec:t}=fs(),{specs:n,refresh:r}=cn(),i=$e(()=>V.dashboard()),l=$e(()=>V.jobs()),[a,o]=j.useState(null),u=i.data,c=n.reduce((p,g)=>p+g.parsed.tcs.length,0),h=l.data??[],d=h[0],f=(u==null?void 0:u.failing)??[],m=()=>void V.createJob({type:"testrun",repeatEach:1}).then(p=>{r(),e(`/runs/${p.id}`)}).catch(p=>o(p.message));return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Overview"}]}),s.jsx(Le,{error:i.error??l.error??a}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Overview"}),s.jsx("p",{className:"page-sub",children:"Test coverage and run health across all specs."})]}),s.jsxs("div",{className:"row",children:[s.jsxs("button",{className:"btn ghost",onClick:()=>t(),children:[s.jsx(qt,{size:15})," New spec"]}),s.jsxs("button",{className:"btn",onClick:m,children:[s.jsx(ft,{size:13})," Run all specs"]})]})]}),s.jsxs("div",{className:"stats",children:[s.jsxs("div",{className:"stat",children:[s.jsxs("div",{className:"stat-head",children:[s.jsx("span",{children:"Coverage"}),s.jsx("span",{className:"stat-icon",children:s.jsx(wh,{size:16})})]}),s.jsxs("div",{className:"stat-value",children:[oa((u==null?void 0:u.coverage.mapped)??0,(u==null?void 0:u.coverage.total)??0),"%",s.jsxs("small",{children:[(u==null?void 0:u.coverage.mapped)??0," / ",(u==null?void 0:u.coverage.total)??0," TC"]})]}),s.jsx("div",{className:"progress",children:s.jsx("i",{style:{width:`${oa((u==null?void 0:u.coverage.mapped)??0,(u==null?void 0:u.coverage.total)??0)}%`}})})]}),s.jsxs("div",{className:"stat",children:[s.jsxs("div",{className:"stat-head",children:[s.jsx("span",{children:"Pass rate"}),s.jsx("span",{className:"stat-icon ok",children:s.jsx(bh,{size:16})})]}),s.jsxs("div",{className:"stat-value",children:[oa((u==null?void 0:u.passRate.passed)??0,(u==null?void 0:u.passRate.total)??0),"%",s.jsxs("small",{children:[(u==null?void 0:u.passRate.passed)??0," / ",(u==null?void 0:u.passRate.total)??0," TC"]})]}),s.jsx("div",{className:"progress ok",children:s.jsx("i",{style:{width:`${oa((u==null?void 0:u.passRate.passed)??0,(u==null?void 0:u.passRate.total)??0)}%`}})})]}),s.jsxs("div",{className:"stat",children:[s.jsxs("div",{className:"stat-head",children:[s.jsx("span",{children:"Specs"}),s.jsx("span",{className:"stat-icon info",children:s.jsx(qn,{size:16})})]}),s.jsxs("div",{className:"stat-value",children:[n.length,s.jsxs("small",{children:[c," test cases"]})]}),s.jsx(ye,{to:"/specs",className:"stat-link",children:"Manage specs →"})]}),s.jsxs("div",{className:"stat",children:[s.jsxs("div",{className:"stat-head",children:[s.jsx("span",{children:"Recent runs"}),s.jsx("span",{className:"stat-icon warn",children:s.jsx(ft,{size:14})})]}),s.jsxs("div",{className:"stat-value",children:[h.length,s.jsx("small",{children:"runs"})]}),s.jsxs("div",{className:"muted small",children:["Last run: ",Rt((d==null?void 0:d.finishedAt)??(d==null?void 0:d.startedAt)??(d==null?void 0:d.createdAt))]})]})]}),s.jsxs("div",{className:"overview-grid",children:[s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Recent runs"}),s.jsx(ye,{to:"/runs",className:"card-link",children:"View all"})]}),s.jsxs("table",{className:"flat",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Run"}),s.jsx("th",{children:"Spec"}),s.jsx("th",{children:"Result"}),s.jsx("th",{className:"num",children:"Duration"})]})}),s.jsx("tbody",{children:h.slice(0,5).map(p=>s.jsxs("tr",{onClick:()=>e(`/runs/${p.id}`),style:{cursor:"pointer"},children:[s.jsxs("td",{className:"mono",children:["#",p.id]}),s.jsxs("td",{children:[p.target,p.args.tcId?s.jsxs("span",{className:"muted small",children:[" · ",p.args.tcId]}):null]}),s.jsx("td",{children:s.jsx(ri,{status:p.status,title:p.summary??void 0,children:p.summary&&p.summary.length<=24?p.summary:p.status})}),s.jsx("td",{className:"num muted",children:br(p.startedAt,p.finishedAt)})]},p.id))})]}),l.data&&h.length===0&&s.jsx("p",{className:"muted pad",children:"No runs yet."})]}),s.jsxs("div",{className:"card pad",children:[s.jsx("h3",{className:"card-title",children:"Pipeline agents"}),s.jsxs("p",{className:"muted small",style:{margin:"2px 0 14px"},children:["Runs with ",s.jsx("span",{className:"accent-text",children:"Claude Code"})," — no API key needed."]}),s.jsx("ol",{className:"agent-steps",children:["explorer","generator","validator","healer"].map((p,g)=>s.jsxs("li",{title:Ne[p].description,children:[s.jsx("span",{className:"step-num",children:g+1}),Ne[p].label,p==="healer"&&s.jsx("span",{className:"muted small accent-soft-text",children:"≤ 2 loops"})]},p))})]})]}),f.length>0&&s.jsxs("div",{className:"card",style:{marginTop:18},children:[s.jsx("div",{className:"card-head",children:s.jsxs("h3",{children:["Failing tests (",f.length,")"]})}),s.jsx("table",{className:"flat",children:s.jsx("tbody",{children:f.map(p=>s.jsxs("tr",{onClick:()=>e(`/runs/${p.jobId}${p.id?`?result=${p.id}`:""}`),style:{cursor:"pointer"},title:"Open this failed test in Recent runs",children:[s.jsxs("td",{children:[s.jsx("div",{children:p.title}),s.jsx("div",{className:"mono small",style:{color:"var(--fail)"},children:(p.error??"").split(`
400
+ `)[0].slice(0,160)})]}),s.jsx("td",{className:"num",children:s.jsxs(ye,{to:`/runs/${p.jobId}${p.id?`?result=${p.id}`:""}`,onClick:g=>g.stopPropagation(),children:["#",p.jobId]})})]},`${p.jobId}-${p.title}`))})})]}),s.jsxs("div",{className:"card",style:{marginTop:18},children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Specs at a glance"}),s.jsx(ye,{to:"/specs",className:"card-link",children:"Open Specs page"})]}),s.jsxs("div",{className:"glance",children:[((u==null?void 0:u.specs)??[]).map(p=>s.jsxs(ye,{to:`/specs/${p.file}`,className:"glance-row",children:[s.jsx("span",{className:"file-icon muted-icon",children:s.jsx(qn,{size:16})}),s.jsxs("div",{className:"grow",children:[s.jsx("div",{className:"mono strong",children:p.file}),s.jsx("div",{className:"muted small",children:p.title||"—"})]}),s.jsxs("span",{className:"muted small",children:[p.tcCount," test cases"]}),s.jsxs("span",{className:`chip ${p.mappedCount<p.tcCount?"warn":""}`,children:[p.mappedCount,"/",p.tcCount," mapped"]})]},p.file)),u&&u.specs.length===0&&s.jsx("p",{className:"muted pad",children:"No specs yet."})]})]})]})}function Um({value:e,mode:t}){const[n,r]=j.useState({...e}),i=(a,o)=>{e[a]=o,r({...e})},l=t==="export"?[{key:"jobs",title:"Jobs",hint:"Agent logs, test results, Claude usage and HTML reports. Can make the zip large."},{key:"chats",title:"Chat history",hint:"Chat messages and uploaded files."}]:[{key:"jobs",title:"Jobs",hint:"Replaces the current job history with the one in the zip."},{key:"chats",title:"Chat history",hint:"Adds the chats in the zip; a chat with the same id is replaced."}];return s.jsxs("fieldset",{className:"transfer-options",children:[s.jsx("legend",{children:t==="export"?"Also include":"Also import (if the zip has it)"}),l.map(a=>s.jsxs("label",{className:`transfer-option${n[a.key]?" on":""}`,children:[s.jsx("input",{type:"checkbox",className:"check-box",checked:n[a.key],onChange:o=>i(a.key,o.target.checked)}),s.jsxs("span",{className:"transfer-option-text",children:[s.jsx("span",{className:"transfer-option-title",children:a.title}),s.jsx("span",{className:"transfer-option-hint",children:a.hint})]})]},a.key))]})}function CL({onImported:e}){const t=Ir(),n=In(),r=Jb(),i=j.useRef(null),[l,a]=j.useState(!1),o=async h=>{a(!0);try{await r(h())}catch(d){t.error(d.message)}finally{a(!1)}},u=async()=>{const h={jobs:!1,chats:!1};await n({title:"Export project",message:s.jsxs(s.Fragment,{children:["Specs, tests, Playwright config, CLAUDE.md, Claude skills, settings, agents and pipelines are exported as a zip. Saved browser logins are never included.",s.jsx(Um,{value:h,mode:"export"})]}),confirmLabel:"Export"})&&await o(async()=>{const f=URL.createObjectURL(await V.exportProject(h)),m=document.createElement("a");m.href=f,m.download=`agent-studio-export-${new Date().toISOString().slice(0,10)}.zip`,m.click(),URL.revokeObjectURL(f);const p=[h.jobs&&"jobs",h.chats&&"chats"].filter(Boolean).join(" and ");t.success(p?`Project exported with ${p}`:"Project exported")})},c=async h=>{const d={jobs:!1,chats:!1};await n({title:`Import ${h.name}?`,message:s.jsxs(s.Fragment,{children:["Specs, tests, Playwright config, CLAUDE.md and Claude skills in the zip overwrite the files with the same name. Settings, all agents (built-in instructions and custom agents) and pipelines are replaced. Jobs and chats are kept unless ticked below.",s.jsx(Um,{value:d,mode:"import"})]}),confirmLabel:"Import",danger:!0})&&await o(async()=>{const m=await new Promise((y,x)=>{const v=new FileReader;v.onload=()=>y(String(v.result)),v.onerror=()=>x(v.error),v.readAsDataURL(h)}),p=await V.importProject(m.slice(m.indexOf(",")+1),d);ab(),e==null||e();const g=[`${p.files} files`,`${p.agents} custom agents`,`${p.pipelines} custom pipelines`,`${p.instructions} built-in agent instructions`];p.jobs!==null&&g.push(`${p.jobs} jobs`),p.chats!==null&&g.push(`${p.chats} chats`);const w=[d.jobs&&p.jobs===null&&"jobs",d.chats&&p.chats===null&&"chats"].filter(Boolean).join(" or ");t.success(`Imported ${g.slice(0,-1).join(", ")} and ${g[g.length-1]}${w?` (the zip has no ${w})`:""}`)})};return s.jsxs("span",{className:"row",children:[s.jsxs("button",{type:"button",className:"btn",onClick:()=>{var h;return(h=i.current)==null?void 0:h.click()},disabled:l,title:"Import a project zip exported from Agent Studio",children:[s.jsx(Ao,{size:15})," Import"]}),s.jsxs("button",{type:"button",className:"btn",onClick:()=>void u(),disabled:l,title:"Export specs, tests, Playwright config, CLAUDE.md, Claude skills, settings, agents and pipelines (optionally jobs and chats) as a zip",children:[s.jsx(ds,{size:15})," Export"]}),s.jsx("input",{ref:i,type:"file",accept:".zip",hidden:!0,onChange:h=>{var f;const d=(f=h.target.files)==null?void 0:f[0];h.target.value="",d&&c(d)}})]})}async function gj(){const e=await V.claudeMd();if(e.content===null)return;const t=URL.createObjectURL(new Blob([e.content],{type:"text/markdown"})),n=document.createElement("a");n.href=t,n.download=`CLAUDE-${new Date().toISOString().slice(0,10)}.md`,n.click(),setTimeout(()=>URL.revokeObjectURL(t),1e3)}function EL(){var v,b,A,k;const e=ut(),t=In(),n=Ir(),r=$e(()=>V.claudeMd()),i=$e(()=>V.jobsPage({page:1,pageSize:1,type:"context"})),[l,a]=j.useState(""),[o,u]=j.useState("rendered"),[c,h]=j.useState(!1),[d,f]=j.useState(null),m=(v=i.data)==null?void 0:v.items[0],p=j.useRef(null),[g,w]=j.useState(null),y=async E=>{if(!E)return;if(!/\.md$/i.test(E.name))return f("Choose a Markdown (.md) file.");const T=await E.text();if(!await t({title:"Replace CLAUDE.md?",message:`CLAUDE.md is replaced with ${E.name}. The current file is backed up first.`,confirmLabel:"Replace",danger:!0})){p.current&&(p.current.value="");return}try{const C=await V.uploadClaudeMd(T);n.success("CLAUDE.md replaced"),w(`CLAUDE.md replaced with ${E.name}.${C.backup?` Previous version backed up to ${C.backup}.`:""}`),f(null),r.reload()}catch(C){f(C.message)}finally{p.current&&(p.current.value="")}},x=async E=>{E.preventDefault(),h(!0);try{const T=await V.createJob({type:"context",...l.trim()?{notes:l.trim()}:{}});e(`/runs/${T.id}`)}catch(T){f(T.message),h(!1)}};return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Project"}]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Project"}),s.jsx("p",{className:"page-sub",children:"Project context (CLAUDE.md), import / export and reset."})]}),s.jsxs("span",{className:"row",children:[s.jsx(CL,{onImported:r.reload}),s.jsxs(ye,{className:"btn danger",to:"/project/reset",title:"Remove this project's specs, tests, results and context; you choose what and see the list first",children:[s.jsx(Ar,{size:14})," Reset"]})]})]}),s.jsxs("div",{className:"overview-grid project-grid",children:[s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head row between",children:[s.jsxs("h3",{children:["CLAUDE.md"," ",((b=r.data)==null?void 0:b.mtimeMs)&&s.jsxs("span",{className:"muted small",style:{fontWeight:400},children:["· modified ",Rt(new Date(r.data.mtimeMs).toISOString())]})]}),s.jsxs("span",{className:"row",children:[s.jsx("button",{className:"btn ghost sm",onClick:()=>void gj(),disabled:!((A=r.data)!=null&&A.content),children:"Download"}),s.jsxs("button",{className:"btn ghost sm",onClick:()=>{var E;return(E=p.current)==null?void 0:E.click()},title:"Replace CLAUDE.md with a file, e.g. this project's saved context",children:[s.jsx(Ao,{size:13})," Upload"]}),s.jsx("input",{ref:p,type:"file",accept:".md,text/markdown",hidden:!0,onChange:E=>{var T;return void y((T=E.target.files)==null?void 0:T[0])}}),s.jsx(un,{value:o,onChange:u,items:[{id:"rendered",label:"Preview"},{id:"source",label:"Source"}]})]})]}),g&&s.jsx("div",{className:"ok-box",style:{margin:12},children:g}),s.jsx(Le,{error:r.error}),r.data&&r.data.content===null&&s.jsx("p",{className:"muted pad",children:"There is no CLAUDE.md at the repo root yet. The Context Writer will create one."}),((k=r.data)==null?void 0:k.content)&&(o==="rendered"?s.jsx("div",{className:"pad md claude-md",children:s.jsx(zr,{children:r.data.content.replace(/<!--[\s\S]*?-->/g,"")})}):s.jsx("pre",{className:"mono pad claude-md",style:{margin:0,whiteSpace:"pre-wrap"},children:r.data.content}))]}),s.jsxs("form",{className:"card pad req-form project-writer",onSubmit:x,children:[s.jsxs("div",{className:"row",children:[s.jsx(Ft,{agent:"contextwriter",size:36}),s.jsxs("div",{children:[s.jsx("b",{children:"Context Writer"}),s.jsx("div",{className:"muted small",children:"LLM agent (Claude Code), may only edit CLAUDE.md"})]})]}),s.jsxs("label",{children:["Notes about this project (optional)",s.jsx("textarea",{className:"input",style:{minHeight:120},value:l,onChange:E=>a(E.target.value),placeholder:"e.g. <App name>: customer portal. Roles: admin, customer. Login with email + password. Test ids use data-testid."})]}),s.jsx(Le,{error:d}),s.jsxs("div",{className:"row between",children:[s.jsx("span",{className:"muted small",children:m?s.jsxs(s.Fragment,{children:["Last update: ",s.jsxs(ye,{to:`/runs/${m.id}`,children:["job #",m.id]})," ",s.jsx(An,{status:m.status})," ",Rt(m.finishedAt??m.createdAt)]}):"Never updated by Agent Studio"}),s.jsxs("button",{type:"submit",className:"btn",disabled:c,children:[s.jsx(Sh,{size:15})," ",c?"Starting…":"Update CLAUDE.md"]})]})]})]})]})}const Bm=e=>e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(1)} MB`;function TL({mentions:e,title:t}){const n=j.useMemo(()=>{const r=new Map;for(const i of e)r.set(i.file,[...r.get(i.file)??[],i]);return[...r.entries()]},[e]);return e.length?s.jsxs("details",{className:"rt-mentions",children:[s.jsxs("summary",{children:[t,": ",e.length," line",e.length===1?"":"s"," in ",n.length," file",n.length===1?"":"s"]}),s.jsx("p",{className:"muted small",children:"These files are not changed by the reset (source code, docs). Review and edit them by hand."}),n.map(([r,i])=>s.jsxs("div",{className:"rt-file",children:[s.jsx("code",{children:r}),i.map(l=>s.jsxs("div",{className:"rt-line",children:[s.jsx("span",{className:"muted",children:l.line})," ",l.text]},`${l.line}-${l.text}`))]},r))]}):s.jsx("p",{className:"muted small",children:"No other file mentions the project."})}function PL(){const{refresh:e}=cn(),[t,n]=j.useState(null),[r,i]=j.useState(new Set),[l,a]=j.useState(""),[o,u]=j.useState(!0),[c,h]=j.useState(!1),[d,f]=j.useState(null),[m,p]=j.useState(null),g=async()=>{try{const E=await V.resetPlan();n(E),i(T=>T.size?T:new Set(E.categories.filter(I=>I.defaultOn).map(I=>I.id))),f(null)}catch(E){f(E.message)}};j.useEffect(()=>{g()},[]);const w=E=>i(T=>{const I=new Set(T);return I.has(E)?I.delete(E):I.add(E),I}),y=async()=>{if(t){h(!0);try{const E=await V.resetProject({categories:[...r],confirm:l,backup:o});p(E),a(""),e(),await g()}catch(E){f(E.message)}finally{h(!1)}}},x=E=>i(new Set(E&&t?t.categories.map(T=>T.id):[])),v=(t==null?void 0:t.categories.filter(E=>r.has(E.id)))??[],b=v.reduce((E,T)=>E+(T.id==="prompts"?0:T.fileCount),0),A=v.reduce((E,T)=>E+(T.bytes??0),0),k=t&&l===t.confirmWord&&r.size>0&&!t.busy&&!c;return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Project",to:"/project"},{label:"Reset project template"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Reset project template"}),s.jsxs("p",{className:"page-sub",children:["Strip everything that belongs to the current project so this repository can be cloned and reused for another one. With ",s.jsx("b",{children:"Backup data"})," on, specs, tests, CLAUDE.md and chat history are backed up first; results and logs are always deleted for good."]})]})}),m&&s.jsxs("div",{className:"ok-box",children:[s.jsx("b",{children:"Project reset."})," ",Object.entries(m.removed).map(([E,T])=>{var I;return`${((I=t==null?void 0:t.categories.find(C=>C.id===E))==null?void 0:I.label)??E}: ${T}`}).join(" · "),m.backupDir&&s.jsxs(s.Fragment,{children:[s.jsx("br",{}),"Backup of the removed files (specs, tests, CLAUDE.md, chat history…): ",s.jsx("code",{children:m.backupDir})]}),!m.backupDir&&s.jsxs(s.Fragment,{children:[s.jsx("br",{}),"No backup was made: removed items were deleted permanently."]}),s.jsx("br",{}),"Next: add specs for the new project, then ",s.jsx(ye,{to:"/project",children:"update CLAUDE.md"})," with the Context Writer or upload the project's CLAUDE.md.",m.mentions.length>0&&s.jsx("div",{style:{marginTop:8},children:s.jsx(TL,{mentions:m.mentions,title:"Still mentioned"})})]}),s.jsx(Le,{error:d}),(t==null?void 0:t.busy)&&s.jsx("div",{className:"warn-box",children:"A job is queued, running or waiting for review. Wait for it to finish (or cancel it) before resetting."}),t&&s.jsxs("div",{className:"overview-grid rt-grid",children:[s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head row between",children:[s.jsxs("h3",{children:["What to reset"," ",s.jsxs("span",{className:"muted small",style:{fontWeight:400},children:["· ",r.size," of ",t.categories.length," selected"]})]}),s.jsxs("span",{className:"row",children:[s.jsx("button",{className:"btn ghost sm",onClick:()=>x(r.size<t.categories.length),children:r.size<t.categories.length?"Select all":"Select none"}),s.jsxs("button",{className:"btn ghost sm",onClick:()=>void g(),children:[s.jsx(Jn,{size:13})," Refresh"]})]})]}),t.categories.map(E=>s.jsxs("label",{className:`rt-cat ${r.has(E.id)?"on":""}`,children:[s.jsx("input",{type:"checkbox",checked:r.has(E.id),onChange:()=>w(E.id)}),s.jsxs("span",{className:"grow",children:[s.jsxs("span",{className:"rt-cat-head",children:[s.jsx("b",{children:E.label}),s.jsxs("span",{className:"muted small",children:[E.fileCount," ",E.id==="prompts"?"custom":`file${E.fileCount===1?"":"s"}`,E.bytes?` · ${Bm(E.bytes)}`:""]}),s.jsx("span",{className:`rt-tag ${E.backedUp&&o?"":"gone"}`,children:E.backedUp&&o?"backed up":"deleted for good"})]}),s.jsx("span",{className:"muted small",children:E.description}),E.note&&s.jsx("span",{className:"small",children:E.note}),E.files.length>0&&s.jsxs("details",{className:"rt-files",children:[s.jsx("summary",{className:"small",children:"Show files"}),E.files.map(T=>s.jsx("code",{children:T},T)),E.fileCount>E.files.length&&s.jsxs("span",{className:"muted small",children:["…and ",E.fileCount-E.files.length," more"]})]})]})]},E.id))]}),s.jsxs("div",{className:"card pad danger-zone rt-panel",children:[s.jsx("h3",{className:"card-title",children:"Reset"}),s.jsxs("div",{className:"rt-summary small",children:[s.jsx("b",{children:r.size})," item",r.size===1?"":"s"," · ",s.jsx("b",{children:b})," file",b===1?"":"s",A?s.jsxs(s.Fragment,{children:[" · ",Bm(A)]}):null]}),s.jsxs("label",{className:"small row",style:{gap:8,alignItems:"center"},children:[s.jsx("input",{type:"checkbox",checked:o,onChange:E=>u(E.target.checked)}),s.jsx("b",{children:"Backup data"})]}),!o&&s.jsx("div",{className:"warn-box small",style:{margin:0},children:"Backup is off: the selected items are deleted permanently and cannot be restored."}),s.jsxs("p",{className:"muted small",style:{margin:0},children:["Keep this project's context? ",s.jsx("button",{className:"link-btn",onClick:()=>void gj(),children:"Download CLAUDE.md"})," first and upload it again later on the Project page."]}),s.jsxs("label",{className:"small",style:{display:"grid",gap:6},children:[s.jsxs("span",{children:["Type ",s.jsx("b",{children:t.confirmWord})," to confirm"]}),s.jsx("input",{className:"input mono",value:l,onChange:E=>a(E.target.value),"aria-label":"Confirmation word",autoComplete:"off"})]}),s.jsxs("button",{className:"btn danger-solid",disabled:!k,onClick:()=>void y(),children:[s.jsx(Ar,{size:14})," ",c?"Resetting…":`Reset ${r.size} item${r.size===1?"":"s"}`]})]})]})]})}const RL=/^[a-z0-9][a-z0-9_-]*$/;function LL(e){return e.replace(/\.(md|txt)$/i,"").toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/đ/g,"d").replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,60)}function AL(){const e=ut(),{specs:t}=cn(),[n,r]=j.useState(""),[i,l]=j.useState(""),[a,o]=j.useState(!1),[u,c]=j.useState(!1),[h,d]=j.useState(null),f=j.useRef(null),m=n.trim().replace(/\.md$/,""),p=`${m}.md`,g=t.some(v=>v.file===p),w=i.length>ku,y=async v=>{if(v){if(!/\.(md|txt)$/i.test(v.name))return d("Only .md or .txt files can be loaded. Copy text from Word/Confluence and paste it instead.");l(await v.text()),m||r(LL(v.name)),d(null)}},x=async v=>{if(v.preventDefault(),!RL.test(m))return d('Spec name may only contain lowercase letters, digits, "-" or "_", and must start with a letter or digit.');if(!i.trim())return d("Paste the requirement first.");if(w)return d(`The requirement is longer than ${ku.toLocaleString()} characters.`);if(g&&!a)return d(`specs/${p} already exists. Choose another name or tick "Overwrite".`);c(!0);try{const b=await V.createJob({type:"spec",spec:p,requirement:i,...g?{overwrite:!0}:{}});e(`/runs/${b.id}`)}catch(b){d(b.message),c(!1)}};return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Specification"},{label:"Generator"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Generator"}),s.jsx("p",{className:"page-sub",children:"Paste a BA requirement or user story. The QA Test Case Writer agent turns it into a spec with test cases, which you then review and run."})]})}),s.jsxs("div",{className:"overview-grid",children:[s.jsxs("form",{className:"card pad req-form",onSubmit:x,children:[s.jsxs("label",{children:["Spec name",s.jsxs("span",{className:"row",children:[s.jsx("input",{className:"input grow",placeholder:"e.g. login",value:n,onChange:v=>r(v.target.value),"aria-describedby":"spec-name-help"}),s.jsx("span",{className:"muted",children:".md"})]}),s.jsxs("span",{id:"spec-name-help",className:"muted small",style:{fontWeight:400},children:["Saved as ",s.jsxs("code",{children:["specs/",m||"<name>",".md"]})]})]}),g&&s.jsxs("label",{className:"row",style:{display:"flex",fontWeight:400},children:[s.jsx("input",{type:"checkbox",checked:a,onChange:v=>o(v.target.checked)}),s.jsxs("span",{children:[s.jsxs("b",{children:["specs/",p]})," already exists: overwrite it (existing TC-IDs are kept where they still apply)"]})]}),s.jsxs("label",{children:[s.jsxs("span",{className:"row between",children:[s.jsx("span",{children:"Requirement"}),s.jsxs("button",{type:"button",className:"btn ghost",onClick:()=>{var v;return(v=f.current)==null?void 0:v.click()},children:[s.jsx(Ao,{size:14})," Load .md / .txt"]})]}),s.jsx("textarea",{className:"input",value:i,onChange:v=>l(v.target.value),placeholder:`As a <role>, I want to <action> so that <benefit>.
401
+
402
+ Business rules:
403
+ - <rule, limits, ranges>
415
404
 
416
- `,d.fixedPart.split(`
417
- `).map((M,U)=>s.jsxs("span",{className:U===0?"fixed-head":"fixed",children:[M,`
418
- `]},U))]}):!m&&s.jsx("p",{className:"muted",children:"Building preview…"})]}),o==="permissions"&&s.jsxs("div",{className:"pad",children:[s.jsxs("p",{className:"muted small",children:["Headless Claude Code with ",s.jsx("code",{children:"--permission-mode dontAsk"}),": anything outside the allow list is denied. Permissions are fixed by Agent Studio."]}),s.jsx("h4",{children:"Allowed"}),s.jsx("div",{className:"perm",children:d?d.allowedTools.map(M=>s.jsx("code",{children:M},M)):s.jsx(kA,{agent:e,onLoad:f})}),s.jsx("h4",{children:"Explicitly denied"}),s.jsx("div",{className:"perm",children:((d==null?void 0:d.disallowedTools)??mA).map(M=>s.jsx("code",{className:"deny",children:M},M))})]})]})]})}function wA({info:e,onSaved:t}){var d,f,m;const n=$e(()=>Q.skills(),[e.agent]),[r,i]=j.useState(!1),[l,a]=j.useState(null),o=e.skills,u=new Set((d=n.data)==null?void 0:d.map(p=>p.name)),c=async p=>{i(!0);try{await Q.saveAgentSkills(e.agent,p),a(null),t()}catch(g){a(g.message)}finally{i(!1)}},h=p=>{const g=o.includes(p.name);p.error&&!g||c(g?o.filter(w=>w!==p.name):[...o,p.name])};return s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("p",{className:"muted small",style:{margin:0},children:["Select Claude Code skills from ",s.jsx("code",{children:".claude/skills/<name>/SKILL.md"})," (frontmatter ",s.jsx("code",{children:"name"})," + ",s.jsx("code",{children:"description"}),", then the skill's instructions). The skill content is not copied into the instructions: when the agent runs, Claude Code loads the selected skills itself with its Skill tool and applies them on top of the agent's role and persona. Claude Code's own skills (built-in, plugins such as superpowers) stay available too; nothing is blocked. The agent log shows every skill used (",s.jsx("code",{children:"[skill]"})," lines). Changes apply to jobs that start after saving."]}),s.jsx(Le,{error:n.error??l}),e.skillsUnavailable.length>0&&s.jsxs("div",{className:"row",style:{gap:8},children:[s.jsxs("span",{className:"chip warn",children:["Skipped when jobs run: ",e.skillsUnavailable.join(", ")]}),s.jsx("span",{className:"muted small",children:"missing or invalid on disk"}),n.data&&e.skillsUnavailable.some(p=>!u.has(p))&&s.jsx("button",{type:"button",className:"link-btn",disabled:r,onClick:()=>void c(o.filter(p=>u.has(p))),children:"Remove missing"})]}),((f=n.data)==null?void 0:f.length)===0&&s.jsxs("p",{className:"muted",children:["No skills found. Create ",s.jsx("code",{children:".claude/skills/<name>/SKILL.md"})," in the project, then click ",s.jsx("b",{children:"Rescan folder"}),"."]}),s.jsx("div",{className:"skill-list",children:(m=n.data)==null?void 0:m.map(p=>{const g=o.includes(p.name);return s.jsxs("label",{className:`skill-item ${g?"on":""} ${p.error&&!g?"invalid":""}`,title:p.error??p.dir,children:[s.jsx("input",{type:"checkbox",checked:g,disabled:r||!!p.error&&!g,onChange:()=>h(p),"aria-label":`Attach skill ${p.name}`}),s.jsxs("span",{className:"row",style:{gap:8},children:[s.jsx("b",{children:p.name}),g&&s.jsx(yt,{status:"stale",children:o.length>1?`attached #${o.indexOf(p.name)+1}`:"attached"}),p.error&&s.jsx("span",{className:"chip fail",children:"invalid"})]}),s.jsx("span",{className:"skill-desc muted small",children:p.error??p.description}),s.jsxs("span",{className:"skill-meta muted small",children:[s.jsxs("code",{children:[p.dir,"/SKILL.md"]}),s.jsxs("span",{children:[p.chars.toLocaleString()," characters"]}),p.files.length>0&&s.jsxs("span",{title:p.files.join(", "),children:["+",p.files.length," file",p.files.length===1?"":"s"]}),p.allowedTools.length>0&&s.jsxs("span",{className:"chip warn",title:"From the skill's frontmatter: Claude Code allows these tools while the skill is active, on top of the agent's permissions",children:["allowed-tools: ",p.allowedTools.join(" ")]})]})]},p.name)})}),s.jsxs("div",{className:"row between muted small",children:[s.jsxs("span",{children:[o.length," attached · see Full prompt preview for the result"]}),s.jsxs("button",{type:"button",className:"btn ghost sm",onClick:n.reload,disabled:r,children:[s.jsx(Yn,{size:12})," Rescan folder"]})]})]})}function kA({agent:e,onLoad:t}){return j.useEffect(()=>{Q.previewAgentPrompt(e,{}).then(t).catch(()=>{})},[e,t]),s.jsx("span",{className:"muted small",children:"Loading…"})}let bA=0;const wj=()=>`b${Date.now().toString(36)}${(bA++).toString(36)}`;function kj(e,t=wj){return e.map(n=>n.kind==="agent"?{uid:t(),kind:"agent",agent:n.agent}:{uid:t(),kind:"loop",maxIterations:n.maxIterations,endsWhen:n.endsWhen??"first",steps:kj(n.steps.map(ds),t)})}const bj=e=>({kind:"loop",steps:e.steps.map(t=>t.kind==="agent"?t.agent:bj(t)),maxIterations:e.maxIterations,...e.endsWhen==="last"?{endsWhen:"last"}:{}});function Sj(e){return e.map(t=>t.kind==="agent"?{kind:"agent",agent:t.agent}:bj(t))}const fd=(e,t)=>e.length===t.length&&e.every((n,r)=>n===t[r]),Nj=(e,t)=>e.length<=t.length&&e.every((n,r)=>n===t[r]);function ef(e,t){let n=e,r;for(const i of t){if(r=n[i],!r)return;n=r.kind==="loop"?r.steps:[]}return r}function Cj(e,t){if(t.length===0)return e;const n=ef(e,t);return(n==null?void 0:n.kind)==="loop"?n.steps:null}const Ej=e=>e.kind==="agent"?0:1+Math.max(0,...e.steps.map(Ej));function ml(e,t,n){if(t.length===0)return n(e);const[r,...i]=t;return e.map((l,a)=>a===r&&l.kind==="loop"?{...l,steps:ml(l.steps,i,n)}:l)}const SA=(e,t)=>t.from==="block"?ef(e,t.path)??null:null;function Tj(e,t,n){const r=Cj(e,n.parent);if(!r||n.index<0||n.index>r.length)return!1;let i;if(t.from==="palette")i=0;else if(t.from==="palette-loop")i=1;else{const a=SA(e,t);if(!a||Nj(t.path,n.parent))return!1;i=Ej(a)}return n.parent.length+i>to?!1:t.from==="block"&&fd(t.path.slice(0,-1),n.parent)||r.length<(n.parent.length===0?ba:Sa)}function pd(e,t,n,r=wj){if(!Tj(e,t,n))return e;let i,l=e,a=n;if(t.from==="palette")i={uid:r(),kind:"agent",agent:t.agent};else if(t.from==="palette-loop")i={uid:r(),kind:"loop",steps:[],maxIterations:Lb,endsWhen:"first"};else{const o=t.path.slice(0,-1),u=t.path[t.path.length-1];if(fd(o,n.parent)&&(n.index===u||n.index===u+1))return e;if(i=ef(e,t.path),l=ml(e,o,c=>c.filter((h,d)=>d!==u)),fd(o,n.parent))n.index>u&&(a={...n,index:n.index-1});else if(Nj(o,n.parent)&&n.parent[o.length]>u){const c=[...n.parent];c[o.length]-=1,a={...n,parent:c}}}return ml(l,a.parent,o=>[...o.slice(0,a.index),i,...o.slice(a.index)])}function Km(e,t,n){const r=t.slice(0,-1),i=t[t.length-1],l=Cj(e,r),a=i+n;return!l||a<0||a>=l.length?e:pd(e,{from:"block",path:t},{parent:r,index:n<0?a:a+1})}function NA(e,t){const n=t[t.length-1];return ml(e,t.slice(0,-1),r=>r.filter((i,l)=>l!==n))}function Ym(e,t,n){const r=t[t.length-1];return ml(e,t.slice(0,-1),i=>i.map((l,a)=>a===r&&l.kind==="loop"?{...l,...n}:l))}const CA=Object.keys(Ne).filter(e=>e!=="custom"),Hu=(e,t,n,r="")=>JSON.stringify({name:e.trim(),description:t.trim(),workDir:r.trim(),steps:Sj(n)});function Jm(){const{id:e}=li(),t=!e||e==="new",[n]=yh(),r=ut(),i=In(),l=Ir(),a=$e(()=>Q.settings()),o=$e(()=>Q.customAgents()).data??[],u=$e(()=>t?Promise.resolve(null):Q.pipeline(e),[e]),[c,h]=j.useState(""),[d,f]=j.useState(""),[m,p]=j.useState(""),[g,w]=j.useState([]),[y,x]=j.useState(),[v,b]=j.useState(null),[A,k]=j.useState(!1),[E,T]=j.useState(null),[I,C]=j.useState(null),[R,L]=j.useState(!1),[M,U]=j.useState(!1),D=j.useRef(!1),q=j.useMemo(()=>{var V;return Mb(((V=a.data)==null?void 0:V.settings.maxHealRounds)??2)},[a.data]),J=(V,de,ve=!0)=>{const ct=kj(V.steps);h(V.name),f(V.description),p(V.workDir??""),w(ct),x(de),b(ve?Hu(V.name,V.description,ct,V.workDir??""):Hu("","",[],"")),k(!0)};j.useEffect(()=>{if(!t){u.data&&J(u.data,u.data.updatedAt);return}const V=n.get("from");if(V&&!a.data)return;const de=q.find(ve=>ve.id===V);de?J({...de,name:`${de.name} (custom)`},void 0,!1):J({name:"",description:"",steps:[]},void 0)},[t,u.data,a.data]);const B=Hu(c,d,g,m),X=A&&v!==null&&B!==v,S=zb({name:c,description:d,workDir:m,steps:Sj(g)}),ae=S.ok?[]:S.errors,O=xh(({currentLocation:V,nextLocation:de})=>X&&!D.current&&V.pathname!==de.pathname);Rh(O,{title:"Discard the unsaved pipeline changes?",message:"Your changes to this pipeline will be lost.",confirmLabel:"Discard",danger:!0});const N=async()=>{if(S.ok){L(!0);try{const V=t?await Q.createPipeline(S.value):await Q.savePipeline(e,S.value,y);C(null),J(V,V.updatedAt),U(!0),setTimeout(()=>U(!1),2e3),l.success(t?`Pipeline "${V.name}" created`:`Pipeline "${V.name}" saved`),t&&(D.current=!0,r(`/agents/pipelines/${V.id}`,{replace:!0}))}catch(V){C(V.message)}finally{L(!1)}}},F=async()=>{var ve;if(t)return;const V=((ve=u.data)==null?void 0:ve.name)||c||e;if(await i({title:`Delete the pipeline "${V}"?`,message:"The pipeline is removed for everyone using this Agent Studio. This cannot be undone.",confirmLabel:"Delete pipeline",danger:!0})){L(!0);try{await Q.deletePipeline(e),D.current=!0,l.success(`Pipeline "${V}" deleted`),r("/agents?tab=custom",{replace:!0})}catch(ct){C(ct.message),L(!1)}}},Z=(V,de)=>{V.dataTransfer.effectAllowed=de.from==="palette"||de.from==="palette-loop"?"copy":"move",V.dataTransfer.setData("text/plain","qa-pipeline"),T(de)},ce=()=>T(null),Te=V=>{E&&w(de=>pd(de,E,V)),T(null)},tt=V=>w(de=>pd(de,V,{parent:[],index:de.length})),W={blocks:g,drag:E,customAgents:o,setBlocks:w,startDrag:Z,endDrag:ce,drop:Te},ge=t?"New pipeline":c||"Pipeline";return!t&&u.error?s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Agents",to:"/agents"},{label:"Pipeline"}]}),s.jsx(Le,{error:u.error}),s.jsx(ye,{to:"/agents",className:"btn ghost",children:"Back to Agents"})]}):s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Agents",to:"/agents"},{label:ge}]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:ge}),s.jsxs("p",{className:"page-sub",children:["Drag agents from the palette into the pipeline, reorder them by dragging, and add a ",s.jsx("b",{children:"Loop"})," to repeat agents. Each loop runs its entries in order and ends when its first entry passes (check first) or when its last entry passes (work first, then check), or after its maximum number of iterations. Drop a loop inside another loop to nest it (up to ",to," levels); a nested loop in the check position (first, or last for loops that end when the last entry passes) ends the outer loop when it passes. Run it from the chat with ",s.jsx("code",{children:"/p:<name> <spec.md> [input]"})," or a prompt that names a spec or TC-ID (",s.jsx("code",{children:"/p:<name> check TC-LOGIN-001 on mobile"}),"); a pipeline with only custom agents or the Context Writer also runs from a prompt alone: ",s.jsx("code",{children:"/p:<name> <prompt>"}),"."]})]}),s.jsxs("span",{className:"row",children:[!t&&s.jsxs("button",{className:"btn danger",onClick:()=>void F(),disabled:R,children:[s.jsx(Ar,{size:14})," Delete"]}),s.jsxs("button",{className:"btn",onClick:()=>void N(),disabled:R||!A||!S.ok||!t&&!X,title:ae[0],children:[s.jsx(cs,{size:14})," ",M?"Saved":t?"Create pipeline":"Save"]})]})]}),s.jsx(Le,{error:I}),s.jsxs("div",{className:"card pl-meta",children:[s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:"Name"}),s.jsx("input",{className:"input",value:c,maxLength:Vc,onChange:V=>h(V.target.value),placeholder:"e.g. Nightly regression"})]}),s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:"Description"}),s.jsx("input",{className:"input",value:d,maxLength:Qc,onChange:V=>f(V.target.value),placeholder:"Optional"})]}),s.jsxs("label",{className:"pl-field wide",children:[s.jsx("span",{children:"Working directory"}),s.jsx("input",{className:"input",value:m,onChange:V=>p(V.target.value),placeholder:"Optional"}),s.jsx("span",{className:"muted small",children:"Custom agents run here (e.g. D:\\my-app). Empty: this QA repository."})]}),t&&s.jsxs("label",{className:"pl-field pl-from",children:[s.jsx("span",{children:"Start from"}),s.jsxs("select",{className:"input",value:n.get("from")??"",onChange:async V=>{const de=V.target.value;if(g.length&&!await i({title:"Replace the current steps?",message:"The pipeline steps are replaced with the chosen starting point.",confirmLabel:"Replace",danger:!0}))return;r(de?`/agents/pipelines/new?from=${de}`:"/agents/pipelines/new",{replace:!0});const ve=q.find(ct=>ct.id===de);J(ve?{...ve,name:`${ve.name} (custom)`}:{name:"",description:"",steps:[]},void 0,!ve)},children:[s.jsx("option",{value:"",children:"Blank pipeline"}),q.map(V=>s.jsxs("option",{value:V.id,children:["Built-in: ",V.name]},V.id))]})]})]}),s.jsxs("div",{className:"pl-layout",children:[s.jsxs("aside",{className:"card pl-palette","aria-label":"Agent palette",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"Palette"})}),s.jsx("p",{className:"muted small pl-hint",children:"Drag onto the pipeline, or press + to add at the end."}),s.jsxs("div",{className:"pl-tile pl-tile-loop",draggable:!0,onDragStart:V=>Z(V,{from:"palette-loop"}),onDragEnd:ce,children:[s.jsx("span",{className:"pl-loop-icon",children:s.jsx(ls,{size:16})}),s.jsxs("span",{className:"pl-tile-text",children:[s.jsx("b",{children:"Loop"}),s.jsx("span",{className:"muted small",children:"Repeat agents up to a maximum count; loops can be nested"})]}),s.jsx("button",{className:"btn ghost sm icon","aria-label":"Add a loop",onClick:()=>tt({from:"palette-loop"}),children:s.jsx(qt,{size:14})})]}),CA.map(V=>s.jsxs("div",{className:"pl-tile",draggable:!0,onDragStart:de=>Z(de,{from:"palette",agent:V}),onDragEnd:ce,children:[s.jsx(Ft,{agent:V,size:28}),s.jsxs("span",{className:"pl-tile-text",children:[s.jsx("b",{children:Ne[V].label}),s.jsx("span",{className:"muted small",children:Ne[V].llm?"LLM agent":"Playwright step"})]}),s.jsx("button",{className:"btn ghost sm icon","aria-label":`Add ${Ne[V].label}`,onClick:()=>tt({from:"palette",agent:V}),children:s.jsx(qt,{size:14})})]},V)),o.map(V=>{const de=Ph(V.id);return s.jsxs("div",{className:"pl-tile",draggable:!0,onDragStart:ve=>Z(ve,{from:"palette",agent:de}),onDragEnd:ce,children:[s.jsx(Ft,{agent:"custom",size:28}),s.jsxs("span",{className:"pl-tile-text",children:[s.jsx("b",{children:V.name}),s.jsx("span",{className:"muted small",children:"Custom agent"})]}),s.jsx("button",{className:"btn ghost sm icon","aria-label":`Add ${V.name}`,onClick:()=>tt({from:"palette",agent:de}),children:s.jsx(qt,{size:14})})]},V.id)}),o.length===0&&s.jsxs(ye,{to:"/agents/custom/new",className:"btn ghost sm",children:[s.jsx(qt,{size:14})," New agent"]})]}),s.jsxs("div",{className:"card pl-canvas","aria-label":"Pipeline",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Pipeline"}),s.jsxs("span",{className:"muted small",children:[g.length," block",g.length===1?"":"s"]})]}),s.jsxs("div",{className:"pl-flow",children:[s.jsx("span",{className:"pl-terminal",children:"Start"}),g.map((V,de)=>s.jsxs("div",{className:"pl-item",children:[s.jsx(co,{tree:W,target:{parent:[],index:de}}),s.jsx(Lj,{tree:W,block:V,path:[de],siblings:g.length})]},V.uid)),s.jsx(co,{tree:W,target:{parent:[],index:g.length},empty:g.length===0}),s.jsx("span",{className:"pl-terminal",children:"End"})]}),A&&ae.length>0&&(g.length>0||c)&&s.jsx("div",{className:"warn-box",role:"status",children:ae.join(`
419
- `)})]})]})]})}const Pj=e=>e.map(t=>t+1).join("."),Rj=(e,t)=>(e==null?void 0:e.from)==="block"&&e.path.length===t.length&&e.path.every((n,r)=>n===t[r]);function Lj({tree:e,block:t,path:n,siblings:r,parentEndsWhen:i}){var m;const{drag:l,customAgents:a,startDrag:o,endDrag:u}=e,c=n.length>1,h=n[n.length-1],d=c&&(i==="last"?h===r-1:h===0),f=p=>{p.stopPropagation(),o(p,{from:"block",path:n})};if(t.kind==="agent"){const p=Pl(t.agent,a);return s.jsxs("div",{className:`pl-block ${c?"inner":""} ${Rj(l,n)?"dragging":""}`,draggable:!0,onDragStart:f,onDragEnd:u,children:[s.jsx("span",{className:"pl-num",children:Pj(n)}),s.jsx(Ft,{agent:Vh(t.agent),size:c?26:30}),s.jsxs("span",{className:"pl-tile-text",children:[s.jsx("b",{children:p}),((m=a.find(g=>Ph(g.id)===t.agent))==null?void 0:m.review)==="human"&&s.jsx("span",{className:"hr-badge",children:"Human review"}),d?s.jsx("span",{className:"muted small",children:"Loop ends when this agent passes"}):!c&&s.jsx("span",{className:"muted small",children:bl(t.agent)?"Custom agent":Ne[t.agent].description})]}),s.jsx(Aj,{tree:e,path:n,count:r,label:p})]})}return s.jsx(EA,{tree:e,loop:t,path:n,siblings:r,first:d,onDragStart:f})}function EA({tree:e,loop:t,path:n,siblings:r,first:i,onDragStart:l}){const{drag:a,setBlocks:o,endDrag:u}=e,c=Pj(n),h=`loop ${c}`;return s.jsxs("div",{className:`pl-loop ${n.length>1?"nested":""} ${Rj(a,n)?"dragging":""}`,"data-depth":n.length,children:[s.jsxs("div",{className:"pl-loop-head",draggable:!0,onDragStart:l,onDragEnd:u,children:[s.jsx("span",{className:"pl-num",children:c}),s.jsx("span",{className:"pl-loop-icon",children:s.jsx(ls,{size:15})}),s.jsxs("span",{className:"pl-loop-title",children:[s.jsx("b",{children:n.length>1?"Nested loop":"Loop"}),i&&s.jsx("span",{className:"muted small",children:"Outer loop ends when this loop passes"})]}),s.jsxs("label",{className:"pl-max",children:[s.jsx("span",{className:"muted small",children:"Max iterations"}),s.jsx("input",{className:"input",type:"number",min:1,max:fl,step:1,value:t.maxIterations??"","aria-label":`Maximum iterations of ${h}`,onChange:d=>o(f=>Ym(f,n,{maxIterations:d.target.value===""?null:Math.max(1,Math.min(fl,Math.round(Number(d.target.value))))}))})]}),s.jsxs("label",{className:"pl-max",children:[s.jsx("span",{className:"muted small",children:"Ends when"}),s.jsxs("select",{className:"input",value:t.endsWhen,"aria-label":`When ${h} ends`,onChange:d=>o(f=>Ym(f,n,{endsWhen:d.target.value})),children:[s.jsx("option",{value:"first",children:"first entry passes"}),s.jsx("option",{value:"last",children:"last entry passes"})]})]}),s.jsx(Aj,{tree:e,path:n,count:r,label:h})]}),s.jsxs("div",{className:"pl-loop-body",children:[t.steps.map((d,f)=>s.jsxs("div",{className:"pl-item",children:[s.jsx(co,{tree:e,target:{parent:n,index:f},inner:!0}),s.jsx(Lj,{tree:e,block:d,path:[...n,f],siblings:t.steps.length,parentEndsWhen:t.endsWhen})]},d.uid)),s.jsx(co,{tree:e,target:{parent:n,index:t.steps.length},inner:!0,empty:t.steps.length===0}),s.jsxs("div",{className:"pl-loop-foot muted small",children:[s.jsx(ls,{size:12})," repeats up to ",t.maxIterations??"?"," time",t.maxIterations===1?"":"s"]})]})]})}function co({tree:e,target:t,inner:n,empty:r}){const{blocks:i,drag:l,drop:a}=e,[o,u]=j.useState(!1),c=l!==null&&Tj(i,l,t);return s.jsx("div",{className:`pl-gap ${n?"inner":""} ${r?"empty":""} ${c?"active":""} ${o&&c?"over":""}`,onDragOver:h=>{c&&(h.preventDefault(),h.stopPropagation(),h.dataTransfer.dropEffect=l.from==="palette"||l.from==="palette-loop"?"copy":"move",o||u(!0))},onDragLeave:()=>u(!1),onDrop:h=>{h.preventDefault(),h.stopPropagation(),u(!1),a(t)},children:r?s.jsx("span",{className:"muted small",children:n?"Drop agents or a loop here to repeat them":"Drag agents or a loop here"}):s.jsx("span",{className:"pl-arrow",children:"↓"})})}function Aj({tree:e,path:t,count:n,label:r}){const{setBlocks:i}=e,l=t[t.length-1];return s.jsxs("span",{className:"pl-actions",children:[s.jsx("button",{className:"btn ghost sm icon","aria-label":`Move ${r} up`,disabled:l===0,onClick:()=>i(a=>Km(a,t,-1)),children:"↑"}),s.jsx("button",{className:"btn ghost sm icon","aria-label":`Move ${r} down`,disabled:l===n-1,onClick:()=>i(a=>Km(a,t,1)),children:"↓"}),s.jsx("button",{className:"btn ghost sm icon","aria-label":`Remove ${r}`,onClick:()=>i(a=>NA(a,t)),children:s.jsx(kr,{size:13})})]})}const TA=[{id:"1",label:"24 h"},{id:"7",label:"7 days"},{id:"30",label:"30 days"},{id:"90",label:"90 days"}],cr=e=>e.inputTokens+e.cacheReadTokens+e.cacheWriteTokens,Pn=(e,t)=>e.trackedRuns?sn(t):"—";function PA(e){const t=new Map(e.byDay.map(i=>[i.day,i])),n=[],r=new Date;for(let i=Math.max(e.days,1)-1;i>=0;i--){const l=new Date(r.getTime()-i*864e5).toISOString().slice(0,10);n.push(t.get(l)??{day:l,runs:0,trackedRuns:0,costUsd:0,turns:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheWriteTokens:0})}return n}function RA(e){if(e<=0)return 1;const t=10**Math.floor(Math.log10(e));return([1,2,2.5,5,10].find(n=>n*t>=e)??10)*t}const Ti=e=>new Date(`${e}T00:00:00`).toLocaleDateString("en-US",{month:"short",day:"numeric"});function LA({report:e}){const t=PA(e),n=RA(Math.max(...t.map(r=>r.costUsd)));return s.jsxs("div",{children:[s.jsxs("div",{className:"usage-chart",role:"img","aria-label":`Estimated cost per day over the last ${e.days} days`,children:[[.5,1].map(r=>s.jsx("div",{className:"usage-chart-gridline",style:{bottom:`${r*100}%`},children:s.jsx("span",{children:Kt(n*r)})},r)),t.map(r=>s.jsxs("div",{className:`bar-col ${r.costUsd?"":"zero"}`,tabIndex:0,"aria-label":`${Ti(r.day)}: ${Kt(r.costUsd)}, ${r.runs} runs`,children:[s.jsx("i",{style:{height:`${Math.max(r.costUsd/n*100,r.costUsd?2:0)}%`}}),s.jsxs("span",{className:"tip",children:[s.jsx("b",{children:Ti(r.day)})," · ",Kt(r.costUsd),s.jsx("br",{}),r.runs," run",r.runs===1?"":"s"," · ",sn(cr(r))," in / ",sn(r.outputTokens)," out"]})]},r.day))]}),s.jsxs("div",{className:"usage-axis",children:[s.jsx("span",{children:Ti(t[0].day)}),t.length>2&&s.jsx("span",{children:Ti(t[Math.floor(t.length/2)].day)}),s.jsx("span",{children:Ti(t[t.length-1].day)})]})]})}function ua({icon:e,label:t,value:n,sub:r}){return s.jsxs("div",{className:"stat",children:[s.jsxs("div",{className:"stat-head",children:[s.jsx("span",{children:t}),s.jsx("span",{className:"stat-icon",children:e})]}),s.jsx("div",{className:"stat-value",children:n}),r&&s.jsx("div",{className:"muted small",children:r})]})}function Wu({title:e,rows:t,name:n,total:r}){return s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:e})}),t.length===0?s.jsx("p",{className:"muted pad",children:"No runs in this range."}):s.jsx("div",{className:"table-wrap",children:s.jsxs("table",{className:"flat",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Name"}),s.jsx("th",{className:"num",children:"Runs"}),s.jsx("th",{className:"num",children:"Tokens in"}),s.jsx("th",{className:"num",children:"Tokens out"}),s.jsx("th",{className:"num",children:"Est. cost"}),s.jsx("th",{children:"Share"})]})}),s.jsx("tbody",{children:t.map((i,l)=>s.jsxs("tr",{children:[s.jsx("td",{children:n(i)}),s.jsx("td",{className:"num",children:i.runs}),s.jsx("td",{className:"num",children:Pn(i,cr(i))}),s.jsx("td",{className:"num",children:Pn(i,i.outputTokens)}),s.jsx("td",{className:"num",children:Kt(i.costUsd)}),s.jsx("td",{children:s.jsx("div",{className:"share-bar",title:`${r?Math.round(i.costUsd/r*100):0}% of cost`,children:s.jsx("i",{style:{width:`${r?i.costUsd/r*100:0}%`}})})})]},l))})]})})]})}const Ij="qa-studio.usage.recentView";function AA(){try{return localStorage.getItem(Ij)==="jobs"?"jobs":"runs"}catch{return"runs"}}function IA({job:e}){return s.jsxs(s.Fragment,{children:[s.jsxs(ye,{to:`/runs/${e.jobId}`,children:["#",e.jobId," ",Sr[e.jobType]??e.jobType]}),s.jsx("div",{className:"muted small",children:e.name??e.target})]})}function DA({jobs:e}){const[t,n]=j.useState(()=>new Set),r=l=>n(a=>{const o=new Set(a);return o.has(l)?o.delete(l):o.add(l),o}),i=e.length>0&&e.every(l=>t.has(l.jobId));return e.length===0?s.jsx("p",{className:"muted pad",children:"No runs in this range."}):s.jsx("div",{className:"table-wrap",children:s.jsxs("table",{className:"flat usage-jobs",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:s.jsx("button",{className:"btn ghost sm",onClick:()=>n(i?new Set:new Set(e.map(l=>l.jobId))),children:i?"Collapse all":"Expand all"})}),s.jsx("th",{children:"Agents"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Model"}),s.jsx("th",{className:"num",children:"Turns"}),s.jsx("th",{className:"num",children:"Tokens in"}),s.jsx("th",{className:"num",children:"Tokens out"}),s.jsx("th",{className:"num",children:"Est. cost"}),s.jsx("th",{children:"When"})]})}),s.jsx("tbody",{children:e.map(l=>{const a=t.has(l.jobId),o=[...new Set(l.agentRuns.map(u=>u.model).filter(Boolean))];return s.jsxs(j.Fragment,{children:[s.jsxs("tr",{className:"usage-job-row",children:[s.jsx("td",{children:s.jsxs("span",{className:"usage-job-cell",children:[s.jsx("button",{className:"usage-expand",onClick:()=>r(l.jobId),"aria-expanded":a,"aria-label":`${a?"Hide":"Show"} the LLM runs of job #${l.jobId}`,children:s.jsx(ti,{size:12,open:a})}),s.jsx("span",{children:s.jsx(IA,{job:l})})]})}),s.jsx("td",{children:s.jsxs("span",{className:"usage-agent-icons",title:l.agentRuns.map(u=>{var c;return((c=Ne[u.agent])==null?void 0:c.label)??u.agent}).join(" → "),children:[l.agentRuns.slice(0,6).map(u=>s.jsx(Ft,{agent:u.agent,size:20},u.runId)),s.jsxs("span",{className:"muted small",children:[l.runs," run",l.runs===1?"":"s"]})]})}),s.jsx("td",{children:s.jsx(An,{status:l.status})}),s.jsx("td",{children:o.length?o.map(u=>s.jsx("code",{children:u},u)):s.jsx("span",{className:"muted",children:"—"})}),s.jsx("td",{className:"num",children:l.turns}),s.jsx("td",{className:"num",children:Pn(l,cr(l))}),s.jsx("td",{className:"num",children:Pn(l,l.outputTokens)}),s.jsx("td",{className:"num strong",children:Kt(l.costUsd)}),s.jsx("td",{className:"small",children:Rt(l.at)})]}),a&&l.agentRuns.map(u=>{var c;return s.jsxs("tr",{className:"usage-sub-row",children:[s.jsx("td",{children:s.jsxs("span",{className:"usage-sub-name",children:[s.jsx(Ft,{agent:u.agent,size:20})," ",((c=Ne[u.agent])==null?void 0:c.label)??u.agent]})}),s.jsxs("td",{className:"muted small",children:["run #",u.runId]}),s.jsx("td",{children:s.jsx(An,{status:u.status})}),s.jsx("td",{children:u.model?s.jsx("code",{children:u.model}):s.jsx("span",{className:"muted",children:"—"})}),s.jsx("td",{className:"num",children:u.turns}),s.jsx("td",{className:"num",children:Pn(u,cr(u))}),s.jsx("td",{className:"num",children:Pn(u,u.outputTokens)}),s.jsx("td",{className:"num",children:Kt(u.costUsd)}),s.jsx("td",{className:"small",children:Rt(u.at)})]},u.runId)})]},l.jobId)})})]})})}function zA(){const[e,t]=j.useState(AA),n=d=>{t(d);try{localStorage.setItem(Ij,d)}catch{}},[r,i]=j.useState("30"),{data:l,error:a,reload:o}=$e(()=>Q.usage(Number(r)),[r]),u=l==null?void 0:l.totals,c=u&&cr(u)?Math.round(u.cacheReadTokens/cr(u)*100):0,h=u?u.runs-u.trackedRuns:0;return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Claude usage"}]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Claude usage"}),s.jsxs("p",{className:"page-sub",children:["Tokens and estimated cost of the Claude Code agents run by Agent Studio (QA Explorer, QA Script Generator, QA Script Healer, QA Test Case Writer, Context Writer). The cost is Claude Code's API-price estimate. On a Claude subscription, check plan limits with ",s.jsx("code",{children:"/usage"})," in Claude Code."]})]}),s.jsxs("div",{className:"row",children:[s.jsx(kn,{value:r,onChange:i,items:TA}),s.jsx("button",{className:"btn ghost",onClick:o,title:"Refresh","aria-label":"Refresh",children:s.jsx(Yn,{size:15})})]})]}),s.jsx(Le,{error:a}),l&&u&&s.jsxs(s.Fragment,{children:[h>0&&s.jsxs("div",{className:"warn-box",style:{marginBottom:14},children:[h," of ",u.runs," runs in this range were recorded before token tracking was added: they count toward cost and runs, but their tokens show as —."]}),s.jsxs("div",{className:"stats usage-stats",children:[s.jsx(ua,{icon:s.jsx(_y,{size:16}),label:"Estimated cost",value:Kt(u.costUsd),sub:`${u.runs?Kt(u.costUsd/u.runs):"—"} per run`}),s.jsx(ua,{icon:s.jsx($y,{size:16}),label:"LLM agent runs",value:u.runs,sub:`${u.turns.toLocaleString()} turns`}),s.jsx(ua,{icon:s.jsx(ft,{size:16}),label:"Tokens in",value:Pn(u,cr(u)),sub:u.trackedRuns?`${c}% served from cache`:"No token data yet"}),s.jsx(ua,{icon:s.jsx(ft,{size:16}),label:"Tokens out",value:Pn(u,u.outputTokens),sub:u.trackedRuns?`${sn(u.inputTokens)} uncached input`:"No token data yet"})]}),s.jsxs("div",{className:"card pad",style:{marginBottom:14},children:[s.jsxs("div",{className:"row between",style:{marginBottom:18},children:[s.jsx("h3",{className:"card-title",children:"Estimated cost per day"}),s.jsxs("span",{className:"muted small",children:["Since ",new Date(l.since).toLocaleString("en-US",{hour12:!1})]})]}),s.jsx(LA,{report:l})]}),s.jsxs("div",{className:"overview-grid",style:{marginBottom:14},children:[s.jsx(Wu,{title:"By spec",rows:l.bySpec,total:u.costUsd,name:d=>d.target.endsWith(".md")?s.jsx(ye,{to:`/specs/${d.target}`,children:d.target}):d.target}),s.jsx(Wu,{title:"By agent",rows:l.byAgent,total:u.costUsd,name:d=>{var f;return s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8,whiteSpace:"nowrap"},children:[s.jsx(Ft,{agent:d.agent,size:22})," ",((f=Ne[d.agent])==null?void 0:f.label)??d.agent]})}})]}),s.jsx("div",{style:{marginBottom:14},children:s.jsx(Wu,{title:"By model",rows:l.byModel,total:u.costUsd,name:d=>s.jsx("code",{children:d.model})})}),s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Recent LLM runs"}),s.jsx(kn,{value:e,onChange:n,items:[{id:"runs",label:"Runs"},{id:"jobs",label:"Group by job"}]})]}),e==="jobs"?s.jsx(DA,{jobs:l.recentJobs}):l.recent.length===0?s.jsx("p",{className:"muted pad",children:"No runs in this range. Usage is recorded for agent runs from this version of Agent Studio onward."}):s.jsx("div",{className:"table-wrap",children:s.jsxs("table",{className:"flat",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Job"}),s.jsx("th",{children:"Agent"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Model"}),s.jsx("th",{className:"num",children:"Turns"}),s.jsx("th",{className:"num",children:"Tokens in"}),s.jsx("th",{className:"num",children:"Tokens out"}),s.jsx("th",{className:"num",children:"Est. cost"}),s.jsx("th",{children:"When"})]})}),s.jsx("tbody",{children:l.recent.map(d=>{var f;return s.jsxs("tr",{children:[s.jsxs("td",{children:[s.jsxs(ye,{to:`/runs/${d.jobId}`,children:["#",d.jobId," ",Sr[d.jobType]]}),s.jsx("div",{className:"muted small",children:d.target})]}),s.jsx("td",{children:((f=Ne[d.agent])==null?void 0:f.label)??d.agent}),s.jsx("td",{children:s.jsx(An,{status:d.status})}),s.jsx("td",{children:d.model?s.jsx("code",{children:d.model}):s.jsx("span",{className:"muted",children:"—"})}),s.jsx("td",{className:"num",children:d.turns}),s.jsx("td",{className:"num",children:Pn(d,cr(d))}),s.jsx("td",{className:"num",children:Pn(d,d.outputTokens)}),s.jsx("td",{className:"num",children:Kt(d.costUsd)}),s.jsx("td",{className:"small",children:Rt(d.at)})]},d.runId)})})]})})]})]})]})}const Pi=e=>`${e.spec}#${e.tcId}`;function MA(e){return e.target==="all"?"All tests":e.args.tcId?"1 TC":"Whole spec"}function $A({counts:e}){const t=Object.values(e).reduce((r,i)=>r+i,0);if(!t)return s.jsx("span",{className:"muted small",children:"—"});const n=["passed","flaky","failed","skipped"];return s.jsxs("span",{className:"row",style:{gap:8},children:[s.jsx("span",{className:"tr-progress",role:"img","aria-label":n.filter(r=>e[r]).map(r=>`${e[r]} ${r}`).join(", "),children:n.map(r=>e[r]?s.jsx("i",{className:r,style:{width:`${e[r]/t*100}%`},title:`${e[r]} ${r}`},r):null)}),s.jsxs("span",{className:"small",children:[e.passed??0,"/",t]})]})}function _A(){const e=ut(),t=Tl(),{data:n,error:r,reload:i}=$e(()=>Q.testRuns({page:t.page,pageSize:t.pageSize}),[t.page,t.pageSize]),l=(n==null?void 0:n.items)??[],a=l.some(o=>o.status==="queued"||o.status==="running");return j.useEffect(()=>{if(!a)return;const o=setInterval(i,2e3);return()=>clearInterval(o)},[a,i]),s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Testing"},{label:"Test runs"}]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Test runs"}),s.jsx("p",{className:"page-sub",children:"Pick test cases, name the run, execute it and review the results. Results use the line reporter; the Playwright HTML report is optional."})]}),s.jsxs(ye,{className:"btn",to:"/test-runs/new",children:[s.jsx(qt,{size:15})," New test run"]})]}),s.jsx(Le,{error:r}),s.jsxs("div",{className:"table-wrap",children:[s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Run"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Results"}),s.jsx("th",{className:"num",children:"Cases"}),s.jsx("th",{children:"Started"}),s.jsx("th",{children:"Duration"}),s.jsx("th",{children:"Report"})]})}),s.jsx("tbody",{children:l.map(o=>s.jsxs("tr",{onClick:()=>e(`/runs/${o.id}`),style:{cursor:"pointer"},children:[s.jsxs("td",{children:[s.jsx("div",{className:"strong",children:o.args.name??`Test run #${o.id}`}),s.jsxs("div",{className:"muted small",children:["#",o.id,o.args.repeatEach&&o.args.repeatEach>1?` · ${o.args.repeatEach}×`:"",o.args.retries!==void 0?` · retries ${o.args.retries}`:""]})]}),s.jsx("td",{children:s.jsx(An,{status:o.status})}),s.jsx("td",{children:s.jsx($A,{counts:o.counts})}),s.jsx("td",{className:"num",children:o.args.selection?o.caseCount:s.jsx("span",{className:"muted small",children:MA(o)})}),s.jsx("td",{className:"muted small",children:Rt(o.startedAt??o.createdAt)}),s.jsx("td",{className:"muted small",children:br(o.startedAt,o.finishedAt)}),s.jsx("td",{onClick:u=>u.stopPropagation(),children:o.hasHtmlReport?s.jsxs("a",{className:"btn ghost",href:vh(o.id),target:"_blank",rel:"noreferrer",children:[s.jsx(Nh,{size:13})," HTML"]}):s.jsx("span",{className:"muted small",children:"line only"})})]},o.id))})]}),n&&l.length===0&&s.jsxs("p",{className:"muted",style:{padding:16},children:["No test runs yet. ",s.jsx(ye,{to:"/test-runs/new",children:"Create the first one"}),"."]}),n&&s.jsx(ps,{page:t.page,pageSize:t.pageSize,total:n.total,onPage:t.setPage,onPageSize:t.setPageSize,label:"runs"})]})]})}const OA=8;function FA({query:e,onQuery:t,tags:n,allTags:r,onToggleTag:i,onClearTags:l}){const[a,o]=j.useState(!1),[u,c]=j.useState(0),h=j.useRef(null),d=e.trim().toLowerCase().replace(/^#/,""),f=r.filter(w=>!n.has(w)&&(!d||w.toLowerCase().includes(d))).sort((w,y)=>+!w.toLowerCase().startsWith(d)-+!y.toLowerCase().startsWith(d)).slice(0,OA),m=a&&f.length>0&&(d.length>0||n.size===0||e==="");j.useEffect(()=>c(0),[d]);const p=w=>{var y;i(w),t(""),c(0),(y=h.current)==null||y.focus()},g=w=>{var y;w.key==="ArrowDown"&&m?(w.preventDefault(),c(x=>(x+1)%f.length)):w.key==="ArrowUp"&&m?(w.preventDefault(),c(x=>(x-1+f.length)%f.length)):w.key==="Enter"?(w.preventDefault(),m&&d&&p(f[u])):w.key==="Escape"?e?t(""):(y=h.current)==null||y.blur():w.key==="Backspace"&&e===""&&n.size>0&&i([...n][n.size-1])};return s.jsxs("div",{className:"tag-search grow",onClick:()=>{var w;return(w=h.current)==null?void 0:w.focus()},children:[s.jsx(Ro,{size:15}),[...n].map(w=>s.jsxs("span",{className:"tag-token",children:["#",w,s.jsx("button",{type:"button","aria-label":`Remove tag filter ${w}`,onClick:y=>{y.stopPropagation(),i(w)},children:s.jsx(kr,{size:11})})]},w)),s.jsx("input",{ref:h,className:"tag-search-input",placeholder:n.size?"Add text or another tag…":"Search TC-ID, title, spec or tag…",value:e,onChange:w=>t(w.target.value),onFocus:()=>o(!0),onBlur:()=>o(!1),onKeyDown:g,role:"combobox","aria-expanded":m,"aria-controls":"tag-suggestions","aria-activedescendant":m?`tag-opt-${u}`:void 0,"aria-label":"Search test cases or filter by tag"}),n.size>0&&s.jsx("button",{type:"button",className:"tag-search-clear",onClick:w=>{w.stopPropagation(),l()},title:"Clear tag filters","aria-label":"Clear tag filters",children:"Clear tags"}),m&&s.jsxs("ul",{id:"tag-suggestions",className:"tag-suggestions",role:"listbox","aria-label":"Tags",children:[s.jsx("li",{className:"tag-suggestions-head","aria-hidden":"true",children:"Filter by tag"}),f.map((w,y)=>s.jsxs("li",{id:`tag-opt-${y}`,role:"option","aria-selected":y===u,className:y===u?"active":"",onMouseEnter:()=>c(y),onMouseDown:x=>{x.preventDefault(),p(w)},children:["#",w]},w))]})]})}const UA=()=>`Test run ${new Date().toLocaleString("en-GB",{hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}`;function BA(){var Zt;const e=ut(),n=Kn().state??null,{specs:r}=un(),i=$e(()=>Q.settings()),[l,a]=j.useState((n==null?void 0:n.name)??UA()),[o,u]=j.useState(()=>new Map(((n==null?void 0:n.selection)??[]).map(ee=>[Pi(ee),ee]))),[c,h]=j.useState(""),d=lb(c.trim(),250),[f,m]=j.useState(""),[p,g]=j.useState(new Set),[w,y]=j.useState("all"),[x,v]=j.useState(!1),[b,A]=j.useState(1),[k,E]=j.useState((n==null?void 0:n.retries)??null),[T,I]=j.useState(null),[C,R]=j.useState(!1),[L,M]=j.useState(null),U=T??((Zt=i.data)==null?void 0:Zt.settings.htmlReport)??!0,D=[...p].sort(),q=x?[...o.keys()].sort():null,J=Tl([],50),B=JSON.stringify([d,f,D,w,x]),[X,S]=j.useState(B),ae=B!==X;ae&&(S(B),J.page!==1&&J.setPage(1));const O=ae?1:J.page,N=$e(()=>Q.searchTestCases({page:O,pageSize:J.pageSize,q:d,tags:D,spec:f,result:w,...q?{selected:q}:{}}),[O,J.pageSize,d,f,D.join("\0"),w,(q==null?void 0:q.join("\0"))??null]),F=N.data,Z=(F==null?void 0:F.items)??[],ce=(F==null?void 0:F.allTags)??[],Te=(F==null?void 0:F.matchingRunnable)??[],tt=Te.length>0&&Te.every(ee=>o.has(Pi(ee))),W=[...o.values()],ge=new Set(W.map(ee=>ee.spec)).size,V=ee=>u(Ce=>{const Ze=new Map(Ce),zr=Pi(ee);return Ze.has(zr)?Ze.delete(zr):Ze.set(zr,ee),Ze}),de=()=>u(ee=>{const Ce=new Map(ee);for(const Ze of Te)tt?Ce.delete(Pi(Ze)):Ce.set(Pi(Ze),Ze);return Ce}),ve=ee=>g(Ce=>{const Ze=new Set(Ce);return Ze.has(ee)?Ze.delete(ee):Ze.add(ee),Ze}),ct=async ee=>{if(ee.preventDefault(),!l.trim())return M("Give the test run a name.");if(!W.length)return M("Pick at least one test case that has a Playwright test.");if(W.length>Mp)return M(`A test run can have at most ${Mp} test cases.`);R(!0);try{const Ce=await Q.createJob({type:"testrun",name:l.trim(),selection:W,repeatEach:b,...k!==null?{retries:k}:{},htmlReport:U});e(`/runs/${Ce.id}`)}catch(Ce){M(Ce.message),R(!1)}};return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Testing"},{label:"Test runs",to:"/test-runs"},{label:"New test run"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"New test run"}),s.jsx("p",{className:"page-sub",children:"Filter and pick test cases. Only test cases that have a Playwright test can be run."})]})}),s.jsxs("form",{className:"tr-layout",onSubmit:ct,children:[s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"tr-filters",children:[s.jsx(FA,{query:c,onQuery:h,tags:p,allTags:ce,onToggleTag:ve,onClearTags:()=>g(new Set)}),s.jsxs("select",{className:"select",value:f,onChange:ee=>m(ee.target.value),"aria-label":"Spec",children:[s.jsx("option",{value:"",children:"All specs"}),r.map(ee=>s.jsx("option",{value:ee.file,children:ee.file},ee.file))]}),s.jsxs("select",{className:"select",value:w,onChange:ee=>y(ee.target.value),"aria-label":"Last result",children:[s.jsx("option",{value:"all",children:"Any last result"}),s.jsx("option",{value:"passed",children:"Last passed"}),s.jsx("option",{value:"failed",children:"Last failed"}),s.jsx("option",{value:"none",children:"Never run"})]}),s.jsxs("label",{className:"row small",style:{gap:6},children:[s.jsx("input",{type:"checkbox",checked:x,onChange:ee=>v(ee.target.checked)})," Selected only"]})]}),s.jsxs("div",{className:"table-wrap",style:{border:0},children:[s.jsxs("table",{className:"tr-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"check",children:s.jsx("input",{type:"checkbox",checked:tt,onChange:de,disabled:!Te.length,"aria-label":`Select all ${Te.length} filtered test cases`,title:`All ${Te.length} runnable test cases that match the filters (every page)`})}),s.jsx("th",{children:"Test case"}),s.jsx("th",{children:"Spec"}),s.jsx("th",{children:"Tags"}),s.jsx("th",{children:"Last result"})]})}),s.jsx("tbody",{children:Z.map(ee=>s.jsxs("tr",{className:`${ee.runnable?"":"disabled"} ${o.has(ee.key)?"picked":""}`,onClick:()=>ee.runnable&&V(ee.ref),style:{cursor:ee.runnable?"pointer":"default"},children:[s.jsx("td",{className:"check",onClick:Ce=>Ce.stopPropagation(),children:s.jsx("input",{type:"checkbox",checked:o.has(ee.key),disabled:!ee.runnable,onChange:()=>V(ee.ref),"aria-label":`Select ${ee.tcId}`})}),s.jsxs("td",{children:[s.jsx("code",{children:ee.tcId})," ",ee.tcTitle,!ee.runnable&&s.jsx("div",{className:"muted small",children:"No Playwright test yet: generate it first"})]}),s.jsx("td",{className:"small",children:s.jsx(ye,{to:`/specs/${ee.ref.spec}`,onClick:Ce=>Ce.stopPropagation(),children:ee.ref.spec})}),s.jsx("td",{children:s.jsx("span",{className:"row",style:{gap:4,flexWrap:"wrap"},children:ee.tags.map(Ce=>s.jsx("button",{type:"button",className:`tag tag-btn ${p.has(Ce)?"on":""}`,title:p.has(Ce)?`Remove the "${Ce}" filter`:`Filter by "${Ce}"`,onClick:Ze=>{Ze.stopPropagation(),ve(Ce)},children:Ce},Ce))})}),s.jsx("td",{children:ee.lastResult?s.jsx(ni,{status:ee.lastResult.status,title:Rt(ee.lastResult.at)}):s.jsx("span",{className:"muted small",children:"never"})})]},ee.key))})]}),s.jsx(Le,{error:N.error}),F&&Z.length===0&&s.jsx("p",{className:"muted",style:{padding:16},children:F.totalCases?"No test case matches the filters.":"No test cases yet: add a spec first."}),!F&&!N.error&&s.jsx("p",{className:"muted",style:{padding:16},children:"Loading test cases…"}),F&&s.jsx(ps,{page:O,pageSize:J.pageSize,total:F.total,onPage:J.setPage,onPageSize:J.setPageSize,label:"test cases"})]})]}),s.jsx("div",{className:"tr-side",children:s.jsxs("div",{className:"card pad",style:{display:"grid",gap:12},children:[s.jsxs("label",{children:["Run name",s.jsx("input",{className:"input",value:l,maxLength:bb,onChange:ee=>a(ee.target.value)})]}),s.jsxs("label",{children:["Repeat each test",s.jsx("select",{className:"select",value:b,onChange:ee=>A(Number(ee.target.value)),children:[1,2,3,5,10].map(ee=>s.jsxs("option",{value:ee,children:[ee,"×"]},ee))})]}),s.jsxs("label",{children:["Retries on failure",s.jsxs("select",{className:"select",value:k??"",onChange:ee=>E(ee.target.value===""?null:Number(ee.target.value)),children:[s.jsx("option",{value:"",children:"Default (playwright.config.ts)"}),Array.from({length:kb+1},(ee,Ce)=>s.jsx("option",{value:Ce,children:Ce===0?"No retries":`${Ce} ${Ce===1?"retry":"retries"}`},Ce))]}),s.jsx("div",{className:"muted small",children:"A test that fails and then passes on a retry is reported as flaky."})]}),s.jsxs("div",{className:"row between",children:[s.jsxs("span",{style:{fontSize:13,fontWeight:600},children:["HTML report",s.jsx("div",{className:"muted small",style:{fontWeight:400},children:"Line report is always on"})]}),s.jsxs("label",{className:"switch",children:[s.jsx("input",{type:"checkbox",checked:U,onChange:ee=>I(ee.target.checked),"aria-label":"Also write the Playwright HTML report"}),s.jsx("span",{children:U?"On":"Off"})]})]}),s.jsxs("div",{className:"muted small",children:[s.jsx("b",{style:{color:"var(--text)"},children:W.length})," test case",W.length===1?"":"s"," selected from ",ge," spec",ge===1?"":"s",o.size>0&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("button",{type:"button",className:"link-btn",onClick:()=>u(new Map),children:"clear"})]})]}),s.jsx(Le,{error:L}),s.jsxs("button",{type:"submit",className:"btn",disabled:C||!W.length,children:[s.jsx(ft,{size:14})," ",C?"Starting…":"Create & run"]})]})})]})]})}const HA=z0([{element:s.jsx(uS,{}),children:[{path:"/",element:s.jsx(XT,{})},{path:"/chat/:id?",element:s.jsx(cA,{})},{path:"/specs",element:s.jsx(oP,{})},{path:"/specs/from-requirement",element:s.jsx(iP,{})},{path:"/specs/:file",element:s.jsx(xP,{})},{path:"/mapping",element:s.jsx(JT,{})},{path:"/runs",element:s.jsx(lP,{})},{path:"/runs/:id",element:s.jsx($T,{})},{path:"/agents",element:s.jsx(SP,{})},{path:"/agents/custom/new",element:s.jsx(Gm,{},"new")},{path:"/agents/custom/:id",element:s.jsx(Gm,{})},{path:"/agents/:agent",element:s.jsx(xA,{})},{path:"/agents/pipelines/new",element:s.jsx(Jm,{},"new")},{path:"/agents/pipelines/:id",element:s.jsx(Jm,{})},{path:"/usage",element:s.jsx(zA,{})},{path:"/test-runs",element:s.jsx(_A,{})},{path:"/test-runs/new",element:s.jsx(BA,{})},{path:"/project",element:s.jsx(eP,{})},{path:"/project/reset",element:s.jsx(nP,{})},{path:"/settings",element:s.jsx(kP,{})},{path:"*",element:s.jsx("p",{children:"Page not found."})}]}],{future:{v7_relativeSplatPath:!0,v7_fetcherPersist:!0,v7_normalizeFormMethod:!0,v7_partialHydration:!0,v7_skipActionErrorRevalidation:!0}});"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(e=>console.warn("Service worker registration failed",e))});dy(document.getElementById("root")).render(s.jsx(j.StrictMode,{children:s.jsx(H0,{router:HA,future:{v7_startTransition:!0}})}));
405
+ Acceptance criteria:
406
+ - Given ... when ... then ...
407
+ - ...`,"aria-label":"Requirement text"}),s.jsxs("span",{className:`small ${w?"":"muted"}`,style:{fontWeight:400,color:w?"var(--fail)":void 0},children:[i.length.toLocaleString()," / ",ku.toLocaleString()," characters"]})]}),s.jsx("input",{ref:f,type:"file",accept:".md,.txt,text/markdown,text/plain",hidden:!0,onChange:v=>{var b;return void y((b=v.target.files)==null?void 0:b[0])}}),s.jsx(Le,{error:h}),s.jsx("div",{className:"row",style:{justifyContent:"flex-end"},children:s.jsxs("button",{type:"submit",className:"btn",disabled:u,children:[s.jsx(hl,{size:15})," ",u?"Starting…":"Generate spec"]})})]}),s.jsxs("div",{className:"card pad",children:[s.jsxs("div",{className:"row",style:{marginBottom:12},children:[s.jsx(Ft,{agent:"specwriter",size:36}),s.jsxs("div",{children:[s.jsx("b",{children:"How it works"}),s.jsx("div",{className:"muted small",children:"QA Test Case Writer agent (Claude Code)"})]})]}),s.jsxs("ol",{className:"req-steps",children:[s.jsx("li",{children:"The requirement is saved with the job. The agent reads it, plus existing specs for style."}),s.jsxs("li",{children:["It writes ",s.jsxs("code",{children:["specs/",m||"<name>",".md"]})," with one ",s.jsx("code",{children:"## TC-…"})," per behaviour, designed with equivalence partitioning, boundary values, decision tables, state transitions and use cases, always adding edge and security cases."]}),s.jsxs("li",{children:["Each test case gets a test level tag (",s.jsx("b",{children:"IT"}),", ",s.jsx("b",{children:"ST"}),", ",s.jsx("b",{children:"SIT"}),", ",s.jsx("b",{children:"UAT"}),") plus type tags (smoke, negative, boundary, security…) and its design technique."]}),s.jsx("li",{children:"Its assumptions and open questions for the BA are listed in the job output."}),s.jsxs("li",{children:["Review the spec in the editor, then run ",s.jsx("b",{children:"Generate tests"}),"."]})]}),s.jsxs("p",{className:"muted small",style:{marginTop:14},children:["The agent can only write that spec file. It does not open a browser and does not invent credentials. Accounts come from ",s.jsx("code",{children:".env"})," when tests are generated."]})]})]})]})}function IL(){const e=ut(),[t,n]=j.useState("all"),r=Tl([t]),{data:i,error:l,reload:a}=$e(()=>V.jobsPage({page:r.page,pageSize:r.pageSize,type:t==="all"?void 0:t}),[r.page,r.pageSize,t]),[o,u]=j.useState(null),c=((i==null?void 0:i.items)??[]).some(d=>d.status==="queued"||d.status==="running");j.useEffect(()=>{if(!c)return;const d=setInterval(a,2e3);return()=>clearInterval(d)},[c,a]);const h=(i==null?void 0:i.items)??[];return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Testing"},{label:"Recent runs"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Recent runs"}),s.jsx("p",{className:"page-sub",children:"Explore, generate, run and heal jobs with their agent timeline."})]})}),s.jsxs("div",{className:"row between",style:{marginBottom:14},children:[s.jsx(un,{value:t,onChange:n,items:["all","testrun","generate","explore","heal","spec","context"].map(d=>({id:d,label:d==="all"?"All":Sr[d]}))}),s.jsx("div",{className:"row",children:s.jsxs("button",{className:"btn dark",onClick:()=>void V.createJob({type:"testrun",repeatEach:1}).then(d=>e(`/runs/${d.id}`)).catch(d=>u(d.message)),children:[s.jsx(ft,{size:14})," Run all tests"]})})]}),s.jsx(Le,{error:l??o}),s.jsxs("div",{className:"table-wrap",children:[s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Job"}),s.jsx("th",{children:"Agents"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Result"}),s.jsx("th",{children:"Started"}),s.jsx("th",{children:"Duration"})]})}),s.jsx("tbody",{children:h.map(d=>s.jsxs("tr",{onClick:()=>e(`/runs/${d.id}`),style:{cursor:"pointer"},children:[s.jsx("td",{children:s.jsxs("div",{className:"file-cell",children:[s.jsx("span",{className:"file-icon",children:s.jsx(ft,{size:14})}),s.jsxs("div",{children:[s.jsxs("div",{children:["#",d.id," ",Sr[d.type]]}),s.jsxs("div",{className:"sub",children:[d.args.name??d.target,d.args.tcId?` · ${d.args.tcId}`:"",d.args.repeatEach&&d.args.repeatEach>1?` · ${d.args.repeatEach}×`:""]})]})]})}),s.jsx("td",{children:s.jsx(qb,{agents:d.agents})}),s.jsxs("td",{children:[s.jsx(An,{status:d.status}),d.warning&&s.jsx("span",{title:d.warning,style:{color:"var(--warn)"},children:" ⚠"})]}),s.jsx("td",{className:"muted small",children:d.summary??"—"}),s.jsx("td",{className:"muted small",children:Rt(d.startedAt??d.createdAt)}),s.jsx("td",{className:"muted small",children:br(d.startedAt,d.finishedAt)})]},d.id))})]}),i&&h.length===0&&s.jsx("p",{className:"muted",style:{padding:16},children:"No jobs yet."}),i&&s.jsx(ms,{page:r.page,pageSize:r.pageSize,total:i.total,onPage:r.setPage,onPageSize:r.setPageSize,label:"jobs"})]})]})}function Hm(e){return e.replace(/\.md$/i,"").toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/đ/g,"d").replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+|-+$/g,"")||"spec"}function DL(e){const t=e.filter(r=>r.lastResult);if(!t.length)return null;const n=t.filter(r=>r.lastResult.status==="passed").length;return n===t.length?{status:"passed",label:`${n}/${t.length} passed`}:{status:"failed",label:`${t.length-n}/${t.length} failed`}}function zL(){const e=ut(),{openNewSpec:t}=fs(),{specs:n,mapping:r,refresh:i}=cn(),[l,a]=j.useState("all"),[o,u]=j.useState(""),[c,h]=j.useState(new Set),[d,f]=j.useState(!1),[m,p]=j.useState(null),g=j.useRef(null),w=j.useMemo(()=>n.map(R=>{const L=r.filter(U=>U.specFile===R.file&&U.status!=="orphan"),M=new Set(L.filter(U=>U.testFile).map(U=>U.tcId)).size;return{spec:R,mapped:M,total:R.parsed.tcs.length,last:DL(L)}}),[n,r]),y=R=>R.total>0&&R.mapped>=R.total,x=[...new Set(n.flatMap(R=>R.parsed.tags))].sort(),v=o.trim().toLowerCase(),b=w.filter(R=>(l==="all"||(l==="mapped"?y(R):!y(R)))&&(!v||`${R.spec.file} ${R.spec.parsed.title} ${R.spec.parsed.tags.join(" ")}`.toLowerCase().includes(v))&&(c.size===0||R.spec.parsed.tags.some(L=>c.has(L)))),A=Zh(b,[l,o,c]),k=w.reduce((R,L)=>R+L.total,0),E=w.reduce((R,L)=>R+Math.max(L.total-L.mapped,0),0),T=async R=>{const L=R.filter(U=>/\.md$/i.test(U.name));if(!L.length)return p("Only .md files are accepted");if(L.length===1){t({name:Hm(L[0].name),content:await L[0].text()});return}const M=[];for(const U of L)try{await V.createSpec(`${Hm(U.name)}.md`,await U.text())}catch(D){M.push(`${U.name}: ${D.message}`)}i(),p(M.length?M.join(`
408
+ `):null)},I=R=>{T([...R.target.files??[]]),R.target.value=""},C=R=>void V.createJob({type:"testrun",spec:R,repeatEach:1}).then(L=>e(`/runs/${L.id}`)).catch(L=>p(L.message));return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Specification"},{label:"Specs"}]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Specs"}),s.jsx("p",{className:"page-sub",children:"Markdown specs and the test cases mapped to Playwright scripts."})]}),s.jsxs("div",{className:"row",children:[s.jsxs("button",{className:"btn ghost",onClick:()=>{var R;return(R=g.current)==null?void 0:R.click()},children:[s.jsx(Ao,{size:15})," Import .md"]}),s.jsx("input",{ref:g,type:"file",accept:".md,text/markdown",multiple:!0,hidden:!0,onChange:I}),s.jsxs(ye,{className:"btn ghost",to:"/specs/from-requirement",title:"QA Test Case Writer agent drafts the spec from a BA requirement",children:[s.jsx(hl,{size:15})," Generator"]}),s.jsxs("button",{className:"btn",onClick:()=>t(),children:[s.jsx(qt,{size:15})," New spec"]})]})]}),s.jsx(Le,{error:m}),s.jsxs("div",{className:"toolbar",children:[s.jsx(un,{value:l,onChange:a,items:[{id:"all",label:s.jsxs(s.Fragment,{children:["All ",s.jsx("span",{className:"tab-count",children:w.length})]})},{id:"mapped",label:s.jsxs(s.Fragment,{children:["Mapped ",s.jsx("span",{className:"tab-count",children:w.filter(y).length})]})},{id:"needs",label:s.jsxs(s.Fragment,{children:["Needs mapping ",s.jsx("span",{className:"tab-count",children:w.filter(R=>!y(R)).length})]})}]}),s.jsx("div",{className:"grow"}),s.jsxs("label",{className:"search-input",children:[s.jsx(Ro,{size:15}),s.jsx("input",{value:o,onChange:R=>u(R.target.value),placeholder:"Search by file, title or tag","aria-label":"Search specs"})]}),s.jsxs("div",{className:"menu-wrap",children:[s.jsxs("button",{className:`btn ghost ${c.size?"on":""}`,onClick:()=>f(R=>!R),"aria-expanded":d,children:[s.jsx(jb,{size:15})," Tags",c.size?` (${c.size})`:""]}),d&&s.jsxs("div",{className:"menu",onMouseLeave:()=>f(!1),children:[x.length===0&&s.jsx("div",{className:"muted small pad-sm",children:"No tags yet"}),x.map(R=>s.jsxs("label",{className:"menu-item",children:[s.jsx("input",{type:"checkbox",className:"check-box",checked:c.has(R),onChange:()=>h(L=>{const M=new Set(L);return M.has(R)?M.delete(R):M.add(R),M})}),R]},R)),c.size>0&&s.jsx("button",{className:"btn ghost sm",style:{margin:6},onClick:()=>h(new Set),children:"Clear"})]})]})]}),s.jsxs("div",{className:"table-wrap table-fit",children:[s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Spec"}),s.jsx("th",{children:"Tags"}),s.jsx("th",{className:"num",children:"Test cases"}),s.jsx("th",{children:"Coverage"}),s.jsx("th",{children:"Last result"}),s.jsx("th",{className:"num",children:"Actions"})]})}),s.jsx("tbody",{children:A.pageItems.map(({spec:R,mapped:L,total:M,last:U})=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsxs(ye,{to:`/specs/${R.file}`,className:"file-cell",children:[s.jsx("span",{className:"file-icon",children:s.jsx(qn,{size:16})}),s.jsxs("div",{children:[s.jsx("div",{className:"strong",children:R.parsed.title||R.file}),s.jsxs("div",{className:"sub mono",children:[R.file,R.parsed.warnings.length>0&&s.jsxs("span",{style:{color:"var(--warn)"},children:[" · ⚠ ",R.parsed.warnings.length]})]})]})]})}),s.jsx("td",{children:R.parsed.tags.map(D=>s.jsx("span",{className:"tag",children:D},D))}),s.jsx("td",{className:"num",children:M}),s.jsx("td",{children:s.jsxs("div",{className:"cov",children:[s.jsx("span",{className:"progress",children:s.jsx("i",{style:{width:`${M?L/M*100:0}%`}})}),s.jsxs("span",{className:"small",children:[L,"/",M]})]})}),s.jsx("td",{children:U?s.jsx(ri,{status:U.status,children:U.label}):s.jsx(ri,{status:null})}),s.jsx("td",{className:"num",children:s.jsxs("div",{className:"row",style:{justifyContent:"flex-end",flexWrap:"nowrap",gap:6},children:[s.jsx(ye,{to:`/specs/${R.file}`,className:"btn ghost sm",children:"Open"}),s.jsx("button",{className:"btn ghost sm icon",onClick:()=>C(R.file),disabled:L===0,title:L?`Run ${R.file}`:"Spec has no test file yet","aria-label":`Run ${R.file}`,children:s.jsx(ft,{size:12})})]})})]},R.file))})]}),b.length===0&&s.jsx("p",{className:"muted pad",children:w.length?"No specs match the filter.":"No specs yet."}),b.length>0&&s.jsx(ms,{...A.props,label:"specs"}),s.jsxs("div",{className:"table-foot",children:[s.jsxs("span",{children:[w.length," specs · ",k," test cases"]}),s.jsx("span",{children:E?`${E} test cases need mapping`:"All test cases mapped"})]})]})]})}function ML({value:e,onChange:t}){const n=j.useRef(null),r=e.split(`
409
+ `).length;return s.jsxs("div",{className:"line-editor",children:[s.jsx("div",{className:"gutter",ref:n,"aria-hidden":"true",children:Array.from({length:r},(i,l)=>s.jsx("div",{children:l+1},l))}),s.jsx("textarea",{value:e,onChange:i=>t(i.target.value),onScroll:i=>{n.current&&(n.current.scrollTop=i.currentTarget.scrollTop)},spellCheck:!1,wrap:"off","aria-label":"Spec content (markdown)"})]})}const xj=/^(given|when|then|and|but)\b[: ]?\s*(.*)$/i,$L=/^\s*(tags|technique)\s*:/i;function _L(e){let t="given";return e.map(n=>{const r=n.trim().match(xj),i=r[1].toLowerCase(),l=i==="and"||i==="but";return l||(t=i),{keyword:r[1][0].toUpperCase()+r[1].slice(1).toLowerCase(),kw:t,continuation:l,text:r[2].trim()}})}function OL({text:e}){return s.jsx(zr,{components:{p:({children:t})=>s.jsx(s.Fragment,{children:t})},children:e})}function FL({lines:e}){return s.jsx("ol",{className:"gherkin-steps",children:_L(e).map((t,n)=>s.jsxs("li",{className:`gherkin-step kw-${t.kw}${t.continuation?" continuation":""}`,children:[s.jsx("span",{className:"gherkin-kw",children:t.keyword})," ",s.jsx("span",{className:"gherkin-text",children:s.jsx(OL,{text:t.text})})]},n))})}function UL(e){const t=[];for(const n of e.split(/\r?\n/)){if($L.test(n))continue;const r=xj.test(n.trim()),i=t[t.length-1];i&&i.gherkin===r?i.lines.push(n):t.push({gherkin:r,lines:[n]})}return t}function BL({text:e}){return s.jsx(s.Fragment,{children:UL(e).map((t,n)=>{if(t.gherkin)return s.jsx(FL,{lines:t.lines},n);const r=t.lines.join(`
410
+ `).trim();return r?s.jsx("div",{className:"md",children:s.jsx(zr,{children:r})},n):null})})}function HL({content:e,parsed:t}){var l;const n=e.split(/\r?\n/),r=((l=t.tcs[0])==null?void 0:l.line)??n.length+1,i=n.slice(0,r-1).filter(a=>!/^\s*#\s+/.test(a)&&!/^\s*(tags|preconditions)\s*:/i.test(a)).join(`
411
+ `).trim();return s.jsxs("div",{className:"spec-preview",children:[s.jsx("h2",{children:t.title||"Untitled spec"}),(t.tags.length>0||t.preconditions)&&s.jsxs("p",{className:"meta",children:[t.tags.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"Tags:"})," ",t.tags.join(", ")]}),t.tags.length>0&&t.preconditions&&" · ",t.preconditions&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"Preconditions:"})," ",t.preconditions]})]}),i&&s.jsx("div",{className:"md",children:s.jsx(zr,{children:i})}),t.tcs.map((a,o)=>{var h;const u=((h=t.tcs[o+1])==null?void 0:h.line)??n.length+1,c=n.slice(a.line,u-1).join(`
412
+ `).trim();return s.jsxs("div",{className:"tc-card",children:[s.jsxs("div",{className:"tc-card-head",children:[s.jsx("span",{className:"tc-chip",children:a.id}),s.jsx("b",{children:a.title}),a.tags.map(d=>s.jsx("span",{className:"tag",children:d},d)),a.technique&&s.jsxs("span",{className:"muted small",children:["Technique: ",a.technique]})]}),c&&s.jsx(BL,{text:c})]},`${a.id}-${o}`)})]})}function WL(){const{file:e=""}=ai(),t=ut(),{refresh:n,mapping:r}=cn(),i=In(),l=Ir(),[a,o]=j.useState(""),[u,c]=j.useState(""),[h,d]=j.useState(),[f,m]=j.useState(!1),[p,g]=j.useState(null),[w,y]=j.useState(null),[x,v]=j.useState(!1),[b,A]=j.useState(1),[k,E]=j.useState("split"),T=j.useRef(!1),I=$e(()=>V.jobs(),[e]),C=f&&a!==u,R=j.useMemo(()=>Nb(a),[a]),L=r.filter(F=>F.specFile===e&&F.status!=="orphan"),M=new Set(L.filter(F=>F.testFile).map(F=>F.tcId)),U=L.filter(F=>F.lastResult),D=U.filter(F=>F.lastResult.status==="passed").length,q=(I.data??[]).filter(F=>F.target===e).slice(0,5),J=j.useCallback(async()=>{try{const F=await V.spec(e);o(F.content),c(F.content),d(F.mtimeMs),m(!0),g(null)}catch(F){g(F.message)}},[e]);j.useEffect(()=>{m(!1),T.current=!1,J()},[J]);const B=yh(({currentLocation:F,nextLocation:Z})=>C&&!T.current&&F.pathname!==Z.pathname);Rh(B,{title:"Leave with unsaved changes?",message:"Your edits to this spec are not saved and will be lost.",confirmLabel:"Discard changes",danger:!0}),j.useEffect(()=>{const F=Z=>{C&&Z.preventDefault()};return window.addEventListener("beforeunload",F),()=>window.removeEventListener("beforeunload",F)},[C]);const X=j.useCallback(async(F=!1)=>{v(!0),y(null);try{const Z=await V.saveSpec(e,a,F?void 0:h);return c(a),d(Z.mtimeMs),g(null),y("Saved."),n(),!0}catch(Z){return Z instanceof eo&&Z.status===409&&await i({title:"Spec changed on disk",message:`${Z.message} Overwrite it with your current edits?`,confirmLabel:"Overwrite",danger:!0})?(v(!1),X(!0)):(g(Z.message),!1)}finally{v(!1)}},[a,e,h,n,i]);j.useEffect(()=>{const F=Z=>{(Z.ctrlKey||Z.metaKey)&&Z.key.toLowerCase()==="s"&&(Z.preventDefault(),C&&X())};return window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)},[C,X]);const S=async F=>{if(!(C&&!await X()))try{const Z=await V.createJob(F);T.current=!0,t(`/runs/${Z.id}`)}catch(Z){g(Z.message)}},ae=async()=>{if(await i({title:`Delete ${e}?`,message:"The spec file is removed. Its test file in tests/e2e (if any) is NOT deleted. This cannot be undone.",confirmLabel:"Delete spec",danger:!0}))try{await V.deleteSpec(e),T.current=!0,n(),l.success(`Deleted ${e}`),t("/specs")}catch(Z){g(Z.message)}},O=R.tcs.length===0,N=Zh(R.tcs,[e]);return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Specification"},{label:"Specs",to:"/specs"},{label:e}]}),s.jsxs(mS,{children:[s.jsxs("span",{className:"chip",children:["Coverage ",M.size,"/",R.tcs.length]}),s.jsxs("span",{className:`chip ${D<U.length?"fail":"ok"}`,children:["Pass rate ",D,"/",U.length]})]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{className:"row",style:{alignItems:"flex-start",flexWrap:"nowrap"},children:[s.jsx("button",{className:"btn ghost icon square",onClick:()=>t("/specs"),"aria-label":"Back to specs list",title:"Back to Specs",children:s.jsx(yb,{size:16})}),s.jsxs("div",{children:[s.jsxs("h1",{className:"page-title",children:[R.title||e," ",C&&s.jsx("span",{className:"badge stale",children:"unsaved"})]}),s.jsxs("p",{className:"page-sub row",style:{gap:6},children:[s.jsx("span",{className:"mono",children:e}),R.tags.map(F=>s.jsxs("span",{children:["· ",s.jsx("span",{className:"tag",children:F})]},F))]})]})]}),s.jsxs("div",{className:"row",children:[s.jsxs("button",{className:"btn ghost",onClick:()=>void X(),disabled:!C||x,title:"Ctrl+S",children:[s.jsx(ds,{size:15})," Save"]}),s.jsx("button",{className:"btn ghost icon square",onClick:()=>void(async()=>{C&&!await i({title:"Discard unsaved changes?",message:"Reloading replaces your edits with the file on disk.",confirmLabel:"Discard & reload",danger:!0})||await J()})(),disabled:x,title:"Reload from disk","aria-label":"Reload from disk",children:s.jsx(Jn,{size:15})}),s.jsx("button",{className:"btn danger icon square",onClick:()=>void ae(),disabled:x,title:"Delete spec","aria-label":"Delete spec",children:s.jsx(Ar,{size:15})})]})]}),s.jsxs("div",{className:"pipeline-bar",children:[s.jsxs("div",{className:"pipeline-steps",title:"Runs with Claude Code, no API key needed",children:[s.jsx("b",{children:"Pipeline"}),s.jsx("span",{className:"step",children:Ne.explorer.label}),"→",s.jsx("span",{className:"step",children:Ne.generator.label}),"→",s.jsx("span",{className:"step",children:Ne.validator.label}),"→",s.jsxs("span",{className:"step",children:[Ne.healer.label," ≤ 2"]})]}),s.jsx("div",{className:"grow"}),s.jsxs("button",{className:"btn ghost",onClick:()=>void S({type:"explore",spec:e}),disabled:x||O,children:[s.jsx(zy,{size:15})," Explore"]}),s.jsxs("button",{className:"btn",onClick:()=>void S({type:"generate",spec:e}),disabled:x||O,children:[s.jsx(Lo,{size:15})," Generate"]}),s.jsx("select",{className:"select",value:b,onChange:F=>A(Number(F.target.value)),"aria-label":"Repeat count",children:[1,2,3,5,10].map(F=>s.jsxs("option",{value:F,children:[F,"×"]},F))}),s.jsxs("button",{className:"btn dark",onClick:()=>void S({type:"testrun",spec:e,repeatEach:b}),disabled:x||M.size===0,title:M.size?"":"Spec has no test file yet",children:[s.jsx(ft,{size:13})," Run"]})]}),s.jsx(Le,{error:p}),w&&s.jsx("div",{className:"info-box",children:w}),f&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Spec content"}),s.jsx(un,{value:k,onChange:E,items:[{id:"editor",label:"Editor"},{id:"split",label:"Split"},{id:"preview",label:"Preview"}]})]}),s.jsxs("div",{className:`spec-body ${k}`,children:[k!=="preview"&&s.jsx(ML,{value:a,onChange:o}),k!=="editor"&&s.jsx(HL,{content:a,parsed:R})]})]}),R.warnings.map(F=>s.jsxs("div",{className:"warn-box",children:["⚠ ",F]},F)),s.jsxs("div",{className:"card",style:{marginTop:18},children:[s.jsx("div",{className:"card-head",children:s.jsxs("h3",{children:["Test cases ",s.jsxs("span",{className:"muted",children:["(",R.tcs.length,")"]})]})}),s.jsxs("table",{className:"flat",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"TC-ID"}),s.jsx("th",{children:"Name"}),s.jsx("th",{children:"Mapping"}),s.jsx("th",{children:"Last result"}),s.jsx("th",{className:"num",children:"Actions"})]})}),s.jsx("tbody",{children:N.pageItems.map(F=>{const Z=L.find(Te=>Te.tcId===F.id),ce=Z==null?void 0:Z.lastResult;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("code",{className:"strong",children:F.id})}),s.jsx("td",{children:F.title}),s.jsx("td",{children:Z!=null&&Z.testFile?s.jsxs("span",{className:"map-link",title:`${Z.testFile}:${Z.testLine??""}`,children:[s.jsx(wh,{size:13}),s.jsx("code",{children:Z.testFile.split("/").pop()}),Z.status==="stale"&&s.jsx(yt,{status:"stale"})]}):s.jsx(yt,{status:(Z==null?void 0:Z.status)??"missing"})}),s.jsx("td",{children:ce?s.jsx(ye,{to:`/runs/${ce.jobId}`,children:s.jsx(ri,{status:ce.status,children:ce.status.charAt(0).toUpperCase()+ce.status.slice(1)})}):s.jsx(ri,{status:null})}),s.jsx("td",{className:"num",children:s.jsxs("div",{className:"tc-actions",children:[s.jsx("button",{className:"btn ghost icon tc-action gen",disabled:x,title:M.has(F.id)?`Regenerate the test of ${F.id} only (Explorer → Generator → Validator)`:`Generate a test for ${F.id} only (Explorer → Generator → Validator)`,"aria-label":`Generate ${F.id}`,onClick:()=>void S({type:"generate",spec:e,tcId:F.id}),children:s.jsx(pb,{size:16})}),s.jsx("button",{className:"btn ghost icon tc-action run",disabled:!M.has(F.id)||x,title:M.has(F.id)?`Run ${F.id}`:"TC has no test yet, run Generate","aria-label":`Run ${F.id}`,onClick:()=>void S({type:"testrun",spec:e,tcId:F.id,repeatEach:b}),children:s.jsx(fb,{size:14})})]})})]},`${F.id}-${F.line}`)})})]}),O&&s.jsx("p",{className:"muted pad",children:"No test cases yet. Add a heading like “## TC-XXX-001: Name”."}),!O&&s.jsx(ms,{...N.props,label:"test cases"})]}),q.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"Recent jobs for this spec"}),s.jsx("div",{className:"row",children:q.map(F=>s.jsxs(ye,{to:`/runs/${F.id}`,className:"card pad row",style:{padding:"8px 12px"},children:["#",F.id," ",F.type," ",s.jsx(An,{status:F.status})]},F.id))})]})]})]})}const VL={settings:"path set below",env:"QA_STUDIO_CLAUDE_BIN",path:"found on PATH"};function Uu({label:e,check:t,pending:n}){const r=t?t.ok?"ok":"fail":"pending";return s.jsxs("div",{className:`cc-row ${r}`,children:[s.jsx("span",{className:"cc-mark","aria-hidden":"true",children:r==="ok"?s.jsx(kh,{size:13}):r==="fail"?s.jsx(kr,{size:13}):"?"}),s.jsx("span",{className:"cc-label",children:e}),s.jsx("span",{className:"cc-detail",children:t?t.detail:n})]})}function QL({status:e}){const t=e.binary.ok?e.version.ok?e.test&&!e.test.ok?e.test.hint:null:"version":"path";return!t&&e.state!=="unverified"?null:s.jsxs("div",{className:"cc-guide",children:[t==="path"&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"Install Claude Code, or tell Agent Studio where it is"}),s.jsxs("ol",{children:[s.jsxs("li",{children:["Install it: in PowerShell ",s.jsx("code",{children:"irm https://claude.ai/install.ps1 | iex"}),", or with Node.js ",s.jsx("code",{children:"npm install -g @anthropic-ai/claude-code"}),"."]}),s.jsxs("li",{children:["Open a new terminal and check: ",s.jsx("code",{children:"claude --version"}),"."]}),s.jsxs("li",{children:["If Agent Studio still cannot find it, paste the full path of ",s.jsx("code",{children:"claude.exe"})," below (find it with ",s.jsx("code",{children:"where.exe claude"}),"; for an npm install use the"," ",s.jsx("code",{children:"claude.exe"})," inside ",s.jsx("code",{children:"node_modules\\@anthropic-ai\\claude-code\\bin"}),", not ",s.jsx("code",{children:"claude.cmd"}),")."]})]})]}),t==="version"&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"The binary was found but does not start"}),s.jsxs("ol",{children:[s.jsxs("li",{children:["Run ",s.jsxs("code",{children:[e.binary.detail," --version"]})," in a terminal to see the error."]}),s.jsx("li",{children:"Reinstall or update Claude Code, or point the path below to a working claude.exe."})]})]}),t==="login"&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"Log Claude Code in"}),s.jsxs("ol",{children:[s.jsxs("li",{children:["In a terminal run ",s.jsx("code",{children:"claude"}),", type ",s.jsx("code",{children:"/login"})," and sign in with your Claude account (or a Console API key)."]}),s.jsxs("li",{children:["Using an API key instead: set ",s.jsx("code",{children:"ANTHROPIC_API_KEY"})," in the environment that starts Agent Studio (not only in ",s.jsx("code",{children:".env"}),"), then restart Agent Studio."]}),s.jsx("li",{children:"Come back and run the test prompt again."})]})]}),t==="network"&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"Claude Code did not answer"}),s.jsxs("ol",{children:[s.jsx("li",{children:"Check the internet connection, proxy or VPN of this machine."}),s.jsxs("li",{children:["Run ",s.jsx("code",{children:'claude -p "hi"'})," in a terminal to see the error, then test again."]})]})]}),t==="other"&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"Claude Code returned an error"}),s.jsxs("ol",{children:[s.jsxs("li",{children:["Run ",s.jsx("code",{children:'claude -p "hi"'})," in a terminal from the repo folder to see the full message."]}),s.jsxs("li",{children:["Check usage limits with ",s.jsx("code",{children:"/usage"})," in Claude Code, then test again."]})]})]}),!t&&e.state==="unverified"&&s.jsxs("span",{children:["Claude Code is installed. Run the ",s.jsx("b",{children:"test prompt"})," once to confirm it is logged in and can answer (one short request on the smallest model; on a subscription it only counts toward usage limits)."]})]})}function qL({onChange:e}){const[t,n]=j.useState(null),[r,i]=j.useState(!1),[l,a]=j.useState(!1),[o,u]=j.useState(""),[c,h]=j.useState(null),d=async()=>{i(!0);try{const g=await V.claudeStatus();n(g),u(w=>w||g.configuredPath),h(null),e==null||e()}catch(g){h(g.message)}finally{i(!1)}};j.useEffect(()=>{d()},[]);const f=async()=>{a(!0);try{await V.claudeTest(),await d()}catch(g){h(g.message)}finally{a(!1)}},m=async g=>{try{await V.saveSettings({claudeBin:g}),u(g),h(null),await d()}catch(w){h(w.message)}},p=(t==null?void 0:t.state)==="ready"?"Ready":(t==null?void 0:t.state)==="unverified"?"Installed, not verified":t?"Not ready":"Checking…";return s.jsxs("div",{className:"pad cc",children:[s.jsxs("div",{className:"row between",children:[s.jsxs("div",{children:[s.jsx("b",{children:"Claude Code"})," ",s.jsxs("span",{className:`cc-state ${(t==null?void 0:t.state)??"pending"}`,children:[s.jsx("i",{})," ",p]}),s.jsx("div",{className:"muted small",children:"The QA Explorer, QA Script Generator, QA Script Healer, QA Test Case Writer and Context Writer run through headless Claude Code (claude.exe)."})]}),s.jsxs("span",{className:"row",children:[s.jsxs("button",{className:"btn ghost sm",onClick:()=>void d(),disabled:r||l,children:[s.jsx(Jn,{size:13})," ",r?"Checking…":"Check again"]}),s.jsx("button",{className:"btn sm",onClick:()=>void f(),disabled:l||!(t!=null&&t.binary.ok)||!(t!=null&&t.version.ok),title:"Sends one short prompt through Claude Code",children:l?"Testing… (up to 2 min)":"Run test prompt"})]})]}),s.jsx(Le,{error:c}),t&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"cc-checks",children:[s.jsx(Uu,{label:"Binary",check:t.binary}),s.jsx(Uu,{label:"Starts",check:t.version}),s.jsx(Uu,{label:"Logged in & answers",check:t.test?{ok:t.test.ok,detail:`${t.test.message} · ${Rt(t.test.at)}${t.test.model?` · ${t.test.model}`:""}${t.test.costUsd!==null?` · ${Kt(t.test.costUsd)}`:""}`}:null,pending:"Not tested yet for this binary"})]}),t.source&&s.jsxs("div",{className:"muted small",children:["Using ",VL[t.source],"."]}),s.jsx(QL,{status:t})]}),s.jsxs("div",{className:"cc-path",children:[s.jsxs("label",{htmlFor:"claude-bin",className:"small",style:{fontWeight:600},children:["Path to claude.exe ",s.jsx("span",{className:"muted",style:{fontWeight:400},children:"(leave empty to use QA_STUDIO_CLAUDE_BIN or PATH)"})]}),s.jsxs("div",{className:"row",children:[s.jsx("input",{id:"claude-bin",className:"input grow mono",placeholder:"C:\\Users\\<you>\\.local\\bin\\claude.exe",value:o,onChange:g=>u(g.target.value)}),s.jsxs("button",{className:"btn ghost sm",onClick:()=>void m(o),disabled:o===((t==null?void 0:t.configuredPath)??""),children:[s.jsx(ds,{size:13})," Save path"]}),(t==null?void 0:t.configuredPath)&&s.jsx("button",{className:"btn ghost sm",onClick:()=>void m(""),children:"Use automatic"})]})]})]})}function GL(){const{data:e,error:t,reload:n}=$e(()=>V.settings()),[r,i]=j.useState(null),[l,a]=j.useState(null),[o,u]=j.useState(!1);j.useEffect(()=>{e&&i(e.settings.maxHealRounds)},[e]);const c=e==null?void 0:e.settings.maxHealRounds,h=r!==null&&r!==c,d=async()=>{if(r!==null)try{await V.saveSettings({maxHealRounds:r}),a(null),u(!0),setTimeout(()=>u(!1),2e3),n()}catch(f){a(f.message)}};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"setting-row",children:[s.jsxs("div",{children:[s.jsx("b",{children:"Maximum heal rounds"}),s.jsxs("div",{className:"muted small",children:["QA Validator fails → QA Script Healer fixes → back to QA Validator. The loop stops when tests pass, the QA Script Healer reports an app bug or gives up, or after this many heal rounds (prevents an infinite loop). 0 turns the QA Script Healer off. Default ",(e==null?void 0:e.defaults.maxHealRounds)??2,". Applies to jobs queued after saving."]}),s.jsx(Le,{error:t??l})]}),s.jsxs("span",{className:"row",children:[s.jsx("input",{className:"input",type:"number",min:0,max:Op,step:1,style:{width:80},value:r??"",onChange:f=>i(f.target.value===""?null:Math.max(0,Math.min(Op,Math.round(Number(f.target.value))))),"aria-label":"Maximum heal rounds"}),s.jsxs("button",{className:"btn",disabled:!h,onClick:()=>void d(),children:[s.jsx(ds,{size:14})," ",o?"Saved":"Save"]})]})]}),s.jsxs("div",{className:"setting-row",children:[s.jsxs("div",{children:[s.jsx("b",{children:"Playwright HTML report"}),s.jsx("div",{className:"muted small",children:"Default for new test runs. The line reporter is always on; when this is on, runs also write the HTML report (traces, screenshots), which opens from the run page. Each run can override it."})]}),s.jsxs("label",{className:"switch",children:[s.jsx("input",{type:"checkbox",checked:(e==null?void 0:e.settings.htmlReport)??!0,disabled:!e,onChange:f=>void V.saveSettings({htmlReport:f.target.checked}).then(n,m=>a(m.message))}),s.jsx("span",{children:e!=null&&e.settings.htmlReport?"On":"Off"})]})]})]})}function KL(){const{theme:e,toggleTheme:t,refreshClaude:n}=fs();return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"General"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Settings"}),s.jsx("p",{className:"page-sub",children:"Pipeline settings are saved in Agent Studio; appearance is stored in this browser."})]})}),s.jsxs("div",{className:"card",style:{marginBottom:12},id:"claude",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"LLM runtime"})}),s.jsx(qL,{onChange:n})]}),s.jsxs("div",{className:"settings-grid",children:[s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"Pipeline"})}),s.jsx(GL,{})]}),s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"Appearance"})}),s.jsxs("div",{className:"setting-row",children:[s.jsxs("div",{children:[s.jsx("b",{children:"Theme"}),s.jsx("div",{className:"muted small",children:"Light or dark theme."})]}),s.jsxs("button",{className:"btn ghost",onClick:t,children:[e==="dark"?s.jsx(_y,{size:15}):s.jsx($y,{size:15})," ",e==="dark"?"Dark":"Light"]})]}),s.jsxs("div",{className:"setting-row",children:[s.jsxs("div",{children:[s.jsx("b",{children:"Keyboard shortcuts"}),s.jsx("div",{className:"muted small",children:"Search / command palette, save spec."})]}),s.jsxs("span",{className:"row small",children:[s.jsx("span",{className:"kbd-light",children:"Ctrl K"}),s.jsx("span",{className:"kbd-light",children:"Ctrl S"})]})]})]})]})]})}function yj({title:e,onStart:t,onClose:n,specRequired:r,newSpec:i,promptOnly:l,specAgent:a}){var A,k,E;const o=ut(),u=$e(()=>V.specs()),[c,h]=j.useState(""),[d,f]=j.useState(""),[m,p]=j.useState(null),[g,w]=j.useState(!1);j.useEffect(()=>{const T=I=>I.key==="Escape"&&n();return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[n]);const y=async()=>{w(!0);try{let T=c.trim();i&&T&&!T.endsWith(".md")&&(T=`${T}.md`);const I=await t(T,d);o(`/runs/${I.id}`)}catch(T){p(T.message),w(!1)}},x=r?"Spec":"Spec (optional)",v=l?c?"Prompt (optional)":"Prompt":"Input (optional)",b=r?!!c.trim():l?!!c.trim()||!!d.trim():!0;return s.jsx("div",{className:"overlay",onClick:n,children:s.jsx("div",{className:"modal",role:"dialog","aria-modal":"true","aria-label":e,onClick:T=>T.stopPropagation(),children:s.jsxs("div",{className:"modal-body",style:{display:"grid",gap:12},children:[s.jsx("h3",{style:{margin:0},children:e}),s.jsx(Le,{error:m??u.error}),s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:x}),i?s.jsxs(s.Fragment,{children:[s.jsx("input",{className:"input",list:"run-dialog-specs",value:c,onChange:T=>h(T.target.value),placeholder:"new-spec.md"}),s.jsx("datalist",{id:"run-dialog-specs",children:(A=u.data)==null?void 0:A.map(T=>s.jsx("option",{value:T.file},T.file))})]}):s.jsxs("select",{className:"input",value:c,onChange:T=>h(T.target.value),children:[s.jsx("option",{value:"",children:r?"Select a spec…":l?"No spec (prompt only)":"No spec"}),(k=u.data)==null?void 0:k.map(T=>s.jsx("option",{value:T.file,children:T.file},T.file))]}),l&&a&&!c&&s.jsxs("span",{className:"muted small",children:["Without a spec, the pipeline stops at the ",((E=Ne[a])==null?void 0:E.label)??a,"."]})]}),s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:v}),s.jsx("textarea",{className:"input",rows:6,value:d,onChange:T=>f(T.target.value),placeholder:i?"The requirement to turn into the spec":"What should the agents do this time?"})]}),s.jsxs("span",{className:"row",style:{justifyContent:"flex-end"},children:[s.jsx("button",{className:"btn ghost",onClick:n,children:"Cancel"}),s.jsxs("button",{className:"btn",onClick:()=>void y(),disabled:g||!b,children:[s.jsx(ft,{size:14})," Start job"]})]})]})})})}const Bu=e=>{var t;return((t=e.steps[0])==null?void 0:t.kind)==="agent"&&e.steps[0].agent==="specwriter"},vj=Object.keys(Ne).filter(e=>e!=="custom"),Wm=vj.filter(e=>Ne[e].llm),Vm=vj.filter(e=>!Ne[e].llm),Qm=Object.keys(Io),YL=[{tone:"opus",label:"Opus"},{tone:"sonnet",label:"Sonnet"},{tone:"haiku",label:"Haiku"},{tone:"none",label:"No LLM"}];function jj(e){const t=e.replace(/^QA\s+/,"").split(/\s+/).filter(Boolean);return t.length>1?t.map(n=>n[0].toUpperCase()).join("").slice(0,2):(t[0]??e).slice(0,2)}function JL(){var x,v,b,A,k,E,T;const e=Ir(),t=In(),n=ut(),[r,i]=vh(),l=r.get("tab")==="custom"?"custom":"default",a=I=>i(I==="custom"?{tab:"custom"}:{},{replace:!0}),o=$e(()=>V.settings()),u=$e(()=>V.agentPrompts()),c=$e(()=>V.pipelines()),h=$e(()=>V.customAgents()),[d,f]=j.useState(null),m=((x=o.data)==null?void 0:x.settings.maxHealRounds)??null,p=I=>{var C;return(C=u.data)==null?void 0:C.find(R=>R.agent===I)},g=I=>{var R,L,M;const C=bl(I);return C?((L=(R=h.data)==null?void 0:R.find(U=>U.id===C))==null?void 0:L.model)??"none":Ne[I].llm?((M=p(I))==null?void 0:M.model)??"none":"none"},w=async I=>{if(await t({title:`Delete the pipeline "${I.name}"?`,message:"The pipeline is removed for everyone using this Agent Studio. This cannot be undone.",confirmLabel:"Delete pipeline",danger:!0}))try{await V.deletePipeline(I.id),e.success(`Pipeline "${I.name}" deleted`),c.reload()}catch(R){e.error(R.message)}},y=(v=c.data)==null?void 0:v.length;return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Agents"}]}),s.jsxs("div",{className:"page-head ap-page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Agents & pipelines"}),s.jsx("p",{className:"page-sub",children:"Agents are the building blocks. Pipelines chain them into jobs. All agents run through Claude Code; Playwright steps run without an LLM."})]}),s.jsxs("span",{className:"row",children:[s.jsxs(ye,{to:"/agents/custom/new",className:"btn ghost",children:[s.jsx(qt,{size:15})," New agent"]}),s.jsxs(ye,{to:"/agents/pipelines/new",className:"btn",children:[s.jsx(qt,{size:15})," New pipeline"]})]})]}),s.jsxs("div",{className:"card ap-card",children:[s.jsxs("div",{className:"ap-head",children:[s.jsxs("div",{className:"ap-head-title",children:[s.jsx("h3",{children:"Agents"}),s.jsxs("span",{className:"muted small",children:[Wm.length," Built-in agents · ",((b=h.data)==null?void 0:b.length)??0," custom · ",Vm.length," Playwright steps · click an agent to open its details"]})]}),s.jsx("span",{className:"ap-legend","aria-label":"Model colours",children:YL.map(I=>s.jsxs("span",{children:[s.jsx("i",{className:`tone-dot tone-${I.tone}`})," ",I.label]},I.tone))})]}),s.jsx(Le,{error:u.error}),s.jsx("div",{className:"ap-group-label",children:"Built-in agents"}),s.jsx("div",{className:"ap-grid",children:Wm.map(I=>s.jsx(qm,{agent:I,tone:g(I),info:p(I)},I))}),s.jsx("div",{className:"ap-group-label",children:"Custom agents"}),s.jsx(Le,{error:h.error}),((A=h.data)==null?void 0:A.length)===0&&s.jsxs("p",{className:"ap-note",children:["No custom agents yet. Click ",s.jsx("b",{children:"New agent"})," to create one."]}),!!((k=h.data)!=null&&k.length)&&s.jsx("div",{className:"ap-grid",children:h.data.map(I=>s.jsxs(ye,{to:`/agents/custom/${I.id}`,className:"ap-agent","aria-label":`${I.name}: ${I.description||"Custom agent"}`,children:[s.jsx("span",{className:`ap-avatar tone-${I.model}`,children:jj(I.name)}),s.jsxs("span",{className:"ap-agent-text",children:[s.jsxs("b",{children:[I.name,I.skills.length>0&&s.jsxs("span",{className:"ap-custom",title:`Skills: ${I.skills.join(", ")}`,children:[I.skills.length," skill",I.skills.length===1?"":"s"]})]}),s.jsx("span",{title:I.description,children:I.description||"Custom agent"})]}),s.jsx("span",{className:`ap-pill tone-${I.model}`,children:I.model[0].toUpperCase()+I.model.slice(1)}),s.jsx("span",{className:"ap-chevron","aria-hidden":"true",children:s.jsx(ni,{size:14})})]},I.id))}),s.jsx("div",{className:"ap-group-label",children:"Playwright steps · No LLM"}),s.jsx("div",{className:"ap-grid",children:Vm.map(I=>s.jsx(qm,{agent:I,tone:"none"},I))})]}),s.jsxs("div",{className:"card ap-card",children:[s.jsxs("div",{className:"ap-head",children:[s.jsx("div",{className:"ap-head-title",children:s.jsx("h3",{children:"Pipelines"})}),s.jsx(un,{value:l,onChange:a,items:[{id:"default",label:s.jsxs(s.Fragment,{children:["Default ",s.jsx("span",{className:"tab-count",children:Qm.length})]})},{id:"custom",label:s.jsxs(s.Fragment,{children:["Custom ",s.jsx("span",{className:"tab-count",children:y??"…"})]})}]})]}),l==="default"?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"ap-note",children:"Built-in job types. Duplicate one to start a custom pipeline. Loops repeat until the QA Validator passes or the round limit is reached."}),s.jsx("div",{className:"ap-rows",children:Qm.map(I=>s.jsxs("div",{className:"ap-row",children:[s.jsx("span",{className:"ap-row-name",children:Sr[I]}),s.jsx("span",{className:"ap-row-steps",children:s.jsx(XL,{type:I,maxRounds:m,toneOf:g})}),s.jsxs("span",{className:"ap-row-meta",children:[s.jsx(wb,{size:13})," Built-in"]}),s.jsx("span",{className:"ap-row-actions",children:s.jsx("button",{className:"btn ghost sm",onClick:()=>n(`/agents/pipelines/new?from=${I}`),"aria-label":`Duplicate ${Sr[I]}`,children:"Duplicate"})})]},I))})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"ap-note",children:"Your own pipelines. Each loop repeats its agents until the first one passes, or up to its maximum iterations."}),s.jsx(Le,{error:c.error}),((E=c.data)==null?void 0:E.length)===0&&s.jsxs("div",{className:"ap-empty",children:[s.jsx("p",{className:"muted",children:"No custom pipelines yet."}),s.jsxs(ye,{to:"/agents/pipelines/new",className:"btn sm",children:[s.jsx(qt,{size:14})," New pipeline"]})]}),s.jsx("div",{className:"ap-rows",children:(T=c.data)==null?void 0:T.map(I=>s.jsxs("div",{className:"ap-row",children:[s.jsxs("span",{className:"ap-row-name",children:[s.jsx(ye,{to:`/agents/pipelines/${I.id}`,children:I.name}),I.description&&s.jsx("span",{className:"muted small ap-row-desc",children:I.description})]}),s.jsx("span",{className:"ap-row-steps",children:s.jsx(ZL,{steps:I.steps,toneOf:g,custom:h.data??[]})}),s.jsx("span",{className:"ap-row-meta",title:`Updated ${Rt(I.updatedAt)}`,children:Rt(I.updatedAt)}),s.jsxs("span",{className:"ap-row-actions",children:[s.jsx("button",{className:"btn sm",onClick:()=>f(I),"aria-label":`Run pipeline ${I.name}`,children:"Run"}),s.jsx(ye,{to:`/agents/pipelines/${I.id}`,className:"btn ghost sm","aria-label":`Edit pipeline ${I.name}`,children:"Edit"}),s.jsx("button",{className:"btn danger sm icon",onClick:()=>void w(I),"aria-label":`Delete pipeline ${I.name}`,title:"Delete",children:s.jsx(Ar,{size:14})})]})]},I.id))})]})]}),d&&s.jsx(yj,{title:`Run ${d.name}`,specRequired:Bu(d),promptOnly:!Bu(d),specAgent:Ob(d.steps),newSpec:Bu(d),onClose:()=>f(null),onStart:(I,C)=>V.createJob({type:"pipeline",pipelineId:d.id,...I?{spec:I}:{},...C.trim()?{input:C}:{}})})]})}function qm({agent:e,tone:t,info:n}){const r=Ne[e],i=(n==null?void 0:n.customized)||(n==null?void 0:n.modelCustomized);return s.jsxs(ye,{to:`/agents/${e}`,className:`ap-agent ${r.llm?"":"step"}`,"aria-label":`${r.label}: ${r.description}`,children:[s.jsx("span",{className:`ap-avatar tone-${t}`,children:jj(r.label)}),s.jsxs("span",{className:"ap-agent-text",children:[s.jsxs("b",{children:[r.label,i&&s.jsx("span",{className:"ap-custom",title:n!=null&&n.customized?"Custom prompt":"Custom model",children:"custom"}),!!(n!=null&&n.skills.length)&&s.jsxs("span",{className:"ap-custom",title:`Skills: ${n.skills.join(", ")}`,children:[n.skills.length," skill",n.skills.length===1?"":"s"]})]}),s.jsx("span",{title:r.description,children:r.description})]}),s.jsx("span",{className:`ap-pill tone-${t}`,children:r.llm?n?n.model[0].toUpperCase()+n.model.slice(1):"…":"No LLM"}),s.jsx("span",{className:"ap-chevron","aria-hidden":"true",children:s.jsx(ni,{size:14})})]})}const dd=(e,t)=>{var n;return((n=t.find(r=>Ph(r.id)===e))==null?void 0:n.review)==="human"};function wj({agent:e,toneOf:t,custom:n}){const r=dd(e,n);return s.jsxs("span",{className:`ap-chip tone-${t(e)}`,title:r?"Human review":void 0,children:[Pl(e,n),r&&" 👤"]})}const hd=()=>s.jsx("span",{className:"ap-arrow",children:"→"});function XL({type:e,maxRounds:t,toneOf:n}){const r=Io[e],i=e==="generate"||e==="heal",l=i?r.filter(o=>!Eh.includes(o)):r,a=e==="heal"?["healer","validator"]:["validator","healer"];return s.jsxs(s.Fragment,{children:[l.map((o,u)=>s.jsxs(j.Fragment,{children:[u>0&&s.jsx(hd,{}),s.jsx(wj,{agent:o,toneOf:n,custom:[]})]},o)),i&&s.jsxs(s.Fragment,{children:[l.length>0&&s.jsx(hd,{}),s.jsx(tf,{agents:a,toneOf:n,custom:[],suffix:t===null?null:`max ${t} round${t===1?"":"s"}`,swap:!0})]})]})}function ZL({steps:e,toneOf:t,custom:n}){return s.jsx(s.Fragment,{children:e.map((r,i)=>s.jsxs(j.Fragment,{children:[i>0&&s.jsx(hd,{}),r.kind==="agent"?s.jsx(wj,{agent:r.agent,toneOf:t,custom:n}):s.jsx(tf,{agents:r.steps,toneOf:t,custom:n,suffix:`max ${r.maxIterations}×${r.endsWhen==="last"?" · until last passes":""}`,endsWhen:r.endsWhen})]},i))})}function tf({agents:e,toneOf:t,custom:n,suffix:r,swap:i,endsWhen:l}){return s.jsxs("span",{className:"ap-loop",title:`Repeats its agents; stops when the ${l==="last"?"last":"first"} one passes or the maximum is reached`,children:[s.jsx(as,{size:12}),e.map((a,o)=>s.jsxs(j.Fragment,{children:[o>0&&(i?s.jsx("span",{className:"ap-loop-sep",children:"⇄"}):s.jsx("span",{className:"ap-loop-sep",children:"→"})),typeof a=="string"?s.jsxs("span",{className:`ap-loop-name tone-${t(a)}`,title:dd(a,n)?"Human review":void 0,children:[Pl(a,n),dd(a,n)&&" 👤"]}):s.jsx(tf,{agents:a.steps,toneOf:t,custom:n,suffix:`max ${a.maxIterations}×${a.endsWhen==="last"?" · until last passes":""}`,endsWhen:a.endsWhen})]},o)),r&&s.jsx("span",{className:"ap-loop-max",children:r})]})}const eA={builtin:"built-in",project:"project",user:"user",synced:"claude.ai",plugin:"",other:""},Hu=60;function tA(e,t){var h,d;const n=((h=t.catalog)==null?void 0:h.pipelines)??[],r=e.match(/^\/p:([a-z0-9-]+) (\S*)$/i);if(r){const f=n.find(p=>p.name===r[1].toLowerCase());if(!(f!=null&&f.runnable)||!/^[<[]spec\.md[>\]]/.test(f.argumentHint))return[];const m=r[2].toLowerCase();return t.specs.filter(p=>p.toLowerCase().startsWith(m)).slice(0,Hu).map(p=>({insert:`/p:${f.name} ${p} `,label:p,hint:"",description:"",badge:"spec"}))}const i=e.match(/^\/p:([a-z0-9-]*)$/i);if(i)return ta(n,i[1]).slice(0,Hu).map(f=>({insert:`/p:${f.name} `,label:`/p:${f.name}`,hint:f.argumentHint,description:f.label===f.description||!f.description?f.label:`${f.label} — ${f.description}`,badge:f.builtin?"built-in":"custom"}));const l=e.match(/^\/(\S*)$/);if(!l)return[];const a=l[1],o=ta(t.local.map(f=>({name:f.cmd.slice(1),description:f.help,l:f})),a).map(({l:f})=>({insert:`${f.cmd} `,label:f.cmd,hint:f.args,description:f.help,badge:"Agent Studio"})),u=n.length?ta([{name:"p:",description:"Run an Agent Studio pipeline"}],a).map(()=>({insert:"/p:",label:"/p:<pipeline>",hint:"",description:"Run an Agent Studio pipeline",badge:"Agent Studio"})):[],c=ta(((d=t.catalog)==null?void 0:d.commands)??[],a).map(f=>({insert:`/${f.name} `,label:`/${f.name}`,hint:f.argumentHint,description:f.description,badge:f.source==="plugin"?f.name.split(":")[0]:eA[f.source]}));return[...o,...u,...c].slice(0,Hu)}const kj="qa-studio.chat.settings",Gm={model:"default",effort:"default",permissionMode:"acceptEdits"};function nA(){try{return{...Gm,...JSON.parse(localStorage.getItem(kj)??"{}")}}catch{return Gm}}function rA(e){try{localStorage.setItem(kj,JSON.stringify(e))}catch{}}const fd=e=>typeof e=="number"?`$${e<.01&&e>0?e.toFixed(3):e.toFixed(2)}`:"",sA=e=>typeof e=="number"?e<6e4?`${(e/1e3).toFixed(1)} s`:`${Math.floor(e/6e4)} min ${Math.round(e%6e4/1e3)} s`:"",iA=e=>e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(1)} MB`,uo=[{cmd:"/model",args:"<default|fable|opus|sonnet|haiku|full-id>",help:"Change the model"},{cmd:"/effort",args:`<${Jr.join("|")}>`,help:"Change the reasoning effort"},{cmd:"/mode",args:"<plan|acceptEdits|auto|bypassPermissions>",help:"Change the permission mode"},{cmd:"/new",args:"",help:"Start a new chat"},{cmd:"/help",args:"",help:"List the commands"}];function lA(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>t(String(r.result).replace(/^data:[^,]*,/,"")),r.onerror=()=>n(r.error??new Error("Could not read the file")),r.readAsDataURL(e)})}const bj=j.createContext(async()=>{}),aA={allowed:"Allowed",always:"Always allowed (saved to .claude/settings.local.json)",denied:"Denied",expired:"No longer waiting"};function oA({b:e}){const t=j.useContext(bj),[n,r]=j.useState(!1),i=a=>{r(!0),t(e.requestId,a).finally(()=>r(!1))},l=e.state==="pending";return s.jsxs("div",{className:`chat-perm ${e.state}`,role:l?"alertdialog":void 0,"aria-label":`Permission for ${e.toolName}`,children:[s.jsxs("div",{className:"chat-perm-head",children:[s.jsx("b",{children:l?`Allow Claude to use ${e.toolName}?`:e.toolName}),!l&&s.jsx("span",{className:`chat-perm-state ${e.state}`,children:aA[e.state]})]}),e.summary&&s.jsx("code",{className:"chat-perm-cmd",children:e.summary}),l&&e.reason&&s.jsx("div",{className:"muted small",children:e.reason}),e.input&&s.jsxs("details",{children:[s.jsx("summary",{className:"muted small",children:"Full input"}),s.jsx("pre",{children:e.input})]}),l&&s.jsxs("div",{className:"row chat-perm-actions",children:[s.jsx("button",{className:"btn sm",disabled:n,onClick:()=>i("allow"),autoFocus:!0,children:"Allow"}),e.canRemember&&s.jsx("button",{className:"btn ghost sm",disabled:n,onClick:()=>i("always"),title:"Allow now and don't ask again for this in this project (.claude/settings.local.json)",children:"Always allow"}),s.jsx("button",{className:"btn ghost sm chat-perm-deny",disabled:n,onClick:()=>i("deny"),children:"Deny"})]})]})}const uA=[dj],cA={table:({node:e,...t})=>s.jsx("div",{className:"chat-table-wrap",children:s.jsx("table",{...t})}),a:({node:e,...t})=>s.jsx("a",{...t,target:"_blank",rel:"noreferrer"})};function dA({b:e}){const t=e.done?e.isError?"error":"ok":"running";return s.jsxs("details",{className:`chat-tool ${t}`,children:[s.jsxs("summary",{children:[s.jsx("span",{className:"chat-tool-state",children:t==="running"?s.jsx("span",{className:"chat-spinner"}):t==="error"?s.jsx(kr,{size:12}):s.jsx(kh,{size:12})}),s.jsx("b",{children:e.name}),e.summary&&s.jsx("code",{className:"chat-tool-sum",children:e.summary})]}),e.input&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"chat-tool-label",children:"Input"}),s.jsx("pre",{children:e.input})]}),e.result!==void 0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"chat-tool-label",children:e.isError?"Error":"Result"}),s.jsx("pre",{children:e.result||"(empty)"})]})]})}function hA({b:e}){switch(e.kind){case"text":return s.jsx("div",{className:"chat-md",children:s.jsx(zr,{remarkPlugins:uA,components:cA,children:e.text})});case"thinking":return s.jsxs("details",{className:"chat-thinking",children:[s.jsx("summary",{children:"Thinking"}),s.jsx("div",{className:"chat-thinking-body",children:e.text})]});case"tool":return s.jsx(dA,{b:e});case"permission":return s.jsx(oA,{b:e});case"error":return s.jsx("div",{className:"error-box chat-error",role:"alert",children:e.text});case"notice":return s.jsx("div",{className:"chat-notice",children:e.text});case"job":return s.jsxs("div",{className:"chat-job",children:[s.jsxs("span",{children:["Started ",s.jsx("strong",{children:e.pipeline})," · ",s.jsx("code",{children:e.target})]}),s.jsxs(ye,{className:"btn ghost",to:`/runs/${e.jobId}`,children:["Open job #",e.jobId]})]})}}function Sj({a:e,onRemove:t}){return s.jsxs("span",{className:"chat-att",title:e.path,children:[s.jsx(By,{size:12}),s.jsx("span",{className:"chat-att-name",children:e.name}),s.jsx("span",{className:"muted",children:iA(e.size)}),t&&s.jsx("button",{type:"button",className:"chat-att-x",onClick:t,"aria-label":`Remove ${e.name}`,children:s.jsx(kr,{size:11})})]})}function fA({m:e}){var n;if(e.role==="user"){const r=e.blocks.find(i=>i.kind==="text");return s.jsxs("div",{className:"chat-msg user",children:[s.jsxs("div",{className:"chat-bubble",children:[r&&r.kind==="text"&&s.jsx("div",{className:"chat-user-text",children:r.text}),!!((n=e.attachments)!=null&&n.length)&&s.jsx("div",{className:"chat-atts",children:e.attachments.map(i=>s.jsx(Sj,{a:i},i.id))})]}),e.settings&&s.jsxs("div",{className:"chat-meta",children:[e.settings.model," · effort ",e.settings.effort," · ",e.settings.permissionMode]})]})}const t=[e.model,fd(e.costUsd),sA(e.durationMs),e.turns?`${e.turns} turn${e.turns>1?"s":""}`:""].filter(Boolean);return s.jsxs("div",{className:"chat-msg assistant",children:[s.jsx("span",{className:"chat-avatar","aria-hidden":"true",children:s.jsx(Ch,{size:15})}),s.jsxs("div",{className:"chat-body",children:[e.blocks.map((r,i)=>s.jsx(hA,{b:r},i)),e.pending&&s.jsxs("div",{className:"chat-typing","aria-label":"Claude is working",children:[s.jsx("i",{}),s.jsx("i",{}),s.jsx("i",{})]}),!e.pending&&t.length>0&&s.jsx("div",{className:"chat-meta",children:t.join(" · ")})]})]})}function pA({settings:e,onSettings:t,busy:n,onSend:r,onStop:i,ensureSession:l,onSlash:a}){var ae;const o=Ir(),[u,c]=j.useState(""),[h,d]=j.useState([]),[f,m]=j.useState(0),[p,g]=j.useState(!1),w=j.useRef(null),y=j.useRef(null),[x,v]=j.useState(null),[b,A]=j.useState([]),[k,E]=j.useState(0),[T,I]=j.useState(null),C=j.useRef(!1),R=j.useRef(null);j.useEffect(()=>{!u.startsWith("/")||C.current||(C.current=!0,V.chatCommands().then(v,()=>v(null)),V.specs().then(O=>A(O.map(N=>N.file)),()=>A([])))},[u]),j.useEffect(()=>E(0),[u]),j.useLayoutEffect(()=>{const O=y.current;O&&(O.style.height="auto",O.style.height=`${Math.min(O.scrollHeight,260)}px`)},[u]);const L=async O=>{if(O.length){m(N=>N+O.length);try{const N=await l();for(const F of O)try{const Z=await lA(F),ce=await V.uploadChatFile(N,{name:F.name||"pasted.png",mime:F.type||"application/octet-stream",data:Z});d(Te=>[...Te,ce])}catch(Z){o.error(`${F.name}: ${Z.message}`)}finally{m(Z=>Z-1)}}catch(N){m(0),o.error(N.message)}}},M=async()=>{const O=u.trim(),N=O.match(/^(\/[a-z]+)(?:\s+(.*))?$/i);if(N&&uo.some(F=>F.cmd===N[1].toLowerCase())){a(N[1].toLowerCase(),(N[2]??"").trim())&&c("");return}n||f||!O&&!h.length||await r(O,h)&&(c(""),d([]))},U=O=>{var F;const N=B[O];!N||N.disabled||(c(N.insert),E(0),(F=y.current)==null||F.focus())},D=O=>{if(B.length&&!O.nativeEvent.isComposing){const N=F=>{var ce,Te;O.preventDefault();const Z=(X+F+B.length)%B.length;E(Z),(Te=(ce=R.current)==null?void 0:ce.children[Z])==null||Te.scrollIntoView({block:"nearest"})};if(O.key==="ArrowDown")return N(1);if(O.key==="ArrowUp")return N(-1);if(O.key==="Escape")return O.preventDefault(),I(u);if(O.key==="Tab"||O.key==="Enter"&&!O.shiftKey&&B[X]&&B[X].insert.trim()!==u.trim())return O.preventDefault(),U(X)}O.key==="Enter"&&!O.shiftKey&&!O.nativeEvent.isComposing&&(O.preventDefault(),M()),O.key==="Escape"&&n&&i()},q=O=>{const N=[...O.clipboardData.files];N.length&&(O.preventDefault(),L(N))},J=O=>{O.preventDefault(),g(!1),L([...O.dataTransfer.files])},B=T===u?[]:tA(u,{local:uo,catalog:x,specs:b}),X=Math.min(k,Math.max(0,B.length-1)),S=Up.some(O=>O.id===e.model);return s.jsxs("div",{className:`chat-composer ${p?"dragging":""}`,onDragOver:O=>(O.preventDefault(),g(!0)),onDragLeave:()=>g(!1),onDrop:J,children:[B.length>0&&s.jsxs("div",{className:"chat-slash",role:"listbox",ref:R,children:[B.map((O,N)=>s.jsxs("button",{type:"button",role:"option","aria-selected":N===X,"aria-disabled":O.disabled,title:O.disabledReason??O.description,className:`chat-slash-item ${N===X?"active":""} ${O.disabled?"disabled":""}`,onMouseEnter:()=>E(N),onMouseDown:F=>F.preventDefault(),onClick:()=>U(N),children:[s.jsxs("code",{children:[O.label,O.hint&&s.jsxs("span",{className:"muted",children:[" ",O.hint]})]}),s.jsx("span",{className:"chat-slash-desc muted",children:O.description}),O.badge&&s.jsx("span",{className:"chat-slash-badge",children:O.badge})]},O.insert)),u.startsWith("/")&&!u.startsWith("/p:")&&(x==null?void 0:x.error)&&s.jsx("div",{className:"chat-slash-note muted",children:x.error})]}),(h.length>0||f>0)&&s.jsxs("div",{className:"chat-atts",children:[h.map(O=>s.jsx(Sj,{a:O,onRemove:()=>d(N=>N.filter(F=>F.id!==O.id))},O.id)),f>0&&s.jsxs("span",{className:"chat-att muted",children:["Uploading ",f,"…"]})]}),s.jsx("textarea",{ref:y,className:"chat-input",rows:1,autoFocus:!0,placeholder:n?"Claude is answering… (Esc to stop)":"Message Claude Code - Enter to send, Shift+Enter for a new line, / for commands",value:u,onChange:O=>c(O.target.value),onKeyDown:D,onPaste:q,"aria-label":"Message"}),s.jsxs("div",{className:"chat-toolbar",children:[s.jsx("input",{ref:w,type:"file",multiple:!0,hidden:!0,onChange:O=>(L([...O.target.files??[]]),O.target.value="")}),s.jsx("button",{type:"button",className:"btn ghost icon square",onClick:()=>{var O;return(O=w.current)==null?void 0:O.click()},title:"Attach files (or paste / drop them)","aria-label":"Attach files",children:s.jsx(By,{size:16})}),s.jsxs("label",{className:"chat-select",title:"Model",children:[s.jsx("span",{children:"Model"}),s.jsxs("select",{value:e.model,onChange:O=>t({model:O.target.value}),"aria-label":"Model",children:[!S&&s.jsx("option",{value:e.model,children:e.model}),Up.map(O=>s.jsx("option",{value:O.id,children:O.label},O.id))]})]}),s.jsxs("label",{className:"chat-select chat-effort",title:"Reasoning effort: higher thinks longer (slower, more tokens). Default = Claude Code's own setting",children:[s.jsx("span",{children:"Effort"}),s.jsx("input",{type:"range",min:0,max:Jr.length-1,step:1,value:Math.max(0,Jr.indexOf(e.effort)),onChange:O=>t({effort:Jr[Number(O.target.value)]}),"aria-label":"Effort","aria-valuetext":e.effort,list:"chat-effort-ticks"}),s.jsx("datalist",{id:"chat-effort-ticks",children:Jr.map((O,N)=>s.jsx("option",{value:N},O))}),s.jsx("b",{className:"chat-effort-value",children:e.effort==="default"?"Default":e.effort})]}),s.jsxs("label",{className:"chat-select",title:(ae=no.find(O=>O.id===e.permissionMode))==null?void 0:ae.description,children:[s.jsx("span",{children:"Permissions"}),s.jsx("select",{value:e.permissionMode,onChange:O=>t({permissionMode:O.target.value}),"aria-label":"Permission mode",children:no.map(O=>s.jsx("option",{value:O.id,title:O.description,children:O.label},O.id))})]}),s.jsx("div",{className:"grow"}),n?s.jsxs("button",{type:"button",className:"btn danger sm",onClick:i,title:"Stop (Esc)",children:[s.jsx(Oy,{size:14})," Stop"]}):s.jsxs("button",{type:"button",className:"btn sm",onClick:()=>void M(),disabled:f>0||!u.trim()&&!h.length,"aria-label":"Send",children:[s.jsx(kb,{size:14})," Send"]})]})]})}function mA(){const{id:e}=ai(),t=ut(),n=Ir(),r=In(),i=$e(()=>V.chats(),[]),[l,a]=j.useState(null),[o,u]=j.useState(nA),[c,h]=j.useState(null),[d,f]=j.useState(null),m=j.useRef(null),p=j.useRef(!0),g=j.useRef(null),w=i.reload;j.useEffect(()=>{if(a(null),h(null),p.current=!0,!e)return;let L=!0;V.chat(e).then(U=>L&&a(D=>D??U)).catch(U=>L&&h(U.message));const M=ib(e,U=>{L&&(U.type==="session"?(a(U.session),U.session.busy||w()):a(D=>D&&{...D,messages:D.messages.map(q=>q.id===U.message.id?U.message:q)}))});return()=>{L=!1,M()}},[e,w]),j.useLayoutEffect(()=>{const L=m.current;L&&p.current&&(L.scrollTop=L.scrollHeight)},[l]);const y=l?{model:l.model,effort:l.effort,permissionMode:l.permissionMode}:o,x=j.useCallback(async()=>{if(e)return e;g.current??(g.current=V.createChat(o).then(L=>(a(L),t(`/chat/${L.id}`,{replace:!0}),w(),L.id)));try{return await g.current}finally{g.current=null}},[e,o,t,w]),v=async L=>{const M={...y,...L};if(u(M),rA(M),!!l){a({...l,...L});try{await V.updateChat(l.id,L)}catch(U){n.error(U.message)}}},b=async(L,M)=>{try{const U=await x();p.current=!0;const D=await V.sendChat(U,L,M.map(q=>q.id));return a(q=>q&&q.messages.length>D.messages.length?q:D),!0}catch(U){return n.error(U.message),!1}},A=j.useCallback(async(L,M)=>{if(e)try{await V.answerChatPermission(e,L,M)}catch(U){n.error(U.message)}},[e,n]),k=()=>{l&&V.stopChat(l.id).catch(L=>n.error(L.message))},E=(L,M)=>{var U;if(L==="/new")return t("/chat"),!0;if(L==="/help")return n.info(s.jsx("div",{children:uo.map(D=>s.jsxs("div",{children:[s.jsx("code",{children:D.cmd})," ",D.help]},D.cmd))})),!0;if(!M)return n.warning(`Usage: ${L} ${(U=uo.find(D=>D.cmd===L))==null?void 0:U.args}`),!1;if(L==="/model")return v({model:M}),n.success(`Model: ${M}`),!0;if(L==="/effort")return Jr.includes(M)?(v({effort:M}),n.success(`Effort: ${M}`),!0):(n.error(`Effort must be one of ${Jr.join(", ")}`),!1);if(L==="/mode"){const D=no.find(q=>q.id.toLowerCase()===M.toLowerCase());return D?(v({permissionMode:D.id}),n.success(`Permissions: ${D.label}`),!0):(n.error(`Mode must be one of ${no.map(q=>q.id).join(", ")}`),!1)}return!1},T=async L=>{if(await r({title:`Delete "${L.title}"?`,message:"The chat and its attachments are removed from Agent Studio. The Claude Code session itself stays in Claude Code’s history.",danger:!0,confirmLabel:"Delete"}))try{await V.deleteChat(L.id),L.id===e&&t("/chat"),w()}catch(M){n.error(M.message)}},I=async()=>{if(!l||d===null)return;const L=d.trim();if(f(null),!(!L||L===l.title))try{a(await V.updateChat(l.id,{title:L})),w()}catch(M){n.error(M.message)}},C=()=>{l&&navigator.clipboard.writeText(`claude --resume ${l.id}`).then(()=>n.success("Copied: run it in a terminal at the repo root to continue there")).catch(()=>n.error("Could not copy"))},R=i.data??[];return s.jsxs("div",{className:"chat-page",children:[s.jsx(ot,{items:[{label:"Claude chat",to:"/chat"},...l?[{label:l.title}]:[]]}),s.jsxs("aside",{className:"chat-list",children:[s.jsxs("button",{className:"btn chat-new",onClick:()=>t("/chat"),children:[s.jsx(qt,{size:15})," New chat"]}),s.jsxs("div",{className:"chat-list-items",children:[R.length===0&&s.jsx("p",{className:"muted small chat-list-empty",children:"No chats yet."}),R.map(L=>s.jsxs("div",{className:`chat-list-item ${L.id===e?"active":""}`,children:[s.jsxs(ye,{to:`/chat/${L.id}`,className:"chat-list-link",children:[s.jsxs("span",{className:"chat-list-title",children:[L.busy&&s.jsx("span",{className:"chat-dot",title:"Answering"}),L.title]}),s.jsxs("span",{className:"muted small",children:[Rt(L.updatedAt),L.costUsd>0&&` · ${fd(L.costUsd)}`]})]}),s.jsx("button",{className:"chat-list-del",onClick:()=>void T(L),"aria-label":`Delete ${L.title}`,title:"Delete chat",children:s.jsx(Ar,{size:13})})]},L.id))]})]}),s.jsxs("section",{className:"chat-main",children:[s.jsxs("header",{className:"chat-head",children:[l&&d!==null?s.jsx("input",{className:"input chat-rename",autoFocus:!0,value:d,onChange:L=>f(L.target.value),onBlur:()=>void I(),onKeyDown:L=>L.key==="Enter"?void I():L.key==="Escape"&&f(null),"aria-label":"Chat title"}):s.jsx("h1",{className:"chat-title",onDoubleClick:()=>l&&f(l.title),title:l?"Double-click to rename":void 0,children:(l==null?void 0:l.title)??"New chat"}),s.jsx("div",{className:"grow"}),l&&l.costUsd>0&&s.jsxs("span",{className:"muted small",children:["Total ",fd(l.costUsd)]}),(l==null?void 0:l.started)&&s.jsx("button",{className:"btn ghost sm",onClick:C,title:"Copy the command that continues this session in a terminal",children:s.jsx("code",{children:"claude --resume"})})]}),s.jsxs("div",{className:"chat-scroll",ref:m,onScroll:L=>p.current=L.currentTarget.scrollHeight-L.currentTarget.scrollTop-L.currentTarget.clientHeight<80,children:[c&&s.jsx("div",{className:"error-box",children:c}),!c&&(!l||l.messages.length===0)&&s.jsxs("div",{className:"chat-empty",children:[s.jsx("span",{className:"chat-empty-icon",children:s.jsx(Ch,{size:26})}),s.jsx("h2",{children:"Chat with Claude Code"}),s.jsxs("p",{className:"muted",children:["Runs Claude Code in this repository, like the terminal: it reads ",s.jsx("code",{children:"CLAUDE.md"}),", your skills and settings, and can edit files depending on the permission mode. Attach files with the paperclip, paste or drop them. Type ",s.jsx("code",{children:"/"})," for commands."]})]}),s.jsx(bj.Provider,{value:A,children:l==null?void 0:l.messages.map(L=>s.jsx(fA,{m:L},L.id))})]}),s.jsx(pA,{settings:y,onSettings:L=>void v(L),busy:!!(l!=null&&l.busy),onSend:b,onStop:k,ensureSession:x,onSlash:E})]})]})}const gA={name:"",description:"",instructions:"",model:"sonnet",skills:[],claudeMdSections:[],permissions:Ib,review:"auto"},xA=[{key:"browser",label:"Browser",hint:"Drive a real browser with playwright cli; gets the .env values (base URL, accounts)."},{key:"editTests",label:"Edit tests",hint:"Edit tests/e2e, tests/pages and tests/fixtures."},{key:"editSpecs",label:"Edit specs",hint:"Edit files in specs/."},{key:"typecheck",label:"Typecheck",hint:"Run npm run typecheck."}],Km=e=>({name:e.name,description:e.description,instructions:e.instructions,model:e.model,skills:e.skills,claudeMdSections:e.claudeMdSections,permissions:e.permissions,review:e.review??"auto"}),Ym=(e,t)=>e.includes(t)?e.filter(n=>n!==t):[...e,t],yA=[{id:"scoped",label:"Scoped",hint:"Read the repository; write only its job directory plus what the toggles allow."},{id:"full",label:"Full edit",hint:"Create and edit any file and run any shell command, except the denied commands and protected folders below."}],vA=[{key:"deniedCommands",label:"Denied commands",hint:"One command per line; it is blocked with any arguments (Bash(<command>:*)).",placeholder:`git push
413
+ rm -rf`},{key:"protectedPaths",label:"Protected folders",hint:"One folder per line, relative to the repository root; the agent cannot edit or create files inside it (Edit(<folder>/**)).",placeholder:`qa-studio
414
+ .git`}];function Jm(){var L,M,U;const{id:e}=ai(),t=!e,n=ut(),r=Ir(),i=In(),l=$e(()=>e?V.customAgent(e):Promise.resolve(null),[e]),a=$e(()=>V.claudeMdSections()),o=$e(()=>V.skills()),[u,c]=j.useState(gA),[h,d]=j.useState("instructions"),[f,m]=j.useState(null),[p,g]=j.useState(null),[w,y]=j.useState(!1),[x,v]=j.useState(!1);j.useEffect(()=>{l.data&&c(Km(l.data))},[l.data]);const b=(D,q)=>c(J=>({...J,[D]:q})),A=D=>c(q=>{const J=q.permissions,B=D==="full"&&!J.deniedCommands.length&&!J.protectedPaths.length;return{...q,permissions:{...J,mode:D,...B?{deniedCommands:Wy,protectedPaths:Vy}:{}}}}),k=async D=>{const q=Qb(D);u.instructions.trim()&&u.instructions!==q.instructions&&!await i({title:`Load the ${Gc.find(B=>B.id===D).label} template?`,message:"It replaces the instructions, description, model, review mode and permissions of this draft. Nothing is saved until you click Save.",confirmLabel:"Load template"})||(c(J=>({...J,name:t||!J.name.trim()?q.name:J.name,description:q.description,instructions:q.instructions,model:q.model,review:q.review,permissions:q.permissions})),d("instructions"),r.success(`Template loaded${t?"":": click Save to keep it"}`))},E=async()=>{var D;y(!0),g(null);try{const q=t?await V.createCustomAgent(u):await V.saveCustomAgent(e,u,(D=l.data)==null?void 0:D.updatedAt);r.success(t?`Agent "${q.name}" created`:`Agent "${q.name}" saved`),t?n(`/agents/custom/${q.id}`,{replace:!0}):l.reload()}catch(q){g(q.message)}finally{y(!1)}},T=async()=>{if(await i({title:`Delete the agent "${u.name}"?`,message:"Past jobs keep their results. This cannot be undone.",confirmLabel:"Delete agent",danger:!0}))try{await V.deleteCustomAgent(e),r.success("Agent deleted"),n("/agents")}catch(q){r.error(q.message)}};j.useEffect(()=>{if(h!=="preview"&&h!=="permissions")return;let D=!0;const q=setTimeout(()=>{V.previewCustomAgent(t?null:e,{agent:u}).then(J=>D&&(m(J),g(null))).catch(J=>D&&g(J.message))},300);return()=>{D=!1,clearTimeout(q)}},[h,u]);const I=!!l.data&&JSON.stringify(Km(l.data))!==JSON.stringify(u),C=!w&&(t||!!l.data&&!l.error),R=u.claudeMdSections.filter(D=>a.data&&!a.data.includes(D));return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Agents",to:"/agents"},{label:t?"New agent":u.name||"…"}]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:t?"New agent":u.name}),s.jsx("p",{className:"page-sub",children:"A custom LLM agent. It runs through Claude Code with the tools you allow below; .env reads, WebFetch and WebSearch are always blocked."})]}),s.jsxs("span",{className:"row",children:[s.jsx(ye,{to:"/agents",className:"btn ghost",children:"Back"}),s.jsxs("select",{className:"input",style:{width:"auto"},value:"",onChange:D=>D.target.value&&void k(D.target.value),"aria-label":"Load template",title:"Fill this agent from a built-in SDLC template",children:[s.jsx("option",{value:"",children:"Load template…"}),Gc.map(D=>s.jsx("option",{value:D.id,children:D.label},D.id))]}),!t&&s.jsxs("button",{className:"btn danger",onClick:()=>void T(),disabled:w,children:[s.jsx(Ar,{size:14})," Delete"]}),!t&&s.jsxs("button",{className:"btn ghost",onClick:()=>v(!0),disabled:I||!l.data,title:I?"Save your changes first":void 0,children:[s.jsx(ft,{size:14})," Run"]}),s.jsxs("button",{className:"btn",onClick:()=>void E(),disabled:!C,children:[t?s.jsx(qt,{size:14}):s.jsx(ds,{size:14})," ",t?"Create agent":"Save"]})]})]}),s.jsx(Le,{error:l.error??p}),s.jsxs("div",{className:"card pl-meta four",children:[s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:"Name"}),s.jsx("input",{className:"input",value:u.name,maxLength:80,onChange:D=>b("name",D.target.value),placeholder:"e.g. Accessibility reviewer"})]}),s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:"Description"}),s.jsx("input",{className:"input",value:u.description,maxLength:500,onChange:D=>b("description",D.target.value),placeholder:"Optional"})]}),s.jsxs("label",{className:"pl-field pl-from",children:[s.jsx("span",{children:"Model"}),s.jsx("select",{className:"input",value:u.model,onChange:D=>b("model",D.target.value),children:Th.map(D=>s.jsx("option",{value:D.id,children:D.label},D.id))})]}),s.jsxs("div",{className:"pl-field",children:[s.jsx("span",{children:"Review"}),s.jsx("div",{className:"seg",role:"radiogroup","aria-label":"Review mode",children:["auto","human"].map(D=>s.jsx("button",{type:"button",role:"radio","aria-checked":u.review===D,className:`seg-btn ${u.review===D?"on":""}`,onClick:()=>b("review",D),children:D==="auto"?"Auto":"Human"},D))}),s.jsx("span",{className:"muted small",children:u.review==="human"?"The pipeline pauses after this agent until someone approves or rejects its output.":"The pipeline goes on as soon as this agent finishes."})]})]}),s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"card-head row between",children:s.jsx(un,{value:h,onChange:d,items:[{id:"instructions",label:"Instructions"},{id:"context",label:u.claudeMdSections.length?`CLAUDE.md (${u.claudeMdSections.length})`:"CLAUDE.md"},{id:"skills",label:u.skills.length?`Skills (${u.skills.length})`:"Skills"},{id:"preview",label:"Full prompt preview"},{id:"permissions",label:"Permissions"}]})}),h==="instructions"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("p",{className:"muted small",style:{margin:0},children:["Placeholders: ",Ab.map(D=>`{{${D}}}`).join(", "),". Agent Studio adds the fixed part (environment, tool rules, result file) after your instructions."]}),s.jsx("textarea",{className:"input prompt-editor",value:u.instructions,onChange:D=>b("instructions",D.target.value),spellCheck:!1,"aria-label":"Instructions"}),s.jsxs("span",{className:"muted small",children:[u.instructions.length.toLocaleString()," characters"]})]}),h==="context"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsx("p",{className:"muted small",style:{margin:0},children:"CLAUDE.md is always loaded. Pick the sections this agent must follow; the prompt names them explicitly."}),R.length>0&&s.jsx("div",{children:s.jsxs("span",{className:"chip warn",children:["Not in CLAUDE.md any more: ",R.join(", ")]})}),s.jsx(Le,{error:a.error}),((L=a.data)==null?void 0:L.length)===0&&s.jsx("p",{className:"muted",children:"CLAUDE.md has no sections yet."}),s.jsx("div",{className:"skill-list",children:[...a.data??[],...R].map(D=>s.jsxs("label",{className:`skill-item ${u.claudeMdSections.includes(D)?"on":""}`,children:[s.jsx("input",{type:"checkbox",checked:u.claudeMdSections.includes(D),onChange:()=>b("claudeMdSections",Ym(u.claudeMdSections,D)),"aria-label":`Section ${D}`}),s.jsx("b",{children:D})]},D))})]}),h==="skills"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("p",{className:"muted small",style:{margin:0},children:["Claude Code skills from ",s.jsx("code",{children:".claude/skills/<name>/SKILL.md"}),". The agent loads the selected skills itself when it runs."]}),s.jsx(Le,{error:o.error}),((M=o.data)==null?void 0:M.length)===0&&s.jsx("p",{className:"muted",children:"No skills found in .claude/skills."}),s.jsx("div",{className:"skill-list",children:(U=o.data)==null?void 0:U.map(D=>{const q=u.skills.includes(D.name);return s.jsxs("label",{className:`skill-item ${q?"on":""} ${D.error&&!q?"invalid":""}`,title:D.error??D.dir,children:[s.jsx("input",{type:"checkbox",checked:q,disabled:!!D.error&&!q,onChange:()=>b("skills",Ym(u.skills,D.name)),"aria-label":`Attach skill ${D.name}`}),s.jsx("b",{children:D.name}),s.jsx("span",{className:"skill-desc muted small",children:D.error??D.description})]},D.name)})})]}),h==="permissions"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("p",{className:"muted small",style:{margin:0},children:["Headless Claude Code with ",s.jsx("code",{children:"--permission-mode dontAsk"}),": anything outside the allow list is denied. The lists below follow your changes."]}),s.jsx("div",{className:"skill-list",children:yA.map(D=>s.jsxs("label",{className:`skill-item ${u.permissions.mode===D.id?"on":""}`,children:[s.jsx("input",{type:"radio",name:"permission-mode",checked:u.permissions.mode===D.id,onChange:()=>A(D.id)}),s.jsx("b",{children:D.label}),s.jsx("span",{className:"skill-desc muted small",children:D.hint})]},D.id))}),s.jsx("h4",{children:u.permissions.mode==="full"?"Options":"Allow"}),s.jsx("div",{className:"skill-list",children:xA.filter(D=>u.permissions.mode==="scoped"||D.key==="browser").map(D=>s.jsxs("label",{className:`skill-item ${u.permissions[D.key]?"on":""}`,children:[s.jsx("input",{type:"checkbox",checked:u.permissions[D.key],onChange:q=>b("permissions",{...u.permissions,[D.key]:q.target.checked})}),s.jsx("b",{children:D.label}),s.jsx("span",{className:"skill-desc muted small",children:D.hint})]},D.key))}),s.jsx("h4",{children:"Deny"}),u.permissions.mode==="full"&&s.jsx("p",{className:"muted small",style:{margin:0},children:"Command rules match the start of a command, so they are a guard rail, not a sandbox: an agent with full shell access can still reach a protected folder or .env another way. Use Full edit only for agents you trust."}),vA.map(D=>s.jsxs("label",{className:"pl-field",children:[s.jsxs("span",{children:[s.jsx("b",{children:D.label})," ",s.jsx("span",{className:"muted small",children:D.hint})]}),s.jsx("textarea",{className:"input",rows:4,spellCheck:!1,placeholder:D.placeholder,value:u.permissions[D.key].join(`
415
+ `),onChange:q=>b("permissions",{...u.permissions,[D.key]:q.target.value.split(`
416
+ `)}),"aria-label":D.label})]},D.key)),f&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{children:"Allowed"}),s.jsx("div",{className:"perm",children:f.allowedTools.map(D=>s.jsx("code",{children:D},D))}),s.jsx("h4",{children:"Denied"}),s.jsx("div",{className:"perm",children:f.disallowedTools.map(D=>s.jsx("code",{className:"deny",children:D},D))})]})]}),h==="preview"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsx("span",{className:"muted small",children:"What Claude Code receives, with your unsaved edits (updates as you type). Placeholders stay generic; secret values are never shown."}),f?s.jsx(hj,{preview:f}):!p&&s.jsx("p",{className:"muted",children:"Building preview…"})]})]}),x&&e&&s.jsx(yj,{title:"Run agent",onClose:()=>v(!1),onStart:(D,q)=>V.createJob({type:"custom",agentId:e,...D?{spec:D}:{},...q.trim()?{input:q}:{}})})]})}const jA=["Read(.env)","Read(**/.env)","Read(.env.local)","Read(**/.env.local)","WebFetch","WebSearch"],wA={validator:{command:"playwright test tests/e2e/<spec>.spec.ts --project=chrome --repeat-each=3 --retries=0 --reporter=line,json",notes:["Runs after the QA Script Generator and after each QA Script Healer round (QA Validator ⇄ QA Script Healer loop, max rounds in Settings).","Passes only when every repetition passes: catches flaky scripts before they are accepted."]},runner:{command:"playwright test [files] [--grep <TC-IDs>] --project=chrome --repeat-each=<n> --reporter=line,json[,html]",notes:["Used by Run tests and Test runs.",'The HTML reporter is added when the run has "HTML report" on (default in Settings).']}};function kA(){const e=ai().agent,t=Ne[e];return t?t.llm?s.jsx(NA,{agent:e}):s.jsx(bA,{agent:e}):s.jsx(Le,{error:`Unknown agent: ${e}`})}function Nj({agent:e,extra:t}){const n=Ne[e];return s.jsxs(s.Fragment,{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Agents",to:"/agents"},{label:n.label}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{className:"row",style:{alignItems:"flex-start"},children:[s.jsx(Ft,{agent:e,size:44}),s.jsxs("div",{children:[s.jsxs("h1",{className:"page-title",children:[n.label," ",t]}),s.jsxs("p",{className:"page-sub",children:[n.description," · ",n.llm?"LLM agent (Claude Code)":"Deterministic step"]})]})]})})]})}function bA({agent:e}){const t=wA[e];return s.jsxs("section",{children:[s.jsx(Nj,{agent:e}),s.jsxs("div",{className:"card pad",children:[s.jsx("p",{className:"muted",children:"This step has no prompt: it runs Playwright Test directly (no shell, no LLM). It cannot write any file other than its report."}),t&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{children:"Command"}),s.jsx("pre",{className:"prompt-preview",children:t.command}),s.jsx("ul",{children:t.notes.map(n=>s.jsx("li",{children:n},n))})]})]})]})}function SA({info:e,onSaved:t}){const[n,r]=j.useState(!1),[i,l]=j.useState(null),a=async u=>{if(u!==e.model){r(!0);try{await V.saveAgentModel(e.agent,u),l(null),t()}catch(c){l(c.message)}finally{r(!1)}}},o=async()=>{r(!0);try{await V.resetAgentModel(e.agent),l(null),t()}catch(u){l(u.message)}finally{r(!1)}};return s.jsxs("div",{className:"row",style:{gap:10,margin:"4px 0 14px"},children:[s.jsx("span",{className:"muted small",children:"Model:"}),s.jsx("select",{className:"select",value:e.model,disabled:n,onChange:u=>void a(u.target.value),"aria-label":`${Ne[e.agent].label} model`,children:Th.map(u=>s.jsx("option",{value:u.id,title:u.label,children:u.label},u.id))}),s.jsx(yt,{status:e.modelCustomized?"stale":"neutral",children:e.modelCustomized?"custom model":"default model"}),e.modelCustomized&&s.jsxs("button",{type:"button",className:"btn ghost sm",disabled:n,onClick:()=>void o(),title:"Use the default model",children:[s.jsx(Jn,{size:12})," Reset"]}),s.jsx(Le,{error:i})]})}function NA({agent:e}){var L;const{specs:t}=cn(),n=In(),r=$e(()=>V.agentPrompts(),[e]),i=(L=r.data)==null?void 0:L.find(M=>M.agent===e),[l,a]=j.useState(null),[o,u]=j.useState("instructions"),[c,h]=j.useState(""),[d,f]=j.useState(null),[m,p]=j.useState(null),[g,w]=j.useState(null),[y,x]=j.useState(null),[v,b]=j.useState(!1),A=j.useRef(null);j.useEffect(()=>{i&&l===null&&a(i.instructions)},[i,l]),j.useEffect(()=>a(null),[e]);const k=i!==void 0&&l!==null&&l!==i.instructions,E=i!==void 0&&l!==null&&l.trim()!==i.defaultInstructions.trim(),T=yh(({currentLocation:M,nextLocation:U})=>k&&M.pathname!==U.pathname);Rh(T,{title:"Discard the unsaved instructions?",message:"Your edits to this prompt will be lost.",confirmLabel:"Discard",danger:!0}),j.useEffect(()=>{if(o!=="preview"||l===null)return;const M=setTimeout(()=>{V.previewAgentPrompt(e,{instructions:l,...c?{spec:c}:{}}).then(U=>(f(U),p(null))).catch(U=>p(U.message))},300);return()=>clearTimeout(M)},[o,l,c,e]);const I=async()=>{if(l!==null){b(!0);try{const M=await V.saveAgentPrompt(e,l);a(M.instructions),r.reload(),w(null),x(M.customized?"Saved. New jobs use these instructions.":"Saved: same as the default, so the default is used.")}catch(M){w(M.message)}finally{b(!1)}}},C=async()=>{if(await n({title:`Reset the ${Ne[e].label} instructions?`,message:"Your custom instructions are replaced with the built-in default. New jobs use the default.",confirmLabel:"Reset to default",danger:!0})){b(!0);try{const U=await V.resetAgentPrompt(e);a(U.instructions),r.reload(),w(null),x("Reset to the default instructions.")}catch(U){w(U.message)}finally{b(!1)}}},R=M=>{const U=A.current;if(!U||l===null)return;const D=`{{${M}}}`,q=l.slice(0,U.selectionStart)+D+l.slice(U.selectionEnd),J=U.selectionStart+D.length;a(q),requestAnimationFrame(()=>(U.focus(),U.setSelectionRange(J,J)))};return s.jsxs("section",{children:[s.jsx(Nj,{agent:e,extra:i&&(i.customized?s.jsx(yt,{status:"stale",children:"custom instructions"}):s.jsx(yt,{status:"neutral",children:"default instructions"}))}),i&&s.jsx(SA,{info:i,onSaved:r.reload}),s.jsx(Le,{error:r.error??g}),y&&!k&&s.jsx("div",{className:"ok-box",children:y}),s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head row between",children:[s.jsx(un,{value:o,onChange:u,items:[{id:"instructions",label:k?"Instructions •":"Instructions"},{id:"skills",label:i!=null&&i.skills.length?`Skills (${i.skills.length})`:"Skills"},{id:"preview",label:"Full prompt preview"},{id:"permissions",label:"Permissions"}]}),s.jsxs("span",{className:"row",children:[s.jsxs("button",{className:"btn ghost",onClick:()=>void C(),disabled:v||!(i!=null&&i.customized),title:"Use the built-in instructions",children:[s.jsx(Jn,{size:14})," Reset to default"]}),s.jsxs("button",{className:"btn",onClick:()=>void I(),disabled:v||!k,children:[s.jsx(ds,{size:14})," Save"]})]})]}),o==="instructions"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("p",{className:"muted small",style:{margin:0},children:["The agent's role and working rules. Agent Studio appends a fixed part to every prompt: input files, the ",s.jsx("code",{children:".env"})," environment, tool rules and the output JSON the pipeline reads. That part cannot be edited here; see ",s.jsx("b",{children:"Full prompt preview"}),". Project rules shared by all agents live in"," ",s.jsx(ye,{to:"/project",children:"CLAUDE.md"}),". Changes apply to jobs that start after saving."]}),i&&s.jsxs("div",{className:"ph-list","aria-label":"Insert placeholder",children:[s.jsx("span",{className:"muted small",children:"Insert:"}),Object.entries(i.placeholders).map(([M,U])=>s.jsx("button",{type:"button",className:"chip",title:U,onClick:()=>R(M),children:`{{${M}}}`},M))]}),s.jsx("textarea",{ref:A,className:"input prompt-editor",value:l??"",onChange:M=>(a(M.target.value),x(null)),spellCheck:!1,"aria-label":`${Ne[e].label} instructions`,disabled:l===null}),s.jsxs("div",{className:"row between muted small",children:[s.jsxs("span",{children:[(l==null?void 0:l.length.toLocaleString())??0," characters",E?" · differs from the default":" · same as the default"]}),k&&s.jsx("button",{type:"button",className:"link-btn",onClick:()=>a(i.instructions),children:"Discard changes"})]})]}),o==="skills"&&i&&s.jsx(CA,{info:i,onSaved:()=>(r.reload(),f(null))}),o==="preview"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("div",{className:"row between",children:[s.jsxs("span",{className:"muted small",children:["What Claude Code receives",k?" (with your unsaved edits)":"",". Generic shows placeholders; pick a spec to see a real job with .env values (passwords and accounts masked)."]}),s.jsxs("select",{className:"select",value:c,onChange:M=>h(M.target.value),"aria-label":"Sample spec",children:[s.jsx("option",{value:"",children:"Generic (placeholders, no project data)"}),t.map(M=>s.jsx("option",{value:M.file,children:M.file},M.file))]})]}),s.jsx(Le,{error:m}),d?s.jsx(hj,{preview:d}):!m&&s.jsx("p",{className:"muted",children:"Building preview…"})]}),o==="permissions"&&s.jsxs("div",{className:"pad",children:[s.jsxs("p",{className:"muted small",children:["Headless Claude Code with ",s.jsx("code",{children:"--permission-mode dontAsk"}),": anything outside the allow list is denied. Permissions are fixed by Agent Studio."]}),s.jsx("h4",{children:"Allowed"}),s.jsx("div",{className:"perm",children:d?d.allowedTools.map(M=>s.jsx("code",{children:M},M)):s.jsx(EA,{agent:e,onLoad:f})}),s.jsx("h4",{children:"Explicitly denied"}),s.jsx("div",{className:"perm",children:((d==null?void 0:d.disallowedTools)??jA).map(M=>s.jsx("code",{className:"deny",children:M},M))})]})]})]})}function CA({info:e,onSaved:t}){var d,f,m;const n=$e(()=>V.skills(),[e.agent]),[r,i]=j.useState(!1),[l,a]=j.useState(null),o=e.skills,u=new Set((d=n.data)==null?void 0:d.map(p=>p.name)),c=async p=>{i(!0);try{await V.saveAgentSkills(e.agent,p),a(null),t()}catch(g){a(g.message)}finally{i(!1)}},h=p=>{const g=o.includes(p.name);p.error&&!g||c(g?o.filter(w=>w!==p.name):[...o,p.name])};return s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("p",{className:"muted small",style:{margin:0},children:["Select Claude Code skills from ",s.jsx("code",{children:".claude/skills/<name>/SKILL.md"})," (frontmatter ",s.jsx("code",{children:"name"})," + ",s.jsx("code",{children:"description"}),", then the skill's instructions). The skill content is not copied into the instructions: when the agent runs, Claude Code loads the selected skills itself with its Skill tool and applies them on top of the agent's role and persona. Claude Code's own skills (built-in, plugins such as superpowers) stay available too; nothing is blocked. The agent log shows every skill used (",s.jsx("code",{children:"[skill]"})," lines). Changes apply to jobs that start after saving."]}),s.jsx(Le,{error:n.error??l}),e.skillsUnavailable.length>0&&s.jsxs("div",{className:"row",style:{gap:8},children:[s.jsxs("span",{className:"chip warn",children:["Skipped when jobs run: ",e.skillsUnavailable.join(", ")]}),s.jsx("span",{className:"muted small",children:"missing or invalid on disk"}),n.data&&e.skillsUnavailable.some(p=>!u.has(p))&&s.jsx("button",{type:"button",className:"link-btn",disabled:r,onClick:()=>void c(o.filter(p=>u.has(p))),children:"Remove missing"})]}),((f=n.data)==null?void 0:f.length)===0&&s.jsxs("p",{className:"muted",children:["No skills found. Create ",s.jsx("code",{children:".claude/skills/<name>/SKILL.md"})," in the project, then click ",s.jsx("b",{children:"Rescan folder"}),"."]}),s.jsx("div",{className:"skill-list",children:(m=n.data)==null?void 0:m.map(p=>{const g=o.includes(p.name);return s.jsxs("label",{className:`skill-item ${g?"on":""} ${p.error&&!g?"invalid":""}`,title:p.error??p.dir,children:[s.jsx("input",{type:"checkbox",checked:g,disabled:r||!!p.error&&!g,onChange:()=>h(p),"aria-label":`Attach skill ${p.name}`}),s.jsxs("span",{className:"row",style:{gap:8},children:[s.jsx("b",{children:p.name}),g&&s.jsx(yt,{status:"stale",children:o.length>1?`attached #${o.indexOf(p.name)+1}`:"attached"}),p.error&&s.jsx("span",{className:"chip fail",children:"invalid"})]}),s.jsx("span",{className:"skill-desc muted small",children:p.error??p.description}),s.jsxs("span",{className:"skill-meta muted small",children:[s.jsxs("code",{children:[p.dir,"/SKILL.md"]}),s.jsxs("span",{children:[p.chars.toLocaleString()," characters"]}),p.files.length>0&&s.jsxs("span",{title:p.files.join(", "),children:["+",p.files.length," file",p.files.length===1?"":"s"]}),p.allowedTools.length>0&&s.jsxs("span",{className:"chip warn",title:"From the skill's frontmatter: Claude Code allows these tools while the skill is active, on top of the agent's permissions",children:["allowed-tools: ",p.allowedTools.join(" ")]})]})]},p.name)})}),s.jsxs("div",{className:"row between muted small",children:[s.jsxs("span",{children:[o.length," attached · see Full prompt preview for the result"]}),s.jsxs("button",{type:"button",className:"btn ghost sm",onClick:n.reload,disabled:r,children:[s.jsx(Jn,{size:12})," Rescan folder"]})]})]})}function EA({agent:e,onLoad:t}){return j.useEffect(()=>{V.previewAgentPrompt(e,{}).then(t).catch(()=>{})},[e,t]),s.jsx("span",{className:"muted small",children:"Loading…"})}let TA=0;const Cj=()=>`b${Date.now().toString(36)}${(TA++).toString(36)}`;function Ej(e,t=Cj){return e.map(n=>n.kind==="agent"?{uid:t(),kind:"agent",agent:n.agent}:{uid:t(),kind:"loop",maxIterations:n.maxIterations,endsWhen:n.endsWhen??"first",steps:Ej(n.steps.map(hs),t)})}const Tj=e=>({kind:"loop",steps:e.steps.map(t=>t.kind==="agent"?t.agent:Tj(t)),maxIterations:e.maxIterations,...e.endsWhen==="last"?{endsWhen:"last"}:{}});function Pj(e){return e.map(t=>t.kind==="agent"?{kind:"agent",agent:t.agent}:Tj(t))}const pd=(e,t)=>e.length===t.length&&e.every((n,r)=>n===t[r]),Rj=(e,t)=>e.length<=t.length&&e.every((n,r)=>n===t[r]);function nf(e,t){let n=e,r;for(const i of t){if(r=n[i],!r)return;n=r.kind==="loop"?r.steps:[]}return r}function Lj(e,t){if(t.length===0)return e;const n=nf(e,t);return(n==null?void 0:n.kind)==="loop"?n.steps:null}const Aj=e=>e.kind==="agent"?0:1+Math.max(0,...e.steps.map(Aj));function ml(e,t,n){if(t.length===0)return n(e);const[r,...i]=t;return e.map((l,a)=>a===r&&l.kind==="loop"?{...l,steps:ml(l.steps,i,n)}:l)}const PA=(e,t)=>t.from==="block"?nf(e,t.path)??null:null;function Ij(e,t,n){const r=Lj(e,n.parent);if(!r||n.index<0||n.index>r.length)return!1;let i;if(t.from==="palette")i=0;else if(t.from==="palette-loop")i=1;else{const a=PA(e,t);if(!a||Rj(t.path,n.parent))return!1;i=Aj(a)}return n.parent.length+i>to?!1:t.from==="block"&&pd(t.path.slice(0,-1),n.parent)||r.length<(n.parent.length===0?ba:Sa)}function md(e,t,n,r=Cj){if(!Ij(e,t,n))return e;let i,l=e,a=n;if(t.from==="palette")i={uid:r(),kind:"agent",agent:t.agent};else if(t.from==="palette-loop")i={uid:r(),kind:"loop",steps:[],maxIterations:Mb,endsWhen:"first"};else{const o=t.path.slice(0,-1),u=t.path[t.path.length-1];if(pd(o,n.parent)&&(n.index===u||n.index===u+1))return e;if(i=nf(e,t.path),l=ml(e,o,c=>c.filter((h,d)=>d!==u)),pd(o,n.parent))n.index>u&&(a={...n,index:n.index-1});else if(Rj(o,n.parent)&&n.parent[o.length]>u){const c=[...n.parent];c[o.length]-=1,a={...n,parent:c}}}return ml(l,a.parent,o=>[...o.slice(0,a.index),i,...o.slice(a.index)])}function Xm(e,t,n){const r=t.slice(0,-1),i=t[t.length-1],l=Lj(e,r),a=i+n;return!l||a<0||a>=l.length?e:md(e,{from:"block",path:t},{parent:r,index:n<0?a:a+1})}function RA(e,t){const n=t[t.length-1];return ml(e,t.slice(0,-1),r=>r.filter((i,l)=>l!==n))}function Zm(e,t,n){const r=t[t.length-1];return ml(e,t.slice(0,-1),i=>i.map((l,a)=>a===r&&l.kind==="loop"?{...l,...n}:l))}const LA=Object.keys(Ne).filter(e=>e!=="custom"),Wu=(e,t,n,r="")=>JSON.stringify({name:e.trim(),description:t.trim(),workDir:r.trim(),steps:Pj(n)});function eg(){const{id:e}=ai(),t=!e||e==="new",[n]=vh(),r=ut(),i=In(),l=Ir(),a=$e(()=>V.settings()),o=$e(()=>V.customAgents()).data??[],u=$e(()=>t?Promise.resolve(null):V.pipeline(e),[e]),[c,h]=j.useState(""),[d,f]=j.useState(""),[m,p]=j.useState(""),[g,w]=j.useState([]),[y,x]=j.useState(),[v,b]=j.useState(null),[A,k]=j.useState(!1),[E,T]=j.useState(null),[I,C]=j.useState(null),[R,L]=j.useState(!1),[M,U]=j.useState(!1),D=j.useRef(!1),q=j.useMemo(()=>{var Q;return Ub(((Q=a.data)==null?void 0:Q.settings.maxHealRounds)??2)},[a.data]),J=(Q,de,ve=!0)=>{const ct=Ej(Q.steps);h(Q.name),f(Q.description),p(Q.workDir??""),w(ct),x(de),b(ve?Wu(Q.name,Q.description,ct,Q.workDir??""):Wu("","",[],"")),k(!0)};j.useEffect(()=>{if(!t){u.data&&J(u.data,u.data.updatedAt);return}const Q=n.get("from");if(Q&&!a.data)return;const de=q.find(ve=>ve.id===Q);de?J({...de,name:`${de.name} (custom)`},void 0,!1):J({name:"",description:"",steps:[]},void 0)},[t,u.data,a.data]);const B=Wu(c,d,g,m),X=A&&v!==null&&B!==v,S=Fb({name:c,description:d,workDir:m,steps:Pj(g)}),ae=S.ok?[]:S.errors,O=yh(({currentLocation:Q,nextLocation:de})=>X&&!D.current&&Q.pathname!==de.pathname);Rh(O,{title:"Discard the unsaved pipeline changes?",message:"Your changes to this pipeline will be lost.",confirmLabel:"Discard",danger:!0});const N=async()=>{if(S.ok){L(!0);try{const Q=t?await V.createPipeline(S.value):await V.savePipeline(e,S.value,y);C(null),J(Q,Q.updatedAt),U(!0),setTimeout(()=>U(!1),2e3),l.success(t?`Pipeline "${Q.name}" created`:`Pipeline "${Q.name}" saved`),t&&(D.current=!0,r(`/agents/pipelines/${Q.id}`,{replace:!0}))}catch(Q){C(Q.message)}finally{L(!1)}}},F=async()=>{var ve;if(t)return;const Q=((ve=u.data)==null?void 0:ve.name)||c||e;if(await i({title:`Delete the pipeline "${Q}"?`,message:"The pipeline is removed for everyone using this Agent Studio. This cannot be undone.",confirmLabel:"Delete pipeline",danger:!0})){L(!0);try{await V.deletePipeline(e),D.current=!0,l.success(`Pipeline "${Q}" deleted`),r("/agents?tab=custom",{replace:!0})}catch(ct){C(ct.message),L(!1)}}},Z=(Q,de)=>{Q.dataTransfer.effectAllowed=de.from==="palette"||de.from==="palette-loop"?"copy":"move",Q.dataTransfer.setData("text/plain","qa-pipeline"),T(de)},ce=()=>T(null),Te=Q=>{E&&w(de=>md(de,E,Q)),T(null)},tt=Q=>w(de=>md(de,Q,{parent:[],index:de.length})),W={blocks:g,drag:E,customAgents:o,setBlocks:w,startDrag:Z,endDrag:ce,drop:Te},ge=t?"New pipeline":c||"Pipeline";return!t&&u.error?s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Agents",to:"/agents"},{label:"Pipeline"}]}),s.jsx(Le,{error:u.error}),s.jsx(ye,{to:"/agents",className:"btn ghost",children:"Back to Agents"})]}):s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Agents",to:"/agents"},{label:ge}]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:ge}),s.jsxs("p",{className:"page-sub",children:["Drag agents from the palette into the pipeline, reorder them by dragging, and add a ",s.jsx("b",{children:"Loop"})," to repeat agents. Each loop runs its entries in order and ends when its first entry passes (check first) or when its last entry passes (work first, then check), or after its maximum number of iterations. Drop a loop inside another loop to nest it (up to ",to," levels); a nested loop in the check position (first, or last for loops that end when the last entry passes) ends the outer loop when it passes. Run it from the chat with ",s.jsx("code",{children:"/p:<name> <spec.md> [input]"})," or a prompt that names a spec or TC-ID (",s.jsx("code",{children:"/p:<name> check TC-LOGIN-001 on mobile"}),"); a pipeline with only custom agents or the Context Writer also runs from a prompt alone: ",s.jsx("code",{children:"/p:<name> <prompt>"}),"."]})]}),s.jsxs("span",{className:"row",children:[!t&&s.jsxs("button",{className:"btn danger",onClick:()=>void F(),disabled:R,children:[s.jsx(Ar,{size:14})," Delete"]}),s.jsxs("button",{className:"btn",onClick:()=>void N(),disabled:R||!A||!S.ok||!t&&!X,title:ae[0],children:[s.jsx(ds,{size:14})," ",M?"Saved":t?"Create pipeline":"Save"]})]})]}),s.jsx(Le,{error:I}),s.jsxs("div",{className:"card pl-meta",children:[s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:"Name"}),s.jsx("input",{className:"input",value:c,maxLength:Qc,onChange:Q=>h(Q.target.value),placeholder:"e.g. Nightly regression"})]}),s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:"Description"}),s.jsx("input",{className:"input",value:d,maxLength:qc,onChange:Q=>f(Q.target.value),placeholder:"Optional"})]}),s.jsxs("label",{className:"pl-field wide",children:[s.jsx("span",{children:"Working directory"}),s.jsx("input",{className:"input",value:m,onChange:Q=>p(Q.target.value),placeholder:"Optional"}),s.jsx("span",{className:"muted small",children:"Custom agents run here (e.g. D:\\my-app). Empty: this QA repository."})]}),t&&s.jsxs("label",{className:"pl-field pl-from",children:[s.jsx("span",{children:"Start from"}),s.jsxs("select",{className:"input",value:n.get("from")??"",onChange:async Q=>{const de=Q.target.value;if(g.length&&!await i({title:"Replace the current steps?",message:"The pipeline steps are replaced with the chosen starting point.",confirmLabel:"Replace",danger:!0}))return;r(de?`/agents/pipelines/new?from=${de}`:"/agents/pipelines/new",{replace:!0});const ve=q.find(ct=>ct.id===de);J(ve?{...ve,name:`${ve.name} (custom)`}:{name:"",description:"",steps:[]},void 0,!ve)},children:[s.jsx("option",{value:"",children:"Blank pipeline"}),q.map(Q=>s.jsxs("option",{value:Q.id,children:["Built-in: ",Q.name]},Q.id))]})]})]}),s.jsxs("div",{className:"pl-layout",children:[s.jsxs("aside",{className:"card pl-palette","aria-label":"Agent palette",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"Palette"})}),s.jsx("p",{className:"muted small pl-hint",children:"Drag onto the pipeline, or press + to add at the end."}),s.jsxs("div",{className:"pl-tile pl-tile-loop",draggable:!0,onDragStart:Q=>Z(Q,{from:"palette-loop"}),onDragEnd:ce,children:[s.jsx("span",{className:"pl-loop-icon",children:s.jsx(as,{size:16})}),s.jsxs("span",{className:"pl-tile-text",children:[s.jsx("b",{children:"Loop"}),s.jsx("span",{className:"muted small",children:"Repeat agents up to a maximum count; loops can be nested"})]}),s.jsx("button",{className:"btn ghost sm icon","aria-label":"Add a loop",onClick:()=>tt({from:"palette-loop"}),children:s.jsx(qt,{size:14})})]}),LA.map(Q=>s.jsxs("div",{className:"pl-tile",draggable:!0,onDragStart:de=>Z(de,{from:"palette",agent:Q}),onDragEnd:ce,children:[s.jsx(Ft,{agent:Q,size:28}),s.jsxs("span",{className:"pl-tile-text",children:[s.jsx("b",{children:Ne[Q].label}),s.jsx("span",{className:"muted small",children:Ne[Q].llm?"LLM agent":"Playwright step"})]}),s.jsx("button",{className:"btn ghost sm icon","aria-label":`Add ${Ne[Q].label}`,onClick:()=>tt({from:"palette",agent:Q}),children:s.jsx(qt,{size:14})})]},Q)),o.map(Q=>{const de=Ph(Q.id);return s.jsxs("div",{className:"pl-tile",draggable:!0,onDragStart:ve=>Z(ve,{from:"palette",agent:de}),onDragEnd:ce,children:[s.jsx(Ft,{agent:"custom",size:28}),s.jsxs("span",{className:"pl-tile-text",children:[s.jsx("b",{children:Q.name}),s.jsx("span",{className:"muted small",children:"Custom agent"})]}),s.jsx("button",{className:"btn ghost sm icon","aria-label":`Add ${Q.name}`,onClick:()=>tt({from:"palette",agent:de}),children:s.jsx(qt,{size:14})})]},Q.id)}),o.length===0&&s.jsxs(ye,{to:"/agents/custom/new",className:"btn ghost sm",children:[s.jsx(qt,{size:14})," New agent"]})]}),s.jsxs("div",{className:"card pl-canvas","aria-label":"Pipeline",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Pipeline"}),s.jsxs("span",{className:"muted small",children:[g.length," block",g.length===1?"":"s"]})]}),s.jsxs("div",{className:"pl-flow",children:[s.jsx("span",{className:"pl-terminal",children:"Start"}),g.map((Q,de)=>s.jsxs("div",{className:"pl-item",children:[s.jsx(co,{tree:W,target:{parent:[],index:de}}),s.jsx(Mj,{tree:W,block:Q,path:[de],siblings:g.length})]},Q.uid)),s.jsx(co,{tree:W,target:{parent:[],index:g.length},empty:g.length===0}),s.jsx("span",{className:"pl-terminal",children:"End"})]}),A&&ae.length>0&&(g.length>0||c)&&s.jsx("div",{className:"warn-box",role:"status",children:ae.join(`
417
+ `)})]})]})]})}const Dj=e=>e.map(t=>t+1).join("."),zj=(e,t)=>(e==null?void 0:e.from)==="block"&&e.path.length===t.length&&e.path.every((n,r)=>n===t[r]);function Mj({tree:e,block:t,path:n,siblings:r,parentEndsWhen:i}){var m;const{drag:l,customAgents:a,startDrag:o,endDrag:u}=e,c=n.length>1,h=n[n.length-1],d=c&&(i==="last"?h===r-1:h===0),f=p=>{p.stopPropagation(),o(p,{from:"block",path:n})};if(t.kind==="agent"){const p=Pl(t.agent,a);return s.jsxs("div",{className:`pl-block ${c?"inner":""} ${zj(l,n)?"dragging":""}`,draggable:!0,onDragStart:f,onDragEnd:u,children:[s.jsx("span",{className:"pl-num",children:Dj(n)}),s.jsx(Ft,{agent:ef(t.agent),size:c?26:30}),s.jsxs("span",{className:"pl-tile-text",children:[s.jsx("b",{children:p}),((m=a.find(g=>Ph(g.id)===t.agent))==null?void 0:m.review)==="human"&&s.jsx("span",{className:"hr-badge",children:"Human review"}),d?s.jsx("span",{className:"muted small",children:"Loop ends when this agent passes"}):!c&&s.jsx("span",{className:"muted small",children:bl(t.agent)?"Custom agent":Ne[t.agent].description})]}),s.jsx($j,{tree:e,path:n,count:r,label:p})]})}return s.jsx(AA,{tree:e,loop:t,path:n,siblings:r,first:d,onDragStart:f})}function AA({tree:e,loop:t,path:n,siblings:r,first:i,onDragStart:l}){const{drag:a,setBlocks:o,endDrag:u}=e,c=Dj(n),h=`loop ${c}`;return s.jsxs("div",{className:`pl-loop ${n.length>1?"nested":""} ${zj(a,n)?"dragging":""}`,"data-depth":n.length,children:[s.jsxs("div",{className:"pl-loop-head",draggable:!0,onDragStart:l,onDragEnd:u,children:[s.jsx("span",{className:"pl-num",children:c}),s.jsx("span",{className:"pl-loop-icon",children:s.jsx(as,{size:15})}),s.jsxs("span",{className:"pl-loop-title",children:[s.jsx("b",{children:n.length>1?"Nested loop":"Loop"}),i&&s.jsx("span",{className:"muted small",children:"Outer loop ends when this loop passes"})]}),s.jsxs("label",{className:"pl-max",children:[s.jsx("span",{className:"muted small",children:"Max iterations"}),s.jsx("input",{className:"input",type:"number",min:1,max:fl,step:1,value:t.maxIterations??"","aria-label":`Maximum iterations of ${h}`,onChange:d=>o(f=>Zm(f,n,{maxIterations:d.target.value===""?null:Math.max(1,Math.min(fl,Math.round(Number(d.target.value))))}))})]}),s.jsxs("label",{className:"pl-max",children:[s.jsx("span",{className:"muted small",children:"Ends when"}),s.jsxs("select",{className:"input",value:t.endsWhen,"aria-label":`When ${h} ends`,onChange:d=>o(f=>Zm(f,n,{endsWhen:d.target.value})),children:[s.jsx("option",{value:"first",children:"first entry passes"}),s.jsx("option",{value:"last",children:"last entry passes"})]})]}),s.jsx($j,{tree:e,path:n,count:r,label:h})]}),s.jsxs("div",{className:"pl-loop-body",children:[t.steps.map((d,f)=>s.jsxs("div",{className:"pl-item",children:[s.jsx(co,{tree:e,target:{parent:n,index:f},inner:!0}),s.jsx(Mj,{tree:e,block:d,path:[...n,f],siblings:t.steps.length,parentEndsWhen:t.endsWhen})]},d.uid)),s.jsx(co,{tree:e,target:{parent:n,index:t.steps.length},inner:!0,empty:t.steps.length===0}),s.jsxs("div",{className:"pl-loop-foot muted small",children:[s.jsx(as,{size:12})," repeats up to ",t.maxIterations??"?"," time",t.maxIterations===1?"":"s"]})]})]})}function co({tree:e,target:t,inner:n,empty:r}){const{blocks:i,drag:l,drop:a}=e,[o,u]=j.useState(!1),c=l!==null&&Ij(i,l,t);return s.jsx("div",{className:`pl-gap ${n?"inner":""} ${r?"empty":""} ${c?"active":""} ${o&&c?"over":""}`,onDragOver:h=>{c&&(h.preventDefault(),h.stopPropagation(),h.dataTransfer.dropEffect=l.from==="palette"||l.from==="palette-loop"?"copy":"move",o||u(!0))},onDragLeave:()=>u(!1),onDrop:h=>{h.preventDefault(),h.stopPropagation(),u(!1),a(t)},children:r?s.jsx("span",{className:"muted small",children:n?"Drop agents or a loop here to repeat them":"Drag agents or a loop here"}):s.jsx("span",{className:"pl-arrow",children:"↓"})})}function $j({tree:e,path:t,count:n,label:r}){const{setBlocks:i}=e,l=t[t.length-1];return s.jsxs("span",{className:"pl-actions",children:[s.jsx("button",{className:"btn ghost sm icon","aria-label":`Move ${r} up`,disabled:l===0,onClick:()=>i(a=>Xm(a,t,-1)),children:"↑"}),s.jsx("button",{className:"btn ghost sm icon","aria-label":`Move ${r} down`,disabled:l===n-1,onClick:()=>i(a=>Xm(a,t,1)),children:"↓"}),s.jsx("button",{className:"btn ghost sm icon","aria-label":`Remove ${r}`,onClick:()=>i(a=>RA(a,t)),children:s.jsx(kr,{size:13})})]})}const IA=[{id:"1",label:"24 h"},{id:"7",label:"7 days"},{id:"30",label:"30 days"},{id:"90",label:"90 days"}],dr=e=>e.inputTokens+e.cacheReadTokens+e.cacheWriteTokens,Pn=(e,t)=>e.trackedRuns?sn(t):"—";function DA(e){const t=new Map(e.byDay.map(i=>[i.day,i])),n=[],r=new Date;for(let i=Math.max(e.days,1)-1;i>=0;i--){const l=new Date(r.getTime()-i*864e5).toISOString().slice(0,10);n.push(t.get(l)??{day:l,runs:0,trackedRuns:0,costUsd:0,turns:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheWriteTokens:0})}return n}function zA(e){if(e<=0)return 1;const t=10**Math.floor(Math.log10(e));return([1,2,2.5,5,10].find(n=>n*t>=e)??10)*t}const Ti=e=>new Date(`${e}T00:00:00`).toLocaleDateString("en-US",{month:"short",day:"numeric"});function MA({report:e}){const t=DA(e),n=zA(Math.max(...t.map(r=>r.costUsd)));return s.jsxs("div",{children:[s.jsxs("div",{className:"usage-chart",role:"img","aria-label":`Estimated cost per day over the last ${e.days} days`,children:[[.5,1].map(r=>s.jsx("div",{className:"usage-chart-gridline",style:{bottom:`${r*100}%`},children:s.jsx("span",{children:Kt(n*r)})},r)),t.map(r=>s.jsxs("div",{className:`bar-col ${r.costUsd?"":"zero"}`,tabIndex:0,"aria-label":`${Ti(r.day)}: ${Kt(r.costUsd)}, ${r.runs} runs`,children:[s.jsx("i",{style:{height:`${Math.max(r.costUsd/n*100,r.costUsd?2:0)}%`}}),s.jsxs("span",{className:"tip",children:[s.jsx("b",{children:Ti(r.day)})," · ",Kt(r.costUsd),s.jsx("br",{}),r.runs," run",r.runs===1?"":"s"," · ",sn(dr(r))," in / ",sn(r.outputTokens)," out"]})]},r.day))]}),s.jsxs("div",{className:"usage-axis",children:[s.jsx("span",{children:Ti(t[0].day)}),t.length>2&&s.jsx("span",{children:Ti(t[Math.floor(t.length/2)].day)}),s.jsx("span",{children:Ti(t[t.length-1].day)})]})]})}function ua({icon:e,label:t,value:n,sub:r}){return s.jsxs("div",{className:"stat",children:[s.jsxs("div",{className:"stat-head",children:[s.jsx("span",{children:t}),s.jsx("span",{className:"stat-icon",children:e})]}),s.jsx("div",{className:"stat-value",children:n}),r&&s.jsx("div",{className:"muted small",children:r})]})}function Vu({title:e,rows:t,name:n,total:r}){return s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:e})}),t.length===0?s.jsx("p",{className:"muted pad",children:"No runs in this range."}):s.jsx("div",{className:"table-wrap",children:s.jsxs("table",{className:"flat",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Name"}),s.jsx("th",{className:"num",children:"Runs"}),s.jsx("th",{className:"num",children:"Tokens in"}),s.jsx("th",{className:"num",children:"Tokens out"}),s.jsx("th",{className:"num",children:"Est. cost"}),s.jsx("th",{children:"Share"})]})}),s.jsx("tbody",{children:t.map((i,l)=>s.jsxs("tr",{children:[s.jsx("td",{children:n(i)}),s.jsx("td",{className:"num",children:i.runs}),s.jsx("td",{className:"num",children:Pn(i,dr(i))}),s.jsx("td",{className:"num",children:Pn(i,i.outputTokens)}),s.jsx("td",{className:"num",children:Kt(i.costUsd)}),s.jsx("td",{children:s.jsx("div",{className:"share-bar",title:`${r?Math.round(i.costUsd/r*100):0}% of cost`,children:s.jsx("i",{style:{width:`${r?i.costUsd/r*100:0}%`}})})})]},l))})]})})]})}const _j="qa-studio.usage.recentView";function $A(){try{return localStorage.getItem(_j)==="jobs"?"jobs":"runs"}catch{return"runs"}}function _A({job:e}){return s.jsxs(s.Fragment,{children:[s.jsxs(ye,{to:`/runs/${e.jobId}`,children:["#",e.jobId," ",Sr[e.jobType]??e.jobType]}),s.jsx("div",{className:"muted small",children:e.name??e.target})]})}function OA({jobs:e}){const[t,n]=j.useState(()=>new Set),r=l=>n(a=>{const o=new Set(a);return o.has(l)?o.delete(l):o.add(l),o}),i=e.length>0&&e.every(l=>t.has(l.jobId));return e.length===0?s.jsx("p",{className:"muted pad",children:"No runs in this range."}):s.jsx("div",{className:"table-wrap",children:s.jsxs("table",{className:"flat usage-jobs",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:s.jsx("button",{className:"btn ghost sm",onClick:()=>n(i?new Set:new Set(e.map(l=>l.jobId))),children:i?"Collapse all":"Expand all"})}),s.jsx("th",{children:"Agents"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Model"}),s.jsx("th",{className:"num",children:"Turns"}),s.jsx("th",{className:"num",children:"Tokens in"}),s.jsx("th",{className:"num",children:"Tokens out"}),s.jsx("th",{className:"num",children:"Est. cost"}),s.jsx("th",{children:"When"})]})}),s.jsx("tbody",{children:e.map(l=>{const a=t.has(l.jobId),o=[...new Set(l.agentRuns.map(u=>u.model).filter(Boolean))];return s.jsxs(j.Fragment,{children:[s.jsxs("tr",{className:"usage-job-row",children:[s.jsx("td",{children:s.jsxs("span",{className:"usage-job-cell",children:[s.jsx("button",{className:"usage-expand",onClick:()=>r(l.jobId),"aria-expanded":a,"aria-label":`${a?"Hide":"Show"} the LLM runs of job #${l.jobId}`,children:s.jsx(ni,{size:12,open:a})}),s.jsx("span",{children:s.jsx(_A,{job:l})})]})}),s.jsx("td",{children:s.jsxs("span",{className:"usage-agent-icons",title:l.agentRuns.map(u=>{var c;return((c=Ne[u.agent])==null?void 0:c.label)??u.agent}).join(" → "),children:[l.agentRuns.slice(0,6).map(u=>s.jsx(Ft,{agent:u.agent,size:20},u.runId)),s.jsxs("span",{className:"muted small",children:[l.runs," run",l.runs===1?"":"s"]})]})}),s.jsx("td",{children:s.jsx(An,{status:l.status})}),s.jsx("td",{children:o.length?o.map(u=>s.jsx("code",{children:u},u)):s.jsx("span",{className:"muted",children:"—"})}),s.jsx("td",{className:"num",children:l.turns}),s.jsx("td",{className:"num",children:Pn(l,dr(l))}),s.jsx("td",{className:"num",children:Pn(l,l.outputTokens)}),s.jsx("td",{className:"num strong",children:Kt(l.costUsd)}),s.jsx("td",{className:"small",children:Rt(l.at)})]}),a&&l.agentRuns.map(u=>{var c;return s.jsxs("tr",{className:"usage-sub-row",children:[s.jsx("td",{children:s.jsxs("span",{className:"usage-sub-name",children:[s.jsx(Ft,{agent:u.agent,size:20})," ",((c=Ne[u.agent])==null?void 0:c.label)??u.agent]})}),s.jsxs("td",{className:"muted small",children:["run #",u.runId]}),s.jsx("td",{children:s.jsx(An,{status:u.status})}),s.jsx("td",{children:u.model?s.jsx("code",{children:u.model}):s.jsx("span",{className:"muted",children:"—"})}),s.jsx("td",{className:"num",children:u.turns}),s.jsx("td",{className:"num",children:Pn(u,dr(u))}),s.jsx("td",{className:"num",children:Pn(u,u.outputTokens)}),s.jsx("td",{className:"num",children:Kt(u.costUsd)}),s.jsx("td",{className:"small",children:Rt(u.at)})]},u.runId)})]},l.jobId)})})]})})}function FA(){const[e,t]=j.useState($A),n=d=>{t(d);try{localStorage.setItem(_j,d)}catch{}},[r,i]=j.useState("30"),{data:l,error:a,reload:o}=$e(()=>V.usage(Number(r)),[r]),u=l==null?void 0:l.totals,c=u&&dr(u)?Math.round(u.cacheReadTokens/dr(u)*100):0,h=u?u.runs-u.trackedRuns:0;return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Claude usage"}]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Claude usage"}),s.jsxs("p",{className:"page-sub",children:["Tokens and estimated cost of the Claude Code agents run by Agent Studio (QA Explorer, QA Script Generator, QA Script Healer, QA Test Case Writer, Context Writer). The cost is Claude Code's API-price estimate. On a Claude subscription, check plan limits with ",s.jsx("code",{children:"/usage"})," in Claude Code."]})]}),s.jsxs("div",{className:"row",children:[s.jsx(un,{value:r,onChange:i,items:IA}),s.jsx("button",{className:"btn ghost",onClick:o,title:"Refresh","aria-label":"Refresh",children:s.jsx(Jn,{size:15})})]})]}),s.jsx(Le,{error:a}),l&&u&&s.jsxs(s.Fragment,{children:[h>0&&s.jsxs("div",{className:"warn-box",style:{marginBottom:14},children:[h," of ",u.runs," runs in this range were recorded before token tracking was added: they count toward cost and runs, but their tokens show as —."]}),s.jsxs("div",{className:"stats usage-stats",children:[s.jsx(ua,{icon:s.jsx(Uy,{size:16}),label:"Estimated cost",value:Kt(u.costUsd),sub:`${u.runs?Kt(u.costUsd/u.runs):"—"} per run`}),s.jsx(ua,{icon:s.jsx(Fy,{size:16}),label:"LLM agent runs",value:u.runs,sub:`${u.turns.toLocaleString()} turns`}),s.jsx(ua,{icon:s.jsx(ft,{size:16}),label:"Tokens in",value:Pn(u,dr(u)),sub:u.trackedRuns?`${c}% served from cache`:"No token data yet"}),s.jsx(ua,{icon:s.jsx(ft,{size:16}),label:"Tokens out",value:Pn(u,u.outputTokens),sub:u.trackedRuns?`${sn(u.inputTokens)} uncached input`:"No token data yet"})]}),s.jsxs("div",{className:"card pad",style:{marginBottom:14},children:[s.jsxs("div",{className:"row between",style:{marginBottom:18},children:[s.jsx("h3",{className:"card-title",children:"Estimated cost per day"}),s.jsxs("span",{className:"muted small",children:["Since ",new Date(l.since).toLocaleString("en-US",{hour12:!1})]})]}),s.jsx(MA,{report:l})]}),s.jsxs("div",{className:"overview-grid",style:{marginBottom:14},children:[s.jsx(Vu,{title:"By spec",rows:l.bySpec,total:u.costUsd,name:d=>d.target.endsWith(".md")?s.jsx(ye,{to:`/specs/${d.target}`,children:d.target}):d.target}),s.jsx(Vu,{title:"By agent",rows:l.byAgent,total:u.costUsd,name:d=>{var f;return s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8,whiteSpace:"nowrap"},children:[s.jsx(Ft,{agent:d.agent,size:22})," ",((f=Ne[d.agent])==null?void 0:f.label)??d.agent]})}})]}),s.jsx("div",{style:{marginBottom:14},children:s.jsx(Vu,{title:"By model",rows:l.byModel,total:u.costUsd,name:d=>s.jsx("code",{children:d.model})})}),s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Recent LLM runs"}),s.jsx(un,{value:e,onChange:n,items:[{id:"runs",label:"Runs"},{id:"jobs",label:"Group by job"}]})]}),e==="jobs"?s.jsx(OA,{jobs:l.recentJobs}):l.recent.length===0?s.jsx("p",{className:"muted pad",children:"No runs in this range. Usage is recorded for agent runs from this version of Agent Studio onward."}):s.jsx("div",{className:"table-wrap",children:s.jsxs("table",{className:"flat",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Job"}),s.jsx("th",{children:"Agent"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Model"}),s.jsx("th",{className:"num",children:"Turns"}),s.jsx("th",{className:"num",children:"Tokens in"}),s.jsx("th",{className:"num",children:"Tokens out"}),s.jsx("th",{className:"num",children:"Est. cost"}),s.jsx("th",{children:"When"})]})}),s.jsx("tbody",{children:l.recent.map(d=>{var f;return s.jsxs("tr",{children:[s.jsxs("td",{children:[s.jsxs(ye,{to:`/runs/${d.jobId}`,children:["#",d.jobId," ",Sr[d.jobType]]}),s.jsx("div",{className:"muted small",children:d.target})]}),s.jsx("td",{children:((f=Ne[d.agent])==null?void 0:f.label)??d.agent}),s.jsx("td",{children:s.jsx(An,{status:d.status})}),s.jsx("td",{children:d.model?s.jsx("code",{children:d.model}):s.jsx("span",{className:"muted",children:"—"})}),s.jsx("td",{className:"num",children:d.turns}),s.jsx("td",{className:"num",children:Pn(d,dr(d))}),s.jsx("td",{className:"num",children:Pn(d,d.outputTokens)}),s.jsx("td",{className:"num",children:Kt(d.costUsd)}),s.jsx("td",{className:"small",children:Rt(d.at)})]},d.runId)})})]})})]})]})]})}const Pi=e=>`${e.spec}#${e.tcId}`;function UA(e){return e.target==="all"?"All tests":e.args.tcId?"1 TC":"Whole spec"}function BA({counts:e}){const t=Object.values(e).reduce((r,i)=>r+i,0);if(!t)return s.jsx("span",{className:"muted small",children:"—"});const n=["passed","flaky","failed","skipped"];return s.jsxs("span",{className:"row",style:{gap:8},children:[s.jsx("span",{className:"tr-progress",role:"img","aria-label":n.filter(r=>e[r]).map(r=>`${e[r]} ${r}`).join(", "),children:n.map(r=>e[r]?s.jsx("i",{className:r,style:{width:`${e[r]/t*100}%`},title:`${e[r]} ${r}`},r):null)}),s.jsxs("span",{className:"small",children:[e.passed??0,"/",t]})]})}function HA(){const e=ut(),t=Tl(),{data:n,error:r,reload:i}=$e(()=>V.testRuns({page:t.page,pageSize:t.pageSize}),[t.page,t.pageSize]),l=(n==null?void 0:n.items)??[],a=l.some(o=>o.status==="queued"||o.status==="running");return j.useEffect(()=>{if(!a)return;const o=setInterval(i,2e3);return()=>clearInterval(o)},[a,i]),s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Testing"},{label:"Test runs"}]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Test runs"}),s.jsx("p",{className:"page-sub",children:"Pick test cases, name the run, execute it and review the results. Results use the line reporter; the Playwright HTML report is optional."})]}),s.jsxs(ye,{className:"btn",to:"/test-runs/new",children:[s.jsx(qt,{size:15})," New test run"]})]}),s.jsx(Le,{error:r}),s.jsxs("div",{className:"table-wrap",children:[s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Run"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Results"}),s.jsx("th",{className:"num",children:"Cases"}),s.jsx("th",{children:"Started"}),s.jsx("th",{children:"Duration"}),s.jsx("th",{children:"Report"})]})}),s.jsx("tbody",{children:l.map(o=>s.jsxs("tr",{onClick:()=>e(`/runs/${o.id}`),style:{cursor:"pointer"},children:[s.jsxs("td",{children:[s.jsx("div",{className:"strong",children:o.args.name??`Test run #${o.id}`}),s.jsxs("div",{className:"muted small",children:["#",o.id,o.args.repeatEach&&o.args.repeatEach>1?` · ${o.args.repeatEach}×`:"",o.args.retries!==void 0?` · retries ${o.args.retries}`:""]})]}),s.jsx("td",{children:s.jsx(An,{status:o.status})}),s.jsx("td",{children:s.jsx(BA,{counts:o.counts})}),s.jsx("td",{className:"num",children:o.args.selection?o.caseCount:s.jsx("span",{className:"muted small",children:UA(o)})}),s.jsx("td",{className:"muted small",children:Rt(o.startedAt??o.createdAt)}),s.jsx("td",{className:"muted small",children:br(o.startedAt,o.finishedAt)}),s.jsx("td",{onClick:u=>u.stopPropagation(),children:o.hasHtmlReport?s.jsxs("a",{className:"btn ghost",href:jh(o.id),target:"_blank",rel:"noreferrer",children:[s.jsx(Nh,{size:13})," HTML"]}):s.jsx("span",{className:"muted small",children:"line only"})})]},o.id))})]}),n&&l.length===0&&s.jsxs("p",{className:"muted",style:{padding:16},children:["No test runs yet. ",s.jsx(ye,{to:"/test-runs/new",children:"Create the first one"}),"."]}),n&&s.jsx(ms,{page:t.page,pageSize:t.pageSize,total:n.total,onPage:t.setPage,onPageSize:t.setPageSize,label:"runs"})]})]})}const WA=8;function VA({query:e,onQuery:t,tags:n,allTags:r,onToggleTag:i,onClearTags:l}){const[a,o]=j.useState(!1),[u,c]=j.useState(0),h=j.useRef(null),d=e.trim().toLowerCase().replace(/^#/,""),f=r.filter(w=>!n.has(w)&&(!d||w.toLowerCase().includes(d))).sort((w,y)=>+!w.toLowerCase().startsWith(d)-+!y.toLowerCase().startsWith(d)).slice(0,WA),m=a&&f.length>0&&(d.length>0||n.size===0||e==="");j.useEffect(()=>c(0),[d]);const p=w=>{var y;i(w),t(""),c(0),(y=h.current)==null||y.focus()},g=w=>{var y;w.key==="ArrowDown"&&m?(w.preventDefault(),c(x=>(x+1)%f.length)):w.key==="ArrowUp"&&m?(w.preventDefault(),c(x=>(x-1+f.length)%f.length)):w.key==="Enter"?(w.preventDefault(),m&&d&&p(f[u])):w.key==="Escape"?e?t(""):(y=h.current)==null||y.blur():w.key==="Backspace"&&e===""&&n.size>0&&i([...n][n.size-1])};return s.jsxs("div",{className:"tag-search grow",onClick:()=>{var w;return(w=h.current)==null?void 0:w.focus()},children:[s.jsx(Ro,{size:15}),[...n].map(w=>s.jsxs("span",{className:"tag-token",children:["#",w,s.jsx("button",{type:"button","aria-label":`Remove tag filter ${w}`,onClick:y=>{y.stopPropagation(),i(w)},children:s.jsx(kr,{size:11})})]},w)),s.jsx("input",{ref:h,className:"tag-search-input",placeholder:n.size?"Add text or another tag…":"Search TC-ID, title, spec or tag…",value:e,onChange:w=>t(w.target.value),onFocus:()=>o(!0),onBlur:()=>o(!1),onKeyDown:g,role:"combobox","aria-expanded":m,"aria-controls":"tag-suggestions","aria-activedescendant":m?`tag-opt-${u}`:void 0,"aria-label":"Search test cases or filter by tag"}),n.size>0&&s.jsx("button",{type:"button",className:"tag-search-clear",onClick:w=>{w.stopPropagation(),l()},title:"Clear tag filters","aria-label":"Clear tag filters",children:"Clear tags"}),m&&s.jsxs("ul",{id:"tag-suggestions",className:"tag-suggestions",role:"listbox","aria-label":"Tags",children:[s.jsx("li",{className:"tag-suggestions-head","aria-hidden":"true",children:"Filter by tag"}),f.map((w,y)=>s.jsxs("li",{id:`tag-opt-${y}`,role:"option","aria-selected":y===u,className:y===u?"active":"",onMouseEnter:()=>c(y),onMouseDown:x=>{x.preventDefault(),p(w)},children:["#",w]},w))]})]})}const QA=()=>`Test run ${new Date().toLocaleString("en-GB",{hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}`;function qA(){var Zt;const e=ut(),n=Yn().state??null,{specs:r}=cn(),i=$e(()=>V.settings()),[l,a]=j.useState((n==null?void 0:n.name)??QA()),[o,u]=j.useState(()=>new Map(((n==null?void 0:n.selection)??[]).map(ee=>[Pi(ee),ee]))),[c,h]=j.useState(""),d=db(c.trim(),250),[f,m]=j.useState(""),[p,g]=j.useState(new Set),[w,y]=j.useState("all"),[x,v]=j.useState(!1),[b,A]=j.useState(1),[k,E]=j.useState((n==null?void 0:n.retries)??null),[T,I]=j.useState(null),[C,R]=j.useState(!1),[L,M]=j.useState(null),U=T??((Zt=i.data)==null?void 0:Zt.settings.htmlReport)??!0,D=[...p].sort(),q=x?[...o.keys()].sort():null,J=Tl([],50),B=JSON.stringify([d,f,D,w,x]),[X,S]=j.useState(B),ae=B!==X;ae&&(S(B),J.page!==1&&J.setPage(1));const O=ae?1:J.page,N=$e(()=>V.searchTestCases({page:O,pageSize:J.pageSize,q:d,tags:D,spec:f,result:w,...q?{selected:q}:{}}),[O,J.pageSize,d,f,D.join("\0"),w,(q==null?void 0:q.join("\0"))??null]),F=N.data,Z=(F==null?void 0:F.items)??[],ce=(F==null?void 0:F.allTags)??[],Te=(F==null?void 0:F.matchingRunnable)??[],tt=Te.length>0&&Te.every(ee=>o.has(Pi(ee))),W=[...o.values()],ge=new Set(W.map(ee=>ee.spec)).size,Q=ee=>u(Ce=>{const Ze=new Map(Ce),Mr=Pi(ee);return Ze.has(Mr)?Ze.delete(Mr):Ze.set(Mr,ee),Ze}),de=()=>u(ee=>{const Ce=new Map(ee);for(const Ze of Te)tt?Ce.delete(Pi(Ze)):Ce.set(Pi(Ze),Ze);return Ce}),ve=ee=>g(Ce=>{const Ze=new Set(Ce);return Ze.has(ee)?Ze.delete(ee):Ze.add(ee),Ze}),ct=async ee=>{if(ee.preventDefault(),!l.trim())return M("Give the test run a name.");if(!W.length)return M("Pick at least one test case that has a Playwright test.");if(W.length>_p)return M(`A test run can have at most ${_p} test cases.`);R(!0);try{const Ce=await V.createJob({type:"testrun",name:l.trim(),selection:W,repeatEach:b,...k!==null?{retries:k}:{},htmlReport:U});e(`/runs/${Ce.id}`)}catch(Ce){M(Ce.message),R(!1)}};return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Testing"},{label:"Test runs",to:"/test-runs"},{label:"New test run"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"New test run"}),s.jsx("p",{className:"page-sub",children:"Filter and pick test cases. Only test cases that have a Playwright test can be run."})]})}),s.jsxs("form",{className:"tr-layout",onSubmit:ct,children:[s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"tr-filters",children:[s.jsx(VA,{query:c,onQuery:h,tags:p,allTags:ce,onToggleTag:ve,onClearTags:()=>g(new Set)}),s.jsxs("select",{className:"select",value:f,onChange:ee=>m(ee.target.value),"aria-label":"Spec",children:[s.jsx("option",{value:"",children:"All specs"}),r.map(ee=>s.jsx("option",{value:ee.file,children:ee.file},ee.file))]}),s.jsxs("select",{className:"select",value:w,onChange:ee=>y(ee.target.value),"aria-label":"Last result",children:[s.jsx("option",{value:"all",children:"Any last result"}),s.jsx("option",{value:"passed",children:"Last passed"}),s.jsx("option",{value:"failed",children:"Last failed"}),s.jsx("option",{value:"none",children:"Never run"})]}),s.jsxs("label",{className:"row small",style:{gap:6},children:[s.jsx("input",{type:"checkbox",checked:x,onChange:ee=>v(ee.target.checked)})," Selected only"]})]}),s.jsxs("div",{className:"table-wrap",style:{border:0},children:[s.jsxs("table",{className:"tr-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"check",children:s.jsx("input",{type:"checkbox",checked:tt,onChange:de,disabled:!Te.length,"aria-label":`Select all ${Te.length} filtered test cases`,title:`All ${Te.length} runnable test cases that match the filters (every page)`})}),s.jsx("th",{children:"Test case"}),s.jsx("th",{children:"Spec"}),s.jsx("th",{children:"Tags"}),s.jsx("th",{children:"Last result"})]})}),s.jsx("tbody",{children:Z.map(ee=>s.jsxs("tr",{className:`${ee.runnable?"":"disabled"} ${o.has(ee.key)?"picked":""}`,onClick:()=>ee.runnable&&Q(ee.ref),style:{cursor:ee.runnable?"pointer":"default"},children:[s.jsx("td",{className:"check",onClick:Ce=>Ce.stopPropagation(),children:s.jsx("input",{type:"checkbox",checked:o.has(ee.key),disabled:!ee.runnable,onChange:()=>Q(ee.ref),"aria-label":`Select ${ee.tcId}`})}),s.jsxs("td",{children:[s.jsx("code",{children:ee.tcId})," ",ee.tcTitle,!ee.runnable&&s.jsx("div",{className:"muted small",children:"No Playwright test yet: generate it first"})]}),s.jsx("td",{className:"small",children:s.jsx(ye,{to:`/specs/${ee.ref.spec}`,onClick:Ce=>Ce.stopPropagation(),children:ee.ref.spec})}),s.jsx("td",{children:s.jsx("span",{className:"row",style:{gap:4,flexWrap:"wrap"},children:ee.tags.map(Ce=>s.jsx("button",{type:"button",className:`tag tag-btn ${p.has(Ce)?"on":""}`,title:p.has(Ce)?`Remove the "${Ce}" filter`:`Filter by "${Ce}"`,onClick:Ze=>{Ze.stopPropagation(),ve(Ce)},children:Ce},Ce))})}),s.jsx("td",{children:ee.lastResult?s.jsx(ri,{status:ee.lastResult.status,title:Rt(ee.lastResult.at)}):s.jsx("span",{className:"muted small",children:"never"})})]},ee.key))})]}),s.jsx(Le,{error:N.error}),F&&Z.length===0&&s.jsx("p",{className:"muted",style:{padding:16},children:F.totalCases?"No test case matches the filters.":"No test cases yet: add a spec first."}),!F&&!N.error&&s.jsx("p",{className:"muted",style:{padding:16},children:"Loading test cases…"}),F&&s.jsx(ms,{page:O,pageSize:J.pageSize,total:F.total,onPage:J.setPage,onPageSize:J.setPageSize,label:"test cases"})]})]}),s.jsx("div",{className:"tr-side",children:s.jsxs("div",{className:"card pad",style:{display:"grid",gap:12},children:[s.jsxs("label",{children:["Run name",s.jsx("input",{className:"input",value:l,maxLength:Tb,onChange:ee=>a(ee.target.value)})]}),s.jsxs("label",{children:["Repeat each test",s.jsx("select",{className:"select",value:b,onChange:ee=>A(Number(ee.target.value)),children:[1,2,3,5,10].map(ee=>s.jsxs("option",{value:ee,children:[ee,"×"]},ee))})]}),s.jsxs("label",{children:["Retries on failure",s.jsxs("select",{className:"select",value:k??"",onChange:ee=>E(ee.target.value===""?null:Number(ee.target.value)),children:[s.jsx("option",{value:"",children:"Default (playwright.config.ts)"}),Array.from({length:Eb+1},(ee,Ce)=>s.jsx("option",{value:Ce,children:Ce===0?"No retries":`${Ce} ${Ce===1?"retry":"retries"}`},Ce))]}),s.jsx("div",{className:"muted small",children:"A test that fails and then passes on a retry is reported as flaky."})]}),s.jsxs("div",{className:"row between",children:[s.jsxs("span",{style:{fontSize:13,fontWeight:600},children:["HTML report",s.jsx("div",{className:"muted small",style:{fontWeight:400},children:"Line report is always on"})]}),s.jsxs("label",{className:"switch",children:[s.jsx("input",{type:"checkbox",checked:U,onChange:ee=>I(ee.target.checked),"aria-label":"Also write the Playwright HTML report"}),s.jsx("span",{children:U?"On":"Off"})]})]}),s.jsxs("div",{className:"muted small",children:[s.jsx("b",{style:{color:"var(--text)"},children:W.length})," test case",W.length===1?"":"s"," selected from ",ge," spec",ge===1?"":"s",o.size>0&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("button",{type:"button",className:"link-btn",onClick:()=>u(new Map),children:"clear"})]})]}),s.jsx(Le,{error:L}),s.jsxs("button",{type:"submit",className:"btn",disabled:C||!W.length,children:[s.jsx(ft,{size:14})," ",C?"Starting…":"Create & run"]})]})})]})]})}const GA=F0([{element:s.jsx(pS,{}),children:[{path:"/",element:s.jsx(NL,{})},{path:"/chat/:id?",element:s.jsx(mA,{})},{path:"/specs",element:s.jsx(zL,{})},{path:"/specs/from-requirement",element:s.jsx(AL,{})},{path:"/specs/:file",element:s.jsx(WL,{})},{path:"/mapping",element:s.jsx(SL,{})},{path:"/runs",element:s.jsx(IL,{})},{path:"/runs/:id",element:s.jsx(uL,{})},{path:"/agents",element:s.jsx(JL,{})},{path:"/agents/custom/new",element:s.jsx(Jm,{},"new")},{path:"/agents/custom/:id",element:s.jsx(Jm,{})},{path:"/agents/:agent",element:s.jsx(kA,{})},{path:"/agents/pipelines/new",element:s.jsx(eg,{},"new")},{path:"/agents/pipelines/:id",element:s.jsx(eg,{})},{path:"/usage",element:s.jsx(FA,{})},{path:"/test-runs",element:s.jsx(HA,{})},{path:"/test-runs/new",element:s.jsx(qA,{})},{path:"/project",element:s.jsx(EL,{})},{path:"/project/reset",element:s.jsx(PL,{})},{path:"/settings",element:s.jsx(KL,{})},{path:"*",element:s.jsx("p",{children:"Page not found."})}]}],{future:{v7_relativeSplatPath:!0,v7_fetcherPersist:!0,v7_normalizeFormMethod:!0,v7_partialHydration:!0,v7_skipActionErrorRevalidation:!0}});"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(e=>console.warn("Service worker registration failed",e))});py(document.getElementById("root")).render(s.jsx(j.StrictMode,{children:s.jsx(G0,{router:GA,future:{v7_startTransition:!0}})}));