assuremind 1.4.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli/index.js +164 -163
- package/package.json +4 -1
- package/templates/env.minimal +18 -6
- package/ui/dist/assets/index-CDdZfob4.css +1 -0
- package/ui/dist/assets/index-Dqfu_NfK.js +1029 -0
- package/ui/dist/index.html +2 -2
- package/ui/dist/assets/index-DqkGvedS.js +0 -1024
- package/ui/dist/assets/index-Dry-Q0Et.css +0 -1
|
@@ -0,0 +1,1029 @@
|
|
|
1
|
+
function by(s,r){for(var a=0;a<r.length;a++){const o=r[a];if(typeof o!="string"&&!Array.isArray(o)){for(const c in o)if(c!=="default"&&!(c in s)){const u=Object.getOwnPropertyDescriptor(o,c);u&&Object.defineProperty(s,c,u.get?u:{enumerable:!0,get:()=>o[c]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const x of u.addedNodes)x.tagName==="LINK"&&x.rel==="modulepreload"&&o(x)}).observe(document,{childList:!0,subtree:!0});function a(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(c){if(c.ep)return;c.ep=!0;const u=a(c);fetch(c.href,u)}})();function vy(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Pd={exports:{}},li={},Rd={exports:{}},Ie={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Lh;function jy(){if(Lh)return Ie;Lh=1;var s=Symbol.for("react.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),x=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),N=Symbol.iterator;function E(T){return T===null||typeof T!="object"?null:(T=N&&T[N]||T["@@iterator"],typeof T=="function"?T:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},P=Object.assign,M={};function k(T,D,ce){this.props=T,this.context=D,this.refs=M,this.updater=ce||S}k.prototype.isReactComponent={},k.prototype.setState=function(T,D){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,D,"setState")},k.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function j(){}j.prototype=k.prototype;function v(T,D,ce){this.props=T,this.context=D,this.refs=M,this.updater=ce||S}var z=v.prototype=new j;z.constructor=v,P(z,k.prototype),z.isPureReactComponent=!0;var C=Array.isArray,w=Object.prototype.hasOwnProperty,F={current:null},Q={key:!0,ref:!0,__self:!0,__source:!0};function Z(T,D,ce){var G,xe={},je=null,Ae=null;if(D!=null)for(G in D.ref!==void 0&&(Ae=D.ref),D.key!==void 0&&(je=""+D.key),D)w.call(D,G)&&!Q.hasOwnProperty(G)&&(xe[G]=D[G]);var he=arguments.length-2;if(he===1)xe.children=ce;else if(1<he){for(var Pe=Array(he),Ke=0;Ke<he;Ke++)Pe[Ke]=arguments[Ke+2];xe.children=Pe}if(T&&T.defaultProps)for(G in he=T.defaultProps,he)xe[G]===void 0&&(xe[G]=he[G]);return{$$typeof:s,type:T,key:je,ref:Ae,props:xe,_owner:F.current}}function le(T,D){return{$$typeof:s,type:T.type,key:D,ref:T.ref,props:T.props,_owner:T._owner}}function K(T){return typeof T=="object"&&T!==null&&T.$$typeof===s}function J(T){var D={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(ce){return D[ce]})}var ue=/\/+/g;function ke(T,D){return typeof T=="object"&&T!==null&&T.key!=null?J(""+T.key):D.toString(36)}function re(T,D,ce,G,xe){var je=typeof T;(je==="undefined"||je==="boolean")&&(T=null);var Ae=!1;if(T===null)Ae=!0;else switch(je){case"string":case"number":Ae=!0;break;case"object":switch(T.$$typeof){case s:case r:Ae=!0}}if(Ae)return Ae=T,xe=xe(Ae),T=G===""?"."+ke(Ae,0):G,C(xe)?(ce="",T!=null&&(ce=T.replace(ue,"$&/")+"/"),re(xe,D,ce,"",function(Ke){return Ke})):xe!=null&&(K(xe)&&(xe=le(xe,ce+(!xe.key||Ae&&Ae.key===xe.key?"":(""+xe.key).replace(ue,"$&/")+"/")+T)),D.push(xe)),1;if(Ae=0,G=G===""?".":G+":",C(T))for(var he=0;he<T.length;he++){je=T[he];var Pe=G+ke(je,he);Ae+=re(je,D,ce,Pe,xe)}else if(Pe=E(T),typeof Pe=="function")for(T=Pe.call(T),he=0;!(je=T.next()).done;)je=je.value,Pe=G+ke(je,he++),Ae+=re(je,D,ce,Pe,xe);else if(je==="object")throw D=String(T),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.");return Ae}function be(T,D,ce){if(T==null)return T;var G=[],xe=0;return re(T,G,"","",function(je){return D.call(ce,je,xe++)}),G}function Ne(T){if(T._status===-1){var D=T._result;D=D(),D.then(function(ce){(T._status===0||T._status===-1)&&(T._status=1,T._result=ce)},function(ce){(T._status===0||T._status===-1)&&(T._status=2,T._result=ce)}),T._status===-1&&(T._status=0,T._result=D)}if(T._status===1)return T._result.default;throw T._result}var ye={current:null},_={transition:null},Y={ReactCurrentDispatcher:ye,ReactCurrentBatchConfig:_,ReactCurrentOwner:F};function L(){throw Error("act(...) is not supported in production builds of React.")}return Ie.Children={map:be,forEach:function(T,D,ce){be(T,function(){D.apply(this,arguments)},ce)},count:function(T){var D=0;return be(T,function(){D++}),D},toArray:function(T){return be(T,function(D){return D})||[]},only:function(T){if(!K(T))throw Error("React.Children.only expected to receive a single React element child.");return T}},Ie.Component=k,Ie.Fragment=a,Ie.Profiler=c,Ie.PureComponent=v,Ie.StrictMode=o,Ie.Suspense=f,Ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y,Ie.act=L,Ie.cloneElement=function(T,D,ce){if(T==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+T+".");var G=P({},T.props),xe=T.key,je=T.ref,Ae=T._owner;if(D!=null){if(D.ref!==void 0&&(je=D.ref,Ae=F.current),D.key!==void 0&&(xe=""+D.key),T.type&&T.type.defaultProps)var he=T.type.defaultProps;for(Pe in D)w.call(D,Pe)&&!Q.hasOwnProperty(Pe)&&(G[Pe]=D[Pe]===void 0&&he!==void 0?he[Pe]:D[Pe])}var Pe=arguments.length-2;if(Pe===1)G.children=ce;else if(1<Pe){he=Array(Pe);for(var Ke=0;Ke<Pe;Ke++)he[Ke]=arguments[Ke+2];G.children=he}return{$$typeof:s,type:T.type,key:xe,ref:je,props:G,_owner:Ae}},Ie.createContext=function(T){return T={$$typeof:x,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},T.Provider={$$typeof:u,_context:T},T.Consumer=T},Ie.createElement=Z,Ie.createFactory=function(T){var D=Z.bind(null,T);return D.type=T,D},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function(T){return{$$typeof:h,render:T}},Ie.isValidElement=K,Ie.lazy=function(T){return{$$typeof:y,_payload:{_status:-1,_result:T},_init:Ne}},Ie.memo=function(T,D){return{$$typeof:g,type:T,compare:D===void 0?null:D}},Ie.startTransition=function(T){var D=_.transition;_.transition={};try{T()}finally{_.transition=D}},Ie.unstable_act=L,Ie.useCallback=function(T,D){return ye.current.useCallback(T,D)},Ie.useContext=function(T){return ye.current.useContext(T)},Ie.useDebugValue=function(){},Ie.useDeferredValue=function(T){return ye.current.useDeferredValue(T)},Ie.useEffect=function(T,D){return ye.current.useEffect(T,D)},Ie.useId=function(){return ye.current.useId()},Ie.useImperativeHandle=function(T,D,ce){return ye.current.useImperativeHandle(T,D,ce)},Ie.useInsertionEffect=function(T,D){return ye.current.useInsertionEffect(T,D)},Ie.useLayoutEffect=function(T,D){return ye.current.useLayoutEffect(T,D)},Ie.useMemo=function(T,D){return ye.current.useMemo(T,D)},Ie.useReducer=function(T,D,ce){return ye.current.useReducer(T,D,ce)},Ie.useRef=function(T){return ye.current.useRef(T)},Ie.useState=function(T){return ye.current.useState(T)},Ie.useSyncExternalStore=function(T,D,ce){return ye.current.useSyncExternalStore(T,D,ce)},Ie.useTransition=function(){return ye.current.useTransition()},Ie.version="18.3.1",Ie}var _h;function Lu(){return _h||(_h=1,Rd.exports=jy()),Rd.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Uh;function Ny(){if(Uh)return li;Uh=1;var s=Lu(),r=Symbol.for("react.element"),a=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,c=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function x(h,f,g){var y,N={},E=null,S=null;g!==void 0&&(E=""+g),f.key!==void 0&&(E=""+f.key),f.ref!==void 0&&(S=f.ref);for(y in f)o.call(f,y)&&!u.hasOwnProperty(y)&&(N[y]=f[y]);if(h&&h.defaultProps)for(y in f=h.defaultProps,f)N[y]===void 0&&(N[y]=f[y]);return{$$typeof:r,type:h,key:E,ref:S,props:N,_owner:c.current}}return li.Fragment=a,li.jsx=x,li.jsxs=x,li}var $h;function wy(){return $h||($h=1,Pd.exports=Ny()),Pd.exports}var e=wy(),p=Lu();const ky=vy(p),Sy=by({__proto__:null,default:ky},[p]);var Xo={},Md={exports:{}},Yt={},Td={exports:{}},zd={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var Bh;function Cy(){return Bh||(Bh=1,(function(s){function r(_,Y){var L=_.length;_.push(Y);e:for(;0<L;){var T=L-1>>>1,D=_[T];if(0<c(D,Y))_[T]=Y,_[L]=D,L=T;else break e}}function a(_){return _.length===0?null:_[0]}function o(_){if(_.length===0)return null;var Y=_[0],L=_.pop();if(L!==Y){_[0]=L;e:for(var T=0,D=_.length,ce=D>>>1;T<ce;){var G=2*(T+1)-1,xe=_[G],je=G+1,Ae=_[je];if(0>c(xe,L))je<D&&0>c(Ae,xe)?(_[T]=Ae,_[je]=L,T=je):(_[T]=xe,_[G]=L,T=G);else if(je<D&&0>c(Ae,L))_[T]=Ae,_[je]=L,T=je;else break e}}return Y}function c(_,Y){var L=_.sortIndex-Y.sortIndex;return L!==0?L:_.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;s.unstable_now=function(){return u.now()}}else{var x=Date,h=x.now();s.unstable_now=function(){return x.now()-h}}var f=[],g=[],y=1,N=null,E=3,S=!1,P=!1,M=!1,k=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function z(_){for(var Y=a(g);Y!==null;){if(Y.callback===null)o(g);else if(Y.startTime<=_)o(g),Y.sortIndex=Y.expirationTime,r(f,Y);else break;Y=a(g)}}function C(_){if(M=!1,z(_),!P)if(a(f)!==null)P=!0,Ne(w);else{var Y=a(g);Y!==null&&ye(C,Y.startTime-_)}}function w(_,Y){P=!1,M&&(M=!1,j(Z),Z=-1),S=!0;var L=E;try{for(z(Y),N=a(f);N!==null&&(!(N.expirationTime>Y)||_&&!J());){var T=N.callback;if(typeof T=="function"){N.callback=null,E=N.priorityLevel;var D=T(N.expirationTime<=Y);Y=s.unstable_now(),typeof D=="function"?N.callback=D:N===a(f)&&o(f),z(Y)}else o(f);N=a(f)}if(N!==null)var ce=!0;else{var G=a(g);G!==null&&ye(C,G.startTime-Y),ce=!1}return ce}finally{N=null,E=L,S=!1}}var F=!1,Q=null,Z=-1,le=5,K=-1;function J(){return!(s.unstable_now()-K<le)}function ue(){if(Q!==null){var _=s.unstable_now();K=_;var Y=!0;try{Y=Q(!0,_)}finally{Y?ke():(F=!1,Q=null)}}else F=!1}var ke;if(typeof v=="function")ke=function(){v(ue)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,be=re.port2;re.port1.onmessage=ue,ke=function(){be.postMessage(null)}}else ke=function(){k(ue,0)};function Ne(_){Q=_,F||(F=!0,ke())}function ye(_,Y){Z=k(function(){_(s.unstable_now())},Y)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(_){_.callback=null},s.unstable_continueExecution=function(){P||S||(P=!0,Ne(w))},s.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):le=0<_?Math.floor(1e3/_):5},s.unstable_getCurrentPriorityLevel=function(){return E},s.unstable_getFirstCallbackNode=function(){return a(f)},s.unstable_next=function(_){switch(E){case 1:case 2:case 3:var Y=3;break;default:Y=E}var L=E;E=Y;try{return _()}finally{E=L}},s.unstable_pauseExecution=function(){},s.unstable_requestPaint=function(){},s.unstable_runWithPriority=function(_,Y){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var L=E;E=_;try{return Y()}finally{E=L}},s.unstable_scheduleCallback=function(_,Y,L){var T=s.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?T+L:T):L=T,_){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=L+D,_={id:y++,callback:Y,priorityLevel:_,startTime:L,expirationTime:D,sortIndex:-1},L>T?(_.sortIndex=L,r(g,_),a(f)===null&&_===a(g)&&(M?(j(Z),Z=-1):M=!0,ye(C,L-T))):(_.sortIndex=D,r(f,_),P||S||(P=!0,Ne(w))),_},s.unstable_shouldYield=J,s.unstable_wrapCallback=function(_){var Y=E;return function(){var L=E;E=Y;try{return _.apply(this,arguments)}finally{E=L}}}})(zd)),zd}var qh;function Ey(){return qh||(qh=1,Td.exports=Cy()),Td.exports}/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Hh;function Py(){if(Hh)return Yt;Hh=1;var s=Lu(),r=Ey();function a(t){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+t,i=1;i<arguments.length;i++)n+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,c={};function u(t,n){x(t,n),x(t+"Capture",n)}function x(t,n){for(c[t]=n,t=0;t<n.length;t++)o.add(n[t])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,g=/^[: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]*$/,y={},N={};function E(t){return f.call(N,t)?!0:f.call(y,t)?!1:g.test(t)?N[t]=!0:(y[t]=!0,!1)}function S(t,n,i,l){if(i!==null&&i.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return l?!1:i!==null?!i.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function P(t,n,i,l){if(n===null||typeof n>"u"||S(t,n,i,l))return!0;if(l)return!1;if(i!==null)switch(i.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function M(t,n,i,l,d,m,b){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=l,this.attributeNamespace=d,this.mustUseProperty=i,this.propertyName=t,this.type=n,this.sanitizeURL=m,this.removeEmptyString=b}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){k[t]=new M(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var n=t[0];k[n]=new M(n,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){k[t]=new M(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){k[t]=new M(t,2,!1,t,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(t){k[t]=new M(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){k[t]=new M(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){k[t]=new M(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){k[t]=new M(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){k[t]=new M(t,5,!1,t.toLowerCase(),null,!1,!1)});var j=/[\-:]([a-z])/g;function v(t){return t[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(t){var n=t.replace(j,v);k[n]=new M(n,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var n=t.replace(j,v);k[n]=new M(n,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var n=t.replace(j,v);k[n]=new M(n,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){k[t]=new M(t,1,!1,t.toLowerCase(),null,!1,!1)}),k.xlinkHref=new M("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){k[t]=new M(t,1,!1,t.toLowerCase(),null,!0,!0)});function z(t,n,i,l){var d=k.hasOwnProperty(n)?k[n]:null;(d!==null?d.type!==0:l||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(P(n,i,d,l)&&(i=null),l||d===null?E(n)&&(i===null?t.removeAttribute(n):t.setAttribute(n,""+i)):d.mustUseProperty?t[d.propertyName]=i===null?d.type===3?!1:"":i:(n=d.attributeName,l=d.attributeNamespace,i===null?t.removeAttribute(n):(d=d.type,i=d===3||d===4&&i===!0?"":""+i,l?t.setAttributeNS(l,n,i):t.setAttribute(n,i))))}var C=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for("react.element"),F=Symbol.for("react.portal"),Q=Symbol.for("react.fragment"),Z=Symbol.for("react.strict_mode"),le=Symbol.for("react.profiler"),K=Symbol.for("react.provider"),J=Symbol.for("react.context"),ue=Symbol.for("react.forward_ref"),ke=Symbol.for("react.suspense"),re=Symbol.for("react.suspense_list"),be=Symbol.for("react.memo"),Ne=Symbol.for("react.lazy"),ye=Symbol.for("react.offscreen"),_=Symbol.iterator;function Y(t){return t===null||typeof t!="object"?null:(t=_&&t[_]||t["@@iterator"],typeof t=="function"?t:null)}var L=Object.assign,T;function D(t){if(T===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);T=n&&n[1]||""}return`
|
|
34
|
+
`+T+t}var ce=!1;function G(t,n){if(!t||ce)return"";ce=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(H){var l=H}Reflect.construct(t,[],n)}else{try{n.call()}catch(H){l=H}t.call(n.prototype)}else{try{throw Error()}catch(H){l=H}t()}}catch(H){if(H&&l&&typeof H.stack=="string"){for(var d=H.stack.split(`
|
|
35
|
+
`),m=l.stack.split(`
|
|
36
|
+
`),b=d.length-1,R=m.length-1;1<=b&&0<=R&&d[b]!==m[R];)R--;for(;1<=b&&0<=R;b--,R--)if(d[b]!==m[R]){if(b!==1||R!==1)do if(b--,R--,0>R||d[b]!==m[R]){var A=`
|
|
37
|
+
`+d[b].replace(" at new "," at ");return t.displayName&&A.includes("<anonymous>")&&(A=A.replace("<anonymous>",t.displayName)),A}while(1<=b&&0<=R);break}}}finally{ce=!1,Error.prepareStackTrace=i}return(t=t?t.displayName||t.name:"")?D(t):""}function xe(t){switch(t.tag){case 5:return D(t.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("SuspenseList");case 0:case 2:case 15:return t=G(t.type,!1),t;case 11:return t=G(t.type.render,!1),t;case 1:return t=G(t.type,!0),t;default:return""}}function je(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Q:return"Fragment";case F:return"Portal";case le:return"Profiler";case Z:return"StrictMode";case ke:return"Suspense";case re:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case J:return(t.displayName||"Context")+".Consumer";case K:return(t._context.displayName||"Context")+".Provider";case ue:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case be:return n=t.displayName||null,n!==null?n:je(t.type)||"Memo";case Ne:n=t._payload,t=t._init;try{return je(t(n))}catch{}}return null}function Ae(t){var n=t.type;switch(t.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=n.render,t=t.displayName||t.name||"",n.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return je(n);case 8:return n===Z?"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 n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function he(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Pe(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ke(t){var n=Pe(t)?"checked":"value",i=Object.getOwnPropertyDescriptor(t.constructor.prototype,n),l=""+t[n];if(!t.hasOwnProperty(n)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,m=i.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return d.call(this)},set:function(b){l=""+b,m.call(this,b)}}),Object.defineProperty(t,n,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(b){l=""+b},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function yt(t){t._valueTracker||(t._valueTracker=Ke(t))}function qt(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var i=n.getValue(),l="";return t&&(l=Pe(t)?t.checked?"true":"false":t.value),t=l,t!==i?(n.setValue(t),!0):!1}function Ye(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function ie(t,n){var i=n.checked;return L({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??t._wrapperState.initialChecked})}function Mt(t,n){var i=n.defaultValue==null?"":n.defaultValue,l=n.checked!=null?n.checked:n.defaultChecked;i=he(n.value!=null?n.value:i),t._wrapperState={initialChecked:l,initialValue:i,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function xt(t,n){n=n.checked,n!=null&&z(t,"checked",n,!1)}function Ft(t,n){xt(t,n);var i=he(n.value),l=n.type;if(i!=null)l==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+i):t.value!==""+i&&(t.value=""+i);else if(l==="submit"||l==="reset"){t.removeAttribute("value");return}n.hasOwnProperty("value")?ys(t,n.type,i):n.hasOwnProperty("defaultValue")&&ys(t,n.type,he(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(t.defaultChecked=!!n.defaultChecked)}function zs(t,n,i){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var l=n.type;if(!(l!=="submit"&&l!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+t._wrapperState.initialValue,i||n===t.value||(t.value=n),t.defaultValue=n}i=t.name,i!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,i!==""&&(t.name=i)}function ys(t,n,i){(n!=="number"||Ye(t.ownerDocument)!==t)&&(i==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+i&&(t.defaultValue=""+i))}var q=Array.isArray;function pe(t,n,i,l){if(t=t.options,n){n={};for(var d=0;d<i.length;d++)n["$"+i[d]]=!0;for(i=0;i<t.length;i++)d=n.hasOwnProperty("$"+t[i].value),t[i].selected!==d&&(t[i].selected=d),d&&l&&(t[i].defaultSelected=!0)}else{for(i=""+he(i),n=null,d=0;d<t.length;d++){if(t[d].value===i){t[d].selected=!0,l&&(t[d].defaultSelected=!0);return}n!==null||t[d].disabled||(n=t[d])}n!==null&&(n.selected=!0)}}function Fe(t,n){if(n.dangerouslySetInnerHTML!=null)throw Error(a(91));return L({},n,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function bs(t,n){var i=n.value;if(i==null){if(i=n.children,n=n.defaultValue,i!=null){if(n!=null)throw Error(a(92));if(q(i)){if(1<i.length)throw Error(a(93));i=i[0]}n=i}n==null&&(n=""),i=n}t._wrapperState={initialValue:he(i)}}function bt(t,n){var i=he(n.value),l=he(n.defaultValue);i!=null&&(i=""+i,i!==t.value&&(t.value=i),n.defaultValue==null&&t.defaultValue!==i&&(t.defaultValue=i)),l!=null&&(t.defaultValue=""+l)}function As(t){var n=t.textContent;n===t._wrapperState.initialValue&&n!==""&&n!==null&&(t.value=n)}function ts(t){switch(t){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 mt(t,n){return t==null||t==="http://www.w3.org/1999/xhtml"?ts(n):t==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var se,Ue=(function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,i,l,d){MSApp.execUnsafeLocalFunction(function(){return t(n,i,l,d)})}:t})(function(t,n){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=n;else{for(se=se||document.createElement("div"),se.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=se.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;n.firstChild;)t.appendChild(n.firstChild)}});function $e(t,n){if(n){var i=t.firstChild;if(i&&i===t.lastChild&&i.nodeType===3){i.nodeValue=n;return}}t.textContent=n}var Ge={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},Ht=["Webkit","ms","Moz","O"];Object.keys(Ge).forEach(function(t){Ht.forEach(function(n){n=n+t.charAt(0).toUpperCase()+t.substring(1),Ge[n]=Ge[t]})});function Qs(t,n,i){return n==null||typeof n=="boolean"||n===""?"":i||typeof n!="number"||n===0||Ge.hasOwnProperty(t)&&Ge[t]?(""+n).trim():n+"px"}function Qn(t,n){t=t.style;for(var i in n)if(n.hasOwnProperty(i)){var l=i.indexOf("--")===0,d=Qs(i,n[i],l);i==="float"&&(i="cssFloat"),l?t.setProperty(i,d):t[i]=d}}var Os=L({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 os(t,n){if(n){if(Os[t]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(a(137,t));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(a(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(a(61))}if(n.style!=null&&typeof n.style!="object")throw Error(a(62))}}function Le(t,n){if(t.indexOf("-")===-1)return typeof n.is=="string";switch(t){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 vs=null;function ls(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Is=null,Kt=null,cs=null;function Bi(t){if(t=Wa(t)){if(typeof Is!="function")throw Error(a(280));var n=t.stateNode;n&&(n=mo(n),Is(t.stateNode,t.type,n))}}function Sa(t){Kt?cs?cs.push(t):cs=[t]:Kt=t}function qi(){if(Kt){var t=Kt,n=cs;if(cs=Kt=null,Bi(t),n)for(t=0;t<n.length;t++)Bi(n[t])}}function Ca(t,n){return t(n)}function Ar(){}var Ea=!1;function Hi(t,n,i){if(Ea)return t(n,i);Ea=!0;try{return Ca(t,n,i)}finally{Ea=!1,(Kt!==null||cs!==null)&&(Ar(),qi())}}function rt(t,n){var i=t.stateNode;if(i===null)return null;var l=mo(i);if(l===null)return null;i=l[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(t=t.type,l=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!l;break e;default:t=!1}if(t)return null;if(i&&typeof i!="function")throw Error(a(231,n,typeof i));return i}var Pa=!1;if(h)try{var hn={};Object.defineProperty(hn,"passive",{get:function(){Pa=!0}}),window.addEventListener("test",hn,hn),window.removeEventListener("test",hn,hn)}catch{Pa=!1}function Or(t,n,i,l,d,m,b,R,A){var H=Array.prototype.slice.call(arguments,3);try{n.apply(i,H)}catch(te){this.onError(te)}}var Jn=!1,Yn=null,Ir=!1,Dr=null,Ds={onError:function(t){Jn=!0,Yn=t}};function Wl(t,n,i,l,d,m,b,R,A){Jn=!1,Yn=null,Or.apply(Ds,arguments)}function Ki(t,n,i,l,d,m,b,R,A){if(Wl.apply(this,arguments),Jn){if(Jn){var H=Yn;Jn=!1,Yn=null}else throw Error(a(198));Ir||(Ir=!0,Dr=H)}}function W(t){var n=t,i=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(i=n.return),t=n.return;while(t)}return n.tag===3?i:null}function Te(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function Ee(t){if(W(t)!==t)throw Error(a(188))}function De(t){var n=t.alternate;if(!n){if(n=W(t),n===null)throw Error(a(188));return n!==t?null:t}for(var i=t,l=n;;){var d=i.return;if(d===null)break;var m=d.alternate;if(m===null){if(l=d.return,l!==null){i=l;continue}break}if(d.child===m.child){for(m=d.child;m;){if(m===i)return Ee(d),t;if(m===l)return Ee(d),n;m=m.sibling}throw Error(a(188))}if(i.return!==l.return)i=d,l=m;else{for(var b=!1,R=d.child;R;){if(R===i){b=!0,i=d,l=m;break}if(R===l){b=!0,l=d,i=m;break}R=R.sibling}if(!b){for(R=m.child;R;){if(R===i){b=!0,i=m,l=d;break}if(R===l){b=!0,l=m,i=d;break}R=R.sibling}if(!b)throw Error(a(189))}}if(i.alternate!==l)throw Error(a(190))}if(i.tag!==3)throw Error(a(188));return i.stateNode.current===i?t:n}function Tt(t){return t=De(t),t!==null?Fr(t):null}function Fr(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var n=Fr(t);if(n!==null)return n;t=t.sibling}return null}var ux=r.unstable_scheduleCallback,xx=r.unstable_cancelCallback,Mg=r.unstable_shouldYield,Tg=r.unstable_requestPaint,ot=r.unstable_now,zg=r.unstable_getCurrentPriorityLevel,Gl=r.unstable_ImmediatePriority,mx=r.unstable_UserBlockingPriority,Vi=r.unstable_NormalPriority,Ag=r.unstable_LowPriority,hx=r.unstable_IdlePriority,Wi=null,Fs=null;function Og(t){if(Fs&&typeof Fs.onCommitFiberRoot=="function")try{Fs.onCommitFiberRoot(Wi,t,void 0,(t.current.flags&128)===128)}catch{}}var js=Math.clz32?Math.clz32:Fg,Ig=Math.log,Dg=Math.LN2;function Fg(t){return t>>>=0,t===0?32:31-(Ig(t)/Dg|0)|0}var Gi=64,Qi=4194304;function Ra(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Ji(t,n){var i=t.pendingLanes;if(i===0)return 0;var l=0,d=t.suspendedLanes,m=t.pingedLanes,b=i&268435455;if(b!==0){var R=b&~d;R!==0?l=Ra(R):(m&=b,m!==0&&(l=Ra(m)))}else b=i&~d,b!==0?l=Ra(b):m!==0&&(l=Ra(m));if(l===0)return 0;if(n!==0&&n!==l&&(n&d)===0&&(d=l&-l,m=n&-n,d>=m||d===16&&(m&4194240)!==0))return n;if((l&4)!==0&&(l|=i&16),n=t.entangledLanes,n!==0)for(t=t.entanglements,n&=l;0<n;)i=31-js(n),d=1<<i,l|=t[i],n&=~d;return l}function Lg(t,n){switch(t){case 1:case 2:case 4:return n+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 n+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 _g(t,n){for(var i=t.suspendedLanes,l=t.pingedLanes,d=t.expirationTimes,m=t.pendingLanes;0<m;){var b=31-js(m),R=1<<b,A=d[b];A===-1?((R&i)===0||(R&l)!==0)&&(d[b]=Lg(R,n)):A<=n&&(t.expiredLanes|=R),m&=~R}}function Ql(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function px(){var t=Gi;return Gi<<=1,(Gi&4194240)===0&&(Gi=64),t}function Jl(t){for(var n=[],i=0;31>i;i++)n.push(t);return n}function Ma(t,n,i){t.pendingLanes|=n,n!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,n=31-js(n),t[n]=i}function Ug(t,n){var i=t.pendingLanes&~n;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=n,t.mutableReadLanes&=n,t.entangledLanes&=n,n=t.entanglements;var l=t.eventTimes;for(t=t.expirationTimes;0<i;){var d=31-js(i),m=1<<d;n[d]=0,l[d]=-1,t[d]=-1,i&=~m}}function Yl(t,n){var i=t.entangledLanes|=n;for(t=t.entanglements;i;){var l=31-js(i),d=1<<l;d&n|t[l]&n&&(t[l]|=n),i&=~d}}var Ve=0;function fx(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var gx,Xl,yx,bx,vx,Zl=!1,Yi=[],pn=null,fn=null,gn=null,Ta=new Map,za=new Map,yn=[],$g="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 jx(t,n){switch(t){case"focusin":case"focusout":pn=null;break;case"dragenter":case"dragleave":fn=null;break;case"mouseover":case"mouseout":gn=null;break;case"pointerover":case"pointerout":Ta.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":za.delete(n.pointerId)}}function Aa(t,n,i,l,d,m){return t===null||t.nativeEvent!==m?(t={blockedOn:n,domEventName:i,eventSystemFlags:l,nativeEvent:m,targetContainers:[d]},n!==null&&(n=Wa(n),n!==null&&Xl(n)),t):(t.eventSystemFlags|=l,n=t.targetContainers,d!==null&&n.indexOf(d)===-1&&n.push(d),t)}function Bg(t,n,i,l,d){switch(n){case"focusin":return pn=Aa(pn,t,n,i,l,d),!0;case"dragenter":return fn=Aa(fn,t,n,i,l,d),!0;case"mouseover":return gn=Aa(gn,t,n,i,l,d),!0;case"pointerover":var m=d.pointerId;return Ta.set(m,Aa(Ta.get(m)||null,t,n,i,l,d)),!0;case"gotpointercapture":return m=d.pointerId,za.set(m,Aa(za.get(m)||null,t,n,i,l,d)),!0}return!1}function Nx(t){var n=Xn(t.target);if(n!==null){var i=W(n);if(i!==null){if(n=i.tag,n===13){if(n=Te(i),n!==null){t.blockedOn=n,vx(t.priority,function(){yx(i)});return}}else if(n===3&&i.stateNode.current.memoizedState.isDehydrated){t.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Xi(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var i=tc(t.domEventName,t.eventSystemFlags,n[0],t.nativeEvent);if(i===null){i=t.nativeEvent;var l=new i.constructor(i.type,i);vs=l,i.target.dispatchEvent(l),vs=null}else return n=Wa(i),n!==null&&Xl(n),t.blockedOn=i,!1;n.shift()}return!0}function wx(t,n,i){Xi(t)&&i.delete(n)}function qg(){Zl=!1,pn!==null&&Xi(pn)&&(pn=null),fn!==null&&Xi(fn)&&(fn=null),gn!==null&&Xi(gn)&&(gn=null),Ta.forEach(wx),za.forEach(wx)}function Oa(t,n){t.blockedOn===n&&(t.blockedOn=null,Zl||(Zl=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,qg)))}function Ia(t){function n(d){return Oa(d,t)}if(0<Yi.length){Oa(Yi[0],t);for(var i=1;i<Yi.length;i++){var l=Yi[i];l.blockedOn===t&&(l.blockedOn=null)}}for(pn!==null&&Oa(pn,t),fn!==null&&Oa(fn,t),gn!==null&&Oa(gn,t),Ta.forEach(n),za.forEach(n),i=0;i<yn.length;i++)l=yn[i],l.blockedOn===t&&(l.blockedOn=null);for(;0<yn.length&&(i=yn[0],i.blockedOn===null);)Nx(i),i.blockedOn===null&&yn.shift()}var Lr=C.ReactCurrentBatchConfig,Zi=!0;function Hg(t,n,i,l){var d=Ve,m=Lr.transition;Lr.transition=null;try{Ve=1,ec(t,n,i,l)}finally{Ve=d,Lr.transition=m}}function Kg(t,n,i,l){var d=Ve,m=Lr.transition;Lr.transition=null;try{Ve=4,ec(t,n,i,l)}finally{Ve=d,Lr.transition=m}}function ec(t,n,i,l){if(Zi){var d=tc(t,n,i,l);if(d===null)yc(t,n,l,eo,i),jx(t,l);else if(Bg(d,t,n,i,l))l.stopPropagation();else if(jx(t,l),n&4&&-1<$g.indexOf(t)){for(;d!==null;){var m=Wa(d);if(m!==null&&gx(m),m=tc(t,n,i,l),m===null&&yc(t,n,l,eo,i),m===d)break;d=m}d!==null&&l.stopPropagation()}else yc(t,n,l,null,i)}}var eo=null;function tc(t,n,i,l){if(eo=null,t=ls(l),t=Xn(t),t!==null)if(n=W(t),n===null)t=null;else if(i=n.tag,i===13){if(t=Te(n),t!==null)return t;t=null}else if(i===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null);return eo=t,null}function kx(t){switch(t){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(zg()){case Gl:return 1;case mx:return 4;case Vi:case Ag:return 16;case hx:return 536870912;default:return 16}default:return 16}}var bn=null,sc=null,to=null;function Sx(){if(to)return to;var t,n=sc,i=n.length,l,d="value"in bn?bn.value:bn.textContent,m=d.length;for(t=0;t<i&&n[t]===d[t];t++);var b=i-t;for(l=1;l<=b&&n[i-l]===d[m-l];l++);return to=d.slice(t,1<l?1-l:void 0)}function so(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function no(){return!0}function Cx(){return!1}function ss(t){function n(i,l,d,m,b){this._reactName=i,this._targetInst=d,this.type=l,this.nativeEvent=m,this.target=b,this.currentTarget=null;for(var R in t)t.hasOwnProperty(R)&&(i=t[R],this[R]=i?i(m):m[R]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?no:Cx,this.isPropagationStopped=Cx,this}return L(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=no)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=no)},persist:function(){},isPersistent:no}),n}var _r={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},nc=ss(_r),Da=L({},_r,{view:0,detail:0}),Vg=ss(Da),rc,ac,Fa,ro=L({},Da,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:oc,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Fa&&(Fa&&t.type==="mousemove"?(rc=t.screenX-Fa.screenX,ac=t.screenY-Fa.screenY):ac=rc=0,Fa=t),rc)},movementY:function(t){return"movementY"in t?t.movementY:ac}}),Ex=ss(ro),Wg=L({},ro,{dataTransfer:0}),Gg=ss(Wg),Qg=L({},Da,{relatedTarget:0}),ic=ss(Qg),Jg=L({},_r,{animationName:0,elapsedTime:0,pseudoElement:0}),Yg=ss(Jg),Xg=L({},_r,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Zg=ss(Xg),e0=L({},_r,{data:0}),Px=ss(e0),t0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},s0={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"},n0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function r0(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=n0[t])?!!n[t]:!1}function oc(){return r0}var a0=L({},Da,{key:function(t){if(t.key){var n=t0[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=so(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?s0[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:oc,charCode:function(t){return t.type==="keypress"?so(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?so(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),i0=ss(a0),o0=L({},ro,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rx=ss(o0),l0=L({},Da,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:oc}),c0=ss(l0),d0=L({},_r,{propertyName:0,elapsedTime:0,pseudoElement:0}),u0=ss(d0),x0=L({},ro,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),m0=ss(x0),h0=[9,13,27,32],lc=h&&"CompositionEvent"in window,La=null;h&&"documentMode"in document&&(La=document.documentMode);var p0=h&&"TextEvent"in window&&!La,Mx=h&&(!lc||La&&8<La&&11>=La),Tx=" ",zx=!1;function Ax(t,n){switch(t){case"keyup":return h0.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ox(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ur=!1;function f0(t,n){switch(t){case"compositionend":return Ox(n);case"keypress":return n.which!==32?null:(zx=!0,Tx);case"textInput":return t=n.data,t===Tx&&zx?null:t;default:return null}}function g0(t,n){if(Ur)return t==="compositionend"||!lc&&Ax(t,n)?(t=Sx(),to=sc=bn=null,Ur=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Mx&&n.locale!=="ko"?null:n.data;default:return null}}var y0={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 Ix(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!y0[t.type]:n==="textarea"}function Dx(t,n,i,l){Sa(l),n=co(n,"onChange"),0<n.length&&(i=new nc("onChange","change",null,i,l),t.push({event:i,listeners:n}))}var _a=null,Ua=null;function b0(t){em(t,0)}function ao(t){var n=Kr(t);if(qt(n))return t}function v0(t,n){if(t==="change")return n}var Fx=!1;if(h){var cc;if(h){var dc="oninput"in document;if(!dc){var Lx=document.createElement("div");Lx.setAttribute("oninput","return;"),dc=typeof Lx.oninput=="function"}cc=dc}else cc=!1;Fx=cc&&(!document.documentMode||9<document.documentMode)}function _x(){_a&&(_a.detachEvent("onpropertychange",Ux),Ua=_a=null)}function Ux(t){if(t.propertyName==="value"&&ao(Ua)){var n=[];Dx(n,Ua,t,ls(t)),Hi(b0,n)}}function j0(t,n,i){t==="focusin"?(_x(),_a=n,Ua=i,_a.attachEvent("onpropertychange",Ux)):t==="focusout"&&_x()}function N0(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return ao(Ua)}function w0(t,n){if(t==="click")return ao(n)}function k0(t,n){if(t==="input"||t==="change")return ao(n)}function S0(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Ns=typeof Object.is=="function"?Object.is:S0;function $a(t,n){if(Ns(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var i=Object.keys(t),l=Object.keys(n);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var d=i[l];if(!f.call(n,d)||!Ns(t[d],n[d]))return!1}return!0}function $x(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Bx(t,n){var i=$x(t);t=0;for(var l;i;){if(i.nodeType===3){if(l=t+i.textContent.length,t<=n&&l>=n)return{node:i,offset:n-t};t=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=$x(i)}}function qx(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?qx(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Hx(){for(var t=window,n=Ye();n instanceof t.HTMLIFrameElement;){try{var i=typeof n.contentWindow.location.href=="string"}catch{i=!1}if(i)t=n.contentWindow;else break;n=Ye(t.document)}return n}function uc(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}function C0(t){var n=Hx(),i=t.focusedElem,l=t.selectionRange;if(n!==i&&i&&i.ownerDocument&&qx(i.ownerDocument.documentElement,i)){if(l!==null&&uc(i)){if(n=l.start,t=l.end,t===void 0&&(t=n),"selectionStart"in i)i.selectionStart=n,i.selectionEnd=Math.min(t,i.value.length);else if(t=(n=i.ownerDocument||document)&&n.defaultView||window,t.getSelection){t=t.getSelection();var d=i.textContent.length,m=Math.min(l.start,d);l=l.end===void 0?m:Math.min(l.end,d),!t.extend&&m>l&&(d=l,l=m,m=d),d=Bx(i,m);var b=Bx(i,l);d&&b&&(t.rangeCount!==1||t.anchorNode!==d.node||t.anchorOffset!==d.offset||t.focusNode!==b.node||t.focusOffset!==b.offset)&&(n=n.createRange(),n.setStart(d.node,d.offset),t.removeAllRanges(),m>l?(t.addRange(n),t.extend(b.node,b.offset)):(n.setEnd(b.node,b.offset),t.addRange(n)))}}for(n=[],t=i;t=t.parentNode;)t.nodeType===1&&n.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<n.length;i++)t=n[i],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var E0=h&&"documentMode"in document&&11>=document.documentMode,$r=null,xc=null,Ba=null,mc=!1;function Kx(t,n,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;mc||$r==null||$r!==Ye(l)||(l=$r,"selectionStart"in l&&uc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ba&&$a(Ba,l)||(Ba=l,l=co(xc,"onSelect"),0<l.length&&(n=new nc("onSelect","select",null,n,i),t.push({event:n,listeners:l}),n.target=$r)))}function io(t,n){var i={};return i[t.toLowerCase()]=n.toLowerCase(),i["Webkit"+t]="webkit"+n,i["Moz"+t]="moz"+n,i}var Br={animationend:io("Animation","AnimationEnd"),animationiteration:io("Animation","AnimationIteration"),animationstart:io("Animation","AnimationStart"),transitionend:io("Transition","TransitionEnd")},hc={},Vx={};h&&(Vx=document.createElement("div").style,"AnimationEvent"in window||(delete Br.animationend.animation,delete Br.animationiteration.animation,delete Br.animationstart.animation),"TransitionEvent"in window||delete Br.transitionend.transition);function oo(t){if(hc[t])return hc[t];if(!Br[t])return t;var n=Br[t],i;for(i in n)if(n.hasOwnProperty(i)&&i in Vx)return hc[t]=n[i];return t}var Wx=oo("animationend"),Gx=oo("animationiteration"),Qx=oo("animationstart"),Jx=oo("transitionend"),Yx=new Map,Xx="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 vn(t,n){Yx.set(t,n),u(n,[t])}for(var pc=0;pc<Xx.length;pc++){var fc=Xx[pc],P0=fc.toLowerCase(),R0=fc[0].toUpperCase()+fc.slice(1);vn(P0,"on"+R0)}vn(Wx,"onAnimationEnd"),vn(Gx,"onAnimationIteration"),vn(Qx,"onAnimationStart"),vn("dblclick","onDoubleClick"),vn("focusin","onFocus"),vn("focusout","onBlur"),vn(Jx,"onTransitionEnd"),x("onMouseEnter",["mouseout","mouseover"]),x("onMouseLeave",["mouseout","mouseover"]),x("onPointerEnter",["pointerout","pointerover"]),x("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qa="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(" "),M0=new Set("cancel close invalid load scroll toggle".split(" ").concat(qa));function Zx(t,n,i){var l=t.type||"unknown-event";t.currentTarget=i,Ki(l,n,void 0,t),t.currentTarget=null}function em(t,n){n=(n&4)!==0;for(var i=0;i<t.length;i++){var l=t[i],d=l.event;l=l.listeners;e:{var m=void 0;if(n)for(var b=l.length-1;0<=b;b--){var R=l[b],A=R.instance,H=R.currentTarget;if(R=R.listener,A!==m&&d.isPropagationStopped())break e;Zx(d,R,H),m=A}else for(b=0;b<l.length;b++){if(R=l[b],A=R.instance,H=R.currentTarget,R=R.listener,A!==m&&d.isPropagationStopped())break e;Zx(d,R,H),m=A}}}if(Ir)throw t=Dr,Ir=!1,Dr=null,t}function Xe(t,n){var i=n[kc];i===void 0&&(i=n[kc]=new Set);var l=t+"__bubble";i.has(l)||(tm(n,t,2,!1),i.add(l))}function gc(t,n,i){var l=0;n&&(l|=4),tm(i,t,l,n)}var lo="_reactListening"+Math.random().toString(36).slice(2);function Ha(t){if(!t[lo]){t[lo]=!0,o.forEach(function(i){i!=="selectionchange"&&(M0.has(i)||gc(i,!1,t),gc(i,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[lo]||(n[lo]=!0,gc("selectionchange",!1,n))}}function tm(t,n,i,l){switch(kx(n)){case 1:var d=Hg;break;case 4:d=Kg;break;default:d=ec}i=d.bind(null,n,i,t),d=void 0,!Pa||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(d=!0),l?d!==void 0?t.addEventListener(n,i,{capture:!0,passive:d}):t.addEventListener(n,i,!0):d!==void 0?t.addEventListener(n,i,{passive:d}):t.addEventListener(n,i,!1)}function yc(t,n,i,l,d){var m=l;if((n&1)===0&&(n&2)===0&&l!==null)e:for(;;){if(l===null)return;var b=l.tag;if(b===3||b===4){var R=l.stateNode.containerInfo;if(R===d||R.nodeType===8&&R.parentNode===d)break;if(b===4)for(b=l.return;b!==null;){var A=b.tag;if((A===3||A===4)&&(A=b.stateNode.containerInfo,A===d||A.nodeType===8&&A.parentNode===d))return;b=b.return}for(;R!==null;){if(b=Xn(R),b===null)return;if(A=b.tag,A===5||A===6){l=m=b;continue e}R=R.parentNode}}l=l.return}Hi(function(){var H=m,te=ls(i),ne=[];e:{var ee=Yx.get(t);if(ee!==void 0){var de=nc,fe=t;switch(t){case"keypress":if(so(i)===0)break e;case"keydown":case"keyup":de=i0;break;case"focusin":fe="focus",de=ic;break;case"focusout":fe="blur",de=ic;break;case"beforeblur":case"afterblur":de=ic;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":de=Ex;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=Gg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=c0;break;case Wx:case Gx:case Qx:de=Yg;break;case Jx:de=u0;break;case"scroll":de=Vg;break;case"wheel":de=m0;break;case"copy":case"cut":case"paste":de=Zg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=Rx}var ge=(n&4)!==0,lt=!ge&&t==="scroll",U=ge?ee!==null?ee+"Capture":null:ee;ge=[];for(var I=H,B;I!==null;){B=I;var ae=B.stateNode;if(B.tag===5&&ae!==null&&(B=ae,U!==null&&(ae=rt(I,U),ae!=null&&ge.push(Ka(I,ae,B)))),lt)break;I=I.return}0<ge.length&&(ee=new de(ee,fe,null,i,te),ne.push({event:ee,listeners:ge}))}}if((n&7)===0){e:{if(ee=t==="mouseover"||t==="pointerover",de=t==="mouseout"||t==="pointerout",ee&&i!==vs&&(fe=i.relatedTarget||i.fromElement)&&(Xn(fe)||fe[Js]))break e;if((de||ee)&&(ee=te.window===te?te:(ee=te.ownerDocument)?ee.defaultView||ee.parentWindow:window,de?(fe=i.relatedTarget||i.toElement,de=H,fe=fe?Xn(fe):null,fe!==null&&(lt=W(fe),fe!==lt||fe.tag!==5&&fe.tag!==6)&&(fe=null)):(de=null,fe=H),de!==fe)){if(ge=Ex,ae="onMouseLeave",U="onMouseEnter",I="mouse",(t==="pointerout"||t==="pointerover")&&(ge=Rx,ae="onPointerLeave",U="onPointerEnter",I="pointer"),lt=de==null?ee:Kr(de),B=fe==null?ee:Kr(fe),ee=new ge(ae,I+"leave",de,i,te),ee.target=lt,ee.relatedTarget=B,ae=null,Xn(te)===H&&(ge=new ge(U,I+"enter",fe,i,te),ge.target=B,ge.relatedTarget=lt,ae=ge),lt=ae,de&&fe)t:{for(ge=de,U=fe,I=0,B=ge;B;B=qr(B))I++;for(B=0,ae=U;ae;ae=qr(ae))B++;for(;0<I-B;)ge=qr(ge),I--;for(;0<B-I;)U=qr(U),B--;for(;I--;){if(ge===U||U!==null&&ge===U.alternate)break t;ge=qr(ge),U=qr(U)}ge=null}else ge=null;de!==null&&sm(ne,ee,de,ge,!1),fe!==null&<!==null&&sm(ne,lt,fe,ge,!0)}}e:{if(ee=H?Kr(H):window,de=ee.nodeName&&ee.nodeName.toLowerCase(),de==="select"||de==="input"&&ee.type==="file")var ve=v0;else if(Ix(ee))if(Fx)ve=k0;else{ve=N0;var Se=j0}else(de=ee.nodeName)&&de.toLowerCase()==="input"&&(ee.type==="checkbox"||ee.type==="radio")&&(ve=w0);if(ve&&(ve=ve(t,H))){Dx(ne,ve,i,te);break e}Se&&Se(t,ee,H),t==="focusout"&&(Se=ee._wrapperState)&&Se.controlled&&ee.type==="number"&&ys(ee,"number",ee.value)}switch(Se=H?Kr(H):window,t){case"focusin":(Ix(Se)||Se.contentEditable==="true")&&($r=Se,xc=H,Ba=null);break;case"focusout":Ba=xc=$r=null;break;case"mousedown":mc=!0;break;case"contextmenu":case"mouseup":case"dragend":mc=!1,Kx(ne,i,te);break;case"selectionchange":if(E0)break;case"keydown":case"keyup":Kx(ne,i,te)}var Ce;if(lc)e:{switch(t){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else Ur?Ax(t,i)&&(ze="onCompositionEnd"):t==="keydown"&&i.keyCode===229&&(ze="onCompositionStart");ze&&(Mx&&i.locale!=="ko"&&(Ur||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Ur&&(Ce=Sx()):(bn=te,sc="value"in bn?bn.value:bn.textContent,Ur=!0)),Se=co(H,ze),0<Se.length&&(ze=new Px(ze,t,null,i,te),ne.push({event:ze,listeners:Se}),Ce?ze.data=Ce:(Ce=Ox(i),Ce!==null&&(ze.data=Ce)))),(Ce=p0?f0(t,i):g0(t,i))&&(H=co(H,"onBeforeInput"),0<H.length&&(te=new Px("onBeforeInput","beforeinput",null,i,te),ne.push({event:te,listeners:H}),te.data=Ce))}em(ne,n)})}function Ka(t,n,i){return{instance:t,listener:n,currentTarget:i}}function co(t,n){for(var i=n+"Capture",l=[];t!==null;){var d=t,m=d.stateNode;d.tag===5&&m!==null&&(d=m,m=rt(t,i),m!=null&&l.unshift(Ka(t,m,d)),m=rt(t,n),m!=null&&l.push(Ka(t,m,d))),t=t.return}return l}function qr(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function sm(t,n,i,l,d){for(var m=n._reactName,b=[];i!==null&&i!==l;){var R=i,A=R.alternate,H=R.stateNode;if(A!==null&&A===l)break;R.tag===5&&H!==null&&(R=H,d?(A=rt(i,m),A!=null&&b.unshift(Ka(i,A,R))):d||(A=rt(i,m),A!=null&&b.push(Ka(i,A,R)))),i=i.return}b.length!==0&&t.push({event:n,listeners:b})}var T0=/\r\n?/g,z0=/\u0000|\uFFFD/g;function nm(t){return(typeof t=="string"?t:""+t).replace(T0,`
|
|
38
|
+
`).replace(z0,"")}function uo(t,n,i){if(n=nm(n),nm(t)!==n&&i)throw Error(a(425))}function xo(){}var bc=null,vc=null;function jc(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Nc=typeof setTimeout=="function"?setTimeout:void 0,A0=typeof clearTimeout=="function"?clearTimeout:void 0,rm=typeof Promise=="function"?Promise:void 0,O0=typeof queueMicrotask=="function"?queueMicrotask:typeof rm<"u"?function(t){return rm.resolve(null).then(t).catch(I0)}:Nc;function I0(t){setTimeout(function(){throw t})}function wc(t,n){var i=n,l=0;do{var d=i.nextSibling;if(t.removeChild(i),d&&d.nodeType===8)if(i=d.data,i==="/$"){if(l===0){t.removeChild(d),Ia(n);return}l--}else i!=="$"&&i!=="$?"&&i!=="$!"||l++;i=d}while(i);Ia(n)}function jn(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return t}function am(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var i=t.data;if(i==="$"||i==="$!"||i==="$?"){if(n===0)return t;n--}else i==="/$"&&n++}t=t.previousSibling}return null}var Hr=Math.random().toString(36).slice(2),Ls="__reactFiber$"+Hr,Va="__reactProps$"+Hr,Js="__reactContainer$"+Hr,kc="__reactEvents$"+Hr,D0="__reactListeners$"+Hr,F0="__reactHandles$"+Hr;function Xn(t){var n=t[Ls];if(n)return n;for(var i=t.parentNode;i;){if(n=i[Js]||i[Ls]){if(i=n.alternate,n.child!==null||i!==null&&i.child!==null)for(t=am(t);t!==null;){if(i=t[Ls])return i;t=am(t)}return n}t=i,i=t.parentNode}return null}function Wa(t){return t=t[Ls]||t[Js],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Kr(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(a(33))}function mo(t){return t[Va]||null}var Sc=[],Vr=-1;function Nn(t){return{current:t}}function Ze(t){0>Vr||(t.current=Sc[Vr],Sc[Vr]=null,Vr--)}function Qe(t,n){Vr++,Sc[Vr]=t.current,t.current=n}var wn={},zt=Nn(wn),Vt=Nn(!1),Zn=wn;function Wr(t,n){var i=t.type.contextTypes;if(!i)return wn;var l=t.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===n)return l.__reactInternalMemoizedMaskedChildContext;var d={},m;for(m in i)d[m]=n[m];return l&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=n,t.__reactInternalMemoizedMaskedChildContext=d),d}function Wt(t){return t=t.childContextTypes,t!=null}function ho(){Ze(Vt),Ze(zt)}function im(t,n,i){if(zt.current!==wn)throw Error(a(168));Qe(zt,n),Qe(Vt,i)}function om(t,n,i){var l=t.stateNode;if(n=n.childContextTypes,typeof l.getChildContext!="function")return i;l=l.getChildContext();for(var d in l)if(!(d in n))throw Error(a(108,Ae(t)||"Unknown",d));return L({},i,l)}function po(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||wn,Zn=zt.current,Qe(zt,t),Qe(Vt,Vt.current),!0}function lm(t,n,i){var l=t.stateNode;if(!l)throw Error(a(169));i?(t=om(t,n,Zn),l.__reactInternalMemoizedMergedChildContext=t,Ze(Vt),Ze(zt),Qe(zt,t)):Ze(Vt),Qe(Vt,i)}var Ys=null,fo=!1,Cc=!1;function cm(t){Ys===null?Ys=[t]:Ys.push(t)}function L0(t){fo=!0,cm(t)}function kn(){if(!Cc&&Ys!==null){Cc=!0;var t=0,n=Ve;try{var i=Ys;for(Ve=1;t<i.length;t++){var l=i[t];do l=l(!0);while(l!==null)}Ys=null,fo=!1}catch(d){throw Ys!==null&&(Ys=Ys.slice(t+1)),ux(Gl,kn),d}finally{Ve=n,Cc=!1}}return null}var Gr=[],Qr=0,go=null,yo=0,ds=[],us=0,er=null,Xs=1,Zs="";function tr(t,n){Gr[Qr++]=yo,Gr[Qr++]=go,go=t,yo=n}function dm(t,n,i){ds[us++]=Xs,ds[us++]=Zs,ds[us++]=er,er=t;var l=Xs;t=Zs;var d=32-js(l)-1;l&=~(1<<d),i+=1;var m=32-js(n)+d;if(30<m){var b=d-d%5;m=(l&(1<<b)-1).toString(32),l>>=b,d-=b,Xs=1<<32-js(n)+d|i<<d|l,Zs=m+t}else Xs=1<<m|i<<d|l,Zs=t}function Ec(t){t.return!==null&&(tr(t,1),dm(t,1,0))}function Pc(t){for(;t===go;)go=Gr[--Qr],Gr[Qr]=null,yo=Gr[--Qr],Gr[Qr]=null;for(;t===er;)er=ds[--us],ds[us]=null,Zs=ds[--us],ds[us]=null,Xs=ds[--us],ds[us]=null}var ns=null,rs=null,tt=!1,ws=null;function um(t,n){var i=ps(5,null,null,0);i.elementType="DELETED",i.stateNode=n,i.return=t,n=t.deletions,n===null?(t.deletions=[i],t.flags|=16):n.push(i)}function xm(t,n){switch(t.tag){case 5:var i=t.type;return n=n.nodeType!==1||i.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(t.stateNode=n,ns=t,rs=jn(n.firstChild),!0):!1;case 6:return n=t.pendingProps===""||n.nodeType!==3?null:n,n!==null?(t.stateNode=n,ns=t,rs=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(i=er!==null?{id:Xs,overflow:Zs}:null,t.memoizedState={dehydrated:n,treeContext:i,retryLane:1073741824},i=ps(18,null,null,0),i.stateNode=n,i.return=t,t.child=i,ns=t,rs=null,!0):!1;default:return!1}}function Rc(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Mc(t){if(tt){var n=rs;if(n){var i=n;if(!xm(t,n)){if(Rc(t))throw Error(a(418));n=jn(i.nextSibling);var l=ns;n&&xm(t,n)?um(l,i):(t.flags=t.flags&-4097|2,tt=!1,ns=t)}}else{if(Rc(t))throw Error(a(418));t.flags=t.flags&-4097|2,tt=!1,ns=t}}}function mm(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;ns=t}function bo(t){if(t!==ns)return!1;if(!tt)return mm(t),tt=!0,!1;var n;if((n=t.tag!==3)&&!(n=t.tag!==5)&&(n=t.type,n=n!=="head"&&n!=="body"&&!jc(t.type,t.memoizedProps)),n&&(n=rs)){if(Rc(t))throw hm(),Error(a(418));for(;n;)um(t,n),n=jn(n.nextSibling)}if(mm(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));e:{for(t=t.nextSibling,n=0;t;){if(t.nodeType===8){var i=t.data;if(i==="/$"){if(n===0){rs=jn(t.nextSibling);break e}n--}else i!=="$"&&i!=="$!"&&i!=="$?"||n++}t=t.nextSibling}rs=null}}else rs=ns?jn(t.stateNode.nextSibling):null;return!0}function hm(){for(var t=rs;t;)t=jn(t.nextSibling)}function Jr(){rs=ns=null,tt=!1}function Tc(t){ws===null?ws=[t]:ws.push(t)}var _0=C.ReactCurrentBatchConfig;function Ga(t,n,i){if(t=i.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(a(309));var l=i.stateNode}if(!l)throw Error(a(147,t));var d=l,m=""+t;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===m?n.ref:(n=function(b){var R=d.refs;b===null?delete R[m]:R[m]=b},n._stringRef=m,n)}if(typeof t!="string")throw Error(a(284));if(!i._owner)throw Error(a(290,t))}return t}function vo(t,n){throw t=Object.prototype.toString.call(n),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t))}function pm(t){var n=t._init;return n(t._payload)}function fm(t){function n(U,I){if(t){var B=U.deletions;B===null?(U.deletions=[I],U.flags|=16):B.push(I)}}function i(U,I){if(!t)return null;for(;I!==null;)n(U,I),I=I.sibling;return null}function l(U,I){for(U=new Map;I!==null;)I.key!==null?U.set(I.key,I):U.set(I.index,I),I=I.sibling;return U}function d(U,I){return U=zn(U,I),U.index=0,U.sibling=null,U}function m(U,I,B){return U.index=B,t?(B=U.alternate,B!==null?(B=B.index,B<I?(U.flags|=2,I):B):(U.flags|=2,I)):(U.flags|=1048576,I)}function b(U){return t&&U.alternate===null&&(U.flags|=2),U}function R(U,I,B,ae){return I===null||I.tag!==6?(I=Nd(B,U.mode,ae),I.return=U,I):(I=d(I,B),I.return=U,I)}function A(U,I,B,ae){var ve=B.type;return ve===Q?te(U,I,B.props.children,ae,B.key):I!==null&&(I.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===Ne&&pm(ve)===I.type)?(ae=d(I,B.props),ae.ref=Ga(U,I,B),ae.return=U,ae):(ae=Ho(B.type,B.key,B.props,null,U.mode,ae),ae.ref=Ga(U,I,B),ae.return=U,ae)}function H(U,I,B,ae){return I===null||I.tag!==4||I.stateNode.containerInfo!==B.containerInfo||I.stateNode.implementation!==B.implementation?(I=wd(B,U.mode,ae),I.return=U,I):(I=d(I,B.children||[]),I.return=U,I)}function te(U,I,B,ae,ve){return I===null||I.tag!==7?(I=cr(B,U.mode,ae,ve),I.return=U,I):(I=d(I,B),I.return=U,I)}function ne(U,I,B){if(typeof I=="string"&&I!==""||typeof I=="number")return I=Nd(""+I,U.mode,B),I.return=U,I;if(typeof I=="object"&&I!==null){switch(I.$$typeof){case w:return B=Ho(I.type,I.key,I.props,null,U.mode,B),B.ref=Ga(U,null,I),B.return=U,B;case F:return I=wd(I,U.mode,B),I.return=U,I;case Ne:var ae=I._init;return ne(U,ae(I._payload),B)}if(q(I)||Y(I))return I=cr(I,U.mode,B,null),I.return=U,I;vo(U,I)}return null}function ee(U,I,B,ae){var ve=I!==null?I.key:null;if(typeof B=="string"&&B!==""||typeof B=="number")return ve!==null?null:R(U,I,""+B,ae);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case w:return B.key===ve?A(U,I,B,ae):null;case F:return B.key===ve?H(U,I,B,ae):null;case Ne:return ve=B._init,ee(U,I,ve(B._payload),ae)}if(q(B)||Y(B))return ve!==null?null:te(U,I,B,ae,null);vo(U,B)}return null}function de(U,I,B,ae,ve){if(typeof ae=="string"&&ae!==""||typeof ae=="number")return U=U.get(B)||null,R(I,U,""+ae,ve);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case w:return U=U.get(ae.key===null?B:ae.key)||null,A(I,U,ae,ve);case F:return U=U.get(ae.key===null?B:ae.key)||null,H(I,U,ae,ve);case Ne:var Se=ae._init;return de(U,I,B,Se(ae._payload),ve)}if(q(ae)||Y(ae))return U=U.get(B)||null,te(I,U,ae,ve,null);vo(I,ae)}return null}function fe(U,I,B,ae){for(var ve=null,Se=null,Ce=I,ze=I=0,Nt=null;Ce!==null&&ze<B.length;ze++){Ce.index>ze?(Nt=Ce,Ce=null):Nt=Ce.sibling;var qe=ee(U,Ce,B[ze],ae);if(qe===null){Ce===null&&(Ce=Nt);break}t&&Ce&&qe.alternate===null&&n(U,Ce),I=m(qe,I,ze),Se===null?ve=qe:Se.sibling=qe,Se=qe,Ce=Nt}if(ze===B.length)return i(U,Ce),tt&&tr(U,ze),ve;if(Ce===null){for(;ze<B.length;ze++)Ce=ne(U,B[ze],ae),Ce!==null&&(I=m(Ce,I,ze),Se===null?ve=Ce:Se.sibling=Ce,Se=Ce);return tt&&tr(U,ze),ve}for(Ce=l(U,Ce);ze<B.length;ze++)Nt=de(Ce,U,ze,B[ze],ae),Nt!==null&&(t&&Nt.alternate!==null&&Ce.delete(Nt.key===null?ze:Nt.key),I=m(Nt,I,ze),Se===null?ve=Nt:Se.sibling=Nt,Se=Nt);return t&&Ce.forEach(function(An){return n(U,An)}),tt&&tr(U,ze),ve}function ge(U,I,B,ae){var ve=Y(B);if(typeof ve!="function")throw Error(a(150));if(B=ve.call(B),B==null)throw Error(a(151));for(var Se=ve=null,Ce=I,ze=I=0,Nt=null,qe=B.next();Ce!==null&&!qe.done;ze++,qe=B.next()){Ce.index>ze?(Nt=Ce,Ce=null):Nt=Ce.sibling;var An=ee(U,Ce,qe.value,ae);if(An===null){Ce===null&&(Ce=Nt);break}t&&Ce&&An.alternate===null&&n(U,Ce),I=m(An,I,ze),Se===null?ve=An:Se.sibling=An,Se=An,Ce=Nt}if(qe.done)return i(U,Ce),tt&&tr(U,ze),ve;if(Ce===null){for(;!qe.done;ze++,qe=B.next())qe=ne(U,qe.value,ae),qe!==null&&(I=m(qe,I,ze),Se===null?ve=qe:Se.sibling=qe,Se=qe);return tt&&tr(U,ze),ve}for(Ce=l(U,Ce);!qe.done;ze++,qe=B.next())qe=de(Ce,U,ze,qe.value,ae),qe!==null&&(t&&qe.alternate!==null&&Ce.delete(qe.key===null?ze:qe.key),I=m(qe,I,ze),Se===null?ve=qe:Se.sibling=qe,Se=qe);return t&&Ce.forEach(function(yy){return n(U,yy)}),tt&&tr(U,ze),ve}function lt(U,I,B,ae){if(typeof B=="object"&&B!==null&&B.type===Q&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case w:e:{for(var ve=B.key,Se=I;Se!==null;){if(Se.key===ve){if(ve=B.type,ve===Q){if(Se.tag===7){i(U,Se.sibling),I=d(Se,B.props.children),I.return=U,U=I;break e}}else if(Se.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===Ne&&pm(ve)===Se.type){i(U,Se.sibling),I=d(Se,B.props),I.ref=Ga(U,Se,B),I.return=U,U=I;break e}i(U,Se);break}else n(U,Se);Se=Se.sibling}B.type===Q?(I=cr(B.props.children,U.mode,ae,B.key),I.return=U,U=I):(ae=Ho(B.type,B.key,B.props,null,U.mode,ae),ae.ref=Ga(U,I,B),ae.return=U,U=ae)}return b(U);case F:e:{for(Se=B.key;I!==null;){if(I.key===Se)if(I.tag===4&&I.stateNode.containerInfo===B.containerInfo&&I.stateNode.implementation===B.implementation){i(U,I.sibling),I=d(I,B.children||[]),I.return=U,U=I;break e}else{i(U,I);break}else n(U,I);I=I.sibling}I=wd(B,U.mode,ae),I.return=U,U=I}return b(U);case Ne:return Se=B._init,lt(U,I,Se(B._payload),ae)}if(q(B))return fe(U,I,B,ae);if(Y(B))return ge(U,I,B,ae);vo(U,B)}return typeof B=="string"&&B!==""||typeof B=="number"?(B=""+B,I!==null&&I.tag===6?(i(U,I.sibling),I=d(I,B),I.return=U,U=I):(i(U,I),I=Nd(B,U.mode,ae),I.return=U,U=I),b(U)):i(U,I)}return lt}var Yr=fm(!0),gm=fm(!1),jo=Nn(null),No=null,Xr=null,zc=null;function Ac(){zc=Xr=No=null}function Oc(t){var n=jo.current;Ze(jo),t._currentValue=n}function Ic(t,n,i){for(;t!==null;){var l=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),t===i)break;t=t.return}}function Zr(t,n){No=t,zc=Xr=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&n)!==0&&(Gt=!0),t.firstContext=null)}function xs(t){var n=t._currentValue;if(zc!==t)if(t={context:t,memoizedValue:n,next:null},Xr===null){if(No===null)throw Error(a(308));Xr=t,No.dependencies={lanes:0,firstContext:t}}else Xr=Xr.next=t;return n}var sr=null;function Dc(t){sr===null?sr=[t]:sr.push(t)}function ym(t,n,i,l){var d=n.interleaved;return d===null?(i.next=i,Dc(n)):(i.next=d.next,d.next=i),n.interleaved=i,en(t,l)}function en(t,n){t.lanes|=n;var i=t.alternate;for(i!==null&&(i.lanes|=n),i=t,t=t.return;t!==null;)t.childLanes|=n,i=t.alternate,i!==null&&(i.childLanes|=n),i=t,t=t.return;return i.tag===3?i.stateNode:null}var Sn=!1;function Fc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function bm(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function tn(t,n){return{eventTime:t,lane:n,tag:0,payload:null,callback:null,next:null}}function Cn(t,n,i){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(Be&2)!==0){var d=l.pending;return d===null?n.next=n:(n.next=d.next,d.next=n),l.pending=n,en(t,i)}return d=l.interleaved,d===null?(n.next=n,Dc(l)):(n.next=d.next,d.next=n),l.interleaved=n,en(t,i)}function wo(t,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194240)!==0)){var l=n.lanes;l&=t.pendingLanes,i|=l,n.lanes=i,Yl(t,i)}}function vm(t,n){var i=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var d=null,m=null;if(i=i.firstBaseUpdate,i!==null){do{var b={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};m===null?d=m=b:m=m.next=b,i=i.next}while(i!==null);m===null?d=m=n:m=m.next=n}else d=m=n;i={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:m,shared:l.shared,effects:l.effects},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=n:t.next=n,i.lastBaseUpdate=n}function ko(t,n,i,l){var d=t.updateQueue;Sn=!1;var m=d.firstBaseUpdate,b=d.lastBaseUpdate,R=d.shared.pending;if(R!==null){d.shared.pending=null;var A=R,H=A.next;A.next=null,b===null?m=H:b.next=H,b=A;var te=t.alternate;te!==null&&(te=te.updateQueue,R=te.lastBaseUpdate,R!==b&&(R===null?te.firstBaseUpdate=H:R.next=H,te.lastBaseUpdate=A))}if(m!==null){var ne=d.baseState;b=0,te=H=A=null,R=m;do{var ee=R.lane,de=R.eventTime;if((l&ee)===ee){te!==null&&(te=te.next={eventTime:de,lane:0,tag:R.tag,payload:R.payload,callback:R.callback,next:null});e:{var fe=t,ge=R;switch(ee=n,de=i,ge.tag){case 1:if(fe=ge.payload,typeof fe=="function"){ne=fe.call(de,ne,ee);break e}ne=fe;break e;case 3:fe.flags=fe.flags&-65537|128;case 0:if(fe=ge.payload,ee=typeof fe=="function"?fe.call(de,ne,ee):fe,ee==null)break e;ne=L({},ne,ee);break e;case 2:Sn=!0}}R.callback!==null&&R.lane!==0&&(t.flags|=64,ee=d.effects,ee===null?d.effects=[R]:ee.push(R))}else de={eventTime:de,lane:ee,tag:R.tag,payload:R.payload,callback:R.callback,next:null},te===null?(H=te=de,A=ne):te=te.next=de,b|=ee;if(R=R.next,R===null){if(R=d.shared.pending,R===null)break;ee=R,R=ee.next,ee.next=null,d.lastBaseUpdate=ee,d.shared.pending=null}}while(!0);if(te===null&&(A=ne),d.baseState=A,d.firstBaseUpdate=H,d.lastBaseUpdate=te,n=d.shared.interleaved,n!==null){d=n;do b|=d.lane,d=d.next;while(d!==n)}else m===null&&(d.shared.lanes=0);ar|=b,t.lanes=b,t.memoizedState=ne}}function jm(t,n,i){if(t=n.effects,n.effects=null,t!==null)for(n=0;n<t.length;n++){var l=t[n],d=l.callback;if(d!==null){if(l.callback=null,l=i,typeof d!="function")throw Error(a(191,d));d.call(l)}}}var Qa={},_s=Nn(Qa),Ja=Nn(Qa),Ya=Nn(Qa);function nr(t){if(t===Qa)throw Error(a(174));return t}function Lc(t,n){switch(Qe(Ya,n),Qe(Ja,t),Qe(_s,Qa),t=n.nodeType,t){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:mt(null,"");break;default:t=t===8?n.parentNode:n,n=t.namespaceURI||null,t=t.tagName,n=mt(n,t)}Ze(_s),Qe(_s,n)}function ea(){Ze(_s),Ze(Ja),Ze(Ya)}function Nm(t){nr(Ya.current);var n=nr(_s.current),i=mt(n,t.type);n!==i&&(Qe(Ja,t),Qe(_s,i))}function _c(t){Ja.current===t&&(Ze(_s),Ze(Ja))}var st=Nn(0);function So(t){for(var n=t;n!==null;){if(n.tag===13){var i=n.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(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 null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Uc=[];function $c(){for(var t=0;t<Uc.length;t++)Uc[t]._workInProgressVersionPrimary=null;Uc.length=0}var Co=C.ReactCurrentDispatcher,Bc=C.ReactCurrentBatchConfig,rr=0,nt=null,ht=null,vt=null,Eo=!1,Xa=!1,Za=0,U0=0;function At(){throw Error(a(321))}function qc(t,n){if(n===null)return!1;for(var i=0;i<n.length&&i<t.length;i++)if(!Ns(t[i],n[i]))return!1;return!0}function Hc(t,n,i,l,d,m){if(rr=m,nt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,Co.current=t===null||t.memoizedState===null?H0:K0,t=i(l,d),Xa){m=0;do{if(Xa=!1,Za=0,25<=m)throw Error(a(301));m+=1,vt=ht=null,n.updateQueue=null,Co.current=V0,t=i(l,d)}while(Xa)}if(Co.current=Mo,n=ht!==null&&ht.next!==null,rr=0,vt=ht=nt=null,Eo=!1,n)throw Error(a(300));return t}function Kc(){var t=Za!==0;return Za=0,t}function Us(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vt===null?nt.memoizedState=vt=t:vt=vt.next=t,vt}function ms(){if(ht===null){var t=nt.alternate;t=t!==null?t.memoizedState:null}else t=ht.next;var n=vt===null?nt.memoizedState:vt.next;if(n!==null)vt=n,ht=t;else{if(t===null)throw Error(a(310));ht=t,t={memoizedState:ht.memoizedState,baseState:ht.baseState,baseQueue:ht.baseQueue,queue:ht.queue,next:null},vt===null?nt.memoizedState=vt=t:vt=vt.next=t}return vt}function ei(t,n){return typeof n=="function"?n(t):n}function Vc(t){var n=ms(),i=n.queue;if(i===null)throw Error(a(311));i.lastRenderedReducer=t;var l=ht,d=l.baseQueue,m=i.pending;if(m!==null){if(d!==null){var b=d.next;d.next=m.next,m.next=b}l.baseQueue=d=m,i.pending=null}if(d!==null){m=d.next,l=l.baseState;var R=b=null,A=null,H=m;do{var te=H.lane;if((rr&te)===te)A!==null&&(A=A.next={lane:0,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null}),l=H.hasEagerState?H.eagerState:t(l,H.action);else{var ne={lane:te,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null};A===null?(R=A=ne,b=l):A=A.next=ne,nt.lanes|=te,ar|=te}H=H.next}while(H!==null&&H!==m);A===null?b=l:A.next=R,Ns(l,n.memoizedState)||(Gt=!0),n.memoizedState=l,n.baseState=b,n.baseQueue=A,i.lastRenderedState=l}if(t=i.interleaved,t!==null){d=t;do m=d.lane,nt.lanes|=m,ar|=m,d=d.next;while(d!==t)}else d===null&&(i.lanes=0);return[n.memoizedState,i.dispatch]}function Wc(t){var n=ms(),i=n.queue;if(i===null)throw Error(a(311));i.lastRenderedReducer=t;var l=i.dispatch,d=i.pending,m=n.memoizedState;if(d!==null){i.pending=null;var b=d=d.next;do m=t(m,b.action),b=b.next;while(b!==d);Ns(m,n.memoizedState)||(Gt=!0),n.memoizedState=m,n.baseQueue===null&&(n.baseState=m),i.lastRenderedState=m}return[m,l]}function wm(){}function km(t,n){var i=nt,l=ms(),d=n(),m=!Ns(l.memoizedState,d);if(m&&(l.memoizedState=d,Gt=!0),l=l.queue,Gc(Em.bind(null,i,l,t),[t]),l.getSnapshot!==n||m||vt!==null&&vt.memoizedState.tag&1){if(i.flags|=2048,ti(9,Cm.bind(null,i,l,d,n),void 0,null),jt===null)throw Error(a(349));(rr&30)!==0||Sm(i,n,d)}return d}function Sm(t,n,i){t.flags|=16384,t={getSnapshot:n,value:i},n=nt.updateQueue,n===null?(n={lastEffect:null,stores:null},nt.updateQueue=n,n.stores=[t]):(i=n.stores,i===null?n.stores=[t]:i.push(t))}function Cm(t,n,i,l){n.value=i,n.getSnapshot=l,Pm(n)&&Rm(t)}function Em(t,n,i){return i(function(){Pm(n)&&Rm(t)})}function Pm(t){var n=t.getSnapshot;t=t.value;try{var i=n();return!Ns(t,i)}catch{return!0}}function Rm(t){var n=en(t,1);n!==null&&Es(n,t,1,-1)}function Mm(t){var n=Us();return typeof t=="function"&&(t=t()),n.memoizedState=n.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ei,lastRenderedState:t},n.queue=t,t=t.dispatch=q0.bind(null,nt,t),[n.memoizedState,t]}function ti(t,n,i,l){return t={tag:t,create:n,destroy:i,deps:l,next:null},n=nt.updateQueue,n===null?(n={lastEffect:null,stores:null},nt.updateQueue=n,n.lastEffect=t.next=t):(i=n.lastEffect,i===null?n.lastEffect=t.next=t:(l=i.next,i.next=t,t.next=l,n.lastEffect=t)),t}function Tm(){return ms().memoizedState}function Po(t,n,i,l){var d=Us();nt.flags|=t,d.memoizedState=ti(1|n,i,void 0,l===void 0?null:l)}function Ro(t,n,i,l){var d=ms();l=l===void 0?null:l;var m=void 0;if(ht!==null){var b=ht.memoizedState;if(m=b.destroy,l!==null&&qc(l,b.deps)){d.memoizedState=ti(n,i,m,l);return}}nt.flags|=t,d.memoizedState=ti(1|n,i,m,l)}function zm(t,n){return Po(8390656,8,t,n)}function Gc(t,n){return Ro(2048,8,t,n)}function Am(t,n){return Ro(4,2,t,n)}function Om(t,n){return Ro(4,4,t,n)}function Im(t,n){if(typeof n=="function")return t=t(),n(t),function(){n(null)};if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function Dm(t,n,i){return i=i!=null?i.concat([t]):null,Ro(4,4,Im.bind(null,n,t),i)}function Qc(){}function Fm(t,n){var i=ms();n=n===void 0?null:n;var l=i.memoizedState;return l!==null&&n!==null&&qc(n,l[1])?l[0]:(i.memoizedState=[t,n],t)}function Lm(t,n){var i=ms();n=n===void 0?null:n;var l=i.memoizedState;return l!==null&&n!==null&&qc(n,l[1])?l[0]:(t=t(),i.memoizedState=[t,n],t)}function _m(t,n,i){return(rr&21)===0?(t.baseState&&(t.baseState=!1,Gt=!0),t.memoizedState=i):(Ns(i,n)||(i=px(),nt.lanes|=i,ar|=i,t.baseState=!0),n)}function $0(t,n){var i=Ve;Ve=i!==0&&4>i?i:4,t(!0);var l=Bc.transition;Bc.transition={};try{t(!1),n()}finally{Ve=i,Bc.transition=l}}function Um(){return ms().memoizedState}function B0(t,n,i){var l=Mn(t);if(i={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null},$m(t))Bm(n,i);else if(i=ym(t,n,i,l),i!==null){var d=_t();Es(i,t,l,d),qm(i,n,l)}}function q0(t,n,i){var l=Mn(t),d={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null};if($m(t))Bm(n,d);else{var m=t.alternate;if(t.lanes===0&&(m===null||m.lanes===0)&&(m=n.lastRenderedReducer,m!==null))try{var b=n.lastRenderedState,R=m(b,i);if(d.hasEagerState=!0,d.eagerState=R,Ns(R,b)){var A=n.interleaved;A===null?(d.next=d,Dc(n)):(d.next=A.next,A.next=d),n.interleaved=d;return}}catch{}i=ym(t,n,d,l),i!==null&&(d=_t(),Es(i,t,l,d),qm(i,n,l))}}function $m(t){var n=t.alternate;return t===nt||n!==null&&n===nt}function Bm(t,n){Xa=Eo=!0;var i=t.pending;i===null?n.next=n:(n.next=i.next,i.next=n),t.pending=n}function qm(t,n,i){if((i&4194240)!==0){var l=n.lanes;l&=t.pendingLanes,i|=l,n.lanes=i,Yl(t,i)}}var Mo={readContext:xs,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useInsertionEffect:At,useLayoutEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useMutableSource:At,useSyncExternalStore:At,useId:At,unstable_isNewReconciler:!1},H0={readContext:xs,useCallback:function(t,n){return Us().memoizedState=[t,n===void 0?null:n],t},useContext:xs,useEffect:zm,useImperativeHandle:function(t,n,i){return i=i!=null?i.concat([t]):null,Po(4194308,4,Im.bind(null,n,t),i)},useLayoutEffect:function(t,n){return Po(4194308,4,t,n)},useInsertionEffect:function(t,n){return Po(4,2,t,n)},useMemo:function(t,n){var i=Us();return n=n===void 0?null:n,t=t(),i.memoizedState=[t,n],t},useReducer:function(t,n,i){var l=Us();return n=i!==void 0?i(n):n,l.memoizedState=l.baseState=n,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:n},l.queue=t,t=t.dispatch=B0.bind(null,nt,t),[l.memoizedState,t]},useRef:function(t){var n=Us();return t={current:t},n.memoizedState=t},useState:Mm,useDebugValue:Qc,useDeferredValue:function(t){return Us().memoizedState=t},useTransition:function(){var t=Mm(!1),n=t[0];return t=$0.bind(null,t[1]),Us().memoizedState=t,[n,t]},useMutableSource:function(){},useSyncExternalStore:function(t,n,i){var l=nt,d=Us();if(tt){if(i===void 0)throw Error(a(407));i=i()}else{if(i=n(),jt===null)throw Error(a(349));(rr&30)!==0||Sm(l,n,i)}d.memoizedState=i;var m={value:i,getSnapshot:n};return d.queue=m,zm(Em.bind(null,l,m,t),[t]),l.flags|=2048,ti(9,Cm.bind(null,l,m,i,n),void 0,null),i},useId:function(){var t=Us(),n=jt.identifierPrefix;if(tt){var i=Zs,l=Xs;i=(l&~(1<<32-js(l)-1)).toString(32)+i,n=":"+n+"R"+i,i=Za++,0<i&&(n+="H"+i.toString(32)),n+=":"}else i=U0++,n=":"+n+"r"+i.toString(32)+":";return t.memoizedState=n},unstable_isNewReconciler:!1},K0={readContext:xs,useCallback:Fm,useContext:xs,useEffect:Gc,useImperativeHandle:Dm,useInsertionEffect:Am,useLayoutEffect:Om,useMemo:Lm,useReducer:Vc,useRef:Tm,useState:function(){return Vc(ei)},useDebugValue:Qc,useDeferredValue:function(t){var n=ms();return _m(n,ht.memoizedState,t)},useTransition:function(){var t=Vc(ei)[0],n=ms().memoizedState;return[t,n]},useMutableSource:wm,useSyncExternalStore:km,useId:Um,unstable_isNewReconciler:!1},V0={readContext:xs,useCallback:Fm,useContext:xs,useEffect:Gc,useImperativeHandle:Dm,useInsertionEffect:Am,useLayoutEffect:Om,useMemo:Lm,useReducer:Wc,useRef:Tm,useState:function(){return Wc(ei)},useDebugValue:Qc,useDeferredValue:function(t){var n=ms();return ht===null?n.memoizedState=t:_m(n,ht.memoizedState,t)},useTransition:function(){var t=Wc(ei)[0],n=ms().memoizedState;return[t,n]},useMutableSource:wm,useSyncExternalStore:km,useId:Um,unstable_isNewReconciler:!1};function ks(t,n){if(t&&t.defaultProps){n=L({},n),t=t.defaultProps;for(var i in t)n[i]===void 0&&(n[i]=t[i]);return n}return n}function Jc(t,n,i,l){n=t.memoizedState,i=i(l,n),i=i==null?n:L({},n,i),t.memoizedState=i,t.lanes===0&&(t.updateQueue.baseState=i)}var To={isMounted:function(t){return(t=t._reactInternals)?W(t)===t:!1},enqueueSetState:function(t,n,i){t=t._reactInternals;var l=_t(),d=Mn(t),m=tn(l,d);m.payload=n,i!=null&&(m.callback=i),n=Cn(t,m,d),n!==null&&(Es(n,t,d,l),wo(n,t,d))},enqueueReplaceState:function(t,n,i){t=t._reactInternals;var l=_t(),d=Mn(t),m=tn(l,d);m.tag=1,m.payload=n,i!=null&&(m.callback=i),n=Cn(t,m,d),n!==null&&(Es(n,t,d,l),wo(n,t,d))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var i=_t(),l=Mn(t),d=tn(i,l);d.tag=2,n!=null&&(d.callback=n),n=Cn(t,d,l),n!==null&&(Es(n,t,l,i),wo(n,t,l))}};function Hm(t,n,i,l,d,m,b){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,m,b):n.prototype&&n.prototype.isPureReactComponent?!$a(i,l)||!$a(d,m):!0}function Km(t,n,i){var l=!1,d=wn,m=n.contextType;return typeof m=="object"&&m!==null?m=xs(m):(d=Wt(n)?Zn:zt.current,l=n.contextTypes,m=(l=l!=null)?Wr(t,d):wn),n=new n(i,m),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=To,t.stateNode=n,n._reactInternals=t,l&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=d,t.__reactInternalMemoizedMaskedChildContext=m),n}function Vm(t,n,i,l){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(i,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(i,l),n.state!==t&&To.enqueueReplaceState(n,n.state,null)}function Yc(t,n,i,l){var d=t.stateNode;d.props=i,d.state=t.memoizedState,d.refs={},Fc(t);var m=n.contextType;typeof m=="object"&&m!==null?d.context=xs(m):(m=Wt(n)?Zn:zt.current,d.context=Wr(t,m)),d.state=t.memoizedState,m=n.getDerivedStateFromProps,typeof m=="function"&&(Jc(t,n,m,i),d.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(n=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),n!==d.state&&To.enqueueReplaceState(d,d.state,null),ko(t,i,d,l),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308)}function ta(t,n){try{var i="",l=n;do i+=xe(l),l=l.return;while(l);var d=i}catch(m){d=`
|
|
39
|
+
Error generating stack: `+m.message+`
|
|
40
|
+
`+m.stack}return{value:t,source:n,stack:d,digest:null}}function Xc(t,n,i){return{value:t,source:null,stack:i??null,digest:n??null}}function Zc(t,n){try{console.error(n.value)}catch(i){setTimeout(function(){throw i})}}var W0=typeof WeakMap=="function"?WeakMap:Map;function Wm(t,n,i){i=tn(-1,i),i.tag=3,i.payload={element:null};var l=n.value;return i.callback=function(){Lo||(Lo=!0,hd=l),Zc(t,n)},i}function Gm(t,n,i){i=tn(-1,i),i.tag=3;var l=t.type.getDerivedStateFromError;if(typeof l=="function"){var d=n.value;i.payload=function(){return l(d)},i.callback=function(){Zc(t,n)}}var m=t.stateNode;return m!==null&&typeof m.componentDidCatch=="function"&&(i.callback=function(){Zc(t,n),typeof l!="function"&&(Pn===null?Pn=new Set([this]):Pn.add(this));var b=n.stack;this.componentDidCatch(n.value,{componentStack:b!==null?b:""})}),i}function Qm(t,n,i){var l=t.pingCache;if(l===null){l=t.pingCache=new W0;var d=new Set;l.set(n,d)}else d=l.get(n),d===void 0&&(d=new Set,l.set(n,d));d.has(i)||(d.add(i),t=oy.bind(null,t,n,i),n.then(t,t))}function Jm(t){do{var n;if((n=t.tag===13)&&(n=t.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return t;t=t.return}while(t!==null);return null}function Ym(t,n,i,l,d){return(t.mode&1)===0?(t===n?t.flags|=65536:(t.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(n=tn(-1,1),n.tag=2,Cn(i,n,1))),i.lanes|=1),t):(t.flags|=65536,t.lanes=d,t)}var G0=C.ReactCurrentOwner,Gt=!1;function Lt(t,n,i,l){n.child=t===null?gm(n,null,i,l):Yr(n,t.child,i,l)}function Xm(t,n,i,l,d){i=i.render;var m=n.ref;return Zr(n,d),l=Hc(t,n,i,l,m,d),i=Kc(),t!==null&&!Gt?(n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~d,sn(t,n,d)):(tt&&i&&Ec(n),n.flags|=1,Lt(t,n,l,d),n.child)}function Zm(t,n,i,l,d){if(t===null){var m=i.type;return typeof m=="function"&&!jd(m)&&m.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(n.tag=15,n.type=m,eh(t,n,m,l,d)):(t=Ho(i.type,null,l,n,n.mode,d),t.ref=n.ref,t.return=n,n.child=t)}if(m=t.child,(t.lanes&d)===0){var b=m.memoizedProps;if(i=i.compare,i=i!==null?i:$a,i(b,l)&&t.ref===n.ref)return sn(t,n,d)}return n.flags|=1,t=zn(m,l),t.ref=n.ref,t.return=n,n.child=t}function eh(t,n,i,l,d){if(t!==null){var m=t.memoizedProps;if($a(m,l)&&t.ref===n.ref)if(Gt=!1,n.pendingProps=l=m,(t.lanes&d)!==0)(t.flags&131072)!==0&&(Gt=!0);else return n.lanes=t.lanes,sn(t,n,d)}return ed(t,n,i,l,d)}function th(t,n,i){var l=n.pendingProps,d=l.children,m=t!==null?t.memoizedState:null;if(l.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},Qe(na,as),as|=i;else{if((i&1073741824)===0)return t=m!==null?m.baseLanes|i:i,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:t,cachePool:null,transitions:null},n.updateQueue=null,Qe(na,as),as|=t,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=m!==null?m.baseLanes:i,Qe(na,as),as|=l}else m!==null?(l=m.baseLanes|i,n.memoizedState=null):l=i,Qe(na,as),as|=l;return Lt(t,n,d,i),n.child}function sh(t,n){var i=n.ref;(t===null&&i!==null||t!==null&&t.ref!==i)&&(n.flags|=512,n.flags|=2097152)}function ed(t,n,i,l,d){var m=Wt(i)?Zn:zt.current;return m=Wr(n,m),Zr(n,d),i=Hc(t,n,i,l,m,d),l=Kc(),t!==null&&!Gt?(n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~d,sn(t,n,d)):(tt&&l&&Ec(n),n.flags|=1,Lt(t,n,i,d),n.child)}function nh(t,n,i,l,d){if(Wt(i)){var m=!0;po(n)}else m=!1;if(Zr(n,d),n.stateNode===null)Ao(t,n),Km(n,i,l),Yc(n,i,l,d),l=!0;else if(t===null){var b=n.stateNode,R=n.memoizedProps;b.props=R;var A=b.context,H=i.contextType;typeof H=="object"&&H!==null?H=xs(H):(H=Wt(i)?Zn:zt.current,H=Wr(n,H));var te=i.getDerivedStateFromProps,ne=typeof te=="function"||typeof b.getSnapshotBeforeUpdate=="function";ne||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(R!==l||A!==H)&&Vm(n,b,l,H),Sn=!1;var ee=n.memoizedState;b.state=ee,ko(n,l,b,d),A=n.memoizedState,R!==l||ee!==A||Vt.current||Sn?(typeof te=="function"&&(Jc(n,i,te,l),A=n.memoizedState),(R=Sn||Hm(n,i,R,l,ee,A,H))?(ne||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(n.flags|=4194308)):(typeof b.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=l,n.memoizedState=A),b.props=l,b.state=A,b.context=H,l=R):(typeof b.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{b=n.stateNode,bm(t,n),R=n.memoizedProps,H=n.type===n.elementType?R:ks(n.type,R),b.props=H,ne=n.pendingProps,ee=b.context,A=i.contextType,typeof A=="object"&&A!==null?A=xs(A):(A=Wt(i)?Zn:zt.current,A=Wr(n,A));var de=i.getDerivedStateFromProps;(te=typeof de=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(R!==ne||ee!==A)&&Vm(n,b,l,A),Sn=!1,ee=n.memoizedState,b.state=ee,ko(n,l,b,d);var fe=n.memoizedState;R!==ne||ee!==fe||Vt.current||Sn?(typeof de=="function"&&(Jc(n,i,de,l),fe=n.memoizedState),(H=Sn||Hm(n,i,H,l,ee,fe,A)||!1)?(te||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(l,fe,A),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(l,fe,A)),typeof b.componentDidUpdate=="function"&&(n.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof b.componentDidUpdate!="function"||R===t.memoizedProps&&ee===t.memoizedState||(n.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||R===t.memoizedProps&&ee===t.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=fe),b.props=l,b.state=fe,b.context=A,l=H):(typeof b.componentDidUpdate!="function"||R===t.memoizedProps&&ee===t.memoizedState||(n.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||R===t.memoizedProps&&ee===t.memoizedState||(n.flags|=1024),l=!1)}return td(t,n,i,l,m,d)}function td(t,n,i,l,d,m){sh(t,n);var b=(n.flags&128)!==0;if(!l&&!b)return d&&lm(n,i,!1),sn(t,n,m);l=n.stateNode,G0.current=n;var R=b&&typeof i.getDerivedStateFromError!="function"?null:l.render();return n.flags|=1,t!==null&&b?(n.child=Yr(n,t.child,null,m),n.child=Yr(n,null,R,m)):Lt(t,n,R,m),n.memoizedState=l.state,d&&lm(n,i,!0),n.child}function rh(t){var n=t.stateNode;n.pendingContext?im(t,n.pendingContext,n.pendingContext!==n.context):n.context&&im(t,n.context,!1),Lc(t,n.containerInfo)}function ah(t,n,i,l,d){return Jr(),Tc(d),n.flags|=256,Lt(t,n,i,l),n.child}var sd={dehydrated:null,treeContext:null,retryLane:0};function nd(t){return{baseLanes:t,cachePool:null,transitions:null}}function ih(t,n,i){var l=n.pendingProps,d=st.current,m=!1,b=(n.flags&128)!==0,R;if((R=b)||(R=t!==null&&t.memoizedState===null?!1:(d&2)!==0),R?(m=!0,n.flags&=-129):(t===null||t.memoizedState!==null)&&(d|=1),Qe(st,d&1),t===null)return Mc(n),t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((n.mode&1)===0?n.lanes=1:t.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(b=l.children,t=l.fallback,m?(l=n.mode,m=n.child,b={mode:"hidden",children:b},(l&1)===0&&m!==null?(m.childLanes=0,m.pendingProps=b):m=Ko(b,l,0,null),t=cr(t,l,i,null),m.return=n,t.return=n,m.sibling=t,n.child=m,n.child.memoizedState=nd(i),n.memoizedState=sd,t):rd(n,b));if(d=t.memoizedState,d!==null&&(R=d.dehydrated,R!==null))return Q0(t,n,b,l,R,d,i);if(m){m=l.fallback,b=n.mode,d=t.child,R=d.sibling;var A={mode:"hidden",children:l.children};return(b&1)===0&&n.child!==d?(l=n.child,l.childLanes=0,l.pendingProps=A,n.deletions=null):(l=zn(d,A),l.subtreeFlags=d.subtreeFlags&14680064),R!==null?m=zn(R,m):(m=cr(m,b,i,null),m.flags|=2),m.return=n,l.return=n,l.sibling=m,n.child=l,l=m,m=n.child,b=t.child.memoizedState,b=b===null?nd(i):{baseLanes:b.baseLanes|i,cachePool:null,transitions:b.transitions},m.memoizedState=b,m.childLanes=t.childLanes&~i,n.memoizedState=sd,l}return m=t.child,t=m.sibling,l=zn(m,{mode:"visible",children:l.children}),(n.mode&1)===0&&(l.lanes=i),l.return=n,l.sibling=null,t!==null&&(i=n.deletions,i===null?(n.deletions=[t],n.flags|=16):i.push(t)),n.child=l,n.memoizedState=null,l}function rd(t,n){return n=Ko({mode:"visible",children:n},t.mode,0,null),n.return=t,t.child=n}function zo(t,n,i,l){return l!==null&&Tc(l),Yr(n,t.child,null,i),t=rd(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function Q0(t,n,i,l,d,m,b){if(i)return n.flags&256?(n.flags&=-257,l=Xc(Error(a(422))),zo(t,n,b,l)):n.memoizedState!==null?(n.child=t.child,n.flags|=128,null):(m=l.fallback,d=n.mode,l=Ko({mode:"visible",children:l.children},d,0,null),m=cr(m,d,b,null),m.flags|=2,l.return=n,m.return=n,l.sibling=m,n.child=l,(n.mode&1)!==0&&Yr(n,t.child,null,b),n.child.memoizedState=nd(b),n.memoizedState=sd,m);if((n.mode&1)===0)return zo(t,n,b,null);if(d.data==="$!"){if(l=d.nextSibling&&d.nextSibling.dataset,l)var R=l.dgst;return l=R,m=Error(a(419)),l=Xc(m,l,void 0),zo(t,n,b,l)}if(R=(b&t.childLanes)!==0,Gt||R){if(l=jt,l!==null){switch(b&-b){case 4:d=2;break;case 16:d=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:d=32;break;case 536870912:d=268435456;break;default:d=0}d=(d&(l.suspendedLanes|b))!==0?0:d,d!==0&&d!==m.retryLane&&(m.retryLane=d,en(t,d),Es(l,t,d,-1))}return vd(),l=Xc(Error(a(421))),zo(t,n,b,l)}return d.data==="$?"?(n.flags|=128,n.child=t.child,n=ly.bind(null,t),d._reactRetry=n,null):(t=m.treeContext,rs=jn(d.nextSibling),ns=n,tt=!0,ws=null,t!==null&&(ds[us++]=Xs,ds[us++]=Zs,ds[us++]=er,Xs=t.id,Zs=t.overflow,er=n),n=rd(n,l.children),n.flags|=4096,n)}function oh(t,n,i){t.lanes|=n;var l=t.alternate;l!==null&&(l.lanes|=n),Ic(t.return,n,i)}function ad(t,n,i,l,d){var m=t.memoizedState;m===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:d}:(m.isBackwards=n,m.rendering=null,m.renderingStartTime=0,m.last=l,m.tail=i,m.tailMode=d)}function lh(t,n,i){var l=n.pendingProps,d=l.revealOrder,m=l.tail;if(Lt(t,n,l.children,i),l=st.current,(l&2)!==0)l=l&1|2,n.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&oh(t,i,n);else if(t.tag===19)oh(t,i,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}l&=1}if(Qe(st,l),(n.mode&1)===0)n.memoizedState=null;else switch(d){case"forwards":for(i=n.child,d=null;i!==null;)t=i.alternate,t!==null&&So(t)===null&&(d=i),i=i.sibling;i=d,i===null?(d=n.child,n.child=null):(d=i.sibling,i.sibling=null),ad(n,!1,d,i,m);break;case"backwards":for(i=null,d=n.child,n.child=null;d!==null;){if(t=d.alternate,t!==null&&So(t)===null){n.child=d;break}t=d.sibling,d.sibling=i,i=d,d=t}ad(n,!0,i,null,m);break;case"together":ad(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function Ao(t,n){(n.mode&1)===0&&t!==null&&(t.alternate=null,n.alternate=null,n.flags|=2)}function sn(t,n,i){if(t!==null&&(n.dependencies=t.dependencies),ar|=n.lanes,(i&n.childLanes)===0)return null;if(t!==null&&n.child!==t.child)throw Error(a(153));if(n.child!==null){for(t=n.child,i=zn(t,t.pendingProps),n.child=i,i.return=n;t.sibling!==null;)t=t.sibling,i=i.sibling=zn(t,t.pendingProps),i.return=n;i.sibling=null}return n.child}function J0(t,n,i){switch(n.tag){case 3:rh(n),Jr();break;case 5:Nm(n);break;case 1:Wt(n.type)&&po(n);break;case 4:Lc(n,n.stateNode.containerInfo);break;case 10:var l=n.type._context,d=n.memoizedProps.value;Qe(jo,l._currentValue),l._currentValue=d;break;case 13:if(l=n.memoizedState,l!==null)return l.dehydrated!==null?(Qe(st,st.current&1),n.flags|=128,null):(i&n.child.childLanes)!==0?ih(t,n,i):(Qe(st,st.current&1),t=sn(t,n,i),t!==null?t.sibling:null);Qe(st,st.current&1);break;case 19:if(l=(i&n.childLanes)!==0,(t.flags&128)!==0){if(l)return lh(t,n,i);n.flags|=128}if(d=n.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),Qe(st,st.current),l)break;return null;case 22:case 23:return n.lanes=0,th(t,n,i)}return sn(t,n,i)}var ch,id,dh,uh;ch=function(t,n){for(var i=n.child;i!==null;){if(i.tag===5||i.tag===6)t.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},id=function(){},dh=function(t,n,i,l){var d=t.memoizedProps;if(d!==l){t=n.stateNode,nr(_s.current);var m=null;switch(i){case"input":d=ie(t,d),l=ie(t,l),m=[];break;case"select":d=L({},d,{value:void 0}),l=L({},l,{value:void 0}),m=[];break;case"textarea":d=Fe(t,d),l=Fe(t,l),m=[];break;default:typeof d.onClick!="function"&&typeof l.onClick=="function"&&(t.onclick=xo)}os(i,l);var b;i=null;for(H in d)if(!l.hasOwnProperty(H)&&d.hasOwnProperty(H)&&d[H]!=null)if(H==="style"){var R=d[H];for(b in R)R.hasOwnProperty(b)&&(i||(i={}),i[b]="")}else H!=="dangerouslySetInnerHTML"&&H!=="children"&&H!=="suppressContentEditableWarning"&&H!=="suppressHydrationWarning"&&H!=="autoFocus"&&(c.hasOwnProperty(H)?m||(m=[]):(m=m||[]).push(H,null));for(H in l){var A=l[H];if(R=d?.[H],l.hasOwnProperty(H)&&A!==R&&(A!=null||R!=null))if(H==="style")if(R){for(b in R)!R.hasOwnProperty(b)||A&&A.hasOwnProperty(b)||(i||(i={}),i[b]="");for(b in A)A.hasOwnProperty(b)&&R[b]!==A[b]&&(i||(i={}),i[b]=A[b])}else i||(m||(m=[]),m.push(H,i)),i=A;else H==="dangerouslySetInnerHTML"?(A=A?A.__html:void 0,R=R?R.__html:void 0,A!=null&&R!==A&&(m=m||[]).push(H,A)):H==="children"?typeof A!="string"&&typeof A!="number"||(m=m||[]).push(H,""+A):H!=="suppressContentEditableWarning"&&H!=="suppressHydrationWarning"&&(c.hasOwnProperty(H)?(A!=null&&H==="onScroll"&&Xe("scroll",t),m||R===A||(m=[])):(m=m||[]).push(H,A))}i&&(m=m||[]).push("style",i);var H=m;(n.updateQueue=H)&&(n.flags|=4)}},uh=function(t,n,i,l){i!==l&&(n.flags|=4)};function si(t,n){if(!tt)switch(t.tailMode){case"hidden":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t.tail=null:i.sibling=null;break;case"collapsed":i=t.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null}}function Ot(t){var n=t.alternate!==null&&t.alternate.child===t.child,i=0,l=0;if(n)for(var d=t.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags&14680064,l|=d.flags&14680064,d.return=t,d=d.sibling;else for(d=t.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=t,d=d.sibling;return t.subtreeFlags|=l,t.childLanes=i,n}function Y0(t,n,i){var l=n.pendingProps;switch(Pc(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ot(n),null;case 1:return Wt(n.type)&&ho(),Ot(n),null;case 3:return l=n.stateNode,ea(),Ze(Vt),Ze(zt),$c(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(bo(n)?n.flags|=4:t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,ws!==null&&(gd(ws),ws=null))),id(t,n),Ot(n),null;case 5:_c(n);var d=nr(Ya.current);if(i=n.type,t!==null&&n.stateNode!=null)dh(t,n,i,l,d),t.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!l){if(n.stateNode===null)throw Error(a(166));return Ot(n),null}if(t=nr(_s.current),bo(n)){l=n.stateNode,i=n.type;var m=n.memoizedProps;switch(l[Ls]=n,l[Va]=m,t=(n.mode&1)!==0,i){case"dialog":Xe("cancel",l),Xe("close",l);break;case"iframe":case"object":case"embed":Xe("load",l);break;case"video":case"audio":for(d=0;d<qa.length;d++)Xe(qa[d],l);break;case"source":Xe("error",l);break;case"img":case"image":case"link":Xe("error",l),Xe("load",l);break;case"details":Xe("toggle",l);break;case"input":Mt(l,m),Xe("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!m.multiple},Xe("invalid",l);break;case"textarea":bs(l,m),Xe("invalid",l)}os(i,m),d=null;for(var b in m)if(m.hasOwnProperty(b)){var R=m[b];b==="children"?typeof R=="string"?l.textContent!==R&&(m.suppressHydrationWarning!==!0&&uo(l.textContent,R,t),d=["children",R]):typeof R=="number"&&l.textContent!==""+R&&(m.suppressHydrationWarning!==!0&&uo(l.textContent,R,t),d=["children",""+R]):c.hasOwnProperty(b)&&R!=null&&b==="onScroll"&&Xe("scroll",l)}switch(i){case"input":yt(l),zs(l,m,!0);break;case"textarea":yt(l),As(l);break;case"select":case"option":break;default:typeof m.onClick=="function"&&(l.onclick=xo)}l=d,n.updateQueue=l,l!==null&&(n.flags|=4)}else{b=d.nodeType===9?d:d.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=ts(i)),t==="http://www.w3.org/1999/xhtml"?i==="script"?(t=b.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof l.is=="string"?t=b.createElement(i,{is:l.is}):(t=b.createElement(i),i==="select"&&(b=t,l.multiple?b.multiple=!0:l.size&&(b.size=l.size))):t=b.createElementNS(t,i),t[Ls]=n,t[Va]=l,ch(t,n,!1,!1),n.stateNode=t;e:{switch(b=Le(i,l),i){case"dialog":Xe("cancel",t),Xe("close",t),d=l;break;case"iframe":case"object":case"embed":Xe("load",t),d=l;break;case"video":case"audio":for(d=0;d<qa.length;d++)Xe(qa[d],t);d=l;break;case"source":Xe("error",t),d=l;break;case"img":case"image":case"link":Xe("error",t),Xe("load",t),d=l;break;case"details":Xe("toggle",t),d=l;break;case"input":Mt(t,l),d=ie(t,l),Xe("invalid",t);break;case"option":d=l;break;case"select":t._wrapperState={wasMultiple:!!l.multiple},d=L({},l,{value:void 0}),Xe("invalid",t);break;case"textarea":bs(t,l),d=Fe(t,l),Xe("invalid",t);break;default:d=l}os(i,d),R=d;for(m in R)if(R.hasOwnProperty(m)){var A=R[m];m==="style"?Qn(t,A):m==="dangerouslySetInnerHTML"?(A=A?A.__html:void 0,A!=null&&Ue(t,A)):m==="children"?typeof A=="string"?(i!=="textarea"||A!=="")&&$e(t,A):typeof A=="number"&&$e(t,""+A):m!=="suppressContentEditableWarning"&&m!=="suppressHydrationWarning"&&m!=="autoFocus"&&(c.hasOwnProperty(m)?A!=null&&m==="onScroll"&&Xe("scroll",t):A!=null&&z(t,m,A,b))}switch(i){case"input":yt(t),zs(t,l,!1);break;case"textarea":yt(t),As(t);break;case"option":l.value!=null&&t.setAttribute("value",""+he(l.value));break;case"select":t.multiple=!!l.multiple,m=l.value,m!=null?pe(t,!!l.multiple,m,!1):l.defaultValue!=null&&pe(t,!!l.multiple,l.defaultValue,!0);break;default:typeof d.onClick=="function"&&(t.onclick=xo)}switch(i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return Ot(n),null;case 6:if(t&&n.stateNode!=null)uh(t,n,t.memoizedProps,l);else{if(typeof l!="string"&&n.stateNode===null)throw Error(a(166));if(i=nr(Ya.current),nr(_s.current),bo(n)){if(l=n.stateNode,i=n.memoizedProps,l[Ls]=n,(m=l.nodeValue!==i)&&(t=ns,t!==null))switch(t.tag){case 3:uo(l.nodeValue,i,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&uo(l.nodeValue,i,(t.mode&1)!==0)}m&&(n.flags|=4)}else l=(i.nodeType===9?i:i.ownerDocument).createTextNode(l),l[Ls]=n,n.stateNode=l}return Ot(n),null;case 13:if(Ze(st),l=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(tt&&rs!==null&&(n.mode&1)!==0&&(n.flags&128)===0)hm(),Jr(),n.flags|=98560,m=!1;else if(m=bo(n),l!==null&&l.dehydrated!==null){if(t===null){if(!m)throw Error(a(318));if(m=n.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(a(317));m[Ls]=n}else Jr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ot(n),m=!1}else ws!==null&&(gd(ws),ws=null),m=!0;if(!m)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=i,n):(l=l!==null,l!==(t!==null&&t.memoizedState!==null)&&l&&(n.child.flags|=8192,(n.mode&1)!==0&&(t===null||(st.current&1)!==0?pt===0&&(pt=3):vd())),n.updateQueue!==null&&(n.flags|=4),Ot(n),null);case 4:return ea(),id(t,n),t===null&&Ha(n.stateNode.containerInfo),Ot(n),null;case 10:return Oc(n.type._context),Ot(n),null;case 17:return Wt(n.type)&&ho(),Ot(n),null;case 19:if(Ze(st),m=n.memoizedState,m===null)return Ot(n),null;if(l=(n.flags&128)!==0,b=m.rendering,b===null)if(l)si(m,!1);else{if(pt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(b=So(t),b!==null){for(n.flags|=128,si(m,!1),l=b.updateQueue,l!==null&&(n.updateQueue=l,n.flags|=4),n.subtreeFlags=0,l=i,i=n.child;i!==null;)m=i,t=l,m.flags&=14680066,b=m.alternate,b===null?(m.childLanes=0,m.lanes=t,m.child=null,m.subtreeFlags=0,m.memoizedProps=null,m.memoizedState=null,m.updateQueue=null,m.dependencies=null,m.stateNode=null):(m.childLanes=b.childLanes,m.lanes=b.lanes,m.child=b.child,m.subtreeFlags=0,m.deletions=null,m.memoizedProps=b.memoizedProps,m.memoizedState=b.memoizedState,m.updateQueue=b.updateQueue,m.type=b.type,t=b.dependencies,m.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),i=i.sibling;return Qe(st,st.current&1|2),n.child}t=t.sibling}m.tail!==null&&ot()>ra&&(n.flags|=128,l=!0,si(m,!1),n.lanes=4194304)}else{if(!l)if(t=So(b),t!==null){if(n.flags|=128,l=!0,i=t.updateQueue,i!==null&&(n.updateQueue=i,n.flags|=4),si(m,!0),m.tail===null&&m.tailMode==="hidden"&&!b.alternate&&!tt)return Ot(n),null}else 2*ot()-m.renderingStartTime>ra&&i!==1073741824&&(n.flags|=128,l=!0,si(m,!1),n.lanes=4194304);m.isBackwards?(b.sibling=n.child,n.child=b):(i=m.last,i!==null?i.sibling=b:n.child=b,m.last=b)}return m.tail!==null?(n=m.tail,m.rendering=n,m.tail=n.sibling,m.renderingStartTime=ot(),n.sibling=null,i=st.current,Qe(st,l?i&1|2:i&1),n):(Ot(n),null);case 22:case 23:return bd(),l=n.memoizedState!==null,t!==null&&t.memoizedState!==null!==l&&(n.flags|=8192),l&&(n.mode&1)!==0?(as&1073741824)!==0&&(Ot(n),n.subtreeFlags&6&&(n.flags|=8192)):Ot(n),null;case 24:return null;case 25:return null}throw Error(a(156,n.tag))}function X0(t,n){switch(Pc(n),n.tag){case 1:return Wt(n.type)&&ho(),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return ea(),Ze(Vt),Ze(zt),$c(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 5:return _c(n),null;case 13:if(Ze(st),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(a(340));Jr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return Ze(st),null;case 4:return ea(),null;case 10:return Oc(n.type._context),null;case 22:case 23:return bd(),null;case 24:return null;default:return null}}var Oo=!1,It=!1,Z0=typeof WeakSet=="function"?WeakSet:Set,me=null;function sa(t,n){var i=t.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(l){at(t,n,l)}else i.current=null}function od(t,n,i){try{i()}catch(l){at(t,n,l)}}var xh=!1;function ey(t,n){if(bc=Zi,t=Hx(),uc(t)){if("selectionStart"in t)var i={start:t.selectionStart,end:t.selectionEnd};else e:{i=(i=t.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var d=l.anchorOffset,m=l.focusNode;l=l.focusOffset;try{i.nodeType,m.nodeType}catch{i=null;break e}var b=0,R=-1,A=-1,H=0,te=0,ne=t,ee=null;t:for(;;){for(var de;ne!==i||d!==0&&ne.nodeType!==3||(R=b+d),ne!==m||l!==0&&ne.nodeType!==3||(A=b+l),ne.nodeType===3&&(b+=ne.nodeValue.length),(de=ne.firstChild)!==null;)ee=ne,ne=de;for(;;){if(ne===t)break t;if(ee===i&&++H===d&&(R=b),ee===m&&++te===l&&(A=b),(de=ne.nextSibling)!==null)break;ne=ee,ee=ne.parentNode}ne=de}i=R===-1||A===-1?null:{start:R,end:A}}else i=null}i=i||{start:0,end:0}}else i=null;for(vc={focusedElem:t,selectionRange:i},Zi=!1,me=n;me!==null;)if(n=me,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,me=t;else for(;me!==null;){n=me;try{var fe=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(fe!==null){var ge=fe.memoizedProps,lt=fe.memoizedState,U=n.stateNode,I=U.getSnapshotBeforeUpdate(n.elementType===n.type?ge:ks(n.type,ge),lt);U.__reactInternalSnapshotBeforeUpdate=I}break;case 3:var B=n.stateNode.containerInfo;B.nodeType===1?B.textContent="":B.nodeType===9&&B.documentElement&&B.removeChild(B.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(ae){at(n,n.return,ae)}if(t=n.sibling,t!==null){t.return=n.return,me=t;break}me=n.return}return fe=xh,xh=!1,fe}function ni(t,n,i){var l=n.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var d=l=l.next;do{if((d.tag&t)===t){var m=d.destroy;d.destroy=void 0,m!==void 0&&od(n,i,m)}d=d.next}while(d!==l)}}function Io(t,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var l=i.create;i.destroy=l()}i=i.next}while(i!==n)}}function ld(t){var n=t.ref;if(n!==null){var i=t.stateNode;t.tag,t=i,typeof n=="function"?n(t):n.current=t}}function mh(t){var n=t.alternate;n!==null&&(t.alternate=null,mh(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&(delete n[Ls],delete n[Va],delete n[kc],delete n[D0],delete n[F0])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function hh(t){return t.tag===5||t.tag===3||t.tag===4}function ph(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||hh(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function cd(t,n,i){var l=t.tag;if(l===5||l===6)t=t.stateNode,n?i.nodeType===8?i.parentNode.insertBefore(t,n):i.insertBefore(t,n):(i.nodeType===8?(n=i.parentNode,n.insertBefore(t,i)):(n=i,n.appendChild(t)),i=i._reactRootContainer,i!=null||n.onclick!==null||(n.onclick=xo));else if(l!==4&&(t=t.child,t!==null))for(cd(t,n,i),t=t.sibling;t!==null;)cd(t,n,i),t=t.sibling}function dd(t,n,i){var l=t.tag;if(l===5||l===6)t=t.stateNode,n?i.insertBefore(t,n):i.appendChild(t);else if(l!==4&&(t=t.child,t!==null))for(dd(t,n,i),t=t.sibling;t!==null;)dd(t,n,i),t=t.sibling}var Pt=null,Ss=!1;function En(t,n,i){for(i=i.child;i!==null;)fh(t,n,i),i=i.sibling}function fh(t,n,i){if(Fs&&typeof Fs.onCommitFiberUnmount=="function")try{Fs.onCommitFiberUnmount(Wi,i)}catch{}switch(i.tag){case 5:It||sa(i,n);case 6:var l=Pt,d=Ss;Pt=null,En(t,n,i),Pt=l,Ss=d,Pt!==null&&(Ss?(t=Pt,i=i.stateNode,t.nodeType===8?t.parentNode.removeChild(i):t.removeChild(i)):Pt.removeChild(i.stateNode));break;case 18:Pt!==null&&(Ss?(t=Pt,i=i.stateNode,t.nodeType===8?wc(t.parentNode,i):t.nodeType===1&&wc(t,i),Ia(t)):wc(Pt,i.stateNode));break;case 4:l=Pt,d=Ss,Pt=i.stateNode.containerInfo,Ss=!0,En(t,n,i),Pt=l,Ss=d;break;case 0:case 11:case 14:case 15:if(!It&&(l=i.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){d=l=l.next;do{var m=d,b=m.destroy;m=m.tag,b!==void 0&&((m&2)!==0||(m&4)!==0)&&od(i,n,b),d=d.next}while(d!==l)}En(t,n,i);break;case 1:if(!It&&(sa(i,n),l=i.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=i.memoizedProps,l.state=i.memoizedState,l.componentWillUnmount()}catch(R){at(i,n,R)}En(t,n,i);break;case 21:En(t,n,i);break;case 22:i.mode&1?(It=(l=It)||i.memoizedState!==null,En(t,n,i),It=l):En(t,n,i);break;default:En(t,n,i)}}function gh(t){var n=t.updateQueue;if(n!==null){t.updateQueue=null;var i=t.stateNode;i===null&&(i=t.stateNode=new Z0),n.forEach(function(l){var d=cy.bind(null,t,l);i.has(l)||(i.add(l),l.then(d,d))})}}function Cs(t,n){var i=n.deletions;if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];try{var m=t,b=n,R=b;e:for(;R!==null;){switch(R.tag){case 5:Pt=R.stateNode,Ss=!1;break e;case 3:Pt=R.stateNode.containerInfo,Ss=!0;break e;case 4:Pt=R.stateNode.containerInfo,Ss=!0;break e}R=R.return}if(Pt===null)throw Error(a(160));fh(m,b,d),Pt=null,Ss=!1;var A=d.alternate;A!==null&&(A.return=null),d.return=null}catch(H){at(d,n,H)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)yh(n,t),n=n.sibling}function yh(t,n){var i=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Cs(n,t),$s(t),l&4){try{ni(3,t,t.return),Io(3,t)}catch(ge){at(t,t.return,ge)}try{ni(5,t,t.return)}catch(ge){at(t,t.return,ge)}}break;case 1:Cs(n,t),$s(t),l&512&&i!==null&&sa(i,i.return);break;case 5:if(Cs(n,t),$s(t),l&512&&i!==null&&sa(i,i.return),t.flags&32){var d=t.stateNode;try{$e(d,"")}catch(ge){at(t,t.return,ge)}}if(l&4&&(d=t.stateNode,d!=null)){var m=t.memoizedProps,b=i!==null?i.memoizedProps:m,R=t.type,A=t.updateQueue;if(t.updateQueue=null,A!==null)try{R==="input"&&m.type==="radio"&&m.name!=null&&xt(d,m),Le(R,b);var H=Le(R,m);for(b=0;b<A.length;b+=2){var te=A[b],ne=A[b+1];te==="style"?Qn(d,ne):te==="dangerouslySetInnerHTML"?Ue(d,ne):te==="children"?$e(d,ne):z(d,te,ne,H)}switch(R){case"input":Ft(d,m);break;case"textarea":bt(d,m);break;case"select":var ee=d._wrapperState.wasMultiple;d._wrapperState.wasMultiple=!!m.multiple;var de=m.value;de!=null?pe(d,!!m.multiple,de,!1):ee!==!!m.multiple&&(m.defaultValue!=null?pe(d,!!m.multiple,m.defaultValue,!0):pe(d,!!m.multiple,m.multiple?[]:"",!1))}d[Va]=m}catch(ge){at(t,t.return,ge)}}break;case 6:if(Cs(n,t),$s(t),l&4){if(t.stateNode===null)throw Error(a(162));d=t.stateNode,m=t.memoizedProps;try{d.nodeValue=m}catch(ge){at(t,t.return,ge)}}break;case 3:if(Cs(n,t),$s(t),l&4&&i!==null&&i.memoizedState.isDehydrated)try{Ia(n.containerInfo)}catch(ge){at(t,t.return,ge)}break;case 4:Cs(n,t),$s(t);break;case 13:Cs(n,t),$s(t),d=t.child,d.flags&8192&&(m=d.memoizedState!==null,d.stateNode.isHidden=m,!m||d.alternate!==null&&d.alternate.memoizedState!==null||(md=ot())),l&4&&gh(t);break;case 22:if(te=i!==null&&i.memoizedState!==null,t.mode&1?(It=(H=It)||te,Cs(n,t),It=H):Cs(n,t),$s(t),l&8192){if(H=t.memoizedState!==null,(t.stateNode.isHidden=H)&&!te&&(t.mode&1)!==0)for(me=t,te=t.child;te!==null;){for(ne=me=te;me!==null;){switch(ee=me,de=ee.child,ee.tag){case 0:case 11:case 14:case 15:ni(4,ee,ee.return);break;case 1:sa(ee,ee.return);var fe=ee.stateNode;if(typeof fe.componentWillUnmount=="function"){l=ee,i=ee.return;try{n=l,fe.props=n.memoizedProps,fe.state=n.memoizedState,fe.componentWillUnmount()}catch(ge){at(l,i,ge)}}break;case 5:sa(ee,ee.return);break;case 22:if(ee.memoizedState!==null){jh(ne);continue}}de!==null?(de.return=ee,me=de):jh(ne)}te=te.sibling}e:for(te=null,ne=t;;){if(ne.tag===5){if(te===null){te=ne;try{d=ne.stateNode,H?(m=d.style,typeof m.setProperty=="function"?m.setProperty("display","none","important"):m.display="none"):(R=ne.stateNode,A=ne.memoizedProps.style,b=A!=null&&A.hasOwnProperty("display")?A.display:null,R.style.display=Qs("display",b))}catch(ge){at(t,t.return,ge)}}}else if(ne.tag===6){if(te===null)try{ne.stateNode.nodeValue=H?"":ne.memoizedProps}catch(ge){at(t,t.return,ge)}}else if((ne.tag!==22&&ne.tag!==23||ne.memoizedState===null||ne===t)&&ne.child!==null){ne.child.return=ne,ne=ne.child;continue}if(ne===t)break e;for(;ne.sibling===null;){if(ne.return===null||ne.return===t)break e;te===ne&&(te=null),ne=ne.return}te===ne&&(te=null),ne.sibling.return=ne.return,ne=ne.sibling}}break;case 19:Cs(n,t),$s(t),l&4&&gh(t);break;case 21:break;default:Cs(n,t),$s(t)}}function $s(t){var n=t.flags;if(n&2){try{e:{for(var i=t.return;i!==null;){if(hh(i)){var l=i;break e}i=i.return}throw Error(a(160))}switch(l.tag){case 5:var d=l.stateNode;l.flags&32&&($e(d,""),l.flags&=-33);var m=ph(t);dd(t,m,d);break;case 3:case 4:var b=l.stateNode.containerInfo,R=ph(t);cd(t,R,b);break;default:throw Error(a(161))}}catch(A){at(t,t.return,A)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function ty(t,n,i){me=t,bh(t)}function bh(t,n,i){for(var l=(t.mode&1)!==0;me!==null;){var d=me,m=d.child;if(d.tag===22&&l){var b=d.memoizedState!==null||Oo;if(!b){var R=d.alternate,A=R!==null&&R.memoizedState!==null||It;R=Oo;var H=It;if(Oo=b,(It=A)&&!H)for(me=d;me!==null;)b=me,A=b.child,b.tag===22&&b.memoizedState!==null?Nh(d):A!==null?(A.return=b,me=A):Nh(d);for(;m!==null;)me=m,bh(m),m=m.sibling;me=d,Oo=R,It=H}vh(t)}else(d.subtreeFlags&8772)!==0&&m!==null?(m.return=d,me=m):vh(t)}}function vh(t){for(;me!==null;){var n=me;if((n.flags&8772)!==0){var i=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:It||Io(5,n);break;case 1:var l=n.stateNode;if(n.flags&4&&!It)if(i===null)l.componentDidMount();else{var d=n.elementType===n.type?i.memoizedProps:ks(n.type,i.memoizedProps);l.componentDidUpdate(d,i.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var m=n.updateQueue;m!==null&&jm(n,m,l);break;case 3:var b=n.updateQueue;if(b!==null){if(i=null,n.child!==null)switch(n.child.tag){case 5:i=n.child.stateNode;break;case 1:i=n.child.stateNode}jm(n,b,i)}break;case 5:var R=n.stateNode;if(i===null&&n.flags&4){i=R;var A=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":A.autoFocus&&i.focus();break;case"img":A.src&&(i.src=A.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var H=n.alternate;if(H!==null){var te=H.memoizedState;if(te!==null){var ne=te.dehydrated;ne!==null&&Ia(ne)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(a(163))}It||n.flags&512&&ld(n)}catch(ee){at(n,n.return,ee)}}if(n===t){me=null;break}if(i=n.sibling,i!==null){i.return=n.return,me=i;break}me=n.return}}function jh(t){for(;me!==null;){var n=me;if(n===t){me=null;break}var i=n.sibling;if(i!==null){i.return=n.return,me=i;break}me=n.return}}function Nh(t){for(;me!==null;){var n=me;try{switch(n.tag){case 0:case 11:case 15:var i=n.return;try{Io(4,n)}catch(A){at(n,i,A)}break;case 1:var l=n.stateNode;if(typeof l.componentDidMount=="function"){var d=n.return;try{l.componentDidMount()}catch(A){at(n,d,A)}}var m=n.return;try{ld(n)}catch(A){at(n,m,A)}break;case 5:var b=n.return;try{ld(n)}catch(A){at(n,b,A)}}}catch(A){at(n,n.return,A)}if(n===t){me=null;break}var R=n.sibling;if(R!==null){R.return=n.return,me=R;break}me=n.return}}var sy=Math.ceil,Do=C.ReactCurrentDispatcher,ud=C.ReactCurrentOwner,hs=C.ReactCurrentBatchConfig,Be=0,jt=null,dt=null,Rt=0,as=0,na=Nn(0),pt=0,ri=null,ar=0,Fo=0,xd=0,ai=null,Qt=null,md=0,ra=1/0,nn=null,Lo=!1,hd=null,Pn=null,_o=!1,Rn=null,Uo=0,ii=0,pd=null,$o=-1,Bo=0;function _t(){return(Be&6)!==0?ot():$o!==-1?$o:$o=ot()}function Mn(t){return(t.mode&1)===0?1:(Be&2)!==0&&Rt!==0?Rt&-Rt:_0.transition!==null?(Bo===0&&(Bo=px()),Bo):(t=Ve,t!==0||(t=window.event,t=t===void 0?16:kx(t.type)),t)}function Es(t,n,i,l){if(50<ii)throw ii=0,pd=null,Error(a(185));Ma(t,i,l),((Be&2)===0||t!==jt)&&(t===jt&&((Be&2)===0&&(Fo|=i),pt===4&&Tn(t,Rt)),Jt(t,l),i===1&&Be===0&&(n.mode&1)===0&&(ra=ot()+500,fo&&kn()))}function Jt(t,n){var i=t.callbackNode;_g(t,n);var l=Ji(t,t===jt?Rt:0);if(l===0)i!==null&&xx(i),t.callbackNode=null,t.callbackPriority=0;else if(n=l&-l,t.callbackPriority!==n){if(i!=null&&xx(i),n===1)t.tag===0?L0(kh.bind(null,t)):cm(kh.bind(null,t)),O0(function(){(Be&6)===0&&kn()}),i=null;else{switch(fx(l)){case 1:i=Gl;break;case 4:i=mx;break;case 16:i=Vi;break;case 536870912:i=hx;break;default:i=Vi}i=zh(i,wh.bind(null,t))}t.callbackPriority=n,t.callbackNode=i}}function wh(t,n){if($o=-1,Bo=0,(Be&6)!==0)throw Error(a(327));var i=t.callbackNode;if(aa()&&t.callbackNode!==i)return null;var l=Ji(t,t===jt?Rt:0);if(l===0)return null;if((l&30)!==0||(l&t.expiredLanes)!==0||n)n=qo(t,l);else{n=l;var d=Be;Be|=2;var m=Ch();(jt!==t||Rt!==n)&&(nn=null,ra=ot()+500,or(t,n));do try{ay();break}catch(R){Sh(t,R)}while(!0);Ac(),Do.current=m,Be=d,dt!==null?n=0:(jt=null,Rt=0,n=pt)}if(n!==0){if(n===2&&(d=Ql(t),d!==0&&(l=d,n=fd(t,d))),n===1)throw i=ri,or(t,0),Tn(t,l),Jt(t,ot()),i;if(n===6)Tn(t,l);else{if(d=t.current.alternate,(l&30)===0&&!ny(d)&&(n=qo(t,l),n===2&&(m=Ql(t),m!==0&&(l=m,n=fd(t,m))),n===1))throw i=ri,or(t,0),Tn(t,l),Jt(t,ot()),i;switch(t.finishedWork=d,t.finishedLanes=l,n){case 0:case 1:throw Error(a(345));case 2:lr(t,Qt,nn);break;case 3:if(Tn(t,l),(l&130023424)===l&&(n=md+500-ot(),10<n)){if(Ji(t,0)!==0)break;if(d=t.suspendedLanes,(d&l)!==l){_t(),t.pingedLanes|=t.suspendedLanes&d;break}t.timeoutHandle=Nc(lr.bind(null,t,Qt,nn),n);break}lr(t,Qt,nn);break;case 4:if(Tn(t,l),(l&4194240)===l)break;for(n=t.eventTimes,d=-1;0<l;){var b=31-js(l);m=1<<b,b=n[b],b>d&&(d=b),l&=~m}if(l=d,l=ot()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*sy(l/1960))-l,10<l){t.timeoutHandle=Nc(lr.bind(null,t,Qt,nn),l);break}lr(t,Qt,nn);break;case 5:lr(t,Qt,nn);break;default:throw Error(a(329))}}}return Jt(t,ot()),t.callbackNode===i?wh.bind(null,t):null}function fd(t,n){var i=ai;return t.current.memoizedState.isDehydrated&&(or(t,n).flags|=256),t=qo(t,n),t!==2&&(n=Qt,Qt=i,n!==null&&gd(n)),t}function gd(t){Qt===null?Qt=t:Qt.push.apply(Qt,t)}function ny(t){for(var n=t;;){if(n.flags&16384){var i=n.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var l=0;l<i.length;l++){var d=i[l],m=d.getSnapshot;d=d.value;try{if(!Ns(m(),d))return!1}catch{return!1}}}if(i=n.child,n.subtreeFlags&16384&&i!==null)i.return=n,n=i;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Tn(t,n){for(n&=~xd,n&=~Fo,t.suspendedLanes|=n,t.pingedLanes&=~n,t=t.expirationTimes;0<n;){var i=31-js(n),l=1<<i;t[i]=-1,n&=~l}}function kh(t){if((Be&6)!==0)throw Error(a(327));aa();var n=Ji(t,0);if((n&1)===0)return Jt(t,ot()),null;var i=qo(t,n);if(t.tag!==0&&i===2){var l=Ql(t);l!==0&&(n=l,i=fd(t,l))}if(i===1)throw i=ri,or(t,0),Tn(t,n),Jt(t,ot()),i;if(i===6)throw Error(a(345));return t.finishedWork=t.current.alternate,t.finishedLanes=n,lr(t,Qt,nn),Jt(t,ot()),null}function yd(t,n){var i=Be;Be|=1;try{return t(n)}finally{Be=i,Be===0&&(ra=ot()+500,fo&&kn())}}function ir(t){Rn!==null&&Rn.tag===0&&(Be&6)===0&&aa();var n=Be;Be|=1;var i=hs.transition,l=Ve;try{if(hs.transition=null,Ve=1,t)return t()}finally{Ve=l,hs.transition=i,Be=n,(Be&6)===0&&kn()}}function bd(){as=na.current,Ze(na)}function or(t,n){t.finishedWork=null,t.finishedLanes=0;var i=t.timeoutHandle;if(i!==-1&&(t.timeoutHandle=-1,A0(i)),dt!==null)for(i=dt.return;i!==null;){var l=i;switch(Pc(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&ho();break;case 3:ea(),Ze(Vt),Ze(zt),$c();break;case 5:_c(l);break;case 4:ea();break;case 13:Ze(st);break;case 19:Ze(st);break;case 10:Oc(l.type._context);break;case 22:case 23:bd()}i=i.return}if(jt=t,dt=t=zn(t.current,null),Rt=as=n,pt=0,ri=null,xd=Fo=ar=0,Qt=ai=null,sr!==null){for(n=0;n<sr.length;n++)if(i=sr[n],l=i.interleaved,l!==null){i.interleaved=null;var d=l.next,m=i.pending;if(m!==null){var b=m.next;m.next=d,l.next=b}i.pending=l}sr=null}return t}function Sh(t,n){do{var i=dt;try{if(Ac(),Co.current=Mo,Eo){for(var l=nt.memoizedState;l!==null;){var d=l.queue;d!==null&&(d.pending=null),l=l.next}Eo=!1}if(rr=0,vt=ht=nt=null,Xa=!1,Za=0,ud.current=null,i===null||i.return===null){pt=1,ri=n,dt=null;break}e:{var m=t,b=i.return,R=i,A=n;if(n=Rt,R.flags|=32768,A!==null&&typeof A=="object"&&typeof A.then=="function"){var H=A,te=R,ne=te.tag;if((te.mode&1)===0&&(ne===0||ne===11||ne===15)){var ee=te.alternate;ee?(te.updateQueue=ee.updateQueue,te.memoizedState=ee.memoizedState,te.lanes=ee.lanes):(te.updateQueue=null,te.memoizedState=null)}var de=Jm(b);if(de!==null){de.flags&=-257,Ym(de,b,R,m,n),de.mode&1&&Qm(m,H,n),n=de,A=H;var fe=n.updateQueue;if(fe===null){var ge=new Set;ge.add(A),n.updateQueue=ge}else fe.add(A);break e}else{if((n&1)===0){Qm(m,H,n),vd();break e}A=Error(a(426))}}else if(tt&&R.mode&1){var lt=Jm(b);if(lt!==null){(lt.flags&65536)===0&&(lt.flags|=256),Ym(lt,b,R,m,n),Tc(ta(A,R));break e}}m=A=ta(A,R),pt!==4&&(pt=2),ai===null?ai=[m]:ai.push(m),m=b;do{switch(m.tag){case 3:m.flags|=65536,n&=-n,m.lanes|=n;var U=Wm(m,A,n);vm(m,U);break e;case 1:R=A;var I=m.type,B=m.stateNode;if((m.flags&128)===0&&(typeof I.getDerivedStateFromError=="function"||B!==null&&typeof B.componentDidCatch=="function"&&(Pn===null||!Pn.has(B)))){m.flags|=65536,n&=-n,m.lanes|=n;var ae=Gm(m,R,n);vm(m,ae);break e}}m=m.return}while(m!==null)}Ph(i)}catch(ve){n=ve,dt===i&&i!==null&&(dt=i=i.return);continue}break}while(!0)}function Ch(){var t=Do.current;return Do.current=Mo,t===null?Mo:t}function vd(){(pt===0||pt===3||pt===2)&&(pt=4),jt===null||(ar&268435455)===0&&(Fo&268435455)===0||Tn(jt,Rt)}function qo(t,n){var i=Be;Be|=2;var l=Ch();(jt!==t||Rt!==n)&&(nn=null,or(t,n));do try{ry();break}catch(d){Sh(t,d)}while(!0);if(Ac(),Be=i,Do.current=l,dt!==null)throw Error(a(261));return jt=null,Rt=0,pt}function ry(){for(;dt!==null;)Eh(dt)}function ay(){for(;dt!==null&&!Mg();)Eh(dt)}function Eh(t){var n=Th(t.alternate,t,as);t.memoizedProps=t.pendingProps,n===null?Ph(t):dt=n,ud.current=null}function Ph(t){var n=t;do{var i=n.alternate;if(t=n.return,(n.flags&32768)===0){if(i=Y0(i,n,as),i!==null){dt=i;return}}else{if(i=X0(i,n),i!==null){i.flags&=32767,dt=i;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{pt=6,dt=null;return}}if(n=n.sibling,n!==null){dt=n;return}dt=n=t}while(n!==null);pt===0&&(pt=5)}function lr(t,n,i){var l=Ve,d=hs.transition;try{hs.transition=null,Ve=1,iy(t,n,i,l)}finally{hs.transition=d,Ve=l}return null}function iy(t,n,i,l){do aa();while(Rn!==null);if((Be&6)!==0)throw Error(a(327));i=t.finishedWork;var d=t.finishedLanes;if(i===null)return null;if(t.finishedWork=null,t.finishedLanes=0,i===t.current)throw Error(a(177));t.callbackNode=null,t.callbackPriority=0;var m=i.lanes|i.childLanes;if(Ug(t,m),t===jt&&(dt=jt=null,Rt=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||_o||(_o=!0,zh(Vi,function(){return aa(),null})),m=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||m){m=hs.transition,hs.transition=null;var b=Ve;Ve=1;var R=Be;Be|=4,ud.current=null,ey(t,i),yh(i,t),C0(vc),Zi=!!bc,vc=bc=null,t.current=i,ty(i),Tg(),Be=R,Ve=b,hs.transition=m}else t.current=i;if(_o&&(_o=!1,Rn=t,Uo=d),m=t.pendingLanes,m===0&&(Pn=null),Og(i.stateNode),Jt(t,ot()),n!==null)for(l=t.onRecoverableError,i=0;i<n.length;i++)d=n[i],l(d.value,{componentStack:d.stack,digest:d.digest});if(Lo)throw Lo=!1,t=hd,hd=null,t;return(Uo&1)!==0&&t.tag!==0&&aa(),m=t.pendingLanes,(m&1)!==0?t===pd?ii++:(ii=0,pd=t):ii=0,kn(),null}function aa(){if(Rn!==null){var t=fx(Uo),n=hs.transition,i=Ve;try{if(hs.transition=null,Ve=16>t?16:t,Rn===null)var l=!1;else{if(t=Rn,Rn=null,Uo=0,(Be&6)!==0)throw Error(a(331));var d=Be;for(Be|=4,me=t.current;me!==null;){var m=me,b=m.child;if((me.flags&16)!==0){var R=m.deletions;if(R!==null){for(var A=0;A<R.length;A++){var H=R[A];for(me=H;me!==null;){var te=me;switch(te.tag){case 0:case 11:case 15:ni(8,te,m)}var ne=te.child;if(ne!==null)ne.return=te,me=ne;else for(;me!==null;){te=me;var ee=te.sibling,de=te.return;if(mh(te),te===H){me=null;break}if(ee!==null){ee.return=de,me=ee;break}me=de}}}var fe=m.alternate;if(fe!==null){var ge=fe.child;if(ge!==null){fe.child=null;do{var lt=ge.sibling;ge.sibling=null,ge=lt}while(ge!==null)}}me=m}}if((m.subtreeFlags&2064)!==0&&b!==null)b.return=m,me=b;else e:for(;me!==null;){if(m=me,(m.flags&2048)!==0)switch(m.tag){case 0:case 11:case 15:ni(9,m,m.return)}var U=m.sibling;if(U!==null){U.return=m.return,me=U;break e}me=m.return}}var I=t.current;for(me=I;me!==null;){b=me;var B=b.child;if((b.subtreeFlags&2064)!==0&&B!==null)B.return=b,me=B;else e:for(b=I;me!==null;){if(R=me,(R.flags&2048)!==0)try{switch(R.tag){case 0:case 11:case 15:Io(9,R)}}catch(ve){at(R,R.return,ve)}if(R===b){me=null;break e}var ae=R.sibling;if(ae!==null){ae.return=R.return,me=ae;break e}me=R.return}}if(Be=d,kn(),Fs&&typeof Fs.onPostCommitFiberRoot=="function")try{Fs.onPostCommitFiberRoot(Wi,t)}catch{}l=!0}return l}finally{Ve=i,hs.transition=n}}return!1}function Rh(t,n,i){n=ta(i,n),n=Wm(t,n,1),t=Cn(t,n,1),n=_t(),t!==null&&(Ma(t,1,n),Jt(t,n))}function at(t,n,i){if(t.tag===3)Rh(t,t,i);else for(;n!==null;){if(n.tag===3){Rh(n,t,i);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Pn===null||!Pn.has(l))){t=ta(i,t),t=Gm(n,t,1),n=Cn(n,t,1),t=_t(),n!==null&&(Ma(n,1,t),Jt(n,t));break}}n=n.return}}function oy(t,n,i){var l=t.pingCache;l!==null&&l.delete(n),n=_t(),t.pingedLanes|=t.suspendedLanes&i,jt===t&&(Rt&i)===i&&(pt===4||pt===3&&(Rt&130023424)===Rt&&500>ot()-md?or(t,0):xd|=i),Jt(t,n)}function Mh(t,n){n===0&&((t.mode&1)===0?n=1:(n=Qi,Qi<<=1,(Qi&130023424)===0&&(Qi=4194304)));var i=_t();t=en(t,n),t!==null&&(Ma(t,n,i),Jt(t,i))}function ly(t){var n=t.memoizedState,i=0;n!==null&&(i=n.retryLane),Mh(t,i)}function cy(t,n){var i=0;switch(t.tag){case 13:var l=t.stateNode,d=t.memoizedState;d!==null&&(i=d.retryLane);break;case 19:l=t.stateNode;break;default:throw Error(a(314))}l!==null&&l.delete(n),Mh(t,i)}var Th;Th=function(t,n,i){if(t!==null)if(t.memoizedProps!==n.pendingProps||Vt.current)Gt=!0;else{if((t.lanes&i)===0&&(n.flags&128)===0)return Gt=!1,J0(t,n,i);Gt=(t.flags&131072)!==0}else Gt=!1,tt&&(n.flags&1048576)!==0&&dm(n,yo,n.index);switch(n.lanes=0,n.tag){case 2:var l=n.type;Ao(t,n),t=n.pendingProps;var d=Wr(n,zt.current);Zr(n,i),d=Hc(null,n,l,t,d,i);var m=Kc();return n.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Wt(l)?(m=!0,po(n)):m=!1,n.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,Fc(n),d.updater=To,n.stateNode=d,d._reactInternals=n,Yc(n,l,t,i),n=td(null,n,l,!0,m,i)):(n.tag=0,tt&&m&&Ec(n),Lt(null,n,d,i),n=n.child),n;case 16:l=n.elementType;e:{switch(Ao(t,n),t=n.pendingProps,d=l._init,l=d(l._payload),n.type=l,d=n.tag=uy(l),t=ks(l,t),d){case 0:n=ed(null,n,l,t,i);break e;case 1:n=nh(null,n,l,t,i);break e;case 11:n=Xm(null,n,l,t,i);break e;case 14:n=Zm(null,n,l,ks(l.type,t),i);break e}throw Error(a(306,l,""))}return n;case 0:return l=n.type,d=n.pendingProps,d=n.elementType===l?d:ks(l,d),ed(t,n,l,d,i);case 1:return l=n.type,d=n.pendingProps,d=n.elementType===l?d:ks(l,d),nh(t,n,l,d,i);case 3:e:{if(rh(n),t===null)throw Error(a(387));l=n.pendingProps,m=n.memoizedState,d=m.element,bm(t,n),ko(n,l,null,i);var b=n.memoizedState;if(l=b.element,m.isDehydrated)if(m={element:l,isDehydrated:!1,cache:b.cache,pendingSuspenseBoundaries:b.pendingSuspenseBoundaries,transitions:b.transitions},n.updateQueue.baseState=m,n.memoizedState=m,n.flags&256){d=ta(Error(a(423)),n),n=ah(t,n,l,i,d);break e}else if(l!==d){d=ta(Error(a(424)),n),n=ah(t,n,l,i,d);break e}else for(rs=jn(n.stateNode.containerInfo.firstChild),ns=n,tt=!0,ws=null,i=gm(n,null,l,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Jr(),l===d){n=sn(t,n,i);break e}Lt(t,n,l,i)}n=n.child}return n;case 5:return Nm(n),t===null&&Mc(n),l=n.type,d=n.pendingProps,m=t!==null?t.memoizedProps:null,b=d.children,jc(l,d)?b=null:m!==null&&jc(l,m)&&(n.flags|=32),sh(t,n),Lt(t,n,b,i),n.child;case 6:return t===null&&Mc(n),null;case 13:return ih(t,n,i);case 4:return Lc(n,n.stateNode.containerInfo),l=n.pendingProps,t===null?n.child=Yr(n,null,l,i):Lt(t,n,l,i),n.child;case 11:return l=n.type,d=n.pendingProps,d=n.elementType===l?d:ks(l,d),Xm(t,n,l,d,i);case 7:return Lt(t,n,n.pendingProps,i),n.child;case 8:return Lt(t,n,n.pendingProps.children,i),n.child;case 12:return Lt(t,n,n.pendingProps.children,i),n.child;case 10:e:{if(l=n.type._context,d=n.pendingProps,m=n.memoizedProps,b=d.value,Qe(jo,l._currentValue),l._currentValue=b,m!==null)if(Ns(m.value,b)){if(m.children===d.children&&!Vt.current){n=sn(t,n,i);break e}}else for(m=n.child,m!==null&&(m.return=n);m!==null;){var R=m.dependencies;if(R!==null){b=m.child;for(var A=R.firstContext;A!==null;){if(A.context===l){if(m.tag===1){A=tn(-1,i&-i),A.tag=2;var H=m.updateQueue;if(H!==null){H=H.shared;var te=H.pending;te===null?A.next=A:(A.next=te.next,te.next=A),H.pending=A}}m.lanes|=i,A=m.alternate,A!==null&&(A.lanes|=i),Ic(m.return,i,n),R.lanes|=i;break}A=A.next}}else if(m.tag===10)b=m.type===n.type?null:m.child;else if(m.tag===18){if(b=m.return,b===null)throw Error(a(341));b.lanes|=i,R=b.alternate,R!==null&&(R.lanes|=i),Ic(b,i,n),b=m.sibling}else b=m.child;if(b!==null)b.return=m;else for(b=m;b!==null;){if(b===n){b=null;break}if(m=b.sibling,m!==null){m.return=b.return,b=m;break}b=b.return}m=b}Lt(t,n,d.children,i),n=n.child}return n;case 9:return d=n.type,l=n.pendingProps.children,Zr(n,i),d=xs(d),l=l(d),n.flags|=1,Lt(t,n,l,i),n.child;case 14:return l=n.type,d=ks(l,n.pendingProps),d=ks(l.type,d),Zm(t,n,l,d,i);case 15:return eh(t,n,n.type,n.pendingProps,i);case 17:return l=n.type,d=n.pendingProps,d=n.elementType===l?d:ks(l,d),Ao(t,n),n.tag=1,Wt(l)?(t=!0,po(n)):t=!1,Zr(n,i),Km(n,l,d),Yc(n,l,d,i),td(null,n,l,!0,t,i);case 19:return lh(t,n,i);case 22:return th(t,n,i)}throw Error(a(156,n.tag))};function zh(t,n){return ux(t,n)}function dy(t,n,i,l){this.tag=t,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ps(t,n,i,l){return new dy(t,n,i,l)}function jd(t){return t=t.prototype,!(!t||!t.isReactComponent)}function uy(t){if(typeof t=="function")return jd(t)?1:0;if(t!=null){if(t=t.$$typeof,t===ue)return 11;if(t===be)return 14}return 2}function zn(t,n){var i=t.alternate;return i===null?(i=ps(t.tag,n,t.key,t.mode),i.elementType=t.elementType,i.type=t.type,i.stateNode=t.stateNode,i.alternate=t,t.alternate=i):(i.pendingProps=n,i.type=t.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=t.flags&14680064,i.childLanes=t.childLanes,i.lanes=t.lanes,i.child=t.child,i.memoizedProps=t.memoizedProps,i.memoizedState=t.memoizedState,i.updateQueue=t.updateQueue,n=t.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=t.sibling,i.index=t.index,i.ref=t.ref,i}function Ho(t,n,i,l,d,m){var b=2;if(l=t,typeof t=="function")jd(t)&&(b=1);else if(typeof t=="string")b=5;else e:switch(t){case Q:return cr(i.children,d,m,n);case Z:b=8,d|=8;break;case le:return t=ps(12,i,n,d|2),t.elementType=le,t.lanes=m,t;case ke:return t=ps(13,i,n,d),t.elementType=ke,t.lanes=m,t;case re:return t=ps(19,i,n,d),t.elementType=re,t.lanes=m,t;case ye:return Ko(i,d,m,n);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case K:b=10;break e;case J:b=9;break e;case ue:b=11;break e;case be:b=14;break e;case Ne:b=16,l=null;break e}throw Error(a(130,t==null?t:typeof t,""))}return n=ps(b,i,n,d),n.elementType=t,n.type=l,n.lanes=m,n}function cr(t,n,i,l){return t=ps(7,t,l,n),t.lanes=i,t}function Ko(t,n,i,l){return t=ps(22,t,l,n),t.elementType=ye,t.lanes=i,t.stateNode={isHidden:!1},t}function Nd(t,n,i){return t=ps(6,t,null,n),t.lanes=i,t}function wd(t,n,i){return n=ps(4,t.children!==null?t.children:[],t.key,n),n.lanes=i,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}function xy(t,n,i,l,d){this.tag=n,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Jl(0),this.expirationTimes=Jl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jl(0),this.identifierPrefix=l,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function kd(t,n,i,l,d,m,b,R,A){return t=new xy(t,n,i,R,A),n===1?(n=1,m===!0&&(n|=8)):n=0,m=ps(3,null,null,n),t.current=m,m.stateNode=t,m.memoizedState={element:l,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fc(m),t}function my(t,n,i){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:F,key:l==null?null:""+l,children:t,containerInfo:n,implementation:i}}function Ah(t){if(!t)return wn;t=t._reactInternals;e:{if(W(t)!==t||t.tag!==1)throw Error(a(170));var n=t;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(Wt(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(a(171))}if(t.tag===1){var i=t.type;if(Wt(i))return om(t,i,n)}return n}function Oh(t,n,i,l,d,m,b,R,A){return t=kd(i,l,!0,t,d,m,b,R,A),t.context=Ah(null),i=t.current,l=_t(),d=Mn(i),m=tn(l,d),m.callback=n??null,Cn(i,m,d),t.current.lanes=d,Ma(t,d,l),Jt(t,l),t}function Vo(t,n,i,l){var d=n.current,m=_t(),b=Mn(d);return i=Ah(i),n.context===null?n.context=i:n.pendingContext=i,n=tn(m,b),n.payload={element:t},l=l===void 0?null:l,l!==null&&(n.callback=l),t=Cn(d,n,b),t!==null&&(Es(t,d,b,m),wo(t,d,b)),b}function Wo(t){return t=t.current,t.child?(t.child.tag===5,t.child.stateNode):null}function Ih(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var i=t.retryLane;t.retryLane=i!==0&&i<n?i:n}}function Sd(t,n){Ih(t,n),(t=t.alternate)&&Ih(t,n)}function hy(){return null}var Dh=typeof reportError=="function"?reportError:function(t){console.error(t)};function Cd(t){this._internalRoot=t}Go.prototype.render=Cd.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(a(409));Vo(t,n,null,null)},Go.prototype.unmount=Cd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;ir(function(){Vo(null,t,null,null)}),n[Js]=null}};function Go(t){this._internalRoot=t}Go.prototype.unstable_scheduleHydration=function(t){if(t){var n=bx();t={blockedOn:null,target:t,priority:n};for(var i=0;i<yn.length&&n!==0&&n<yn[i].priority;i++);yn.splice(i,0,t),i===0&&Nx(t)}};function Ed(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Qo(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Fh(){}function py(t,n,i,l,d){if(d){if(typeof l=="function"){var m=l;l=function(){var H=Wo(b);m.call(H)}}var b=Oh(n,l,t,0,null,!1,!1,"",Fh);return t._reactRootContainer=b,t[Js]=b.current,Ha(t.nodeType===8?t.parentNode:t),ir(),b}for(;d=t.lastChild;)t.removeChild(d);if(typeof l=="function"){var R=l;l=function(){var H=Wo(A);R.call(H)}}var A=kd(t,0,!1,null,null,!1,!1,"",Fh);return t._reactRootContainer=A,t[Js]=A.current,Ha(t.nodeType===8?t.parentNode:t),ir(function(){Vo(n,A,i,l)}),A}function Jo(t,n,i,l,d){var m=i._reactRootContainer;if(m){var b=m;if(typeof d=="function"){var R=d;d=function(){var A=Wo(b);R.call(A)}}Vo(n,b,t,d)}else b=py(i,n,t,d,l);return Wo(b)}gx=function(t){switch(t.tag){case 3:var n=t.stateNode;if(n.current.memoizedState.isDehydrated){var i=Ra(n.pendingLanes);i!==0&&(Yl(n,i|1),Jt(n,ot()),(Be&6)===0&&(ra=ot()+500,kn()))}break;case 13:ir(function(){var l=en(t,1);if(l!==null){var d=_t();Es(l,t,1,d)}}),Sd(t,1)}},Xl=function(t){if(t.tag===13){var n=en(t,134217728);if(n!==null){var i=_t();Es(n,t,134217728,i)}Sd(t,134217728)}},yx=function(t){if(t.tag===13){var n=Mn(t),i=en(t,n);if(i!==null){var l=_t();Es(i,t,n,l)}Sd(t,n)}},bx=function(){return Ve},vx=function(t,n){var i=Ve;try{return Ve=t,n()}finally{Ve=i}},Is=function(t,n,i){switch(n){case"input":if(Ft(t,i),n=i.name,i.type==="radio"&&n!=null){for(i=t;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<i.length;n++){var l=i[n];if(l!==t&&l.form===t.form){var d=mo(l);if(!d)throw Error(a(90));qt(l),Ft(l,d)}}}break;case"textarea":bt(t,i);break;case"select":n=i.value,n!=null&&pe(t,!!i.multiple,n,!1)}},Ca=yd,Ar=ir;var fy={usingClientEntryPoint:!1,Events:[Wa,Kr,mo,Sa,qi,yd]},oi={findFiberByHostInstance:Xn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},gy={bundleType:oi.bundleType,version:oi.version,rendererPackageName:oi.rendererPackageName,rendererConfig:oi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Tt(t),t===null?null:t.stateNode},findFiberByHostInstance:oi.findFiberByHostInstance||hy,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 Yo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yo.isDisabled&&Yo.supportsFiber)try{Wi=Yo.inject(gy),Fs=Yo}catch{}}return Yt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=fy,Yt.createPortal=function(t,n){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ed(n))throw Error(a(200));return my(t,n,null,i)},Yt.createRoot=function(t,n){if(!Ed(t))throw Error(a(299));var i=!1,l="",d=Dh;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(d=n.onRecoverableError)),n=kd(t,1,!1,null,null,i,!1,l,d),t[Js]=n.current,Ha(t.nodeType===8?t.parentNode:t),new Cd(n)},Yt.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=Tt(n),t=t===null?null:t.stateNode,t},Yt.flushSync=function(t){return ir(t)},Yt.hydrate=function(t,n,i){if(!Qo(n))throw Error(a(200));return Jo(null,t,n,!0,i)},Yt.hydrateRoot=function(t,n,i){if(!Ed(t))throw Error(a(405));var l=i!=null&&i.hydratedSources||null,d=!1,m="",b=Dh;if(i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(m=i.identifierPrefix),i.onRecoverableError!==void 0&&(b=i.onRecoverableError)),n=Oh(n,null,t,1,i??null,d,!1,m,b),t[Js]=n.current,Ha(t),l)for(t=0;t<l.length;t++)i=l[t],d=i._getVersion,d=d(i._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[i,d]:n.mutableSourceEagerHydrationData.push(i,d);return new Go(n)},Yt.render=function(t,n,i){if(!Qo(n))throw Error(a(200));return Jo(null,t,n,!1,i)},Yt.unmountComponentAtNode=function(t){if(!Qo(t))throw Error(a(40));return t._reactRootContainer?(ir(function(){Jo(null,null,t,!1,function(){t._reactRootContainer=null,t[Js]=null})}),!0):!1},Yt.unstable_batchedUpdates=yd,Yt.unstable_renderSubtreeIntoContainer=function(t,n,i,l){if(!Qo(i))throw Error(a(200));if(t==null||t._reactInternals===void 0)throw Error(a(38));return Jo(t,n,i,!1,l)},Yt.version="18.3.1-next-f1338f8080-20240426",Yt}var Kh;function qp(){if(Kh)return Md.exports;Kh=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(r){console.error(r)}}return s(),Md.exports=Py(),Md.exports}var Vh;function Ry(){if(Vh)return Xo;Vh=1;var s=qp();return Xo.createRoot=s.createRoot,Xo.hydrateRoot=s.hydrateRoot,Xo}var My=Ry();qp();/**
|
|
41
|
+
* @remix-run/router v1.23.3
|
|
42
|
+
*
|
|
43
|
+
* Copyright (c) Remix Software Inc.
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the MIT license found in the
|
|
46
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
+
*
|
|
48
|
+
* @license MIT
|
|
49
|
+
*/function Si(){return Si=Object.assign?Object.assign.bind():function(s){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var o in a)({}).hasOwnProperty.call(a,o)&&(s[o]=a[o])}return s},Si.apply(null,arguments)}var Fn;(function(s){s.Pop="POP",s.Push="PUSH",s.Replace="REPLACE"})(Fn||(Fn={}));const Wh="popstate";function Ty(s){s===void 0&&(s={});function r(o,c){let{pathname:u,search:x,hash:h}=o.location;return du("",{pathname:u,search:x,hash:h},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function a(o,c){return typeof c=="string"?c:ml(c)}return Ay(r,a,null,s)}function it(s,r){if(s===!1||s===null||typeof s>"u")throw new Error(r)}function _u(s,r){if(!s){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function zy(){return Math.random().toString(36).substr(2,8)}function Gh(s,r){return{usr:s.state,key:s.key,idx:r}}function du(s,r,a,o){return a===void 0&&(a=null),Si({pathname:typeof s=="string"?s:s.pathname,search:"",hash:""},typeof r=="string"?va(r):r,{state:a,key:r&&r.key||o||zy()})}function ml(s){let{pathname:r="/",search:a="",hash:o=""}=s;return a&&a!=="?"&&(r+=a.charAt(0)==="?"?a:"?"+a),o&&o!=="#"&&(r+=o.charAt(0)==="#"?o:"#"+o),r}function va(s){let r={};if(s){let a=s.indexOf("#");a>=0&&(r.hash=s.substr(a),s=s.substr(0,a));let o=s.indexOf("?");o>=0&&(r.search=s.substr(o),s=s.substr(0,o)),s&&(r.pathname=s)}return r}function Ay(s,r,a,o){o===void 0&&(o={});let{window:c=document.defaultView,v5Compat:u=!1}=o,x=c.history,h=Fn.Pop,f=null,g=y();g==null&&(g=0,x.replaceState(Si({},x.state,{idx:g}),""));function y(){return(x.state||{idx:null}).idx}function N(){h=Fn.Pop;let k=y(),j=k==null?null:k-g;g=k,f&&f({action:h,location:M.location,delta:j})}function E(k,j){h=Fn.Push;let v=du(M.location,k,j);g=y()+1;let z=Gh(v,g),C=M.createHref(v);try{x.pushState(z,"",C)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;c.location.assign(C)}u&&f&&f({action:h,location:M.location,delta:1})}function S(k,j){h=Fn.Replace;let v=du(M.location,k,j);g=y();let z=Gh(v,g),C=M.createHref(v);x.replaceState(z,"",C),u&&f&&f({action:h,location:M.location,delta:0})}function P(k){let j=c.location.origin!=="null"?c.location.origin:c.location.href,v=typeof k=="string"?k:ml(k);return v=v.replace(/ $/,"%20"),it(j,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,j)}let M={get action(){return h},get location(){return s(c,x)},listen(k){if(f)throw new Error("A history only accepts one active listener");return c.addEventListener(Wh,N),f=k,()=>{c.removeEventListener(Wh,N),f=null}},createHref(k){return r(c,k)},createURL:P,encodeLocation(k){let j=P(k);return{pathname:j.pathname,search:j.search,hash:j.hash}},push:E,replace:S,go(k){return x.go(k)}};return M}var Qh;(function(s){s.data="data",s.deferred="deferred",s.redirect="redirect",s.error="error"})(Qh||(Qh={}));function Oy(s,r,a){return a===void 0&&(a="/"),Iy(s,r,a)}function Iy(s,r,a,o){let c=typeof r=="string"?va(r):r,u=pa(c.pathname||"/",a);if(u==null)return null;let x=Hp(s);Dy(x);let h=null,f=Wy(u);for(let g=0;h==null&&g<x.length;++g)h=Ky(x[g],f);return h}function Hp(s,r,a,o){r===void 0&&(r=[]),a===void 0&&(a=[]),o===void 0&&(o="");let c=(u,x,h)=>{let f={relativePath:h===void 0?u.path||"":h,caseSensitive:u.caseSensitive===!0,childrenIndex:x,route:u};f.relativePath.startsWith("/")&&(it(f.relativePath.startsWith(o),'Absolute route path "'+f.relativePath+'" nested under path '+('"'+o+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),f.relativePath=f.relativePath.slice(o.length));let g=Ln([o,f.relativePath]),y=a.concat(f);u.children&&u.children.length>0&&(it(u.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),Hp(u.children,r,y,g)),!(u.path==null&&!u.index)&&r.push({path:g,score:qy(g,u.index),routesMeta:y})};return s.forEach((u,x)=>{var h;if(u.path===""||!((h=u.path)!=null&&h.includes("?")))c(u,x);else for(let f of Kp(u.path))c(u,x,f)}),r}function Kp(s){let r=s.split("/");if(r.length===0)return[];let[a,...o]=r,c=a.endsWith("?"),u=a.replace(/\?$/,"");if(o.length===0)return c?[u,""]:[u];let x=Kp(o.join("/")),h=[];return h.push(...x.map(f=>f===""?u:[u,f].join("/"))),c&&h.push(...x),h.map(f=>s.startsWith("/")&&f===""?"/":f)}function Dy(s){s.sort((r,a)=>r.score!==a.score?a.score-r.score:Hy(r.routesMeta.map(o=>o.childrenIndex),a.routesMeta.map(o=>o.childrenIndex)))}const Fy=/^:[\w-]+$/,Ly=3,_y=2,Uy=1,$y=10,By=-2,Jh=s=>s==="*";function qy(s,r){let a=s.split("/"),o=a.length;return a.some(Jh)&&(o+=By),r&&(o+=_y),a.filter(c=>!Jh(c)).reduce((c,u)=>c+(Fy.test(u)?Ly:u===""?Uy:$y),o)}function Hy(s,r){return s.length===r.length&&s.slice(0,-1).every((o,c)=>o===r[c])?s[s.length-1]-r[r.length-1]:0}function Ky(s,r,a){let{routesMeta:o}=s,c={},u="/",x=[];for(let h=0;h<o.length;++h){let f=o[h],g=h===o.length-1,y=u==="/"?r:r.slice(u.length)||"/",N=uu({path:f.relativePath,caseSensitive:f.caseSensitive,end:g},y),E=f.route;if(!N)return null;Object.assign(c,N.params),x.push({params:c,pathname:Ln([u,N.pathname]),pathnameBase:Xy(Ln([u,N.pathnameBase])),route:E}),N.pathnameBase!=="/"&&(u=Ln([u,N.pathnameBase]))}return x}function uu(s,r){typeof s=="string"&&(s={path:s,caseSensitive:!1,end:!0});let[a,o]=Vy(s.path,s.caseSensitive,s.end),c=r.match(a);if(!c)return null;let u=c[0],x=u.replace(/(.)\/+$/,"$1"),h=c.slice(1);return{params:o.reduce((g,y,N)=>{let{paramName:E,isOptional:S}=y;if(E==="*"){let M=h[N]||"";x=u.slice(0,u.length-M.length).replace(/(.)\/+$/,"$1")}const P=h[N];return S&&!P?g[E]=void 0:g[E]=(P||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:x,pattern:s}}function Vy(s,r,a){r===void 0&&(r=!1),a===void 0&&(a=!0),_u(s==="*"||!s.endsWith("*")||s.endsWith("/*"),'Route path "'+s+'" will be treated as if it were '+('"'+s.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+s.replace(/\*$/,"/*")+'".'));let o=[],c="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(x,h,f)=>(o.push({paramName:h,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)"));return s.endsWith("*")?(o.push({paramName:"*"}),c+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?c+="\\/*$":s!==""&&s!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,r?void 0:"i"),o]}function Wy(s){try{return s.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return _u(!1,'The URL path "'+s+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+r+").")),s}}function pa(s,r){if(r==="/")return s;if(!s.toLowerCase().startsWith(r.toLowerCase()))return null;let a=r.endsWith("/")?r.length-1:r.length,o=s.charAt(a);return o&&o!=="/"?null:s.slice(a)||"/"}const Gy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qy=s=>Gy.test(s);function Jy(s,r){r===void 0&&(r="/");let{pathname:a,search:o="",hash:c=""}=typeof s=="string"?va(s):s,u;if(a)if(Qy(a))u=a;else{if(a.includes("//")){let x=a;a=Gp(a),_u(!1,"Pathnames cannot have embedded double slashes - normalizing "+(x+" -> "+a))}a.startsWith("/")?u=Yh(a.substring(1),"/"):u=Yh(a,r)}else u=r;return{pathname:u,search:Zy(o),hash:eb(c)}}function Yh(s,r){let a=r.replace(/\/+$/,"").split("/");return s.split("/").forEach(c=>{c===".."?a.length>1&&a.pop():c!=="."&&a.push(c)}),a.length>1?a.join("/"):"/"}function Ad(s,r,a,o){return"Cannot include a '"+s+"' character in a manually specified "+("`to."+r+"` field ["+JSON.stringify(o)+"]. Please separate it out to the ")+("`to."+a+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Yy(s){return s.filter((r,a)=>a===0||r.route.path&&r.route.path.length>0)}function Vp(s,r){let a=Yy(s);return r?a.map((o,c)=>c===a.length-1?o.pathname:o.pathnameBase):a.map(o=>o.pathnameBase)}function Wp(s,r,a,o){o===void 0&&(o=!1);let c;typeof s=="string"?c=va(s):(c=Si({},s),it(!c.pathname||!c.pathname.includes("?"),Ad("?","pathname","search",c)),it(!c.pathname||!c.pathname.includes("#"),Ad("#","pathname","hash",c)),it(!c.search||!c.search.includes("#"),Ad("#","search","hash",c)));let u=s===""||c.pathname==="",x=u?"/":c.pathname,h;if(x==null)h=a;else{let N=r.length-1;if(!o&&x.startsWith("..")){let E=x.split("/");for(;E[0]==="..";)E.shift(),N-=1;c.pathname=E.join("/")}h=N>=0?r[N]:"/"}let f=Jy(c,h),g=x&&x!=="/"&&x.endsWith("/"),y=(u||x===".")&&a.endsWith("/");return!f.pathname.endsWith("/")&&(g||y)&&(f.pathname+="/"),f}const Gp=s=>s.replace(/\/\/+/g,"/"),Ln=s=>Gp(s.join("/")),Xy=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),Zy=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,eb=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s;function tb(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}const Qp=["post","put","patch","delete"];new Set(Qp);const sb=["get",...Qp];new Set(sb);/**
|
|
50
|
+
* React Router v6.30.4
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/function Ci(){return Ci=Object.assign?Object.assign.bind():function(s){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var o in a)({}).hasOwnProperty.call(a,o)&&(s[o]=a[o])}return s},Ci.apply(null,arguments)}const Tl=p.createContext(null),Jp=p.createContext(null),Hn=p.createContext(null),zl=p.createContext(null),Kn=p.createContext({outlet:null,matches:[],isDataRoute:!1}),Yp=p.createContext(null);function nb(s,r){let{relative:a}=r===void 0?{}:r;Fi()||it(!1);let{basename:o,navigator:c}=p.useContext(Hn),{hash:u,pathname:x,search:h}=Al(s,{relative:a}),f=x;return o!=="/"&&(f=x==="/"?o:Ln([o,x])),c.createHref({pathname:f,search:h,hash:u})}function Fi(){return p.useContext(zl)!=null}function Vn(){return Fi()||it(!1),p.useContext(zl).location}function Xp(s){p.useContext(Hn).static||p.useLayoutEffect(s)}function Vs(){let{isDataRoute:s}=p.useContext(Kn);return s?gb():rb()}function rb(){Fi()||it(!1);let s=p.useContext(Tl),{basename:r,future:a,navigator:o}=p.useContext(Hn),{matches:c}=p.useContext(Kn),{pathname:u}=Vn(),x=JSON.stringify(Vp(c,a.v7_relativeSplatPath)),h=p.useRef(!1);return Xp(()=>{h.current=!0}),p.useCallback(function(g,y){if(y===void 0&&(y={}),!h.current)return;if(typeof g=="number"){o.go(g);return}let N=Wp(g,JSON.parse(x),u,y.relative==="path");s==null&&r!=="/"&&(N.pathname=N.pathname==="/"?r:Ln([r,N.pathname])),(y.replace?o.replace:o.push)(N,y.state,y)},[r,o,x,u,s])}function ab(){let{matches:s}=p.useContext(Kn),r=s[s.length-1];return r?r.params:{}}function Al(s,r){let{relative:a}=r===void 0?{}:r,{future:o}=p.useContext(Hn),{matches:c}=p.useContext(Kn),{pathname:u}=Vn(),x=JSON.stringify(Vp(c,o.v7_relativeSplatPath));return p.useMemo(()=>Wp(s,JSON.parse(x),u,a==="path"),[s,x,u,a])}function ib(s,r){return ob(s,r)}function ob(s,r,a,o){Fi()||it(!1);let{navigator:c}=p.useContext(Hn),{matches:u}=p.useContext(Kn),x=u[u.length-1],h=x?x.params:{};x&&x.pathname;let f=x?x.pathnameBase:"/";x&&x.route;let g=Vn(),y;if(r){var N;let k=typeof r=="string"?va(r):r;f==="/"||(N=k.pathname)!=null&&N.startsWith(f)||it(!1),y=k}else y=g;let E=y.pathname||"/",S=E;if(f!=="/"){let k=f.replace(/^\//,"").split("/");S="/"+E.replace(/^\//,"").split("/").slice(k.length).join("/")}let P=Oy(s,{pathname:S}),M=xb(P&&P.map(k=>Object.assign({},k,{params:Object.assign({},h,k.params),pathname:Ln([f,c.encodeLocation?c.encodeLocation(k.pathname).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?f:Ln([f,c.encodeLocation?c.encodeLocation(k.pathnameBase).pathname:k.pathnameBase])})),u,a,o);return r&&M?p.createElement(zl.Provider,{value:{location:Ci({pathname:"/",search:"",hash:"",state:null,key:"default"},y),navigationType:Fn.Pop}},M):M}function lb(){let s=fb(),r=tb(s)?s.status+" "+s.statusText:s instanceof Error?s.message:JSON.stringify(s),a=s instanceof Error?s.stack:null,c={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},r),a?p.createElement("pre",{style:c},a):null,null)}const cb=p.createElement(lb,null);class db extends p.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,a){return a.location!==r.location||a.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:a.error,location:a.location,revalidation:r.revalidation||a.revalidation}}componentDidCatch(r,a){console.error("React Router caught the following error during render",r,a)}render(){return this.state.error!==void 0?p.createElement(Kn.Provider,{value:this.props.routeContext},p.createElement(Yp.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ub(s){let{routeContext:r,match:a,children:o}=s,c=p.useContext(Tl);return c&&c.static&&c.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=a.route.id),p.createElement(Kn.Provider,{value:r},o)}function xb(s,r,a,o){var c;if(r===void 0&&(r=[]),a===void 0&&(a=null),o===void 0&&(o=null),s==null){var u;if(!a)return null;if(a.errors)s=a.matches;else if((u=o)!=null&&u.v7_partialHydration&&r.length===0&&!a.initialized&&a.matches.length>0)s=a.matches;else return null}let x=s,h=(c=a)==null?void 0:c.errors;if(h!=null){let y=x.findIndex(N=>N.route.id&&h?.[N.route.id]!==void 0);y>=0||it(!1),x=x.slice(0,Math.min(x.length,y+1))}let f=!1,g=-1;if(a&&o&&o.v7_partialHydration)for(let y=0;y<x.length;y++){let N=x[y];if((N.route.HydrateFallback||N.route.hydrateFallbackElement)&&(g=y),N.route.id){let{loaderData:E,errors:S}=a,P=N.route.loader&&E[N.route.id]===void 0&&(!S||S[N.route.id]===void 0);if(N.route.lazy||P){f=!0,g>=0?x=x.slice(0,g+1):x=[x[0]];break}}}return x.reduceRight((y,N,E)=>{let S,P=!1,M=null,k=null;a&&(S=h&&N.route.id?h[N.route.id]:void 0,M=N.route.errorElement||cb,f&&(g<0&&E===0?(yb("route-fallback"),P=!0,k=null):g===E&&(P=!0,k=N.route.hydrateFallbackElement||null)));let j=r.concat(x.slice(0,E+1)),v=()=>{let z;return S?z=M:P?z=k:N.route.Component?z=p.createElement(N.route.Component,null):N.route.element?z=N.route.element:z=y,p.createElement(ub,{match:N,routeContext:{outlet:y,matches:j,isDataRoute:a!=null},children:z})};return a&&(N.route.ErrorBoundary||N.route.errorElement||E===0)?p.createElement(db,{location:a.location,revalidation:a.revalidation,component:M,error:S,children:v(),routeContext:{outlet:null,matches:j,isDataRoute:!0}}):v()},null)}var Zp=(function(s){return s.UseBlocker="useBlocker",s.UseRevalidator="useRevalidator",s.UseNavigateStable="useNavigate",s})(Zp||{}),ef=(function(s){return s.UseBlocker="useBlocker",s.UseLoaderData="useLoaderData",s.UseActionData="useActionData",s.UseRouteError="useRouteError",s.UseNavigation="useNavigation",s.UseRouteLoaderData="useRouteLoaderData",s.UseMatches="useMatches",s.UseRevalidator="useRevalidator",s.UseNavigateStable="useNavigate",s.UseRouteId="useRouteId",s})(ef||{});function mb(s){let r=p.useContext(Tl);return r||it(!1),r}function hb(s){let r=p.useContext(Jp);return r||it(!1),r}function pb(s){let r=p.useContext(Kn);return r||it(!1),r}function tf(s){let r=pb(),a=r.matches[r.matches.length-1];return a.route.id||it(!1),a.route.id}function fb(){var s;let r=p.useContext(Yp),a=hb(),o=tf();return r!==void 0?r:(s=a.errors)==null?void 0:s[o]}function gb(){let{router:s}=mb(Zp.UseNavigateStable),r=tf(ef.UseNavigateStable),a=p.useRef(!1);return Xp(()=>{a.current=!0}),p.useCallback(function(c,u){u===void 0&&(u={}),a.current&&(typeof c=="number"?s.navigate(c):s.navigate(c,Ci({fromRouteId:r},u)))},[s,r])}const Xh={};function yb(s,r,a){Xh[s]||(Xh[s]=!0)}function bb(s,r){s?.v7_startTransition,s?.v7_relativeSplatPath}function Dt(s){it(!1)}function vb(s){let{basename:r="/",children:a=null,location:o,navigationType:c=Fn.Pop,navigator:u,static:x=!1,future:h}=s;Fi()&&it(!1);let f=r.replace(/^\/*/,"/"),g=p.useMemo(()=>({basename:f,navigator:u,static:x,future:Ci({v7_relativeSplatPath:!1},h)}),[f,h,u,x]);typeof o=="string"&&(o=va(o));let{pathname:y="/",search:N="",hash:E="",state:S=null,key:P="default"}=o,M=p.useMemo(()=>{let k=pa(y,f);return k==null?null:{location:{pathname:k,search:N,hash:E,state:S,key:P},navigationType:c}},[f,y,N,E,S,P,c]);return M==null?null:p.createElement(Hn.Provider,{value:g},p.createElement(zl.Provider,{children:a,value:M}))}function jb(s){let{children:r,location:a}=s;return ib(xu(r),a)}new Promise(()=>{});function xu(s,r){r===void 0&&(r=[]);let a=[];return p.Children.forEach(s,(o,c)=>{if(!p.isValidElement(o))return;let u=[...r,c];if(o.type===p.Fragment){a.push.apply(a,xu(o.props.children,u));return}o.type!==Dt&&it(!1),!o.props.index||!o.props.children||it(!1);let x={id:o.props.id||u.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,loader:o.props.loader,action:o.props.action,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(x.children=xu(o.props.children,u)),a.push(x)}),a}/**
|
|
59
|
+
* React Router DOM v6.30.4
|
|
60
|
+
*
|
|
61
|
+
* Copyright (c) Remix Software Inc.
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the MIT license found in the
|
|
64
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
65
|
+
*
|
|
66
|
+
* @license MIT
|
|
67
|
+
*/function hl(){return hl=Object.assign?Object.assign.bind():function(s){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var o in a)({}).hasOwnProperty.call(a,o)&&(s[o]=a[o])}return s},hl.apply(null,arguments)}function sf(s,r){if(s==null)return{};var a={};for(var o in s)if({}.hasOwnProperty.call(s,o)){if(r.indexOf(o)!==-1)continue;a[o]=s[o]}return a}function Nb(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function wb(s,r){return s.button===0&&(!r||r==="_self")&&!Nb(s)}const kb=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Sb=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Cb="6";try{window.__reactRouterVersion=Cb}catch{}const Eb=p.createContext({isTransitioning:!1}),Pb="startTransition",Zh=Sy[Pb];function Rb(s){let{basename:r,children:a,future:o,window:c}=s,u=p.useRef();u.current==null&&(u.current=Ty({window:c,v5Compat:!0}));let x=u.current,[h,f]=p.useState({action:x.action,location:x.location}),{v7_startTransition:g}=o||{},y=p.useCallback(N=>{g&&Zh?Zh(()=>f(N)):f(N)},[f,g]);return p.useLayoutEffect(()=>x.listen(y),[x,y]),p.useEffect(()=>bb(o),[o]),p.createElement(vb,{basename:r,children:a,location:h.location,navigationType:h.action,navigator:x,future:o})}const Mb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Tb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,nf=p.forwardRef(function(r,a){let{onClick:o,relative:c,reloadDocument:u,replace:x,state:h,target:f,to:g,preventScrollReset:y,viewTransition:N}=r,E=sf(r,kb),{basename:S}=p.useContext(Hn),P,M=!1;if(typeof g=="string"&&Tb.test(g)&&(P=g,Mb))try{let z=new URL(window.location.href),C=g.startsWith("//")?new URL(z.protocol+g):new URL(g),w=pa(C.pathname,S);C.origin===z.origin&&w!=null?g=w+C.search+C.hash:M=!0}catch{}let k=nb(g,{relative:c}),j=Ob(g,{replace:x,state:h,target:f,preventScrollReset:y,relative:c,viewTransition:N});function v(z){o&&o(z),z.defaultPrevented||j(z)}return p.createElement("a",hl({},E,{href:P||k,onClick:M||u?o:v,ref:a,target:f}))}),zb=p.forwardRef(function(r,a){let{"aria-current":o="page",caseSensitive:c=!1,className:u="",end:x=!1,style:h,to:f,viewTransition:g,children:y}=r,N=sf(r,Sb),E=Al(f,{relative:N.relative}),S=Vn(),P=p.useContext(Jp),{navigator:M,basename:k}=p.useContext(Hn),j=P!=null&&Ib(E)&&g===!0,v=M.encodeLocation?M.encodeLocation(E).pathname:E.pathname,z=S.pathname,C=P&&P.navigation&&P.navigation.location?P.navigation.location.pathname:null;c||(z=z.toLowerCase(),C=C?C.toLowerCase():null,v=v.toLowerCase()),C&&k&&(C=pa(C,k)||C);const w=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let F=z===v||!x&&z.startsWith(v)&&z.charAt(w)==="/",Q=C!=null&&(C===v||!x&&C.startsWith(v)&&C.charAt(v.length)==="/"),Z={isActive:F,isPending:Q,isTransitioning:j},le=F?o:void 0,K;typeof u=="function"?K=u(Z):K=[u,F?"active":null,Q?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let J=typeof h=="function"?h(Z):h;return p.createElement(nf,hl({},N,{"aria-current":le,className:K,ref:a,style:J,to:f,viewTransition:g}),typeof y=="function"?y(Z):y)});var mu;(function(s){s.UseScrollRestoration="useScrollRestoration",s.UseSubmit="useSubmit",s.UseSubmitFetcher="useSubmitFetcher",s.UseFetcher="useFetcher",s.useViewTransitionState="useViewTransitionState"})(mu||(mu={}));var ep;(function(s){s.UseFetcher="useFetcher",s.UseFetchers="useFetchers",s.UseScrollRestoration="useScrollRestoration"})(ep||(ep={}));function Ab(s){let r=p.useContext(Tl);return r||it(!1),r}function Ob(s,r){let{target:a,replace:o,state:c,preventScrollReset:u,relative:x,viewTransition:h}=r===void 0?{}:r,f=Vs(),g=Vn(),y=Al(s,{relative:x});return p.useCallback(N=>{if(wb(N,a)){N.preventDefault();let E=o!==void 0?o:ml(g)===ml(y);f(s,{replace:E,state:c,preventScrollReset:u,relative:x,viewTransition:h})}},[g,f,y,o,c,a,s,u,x,h])}function Ib(s,r){r===void 0&&(r={});let a=p.useContext(Eb);a==null&&it(!1);let{basename:o}=Ab(mu.useViewTransitionState),c=Al(s,{relative:r.relative});if(!a.isTransitioning)return!1;let u=pa(a.currentLocation.pathname,o)||a.currentLocation.pathname,x=pa(a.nextLocation.pathname,o)||a.nextLocation.pathname;return uu(c.pathname,x)!=null||uu(c.pathname,u)!=null}var ja=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(s){return this.listeners.add(s),this.onSubscribe(),()=>{this.listeners.delete(s),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Db=class extends ja{#e;#t;#s;constructor(){super(),this.#s=s=>{if(typeof window<"u"&&window.addEventListener){const r=()=>s();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(s){this.#s=s,this.#t?.(),this.#t=s(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(s){this.#e!==s&&(this.#e=s,this.onFocus())}onFocus(){const s=this.isFocused();this.listeners.forEach(r=>{r(s)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Uu=new Db,Fb={setTimeout:(s,r)=>setTimeout(s,r),clearTimeout:s=>clearTimeout(s),setInterval:(s,r)=>setInterval(s,r),clearInterval:s=>clearInterval(s)},Lb=class{#e=Fb;#t=!1;setTimeoutProvider(s){this.#e=s}setTimeout(s,r){return this.#e.setTimeout(s,r)}clearTimeout(s){this.#e.clearTimeout(s)}setInterval(s,r){return this.#e.setInterval(s,r)}clearInterval(s){this.#e.clearInterval(s)}},pr=new Lb;function _b(s){setTimeout(s,0)}var Ub=typeof window>"u"||"Deno"in globalThis;function Ut(){}function $b(s,r){return typeof s=="function"?s(r):s}function hu(s){return typeof s=="number"&&s>=0&&s!==1/0}function rf(s,r){return Math.max(s+(r||0)-Date.now(),0)}function _n(s,r){return typeof s=="function"?s(r):s}function fs(s,r){return typeof s=="function"?s(r):s}function tp(s,r){const{type:a="all",exact:o,fetchStatus:c,predicate:u,queryKey:x,stale:h}=s;if(x){if(o){if(r.queryHash!==$u(x,r.options))return!1}else if(!Ei(r.queryKey,x))return!1}if(a!=="all"){const f=r.isActive();if(a==="active"&&!f||a==="inactive"&&f)return!1}return!(typeof h=="boolean"&&r.isStale()!==h||c&&c!==r.state.fetchStatus||u&&!u(r))}function sp(s,r){const{exact:a,status:o,predicate:c,mutationKey:u}=s;if(u){if(!r.options.mutationKey)return!1;if(a){if(Nr(r.options.mutationKey)!==Nr(u))return!1}else if(!Ei(r.options.mutationKey,u))return!1}return!(o&&r.state.status!==o||c&&!c(r))}function $u(s,r){return(r?.queryKeyHashFn||Nr)(s)}function Nr(s){return JSON.stringify(s,(r,a)=>pu(a)?Object.keys(a).sort().reduce((o,c)=>(o[c]=a[c],o),{}):a)}function Ei(s,r){return s===r?!0:typeof s!=typeof r?!1:s&&r&&typeof s=="object"&&typeof r=="object"?Object.keys(r).every(a=>Ei(s[a],r[a])):!1}var Bb=Object.prototype.hasOwnProperty;function af(s,r,a=0){if(s===r)return s;if(a>500)return r;const o=np(s)&&np(r);if(!o&&!(pu(s)&&pu(r)))return r;const u=(o?s:Object.keys(s)).length,x=o?r:Object.keys(r),h=x.length,f=o?new Array(h):{};let g=0;for(let y=0;y<h;y++){const N=o?y:x[y],E=s[N],S=r[N];if(E===S){f[N]=E,(o?y<u:Bb.call(s,N))&&g++;continue}if(E===null||S===null||typeof E!="object"||typeof S!="object"){f[N]=S;continue}const P=af(E,S,a+1);f[N]=P,P===E&&g++}return u===h&&g===u?s:f}function pl(s,r){if(!r||Object.keys(s).length!==Object.keys(r).length)return!1;for(const a in s)if(s[a]!==r[a])return!1;return!0}function np(s){return Array.isArray(s)&&s.length===Object.keys(s).length}function pu(s){if(!rp(s))return!1;const r=s.constructor;if(r===void 0)return!0;const a=r.prototype;return!(!rp(a)||!a.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(s)!==Object.prototype)}function rp(s){return Object.prototype.toString.call(s)==="[object Object]"}function qb(s){return new Promise(r=>{pr.setTimeout(r,s)})}function fu(s,r,a){return typeof a.structuralSharing=="function"?a.structuralSharing(s,r):a.structuralSharing!==!1?af(s,r):r}function Hb(s,r,a=0){const o=[...s,r];return a&&o.length>a?o.slice(1):o}function Kb(s,r,a=0){const o=[r,...s];return a&&o.length>a?o.slice(0,-1):o}var Bu=Symbol();function of(s,r){return!s.queryFn&&r?.initialPromise?()=>r.initialPromise:!s.queryFn||s.queryFn===Bu?()=>Promise.reject(new Error(`Missing queryFn: '${s.queryHash}'`)):s.queryFn}function qu(s,r){return typeof s=="function"?s(...r):!!s}function Vb(s,r,a){let o=!1,c;return Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(c??=r(),o||(o=!0,c.aborted?a():c.addEventListener("abort",a,{once:!0})),c)}),s}var Pi=(()=>{let s=()=>Ub;return{isServer(){return s()},setIsServer(r){s=r}}})();function gu(){let s,r;const a=new Promise((c,u)=>{s=c,r=u});a.status="pending",a.catch(()=>{});function o(c){Object.assign(a,c),delete a.resolve,delete a.reject}return a.resolve=c=>{o({status:"fulfilled",value:c}),s(c)},a.reject=c=>{o({status:"rejected",reason:c}),r(c)},a}var Wb=_b;function Gb(){let s=[],r=0,a=h=>{h()},o=h=>{h()},c=Wb;const u=h=>{r?s.push(h):c(()=>{a(h)})},x=()=>{const h=s;s=[],h.length&&c(()=>{o(()=>{h.forEach(f=>{a(f)})})})};return{batch:h=>{let f;r++;try{f=h()}finally{r--,r||x()}return f},batchCalls:h=>(...f)=>{u(()=>{h(...f)})},schedule:u,setNotifyFunction:h=>{a=h},setBatchNotifyFunction:h=>{o=h},setScheduler:h=>{c=h}}}var ft=Gb(),Qb=class extends ja{#e=!0;#t;#s;constructor(){super(),this.#s=s=>{if(typeof window<"u"&&window.addEventListener){const r=()=>s(!0),a=()=>s(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",a)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(s){this.#s=s,this.#t?.(),this.#t=s(this.setOnline.bind(this))}setOnline(s){this.#e!==s&&(this.#e=s,this.listeners.forEach(a=>{a(s)}))}isOnline(){return this.#e}},fl=new Qb;function Jb(s){return Math.min(1e3*2**s,3e4)}function lf(s){return(s??"online")==="online"?fl.isOnline():!0}var yu=class extends Error{constructor(s){super("CancelledError"),this.revert=s?.revert,this.silent=s?.silent}};function cf(s){let r=!1,a=0,o;const c=gu(),u=()=>c.status!=="pending",x=M=>{if(!u()){const k=new yu(M);E(k),s.onCancel?.(k)}},h=()=>{r=!0},f=()=>{r=!1},g=()=>Uu.isFocused()&&(s.networkMode==="always"||fl.isOnline())&&s.canRun(),y=()=>lf(s.networkMode)&&s.canRun(),N=M=>{u()||(o?.(),c.resolve(M))},E=M=>{u()||(o?.(),c.reject(M))},S=()=>new Promise(M=>{o=k=>{(u()||g())&&M(k)},s.onPause?.()}).then(()=>{o=void 0,u()||s.onContinue?.()}),P=()=>{if(u())return;let M;const k=a===0?s.initialPromise:void 0;try{M=k??s.fn()}catch(j){M=Promise.reject(j)}Promise.resolve(M).then(N).catch(j=>{if(u())return;const v=s.retry??(Pi.isServer()?0:3),z=s.retryDelay??Jb,C=typeof z=="function"?z(a,j):z,w=v===!0||typeof v=="number"&&a<v||typeof v=="function"&&v(a,j);if(r||!w){E(j);return}a++,s.onFail?.(a,j),qb(C).then(()=>g()?void 0:S()).then(()=>{r?E(j):P()})})};return{promise:c,status:()=>c.status,cancel:x,continue:()=>(o?.(),c),cancelRetry:h,continueRetry:f,canStart:y,start:()=>(y()?P():S().then(P),c)}}var df=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),hu(this.gcTime)&&(this.#e=pr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(s){this.gcTime=Math.max(this.gcTime||0,s??(Pi.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e&&(pr.clearTimeout(this.#e),this.#e=void 0)}},Yb=class extends df{#e;#t;#s;#r;#n;#a;#i;constructor(s){super(),this.#i=!1,this.#a=s.defaultOptions,this.setOptions(s.options),this.observers=[],this.#r=s.client,this.#s=this.#r.getQueryCache(),this.queryKey=s.queryKey,this.queryHash=s.queryHash,this.#e=ip(this.options),this.state=s.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(s){if(this.options={...this.#a,...s},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=ip(this.options);r.data!==void 0&&(this.setState(ap(r.data,r.dataUpdatedAt)),this.#e=r)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#s.remove(this)}setData(s,r){const a=fu(this.state.data,s,this.options);return this.#l({data:a,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),a}setState(s,r){this.#l({type:"setState",state:s,setStateOptions:r})}cancel(s){const r=this.#n?.promise;return this.#n?.cancel(s),r?r.then(Ut).catch(Ut):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(s=>fs(s.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Bu||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(s=>_n(s.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(s=>s.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(s=0){return this.state.data===void 0?!0:s==="static"?!1:this.state.isInvalidated?!0:!rf(this.state.dataUpdatedAt,s)}onFocus(){this.observers.find(r=>r.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(r=>r.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(s){this.observers.includes(s)||(this.observers.push(s),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",query:this,observer:s}))}removeObserver(s){this.observers.includes(s)&&(this.observers=this.observers.filter(r=>r!==s),this.observers.length||(this.#n&&(this.#i||this.#o()?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:s}))}getObserversCount(){return this.observers.length}#o(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(s,r){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&r?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(s&&this.setOptions(s),!this.options.queryFn){const h=this.observers.find(f=>f.options.queryFn);h&&this.setOptions(h.options)}const a=new AbortController,o=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#i=!0,a.signal)})},c=()=>{const h=of(this.options,r),g=(()=>{const y={client:this.#r,queryKey:this.queryKey,meta:this.meta};return o(y),y})();return this.#i=!1,this.options.persister?this.options.persister(h,g,this):h(g)},x=(()=>{const h={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:c};return o(h),h})();this.options.behavior?.onFetch(x,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==x.fetchOptions?.meta)&&this.#l({type:"fetch",meta:x.fetchOptions?.meta}),this.#n=cf({initialPromise:r?.initialPromise,fn:x.fetchFn,onCancel:h=>{h instanceof yu&&h.revert&&this.setState({...this.#t,fetchStatus:"idle"}),a.abort()},onFail:(h,f)=>{this.#l({type:"failed",failureCount:h,error:f})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:x.options.retry,retryDelay:x.options.retryDelay,networkMode:x.options.networkMode,canRun:()=>!0});try{const h=await this.#n.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#s.config.onSuccess?.(h,this),this.#s.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof yu){if(h.silent)return this.#n.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#l({type:"error",error:h}),this.#s.config.onError?.(h,this),this.#s.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#l(s){const r=a=>{switch(s.type){case"failed":return{...a,fetchFailureCount:s.failureCount,fetchFailureReason:s.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...uf(a.data,this.options),fetchMeta:s.meta??null};case"success":const o={...a,...ap(s.data,s.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!s.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=s.manual?o:void 0,o;case"error":const c=s.error;return{...a,error:c,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...s.state}}};this.state=r(this.state),ft.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:s})})}};function uf(s,r){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:lf(r.networkMode)?"fetching":"paused",...s===void 0&&{error:null,status:"pending"}}}function ap(s,r){return{data:s,dataUpdatedAt:r??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ip(s){const r=typeof s.initialData=="function"?s.initialData():s.initialData,a=r!==void 0,o=a?typeof s.initialDataUpdatedAt=="function"?s.initialDataUpdatedAt():s.initialDataUpdatedAt:0;return{data:r,dataUpdateCount:0,dataUpdatedAt:a?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:a?"success":"pending",fetchStatus:"idle"}}var Xb=class extends ja{constructor(s,r){super(),this.options=r,this.#e=s,this.#o=null,this.#i=gu(),this.bindMethods(),this.setOptions(r)}#e;#t=void 0;#s=void 0;#r=void 0;#n;#a;#i;#o;#l;#m;#h;#d;#u;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),op(this.#t,this.options)?this.#x():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return bu(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bu(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#v(),this.#j(),this.#t.removeObserver(this)}setOptions(s){const r=this.options,a=this.#t;if(this.options=this.#e.defaultQueryOptions(s),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof fs(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#N(),this.#t.setOptions(this.options),r._defaulted&&!pl(this.options,r)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const o=this.hasListeners();o&&lp(this.#t,a,this.options,r)&&this.#x(),this.updateResult(),o&&(this.#t!==a||fs(this.options.enabled,this.#t)!==fs(r.enabled,this.#t)||_n(this.options.staleTime,this.#t)!==_n(r.staleTime,this.#t))&&this.#f();const c=this.#g();o&&(this.#t!==a||fs(this.options.enabled,this.#t)!==fs(r.enabled,this.#t)||c!==this.#c)&&this.#y(c)}getOptimisticResult(s){const r=this.#e.getQueryCache().build(this.#e,s),a=this.createResult(r,s);return e1(this,a)&&(this.#r=a,this.#a=this.options,this.#n=this.#t.state),a}getCurrentResult(){return this.#r}trackResult(s,r){return new Proxy(s,{get:(a,o)=>(this.trackProp(o),r?.(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,o))})}trackProp(s){this.#p.add(s)}getCurrentQuery(){return this.#t}refetch({...s}={}){return this.fetch({...s})}fetchOptimistic(s){const r=this.#e.defaultQueryOptions(s),a=this.#e.getQueryCache().build(this.#e,r);return a.fetch().then(()=>this.createResult(a,r))}fetch(s){return this.#x({...s,cancelRefetch:s.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#x(s){this.#N();let r=this.#t.fetch(this.options,s);return s?.throwOnError||(r=r.catch(Ut)),r}#f(){this.#v();const s=_n(this.options.staleTime,this.#t);if(Pi.isServer()||this.#r.isStale||!hu(s))return;const a=rf(this.#r.dataUpdatedAt,s)+1;this.#d=pr.setTimeout(()=>{this.#r.isStale||this.updateResult()},a)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(s){this.#j(),this.#c=s,!(Pi.isServer()||fs(this.options.enabled,this.#t)===!1||!hu(this.#c)||this.#c===0)&&(this.#u=pr.setInterval(()=>{(this.options.refetchIntervalInBackground||Uu.isFocused())&&this.#x()},this.#c))}#b(){this.#f(),this.#y(this.#g())}#v(){this.#d&&(pr.clearTimeout(this.#d),this.#d=void 0)}#j(){this.#u&&(pr.clearInterval(this.#u),this.#u=void 0)}createResult(s,r){const a=this.#t,o=this.options,c=this.#r,u=this.#n,x=this.#a,f=s!==a?s.state:this.#s,{state:g}=s;let y={...g},N=!1,E;if(r._optimisticResults){const Z=this.hasListeners(),le=!Z&&op(s,r),K=Z&&lp(s,a,r,o);(le||K)&&(y={...y,...uf(g.data,s.options)}),r._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:S,errorUpdatedAt:P,status:M}=y;E=y.data;let k=!1;if(r.placeholderData!==void 0&&E===void 0&&M==="pending"){let Z;c?.isPlaceholderData&&r.placeholderData===x?.placeholderData?(Z=c.data,k=!0):Z=typeof r.placeholderData=="function"?r.placeholderData(this.#h?.state.data,this.#h):r.placeholderData,Z!==void 0&&(M="success",E=fu(c?.data,Z,r),N=!0)}if(r.select&&E!==void 0&&!k)if(c&&E===u?.data&&r.select===this.#l)E=this.#m;else try{this.#l=r.select,E=r.select(E),E=fu(c?.data,E,r),this.#m=E,this.#o=null}catch(Z){this.#o=Z}this.#o&&(S=this.#o,E=this.#m,P=Date.now(),M="error");const j=y.fetchStatus==="fetching",v=M==="pending",z=M==="error",C=v&&j,w=E!==void 0,Q={status:M,fetchStatus:y.fetchStatus,isPending:v,isSuccess:M==="success",isError:z,isInitialLoading:C,isLoading:C,data:E,dataUpdatedAt:y.dataUpdatedAt,error:S,errorUpdatedAt:P,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:s.isFetched(),isFetchedAfterMount:y.dataUpdateCount>f.dataUpdateCount||y.errorUpdateCount>f.errorUpdateCount,isFetching:j,isRefetching:j&&!v,isLoadingError:z&&!w,isPaused:y.fetchStatus==="paused",isPlaceholderData:N,isRefetchError:z&&w,isStale:Hu(s,r),refetch:this.refetch,promise:this.#i,isEnabled:fs(r.enabled,s)!==!1};if(this.options.experimental_prefetchInRender){const Z=Q.data!==void 0,le=Q.status==="error"&&!Z,K=ke=>{le?ke.reject(Q.error):Z&&ke.resolve(Q.data)},J=()=>{const ke=this.#i=Q.promise=gu();K(ke)},ue=this.#i;switch(ue.status){case"pending":s.queryHash===a.queryHash&&K(ue);break;case"fulfilled":(le||Q.data!==ue.value)&&J();break;case"rejected":(!le||Q.error!==ue.reason)&&J();break}}return Q}updateResult(){const s=this.#r,r=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#a=this.options,this.#n.data!==void 0&&(this.#h=this.#t),pl(r,s))return;this.#r=r;const a=()=>{if(!s)return!0;const{notifyOnChangeProps:o}=this.options,c=typeof o=="function"?o():o;if(c==="all"||!c&&!this.#p.size)return!0;const u=new Set(c??this.#p);return this.options.throwOnError&&u.add("error"),Object.keys(this.#r).some(x=>{const h=x;return this.#r[h]!==s[h]&&u.has(h)})};this.#w({listeners:a()})}#N(){const s=this.#e.getQueryCache().build(this.#e,this.options);if(s===this.#t)return;const r=this.#t;this.#t=s,this.#s=s.state,this.hasListeners()&&(r?.removeObserver(this),s.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#w(s){ft.batch(()=>{s.listeners&&this.listeners.forEach(r=>{r(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Zb(s,r){return fs(r.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&r.retryOnMount===!1)}function op(s,r){return Zb(s,r)||s.state.data!==void 0&&bu(s,r,r.refetchOnMount)}function bu(s,r,a){if(fs(r.enabled,s)!==!1&&_n(r.staleTime,s)!=="static"){const o=typeof a=="function"?a(s):a;return o==="always"||o!==!1&&Hu(s,r)}return!1}function lp(s,r,a,o){return(s!==r||fs(o.enabled,s)===!1)&&(!a.suspense||s.state.status!=="error")&&Hu(s,a)}function Hu(s,r){return fs(r.enabled,s)!==!1&&s.isStaleByTime(_n(r.staleTime,s))}function e1(s,r){return!pl(s.getCurrentResult(),r)}function cp(s){return{onFetch:(r,a)=>{const o=r.options,c=r.fetchOptions?.meta?.fetchMore?.direction,u=r.state.data?.pages||[],x=r.state.data?.pageParams||[];let h={pages:[],pageParams:[]},f=0;const g=async()=>{let y=!1;const N=P=>{Vb(P,()=>r.signal,()=>y=!0)},E=of(r.options,r.fetchOptions),S=async(P,M,k)=>{if(y)return Promise.reject();if(M==null&&P.pages.length)return Promise.resolve(P);const v=(()=>{const F={client:r.client,queryKey:r.queryKey,pageParam:M,direction:k?"backward":"forward",meta:r.options.meta};return N(F),F})(),z=await E(v),{maxPages:C}=r.options,w=k?Kb:Hb;return{pages:w(P.pages,z,C),pageParams:w(P.pageParams,M,C)}};if(c&&u.length){const P=c==="backward",M=P?t1:dp,k={pages:u,pageParams:x},j=M(o,k);h=await S(k,j,P)}else{const P=s??u.length;do{const M=f===0?x[0]??o.initialPageParam:dp(o,h);if(f>0&&M==null)break;h=await S(h,M),f++}while(f<P)}return h};r.options.persister?r.fetchFn=()=>r.options.persister?.(g,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},a):r.fetchFn=g}}}function dp(s,{pages:r,pageParams:a}){const o=r.length-1;return r.length>0?s.getNextPageParam(r[o],r,a[o],a):void 0}function t1(s,{pages:r,pageParams:a}){return r.length>0?s.getPreviousPageParam?.(r[0],r,a[0],a):void 0}var s1=class extends df{#e;#t;#s;#r;constructor(s){super(),this.#e=s.client,this.mutationId=s.mutationId,this.#s=s.mutationCache,this.#t=[],this.state=s.state||xf(),this.setOptions(s.options),this.scheduleGc()}setOptions(s){this.options=s,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(s){this.#t.includes(s)||(this.#t.push(s),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:s}))}removeObserver(s){this.#t=this.#t.filter(r=>r!==s),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:s})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#s.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(s){const r=()=>{this.#n({type:"continue"})},a={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=cf({fn:()=>this.options.mutationFn?this.options.mutationFn(s,a):Promise.reject(new Error("No mutationFn found")),onFail:(u,x)=>{this.#n({type:"failed",failureCount:u,error:x})},onPause:()=>{this.#n({type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const o=this.state.status==="pending",c=!this.#r.canStart();try{if(o)r();else{this.#n({type:"pending",variables:s,isPaused:c}),this.#s.config.onMutate&&await this.#s.config.onMutate(s,this,a);const x=await this.options.onMutate?.(s,a);x!==this.state.context&&this.#n({type:"pending",context:x,variables:s,isPaused:c})}const u=await this.#r.start();return await this.#s.config.onSuccess?.(u,s,this.state.context,this,a),await this.options.onSuccess?.(u,s,this.state.context,a),await this.#s.config.onSettled?.(u,null,this.state.variables,this.state.context,this,a),await this.options.onSettled?.(u,null,s,this.state.context,a),this.#n({type:"success",data:u}),u}catch(u){try{await this.#s.config.onError?.(u,s,this.state.context,this,a)}catch(x){Promise.reject(x)}try{await this.options.onError?.(u,s,this.state.context,a)}catch(x){Promise.reject(x)}try{await this.#s.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,a)}catch(x){Promise.reject(x)}try{await this.options.onSettled?.(void 0,u,s,this.state.context,a)}catch(x){Promise.reject(x)}throw this.#n({type:"error",error:u}),u}finally{this.#s.runNext(this)}}#n(s){const r=a=>{switch(s.type){case"failed":return{...a,failureCount:s.failureCount,failureReason:s.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:s.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:s.isPaused,status:"pending",variables:s.variables,submittedAt:Date.now()};case"success":return{...a,data:s.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:s.error,failureCount:a.failureCount+1,failureReason:s.error,isPaused:!1,status:"error"}}};this.state=r(this.state),ft.batch(()=>{this.#t.forEach(a=>{a.onMutationUpdate(s)}),this.#s.notify({mutation:this,type:"updated",action:s})})}};function xf(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var n1=class extends ja{constructor(s={}){super(),this.config=s,this.#e=new Set,this.#t=new Map,this.#s=0}#e;#t;#s;build(s,r,a){const o=new s1({client:s,mutationCache:this,mutationId:++this.#s,options:s.defaultMutationOptions(r),state:a});return this.add(o),o}add(s){this.#e.add(s);const r=Zo(s);if(typeof r=="string"){const a=this.#t.get(r);a?a.push(s):this.#t.set(r,[s])}this.notify({type:"added",mutation:s})}remove(s){if(this.#e.delete(s)){const r=Zo(s);if(typeof r=="string"){const a=this.#t.get(r);if(a)if(a.length>1){const o=a.indexOf(s);o!==-1&&a.splice(o,1)}else a[0]===s&&this.#t.delete(r)}}this.notify({type:"removed",mutation:s})}canRun(s){const r=Zo(s);if(typeof r=="string"){const o=this.#t.get(r)?.find(c=>c.state.status==="pending");return!o||o===s}else return!0}runNext(s){const r=Zo(s);return typeof r=="string"?this.#t.get(r)?.find(o=>o!==s&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ft.batch(()=>{this.#e.forEach(s=>{this.notify({type:"removed",mutation:s})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(s){const r={exact:!0,...s};return this.getAll().find(a=>sp(r,a))}findAll(s={}){return this.getAll().filter(r=>sp(s,r))}notify(s){ft.batch(()=>{this.listeners.forEach(r=>{r(s)})})}resumePausedMutations(){const s=this.getAll().filter(r=>r.state.isPaused);return ft.batch(()=>Promise.all(s.map(r=>r.continue().catch(Ut))))}};function Zo(s){return s.options.scope?.id}var r1=class extends ja{#e;#t=void 0;#s;#r;constructor(r,a){super(),this.#e=r,this.setOptions(a),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){const a=this.options;this.options=this.#e.defaultMutationOptions(r),pl(this.options,a)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),a?.mutationKey&&this.options.mutationKey&&Nr(a.mutationKey)!==Nr(this.options.mutationKey)?this.reset():this.#s?.state.status==="pending"&&this.#s.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#s?.removeObserver(this)}onMutationUpdate(r){this.#n(),this.#a(r)}getCurrentResult(){return this.#t}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#n(),this.#a()}mutate(r,a){return this.#r=a,this.#s?.removeObserver(this),this.#s=this.#e.getMutationCache().build(this.#e,this.options),this.#s.addObserver(this),this.#s.execute(r)}#n(){const r=this.#s?.state??xf();this.#t={...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset}}#a(r){ft.batch(()=>{if(this.#r&&this.hasListeners()){const a=this.#t.variables,o=this.#t.context,c={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(r?.type==="success"){try{this.#r.onSuccess?.(r.data,a,o,c)}catch(u){Promise.reject(u)}try{this.#r.onSettled?.(r.data,null,a,o,c)}catch(u){Promise.reject(u)}}else if(r?.type==="error"){try{this.#r.onError?.(r.error,a,o,c)}catch(u){Promise.reject(u)}try{this.#r.onSettled?.(void 0,r.error,a,o,c)}catch(u){Promise.reject(u)}}}this.listeners.forEach(a=>{a(this.#t)})})}},a1=class extends ja{constructor(s={}){super(),this.config=s,this.#e=new Map}#e;build(s,r,a){const o=r.queryKey,c=r.queryHash??$u(o,r);let u=this.get(c);return u||(u=new Yb({client:s,queryKey:o,queryHash:c,options:s.defaultQueryOptions(r),state:a,defaultOptions:s.getQueryDefaults(o)}),this.add(u)),u}add(s){this.#e.has(s.queryHash)||(this.#e.set(s.queryHash,s),this.notify({type:"added",query:s}))}remove(s){const r=this.#e.get(s.queryHash);r&&(s.destroy(),r===s&&this.#e.delete(s.queryHash),this.notify({type:"removed",query:s}))}clear(){ft.batch(()=>{this.getAll().forEach(s=>{this.remove(s)})})}get(s){return this.#e.get(s)}getAll(){return[...this.#e.values()]}find(s){const r={exact:!0,...s};return this.getAll().find(a=>tp(r,a))}findAll(s={}){const r=this.getAll();return Object.keys(s).length>0?r.filter(a=>tp(s,a)):r}notify(s){ft.batch(()=>{this.listeners.forEach(r=>{r(s)})})}onFocus(){ft.batch(()=>{this.getAll().forEach(s=>{s.onFocus()})})}onOnline(){ft.batch(()=>{this.getAll().forEach(s=>{s.onOnline()})})}},i1=class{#e;#t;#s;#r;#n;#a;#i;#o;constructor(s={}){this.#e=s.queryCache||new a1,this.#t=s.mutationCache||new n1,this.#s=s.defaultOptions||{},this.#r=new Map,this.#n=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#i=Uu.subscribe(async s=>{s&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=fl.subscribe(async s=>{s&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#i?.(),this.#i=void 0,this.#o?.(),this.#o=void 0)}isFetching(s){return this.#e.findAll({...s,fetchStatus:"fetching"}).length}isMutating(s){return this.#t.findAll({...s,status:"pending"}).length}getQueryData(s){const r=this.defaultQueryOptions({queryKey:s});return this.#e.get(r.queryHash)?.state.data}ensureQueryData(s){const r=this.defaultQueryOptions(s),a=this.#e.build(this,r),o=a.state.data;return o===void 0?this.fetchQuery(s):(s.revalidateIfStale&&a.isStaleByTime(_n(r.staleTime,a))&&this.prefetchQuery(r),Promise.resolve(o))}getQueriesData(s){return this.#e.findAll(s).map(({queryKey:r,state:a})=>{const o=a.data;return[r,o]})}setQueryData(s,r,a){const o=this.defaultQueryOptions({queryKey:s}),u=this.#e.get(o.queryHash)?.state.data,x=$b(r,u);if(x!==void 0)return this.#e.build(this,o).setData(x,{...a,manual:!0})}setQueriesData(s,r,a){return ft.batch(()=>this.#e.findAll(s).map(({queryKey:o})=>[o,this.setQueryData(o,r,a)]))}getQueryState(s){const r=this.defaultQueryOptions({queryKey:s});return this.#e.get(r.queryHash)?.state}removeQueries(s){const r=this.#e;ft.batch(()=>{r.findAll(s).forEach(a=>{r.remove(a)})})}resetQueries(s,r){const a=this.#e;return ft.batch(()=>(a.findAll(s).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...s},r)))}cancelQueries(s,r={}){const a={revert:!0,...r},o=ft.batch(()=>this.#e.findAll(s).map(c=>c.cancel(a)));return Promise.all(o).then(Ut).catch(Ut)}invalidateQueries(s,r={}){return ft.batch(()=>(this.#e.findAll(s).forEach(a=>{a.invalidate()}),s?.refetchType==="none"?Promise.resolve():this.refetchQueries({...s,type:s?.refetchType??s?.type??"active"},r)))}refetchQueries(s,r={}){const a={...r,cancelRefetch:r.cancelRefetch??!0},o=ft.batch(()=>this.#e.findAll(s).filter(c=>!c.isDisabled()&&!c.isStatic()).map(c=>{let u=c.fetch(void 0,a);return a.throwOnError||(u=u.catch(Ut)),c.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(o).then(Ut)}fetchQuery(s){const r=this.defaultQueryOptions(s);r.retry===void 0&&(r.retry=!1);const a=this.#e.build(this,r);return a.isStaleByTime(_n(r.staleTime,a))?a.fetch(r):Promise.resolve(a.state.data)}prefetchQuery(s){return this.fetchQuery(s).then(Ut).catch(Ut)}fetchInfiniteQuery(s){return s.behavior=cp(s.pages),this.fetchQuery(s)}prefetchInfiniteQuery(s){return this.fetchInfiniteQuery(s).then(Ut).catch(Ut)}ensureInfiniteQueryData(s){return s.behavior=cp(s.pages),this.ensureQueryData(s)}resumePausedMutations(){return fl.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#s}setDefaultOptions(s){this.#s=s}setQueryDefaults(s,r){this.#r.set(Nr(s),{queryKey:s,defaultOptions:r})}getQueryDefaults(s){const r=[...this.#r.values()],a={};return r.forEach(o=>{Ei(s,o.queryKey)&&Object.assign(a,o.defaultOptions)}),a}setMutationDefaults(s,r){this.#n.set(Nr(s),{mutationKey:s,defaultOptions:r})}getMutationDefaults(s){const r=[...this.#n.values()],a={};return r.forEach(o=>{Ei(s,o.mutationKey)&&Object.assign(a,o.defaultOptions)}),a}defaultQueryOptions(s){if(s._defaulted)return s;const r={...this.#s.queries,...this.getQueryDefaults(s.queryKey),...s,_defaulted:!0};return r.queryHash||(r.queryHash=$u(r.queryKey,r)),r.refetchOnReconnect===void 0&&(r.refetchOnReconnect=r.networkMode!=="always"),r.throwOnError===void 0&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.queryFn===Bu&&(r.enabled=!1),r}defaultMutationOptions(s){return s?._defaulted?s:{...this.#s.mutations,...s?.mutationKey&&this.getMutationDefaults(s.mutationKey),...s,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},mf=p.createContext(void 0),Re=s=>{const r=p.useContext(mf);if(!r)throw new Error("No QueryClient set, use QueryClientProvider to set one");return r},o1=({client:s,children:r})=>(p.useEffect(()=>(s.mount(),()=>{s.unmount()}),[s]),e.jsx(mf.Provider,{value:s,children:r})),hf=p.createContext(!1),l1=()=>p.useContext(hf);hf.Provider;function c1(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var d1=p.createContext(c1()),u1=()=>p.useContext(d1),x1=(s,r,a)=>{const o=a?.state.error&&typeof s.throwOnError=="function"?qu(s.throwOnError,[a.state.error,a]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||o)&&(r.isReset()||(s.retryOnMount=!1))},m1=s=>{p.useEffect(()=>{s.clearReset()},[s])},h1=({result:s,errorResetBoundary:r,throwOnError:a,query:o,suspense:c})=>s.isError&&!r.isReset()&&!s.isFetching&&o&&(c&&s.data===void 0||qu(a,[s.error,o])),p1=s=>{if(s.suspense){const a=c=>c==="static"?c:Math.max(c??1e3,1e3),o=s.staleTime;s.staleTime=typeof o=="function"?(...c)=>a(o(...c)):a(o),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},f1=(s,r)=>s.isLoading&&s.isFetching&&!r,g1=(s,r)=>s?.suspense&&r.isPending,up=(s,r,a)=>r.fetchOptimistic(s).catch(()=>{a.clearReset()});function y1(s,r,a){const o=l1(),c=u1(),u=Re(),x=u.defaultQueryOptions(s);u.getDefaultOptions().queries?._experimental_beforeQuery?.(x);const h=u.getQueryCache().get(x.queryHash);x._optimisticResults=o?"isRestoring":"optimistic",p1(x),x1(x,c,h),m1(c);const f=!u.getQueryCache().get(x.queryHash),[g]=p.useState(()=>new r(u,x)),y=g.getOptimisticResult(x),N=!o&&s.subscribed!==!1;if(p.useSyncExternalStore(p.useCallback(E=>{const S=N?g.subscribe(ft.batchCalls(E)):Ut;return g.updateResult(),S},[g,N]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),p.useEffect(()=>{g.setOptions(x)},[x,g]),g1(x,y))throw up(x,g,c);if(h1({result:y,errorResetBoundary:c,throwOnError:x.throwOnError,query:h,suspense:x.suspense}))throw y.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(x,y),x.experimental_prefetchInRender&&!Pi.isServer()&&f1(y,o)&&(f?up(x,g,c):h?.promise)?.catch(Ut).finally(()=>{g.updateResult()}),x.notifyOnChangeProps?y:g.trackResult(y)}function Oe(s,r){return y1(s,Xb)}function oe(s,r){const a=Re(),[o]=p.useState(()=>new r1(a,s));p.useEffect(()=>{o.setOptions(s)},[o,s]);const c=p.useSyncExternalStore(p.useCallback(x=>o.subscribe(ft.batchCalls(x)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),u=p.useCallback((x,h)=>{o.mutate(x,h).catch(Ut)},[o]);if(c.error&&qu(o.options.throwOnError,[c.error]))throw c.error;return{...c,mutate:u,mutateAsync:c.mutate}}let b1={data:""},v1=s=>{if(typeof window=="object"){let r=(s?s.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return r.nonce=window.__nonce__,r.parentNode||(s||document.head).appendChild(r),r.firstChild}return s||b1},j1=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,N1=/\/\*[^]*?\*\/| +/g,xp=/\n+/g,Dn=(s,r)=>{let a="",o="",c="";for(let u in s){let x=s[u];u[0]=="@"?u[1]=="i"?a=u+" "+x+";":o+=u[1]=="f"?Dn(x,u):u+"{"+Dn(x,u[1]=="k"?"":r)+"}":typeof x=="object"?o+=Dn(x,r?r.replace(/([^,])+/g,h=>u.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,f=>/&/.test(f)?f.replace(/&/g,h):h?h+" "+f:f)):u):x!=null&&(u=/^--/.test(u)?u:u.replace(/[A-Z]/g,"-$&").toLowerCase(),c+=Dn.p?Dn.p(u,x):u+":"+x+";")}return a+(r&&c?r+"{"+c+"}":c)+o},rn={},pf=s=>{if(typeof s=="object"){let r="";for(let a in s)r+=a+pf(s[a]);return r}return s},w1=(s,r,a,o,c)=>{let u=pf(s),x=rn[u]||(rn[u]=(f=>{let g=0,y=11;for(;g<f.length;)y=101*y+f.charCodeAt(g++)>>>0;return"go"+y})(u));if(!rn[x]){let f=u!==s?s:(g=>{let y,N,E=[{}];for(;y=j1.exec(g.replace(N1,""));)y[4]?E.shift():y[3]?(N=y[3].replace(xp," ").trim(),E.unshift(E[0][N]=E[0][N]||{})):E[0][y[1]]=y[2].replace(xp," ").trim();return E[0]})(s);rn[x]=Dn(c?{["@keyframes "+x]:f}:f,a?"":"."+x)}let h=a&&rn.g?rn.g:null;return a&&(rn.g=rn[x]),((f,g,y,N)=>{N?g.data=g.data.replace(N,f):g.data.indexOf(f)===-1&&(g.data=y?f+g.data:g.data+f)})(rn[x],r,o,h),x},k1=(s,r,a)=>s.reduce((o,c,u)=>{let x=r[u];if(x&&x.call){let h=x(a),f=h&&h.props&&h.props.className||/^go/.test(h)&&h;x=f?"."+f:h&&typeof h=="object"?h.props?"":Dn(h,""):h===!1?"":h}return o+c+(x??"")},"");function Ol(s){let r=this||{},a=s.call?s(r.p):s;return w1(a.unshift?a.raw?k1(a,[].slice.call(arguments,1),r.p):a.reduce((o,c)=>Object.assign(o,c&&c.call?c(r.p):c),{}):a,v1(r.target),r.g,r.o,r.k)}let ff,vu,ju;Ol.bind({g:1});let un=Ol.bind({k:1});function S1(s,r,a,o){Dn.p=r,ff=s,vu=a,ju=o}function Wn(s,r){let a=this||{};return function(){let o=arguments;function c(u,x){let h=Object.assign({},u),f=h.className||c.className;a.p=Object.assign({theme:vu&&vu()},h),a.o=/ *go\d+/.test(f),h.className=Ol.apply(a,o)+(f?" "+f:"");let g=s;return s[0]&&(g=h.as||s,delete h.as),ju&&g[0]&&ju(h),ff(g,h)}return c}}var C1=s=>typeof s=="function",gl=(s,r)=>C1(s)?s(r):s,E1=(()=>{let s=0;return()=>(++s).toString()})(),gf=(()=>{let s;return()=>{if(s===void 0&&typeof window<"u"){let r=matchMedia("(prefers-reduced-motion: reduce)");s=!r||r.matches}return s}})(),P1=20,Ku="default",yf=(s,r)=>{let{toastLimit:a}=s.settings;switch(r.type){case 0:return{...s,toasts:[r.toast,...s.toasts].slice(0,a)};case 1:return{...s,toasts:s.toasts.map(x=>x.id===r.toast.id?{...x,...r.toast}:x)};case 2:let{toast:o}=r;return yf(s,{type:s.toasts.find(x=>x.id===o.id)?1:0,toast:o});case 3:let{toastId:c}=r;return{...s,toasts:s.toasts.map(x=>x.id===c||c===void 0?{...x,dismissed:!0,visible:!1}:x)};case 4:return r.toastId===void 0?{...s,toasts:[]}:{...s,toasts:s.toasts.filter(x=>x.id!==r.toastId)};case 5:return{...s,pausedAt:r.time};case 6:let u=r.time-(s.pausedAt||0);return{...s,pausedAt:void 0,toasts:s.toasts.map(x=>({...x,pauseDuration:x.pauseDuration+u}))}}},dl=[],bf={toasts:[],pausedAt:void 0,settings:{toastLimit:P1}},qs={},vf=(s,r=Ku)=>{qs[r]=yf(qs[r]||bf,s),dl.forEach(([a,o])=>{a===r&&o(qs[r])})},jf=s=>Object.keys(qs).forEach(r=>vf(s,r)),R1=s=>Object.keys(qs).find(r=>qs[r].toasts.some(a=>a.id===s)),Il=(s=Ku)=>r=>{vf(r,s)},M1={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},T1=(s={},r=Ku)=>{let[a,o]=p.useState(qs[r]||bf),c=p.useRef(qs[r]);p.useEffect(()=>(c.current!==qs[r]&&o(qs[r]),dl.push([r,o]),()=>{let x=dl.findIndex(([h])=>h===r);x>-1&&dl.splice(x,1)}),[r]);let u=a.toasts.map(x=>{var h,f,g;return{...s,...s[x.type],...x,removeDelay:x.removeDelay||((h=s[x.type])==null?void 0:h.removeDelay)||s?.removeDelay,duration:x.duration||((f=s[x.type])==null?void 0:f.duration)||s?.duration||M1[x.type],style:{...s.style,...(g=s[x.type])==null?void 0:g.style,...x.style}}});return{...a,toasts:u}},z1=(s,r="blank",a)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:r,ariaProps:{role:"status","aria-live":"polite"},message:s,pauseDuration:0,...a,id:a?.id||E1()}),Li=s=>(r,a)=>{let o=z1(r,s,a);return Il(o.toasterId||R1(o.id))({type:2,toast:o}),o.id},gt=(s,r)=>Li("blank")(s,r);gt.error=Li("error");gt.success=Li("success");gt.loading=Li("loading");gt.custom=Li("custom");gt.dismiss=(s,r)=>{let a={type:3,toastId:s};r?Il(r)(a):jf(a)};gt.dismissAll=s=>gt.dismiss(void 0,s);gt.remove=(s,r)=>{let a={type:4,toastId:s};r?Il(r)(a):jf(a)};gt.removeAll=s=>gt.remove(void 0,s);gt.promise=(s,r,a)=>{let o=gt.loading(r.loading,{...a,...a?.loading});return typeof s=="function"&&(s=s()),s.then(c=>{let u=r.success?gl(r.success,c):void 0;return u?gt.success(u,{id:o,...a,...a?.success}):gt.dismiss(o),c}).catch(c=>{let u=r.error?gl(r.error,c):void 0;u?gt.error(u,{id:o,...a,...a?.error}):gt.dismiss(o)}),s};var A1=1e3,O1=(s,r="default")=>{let{toasts:a,pausedAt:o}=T1(s,r),c=p.useRef(new Map).current,u=p.useCallback((N,E=A1)=>{if(c.has(N))return;let S=setTimeout(()=>{c.delete(N),x({type:4,toastId:N})},E);c.set(N,S)},[]);p.useEffect(()=>{if(o)return;let N=Date.now(),E=a.map(S=>{if(S.duration===1/0)return;let P=(S.duration||0)+S.pauseDuration-(N-S.createdAt);if(P<0){S.visible&>.dismiss(S.id);return}return setTimeout(()=>gt.dismiss(S.id,r),P)});return()=>{E.forEach(S=>S&&clearTimeout(S))}},[a,o,r]);let x=p.useCallback(Il(r),[r]),h=p.useCallback(()=>{x({type:5,time:Date.now()})},[x]),f=p.useCallback((N,E)=>{x({type:1,toast:{id:N,height:E}})},[x]),g=p.useCallback(()=>{o&&x({type:6,time:Date.now()})},[o,x]),y=p.useCallback((N,E)=>{let{reverseOrder:S=!1,gutter:P=8,defaultPosition:M}=E||{},k=a.filter(z=>(z.position||M)===(N.position||M)&&z.height),j=k.findIndex(z=>z.id===N.id),v=k.filter((z,C)=>C<j&&z.visible).length;return k.filter(z=>z.visible).slice(...S?[v+1]:[0,v]).reduce((z,C)=>z+(C.height||0)+P,0)},[a]);return p.useEffect(()=>{a.forEach(N=>{if(N.dismissed)u(N.id,N.removeDelay);else{let E=c.get(N.id);E&&(clearTimeout(E),c.delete(N.id))}})},[a,u]),{toasts:a,handlers:{updateHeight:f,startPause:h,endPause:g,calculateOffset:y}}},I1=un`
|
|
68
|
+
from {
|
|
69
|
+
transform: scale(0) rotate(45deg);
|
|
70
|
+
opacity: 0;
|
|
71
|
+
}
|
|
72
|
+
to {
|
|
73
|
+
transform: scale(1) rotate(45deg);
|
|
74
|
+
opacity: 1;
|
|
75
|
+
}`,D1=un`
|
|
76
|
+
from {
|
|
77
|
+
transform: scale(0);
|
|
78
|
+
opacity: 0;
|
|
79
|
+
}
|
|
80
|
+
to {
|
|
81
|
+
transform: scale(1);
|
|
82
|
+
opacity: 1;
|
|
83
|
+
}`,F1=un`
|
|
84
|
+
from {
|
|
85
|
+
transform: scale(0) rotate(90deg);
|
|
86
|
+
opacity: 0;
|
|
87
|
+
}
|
|
88
|
+
to {
|
|
89
|
+
transform: scale(1) rotate(90deg);
|
|
90
|
+
opacity: 1;
|
|
91
|
+
}`,L1=Wn("div")`
|
|
92
|
+
width: 20px;
|
|
93
|
+
opacity: 0;
|
|
94
|
+
height: 20px;
|
|
95
|
+
border-radius: 10px;
|
|
96
|
+
background: ${s=>s.primary||"#ff4b4b"};
|
|
97
|
+
position: relative;
|
|
98
|
+
transform: rotate(45deg);
|
|
99
|
+
|
|
100
|
+
animation: ${I1} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
101
|
+
forwards;
|
|
102
|
+
animation-delay: 100ms;
|
|
103
|
+
|
|
104
|
+
&:after,
|
|
105
|
+
&:before {
|
|
106
|
+
content: '';
|
|
107
|
+
animation: ${D1} 0.15s ease-out forwards;
|
|
108
|
+
animation-delay: 150ms;
|
|
109
|
+
position: absolute;
|
|
110
|
+
border-radius: 3px;
|
|
111
|
+
opacity: 0;
|
|
112
|
+
background: ${s=>s.secondary||"#fff"};
|
|
113
|
+
bottom: 9px;
|
|
114
|
+
left: 4px;
|
|
115
|
+
height: 2px;
|
|
116
|
+
width: 12px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&:before {
|
|
120
|
+
animation: ${F1} 0.15s ease-out forwards;
|
|
121
|
+
animation-delay: 180ms;
|
|
122
|
+
transform: rotate(90deg);
|
|
123
|
+
}
|
|
124
|
+
`,_1=un`
|
|
125
|
+
from {
|
|
126
|
+
transform: rotate(0deg);
|
|
127
|
+
}
|
|
128
|
+
to {
|
|
129
|
+
transform: rotate(360deg);
|
|
130
|
+
}
|
|
131
|
+
`,U1=Wn("div")`
|
|
132
|
+
width: 12px;
|
|
133
|
+
height: 12px;
|
|
134
|
+
box-sizing: border-box;
|
|
135
|
+
border: 2px solid;
|
|
136
|
+
border-radius: 100%;
|
|
137
|
+
border-color: ${s=>s.secondary||"#e0e0e0"};
|
|
138
|
+
border-right-color: ${s=>s.primary||"#616161"};
|
|
139
|
+
animation: ${_1} 1s linear infinite;
|
|
140
|
+
`,$1=un`
|
|
141
|
+
from {
|
|
142
|
+
transform: scale(0) rotate(45deg);
|
|
143
|
+
opacity: 0;
|
|
144
|
+
}
|
|
145
|
+
to {
|
|
146
|
+
transform: scale(1) rotate(45deg);
|
|
147
|
+
opacity: 1;
|
|
148
|
+
}`,B1=un`
|
|
149
|
+
0% {
|
|
150
|
+
height: 0;
|
|
151
|
+
width: 0;
|
|
152
|
+
opacity: 0;
|
|
153
|
+
}
|
|
154
|
+
40% {
|
|
155
|
+
height: 0;
|
|
156
|
+
width: 6px;
|
|
157
|
+
opacity: 1;
|
|
158
|
+
}
|
|
159
|
+
100% {
|
|
160
|
+
opacity: 1;
|
|
161
|
+
height: 10px;
|
|
162
|
+
}`,q1=Wn("div")`
|
|
163
|
+
width: 20px;
|
|
164
|
+
opacity: 0;
|
|
165
|
+
height: 20px;
|
|
166
|
+
border-radius: 10px;
|
|
167
|
+
background: ${s=>s.primary||"#61d345"};
|
|
168
|
+
position: relative;
|
|
169
|
+
transform: rotate(45deg);
|
|
170
|
+
|
|
171
|
+
animation: ${$1} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
172
|
+
forwards;
|
|
173
|
+
animation-delay: 100ms;
|
|
174
|
+
&:after {
|
|
175
|
+
content: '';
|
|
176
|
+
box-sizing: border-box;
|
|
177
|
+
animation: ${B1} 0.2s ease-out forwards;
|
|
178
|
+
opacity: 0;
|
|
179
|
+
animation-delay: 200ms;
|
|
180
|
+
position: absolute;
|
|
181
|
+
border-right: 2px solid;
|
|
182
|
+
border-bottom: 2px solid;
|
|
183
|
+
border-color: ${s=>s.secondary||"#fff"};
|
|
184
|
+
bottom: 6px;
|
|
185
|
+
left: 6px;
|
|
186
|
+
height: 10px;
|
|
187
|
+
width: 6px;
|
|
188
|
+
}
|
|
189
|
+
`,H1=Wn("div")`
|
|
190
|
+
position: absolute;
|
|
191
|
+
`,K1=Wn("div")`
|
|
192
|
+
position: relative;
|
|
193
|
+
display: flex;
|
|
194
|
+
justify-content: center;
|
|
195
|
+
align-items: center;
|
|
196
|
+
min-width: 20px;
|
|
197
|
+
min-height: 20px;
|
|
198
|
+
`,V1=un`
|
|
199
|
+
from {
|
|
200
|
+
transform: scale(0.6);
|
|
201
|
+
opacity: 0.4;
|
|
202
|
+
}
|
|
203
|
+
to {
|
|
204
|
+
transform: scale(1);
|
|
205
|
+
opacity: 1;
|
|
206
|
+
}`,W1=Wn("div")`
|
|
207
|
+
position: relative;
|
|
208
|
+
transform: scale(0.6);
|
|
209
|
+
opacity: 0.4;
|
|
210
|
+
min-width: 20px;
|
|
211
|
+
animation: ${V1} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
212
|
+
forwards;
|
|
213
|
+
`,G1=({toast:s})=>{let{icon:r,type:a,iconTheme:o}=s;return r!==void 0?typeof r=="string"?p.createElement(W1,null,r):r:a==="blank"?null:p.createElement(K1,null,p.createElement(U1,{...o}),a!=="loading"&&p.createElement(H1,null,a==="error"?p.createElement(L1,{...o}):p.createElement(q1,{...o})))},Q1=s=>`
|
|
214
|
+
0% {transform: translate3d(0,${s*-200}%,0) scale(.6); opacity:.5;}
|
|
215
|
+
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
|
|
216
|
+
`,J1=s=>`
|
|
217
|
+
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
|
|
218
|
+
100% {transform: translate3d(0,${s*-150}%,-1px) scale(.6); opacity:0;}
|
|
219
|
+
`,Y1="0%{opacity:0;} 100%{opacity:1;}",X1="0%{opacity:1;} 100%{opacity:0;}",Z1=Wn("div")`
|
|
220
|
+
display: flex;
|
|
221
|
+
align-items: center;
|
|
222
|
+
background: #fff;
|
|
223
|
+
color: #363636;
|
|
224
|
+
line-height: 1.3;
|
|
225
|
+
will-change: transform;
|
|
226
|
+
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
|
|
227
|
+
max-width: 350px;
|
|
228
|
+
pointer-events: auto;
|
|
229
|
+
padding: 8px 10px;
|
|
230
|
+
border-radius: 8px;
|
|
231
|
+
`,ev=Wn("div")`
|
|
232
|
+
display: flex;
|
|
233
|
+
justify-content: center;
|
|
234
|
+
margin: 4px 10px;
|
|
235
|
+
color: inherit;
|
|
236
|
+
flex: 1 1 auto;
|
|
237
|
+
white-space: pre-line;
|
|
238
|
+
`,tv=(s,r)=>{let a=s.includes("top")?1:-1,[o,c]=gf()?[Y1,X1]:[Q1(a),J1(a)];return{animation:r?`${un(o)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${un(c)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},sv=p.memo(({toast:s,position:r,style:a,children:o})=>{let c=s.height?tv(s.position||r||"top-center",s.visible):{opacity:0},u=p.createElement(G1,{toast:s}),x=p.createElement(ev,{...s.ariaProps},gl(s.message,s));return p.createElement(Z1,{className:s.className,style:{...c,...a,...s.style}},typeof o=="function"?o({icon:u,message:x}):p.createElement(p.Fragment,null,u,x))});S1(p.createElement);var nv=({id:s,className:r,style:a,onHeightUpdate:o,children:c})=>{let u=p.useCallback(x=>{if(x){let h=()=>{let f=x.getBoundingClientRect().height;o(s,f)};h(),new MutationObserver(h).observe(x,{subtree:!0,childList:!0,characterData:!0})}},[s,o]);return p.createElement("div",{ref:u,className:r,style:a},c)},rv=(s,r)=>{let a=s.includes("top"),o=a?{top:0}:{bottom:0},c=s.includes("center")?{justifyContent:"center"}:s.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:gf()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${r*(a?1:-1)}px)`,...o,...c}},av=Ol`
|
|
239
|
+
z-index: 9999;
|
|
240
|
+
> * {
|
|
241
|
+
pointer-events: auto;
|
|
242
|
+
}
|
|
243
|
+
`,el=16,iv=({reverseOrder:s,position:r="top-center",toastOptions:a,gutter:o,children:c,toasterId:u,containerStyle:x,containerClassName:h})=>{let{toasts:f,handlers:g}=O1(a,u);return p.createElement("div",{"data-rht-toaster":u||"",style:{position:"fixed",zIndex:9999,top:el,left:el,right:el,bottom:el,pointerEvents:"none",...x},className:h,onMouseEnter:g.startPause,onMouseLeave:g.endPause},f.map(y=>{let N=y.position||r,E=g.calculateOffset(y,{reverseOrder:s,gutter:o,defaultPosition:r}),S=rv(N,E);return p.createElement(nv,{id:y.id,key:y.id,onHeightUpdate:g.updateHeight,className:y.visible?av:"",style:S},y.type==="custom"?gl(y.message,y):c?c(y):p.createElement(sv,{toast:y,position:N}))}))},$=gt;/**
|
|
244
|
+
* @license lucide-react v0.451.0 - ISC
|
|
245
|
+
*
|
|
246
|
+
* This source code is licensed under the ISC license.
|
|
247
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
248
|
+
*/const ov=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Nf=(...s)=>s.filter((r,a,o)=>!!r&&o.indexOf(r)===a).join(" ");/**
|
|
249
|
+
* @license lucide-react v0.451.0 - ISC
|
|
250
|
+
*
|
|
251
|
+
* This source code is licensed under the ISC license.
|
|
252
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
253
|
+
*/var lv={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
254
|
+
* @license lucide-react v0.451.0 - ISC
|
|
255
|
+
*
|
|
256
|
+
* This source code is licensed under the ISC license.
|
|
257
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
258
|
+
*/const cv=p.forwardRef(({color:s="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:c="",children:u,iconNode:x,...h},f)=>p.createElement("svg",{ref:f,...lv,width:r,height:r,stroke:s,strokeWidth:o?Number(a)*24/Number(r):a,className:Nf("lucide",c),...h},[...x.map(([g,y])=>p.createElement(g,y)),...Array.isArray(u)?u:[u]]));/**
|
|
259
|
+
* @license lucide-react v0.451.0 - ISC
|
|
260
|
+
*
|
|
261
|
+
* This source code is licensed under the ISC license.
|
|
262
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
263
|
+
*/const V=(s,r)=>{const a=p.forwardRef(({className:o,...c},u)=>p.createElement(cv,{ref:u,iconNode:r,className:Nf(`lucide-${ov(s)}`,o),...c}));return a.displayName=`${s}`,a};/**
|
|
264
|
+
* @license lucide-react v0.451.0 - ISC
|
|
265
|
+
*
|
|
266
|
+
* This source code is licensed under the ISC license.
|
|
267
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
268
|
+
*/const Nu=V("Accessibility",[["circle",{cx:"16",cy:"4",r:"1",key:"1grugj"}],["path",{d:"m18 19 1-7-6 1",key:"r0i19z"}],["path",{d:"m5 8 3-3 5.5 3-2.36 3.5",key:"9ptxx2"}],["path",{d:"M4.24 14.5a5 5 0 0 0 6.88 6",key:"10kmtu"}],["path",{d:"M13.76 17.5a5 5 0 0 0-6.88-6",key:"2qq6rc"}]]);/**
|
|
269
|
+
* @license lucide-react v0.451.0 - ISC
|
|
270
|
+
*
|
|
271
|
+
* This source code is licensed under the ISC license.
|
|
272
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
273
|
+
*/const dv=V("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
274
|
+
* @license lucide-react v0.451.0 - ISC
|
|
275
|
+
*
|
|
276
|
+
* This source code is licensed under the ISC license.
|
|
277
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
278
|
+
*/const wf=V("ArrowDownToLine",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]);/**
|
|
279
|
+
* @license lucide-react v0.451.0 - ISC
|
|
280
|
+
*
|
|
281
|
+
* This source code is licensed under the ISC license.
|
|
282
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
283
|
+
*/const fr=V("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
284
|
+
* @license lucide-react v0.451.0 - ISC
|
|
285
|
+
*
|
|
286
|
+
* This source code is licensed under the ISC license.
|
|
287
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
288
|
+
*/const kf=V("ArrowUpFromLine",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/**
|
|
289
|
+
* @license lucide-react v0.451.0 - ISC
|
|
290
|
+
*
|
|
291
|
+
* This source code is licensed under the ISC license.
|
|
292
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
293
|
+
*/const uv=V("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
|
|
294
|
+
* @license lucide-react v0.451.0 - ISC
|
|
295
|
+
*
|
|
296
|
+
* This source code is licensed under the ISC license.
|
|
297
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
298
|
+
*/const xv=V("Banknote",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M6 12h.01M18 12h.01",key:"113zkx"}]]);/**
|
|
299
|
+
* @license lucide-react v0.451.0 - ISC
|
|
300
|
+
*
|
|
301
|
+
* This source code is licensed under the ISC license.
|
|
302
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
303
|
+
*/const yl=V("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
|
|
304
|
+
* @license lucide-react v0.451.0 - ISC
|
|
305
|
+
*
|
|
306
|
+
* This source code is licensed under the ISC license.
|
|
307
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
308
|
+
*/const mv=V("Binary",[["rect",{x:"14",y:"14",width:"4",height:"6",rx:"2",key:"p02svl"}],["rect",{x:"6",y:"4",width:"4",height:"6",rx:"2",key:"xm4xkj"}],["path",{d:"M6 20h4",key:"1i6q5t"}],["path",{d:"M14 10h4",key:"ru81e7"}],["path",{d:"M6 14h2v6",key:"16z9wg"}],["path",{d:"M14 4h2v6",key:"1idq9u"}]]);/**
|
|
309
|
+
* @license lucide-react v0.451.0 - ISC
|
|
310
|
+
*
|
|
311
|
+
* This source code is licensed under the ISC license.
|
|
312
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
313
|
+
*/const Ri=V("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
|
|
314
|
+
* @license lucide-react v0.451.0 - ISC
|
|
315
|
+
*
|
|
316
|
+
* This source code is licensed under the ISC license.
|
|
317
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
318
|
+
*/const hv=V("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
319
|
+
* @license lucide-react v0.451.0 - ISC
|
|
320
|
+
*
|
|
321
|
+
* This source code is licensed under the ISC license.
|
|
322
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
323
|
+
*/const pv=V("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);/**
|
|
324
|
+
* @license lucide-react v0.451.0 - ISC
|
|
325
|
+
*
|
|
326
|
+
* This source code is licensed under the ISC license.
|
|
327
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
328
|
+
*/const fv=V("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
|
|
329
|
+
* @license lucide-react v0.451.0 - ISC
|
|
330
|
+
*
|
|
331
|
+
* This source code is licensed under the ISC license.
|
|
332
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
333
|
+
*/const gv=V("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
|
|
334
|
+
* @license lucide-react v0.451.0 - ISC
|
|
335
|
+
*
|
|
336
|
+
* This source code is licensed under the ISC license.
|
|
337
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
338
|
+
*/const yv=V("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
|
339
|
+
* @license lucide-react v0.451.0 - ISC
|
|
340
|
+
*
|
|
341
|
+
* This source code is licensed under the ISC license.
|
|
342
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
343
|
+
*/const Un=V("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/**
|
|
344
|
+
* @license lucide-react v0.451.0 - ISC
|
|
345
|
+
*
|
|
346
|
+
* This source code is licensed under the ISC license.
|
|
347
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
348
|
+
*/const bv=V("Car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);/**
|
|
349
|
+
* @license lucide-react v0.451.0 - ISC
|
|
350
|
+
*
|
|
351
|
+
* This source code is licensed under the ISC license.
|
|
352
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
353
|
+
*/const vv=V("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
|
|
354
|
+
* @license lucide-react v0.451.0 - ISC
|
|
355
|
+
*
|
|
356
|
+
* This source code is licensed under the ISC license.
|
|
357
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
358
|
+
*/const Ts=V("ChartNoAxesColumn",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]]);/**
|
|
359
|
+
* @license lucide-react v0.451.0 - ISC
|
|
360
|
+
*
|
|
361
|
+
* This source code is licensed under the ISC license.
|
|
362
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
363
|
+
*/const Sf=V("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);/**
|
|
364
|
+
* @license lucide-react v0.451.0 - ISC
|
|
365
|
+
*
|
|
366
|
+
* This source code is licensed under the ISC license.
|
|
367
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
368
|
+
*/const et=V("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
369
|
+
* @license lucide-react v0.451.0 - ISC
|
|
370
|
+
*
|
|
371
|
+
* This source code is licensed under the ISC license.
|
|
372
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
373
|
+
*/const kt=V("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
374
|
+
* @license lucide-react v0.451.0 - ISC
|
|
375
|
+
*
|
|
376
|
+
* This source code is licensed under the ISC license.
|
|
377
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
378
|
+
*/const jv=V("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
379
|
+
* @license lucide-react v0.451.0 - ISC
|
|
380
|
+
*
|
|
381
|
+
* This source code is licensed under the ISC license.
|
|
382
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
383
|
+
*/const Zt=V("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
384
|
+
* @license lucide-react v0.451.0 - ISC
|
|
385
|
+
*
|
|
386
|
+
* This source code is licensed under the ISC license.
|
|
387
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
388
|
+
*/const Nv=V("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
389
|
+
* @license lucide-react v0.451.0 - ISC
|
|
390
|
+
*
|
|
391
|
+
* This source code is licensed under the ISC license.
|
|
392
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
393
|
+
*/const He=V("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
394
|
+
* @license lucide-react v0.451.0 - ISC
|
|
395
|
+
*
|
|
396
|
+
* This source code is licensed under the ISC license.
|
|
397
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
398
|
+
*/const wv=V("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]]);/**
|
|
399
|
+
* @license lucide-react v0.451.0 - ISC
|
|
400
|
+
*
|
|
401
|
+
* This source code is licensed under the ISC license.
|
|
402
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
403
|
+
*/const kv=V("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
|
|
404
|
+
* @license lucide-react v0.451.0 - ISC
|
|
405
|
+
*
|
|
406
|
+
* This source code is licensed under the ISC license.
|
|
407
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
408
|
+
*/const Sv=V("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);/**
|
|
409
|
+
* @license lucide-react v0.451.0 - ISC
|
|
410
|
+
*
|
|
411
|
+
* This source code is licensed under the ISC license.
|
|
412
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
413
|
+
*/const St=V("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
414
|
+
* @license lucide-react v0.451.0 - ISC
|
|
415
|
+
*
|
|
416
|
+
* This source code is licensed under the ISC license.
|
|
417
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
418
|
+
*/const Cf=V("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
419
|
+
* @license lucide-react v0.451.0 - ISC
|
|
420
|
+
*
|
|
421
|
+
* This source code is licensed under the ISC license.
|
|
422
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
423
|
+
*/const Cr=V("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
424
|
+
* @license lucide-react v0.451.0 - ISC
|
|
425
|
+
*
|
|
426
|
+
* This source code is licensed under the ISC license.
|
|
427
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
428
|
+
*/const Od=V("CloudDownload",[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]]);/**
|
|
429
|
+
* @license lucide-react v0.451.0 - ISC
|
|
430
|
+
*
|
|
431
|
+
* This source code is licensed under the ISC license.
|
|
432
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
433
|
+
*/const Vu=V("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
|
|
434
|
+
* @license lucide-react v0.451.0 - ISC
|
|
435
|
+
*
|
|
436
|
+
* This source code is licensed under the ISC license.
|
|
437
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
438
|
+
*/const Wu=V("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
439
|
+
* @license lucide-react v0.451.0 - ISC
|
|
440
|
+
*
|
|
441
|
+
* This source code is licensed under the ISC license.
|
|
442
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
443
|
+
*/const Cv=V("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
|
|
444
|
+
* @license lucide-react v0.451.0 - ISC
|
|
445
|
+
*
|
|
446
|
+
* This source code is licensed under the ISC license.
|
|
447
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
448
|
+
*/const Ef=V("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
449
|
+
* @license lucide-react v0.451.0 - ISC
|
|
450
|
+
*
|
|
451
|
+
* This source code is licensed under the ISC license.
|
|
452
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
453
|
+
*/const fa=V("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
454
|
+
* @license lucide-react v0.451.0 - ISC
|
|
455
|
+
*
|
|
456
|
+
* This source code is licensed under the ISC license.
|
|
457
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
458
|
+
*/const Na=V("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
459
|
+
* @license lucide-react v0.451.0 - ISC
|
|
460
|
+
*
|
|
461
|
+
* This source code is licensed under the ISC license.
|
|
462
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
463
|
+
*/const Pf=V("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
464
|
+
* @license lucide-react v0.451.0 - ISC
|
|
465
|
+
*
|
|
466
|
+
* This source code is licensed under the ISC license.
|
|
467
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
468
|
+
*/const wa=V("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
469
|
+
* @license lucide-react v0.451.0 - ISC
|
|
470
|
+
*
|
|
471
|
+
* This source code is licensed under the ISC license.
|
|
472
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
473
|
+
*/const Rf=V("FileArchive",[["path",{d:"M10 12v-1",key:"v7bkov"}],["path",{d:"M10 18v-2",key:"1cjy8d"}],["path",{d:"M10 7V6",key:"dljcrl"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01",key:"gkbcor"}],["circle",{cx:"10",cy:"20",r:"2",key:"1xzdoj"}]]);/**
|
|
474
|
+
* @license lucide-react v0.451.0 - ISC
|
|
475
|
+
*
|
|
476
|
+
* This source code is licensed under the ISC license.
|
|
477
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
478
|
+
*/const Mf=V("FileMinus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}]]);/**
|
|
479
|
+
* @license lucide-react v0.451.0 - ISC
|
|
480
|
+
*
|
|
481
|
+
* This source code is licensed under the ISC license.
|
|
482
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
483
|
+
*/const Tf=V("FilePen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]]);/**
|
|
484
|
+
* @license lucide-react v0.451.0 - ISC
|
|
485
|
+
*
|
|
486
|
+
* This source code is licensed under the ISC license.
|
|
487
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
488
|
+
*/const zf=V("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/**
|
|
489
|
+
* @license lucide-react v0.451.0 - ISC
|
|
490
|
+
*
|
|
491
|
+
* This source code is licensed under the ISC license.
|
|
492
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
493
|
+
*/const Af=V("FileQuestion",[["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);/**
|
|
494
|
+
* @license lucide-react v0.451.0 - ISC
|
|
495
|
+
*
|
|
496
|
+
* This source code is licensed under the ISC license.
|
|
497
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
498
|
+
*/const Hs=V("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
499
|
+
* @license lucide-react v0.451.0 - ISC
|
|
500
|
+
*
|
|
501
|
+
* This source code is licensed under the ISC license.
|
|
502
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
503
|
+
*/const Of=V("FileWarning",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
504
|
+
* @license lucide-react v0.451.0 - ISC
|
|
505
|
+
*
|
|
506
|
+
* This source code is licensed under the ISC license.
|
|
507
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
508
|
+
*/const Ev=V("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
|
|
509
|
+
* @license lucide-react v0.451.0 - ISC
|
|
510
|
+
*
|
|
511
|
+
* This source code is licensed under the ISC license.
|
|
512
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
513
|
+
*/const If=V("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
514
|
+
* @license lucide-react v0.451.0 - ISC
|
|
515
|
+
*
|
|
516
|
+
* This source code is licensed under the ISC license.
|
|
517
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
518
|
+
*/const Mi=V("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/**
|
|
519
|
+
* @license lucide-react v0.451.0 - ISC
|
|
520
|
+
*
|
|
521
|
+
* This source code is licensed under the ISC license.
|
|
522
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
523
|
+
*/const Df=V("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
524
|
+
* @license lucide-react v0.451.0 - ISC
|
|
525
|
+
*
|
|
526
|
+
* This source code is licensed under the ISC license.
|
|
527
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
528
|
+
*/const Pv=V("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
529
|
+
* @license lucide-react v0.451.0 - ISC
|
|
530
|
+
*
|
|
531
|
+
* This source code is licensed under the ISC license.
|
|
532
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
533
|
+
*/const $n=V("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
534
|
+
* @license lucide-react v0.451.0 - ISC
|
|
535
|
+
*
|
|
536
|
+
* This source code is licensed under the ISC license.
|
|
537
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
538
|
+
*/const yr=V("GitCommitHorizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);/**
|
|
539
|
+
* @license lucide-react v0.451.0 - ISC
|
|
540
|
+
*
|
|
541
|
+
* This source code is licensed under the ISC license.
|
|
542
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
543
|
+
*/const Ff=V("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);/**
|
|
544
|
+
* @license lucide-react v0.451.0 - ISC
|
|
545
|
+
*
|
|
546
|
+
* This source code is licensed under the ISC license.
|
|
547
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
548
|
+
*/const xn=V("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
549
|
+
* @license lucide-react v0.451.0 - ISC
|
|
550
|
+
*
|
|
551
|
+
* This source code is licensed under the ISC license.
|
|
552
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
553
|
+
*/const Rv=V("GripHorizontal",[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]);/**
|
|
554
|
+
* @license lucide-react v0.451.0 - ISC
|
|
555
|
+
*
|
|
556
|
+
* This source code is licensed under the ISC license.
|
|
557
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
558
|
+
*/const Dl=V("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
|
|
559
|
+
* @license lucide-react v0.451.0 - ISC
|
|
560
|
+
*
|
|
561
|
+
* This source code is licensed under the ISC license.
|
|
562
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
563
|
+
*/const Mv=V("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
|
|
564
|
+
* @license lucide-react v0.451.0 - ISC
|
|
565
|
+
*
|
|
566
|
+
* This source code is licensed under the ISC license.
|
|
567
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
568
|
+
*/const Gu=V("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/**
|
|
569
|
+
* @license lucide-react v0.451.0 - ISC
|
|
570
|
+
*
|
|
571
|
+
* This source code is licensed under the ISC license.
|
|
572
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
573
|
+
*/const bl=V("HeartPulse",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"1uw2ng"}]]);/**
|
|
574
|
+
* @license lucide-react v0.451.0 - ISC
|
|
575
|
+
*
|
|
576
|
+
* This source code is licensed under the ISC license.
|
|
577
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
578
|
+
*/const Qu=V("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
|
|
579
|
+
* @license lucide-react v0.451.0 - ISC
|
|
580
|
+
*
|
|
581
|
+
* This source code is licensed under the ISC license.
|
|
582
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
583
|
+
*/const mp=V("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
584
|
+
* @license lucide-react v0.451.0 - ISC
|
|
585
|
+
*
|
|
586
|
+
* This source code is licensed under the ISC license.
|
|
587
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
588
|
+
*/const Lf=V("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
|
589
|
+
* @license lucide-react v0.451.0 - ISC
|
|
590
|
+
*
|
|
591
|
+
* This source code is licensed under the ISC license.
|
|
592
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
593
|
+
*/const hp=V("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
|
|
594
|
+
* @license lucide-react v0.451.0 - ISC
|
|
595
|
+
*
|
|
596
|
+
* This source code is licensed under the ISC license.
|
|
597
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
598
|
+
*/const Er=V("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
|
|
599
|
+
* @license lucide-react v0.451.0 - ISC
|
|
600
|
+
*
|
|
601
|
+
* This source code is licensed under the ISC license.
|
|
602
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
603
|
+
*/const Tv=V("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
|
|
604
|
+
* @license lucide-react v0.451.0 - ISC
|
|
605
|
+
*
|
|
606
|
+
* This source code is licensed under the ISC license.
|
|
607
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
608
|
+
*/const zv=V("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
|
|
609
|
+
* @license lucide-react v0.451.0 - ISC
|
|
610
|
+
*
|
|
611
|
+
* This source code is licensed under the ISC license.
|
|
612
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
613
|
+
*/const vl=V("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
|
|
614
|
+
* @license lucide-react v0.451.0 - ISC
|
|
615
|
+
*
|
|
616
|
+
* This source code is licensed under the ISC license.
|
|
617
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
618
|
+
*/const Av=V("ListOrdered",[["line",{x1:"10",x2:"21",y1:"6",y2:"6",key:"76qw6h"}],["line",{x1:"10",x2:"21",y1:"12",y2:"12",key:"16nom4"}],["line",{x1:"10",x2:"21",y1:"18",y2:"18",key:"u3jurt"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
|
|
619
|
+
* @license lucide-react v0.451.0 - ISC
|
|
620
|
+
*
|
|
621
|
+
* This source code is licensed under the ISC license.
|
|
622
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
623
|
+
*/const Me=V("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
624
|
+
* @license lucide-react v0.451.0 - ISC
|
|
625
|
+
*
|
|
626
|
+
* This source code is licensed under the ISC license.
|
|
627
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
628
|
+
*/const Id=V("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
629
|
+
* @license lucide-react v0.451.0 - ISC
|
|
630
|
+
*
|
|
631
|
+
* This source code is licensed under the ISC license.
|
|
632
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
633
|
+
*/const Ov=V("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
|
|
634
|
+
* @license lucide-react v0.451.0 - ISC
|
|
635
|
+
*
|
|
636
|
+
* This source code is licensed under the ISC license.
|
|
637
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
638
|
+
*/const Iv=V("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
|
|
639
|
+
* @license lucide-react v0.451.0 - ISC
|
|
640
|
+
*
|
|
641
|
+
* This source code is licensed under the ISC license.
|
|
642
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
643
|
+
*/const Ju=V("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
644
|
+
* @license lucide-react v0.451.0 - ISC
|
|
645
|
+
*
|
|
646
|
+
* This source code is licensed under the ISC license.
|
|
647
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
648
|
+
*/const Dv=V("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
649
|
+
* @license lucide-react v0.451.0 - ISC
|
|
650
|
+
*
|
|
651
|
+
* This source code is licensed under the ISC license.
|
|
652
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
653
|
+
*/const pp=V("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
|
|
654
|
+
* @license lucide-react v0.451.0 - ISC
|
|
655
|
+
*
|
|
656
|
+
* This source code is licensed under the ISC license.
|
|
657
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
658
|
+
*/const Fv=V("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
659
|
+
* @license lucide-react v0.451.0 - ISC
|
|
660
|
+
*
|
|
661
|
+
* This source code is licensed under the ISC license.
|
|
662
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
663
|
+
*/const _f=V("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
664
|
+
* @license lucide-react v0.451.0 - ISC
|
|
665
|
+
*
|
|
666
|
+
* This source code is licensed under the ISC license.
|
|
667
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
668
|
+
*/const gr=V("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
669
|
+
* @license lucide-react v0.451.0 - ISC
|
|
670
|
+
*
|
|
671
|
+
* This source code is licensed under the ISC license.
|
|
672
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
673
|
+
*/const Lv=V("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
674
|
+
* @license lucide-react v0.451.0 - ISC
|
|
675
|
+
*
|
|
676
|
+
* This source code is licensed under the ISC license.
|
|
677
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
678
|
+
*/const _v=V("MoveRight",[["path",{d:"M18 8L22 12L18 16",key:"1r0oui"}],["path",{d:"M2 12H22",key:"1m8cig"}]]);/**
|
|
679
|
+
* @license lucide-react v0.451.0 - ISC
|
|
680
|
+
*
|
|
681
|
+
* This source code is licensed under the ISC license.
|
|
682
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
683
|
+
*/const Uv=V("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/**
|
|
684
|
+
* @license lucide-react v0.451.0 - ISC
|
|
685
|
+
*
|
|
686
|
+
* This source code is licensed under the ISC license.
|
|
687
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
688
|
+
*/const fp=V("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
|
|
689
|
+
* @license lucide-react v0.451.0 - ISC
|
|
690
|
+
*
|
|
691
|
+
* This source code is licensed under the ISC license.
|
|
692
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
693
|
+
*/const Gn=V("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
694
|
+
* @license lucide-react v0.451.0 - ISC
|
|
695
|
+
*
|
|
696
|
+
* This source code is licensed under the ISC license.
|
|
697
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
698
|
+
*/const $v=V("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
|
|
699
|
+
* @license lucide-react v0.451.0 - ISC
|
|
700
|
+
*
|
|
701
|
+
* This source code is licensed under the ISC license.
|
|
702
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
703
|
+
*/const Xt=V("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
704
|
+
* @license lucide-react v0.451.0 - ISC
|
|
705
|
+
*
|
|
706
|
+
* This source code is licensed under the ISC license.
|
|
707
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
708
|
+
*/const Bv=V("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
|
|
709
|
+
* @license lucide-react v0.451.0 - ISC
|
|
710
|
+
*
|
|
711
|
+
* This source code is licensed under the ISC license.
|
|
712
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
713
|
+
*/const Ks=V("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
714
|
+
* @license lucide-react v0.451.0 - ISC
|
|
715
|
+
*
|
|
716
|
+
* This source code is licensed under the ISC license.
|
|
717
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
718
|
+
*/const Yu=V("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
719
|
+
* @license lucide-react v0.451.0 - ISC
|
|
720
|
+
*
|
|
721
|
+
* This source code is licensed under the ISC license.
|
|
722
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
723
|
+
*/const Fl=V("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/**
|
|
724
|
+
* @license lucide-react v0.451.0 - ISC
|
|
725
|
+
*
|
|
726
|
+
* This source code is licensed under the ISC license.
|
|
727
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
728
|
+
*/const _i=V("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
729
|
+
* @license lucide-react v0.451.0 - ISC
|
|
730
|
+
*
|
|
731
|
+
* This source code is licensed under the ISC license.
|
|
732
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
733
|
+
*/const ga=V("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
734
|
+
* @license lucide-react v0.451.0 - ISC
|
|
735
|
+
*
|
|
736
|
+
* This source code is licensed under the ISC license.
|
|
737
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
738
|
+
*/const Uf=V("ScanSearch",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);/**
|
|
739
|
+
* @license lucide-react v0.451.0 - ISC
|
|
740
|
+
*
|
|
741
|
+
* This source code is licensed under the ISC license.
|
|
742
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
743
|
+
*/const Bn=V("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
744
|
+
* @license lucide-react v0.451.0 - ISC
|
|
745
|
+
*
|
|
746
|
+
* This source code is licensed under the ISC license.
|
|
747
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
748
|
+
*/const qv=V("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
|
|
749
|
+
* @license lucide-react v0.451.0 - ISC
|
|
750
|
+
*
|
|
751
|
+
* This source code is licensed under the ISC license.
|
|
752
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
753
|
+
*/const Hv=V("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
|
|
754
|
+
* @license lucide-react v0.451.0 - ISC
|
|
755
|
+
*
|
|
756
|
+
* This source code is licensed under the ISC license.
|
|
757
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
758
|
+
*/const wr=V("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
|
|
759
|
+
* @license lucide-react v0.451.0 - ISC
|
|
760
|
+
*
|
|
761
|
+
* This source code is licensed under the ISC license.
|
|
762
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
763
|
+
*/const jl=V("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
764
|
+
* @license lucide-react v0.451.0 - ISC
|
|
765
|
+
*
|
|
766
|
+
* This source code is licensed under the ISC license.
|
|
767
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
768
|
+
*/const Kv=V("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
769
|
+
* @license lucide-react v0.451.0 - ISC
|
|
770
|
+
*
|
|
771
|
+
* This source code is licensed under the ISC license.
|
|
772
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
773
|
+
*/const Xu=V("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
774
|
+
* @license lucide-react v0.451.0 - ISC
|
|
775
|
+
*
|
|
776
|
+
* This source code is licensed under the ISC license.
|
|
777
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
778
|
+
*/const Vv=V("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);/**
|
|
779
|
+
* @license lucide-react v0.451.0 - ISC
|
|
780
|
+
*
|
|
781
|
+
* This source code is licensed under the ISC license.
|
|
782
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
783
|
+
*/const Wv=V("SkipBack",[["polygon",{points:"19 20 9 12 19 4 19 20",key:"o2sva"}],["line",{x1:"5",x2:"5",y1:"19",y2:"5",key:"1ocqjk"}]]);/**
|
|
784
|
+
* @license lucide-react v0.451.0 - ISC
|
|
785
|
+
*
|
|
786
|
+
* This source code is licensed under the ISC license.
|
|
787
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
788
|
+
*/const Ll=V("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/**
|
|
789
|
+
* @license lucide-react v0.451.0 - ISC
|
|
790
|
+
*
|
|
791
|
+
* This source code is licensed under the ISC license.
|
|
792
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
793
|
+
*/const Gv=V("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
|
|
794
|
+
* @license lucide-react v0.451.0 - ISC
|
|
795
|
+
*
|
|
796
|
+
* This source code is licensed under the ISC license.
|
|
797
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
798
|
+
*/const vi=V("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
|
|
799
|
+
* @license lucide-react v0.451.0 - ISC
|
|
800
|
+
*
|
|
801
|
+
* This source code is licensed under the ISC license.
|
|
802
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
803
|
+
*/const Bt=V("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
|
804
|
+
* @license lucide-react v0.451.0 - ISC
|
|
805
|
+
*
|
|
806
|
+
* This source code is licensed under the ISC license.
|
|
807
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
808
|
+
*/const Qv=V("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
809
|
+
* @license lucide-react v0.451.0 - ISC
|
|
810
|
+
*
|
|
811
|
+
* This source code is licensed under the ISC license.
|
|
812
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
813
|
+
*/const $f=V("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
814
|
+
* @license lucide-react v0.451.0 - ISC
|
|
815
|
+
*
|
|
816
|
+
* This source code is licensed under the ISC license.
|
|
817
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
818
|
+
*/const Jv=V("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
819
|
+
* @license lucide-react v0.451.0 - ISC
|
|
820
|
+
*
|
|
821
|
+
* This source code is licensed under the ISC license.
|
|
822
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
823
|
+
*/const ul=V("Tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);/**
|
|
824
|
+
* @license lucide-react v0.451.0 - ISC
|
|
825
|
+
*
|
|
826
|
+
* This source code is licensed under the ISC license.
|
|
827
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
828
|
+
*/const Bf=V("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
|
|
829
|
+
* @license lucide-react v0.451.0 - ISC
|
|
830
|
+
*
|
|
831
|
+
* This source code is licensed under the ISC license.
|
|
832
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
833
|
+
*/const _l=V("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
834
|
+
* @license lucide-react v0.451.0 - ISC
|
|
835
|
+
*
|
|
836
|
+
* This source code is licensed under the ISC license.
|
|
837
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
838
|
+
*/const gp=V("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
|
|
839
|
+
* @license lucide-react v0.451.0 - ISC
|
|
840
|
+
*
|
|
841
|
+
* This source code is licensed under the ISC license.
|
|
842
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
843
|
+
*/const Yv=V("ToggleLeft",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"8",cy:"12",r:"2",key:"1nvbw3"}]]);/**
|
|
844
|
+
* @license lucide-react v0.451.0 - ISC
|
|
845
|
+
*
|
|
846
|
+
* This source code is licensed under the ISC license.
|
|
847
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
848
|
+
*/const es=V("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
849
|
+
* @license lucide-react v0.451.0 - ISC
|
|
850
|
+
*
|
|
851
|
+
* This source code is licensed under the ISC license.
|
|
852
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
853
|
+
*/const Xv=V("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/**
|
|
854
|
+
* @license lucide-react v0.451.0 - ISC
|
|
855
|
+
*
|
|
856
|
+
* This source code is licensed under the ISC license.
|
|
857
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
858
|
+
*/const Zv=V("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
|
|
859
|
+
* @license lucide-react v0.451.0 - ISC
|
|
860
|
+
*
|
|
861
|
+
* This source code is licensed under the ISC license.
|
|
862
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
863
|
+
*/const gs=V("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
864
|
+
* @license lucide-react v0.451.0 - ISC
|
|
865
|
+
*
|
|
866
|
+
* This source code is licensed under the ISC license.
|
|
867
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
868
|
+
*/const ej=V("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
|
|
869
|
+
* @license lucide-react v0.451.0 - ISC
|
|
870
|
+
*
|
|
871
|
+
* This source code is licensed under the ISC license.
|
|
872
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
873
|
+
*/const Ul=V("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
874
|
+
* @license lucide-react v0.451.0 - ISC
|
|
875
|
+
*
|
|
876
|
+
* This source code is licensed under the ISC license.
|
|
877
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
878
|
+
*/const Zu=V("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
|
|
879
|
+
* @license lucide-react v0.451.0 - ISC
|
|
880
|
+
*
|
|
881
|
+
* This source code is licensed under the ISC license.
|
|
882
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
883
|
+
*/const $l=V("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
|
|
884
|
+
* @license lucide-react v0.451.0 - ISC
|
|
885
|
+
*
|
|
886
|
+
* This source code is licensed under the ISC license.
|
|
887
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
888
|
+
*/const kr=V("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
|
|
889
|
+
* @license lucide-react v0.451.0 - ISC
|
|
890
|
+
*
|
|
891
|
+
* This source code is licensed under the ISC license.
|
|
892
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
893
|
+
*/const tj=V("Webhook",[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]);/**
|
|
894
|
+
* @license lucide-react v0.451.0 - ISC
|
|
895
|
+
*
|
|
896
|
+
* This source code is licensed under the ISC license.
|
|
897
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
898
|
+
*/const _e=V("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
899
|
+
* @license lucide-react v0.451.0 - ISC
|
|
900
|
+
*
|
|
901
|
+
* This source code is licensed under the ISC license.
|
|
902
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
903
|
+
*/const ct=V("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function qf(s){var r,a,o="";if(typeof s=="string"||typeof s=="number")o+=s;else if(typeof s=="object")if(Array.isArray(s)){var c=s.length;for(r=0;r<c;r++)s[r]&&(a=qf(s[r]))&&(o&&(o+=" "),o+=a)}else for(a in s)s[a]&&(o&&(o+=" "),o+=a);return o}function O(){for(var s,r,a=0,o="",c=arguments.length;a<c;a++)(s=arguments[a])&&(r=qf(s))&&(o&&(o+=" "),o+=r);return o}function Hf({size:s=40}){return e.jsx("img",{src:"/favicon.svg",alt:"AssureMind",width:s,height:s,style:{flexShrink:0,borderRadius:s*.22},draggable:!1})}function sj(){return e.jsxs("div",{className:"flex items-center gap-3 select-none min-w-0 px-1",children:[e.jsx(Hf,{size:46}),e.jsxs("div",{className:"flex flex-col justify-center leading-none min-w-0",children:[e.jsx("span",{className:"text-[20px] font-bold text-white truncate",style:{letterSpacing:"-0.02em"},children:"AssureMind"}),e.jsx("span",{className:"text-[9px] font-semibold text-slate-400 uppercase mt-1.5",style:{letterSpacing:"0.18em"},children:"Studio"})]})]})}function nj(){return e.jsxs("div",{className:"flex flex-col items-center gap-1 select-none",children:[e.jsx(Hf,{size:36}),e.jsx("span",{className:"text-[8px] font-bold text-white/70 whitespace-nowrap",style:{letterSpacing:"-0.01em"},children:"AssureMind"})]})}const rj=[{to:"/",icon:Tv,label:"Dashboard"},{to:"/story",icon:Bt,label:"Smart Tests"},{to:"/tests",icon:Mi,label:"Test Editor"},{to:"/run",icon:Xt,label:"Run Config"},{to:"/reports",icon:vv,label:"Reports"},{to:"/variables",icon:Gv,label:"Variables"},{to:"/healing",icon:bl,label:"Self-Healing"},{to:"/git",icon:$n,label:"Git Control Center"},{to:"/library",icon:zv,label:"Step Library"},{to:"/ci-integration",icon:Fl,label:"CI/CD"},{to:"/env-config",icon:Lf,label:"Environment"},{to:"/docs",icon:Ri,label:"Docs"},{to:"/settings",icon:jl,label:"Settings"}];function aj({collapsed:s=!1,onToggle:r,mobileOpen:a=!1}){return e.jsxs(e.Fragment,{children:[a&&e.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-20 lg:hidden",onClick:r}),e.jsxs("aside",{className:O("fixed lg:relative z-30 flex flex-col h-full bg-sidebar text-white transition-all duration-300 ease-in-out flex-shrink-0",s?"w-[84px]":"w-[248px]",a?"translate-x-0":"-translate-x-full lg:translate-x-0"),children:[e.jsx("div",{className:O("flex items-center border-b border-white/[0.06] flex-shrink-0",s?"justify-center px-2 py-3":"px-3 py-4"),children:s?e.jsx(nj,{}):e.jsx(sj,{})}),e.jsx("nav",{className:O("flex-1 overflow-y-auto py-2 space-y-0.5 sidebar-nav-scroll",s?"px-2":"px-3"),style:{paddingTop:s?void 0:"0.75rem"},children:rj.map(({to:o,icon:c,label:u})=>e.jsxs(zb,{to:o,end:o==="/",className:({isActive:x})=>O("sidebar-item",x&&"active",s&&"justify-center !px-0"),title:s?u:void 0,children:[e.jsx(c,{size:18,className:"flex-shrink-0",strokeWidth:1.8}),!s&&e.jsx("span",{className:"truncate",children:u})]},o))}),e.jsx("button",{type:"button",onClick:r,className:O("hidden lg:flex items-center justify-center py-3.5","border-t border-white/[0.06] text-white/30 hover:text-white/70 transition-colors duration-200"),title:s?"Expand sidebar":"Collapse sidebar",children:s?e.jsx(Zt,{size:16}):e.jsx(jv,{size:16})})]})]})}function ij(){const[s,r]=p.useState(!1),[a,o]=p.useState(!1);return{collapsed:s,mobileOpen:a,toggle:()=>{r(u=>!u),o(u=>!u)}}}let ci=!1,Dd=null;const ia=[];let Fd=!1,Ld=[];const wu=new Set;function an(){for(const s of wu)s()}const Je={subscribe(s){return wu.add(s),()=>{wu.delete(s)}},getSnapshot(){return{panelOpen:ci,operationInProgress:Dd,logSteps:[...ia],hasConflict:Fd,conflictFiles:[...Ld]}},togglePanel(){ci=!ci,an()},openPanel(){ci=!0,an()},closePanel(){ci=!1,an()},startOperation(s){Dd=s,ia.length=0,an()},finishOperation(){Dd=null,an()},addLogStep(s){const r=ia.findIndex(a=>a.step===s.step&&a.status==="running");r>=0&&s.status!=="running"?ia[r]=s:r<0&&ia.push(s),an()},clearLogs(){ia.length=0,an()},setConflict(s){Fd=s.length>0,Ld=s,an()},clearConflict(){Fd=!1,Ld=[],an()}};function Bl(){const[s,r]=p.useState(()=>Je.getSnapshot());return p.useEffect(()=>Je.subscribe(()=>r(Je.getSnapshot())),[]),s}const ql="/api",oj=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}/ws`,Kf=["chromium","firefox","webkit"],_d=s=>`assuremind:suppress:${s}`;let di=null;const ku=new Set;function yp(){ku.forEach(s=>s())}const br={subscribe(s){return ku.add(s),()=>{ku.delete(s)}},getSnapshot(){return{activeModal:di}},showModal(s){localStorage.getItem(_d(s))!=="1"&&(di=s,yp())},dismiss(s){s&&di&&localStorage.setItem(_d(di),"1"),di=null,yp()},isSuppressed(s){return localStorage.getItem(_d(s))==="1"}};function lj(){const[s,r]=p.useState(br.getSnapshot);return p.useEffect(()=>br.subscribe(()=>r(br.getSnapshot())),[]),s}const cj=new Set(["AI_NOT_CONFIGURED","JIRA_NOT_CONFIGURED","XRAY_NOT_CONFIGURED"]);async function X(s,r){const a=r?.body!==void 0,o=await fetch(`${ql}${s}`,{headers:{...a?{"Content-Type":"application/json"}:{},...r?.headers},...r});if(!o.ok){const c=await o.text();if(o.status===422)try{const u=JSON.parse(c);if(u.featureHint&&cj.has(u.featureHint))throw br.showModal(u.featureHint),new Error("Configuration required — check the setup instructions in the dialog.")}catch(u){if(u instanceof Error&&u.message.startsWith("Configuration required"))throw u}throw new Error(`API ${r?.method??"GET"} ${s} → ${o.status}: ${c}`)}if(o.status!==204)return o.json()}const Sr={get:()=>X("/config"),update:s=>X("/config",{method:"PUT",body:JSON.stringify(s)}),getAiProvider:()=>X("/ai-provider"),getMcpStatus:()=>X("/mcp/status")},Pr={list:s=>X(`/suites${s?`?type=${s}`:""}`),get:s=>X(`/suites/${s}`),create:s=>X("/suites",{method:"POST",body:JSON.stringify(s)}),update:(s,r)=>X(`/suites/${s}`,{method:"PATCH",body:JSON.stringify(r)}),delete:s=>X(`/suites/${s}`,{method:"DELETE"})},qn={list:s=>X(`/suites/${s}/cases`),get:(s,r)=>X(`/suites/${s}/cases/${r}`),create:(s,r)=>X(`/suites/${s}/cases`,{method:"POST",body:JSON.stringify(r)}),update:(s,r,a)=>X(`/suites/${s}/cases/${r}`,{method:"PATCH",body:JSON.stringify(a)}),delete:(s,r)=>X(`/suites/${s}/cases/${r}`,{method:"DELETE"}),bulkDelete:(s,r)=>X(`/suites/${s}/cases/bulk-delete`,{method:"POST",body:JSON.stringify({ids:r})}),bulkMove:(s,r,a)=>X(`/suites/${s}/cases/bulk-move`,{method:"POST",body:JSON.stringify({ids:r,targetSuiteId:a})})},Rr={add:(s,r,a)=>X(`/suites/${s}/cases/${r}/steps`,{method:"POST",body:JSON.stringify(a)}),update:(s,r,a,o)=>X(`/suites/${s}/cases/${r}/steps/${a}`,{method:"PATCH",body:JSON.stringify(o)}),delete:(s,r,a)=>X(`/suites/${s}/cases/${r}/steps/${a}`,{method:"DELETE"}),generate:(s,r,a)=>X(`/suites/${s}/cases/${r}/steps/${a}/generate`,{method:"POST"}),generateAll:(s,r)=>X(`/suites/${s}/cases/${r}/steps/generate-all`,{method:"POST"}),reorder:(s,r,a)=>X(`/suites/${s}/cases/${r}/steps/reorder`,{method:"PATCH",body:JSON.stringify({stepIds:a})})},Mr={get:s=>X(`/suites/${s}/hooks`),addStep:(s,r,a)=>X(`/suites/${s}/hooks/${r}/steps`,{method:"POST",body:JSON.stringify(a)}),updateStep:(s,r,a,o)=>X(`/suites/${s}/hooks/${r}/steps/${a}`,{method:"PATCH",body:JSON.stringify(o)}),deleteStep:(s,r,a)=>X(`/suites/${s}/hooks/${r}/steps/${a}`,{method:"DELETE"}),reorderSteps:(s,r,a)=>X(`/suites/${s}/hooks/${r}/steps/reorder`,{method:"PATCH",body:JSON.stringify({stepIds:a})}),generateStep:(s,r,a)=>X(`/suites/${s}/hooks/${r}/steps/${a}/generate`,{method:"POST"}),generateAll:(s,r)=>X(`/suites/${s}/hooks/${r}/steps/generate-all`,{method:"POST"})},Ud={getAll:()=>X("/variables"),getEnv:s=>X(`/variables/env/${s}`),set:(s,r)=>X(`/variables/${s}`,{method:"PUT",body:JSON.stringify({value:r})}),delete:s=>X(`/variables/${s}`,{method:"DELETE"})},cn={list:()=>X("/healing"),pending:()=>X("/healing/pending"),stats:()=>X("/healing/stats"),accept:s=>X(`/healing/${s}/accept`,{method:"PATCH"}),reject:s=>X(`/healing/${s}/reject`,{method:"PATCH"}),acceptAll:()=>X("/healing/accept-all",{method:"POST"}),delete:s=>X(`/healing/${s}`,{method:"DELETE"}),deleteBulk:s=>X("/healing/delete-bulk",{method:"POST",body:JSON.stringify({ids:s})}),deleteAll:()=>X("/healing/clear-all",{method:"POST"})},ya={start:s=>X("/run",{method:"POST",body:JSON.stringify(s)}),stop:()=>X("/run/stop",{method:"POST"}),list:s=>X(`/run${s!==void 0?`?limit=${s}`:""}`),get:s=>X(`/run/${s}`)},Nl={list:s=>X(`/report${s!==void 0?`?limit=${s}`:""}`),get:s=>X(`/report/${s}`),delete:s=>X(`/report/${s}`,{method:"DELETE"})},oa={generate:(s,r,a)=>X("/story/generate",{method:"POST",body:JSON.stringify({story:s,suiteName:r,jiraUrl:a})}),generateBulk:(s,r=3)=>X("/story/generate-bulk",{method:"POST",body:JSON.stringify({stories:s,concurrency:r})}),fetchJira:s=>X("/story/fetch-jira",{method:"POST",body:JSON.stringify({jiraUrl:s})}),swaggerPreview:s=>X("/story/swagger-preview",{method:"POST",body:JSON.stringify({specUrl:s})}),generateFromSwagger:(s,r,a,o)=>X("/story/generate-from-swagger",{method:"POST",body:JSON.stringify({specUrl:s,suiteName:r,tags:a,requirements:o||void 0})})},Tr={enabled:()=>X("/xray/enabled"),status:()=>X("/xray/status"),suiteStatus:s=>X(`/xray/status/${s}`),createAll:()=>X("/xray/create-all",{method:"POST"}),createSuite:s=>X(`/xray/create/suite/${s}`,{method:"POST"}),createCase:(s,r)=>X(`/xray/create/case/${s}/${r}`,{method:"POST"}),syncAll:()=>X("/xray/sync-all",{method:"POST"}),syncSuite:s=>X(`/xray/sync/suite/${s}`,{method:"POST"}),syncCase:(s,r)=>X(`/xray/sync/case/${s}/${r}`,{method:"POST"}),validate:()=>X("/xray/validate")},la={list:()=>X("/data-files"),get:s=>X(`/data-files/${encodeURIComponent(s)}`),upload:(s,r)=>X("/data-files/upload",{method:"POST",body:JSON.stringify({filename:s,content:r})}),update:(s,r)=>X(`/data-files/${encodeURIComponent(s)}`,{method:"PUT",body:JSON.stringify({content:r})}),delete:s=>X(`/data-files/${encodeURIComponent(s)}`,{method:"DELETE"})},ut={status:()=>X("/git/status"),branches:()=>X("/git/branches"),checkout:s=>X("/git/checkout",{method:"POST",body:JSON.stringify({branch:s})}),commit:s=>X("/git/commit",{method:"POST",body:JSON.stringify({message:s})}),pull:s=>X("/git/pull",{method:"POST",body:JSON.stringify({rebase:s})}),push:()=>X("/git/push",{method:"POST"}),fullSync:s=>X("/git/full-sync",{method:"POST",body:JSON.stringify({message:s})}),log:s=>X(`/git/log${s?`?count=${s}`:""}`),diff:s=>X(`/git/diff${s?"?staged=true":""}`),conflictContent:s=>X(`/git/conflict-content/${encodeURIComponent(s)}`),resolveConflict:(s,r)=>X("/git/resolve-conflict",{method:"POST",body:JSON.stringify({filePath:s,content:r})}),continueRebase:()=>X("/git/continue-rebase",{method:"POST"}),abortRebase:()=>X("/git/abort-rebase",{method:"POST"}),generateCommitMessage:()=>X("/git/generate-commit-message",{method:"POST"}),resolveConflictAI:(s,r,a)=>X("/git/resolve-conflict-ai",{method:"POST",body:JSON.stringify({filePath:s,ours:r,theirs:a})}),impact:()=>X("/git/impact")};function ka(s,r){const a=r.replace(/\\/g,"/").split("/").pop()??r;return`${ql}/results/${s}/${encodeURIComponent(a)}`}function dj(s){return`${ql}/results/baselines/${encodeURIComponent(s)}.png`}const uj={search:s=>X(`/search?q=${encodeURIComponent(s)}`)},ki={list:()=>X("/files"),upload:(s,r)=>X("/files/upload",{method:"POST",body:JSON.stringify({name:s,dataBase64:r})}),remove:s=>X(`/files/${encodeURIComponent(s)}`,{method:"DELETE"}),downloads:s=>X(`/report/${encodeURIComponent(s)}/downloads`),downloadUrl:(s,r)=>`${ql}/report/${encodeURIComponent(s)}/downloads/${encodeURIComponent(r)}`},wl={get:()=>X("/env"),update:s=>X("/env",{method:"PUT",body:JSON.stringify({values:s})})},bp={generate:s=>X("/ci-config",{method:"POST",body:JSON.stringify(s)}),writeToRepo:s=>X("/ci-config/write",{method:"POST",body:JSON.stringify(s)})},xj={list:()=>X("/templates")},mj={get:(s,r)=>{const a=new URLSearchParams;return s&&a.set("suiteId",s),r&&a.set("caseId",r),X(`/flakiness?${a}`)}},mr={list:()=>X("/step-library"),create:s=>X("/step-library",{method:"POST",body:JSON.stringify(s)}),update:(s,r)=>X(`/step-library/${s}`,{method:"PATCH",body:JSON.stringify(r)}),delete:s=>X(`/step-library/${s}`,{method:"DELETE"}),generate:s=>X(`/step-library/${s}/generate`,{method:"POST"})},vp={capture:(s,r)=>X(`/baselines/${s}/capture`,{method:"POST",body:JSON.stringify({screenshotPath:r})}),get:s=>X(`/baselines/${s}`)},$d={start:(s,r)=>X("/recorder/start",{method:"POST",body:JSON.stringify({url:s,viewport:r})}),stop:()=>X("/recorder/stop",{method:"POST"}),status:()=>X("/recorder/status")};function hj(s){const r=s.locator,a=s.dialogHandler?`page.once('dialog', dialog => dialog.${s.dialogHandler.type}());
|
|
904
|
+
`:"";switch(s.action){case"navigate":return`await page.goto('${dr(s.url||"")}');`;case"click":return`${a}await page.${r}.click();`;case"fill":return`${a}await page.${r}.fill('${dr(s.value||"")}');`;case"select":return`await page.${r}.selectOption('${dr(s.value||"")}');`;case"check":return`await page.${r}.check();`;case"uncheck":return`await page.${r}.uncheck();`;case"press":return r?`await page.${r}.press('${dr(s.value||"")}');`:`await page.keyboard.press('${dr(s.value||"")}');`;case"hover":return`await page.${r}.click();`;case"assert":{const o=s.instruction,c=s.soft?"expect.soft":"expect";if(o.includes("current URL contains")){const u=o.match(/contains "(.+)"/),x=u?u[1]:"/";return`await ${c}(page).toHaveURL(/${pj(x)}/);`}if(o.includes("page title is")){const u=o.match(/title is "(.+)"/),x=u?u[1]:"";return`await ${c}(page).toHaveTitle('${dr(x)}');`}if(o.includes("has value")){const u=o.match(/has value "(.+)"/),x=u?u[1]:"";return`await ${c}(page.${r}).toHaveValue('${dr(x)}');`}return o.includes("is checked")?`await ${c}(page.${r}).toBeChecked();`:o.includes("is unchecked")?`await ${c}(page.${r}).not.toBeChecked();`:r?`await ${c}(page.${r}).toBeVisible();`:`// TODO: ${o}`}default:return`// Unhandled action: ${s.action}`}}function dr(s){return s.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}function pj(s){return s.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&")}function ex(){return Oe({queryKey:["git","status"],queryFn:ut.status,refetchInterval:5e3,retry:1})}function Vf(){return Oe({queryKey:["git","branches"],queryFn:ut.branches,staleTime:3e4,retry:1})}function Wf(s){return Oe({queryKey:["git","log",s],queryFn:()=>ut.log(s),staleTime:1e4,retry:1})}function Gf(){const s=Re();return oe({mutationFn:r=>ut.checkout(r),onSuccess:(r,a)=>{s.invalidateQueries({queryKey:["git"]}),$.success(`Switched to ${a}`)},onError:r=>$.error(`Checkout failed: ${r.message}`)})}function Qf(){const s=Re();return oe({mutationFn:r=>(Je.startOperation("commit"),ut.commit(r)),onSuccess:r=>{Je.finishOperation(),s.invalidateQueries({queryKey:["git"]}),$.success(`Committed: ${r.hash}`)},onError:r=>{Je.finishOperation(),$.error(`Commit failed: ${r.message}`)}})}function Jf(){const s=Re();return oe({mutationFn:r=>(Je.startOperation("pull"),ut.pull(r)),onSuccess:()=>{Je.finishOperation(),s.invalidateQueries({queryKey:["git"]}),$.success("Pull successful")},onError:r=>{Je.finishOperation(),$.error(`Pull failed: ${r.message}`)}})}function Yf(){const s=Re();return oe({mutationFn:()=>(Je.startOperation("push"),ut.push()),onSuccess:()=>{Je.finishOperation(),s.invalidateQueries({queryKey:["git"]}),$.success("Pushed to remote")},onError:r=>{Je.finishOperation(),$.error(`Push failed: ${r.message}`)}})}function Xf(){const s=Re();return oe({mutationFn:r=>(Je.startOperation("full-sync"),ut.fullSync(r)),onSuccess:()=>{Je.finishOperation(),s.invalidateQueries({queryKey:["git"]}),$.success("Full sync complete")},onError:r=>{Je.finishOperation(),$.error(`Sync failed: ${r.message}`)}})}function Zf(){return oe({mutationFn:()=>ut.generateCommitMessage(),onError:s=>$.error(`AI generation failed: ${s.message}`)})}function eg(){const s=Re();return oe({mutationFn:({filePath:r,content:a})=>ut.resolveConflict(r,a),onSuccess:()=>{s.invalidateQueries({queryKey:["git"]}),$.success("Conflict resolved")},onError:r=>$.error(`Resolve failed: ${r.message}`)})}function tg(){return oe({mutationFn:({filePath:s,ours:r,theirs:a})=>ut.resolveConflictAI(s,r,a),onError:s=>$.error(`AI resolve failed: ${s.message}`)})}function sg(){const s=Re();return oe({mutationFn:()=>ut.continueRebase(),onSuccess:()=>{Je.clearConflict(),s.invalidateQueries({queryKey:["git"]}),$.success("Rebase continued")},onError:r=>$.error(`Continue rebase failed: ${r.message}`)})}function ng(){const s=Re();return oe({mutationFn:()=>ut.abortRebase(),onSuccess:()=>{Je.clearConflict(),s.invalidateQueries({queryKey:["git"]}),$.success("Rebase aborted")},onError:r=>$.error(`Abort rebase failed: ${r.message}`)})}const rg="assuremind-theme";function fj(){const s=localStorage.getItem(rg);return s==="dark"||s==="light"?s:"light"}let ha=fj();const Su=new Set;function ag(s){const r=document.documentElement;s==="dark"?r.classList.add("dark"):r.classList.remove("dark")}ag(ha);function gj(){for(const s of Su)s()}const Bd={subscribe(s){return Su.add(s),()=>{Su.delete(s)}},getSnapshot(){return ha},toggle(){ha=ha==="light"?"dark":"light",localStorage.setItem(rg,ha),ag(ha),gj()}};function yj(){return{theme:p.useSyncExternalStore(Bd.subscribe,Bd.getSnapshot),toggle:Bd.toggle}}const ig=6048e5,bj=864e5,tl=43200,jp=1440,Np=Symbol.for("constructDateFrom");function mn(s,r){return typeof s=="function"?s(r):s&&typeof s=="object"&&Np in s?s[Np](r):s instanceof Date?new s.constructor(r):new Date(r)}function Et(s,r){return mn(r||s,s)}let vj={};function Ui(){return vj}function Ti(s,r){const a=Ui(),o=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,c=Et(s,r?.in),u=c.getDay(),x=(u<o?7:0)+u-o;return c.setDate(c.getDate()-x),c.setHours(0,0,0,0),c}function kl(s,r){return Ti(s,{...r,weekStartsOn:1})}function og(s,r){const a=Et(s,r?.in),o=a.getFullYear(),c=mn(a,0);c.setFullYear(o+1,0,4),c.setHours(0,0,0,0);const u=kl(c),x=mn(a,0);x.setFullYear(o,0,4),x.setHours(0,0,0,0);const h=kl(x);return a.getTime()>=u.getTime()?o+1:a.getTime()>=h.getTime()?o:o-1}function Sl(s){const r=Et(s),a=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return a.setUTCFullYear(r.getFullYear()),+s-+a}function Hl(s,...r){const a=mn.bind(null,s||r.find(o=>typeof o=="object"));return r.map(a)}function wp(s,r){const a=Et(s,r?.in);return a.setHours(0,0,0,0),a}function jj(s,r,a){const[o,c]=Hl(a?.in,s,r),u=wp(o),x=wp(c),h=+u-Sl(u),f=+x-Sl(x);return Math.round((h-f)/bj)}function Nj(s,r){const a=og(s,r),o=mn(s,0);return o.setFullYear(a,0,4),o.setHours(0,0,0,0),kl(o)}function xl(s,r){const a=+Et(s)-+Et(r);return a<0?-1:a>0?1:a}function wj(s){return mn(s,Date.now())}function kj(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Sj(s){return!(!kj(s)&&typeof s!="number"||isNaN(+Et(s)))}function Cj(s,r,a){const[o,c]=Hl(a?.in,s,r),u=o.getFullYear()-c.getFullYear(),x=o.getMonth()-c.getMonth();return u*12+x}function Ej(s){return r=>{const o=(s?Math[s]:Math.trunc)(r);return o===0?0:o}}function Pj(s,r){return+Et(s)-+Et(r)}function Rj(s,r){const a=Et(s,r?.in);return a.setHours(23,59,59,999),a}function Mj(s,r){const a=Et(s,r?.in),o=a.getMonth();return a.setFullYear(a.getFullYear(),o+1,0),a.setHours(23,59,59,999),a}function Tj(s,r){const a=Et(s,r?.in);return+Rj(a,r)==+Mj(a,r)}function zj(s,r,a){const[o,c,u]=Hl(a?.in,s,s,r),x=xl(c,u),h=Math.abs(Cj(c,u));if(h<1)return 0;c.getMonth()===1&&c.getDate()>27&&c.setDate(30),c.setMonth(c.getMonth()-x*h);let f=xl(c,u)===-x;Tj(o)&&h===1&&xl(o,u)===1&&(f=!1);const g=x*(h-+f);return g===0?0:g}function Aj(s,r,a){const o=Pj(s,r)/1e3;return Ej(a?.roundingMethod)(o)}function Oj(s,r){const a=Et(s,r?.in);return a.setFullYear(a.getFullYear(),0,1),a.setHours(0,0,0,0),a}const Ij={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Dj=(s,r,a)=>{let o;const c=Ij[s];return typeof c=="string"?o=c:r===1?o=c.one:o=c.other.replace("{{count}}",r.toString()),a?.addSuffix?a.comparison&&a.comparison>0?"in "+o:o+" ago":o};function qd(s){return(r={})=>{const a=r.width?String(r.width):s.defaultWidth;return s.formats[a]||s.formats[s.defaultWidth]}}const Fj={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Lj={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},_j={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Uj={date:qd({formats:Fj,defaultWidth:"full"}),time:qd({formats:Lj,defaultWidth:"full"}),dateTime:qd({formats:_j,defaultWidth:"full"})},$j={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Bj=(s,r,a,o)=>$j[s];function ui(s){return(r,a)=>{const o=a?.context?String(a.context):"standalone";let c;if(o==="formatting"&&s.formattingValues){const x=s.defaultFormattingWidth||s.defaultWidth,h=a?.width?String(a.width):x;c=s.formattingValues[h]||s.formattingValues[x]}else{const x=s.defaultWidth,h=a?.width?String(a.width):s.defaultWidth;c=s.values[h]||s.values[x]}const u=s.argumentCallback?s.argumentCallback(r):r;return c[u]}}const qj={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Hj={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Kj={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Vj={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Wj={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Gj={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Qj=(s,r)=>{const a=Number(s),o=a%100;if(o>20||o<10)switch(o%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},Jj={ordinalNumber:Qj,era:ui({values:qj,defaultWidth:"wide"}),quarter:ui({values:Hj,defaultWidth:"wide",argumentCallback:s=>s-1}),month:ui({values:Kj,defaultWidth:"wide"}),day:ui({values:Vj,defaultWidth:"wide"}),dayPeriod:ui({values:Wj,defaultWidth:"wide",formattingValues:Gj,defaultFormattingWidth:"wide"})};function xi(s){return(r,a={})=>{const o=a.width,c=o&&s.matchPatterns[o]||s.matchPatterns[s.defaultMatchWidth],u=r.match(c);if(!u)return null;const x=u[0],h=o&&s.parsePatterns[o]||s.parsePatterns[s.defaultParseWidth],f=Array.isArray(h)?Xj(h,N=>N.test(x)):Yj(h,N=>N.test(x));let g;g=s.valueCallback?s.valueCallback(f):f,g=a.valueCallback?a.valueCallback(g):g;const y=r.slice(x.length);return{value:g,rest:y}}}function Yj(s,r){for(const a in s)if(Object.prototype.hasOwnProperty.call(s,a)&&r(s[a]))return a}function Xj(s,r){for(let a=0;a<s.length;a++)if(r(s[a]))return a}function Zj(s){return(r,a={})=>{const o=r.match(s.matchPattern);if(!o)return null;const c=o[0],u=r.match(s.parsePattern);if(!u)return null;let x=s.valueCallback?s.valueCallback(u[0]):u[0];x=a.valueCallback?a.valueCallback(x):x;const h=r.slice(c.length);return{value:x,rest:h}}}const eN=/^(\d+)(th|st|nd|rd)?/i,tN=/\d+/i,sN={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},nN={any:[/^b/i,/^(a|c)/i]},rN={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},aN={any:[/1/i,/2/i,/3/i,/4/i]},iN={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},oN={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},lN={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},cN={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},dN={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},uN={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},xN={ordinalNumber:Zj({matchPattern:eN,parsePattern:tN,valueCallback:s=>parseInt(s,10)}),era:xi({matchPatterns:sN,defaultMatchWidth:"wide",parsePatterns:nN,defaultParseWidth:"any"}),quarter:xi({matchPatterns:rN,defaultMatchWidth:"wide",parsePatterns:aN,defaultParseWidth:"any",valueCallback:s=>s+1}),month:xi({matchPatterns:iN,defaultMatchWidth:"wide",parsePatterns:oN,defaultParseWidth:"any"}),day:xi({matchPatterns:lN,defaultMatchWidth:"wide",parsePatterns:cN,defaultParseWidth:"any"}),dayPeriod:xi({matchPatterns:dN,defaultMatchWidth:"any",parsePatterns:uN,defaultParseWidth:"any"})},lg={code:"en-US",formatDistance:Dj,formatLong:Uj,formatRelative:Bj,localize:Jj,match:xN,options:{weekStartsOn:0,firstWeekContainsDate:1}};function mN(s,r){const a=Et(s,r?.in);return jj(a,Oj(a))+1}function hN(s,r){const a=Et(s,r?.in),o=+kl(a)-+Nj(a);return Math.round(o/ig)+1}function cg(s,r){const a=Et(s,r?.in),o=a.getFullYear(),c=Ui(),u=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??c.firstWeekContainsDate??c.locale?.options?.firstWeekContainsDate??1,x=mn(r?.in||s,0);x.setFullYear(o+1,0,u),x.setHours(0,0,0,0);const h=Ti(x,r),f=mn(r?.in||s,0);f.setFullYear(o,0,u),f.setHours(0,0,0,0);const g=Ti(f,r);return+a>=+h?o+1:+a>=+g?o:o-1}function pN(s,r){const a=Ui(),o=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,c=cg(s,r),u=mn(r?.in||s,0);return u.setFullYear(c,0,o),u.setHours(0,0,0,0),Ti(u,r)}function fN(s,r){const a=Et(s,r?.in),o=+Ti(a,r)-+pN(a,r);return Math.round(o/ig)+1}function We(s,r){const a=s<0?"-":"",o=Math.abs(s).toString().padStart(r,"0");return a+o}const On={y(s,r){const a=s.getFullYear(),o=a>0?a:1-a;return We(r==="yy"?o%100:o,r.length)},M(s,r){const a=s.getMonth();return r==="M"?String(a+1):We(a+1,2)},d(s,r){return We(s.getDate(),r.length)},a(s,r){const a=s.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return a.toUpperCase();case"aaa":return a;case"aaaaa":return a[0];default:return a==="am"?"a.m.":"p.m."}},h(s,r){return We(s.getHours()%12||12,r.length)},H(s,r){return We(s.getHours(),r.length)},m(s,r){return We(s.getMinutes(),r.length)},s(s,r){return We(s.getSeconds(),r.length)},S(s,r){const a=r.length,o=s.getMilliseconds(),c=Math.trunc(o*Math.pow(10,a-3));return We(c,r.length)}},ca={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},kp={G:function(s,r,a){const o=s.getFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return a.era(o,{width:"abbreviated"});case"GGGGG":return a.era(o,{width:"narrow"});default:return a.era(o,{width:"wide"})}},y:function(s,r,a){if(r==="yo"){const o=s.getFullYear(),c=o>0?o:1-o;return a.ordinalNumber(c,{unit:"year"})}return On.y(s,r)},Y:function(s,r,a,o){const c=cg(s,o),u=c>0?c:1-c;if(r==="YY"){const x=u%100;return We(x,2)}return r==="Yo"?a.ordinalNumber(u,{unit:"year"}):We(u,r.length)},R:function(s,r){const a=og(s);return We(a,r.length)},u:function(s,r){const a=s.getFullYear();return We(a,r.length)},Q:function(s,r,a){const o=Math.ceil((s.getMonth()+1)/3);switch(r){case"Q":return String(o);case"QQ":return We(o,2);case"Qo":return a.ordinalNumber(o,{unit:"quarter"});case"QQQ":return a.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return a.quarter(o,{width:"narrow",context:"formatting"});default:return a.quarter(o,{width:"wide",context:"formatting"})}},q:function(s,r,a){const o=Math.ceil((s.getMonth()+1)/3);switch(r){case"q":return String(o);case"qq":return We(o,2);case"qo":return a.ordinalNumber(o,{unit:"quarter"});case"qqq":return a.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return a.quarter(o,{width:"narrow",context:"standalone"});default:return a.quarter(o,{width:"wide",context:"standalone"})}},M:function(s,r,a){const o=s.getMonth();switch(r){case"M":case"MM":return On.M(s,r);case"Mo":return a.ordinalNumber(o+1,{unit:"month"});case"MMM":return a.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return a.month(o,{width:"narrow",context:"formatting"});default:return a.month(o,{width:"wide",context:"formatting"})}},L:function(s,r,a){const o=s.getMonth();switch(r){case"L":return String(o+1);case"LL":return We(o+1,2);case"Lo":return a.ordinalNumber(o+1,{unit:"month"});case"LLL":return a.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return a.month(o,{width:"narrow",context:"standalone"});default:return a.month(o,{width:"wide",context:"standalone"})}},w:function(s,r,a,o){const c=fN(s,o);return r==="wo"?a.ordinalNumber(c,{unit:"week"}):We(c,r.length)},I:function(s,r,a){const o=hN(s);return r==="Io"?a.ordinalNumber(o,{unit:"week"}):We(o,r.length)},d:function(s,r,a){return r==="do"?a.ordinalNumber(s.getDate(),{unit:"date"}):On.d(s,r)},D:function(s,r,a){const o=mN(s);return r==="Do"?a.ordinalNumber(o,{unit:"dayOfYear"}):We(o,r.length)},E:function(s,r,a){const o=s.getDay();switch(r){case"E":case"EE":case"EEE":return a.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return a.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(o,{width:"short",context:"formatting"});default:return a.day(o,{width:"wide",context:"formatting"})}},e:function(s,r,a,o){const c=s.getDay(),u=(c-o.weekStartsOn+8)%7||7;switch(r){case"e":return String(u);case"ee":return We(u,2);case"eo":return a.ordinalNumber(u,{unit:"day"});case"eee":return a.day(c,{width:"abbreviated",context:"formatting"});case"eeeee":return a.day(c,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(c,{width:"short",context:"formatting"});default:return a.day(c,{width:"wide",context:"formatting"})}},c:function(s,r,a,o){const c=s.getDay(),u=(c-o.weekStartsOn+8)%7||7;switch(r){case"c":return String(u);case"cc":return We(u,r.length);case"co":return a.ordinalNumber(u,{unit:"day"});case"ccc":return a.day(c,{width:"abbreviated",context:"standalone"});case"ccccc":return a.day(c,{width:"narrow",context:"standalone"});case"cccccc":return a.day(c,{width:"short",context:"standalone"});default:return a.day(c,{width:"wide",context:"standalone"})}},i:function(s,r,a){const o=s.getDay(),c=o===0?7:o;switch(r){case"i":return String(c);case"ii":return We(c,r.length);case"io":return a.ordinalNumber(c,{unit:"day"});case"iii":return a.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return a.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return a.day(o,{width:"short",context:"formatting"});default:return a.day(o,{width:"wide",context:"formatting"})}},a:function(s,r,a){const c=s.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return a.dayPeriod(c,{width:"abbreviated",context:"formatting"});case"aaa":return a.dayPeriod(c,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return a.dayPeriod(c,{width:"narrow",context:"formatting"});default:return a.dayPeriod(c,{width:"wide",context:"formatting"})}},b:function(s,r,a){const o=s.getHours();let c;switch(o===12?c=ca.noon:o===0?c=ca.midnight:c=o/12>=1?"pm":"am",r){case"b":case"bb":return a.dayPeriod(c,{width:"abbreviated",context:"formatting"});case"bbb":return a.dayPeriod(c,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return a.dayPeriod(c,{width:"narrow",context:"formatting"});default:return a.dayPeriod(c,{width:"wide",context:"formatting"})}},B:function(s,r,a){const o=s.getHours();let c;switch(o>=17?c=ca.evening:o>=12?c=ca.afternoon:o>=4?c=ca.morning:c=ca.night,r){case"B":case"BB":case"BBB":return a.dayPeriod(c,{width:"abbreviated",context:"formatting"});case"BBBBB":return a.dayPeriod(c,{width:"narrow",context:"formatting"});default:return a.dayPeriod(c,{width:"wide",context:"formatting"})}},h:function(s,r,a){if(r==="ho"){let o=s.getHours()%12;return o===0&&(o=12),a.ordinalNumber(o,{unit:"hour"})}return On.h(s,r)},H:function(s,r,a){return r==="Ho"?a.ordinalNumber(s.getHours(),{unit:"hour"}):On.H(s,r)},K:function(s,r,a){const o=s.getHours()%12;return r==="Ko"?a.ordinalNumber(o,{unit:"hour"}):We(o,r.length)},k:function(s,r,a){let o=s.getHours();return o===0&&(o=24),r==="ko"?a.ordinalNumber(o,{unit:"hour"}):We(o,r.length)},m:function(s,r,a){return r==="mo"?a.ordinalNumber(s.getMinutes(),{unit:"minute"}):On.m(s,r)},s:function(s,r,a){return r==="so"?a.ordinalNumber(s.getSeconds(),{unit:"second"}):On.s(s,r)},S:function(s,r){return On.S(s,r)},X:function(s,r,a){const o=s.getTimezoneOffset();if(o===0)return"Z";switch(r){case"X":return Cp(o);case"XXXX":case"XX":return xr(o);default:return xr(o,":")}},x:function(s,r,a){const o=s.getTimezoneOffset();switch(r){case"x":return Cp(o);case"xxxx":case"xx":return xr(o);default:return xr(o,":")}},O:function(s,r,a){const o=s.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+Sp(o,":");default:return"GMT"+xr(o,":")}},z:function(s,r,a){const o=s.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+Sp(o,":");default:return"GMT"+xr(o,":")}},t:function(s,r,a){const o=Math.trunc(+s/1e3);return We(o,r.length)},T:function(s,r,a){return We(+s,r.length)}};function Sp(s,r=""){const a=s>0?"-":"+",o=Math.abs(s),c=Math.trunc(o/60),u=o%60;return u===0?a+String(c):a+String(c)+r+We(u,2)}function Cp(s,r){return s%60===0?(s>0?"-":"+")+We(Math.abs(s)/60,2):xr(s,r)}function xr(s,r=""){const a=s>0?"-":"+",o=Math.abs(s),c=We(Math.trunc(o/60),2),u=We(o%60,2);return a+c+r+u}const Ep=(s,r)=>{switch(s){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});default:return r.date({width:"full"})}},dg=(s,r)=>{switch(s){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});default:return r.time({width:"full"})}},gN=(s,r)=>{const a=s.match(/(P+)(p+)?/)||[],o=a[1],c=a[2];if(!c)return Ep(s,r);let u;switch(o){case"P":u=r.dateTime({width:"short"});break;case"PP":u=r.dateTime({width:"medium"});break;case"PPP":u=r.dateTime({width:"long"});break;default:u=r.dateTime({width:"full"});break}return u.replace("{{date}}",Ep(o,r)).replace("{{time}}",dg(c,r))},yN={p:dg,P:gN},bN=/^D+$/,vN=/^Y+$/,jN=["D","DD","YY","YYYY"];function NN(s){return bN.test(s)}function wN(s){return vN.test(s)}function kN(s,r,a){const o=SN(s,r,a);if(console.warn(o),jN.includes(s))throw new RangeError(o)}function SN(s,r,a){const o=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${r}\`) for formatting ${o} to the input \`${a}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const CN=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,EN=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,PN=/^'([^]*?)'?$/,RN=/''/g,MN=/[a-zA-Z]/;function TN(s,r,a){const o=Ui(),c=o.locale??lg,u=o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,x=o.weekStartsOn??o.locale?.options?.weekStartsOn??0,h=Et(s,a?.in);if(!Sj(h))throw new RangeError("Invalid time value");let f=r.match(EN).map(y=>{const N=y[0];if(N==="p"||N==="P"){const E=yN[N];return E(y,c.formatLong)}return y}).join("").match(CN).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const N=y[0];if(N==="'")return{isToken:!1,value:zN(y)};if(kp[N])return{isToken:!0,value:y};if(N.match(MN))throw new RangeError("Format string contains an unescaped latin alphabet character `"+N+"`");return{isToken:!1,value:y}});c.localize.preprocessor&&(f=c.localize.preprocessor(h,f));const g={firstWeekContainsDate:u,weekStartsOn:x,locale:c};return f.map(y=>{if(!y.isToken)return y.value;const N=y.value;(wN(N)||NN(N))&&kN(N,r,String(s));const E=kp[N[0]];return E(h,N,c.localize,g)}).join("")}function zN(s){const r=s.match(PN);return r?r[1].replace(RN,"'"):s}function AN(s,r,a){const o=Ui(),c=a?.locale??o.locale??lg,u=2520,x=xl(s,r);if(isNaN(x))throw new RangeError("Invalid time value");const h=Object.assign({},a,{addSuffix:a?.addSuffix,comparison:x}),[f,g]=Hl(a?.in,...x>0?[r,s]:[s,r]),y=Aj(g,f),N=(Sl(g)-Sl(f))/1e3,E=Math.round((y-N)/60);let S;if(E<2)return a?.includeSeconds?y<5?c.formatDistance("lessThanXSeconds",5,h):y<10?c.formatDistance("lessThanXSeconds",10,h):y<20?c.formatDistance("lessThanXSeconds",20,h):y<40?c.formatDistance("halfAMinute",0,h):y<60?c.formatDistance("lessThanXMinutes",1,h):c.formatDistance("xMinutes",1,h):E===0?c.formatDistance("lessThanXMinutes",1,h):c.formatDistance("xMinutes",E,h);if(E<45)return c.formatDistance("xMinutes",E,h);if(E<90)return c.formatDistance("aboutXHours",1,h);if(E<jp){const P=Math.round(E/60);return c.formatDistance("aboutXHours",P,h)}else{if(E<u)return c.formatDistance("xDays",1,h);if(E<tl){const P=Math.round(E/jp);return c.formatDistance("xDays",P,h)}else if(E<tl*2)return S=Math.round(E/tl),c.formatDistance("aboutXMonths",S,h)}if(S=zj(g,f),S<12){const P=Math.round(E/tl);return c.formatDistance("xMonths",P,h)}else{const P=S%12,M=Math.trunc(S/12);return P<3?c.formatDistance("aboutXYears",M,h):P<9?c.formatDistance("overXYears",M,h):c.formatDistance("almostXYears",M+1,h)}}function Cl(s,r){return AN(s,wj(s),r)}let ur=[];const Cu=new Set;function Hd(){Cu.forEach(s=>s())}const vr={subscribe(s){return Cu.add(s),()=>{Cu.delete(s)}},getSnapshot(){return{notifications:ur,unreadCount:ur.filter(s=>!s.read).length}},push(s){ur=[s,...ur].slice(0,20),Hd()},markAllRead(){ur=ur.map(s=>({...s,read:!0})),Hd()},clear(){ur=[],Hd()}};function ON(){const[s,r]=p.useState(()=>vr.getSnapshot());return p.useEffect(()=>vr.subscribe(()=>r(vr.getSnapshot())),[]),s}function IN({type:s}){switch(s){case"run-complete":return e.jsx(He,{size:13,className:"text-emerald-500 flex-shrink-0"});case"run-error":return e.jsx(St,{size:13,className:"text-red-500 flex-shrink-0"});case"healing":return e.jsx(ct,{size:13,className:"text-amber-500 flex-shrink-0"});case"git":return e.jsx($n,{size:13,className:"text-blue-500 flex-shrink-0"});default:return e.jsx(yl,{size:13,className:"text-content-tertiary flex-shrink-0"})}}function DN(){const[s,r]=p.useState(!1),{notifications:a,unreadCount:o}=ON(),c=p.useRef(null),u=Vs();return p.useEffect(()=>{if(!s)return;function x(h){c.current&&!c.current.contains(h.target)&&r(!1)}return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[s]),e.jsxs("div",{className:"relative",ref:c,children:[e.jsxs("button",{type:"button",onClick:()=>r(x=>!x),className:O("relative p-2 rounded-lg transition-all duration-200",s?"bg-accent-muted text-accent":"text-content-tertiary hover:bg-surface-inset hover:text-content-secondary"),"aria-label":"Notifications",title:"Notifications",children:[e.jsx(yl,{size:16}),o>0&&e.jsx("span",{className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-red-500 text-white text-[9px] font-bold flex items-center justify-center ring-2 ring-surface",children:o>9?"9+":o})]}),s&&e.jsxs("div",{className:"absolute right-0 top-full mt-2 w-80 bg-surface border border-border rounded-xl shadow-modal z-50 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border bg-surface-inset/50",children:[e.jsx("span",{className:"text-xs font-semibold text-content",children:"Notifications"}),e.jsxs("div",{className:"flex items-center gap-1",children:[o>0&&e.jsx("button",{type:"button",onClick:()=>vr.markAllRead(),className:"p-1 rounded text-content-tertiary hover:text-content hover:bg-surface-inset transition-colors",title:"Mark all read",children:e.jsx(Sf,{size:12})}),e.jsx("button",{type:"button",onClick:()=>vr.clear(),className:"p-1 rounded text-content-tertiary hover:text-red-500 hover:bg-red-50 transition-colors",title:"Clear all",children:e.jsx(es,{size:12})})]})]}),e.jsx("div",{className:"max-h-80 overflow-y-auto divide-y divide-border/50",children:a.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-2",children:[e.jsx(yl,{size:20,className:"text-content-tertiary/40"}),e.jsx("p",{className:"text-xs text-content-tertiary",children:"No notifications"})]}):a.map(x=>e.jsxs("div",{className:O("flex items-start gap-2.5 px-3 py-2.5 transition-colors",!x.read&&"bg-accent-muted/20",x.link&&"cursor-pointer hover:bg-surface-inset/50"),onClick:()=>{x.link&&(r(!1),u(x.link))},children:[e.jsx("div",{className:"mt-0.5",children:e.jsx(IN,{type:x.type})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:O("text-xs leading-relaxed",x.read?"text-content-secondary":"text-content font-medium"),children:x.message}),e.jsx("p",{className:"text-[9px] text-content-tertiary mt-0.5",children:Cl(new Date(x.timestamp),{addSuffix:!0})})]}),x.link&&e.jsx(Na,{size:10,className:"text-content-tertiary/60 flex-shrink-0 mt-0.5"}),!x.read&&e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-accent flex-shrink-0 mt-1.5"})]},x.id))})]})]})}function FN(){const s=Re(),r=Vs(),[a,o]=p.useState(!1),c=p.useRef(null),{data:u}=Oe({queryKey:["config"],queryFn:()=>Sr.get(),staleTime:3e4}),x=oe({mutationFn:g=>{const y=u?.profiles?.find(N=>N.name===g);if(!y)throw new Error("Profile not found");return Sr.update({activeProfile:y.name,environment:y.environment,baseUrl:y.baseUrl,browsers:y.browsers,...y.headless!==void 0?{headless:y.headless}:{}})},onSuccess:()=>{s.invalidateQueries({queryKey:["config"]}),o(!1)}});p.useEffect(()=>{const g=y=>{c.current&&!c.current.contains(y.target)&&o(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[]);const h=u?.profiles??[];if(h.length===0)return null;const f=u?.activeProfile??u?.environment??"env";return e.jsxs("div",{ref:c,className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>o(g=>!g),className:"flex items-center gap-1.5 text-xs border border-border rounded-lg px-2.5 py-1.5 text-content-secondary hover:bg-surface-inset transition-colors",children:[e.jsx(xn,{size:12,className:"text-accent flex-shrink-0"}),e.jsx("span",{className:"hidden sm:inline max-w-[100px] truncate",children:f}),e.jsx(kt,{size:11,className:"text-content-tertiary"})]}),a&&e.jsxs("div",{className:"absolute right-0 top-full mt-1 w-52 bg-surface border border-border rounded-xl shadow-elevated z-50 overflow-hidden",children:[e.jsx("div",{className:"px-3 py-2 border-b border-border",children:e.jsx("p",{className:"text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Environment Profiles"})}),e.jsx("div",{className:"py-1",children:h.map(g=>e.jsxs("button",{type:"button",onClick:()=>x.mutate(g.name),className:O("w-full text-left px-3 py-2 text-xs hover:bg-surface-inset transition-colors flex items-center justify-between gap-2",u?.activeProfile===g.name&&"text-accent font-semibold"),children:[e.jsx("span",{className:"truncate",children:g.name}),e.jsx("span",{className:"text-[9px] text-content-tertiary flex-shrink-0",children:g.environment})]},g.name))}),e.jsx("div",{className:"border-t border-border px-3 py-2",children:e.jsxs("button",{type:"button",onClick:()=>{o(!1),r("/settings#profiles")},className:"flex items-center gap-1 text-[10px] text-content-tertiary hover:text-accent transition-colors",children:[e.jsx(wr,{size:10})," Manage profiles"]})})]})]})}const LN={anthropic:"Anthropic",openai:"OpenAI",google:"Google","azure-openai":"Azure OpenAI",bedrock:"Bedrock",deepseek:"DeepSeek",groq:"Groq",together:"Together",qwen:"Qwen",perplexity:"Perplexity",ollama:"Ollama",custom:"Custom",unknown:"AI"};function _N(){const s=Re(),[r,a]=p.useState(!1),[o,c]=p.useState(""),[u,x]=p.useState(""),{data:h}=Oe({queryKey:["ai-provider"],queryFn:()=>Sr.getAiProvider(),staleTime:6e4,retry:!1}),{data:f}=Oe({queryKey:["env"],queryFn:wl.get,enabled:r});p.useEffect(()=>{r&&h&&(c(h.provider==="unknown"?"":h.provider),x(h.model==="unknown"?"":h.model))},[r,h]);const g=f?.providerLabels??LN,y=g[h?.provider??""]??h?.provider??"...",N=h?.model??"...",E=p.useMemo(()=>f?.groups.find(j=>j.id==="ai-core")?.fields.find(j=>j.key==="AI_PROVIDER")?.options??[],[f]),S=p.useMemo(()=>f?.groups.find(j=>j.provider===o)?.fields.find(j=>j.key.endsWith("_MODEL")),[f,o]),P=p.useMemo(()=>{const k=S?.recommended??[];return u&&!k.includes(u)?[u,...k]:k},[S,u]),M=oe({mutationFn:()=>{const k={AI_PROVIDER:o};return S&&u&&(k[S.key]=u),wl.update(k)},onSuccess:()=>{$.success("AI provider updated in .env"),s.invalidateQueries({queryKey:["ai-provider"]}),s.invalidateQueries({queryKey:["env"]}),s.invalidateQueries({queryKey:["config-status"]}),a(!1)},onError:k=>$.error(k.message)});return h?e.jsxs("div",{className:"relative hidden sm:block",children:[e.jsxs("button",{type:"button",onClick:()=>a(k=>!k),title:"Change AI provider & model",className:"flex items-center gap-1.5 text-xs bg-surface-inset border border-border rounded-lg px-3 py-1.5 hover:border-accent/40 transition-colors",children:[e.jsx(hv,{size:13,className:"text-accent flex-shrink-0"}),e.jsx("span",{className:"font-medium text-content-secondary",children:y}),e.jsx("span",{className:"text-content-tertiary/50",children:"/"}),e.jsx("span",{className:"text-content-tertiary truncate max-w-[140px]",children:N}),e.jsx(kt,{size:12,className:"text-content-tertiary"})]}),r&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>a(!1)}),e.jsxs("div",{className:"absolute right-0 mt-2 w-72 z-50 bg-surface border border-border rounded-xl shadow-modal p-3 space-y-3",children:[e.jsx("p",{className:"text-[11px] font-bold text-content",children:"AI Provider"}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-semibold text-content-tertiary block mb-1",children:"Provider"}),e.jsxs("select",{value:o,onChange:k=>{c(k.target.value),x("")},className:"w-full border border-border rounded-lg px-2.5 py-1.5 text-xs bg-surface text-content-secondary focus:outline-none focus:ring-2 focus:ring-accent/30",children:[e.jsx("option",{value:"",children:"— select —"}),E.filter(Boolean).map(k=>e.jsx("option",{value:k,children:g[k]??k},k))]})]}),S&&e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-semibold text-content-tertiary block mb-1",children:"Model"}),P.length>0?e.jsxs("select",{value:u,onChange:k=>x(k.target.value),className:"w-full border border-border rounded-lg px-2.5 py-1.5 text-xs bg-surface text-content-secondary focus:outline-none focus:ring-2 focus:ring-accent/30",children:[e.jsx("option",{value:"",children:"— select —"}),P.map(k=>e.jsx("option",{value:k,children:k},k))]}):e.jsx("input",{type:"text",value:u,placeholder:S.placeholder??"model name",onChange:k=>x(k.target.value),className:"w-full border border-border rounded-lg px-2.5 py-1.5 text-xs bg-surface text-content-secondary focus:outline-none focus:ring-2 focus:ring-accent/30"})]}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Cloud providers also need an API key — set it in the full editor."}),e.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[e.jsxs(nf,{to:"/env-config",onClick:()=>a(!1),className:"text-[11px] text-accent hover:underline flex items-center gap-1",children:[e.jsx(wr,{size:11})," More settings"]}),e.jsxs("button",{type:"button",onClick:()=>M.mutate(),disabled:!o||M.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold bg-accent text-white hover:brightness-110 disabled:opacity-40",children:[e.jsx(ga,{size:12})," ",M.isPending?"Saving…":"Save"]})]})]})]})]}):null}function UN({title:s,onMenuClick:r}){const{panelOpen:a}=Bl(),{data:o}=ex(),{theme:c,toggle:u}=yj(),x=(o?.modified.length??0)+(o?.added.length??0)+(o?.deleted.length??0)+(o?.untracked.length??0);return e.jsxs("header",{className:"h-14 bg-surface border-b border-border flex items-center px-5 gap-3 flex-shrink-0",children:[e.jsx("button",{type:"button",onClick:r,className:"p-1.5 rounded-lg hover:bg-surface-inset text-content-tertiary lg:hidden transition-colors","aria-label":"Toggle sidebar",children:e.jsx(Dv,{size:18})}),e.jsx("h1",{className:"text-sm font-semibold text-content tracking-tight flex-1",children:s}),e.jsx(_N,{}),e.jsx(FN,{}),e.jsx(DN,{}),e.jsx("button",{type:"button",onClick:u,className:O("p-2 rounded-lg transition-all duration-200",c==="dark"?"bg-surface-inset text-amber-400 hover:bg-surface-overlay":"text-content-tertiary hover:bg-surface-inset hover:text-content-secondary"),"aria-label":c==="dark"?"Switch to light mode":"Switch to dark mode",title:c==="dark"?"Light mode":"Dark mode",children:c==="dark"?e.jsx(Jv,{size:16}):e.jsx(Lv,{size:16})}),e.jsxs("button",{type:"button",onClick:()=>Je.togglePanel(),className:O("relative flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-all duration-200",a?"bg-accent-muted text-accent border border-accent/20":"text-content-tertiary hover:bg-surface-inset hover:text-content-secondary border border-transparent"),"aria-label":"Toggle Git panel",title:"Git Control Center",children:[e.jsx($n,{size:14}),e.jsx("span",{className:"hidden sm:inline",children:"Git"}),x>0&&e.jsx("span",{className:"absolute -top-1.5 -right-1.5 w-4 h-4 rounded-full bg-amber-500 text-white text-[9px] font-bold flex items-center justify-center ring-2 ring-surface",children:x>9?"9+":x})]})]})}function we({variant:s="primary",size:r="md",loading:a=!1,children:o,className:c,disabled:u,...x}){return e.jsxs("button",{...x,disabled:u||a,className:O("inline-flex items-center justify-center gap-2 font-medium rounded-lg transition-all duration-150","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1",{"bg-gradient-to-b from-accent to-accent-dark text-white shadow-sm hover:shadow-md hover:brightness-110 focus-visible:ring-accent":s==="primary","bg-surface border border-border text-content-secondary hover:bg-surface-inset hover:text-content hover:border-border-strong focus-visible:ring-accent":s==="secondary","text-content-secondary hover:bg-surface-inset hover:text-content focus-visible:ring-accent/40":s==="ghost","bg-gradient-to-b from-red-500 to-red-600 text-white shadow-sm hover:shadow-md hover:brightness-110 focus-visible:ring-red-500":s==="danger","px-2.5 py-1.5 text-xs gap-1.5":r==="sm","px-4 py-2 text-sm":r==="md","px-5 py-2.5 text-sm":r==="lg","opacity-40 cursor-not-allowed pointer-events-none":u||a},c),children:[a&&e.jsxs("svg",{className:"animate-spin h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-20",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),e.jsx("path",{className:"opacity-80",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),o]})}function zr(s){const r=p.useRef(null),a=p.useRef(s);a.current=s;const o=p.useCallback(()=>{if(r.current?.readyState===WebSocket.OPEN)return;const c=new WebSocket(oj);r.current=c,c.onmessage=u=>{try{const x=JSON.parse(u.data),h=a.current[x.event];h&&h(x.data)}catch{}},c.onclose=()=>{setTimeout(o,3e3)},c.onerror=()=>{c.close()}},[]);p.useEffect(()=>(o(),()=>{r.current?.close()}),[o])}let El={isRunning:!1,runId:null,currentBrowser:null,currentCase:null,currentStep:null,completed:null,error:null,activeCases:new Map};const Eu=new Set;function ug(){Eu.forEach(s=>s())}function da(s){El=s(El),ug()}const Kd={subscribe(s){return Eu.add(s),()=>{Eu.delete(s)}},getSnapshot(){return El},reset(){El={isRunning:!1,runId:null,currentBrowser:null,currentCase:null,currentStep:null,completed:null,error:null,activeCases:new Map},ug()}};function tx(){const s=p.useSyncExternalStore(Kd.subscribe,Kd.getSnapshot),r=p.useCallback(f=>{const g=f;da(()=>({isRunning:!0,runId:g.runId,currentBrowser:null,currentCase:null,currentStep:null,completed:null,error:null,activeCases:new Map}))},[]),a=p.useCallback(f=>{const g=f;da(y=>{const N=new Map(y.activeCases);return N.set(g.caseId,g.caseName),{...y,isRunning:!0,currentBrowser:g.browser??y.currentBrowser,currentCase:g,currentStep:null,activeCases:N}})},[]),o=p.useCallback(f=>{da(g=>({...g,isRunning:!0,currentStep:f}))},[]),c=p.useCallback(f=>{da(g=>({...g,isRunning:!1,completed:f,currentCase:null,currentStep:null}))},[]),u=p.useCallback(f=>{const g=f;da(y=>({...y,isRunning:!1,error:g.error}))},[]),x=p.useCallback(()=>{da(f=>({...f,isRunning:!1,completed:f.completed??{runId:f.runId??"",passed:0,failed:0,skipped:0,duration:0},currentCase:null,currentStep:null}))},[]);zr({"run:start":r,"run:case":a,"run:step":o,"run:complete":c,"run:error":u,"run:stopped":x});const h=p.useCallback(()=>{Kd.reset()},[]);return{...s,reset:h}}function Vd(s,r){zr({[s]:r})}function Pp({data:s,maxHeight:r=32}){const a=Math.max(...s.map(o=>o.value),1);return e.jsx("div",{className:"flex items-end gap-[3px]",style:{height:r},children:s.map((o,c)=>e.jsx("div",{className:O("w-[6px] rounded-full transition-all duration-500",o.color),style:{height:`${Math.max(o.value/a*100,6)}%`}},c))})}function $N({rate:s,hasData:r=!1,size:a=80}){const c=(a-6)/2,u=2*Math.PI*c,x=u-s/100*u,h=r?"#ef4444":"var(--color-border)";return e.jsxs("div",{className:"relative",style:{width:a,height:a},children:[e.jsxs("svg",{width:a,height:a,className:"-rotate-90",children:[e.jsx("circle",{cx:a/2,cy:a/2,r:c,fill:"none",stroke:h,strokeWidth:6}),e.jsx("circle",{cx:a/2,cy:a/2,r:c,fill:"none",stroke:"#10b981",strokeWidth:6,strokeLinecap:"round",strokeDasharray:u,strokeDashoffset:x,className:"transition-all duration-1000 ease-out"})]}),e.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:e.jsxs("span",{className:"text-lg font-bold text-content tabular-nums",children:[s,"%"]})})]})}function BN({status:s}){const r={passed:"bg-emerald-500",failed:"bg-red-500",partial:"bg-amber-500",running:"bg-blue-500 animate-pulse",skipped:"bg-slate-400"};return e.jsx("span",{className:O("w-2 h-2 rounded-full flex-shrink-0",r[s]??"bg-slate-400")})}function qN(s,r){return s.filter(a=>a.suiteIds?.includes(r)).slice(-7).map(a=>({value:a.totalTests>0?Math.round(a.passed/a.totalTests*100):0,color:a.failed>0?"bg-red-400":"bg-emerald-400"}))}function HN(){const s=Vs(),{data:r=[],isLoading:a}=Oe({queryKey:["reports"],queryFn:()=>Nl.list(20)}),{data:o=[],isLoading:c}=Oe({queryKey:["suites"],queryFn:()=>Pr.list()}),{data:u}=Oe({queryKey:["healing-stats"],queryFn:()=>cn.stats(),staleTime:3e4,retry:!1}),x=tx(),h=a||c,f=r[0],g=o.reduce((w,F)=>w+(F.caseCount??0),0),y=o.filter(w=>(w.type??"ui")==="ui"),N=o.filter(w=>(w.type??"ui")==="api"),E=y.reduce((w,F)=>w+(F.caseCount??0),0),S=N.reduce((w,F)=>w+(F.caseCount??0),0),P=r.reduce((w,F)=>w+F.passed,0),M=r.reduce((w,F)=>w+F.failed,0),k=r.reduce((w,F)=>w+F.skipped,0),j=P+M>0?Math.round(P/(P+M)*100):0,v=P+M+k,z=r.filter(w=>w.duration).length>0?Math.round(r.filter(w=>w.duration).reduce((w,F)=>w+(F.duration??0),0)/r.filter(w=>w.duration).length/1e3):0,C=[...r].reverse().map(w=>({value:w.passed+w.failed+w.skipped,color:w.status==="passed"?"bg-emerald-400":w.status==="failed"?"bg-red-400":"bg-amber-400"}));return h?e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex-shrink-0 px-8 pt-6 pb-4",children:[e.jsx("div",{className:"h-7 w-48 rounded-lg skeleton-shimmer"}),e.jsx("div",{className:"h-4 w-72 rounded-lg skeleton-shimmer mt-2"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-8 pb-8",children:[e.jsx("div",{className:"grid grid-cols-4 gap-4 mb-6",children:[1,2,3,4].map(w=>e.jsx("div",{className:"h-28 rounded-2xl skeleton-shimmer"},w))}),e.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(w=>e.jsx("div",{className:"h-64 rounded-2xl skeleton-shimmer"},w))})]})]}):e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex-shrink-0 px-8 pt-6 pb-4 flex items-end justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-content tracking-tight",children:"Dashboard"}),e.jsx("p",{className:"text-sm text-content-tertiary mt-0.5",children:"Test automation health at a glance"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(we,{size:"sm",variant:"secondary",onClick:()=>s("/run"),children:[e.jsx(Xt,{size:13})," Run Tests"]}),e.jsxs(we,{size:"sm",onClick:()=>s("/story"),children:[e.jsx(Bt,{size:13})," Generate"]})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-8 pb-8 space-y-5",children:[x.isRunning&&e.jsx("div",{className:"rounded-2xl border border-accent/25 bg-gradient-to-r from-accent/[0.06] via-accent/[0.03] to-transparent p-4 animate-fade-in",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative w-8 h-8 flex-shrink-0",children:[e.jsx("div",{className:"absolute inset-0 rounded-full border-2 border-accent/20"}),e.jsx("div",{className:"absolute inset-0 rounded-full border-2 border-transparent border-t-accent animate-spin"})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-semibold text-content",children:"Run in progress..."}),x.currentCase&&e.jsxs("p",{className:"text-xs text-content-secondary truncate mt-0.5",children:[x.currentCase.caseName,x.currentStep&&` › ${x.currentStep.instruction}`]})]}),e.jsxs(we,{size:"sm",variant:"ghost",onClick:()=>s("/run"),children:["View ",e.jsx(fr,{size:12})]})]})}),x.completed&&!x.isRunning&&(()=>{const w=x.completed,F=w.failed===0&&w.passed>0,Q=w.failed>0,Z=F?{border:"border-emerald-200/50",bg:"bg-gradient-to-r from-emerald-50/80 to-transparent",icon:"text-emerald-500",title:"text-emerald-800",subtitle:"text-emerald-600",label:"All tests passed"}:Q?{border:"border-red-200/50",bg:"bg-gradient-to-r from-red-50/80 to-transparent",icon:"text-red-500",title:"text-red-800",subtitle:"text-red-600",label:"Completed with failures"}:{border:"border-amber-200/50",bg:"bg-gradient-to-r from-amber-50/80 to-transparent",icon:"text-amber-500",title:"text-amber-800",subtitle:"text-amber-600",label:"Run completed"},le=F?He:Q?St:gs;return e.jsx("div",{className:O("rounded-2xl border p-4 animate-fade-in",Z.border,Z.bg),children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(le,{size:20,className:O(Z.icon,"flex-shrink-0")}),e.jsxs("div",{children:[e.jsx("p",{className:O("text-sm font-semibold",Z.title),children:Z.label}),e.jsxs("p",{className:O("text-xs mt-0.5",Z.subtitle),children:[w.passed," passed / ",w.failed," failed / ",w.skipped," skipped"]})]})]}),e.jsx(we,{variant:"secondary",size:"sm",onClick:()=>s("/reports"),children:"View Report"})]})})})(),e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"rounded-2xl border border-border bg-surface p-5 flex flex-col justify-between",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-indigo-50 border border-indigo-100 flex items-center justify-center",children:e.jsx(Er,{size:18,className:"text-indigo-500"})}),e.jsx("span",{className:"text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Coverage"})]}),e.jsxs("div",{className:"mt-4",children:[e.jsx("p",{className:"text-3xl font-extrabold text-content tabular-nums tracking-tight",children:o.length}),e.jsx("p",{className:"text-xs text-content-tertiary mt-0.5",children:"test suites"})]}),e.jsxs("div",{className:"mt-3 pt-3 border-t border-border-muted flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(gr,{size:11,className:"text-blue-500"}),e.jsxs("span",{className:"text-[11px] text-content-secondary font-medium",children:[y.length," UI"]}),e.jsxs("span",{className:"text-[10px] text-content-tertiary",children:["(",E,")"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Bv,{size:11,className:"text-purple-500"}),e.jsxs("span",{className:"text-[11px] text-content-secondary font-medium",children:[N.length," API"]}),e.jsxs("span",{className:"text-[10px] text-content-tertiary",children:["(",S,")"]})]})]})]}),e.jsxs("div",{className:"rounded-2xl border border-border bg-surface p-5 flex flex-col items-center justify-center",children:[e.jsx("span",{className:"text-[10px] font-semibold text-content-tertiary uppercase tracking-wider mb-3",children:"Pass Rate"}),e.jsx($N,{rate:r.length>0?j:0,hasData:P+M>0}),e.jsx("p",{className:"text-[11px] text-content-tertiary mt-2",children:P+M>0?`${P} of ${P+M} cases passed`:"no runs yet"})]}),e.jsxs("div",{className:"rounded-2xl border border-border bg-surface p-5 flex flex-col justify-between",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-teal-50 border border-teal-100 flex items-center justify-center",children:e.jsx(dv,{size:18,className:"text-teal-500"})}),e.jsx("span",{className:"text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Execution"})]}),e.jsxs("div",{className:"mt-4",children:[e.jsx("p",{className:"text-3xl font-extrabold text-content tabular-nums tracking-tight",children:v}),e.jsx("p",{className:"text-xs text-content-tertiary mt-0.5",children:"tests executed"})]}),e.jsxs("div",{className:"mt-3 pt-3 border-t border-border-muted grid grid-cols-3 gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(He,{size:10,className:"text-emerald-500"}),e.jsx("span",{className:"text-[11px] font-semibold text-emerald-600 tabular-nums",children:P})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(St,{size:10,className:"text-red-500"}),e.jsx("span",{className:"text-[11px] font-semibold text-red-500 tabular-nums",children:M})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Ll,{size:10,className:"text-content-tertiary"}),e.jsx("span",{className:"text-[11px] font-semibold text-content-tertiary tabular-nums",children:k})]})]})]}),e.jsxs("div",{className:"rounded-2xl border border-border bg-surface p-5 flex flex-col justify-between",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-amber-50 border border-amber-100 flex items-center justify-center",children:e.jsx(ct,{size:18,className:"text-amber-500"})}),e.jsx("span",{className:"text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Insights"})]}),e.jsxs("div",{className:"mt-4 space-y-2.5",children:[e.jsx("div",{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[11px] text-content-tertiary",children:"Avg Duration"}),e.jsx("span",{className:"text-sm font-bold text-content tabular-nums",children:z>0?`${z}s`:"—"})]})}),e.jsx("div",{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[11px] text-content-tertiary",children:"Self-Healed"}),e.jsx("span",{className:"text-sm font-bold text-emerald-600 tabular-nums",children:u?.accepted??0})]})}),e.jsx("div",{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[11px] text-content-tertiary",children:"Pending Review"}),e.jsx("span",{className:O("text-sm font-bold tabular-nums",(u?.pending??0)>0?"text-amber-500":"text-content-tertiary"),children:u?.pending??0})]})})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"lg:col-span-2 rounded-2xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-accent-muted flex items-center justify-center",children:e.jsx(Zv,{size:14,className:"text-accent"})}),e.jsx("h2",{className:"text-sm font-semibold text-content",children:"Recent Runs"})]}),r.length>0&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Pp,{data:C,maxHeight:24}),e.jsxs("button",{onClick:()=>s("/reports"),className:"text-xs text-accent font-medium hover:underline flex items-center gap-0.5",children:["View all ",e.jsx(fr,{size:11})]})]})]}),r.length===0?e.jsxs("div",{className:"px-5 py-12 text-center",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl bg-surface-inset flex items-center justify-center mx-auto mb-3",children:e.jsx(Ts,{size:20,className:"text-content-tertiary"})}),e.jsx("p",{className:"text-sm font-medium text-content-secondary",children:"No runs yet"}),e.jsx("p",{className:"text-xs text-content-tertiary mt-1 mb-4",children:"Execute your first test run to see results here"}),e.jsxs(we,{size:"sm",onClick:()=>s("/run"),children:[e.jsx(Xt,{size:12})," Start a Run"]})]}):e.jsxs("div",{className:"divide-y divide-border-muted",children:[e.jsxs("div",{className:"grid grid-cols-[1fr_100px_140px_80px_60px] px-5 py-2 text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:[e.jsx("span",{children:"Run ID"}),e.jsx("span",{children:"Status"}),e.jsx("span",{children:"Results"}),e.jsx("span",{children:"Duration"}),e.jsx("span",{className:"text-right",children:"Time"})]}),r.slice(0,6).map(w=>{const F=w.passed+w.failed+w.skipped,Q=F>0?Math.round(w.passed/F*100):0;return e.jsxs("div",{onClick:()=>s("/reports"),className:"grid grid-cols-[1fr_100px_140px_80px_60px] items-center px-5 py-3 hover:bg-surface-inset cursor-pointer transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(BN,{status:w.status}),e.jsx("span",{className:"text-xs font-mono text-content-secondary truncate",children:w.runId.slice(0,10)})]}),e.jsx("div",{children:e.jsx("span",{className:O("text-[10px] font-semibold px-2 py-0.5 rounded-md uppercase tracking-wide",w.status==="passed"?"bg-emerald-50 text-emerald-700":w.status==="failed"?"bg-red-50 text-red-700":"bg-amber-50 text-amber-700"),children:w.status})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1 h-1.5 bg-surface-inset rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-emerald-400 rounded-full transition-all duration-500",style:{width:`${Q}%`}})}),e.jsxs("span",{className:"text-[11px] text-content-secondary tabular-nums w-12 text-right",children:[w.passed,"/",F]})]}),e.jsx("span",{className:"text-[11px] text-content-tertiary tabular-nums",children:w.duration?`${(w.duration/1e3).toFixed(1)}s`:"—"}),e.jsx("span",{className:"text-[10px] text-content-tertiary text-right",children:Cl(new Date(w.startedAt),{addSuffix:!1})})]},w.runId)})]})]}),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"rounded-2xl border border-border bg-surface overflow-hidden flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-indigo-50 border border-indigo-100 flex items-center justify-center",children:e.jsx(Mi,{size:14,className:"text-indigo-500"})}),e.jsx("h2",{className:"text-sm font-semibold text-content",children:"Test Suites"})]}),e.jsxs("span",{className:"text-[10px] font-semibold text-content-tertiary bg-surface-inset px-2 py-0.5 rounded-md",children:[g," cases"]})]}),o.length===0?e.jsxs("div",{className:"px-5 py-8 text-center",children:[e.jsx("p",{className:"text-sm text-content-tertiary mb-3",children:"No suites yet"}),e.jsx(we,{size:"sm",onClick:()=>s("/tests"),children:"Create Suite"})]}):e.jsx("ul",{className:"divide-y divide-border-muted max-h-[200px] overflow-y-auto",children:o.map(w=>e.jsxs("li",{onClick:()=>s("/tests"),className:"flex items-center justify-between px-5 py-2.5 hover:bg-surface-inset cursor-pointer transition-colors group",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-sm text-content font-medium truncate",children:w.name}),e.jsx("span",{className:O("text-[9px] px-1.5 py-0.5 rounded font-bold uppercase flex-shrink-0",(w.type??"ui")==="api"?"bg-purple-50 text-purple-600":"bg-blue-50 text-blue-600"),children:(w.type??"ui").toUpperCase()})]}),e.jsxs("p",{className:"text-[11px] text-content-tertiary mt-0.5",children:[w.caseCount??0," cases"]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(Pp,{data:qN(r,w.id),maxHeight:24}),e.jsx(fr,{size:13,className:"text-content-tertiary opacity-0 group-hover:opacity-100 transition-opacity"})]})]},w.id))})]}),e.jsx("div",{className:"grid grid-cols-2 gap-2.5",children:[{label:"Smart Tests",icon:Bt,to:"/story",gradient:"from-violet-500 to-indigo-600"},{label:"Self-Healing",icon:bl,to:"/healing",gradient:"from-rose-500 to-pink-600"},{label:"Variables",icon:Xu,to:"/variables",gradient:"from-teal-500 to-cyan-600"},{label:"Reports",icon:Ts,to:"/reports",gradient:"from-amber-500 to-orange-600"}].map(({label:w,icon:F,to:Q,gradient:Z})=>e.jsxs("button",{type:"button",onClick:()=>s(Q),className:"group relative overflow-hidden rounded-xl border border-border bg-surface px-3.5 py-3 hover:border-border-strong hover:shadow-card transition-all duration-200 flex items-center gap-3",children:[e.jsx("div",{className:O("w-8 h-8 rounded-lg bg-gradient-to-br flex items-center justify-center flex-shrink-0",Z),children:e.jsx(F,{size:14,className:"text-white"})}),e.jsx("p",{className:"text-xs font-semibold text-content group-hover:text-accent transition-colors",children:w})]},Q))})]})]}),f&&e.jsx("div",{className:"rounded-2xl border border-border bg-surface px-6 py-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:O("w-10 h-10 rounded-xl flex items-center justify-center",f.status==="passed"?"bg-emerald-50 border border-emerald-100":f.status==="failed"?"bg-red-50 border border-red-100":"bg-amber-50 border border-amber-100"),children:f.status==="passed"?e.jsx(He,{size:18,className:"text-emerald-500"}):f.status==="failed"?e.jsx(gs,{size:18,className:"text-red-500"}):e.jsx(gp,{size:18,className:"text-amber-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold text-content-secondary uppercase tracking-wider",children:"Last Run"}),e.jsxs("p",{className:"text-sm font-bold text-content mt-0.5",children:[f.passed," passed, ",f.failed," failed",f.skipped>0&&`, ${f.skipped} skipped`]})]})]}),e.jsxs("div",{className:"flex items-center gap-6 text-xs text-content-tertiary",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Cr,{size:12}),e.jsx("span",{children:Cl(new Date(f.startedAt),{addSuffix:!0})})]}),f.duration&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(gp,{size:12}),e.jsxs("span",{children:[(f.duration/1e3).toFixed(1),"s"]})]}),e.jsx("div",{className:"flex items-center gap-1.5 font-mono",children:e.jsxs("span",{children:["#",f.runId.slice(0,8)]})}),e.jsxs(we,{size:"sm",variant:"ghost",onClick:()=>s("/reports"),children:["Details ",e.jsx(fr,{size:11})]})]})]})})]})]})}function Ws({open:s,title:r="Confirm Delete",message:a,confirmLabel:o="Delete",onConfirm:c,onCancel:u}){return p.useEffect(()=>{if(!s)return;const x=h=>{h.key==="Escape"&&u(),h.key==="Enter"&&(h.preventDefault(),c())};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[s,u]),s?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center animate-fade-in",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:u}),e.jsxs("div",{className:"relative bg-surface rounded-2xl shadow-modal w-full max-w-sm mx-4 p-6 animate-scale-in border border-border",children:[e.jsxs("div",{className:"flex items-start gap-3.5",children:[e.jsx("div",{className:"flex-shrink-0 w-10 h-10 rounded-xl bg-red-50 border border-red-200/50 flex items-center justify-center",children:e.jsx(gs,{size:18,className:"text-red-500"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-sm font-semibold text-content",children:r}),e.jsx("p",{className:"mt-1 text-sm text-content-secondary leading-relaxed",children:a})]})]}),e.jsxs("div",{className:"mt-6 flex items-center justify-end gap-2.5",children:[e.jsx(we,{variant:"secondary",size:"sm",onClick:u,children:"Cancel"}),e.jsx(we,{variant:"danger",size:"sm",onClick:c,children:o})]})]})]}):null}function Gs(){const[s,r]=p.useState({open:!1,message:"",onConfirm:()=>{}}),a=p.useCallback((u,x)=>{r({open:!0,message:u,onConfirm:x})},[]),o=p.useCallback(()=>{r(u=>({...u,open:!1}))},[]),c=p.useCallback(()=>{s.onConfirm(),r(u=>({...u,open:!1}))},[s.onConfirm]);return{modalProps:{open:s.open,message:s.message,onConfirm:c,onCancel:o},confirmDelete:a}}const KN=[{id:"all",label:"All"},{id:"auth",label:"Auth"},{id:"crud",label:"CRUD"},{id:"navigation",label:"Navigation"},{id:"form",label:"Form"},{id:"api",label:"API"}],VN={auth:"bg-violet-50 text-violet-600",crud:"bg-blue-50 text-blue-600",navigation:"bg-teal-50 text-teal-600",form:"bg-orange-50 text-orange-600",api:"bg-purple-50 text-purple-600"};function WN({open:s,onClose:r,suiteId:a,onCreated:o}){const[c,u]=p.useState("all"),[x,h]=p.useState(null),{data:f=[],isLoading:g}=Oe({queryKey:["templates"],queryFn:()=>xj.list(),enabled:s}),y=oe({mutationFn:S=>qn.create(a,{name:S.name,description:S.description,steps:S.steps.map((P,M)=>({...P,id:crypto.randomUUID(),order:M+1}))}),onSuccess:()=>{$.success("Test case created from template"),o(),r()},onError:S=>{$.error(S.message),h(null)}}),N=S=>{h(S.id),y.mutate(S)},E=c==="all"?f:f.filter(S=>S.category===c);return s?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:r,children:e.jsxs("div",{className:"bg-surface rounded-2xl border border-border shadow-modal w-full max-w-2xl mx-4 overflow-hidden flex flex-col max-h-[85vh]",onClick:S=>S.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border flex-shrink-0",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-bold text-content",children:"Test Case Templates"}),e.jsx("p",{className:"text-[11px] text-content-tertiary mt-0.5",children:"Start from a pre-built template"})]}),e.jsx("button",{type:"button",onClick:r,className:"p-1.5 rounded-lg text-content-tertiary hover:bg-surface-inset hover:text-content transition-colors",children:e.jsx(_e,{size:14})})]}),e.jsx("div",{className:"flex gap-1 px-5 py-2.5 border-b border-border flex-shrink-0 overflow-x-auto",children:KN.map(S=>e.jsx("button",{type:"button",onClick:()=>u(S.id),className:O("px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors flex-shrink-0",c===S.id?"bg-accent text-white":"text-content-secondary hover:bg-surface-inset"),children:S.label},S.id))}),e.jsx("div",{className:"flex-1 overflow-y-auto p-5 min-h-0",children:g?e.jsx("div",{className:"grid grid-cols-2 gap-3",children:[1,2,3,4].map(S=>e.jsx("div",{className:"h-28 rounded-xl skeleton-shimmer"},S))}):E.length===0?e.jsx("div",{className:"py-12 text-center",children:e.jsx("p",{className:"text-sm text-content-tertiary",children:"No templates in this category"})}):e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:E.map(S=>e.jsxs("div",{className:"rounded-xl border border-border bg-surface p-4 flex flex-col gap-3 hover:border-border-strong hover:shadow-card transition-all",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-surface-inset flex items-center justify-center flex-shrink-0",children:e.jsx(Hs,{size:13,className:"text-content-secondary"})}),e.jsx("div",{className:"min-w-0",children:e.jsx("p",{className:"text-sm font-bold text-content truncate",children:S.name})})]}),e.jsx("span",{className:O("text-[9px] px-1.5 py-0.5 rounded font-bold uppercase flex-shrink-0",VN[S.category]??"bg-surface-inset text-content-tertiary"),children:S.category})]}),e.jsx("p",{className:"text-xs text-content-secondary leading-relaxed",children:S.description}),e.jsxs("div",{className:"flex items-center justify-between mt-auto",children:[e.jsxs("span",{className:"text-[10px] text-content-tertiary",children:[S.steps.length," step",S.steps.length!==1?"s":""]}),e.jsx("button",{type:"button",onClick:()=>N(S),disabled:y.isPending,className:O("flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",x===S.id?"bg-emerald-50 text-emerald-600 border border-emerald-200":"bg-accent/10 text-accent hover:bg-accent/20",y.isPending&&"opacity-50 cursor-not-allowed"),children:x===S.id?e.jsxs(e.Fragment,{children:[e.jsx(He,{size:11})," Creating..."]}):"Use Template"})]})]},S.id))})})]})}):null}function xg(){return Oe({queryKey:["suites"],queryFn:()=>Pr.list()})}function GN(){const s=Re();return oe({mutationFn:Pr.create,onSuccess:()=>{s.invalidateQueries({queryKey:["suites"]}),$.success("Suite created")},onError:r=>$.error(r.message)})}function mg(){const s=Re();return oe({mutationFn:({id:r,data:a})=>Pr.update(r,a),onSuccess:()=>{s.invalidateQueries({queryKey:["suites"]}),$.success("Suite updated")},onError:r=>$.error(r.message)})}function QN(){const s=Re();return oe({mutationFn:Pr.delete,onSuccess:()=>{s.invalidateQueries({queryKey:["suites"]}),$.success("Suite deleted")},onError:r=>$.error(r.message)})}function JN(s){return Oe({queryKey:["cases",s],queryFn:()=>qn.list(s),enabled:!!s})}function YN(s,r){return Oe({queryKey:["cases",s,r],queryFn:()=>qn.get(s,r),enabled:!!s&&!!r})}function Rp(s){const r=Re();return oe({mutationFn:a=>qn.create(s,a),onSuccess:()=>{r.invalidateQueries({queryKey:["cases",s]}),$.success("Test case created")},onError:a=>$.error(a.message)})}function XN(s){const r=Re();return oe({mutationFn:({caseId:a,data:o})=>qn.update(s,a,o),onSuccess:(a,{caseId:o})=>{r.invalidateQueries({queryKey:["cases",s]}),r.invalidateQueries({queryKey:["cases",s,o]}),$.success("Test case updated")},onError:a=>$.error(a.message)})}function ZN(s){const r=Re();return oe({mutationFn:a=>qn.delete(s,a),onSuccess:()=>{r.invalidateQueries({queryKey:["cases",s]}),$.success("Test case deleted")},onError:a=>$.error(a.message)})}function e2(s,r){const a=Re();return oe({mutationFn:o=>Rr.add(s,r,o),onSuccess:()=>{a.invalidateQueries({queryKey:["cases",s,r]})},onError:o=>$.error(o.message)})}function t2(s,r){const a=Re();return oe({mutationFn:({stepId:o,instruction:c,timeout:u,stepType:x,retries:h,mockUrl:f,mockResponse:g,mockStatus:y,runAudit:N,soft:E,visualCheck:S})=>Rr.update(s,r,o,{instruction:c,timeout:u,stepType:x,retries:h,mockUrl:f,mockResponse:g,mockStatus:y,runAudit:N,soft:E,visualCheck:S}),onSuccess:()=>{a.invalidateQueries({queryKey:["cases",s,r]})},onError:o=>$.error(o.message)})}function s2(s,r){const a=Re();return oe({mutationFn:o=>Rr.reorder(s,r,o),onSuccess:()=>{a.invalidateQueries({queryKey:["cases",s,r]})},onError:o=>$.error(o.message)})}function n2(s,r){const a=Re();return oe({mutationFn:o=>Rr.delete(s,r,o),onSuccess:()=>{a.invalidateQueries({queryKey:["cases",s,r]})},onError:o=>$.error(o.message)})}function r2(s,r){const a=Re();return oe({mutationFn:o=>Rr.generate(s,r,o),onSuccess:()=>{a.invalidateQueries({queryKey:["cases",s,r]}),$.success("Code generated")},onError:o=>$.error(o.message)})}function a2(s,r){const a=Re();return oe({mutationFn:()=>Rr.generateAll(s,r),onSuccess:o=>{a.invalidateQueries({queryKey:["cases",s,r]}),$.success(`Generated code for ${o.generated} step(s)`)},onError:o=>$.error(o.message)})}const zi=new Map,Pu=new Set;function hg(){for(const s of Pu)s()}function Wd(){return"all"}function Gd(s){return`suite:${s}`}function Qd(s,r){return`case:${s}:${r}`}function Jd(s,r){zi.set(s,{op:r,startedAt:Date.now()}),hg()}function Yd(s){zi.delete(s),hg()}function Xd(s){return zi.get(s)?.op??null}function i2(){const s=new Map,r=new Map;let a=null;for(const[o,c]of zi)o==="all"?a=c.op:o.startsWith("suite:")?s.set(o.slice(6),c.op):o.startsWith("case:")&&r.set(o.slice(5),c.op);return{allOp:a,busySuites:s,busyCases:r,activeCount:zi.size}}function o2(s){return Pu.add(s),()=>{Pu.delete(s)}}const Ct={startAll:s=>Jd(Wd(),s),finishAll:()=>Yd(Wd()),startSuite:(s,r)=>Jd(Gd(s),r),finishSuite:s=>Yd(Gd(s)),startCase:(s,r,a)=>Jd(Qd(s,r),a),finishCase:(s,r)=>Yd(Qd(s,r)),isAllBusy:()=>Xd(Wd()),isSuiteBusy:s=>Xd(Gd(s)),isCaseBusy:(s,r)=>Xd(Qd(s,r)),getSnapshot:i2,subscribe:o2};function $i(s,r){if(s.failed>0){const a=s.results.filter(o=>o.action==="failed");$.error(`${r}: ${s.failed} failed — ${a[0]?.error??"Unknown error"}`)}else if(s.created>0||s.synced>0){const a=[];s.created>0&&a.push(`${s.created} created`),s.synced>0&&a.push(`${s.synced} synced`),s.skipped>0&&a.push(`${s.skipped} skipped`),$.success(`Xray: ${a.join(", ")}`)}else s.skipped>0&&$.success(`Xray: ${s.skipped} already up to date`)}function l2(){return Oe({queryKey:["xray","status"],queryFn:()=>Tr.status(),retry:1,staleTime:1e4})}function pg(s){return Oe({queryKey:["xray","status",s],queryFn:()=>Tr.suiteStatus(s),enabled:!!s,retry:1,staleTime:1e4})}function c2(){const s=Re();return oe({mutationFn:()=>(Ct.startAll("create"),Tr.createAll()),onSuccess:r=>{Ct.finishAll(),s.invalidateQueries({queryKey:["xray"]}),$i(r,"Create in Xray")},onError:r=>{Ct.finishAll(),$.error(`Xray create failed: ${r.message}`)}})}function fg(){const s=Re();return oe({mutationFn:r=>(Ct.startSuite(r,"create"),Tr.createSuite(r)),onSuccess:(r,a)=>{Ct.finishSuite(a),s.invalidateQueries({queryKey:["xray"]}),$i(r,"Create Suite")},onError:(r,a)=>{Ct.finishSuite(a),$.error(`Xray create failed: ${r.message}`)}})}function gg(){const s=Re();return oe({mutationFn:({suiteId:r,caseId:a})=>(Ct.startCase(r,a,"create"),Tr.createCase(r,a)),onSuccess:(r,{suiteId:a,caseId:o})=>{Ct.finishCase(a,o),s.invalidateQueries({queryKey:["xray"]}),$i(r,"Create Case")},onError:(r,{suiteId:a,caseId:o})=>{Ct.finishCase(a,o),$.error(`Xray create failed: ${r.message}`)}})}function d2(){const s=Re();return oe({mutationFn:r=>(Ct.startSuite(r,"sync"),Tr.syncSuite(r)),onSuccess:(r,a)=>{Ct.finishSuite(a),s.invalidateQueries({queryKey:["xray"]}),$i(r,"Sync Suite")},onError:(r,a)=>{Ct.finishSuite(a),$.error(`Xray sync failed: ${r.message}`)}})}function yg(){const s=Re();return oe({mutationFn:({suiteId:r,caseId:a})=>(Ct.startCase(r,a,"sync"),Tr.syncCase(r,a)),onSuccess:(r,{suiteId:a,caseId:o})=>{Ct.finishCase(a,o),s.invalidateQueries({queryKey:["xray"]}),$i(r,"Sync Case")},onError:(r,{suiteId:a,caseId:o})=>{Ct.finishCase(a,o),$.error(`Xray sync failed: ${r.message}`)}})}function sx({code:s,maxLines:r,className:a}){const[o,c]=p.useState(!1),u=async()=>{await navigator.clipboard.writeText(s),c(!0),setTimeout(()=>c(!1),1500)},x=!s.trim();return e.jsxs("div",{className:O("relative rounded-xl bg-[#0d1117] text-slate-300 ring-1 ring-white/5 overflow-hidden",a),children:[!x&&e.jsx("button",{type:"button",onClick:()=>{u()},className:O("absolute top-2.5 right-2.5 p-1.5 rounded-md transition-all duration-150",o?"bg-emerald-500/20 text-emerald-400":"text-slate-500 hover:text-slate-300 hover:bg-white/10"),title:"Copy code",children:o?e.jsx(et,{size:13}):e.jsx(Wu,{size:13})}),e.jsx("pre",{className:O("p-4 text-xs font-mono leading-relaxed overflow-x-auto",r&&`line-clamp-${r}`),style:r?{maxHeight:`${r*1.5}rem`,overflow:"auto"}:void 0,children:e.jsx("code",{children:x?"// No code generated yet":s})})]})}const u2={"not-created":{bg:"bg-surface-inset",text:"text-content-tertiary",dot:"bg-content-tertiary",border:"border-border",label:"Not Created"},created:{bg:"bg-emerald-50",text:"text-emerald-700",dot:"bg-emerald-500",border:"border-emerald-200/60",label:"Created"},synced:{bg:"bg-emerald-50/60",text:"text-emerald-600",dot:"bg-emerald-400",border:"border-emerald-200/60",label:"Synced"},"update-pending":{bg:"bg-amber-50",text:"text-amber-700",dot:"bg-amber-500",border:"border-amber-200/60",label:"Update Pending"}};function nx({status:s,xrayKey:r}){const a=u2[s];return e.jsxs("span",{className:O("inline-flex items-center gap-1.5 px-2 py-0.5 rounded-md text-[10px] font-semibold whitespace-nowrap border tracking-wide",a.bg,a.text,a.border),children:[e.jsx("span",{className:O("w-1.5 h-1.5 rounded-full flex-shrink-0",a.dot)}),a.label,r&&e.jsxs("span",{className:"text-[9px] opacity-60 truncate max-w-[80px]",title:r,children:["(",r,")"]})]})}const x2={"not-created":{icon:Ul,label:"Push to Xray",title:"Create in Xray",btnClass:"bg-gradient-to-b from-emerald-500 to-emerald-600 hover:brightness-110 text-white shadow-sm",iconClass:"text-emerald-600",iconHover:"hover:bg-emerald-50"},"update-pending":{icon:Yu,label:"Sync Xray",title:"Sync changes to Xray",btnClass:"bg-gradient-to-b from-amber-500 to-amber-600 hover:brightness-110 text-white shadow-sm",iconClass:"text-amber-500",iconHover:"hover:bg-amber-50"},created:{icon:He,label:"Synced with Xray",title:"Up to date -- click to re-sync",btnClass:"bg-gradient-to-b from-emerald-500 to-emerald-600 hover:brightness-110 text-white shadow-sm",iconClass:"text-emerald-500",iconHover:"hover:bg-emerald-50"},synced:{icon:He,label:"Synced with Xray",title:"Up to date -- click to re-sync",btnClass:"bg-gradient-to-b from-emerald-500 to-emerald-600 hover:brightness-110 text-white shadow-sm",iconClass:"text-emerald-500",iconHover:"hover:bg-emerald-50"}};function Ai({status:s,onClick:r,busy:a=!1,variant:o="full",label:c}){const u=x2[s],x=u.icon,h=c??u.label;return o==="icon"?e.jsx("button",{type:"button",onClick:f=>{f.stopPropagation(),r()},title:a?"Processing...":u.title,className:O("p-1.5 rounded-lg transition-all duration-150",a?"cursor-wait opacity-50":O(u.iconClass,u.iconHover)),children:a?e.jsx(Me,{size:14,className:"animate-spin text-accent"}):e.jsx(x,{size:14})}):e.jsxs("button",{type:"button",onClick:()=>r(),title:a?"Processing...":u.title,className:O("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-all duration-150",a?"bg-surface-inset text-content-tertiary cursor-wait":u.btnClass),children:[a?e.jsx(Me,{size:13,className:"animate-spin"}):e.jsx(x,{size:13}),a?"Processing...":h]})}function m2(s){return Oe({queryKey:["hooks",s],queryFn:()=>Mr.get(s),enabled:!!s})}function h2(s){const r=Re();return oe({mutationFn:({hookType:a,instruction:o,order:c})=>Mr.addStep(s,a,{instruction:o,order:c}),onSuccess:()=>{r.invalidateQueries({queryKey:["hooks",s]})},onError:a=>$.error(a.message)})}function p2(s){const r=Re();return oe({mutationFn:({hookType:a,stepId:o,instruction:c,timeout:u})=>Mr.updateStep(s,a,o,{instruction:c,timeout:u}),onSuccess:()=>{r.invalidateQueries({queryKey:["hooks",s]})},onError:a=>$.error(a.message)})}function f2(s){const r=Re();return oe({mutationFn:({hookType:a,stepId:o})=>Mr.deleteStep(s,a,o),onSuccess:()=>{r.invalidateQueries({queryKey:["hooks",s]})},onError:a=>$.error(a.message)})}function g2(s){const r=Re();return oe({mutationFn:({hookType:a,stepIds:o})=>Mr.reorderSteps(s,a,o),onSuccess:()=>{r.invalidateQueries({queryKey:["hooks",s]})},onError:a=>$.error(a.message)})}function y2(s){const r=Re();return oe({mutationFn:({hookType:a,stepId:o})=>Mr.generateStep(s,a,o),onSuccess:()=>{r.invalidateQueries({queryKey:["hooks",s]}),$.success("Hook step code generated")},onError:a=>$.error(a.message)})}function b2(s){const r=Re();return oe({mutationFn:a=>Mr.generateAll(s,a),onSuccess:a=>{r.invalidateQueries({queryKey:["hooks",s]}),$.success(`Generated code for ${a.generated} hook step(s)`)},onError:a=>$.error(a.message)})}const v2=[{type:"before_all",label:"Before All",desc:"Runs once before all test cases in the suite",icon:e.jsx(kv,{size:16}),color:"text-emerald-600"},{type:"before_each",label:"Before Each",desc:"Runs before every test case",icon:e.jsx(Ll,{size:16}),color:"text-blue-600"},{type:"after_each",label:"After Each",desc:"Runs after every test case",icon:e.jsx(Wv,{size:16}),color:"text-amber-600"},{type:"after_all",label:"After All",desc:"Runs once after all test cases in the suite",icon:e.jsx(Sv,{size:16}),color:"text-red-500"}];function j2({suiteId:s,open:r,onClose:a}){const{data:o,isLoading:c}=m2(s);return r?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:a}),e.jsxs("div",{className:"relative w-full max-w-3xl max-h-[85vh] bg-surface rounded-xl shadow-2xl flex flex-col overflow-hidden mx-4",children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border bg-gradient-to-r from-slate-50 to-white",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-content",children:"Suite Hooks"}),e.jsx("p",{className:"text-xs text-content-tertiary mt-0.5",children:"Lifecycle hooks run setup/teardown around your test cases (Playwright hooks)"})]}),e.jsx("button",{onClick:a,className:"p-1.5 rounded-lg hover:bg-surface-inset transition-colors text-content-tertiary hover:text-content-secondary",children:e.jsx(_e,{size:18})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:c?e.jsx("div",{className:"flex items-center justify-center py-16",children:e.jsx(Me,{size:24,className:"animate-spin text-accent"})}):v2.map(u=>e.jsx(N2,{suiteId:s,hookType:u.type,label:u.label,description:u.desc,icon:u.icon,color:u.color,steps:o?.[u.type]??[]},u.type))})]})]}):null}function N2({suiteId:s,hookType:r,label:a,description:o,icon:c,color:u,steps:x}){const[h,f]=p.useState(x.length>0),[g,y]=p.useState(""),[N,E]=p.useState(""),[S,P]=p.useState(null),[M,k]=p.useState(""),[j,v]=p.useState(new Set),[z,C]=p.useState(null),[w,F]=p.useState(null),Q=h2(s),Z=f2(s),{modalProps:le,confirmDelete:K}=Gs(),J=g2(s),ue=p2(s),ke=y2(s),re=b2(s),be=()=>{g.trim()&&(Q.mutate({hookType:r,instruction:g.trim()}),y(""))},Ne=D=>{E(D),ke.mutate({hookType:r,stepId:D},{onSettled:()=>E("")})},ye=()=>{re.mutate(r)},_=D=>{if(!z||z===D){C(null),F(null);return}const ce=x.map(je=>je.id),G=ce.indexOf(z),xe=ce.indexOf(D);G<0||xe<0||(ce.splice(G,1),ce.splice(xe,0,z),J.mutate({hookType:r,stepIds:ce}),C(null),F(null))},Y=D=>{P(D.id),k(D.instruction)},L=D=>{M.trim()&&M!==x.find(ce=>ce.id===D)?.instruction&&ue.mutate({hookType:r,stepId:D,instruction:M.trim()}),P(null)},T=x.filter(D=>!D.generatedCode?.trim()).length;return e.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[e.jsxs("button",{type:"button",onClick:()=>f(!h),className:"w-full flex items-center gap-3 px-4 py-3 bg-surface-inset hover:bg-surface-inset transition-colors text-left",children:[h?e.jsx(kt,{size:14,className:"text-content-tertiary"}):e.jsx(Zt,{size:14,className:"text-content-tertiary"}),e.jsx("span",{className:O("flex-shrink-0",u),children:c}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-sm font-semibold text-content-secondary",children:a}),e.jsx("span",{className:"text-[10px] text-content-tertiary ml-2",children:o})]}),e.jsxs("span",{className:O("text-[10px] font-semibold px-2 py-0.5 rounded-full",x.length>0?"bg-accent/10 text-accent":"bg-slate-200 text-content-tertiary"),children:[x.length," step",x.length!==1?"s":""]})]}),h&&e.jsxs("div",{className:"border-t border-border bg-surface",children:[x.length===0?e.jsx("div",{className:"px-4 py-6 text-center",children:e.jsx("p",{className:"text-xs text-content-tertiary",children:"No steps yet — add one below"})}):e.jsx("div",{className:"divide-y divide-slate-100",children:x.map((D,ce)=>e.jsxs("div",{draggable:!0,onDragStart:()=>C(D.id),onDragOver:G=>{G.preventDefault(),F(D.id)},onDragLeave:()=>F(null),onDrop:()=>_(D.id),onDragEnd:()=>{C(null),F(null)},className:O("flex items-start gap-2 px-4 py-2.5 group transition-colors",w===D.id&&"bg-accent/5 border-l-2 border-accent",z===D.id&&"opacity-40"),children:[e.jsx("div",{className:"pt-0.5 cursor-grab text-content-tertiary opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx(Dl,{size:12})}),e.jsx("span",{className:"text-[10px] font-bold text-content-tertiary pt-0.5 w-4 flex-shrink-0",children:ce+1}),e.jsxs("div",{className:"flex-1 min-w-0",children:[S===D.id?e.jsx("input",{autoFocus:!0,className:"w-full text-xs border border-accent rounded px-2 py-1 focus:outline-none focus:ring-1 focus:ring-accent",value:M,onChange:G=>k(G.target.value),onBlur:()=>L(D.id),onKeyDown:G=>{G.key==="Enter"&&L(D.id),G.key==="Escape"&&P(null)}}):e.jsxs("p",{className:"text-xs text-content-secondary cursor-pointer hover:text-accent transition-colors flex items-center gap-1.5",onClick:()=>Y(D),title:"Click to edit",children:[D.instruction,D.generatedCode&&!j.has(D.id)&&e.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-green-400 flex-shrink-0",title:"Code generated"})]}),D.generatedCode&&j.has(D.id)&&e.jsx("div",{className:"mt-1",children:e.jsx(sx,{code:D.generatedCode,maxLines:6})})]}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[D.generatedCode&&e.jsx("button",{title:j.has(D.id)?"Hide code":"Show code",onClick:()=>v(G=>{const xe=new Set(G);return xe.has(D.id)?xe.delete(D.id):xe.add(D.id),xe}),className:O("p-1 rounded transition-colors",j.has(D.id)?"text-content-secondary bg-slate-100":"text-content-tertiary hover:bg-surface-inset"),children:e.jsx(Vu,{size:12})}),e.jsx("button",{title:"Generate code",onClick:()=>Ne(D.id),disabled:N===D.id,className:"p-1 rounded hover:bg-purple-50 text-purple-500 transition-colors",children:N===D.id?e.jsx(Me,{size:12,className:"animate-spin"}):e.jsx(kr,{size:12})}),e.jsx("button",{title:"Delete step",onClick:()=>K("Delete this hook step? This cannot be undone.",()=>Z.mutate({hookType:r,stepId:D.id})),className:"p-1 rounded hover:bg-red-50 text-red-400 transition-colors",children:e.jsx(es,{size:12})})]})]},D.id))}),e.jsxs("div",{className:"px-4 py-3 border-t border-slate-100 bg-surface-inset/50 flex items-center gap-2",children:[e.jsx("input",{className:"flex-1 text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-1 focus:ring-accent placeholder:text-content-tertiary",value:g,onChange:D=>y(D.target.value),onKeyDown:D=>{D.key==="Enter"&&be()},placeholder:"Add a step (e.g. Navigate to login page)"}),e.jsxs("button",{type:"button",onClick:be,disabled:!g.trim()||Q.isPending,className:O("inline-flex items-center gap-1 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-colors",g.trim()?"bg-accent text-white hover:bg-accent/90":"bg-slate-200 text-content-tertiary cursor-not-allowed"),children:[Q.isPending?e.jsx(Me,{size:11,className:"animate-spin"}):e.jsx(Ks,{size:11}),"Add"]}),x.length>0&&T>0&&e.jsxs("button",{type:"button",onClick:ye,disabled:re.isPending,className:"inline-flex items-center gap-1 px-2.5 py-1.5 rounded-lg text-xs font-medium bg-purple-600 text-white hover:bg-purple-700 transition-colors",children:[re.isPending?e.jsx(Me,{size:11,className:"animate-spin"}):e.jsx(kr,{size:11}),"Generate All (",T,")"]})]})]}),e.jsx(Ws,{...le})]})}const Mp={person:{icon:Zu,label:"Person"},internet:{icon:xn,label:"Internet"},phone:{icon:$v,label:"Phone"},location:{icon:Iv,label:"Location"},company:{icon:gv,label:"Company"},finance:{icon:xv,label:"Finance"},date:{icon:yv,label:"Date"},lorem:{icon:ej,label:"Lorem"},string:{icon:mv,label:"String"},number:{icon:Gu,label:"Number"},datatype:{icon:Yv,label:"Datatype"},image:{icon:Qu,label:"Image"},color:{icon:Uv,label:"Color"},commerce:{icon:Vv,label:"Commerce"},vehicle:{icon:bv,label:"Vehicle"},system:{icon:Mv,label:"System"}},Zd=[{name:"FIRST_NAME",example:"Alice"},{name:"LAST_NAME",example:"Smith"},{name:"AGE",example:"34"},{name:"EMAIL",example:"alice.smith123@example.com"},{name:"PHONE",example:"415-782-3901"},{name:"PASSWORD",example:"Xk9#mP2$qL"}];function ji(s,r){return s==="classic"?`{{FAKE_${r}}}`:`{{FAKE_${s}_${r}}}`.toUpperCase()}async function w2(){const s=await fetch("/api/faker/generators");if(!s.ok)throw new Error("Failed to load generators");return s.json()}function k2({onInsert:s}){const[r,a]=p.useState(!1),[o,c]=p.useState("person"),[u,x]=p.useState(""),[h,f]=p.useState("6"),[g,y]=p.useState([]),{data:N=[],isLoading:E}=Oe({queryKey:["faker-generators"],queryFn:w2,enabled:r,staleTime:1/0}),S=p.useMemo(()=>{if(!u.trim())return null;const w=u.toLowerCase(),F=[];for(const Q of N)for(const Z of Q.methods){const le=`${Q.category}_${Z.name}`.toLowerCase();(Z.name.toLowerCase().includes(w)||Q.category.toLowerCase().includes(w)||le.includes(w)||Z.example.toLowerCase().includes(w))&&F.push({category:Q.category,method:Z})}for(const Q of Zd)(Q.name.toLowerCase().includes(w)||Q.example.toLowerCase().includes(w))&&F.push({category:"classic",method:Q});return F},[u,N]),P=p.useMemo(()=>o==="classic"?null:N.find(w=>w.category===o)?.methods??[],[o,N]),M=p.useCallback((w,F)=>{const Q=ji(w,F);y(Z=>Z.includes(Q)?Z.filter(le=>le!==Q):[...Z,Q])},[]),k=p.useCallback(()=>{g.length>0&&s(g.join(", ")),y([]),a(!1),x("")},[g,s]),j=p.useCallback(()=>{g.length>0&&s(g.join(", ")),y([]),a(!1),x("")},[g,s]),v=p.useCallback(w=>{y(F=>F.filter(Q=>Q!==w))},[]),z=()=>{const F=`{{FAKE_NUMBER_${Math.max(1,Math.min(20,parseInt(h,10)||6))}}}`;y(Q=>Q.includes(F)?Q:[...Q,F])},C=p.useMemo(()=>[...N.map(F=>F.category),"classic"],[N]);return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:()=>a(!0),title:"Insert dynamic data token",className:O("inline-flex items-center justify-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs font-medium border transition-all duration-150 focus:outline-none","bg-gradient-to-b from-violet-500 to-violet-600 text-white border-violet-700 shadow-sm hover:brightness-110 hover:shadow-md"),children:[e.jsx(Bt,{size:12}),e.jsx("span",{className:"hidden sm:inline",children:"Fake Data"}),e.jsx(kt,{size:10})]}),r&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm animate-fade-in",onClick:w=>{w.target===w.currentTarget&&j()},children:e.jsxs("div",{className:"bg-surface rounded-2xl shadow-modal w-full max-w-2xl mx-4 overflow-hidden border border-border animate-scale-in flex flex-col",style:{maxHeight:"min(640px, 85vh)"},children:[e.jsxs("div",{className:"flex items-center gap-3 px-5 py-3.5 border-b border-border bg-gradient-to-r from-violet-50 to-indigo-50 dark:from-violet-500/10 dark:to-indigo-500/10 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[e.jsx(Bt,{size:16,className:"text-violet-500 dark:text-violet-400"}),e.jsx("h2",{className:"text-sm font-bold text-violet-800 dark:text-violet-200",children:"Faker Data"}),e.jsxs("span",{className:"text-[10px] text-violet-500 dark:text-violet-300 bg-violet-100 dark:bg-violet-500/20 px-2 py-0.5 rounded-full font-medium",children:[N.reduce((w,F)=>w+F.methods.length,0)+Zd.length,"+ generators"]})]}),e.jsx("button",{type:"button",onClick:j,className:"p-1 rounded-lg hover:bg-violet-100 dark:hover:bg-violet-500/20 text-violet-400 hover:text-violet-600 dark:hover:text-violet-300 transition-colors",children:e.jsx(_e,{size:16})})]}),e.jsx("div",{className:"px-5 py-3 border-b border-border flex-shrink-0",children:e.jsxs("div",{className:"flex items-center gap-2 bg-surface-inset rounded-xl px-3 py-2 border border-border focus-within:border-violet-300 focus-within:ring-2 focus-within:ring-violet-100 transition-all",children:[e.jsx(Bn,{size:14,className:"text-content-tertiary flex-shrink-0"}),e.jsx("input",{type:"text",value:u,onChange:w=>x(w.target.value),placeholder:"Search generators... (e.g. email, address, uuid)",className:"flex-1 bg-transparent outline-none text-sm text-content placeholder:text-content-tertiary",autoFocus:!0}),u&&e.jsx("button",{type:"button",onClick:()=>x(""),className:"text-content-tertiary hover:text-content transition-colors",children:e.jsx(_e,{size:12})})]})}),e.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[e.jsx("div",{className:"w-40 flex-shrink-0 border-r border-border overflow-y-auto bg-surface-inset/40 py-2 px-2 space-y-0.5",children:E?e.jsx("div",{className:"space-y-2 px-1",children:Array.from({length:8}).map((w,F)=>e.jsx("div",{className:"h-7 rounded-lg bg-surface-inset animate-pulse"},F))}):C.map(w=>{const F=Mp[w]??{icon:Er,label:w.charAt(0).toUpperCase()+w.slice(1)},Q=w==="classic"?Bt:F.icon,Z=w==="classic"?"Classic":F.label;return e.jsxs("button",{type:"button",onClick:()=>{c(w),x("")},className:O("w-full flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-[11px] font-medium transition-all text-left",o===w&&!u?"bg-violet-100 text-violet-700 dark:bg-violet-500/20 dark:text-violet-200 shadow-sm":"text-content-secondary hover:bg-surface-inset hover:text-content"),children:[e.jsx(Q,{size:13,className:"flex-shrink-0"}),e.jsx("span",{className:"truncate",children:Z})]},w)})}),e.jsx("div",{className:"flex-1 overflow-y-auto py-2 px-3",children:E?e.jsx("div",{className:"space-y-2",children:Array.from({length:6}).map((w,F)=>e.jsx("div",{className:"h-12 rounded-xl bg-surface-inset animate-pulse"},F))}):S?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest px-1 mb-2",children:[S.length," result",S.length!==1?"s":"",' for "',u,'"']}),S.length===0?e.jsx("p",{className:"text-sm text-content-tertiary text-center py-8",children:"No generators found. Try a different search term."}):e.jsx("div",{className:"space-y-1",children:S.map(({category:w,method:F})=>e.jsx(eu,{category:w,method:F,selected:g.includes(ji(w,F.name)),onToggle:M},`${w}-${F.name}`))})]}):o==="classic"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest px-1 mb-2",children:"Classic Tokens (backward-compatible)"}),e.jsx("div",{className:"space-y-1",children:Zd.map(w=>e.jsx(eu,{category:"classic",method:w,selected:g.includes(ji("classic",w.name)),onToggle:M},w.name))}),e.jsxs("div",{className:"mt-4 pt-3 border-t border-border",children:[e.jsxs("p",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest px-1 mb-2 flex items-center gap-1",children:[e.jsx(Gu,{size:10})," Random Number"]}),e.jsxs("div",{className:"flex items-center gap-2 px-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-1 bg-surface-inset rounded-lg px-3 py-2 border border-border",children:[e.jsx("span",{className:"text-[11px] text-content-tertiary",children:"Digits:"}),e.jsx("input",{type:"number",min:1,max:20,value:h,onChange:w=>f(w.target.value),onKeyDown:w=>w.key==="Enter"&&z(),className:"w-12 text-sm bg-transparent outline-none text-content font-mono tabular-nums"})]}),e.jsx("button",{type:"button",onClick:z,className:"flex-shrink-0 px-3 py-2 rounded-lg bg-violet-600 hover:bg-violet-700 text-white text-[11px] font-semibold transition-colors",children:"+ Add"})]}),e.jsx("p",{className:"text-[10px] text-content-tertiary px-1 mt-2 font-mono",children:`→ {{FAKE_NUMBER_${Math.max(1,parseInt(h,10)||6)}}}`})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest px-1 mb-2",children:[Mp[o]?.label??o," — ",P?.length??0," generators"]}),e.jsx("div",{className:"space-y-1",children:(P??[]).map(w=>e.jsx(eu,{category:o,method:w,selected:g.includes(ji(o,w.name)),onToggle:M},w.name))})]})})]}),g.length>0&&e.jsxs("div",{className:"px-5 py-2.5 border-t border-border bg-violet-50/50 dark:bg-violet-500/10 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsxs("span",{className:"text-[10px] font-bold text-violet-600 dark:text-violet-300 uppercase tracking-wider",children:["Selected (",g.length,")"]}),e.jsx("button",{type:"button",onClick:()=>y([]),className:"text-[10px] text-violet-400 hover:text-violet-600 dark:hover:text-violet-300 transition-colors underline",children:"Clear all"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 max-h-16 overflow-y-auto",children:g.map(w=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-lg bg-violet-100 text-violet-700 border border-violet-200 dark:bg-violet-500/20 dark:text-violet-200 dark:border-violet-500/30 text-[10px] font-mono",children:[w,e.jsx("button",{type:"button",onClick:()=>v(w),className:"text-violet-400 hover:text-violet-700 dark:hover:text-violet-200 transition-colors",children:e.jsx(_e,{size:10})})]},w))})]}),e.jsxs("div",{className:"px-5 py-2.5 bg-surface-inset/60 border-t border-border flex items-center justify-between flex-shrink-0",children:[e.jsxs("p",{className:"text-[10px] text-content-tertiary",children:["Click to select multiple tokens. They will be inserted ",e.jsx("strong",{children:"comma-separated"}),"."]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>{y([]),a(!1),x("")},className:"px-3 py-1.5 rounded-lg border border-border text-xs font-medium text-content-secondary hover:bg-surface-inset transition-colors",children:"Cancel"}),e.jsxs("button",{type:"button",onClick:k,disabled:g.length===0,className:O("px-4 py-1.5 rounded-lg text-xs font-semibold transition-all",g.length>0?"bg-violet-600 hover:bg-violet-700 text-white shadow-sm":"bg-violet-200 text-violet-400 dark:bg-violet-500/15 dark:text-violet-400/60 cursor-not-allowed"),children:["Insert ",g.length>0?`${g.length} token${g.length>1?"s":""}`:""]})]})]})]})})]})}function eu({category:s,method:r,selected:a,onToggle:o}){const c=ji(s,r.name);return e.jsxs("button",{type:"button",onClick:()=>o(s,r.name),className:O("w-full flex items-center justify-between gap-3 px-3 py-2 rounded-xl transition-colors group text-left",a?"bg-violet-100 border border-violet-200 dark:bg-violet-500/20 dark:border-violet-500/30 shadow-sm":"hover:bg-violet-50 dark:hover:bg-violet-500/10 border border-transparent"),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx("div",{className:O("flex-shrink-0 w-4 h-4 rounded flex items-center justify-center border transition-all",a?"bg-violet-600 border-violet-600":"border-gray-300 dark:border-gray-600 group-hover:border-violet-400"),children:a&&e.jsx(et,{size:10,className:"text-white",strokeWidth:3})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[s!=="classic"&&e.jsx("span",{className:O("text-[9px] px-1.5 py-0.5 rounded font-medium uppercase flex-shrink-0",a?"text-violet-600 bg-violet-200 dark:text-violet-200 dark:bg-violet-500/30":"text-violet-400 bg-violet-50 group-hover:bg-violet-100 dark:bg-violet-500/15 dark:group-hover:bg-violet-500/25"),children:s}),e.jsx("p",{className:O("text-[12px] font-medium truncate",a?"text-violet-700 dark:text-violet-200":"text-content group-hover:text-violet-700 dark:group-hover:text-violet-300"),children:r.name})]}),e.jsx("p",{className:"text-[9px] text-content-tertiary font-mono truncate mt-0.5",children:c})]})]}),e.jsx("span",{className:"text-[10px] text-content-tertiary bg-surface-inset px-2 py-1 rounded-lg font-mono flex-shrink-0 max-w-[180px] truncate",children:r.example})]})}function S2(s){return s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`}function C2(s){return new Promise((r,a)=>{const o=new FileReader;o.onload=()=>{const c=String(o.result);r(c.slice(c.indexOf(",")+1))},o.onerror=()=>a(o.error),o.readAsDataURL(s)})}function E2({onInsert:s}){const[r,a]=p.useState(!1),o=p.useRef(null),c=Re(),{data:u=[],isLoading:x}=Oe({queryKey:["files"],queryFn:ki.list,enabled:r}),h=oe({mutationFn:async y=>{const N=await C2(y);return ki.upload(y.name,N)},onSuccess:y=>{$.success(`Uploaded ${y.name}`),c.invalidateQueries({queryKey:["files"]})},onError:y=>$.error(y.message)}),f=oe({mutationFn:y=>ki.remove(y),onSuccess:()=>c.invalidateQueries({queryKey:["files"]}),onError:y=>$.error(y.message)}),g=y=>{s(y.token),$.success(`Inserted ${y.token}`),a(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:()=>a(!0),title:"Insert an uploaded file token",className:O("inline-flex items-center justify-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs font-medium border transition-all duration-150 focus:outline-none","bg-gradient-to-b from-sky-500 to-sky-600 text-white border-sky-700 shadow-sm hover:brightness-110 hover:shadow-md"),children:[e.jsx(fp,{size:12}),e.jsx("span",{className:"hidden sm:inline",children:"Files"}),e.jsx(kt,{size:10})]}),r&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm animate-fade-in",onClick:y=>{y.target===y.currentTarget&&a(!1)},children:e.jsxs("div",{className:"bg-surface rounded-2xl shadow-modal w-full max-w-lg mx-4 overflow-hidden border border-border animate-scale-in flex flex-col",style:{maxHeight:"min(560px, 85vh)"},children:[e.jsxs("div",{className:"flex items-center gap-3 px-5 py-3.5 border-b border-border bg-gradient-to-r from-sky-50 to-cyan-50 dark:from-sky-500/10 dark:to-cyan-500/10 flex-shrink-0",children:[e.jsx(fp,{size:16,className:"text-sky-500 dark:text-sky-400"}),e.jsx("h2",{className:"text-sm font-bold text-sky-800 dark:text-sky-200 flex-1",children:"Upload Files"}),e.jsx("button",{type:"button",onClick:()=>a(!1),className:"p-1 rounded-lg hover:bg-sky-100 dark:hover:bg-sky-500/20 text-sky-400 hover:text-sky-600 dark:hover:text-sky-300 transition-colors",children:e.jsx(_e,{size:16})})]}),e.jsxs("div",{className:"px-5 py-3 border-b border-border flex-shrink-0",children:[e.jsx("input",{ref:o,type:"file",className:"hidden",onChange:y=>{const N=y.target.files?.[0];N&&h.mutate(N),y.target.value=""}}),e.jsxs("button",{type:"button",onClick:()=>o.current?.click(),disabled:h.isPending,className:"w-full flex items-center justify-center gap-2 px-3 py-2 rounded-xl text-xs font-semibold border border-dashed border-sky-300 text-sky-600 hover:bg-sky-50 dark:border-sky-500/40 dark:text-sky-300 dark:hover:bg-sky-500/10 transition-colors disabled:opacity-50",children:[e.jsx(Ul,{size:13}),h.isPending?"Uploading…":"Choose a file to upload"]}),e.jsxs("p",{className:"text-[10px] text-content-tertiary mt-1.5",children:["Saved to ",e.jsx("code",{className:"text-accent",children:"fixtures/uploads/"})," and inserted as a ",e.jsx("code",{className:"text-accent",children:"{{FILE:…}}"})," token."]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-3 min-h-0",children:x?e.jsx("p",{className:"text-sm text-content-tertiary text-center py-6",children:"Loading…"}):u.length===0?e.jsx("p",{className:"text-sm text-content-tertiary text-center py-6",children:"No files uploaded yet."}):e.jsx("div",{className:"space-y-1",children:u.map(y=>e.jsxs("div",{className:"group flex items-center gap-2 px-3 py-2 rounded-xl border border-transparent hover:bg-sky-50 dark:hover:bg-sky-500/10 transition-colors",children:[e.jsx(Ev,{size:14,className:"text-sky-500 dark:text-sky-400 flex-shrink-0"}),e.jsxs("button",{type:"button",onClick:()=>g(y),className:"flex-1 text-left min-w-0",children:[e.jsx("div",{className:"text-[12px] font-medium text-content truncate",children:y.name}),e.jsxs("div",{className:"text-[10px] text-content-tertiary font-mono truncate",children:[y.token," · ",S2(y.size)]})]}),e.jsx("button",{type:"button",onClick:()=>f.mutate(y.name),title:"Delete file",className:"p-1 rounded-md text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-500/10 opacity-0 group-hover:opacity-100 transition-all flex-shrink-0",children:e.jsx(es,{size:12})})]},y.name))})}),e.jsx("div",{className:"px-5 py-2.5 border-t border-border bg-surface-inset/30 flex-shrink-0",children:e.jsx("p",{className:"text-[11px] text-content-tertiary",children:"Click a file to insert its token into the step."})})]})})]})}function P2({selectedIds:s,suiteId:r,suites:a,onClear:o,onDeleted:c,onMoved:u}){const x=Re(),{modalProps:h,confirmDelete:f}=Gs(),[g,y]=p.useState(""),N=oe({mutationFn:()=>qn.bulkDelete(r,Array.from(s)),onSuccess:M=>{$.success(`Deleted ${M.deleted} case${M.deleted!==1?"s":""}`),x.invalidateQueries({queryKey:["cases",r]}),c(),o()},onError:M=>$.error(M.message)}),E=oe({mutationFn:M=>qn.bulkMove(r,Array.from(s),M),onSuccess:M=>{$.success(`Moved ${M.moved} case${M.moved!==1?"s":""}`),x.invalidateQueries({queryKey:["cases",r]}),u(),o(),y("")},onError:M=>$.error(M.message)}),S=a.filter(M=>M.id!==r),P=s.size;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"fixed bottom-0 left-[248px] right-0 z-30 bg-surface border-t border-border shadow-elevated px-5 py-3 flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-semibold text-content flex-shrink-0",children:[P," case",P!==1?"s":""," selected"]}),e.jsx("button",{type:"button",onClick:()=>$("Coming soon",{icon:"🔜"}),className:"inline-flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-lg border border-border text-content-secondary hover:bg-surface-inset transition-colors",children:"Run Selected"}),e.jsxs("button",{type:"button",onClick:()=>f(`Delete ${P} selected case${P!==1?"s":""}? This cannot be undone.`,()=>N.mutate()),disabled:N.isPending,className:"inline-flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-lg border border-red-200 text-red-600 bg-red-50 hover:bg-red-100 transition-colors disabled:opacity-50",children:[e.jsx(es,{size:12})," Delete Selected"]}),S.length>0&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(_v,{size:13,className:"text-content-tertiary flex-shrink-0"}),e.jsxs("select",{className:"text-xs border border-border rounded-lg px-2 py-1.5 bg-surface text-content-secondary focus:outline-none focus:ring-1 focus:ring-accent/30",value:g,onChange:M=>y(M.target.value),children:[e.jsx("option",{value:"",children:"Move to suite…"}),S.map(M=>e.jsx("option",{value:M.id,children:M.name},M.id))]}),g&&e.jsx("button",{type:"button",onClick:()=>E.mutate(g),disabled:E.isPending,className:"text-xs px-3 py-1.5 rounded-lg bg-accent text-white hover:brightness-110 transition-colors disabled:opacity-50",children:"Move"})]}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{type:"button",onClick:o,className:"p-1.5 rounded-lg text-content-tertiary hover:bg-surface-inset transition-colors",children:e.jsx(_e,{size:14})})]}),e.jsx(Ws,{...h})]})}function R2({passRate:s,runs:r,flaky:a}){if(!a||r<3||s===1)return null;const o=Math.round(s*100);return e.jsx("span",{title:`Flaky: ${o}% pass rate over ${r} runs`,className:"inline-flex items-center gap-0.5 text-[8px] font-semibold px-1.5 py-0.5 rounded bg-amber-50 text-amber-600 ring-1 ring-amber-200 flex-shrink-0",children:"~flaky"})}function M2({open:s,onClose:r,suiteId:a,caseId:o,onInserted:c}){const u=Re(),[x,h]=p.useState(""),[f,g]=p.useState(!1),[y,N]=p.useState(""),[E,S]=p.useState(""),{data:P=[]}=Oe({queryKey:["step-library"],queryFn:()=>mr.list()}),M=oe({mutationFn:v=>Rr.add(a,o,{instruction:v.instruction,...v.generatedCode?{generatedCode:v.generatedCode,strategy:"cache"}:{}}),onSuccess:()=>{u.invalidateQueries({queryKey:["cases",a,o]}),$.success("Step inserted"),c()},onError:v=>$.error(v.message)}),k=oe({mutationFn:()=>mr.create({name:y,instruction:E}),onSuccess:()=>{u.invalidateQueries({queryKey:["step-library"]}),$.success("Step saved to library"),g(!1),N(""),S("")},onError:v=>$.error(v.message)}),j=P.filter(v=>!x||v.name.toLowerCase().includes(x.toLowerCase())||v.instruction.toLowerCase().includes(x.toLowerCase())||v.tags.some(z=>z.toLowerCase().includes(x.toLowerCase())));return s?e.jsxs("div",{className:"fixed right-0 top-0 bottom-0 w-80 bg-surface border-l border-border shadow-xl z-40 flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ri,{size:14,className:"text-accent"}),e.jsx("span",{className:"text-sm font-semibold text-content",children:"Step Library"})]}),e.jsx("button",{type:"button",onClick:r,className:"p-1 rounded text-content-tertiary hover:text-content hover:bg-surface-inset",children:e.jsx(_e,{size:14})})]}),e.jsx("div",{className:"px-3 py-2 border-b border-border flex-shrink-0",children:e.jsxs("div",{className:"relative",children:[e.jsx(Bn,{size:12,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-content-tertiary"}),e.jsx("input",{type:"text",placeholder:"Search steps…",value:x,onChange:v=>h(v.target.value),className:"w-full pl-7 pr-3 py-1.5 text-xs border border-border rounded-lg bg-surface-inset focus:outline-none focus:ring-1 focus:ring-accent/30"})]})}),e.jsxs("div",{className:"flex-1 overflow-y-auto py-2 px-2 space-y-1",children:[j.length===0&&e.jsx("p",{className:"text-[11px] text-content-tertiary text-center py-6",children:P.length===0?"No steps in library yet":"No results"}),j.map(v=>e.jsx("div",{className:"border border-border rounded-lg p-2.5 hover:border-accent/30 hover:bg-surface-inset/50 transition-colors",children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("p",{className:"text-xs font-semibold text-content truncate",children:v.name}),v.generatedCode?e.jsx("span",{className:"flex-shrink-0 text-[8px] px-1 py-px rounded bg-emerald-50 dark:bg-emerald-900/20 text-emerald-600 dark:text-emerald-400 ring-1 ring-emerald-200 dark:ring-emerald-800",children:"Ready"}):e.jsx("span",{className:"flex-shrink-0 text-[8px] px-1 py-px rounded bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-1 ring-amber-200 dark:ring-amber-800",children:"No code"})]}),e.jsx("p",{className:"text-[10px] text-content-tertiary mt-0.5 line-clamp-2",children:v.instruction}),v.tags.length>0&&e.jsx("div",{className:"flex flex-wrap gap-0.5 mt-1",children:v.tags.map(z=>e.jsx("span",{className:"text-[8px] px-1 py-px rounded bg-accent/8 text-accent ring-1 ring-accent/15",children:z},z))})]}),e.jsx("button",{type:"button",onClick:()=>M.mutate({instruction:v.instruction,generatedCode:v.generatedCode}),disabled:M.isPending,className:"flex-shrink-0 text-[10px] px-2 py-1 rounded bg-accent text-white hover:brightness-110 transition-colors disabled:opacity-50",children:"Insert"})]})},v.id))]}),e.jsx("div",{className:"border-t border-border p-3 flex-shrink-0",children:f?e.jsxs("div",{className:"space-y-2",children:[e.jsx("input",{type:"text",placeholder:"Step name",value:y,onChange:v=>N(v.target.value),className:"w-full px-2 py-1.5 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30"}),e.jsx("textarea",{placeholder:"Step instruction",value:E,onChange:v=>S(v.target.value),rows:2,className:"w-full px-2 py-1.5 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30 resize-none"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"button",onClick:()=>k.mutate(),disabled:!y.trim()||!E.trim()||k.isPending,className:"flex-1 text-xs py-1.5 rounded-lg bg-accent text-white hover:brightness-110 transition-colors disabled:opacity-50",children:"Save"}),e.jsx("button",{type:"button",onClick:()=>g(!1),className:"text-xs px-3 py-1.5 rounded-lg border border-border text-content-secondary hover:bg-surface-inset",children:"Cancel"})]})]}):e.jsxs("button",{type:"button",onClick:()=>g(!0),className:"w-full flex items-center justify-center gap-1.5 text-xs py-2 rounded-lg border border-dashed border-border text-content-tertiary hover:text-content hover:border-accent/40 transition-colors",children:[e.jsx(Ks,{size:12})," Save current step to library"]})})]}):null}const mi=new Set,ua=new Map;let In=null,hi=null,pi=null;const xa=new Map,fi=new Map,Ru=new Set;function ma(){Ru.forEach(s=>s())}const $t={subscribe(s){return Ru.add(s),()=>Ru.delete(s)},getSnapshot(){return{runningCaseIds:mi,runningSuiteId:In,caseLastRun:xa,suiteLastRun:fi}},startCase(s){mi.add(s),ma()},startSuite(s){pi=s,In=s,ma()},onRunStart(s){pi&&(hi=s,pi=null)},onCaseRunning(s,r){ua.has(s)||ua.set(s,r)},onCaseDone(s,r,a){const o=s===hi,c=xa.get(r),u=o?c?.allureRunId??s:s;xa.set(r,{status:a,runId:s,allureRunId:u}),ma()},onComplete(s,r){const a=ua.get(s);a&&(mi.delete(a),ua.delete(s)),mi.clear(),ua.clear(),s===hi&&In?fi.set(In,{...r,runId:s}):In&&fi.set(In,{...r,runId:s}),In=null,hi=null,pi=null,ma()},seedFromHistory(s){for(const r of s)for(const a of r.suites){fi.has(a.suiteId)||fi.set(a.suiteId,{passed:r.passed,failed:r.failed,skipped:r.skipped,runId:r.runId});const c=r.suites.reduce((u,x)=>u+x.cases.length,0)===1;for(const u of a.cases){const x=xa.get(u.caseId);x?c&&!x.allureRunId&&xa.set(u.caseId,{...x,allureRunId:r.runId}):xa.set(u.caseId,{status:u.status,runId:r.runId,allureRunId:r.runId})}}ma()},clear(){mi.clear(),ua.clear(),In=null,hi=null,pi=null,ma()}};function Kl(){const[s,r]=p.useState(()=>$t.getSnapshot());return p.useEffect(()=>$t.subscribe(()=>r($t.getSnapshot())),[]),s}function rx(){const[s,r]=p.useState(()=>Ct.getSnapshot());return p.useEffect(()=>Ct.subscribe(()=>r(Ct.getSnapshot())),[]),s}const bg=["critical","high","medium","low"],Mu={critical:"bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 ring-red-500/20 dark:ring-red-500/30",high:"bg-orange-50 dark:bg-orange-900/20 text-orange-600 dark:text-orange-400 ring-orange-500/20 dark:ring-orange-500/30",medium:"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 ring-blue-500/20 dark:ring-blue-500/30",low:"bg-surface-inset text-content-secondary ring-border"};function Oi({tags:s,editable:r=!1,onAdd:a,onRemove:o}){const[c,u]=p.useState(""),x=()=>{const h=c.trim().toLowerCase().replace(/\s+/g,"-");if(!h||s.includes(h)){u("");return}a?.(h),u("")};return e.jsxs("div",{className:"flex flex-wrap gap-0.5 items-center",children:[s.map(h=>e.jsxs("span",{className:"inline-flex items-center gap-px px-1.5 py-px rounded bg-accent/8 text-accent text-[9px] font-medium ring-1 ring-accent/15 leading-tight",children:[h,r&&e.jsx("button",{type:"button",onClick:()=>o?.(h),children:e.jsx(_e,{size:8,className:"hover:text-red-500"})})]},h)),r&&e.jsx("input",{className:"text-[9px] border border-dashed border-border rounded bg-transparent outline-none w-14 px-1.5 py-px placeholder-content-tertiary focus:border-accent focus:ring-1 focus:ring-accent/20 transition-colors",placeholder:"+ tag",value:c,onChange:h=>u(h.target.value),onKeyDown:h=>{h.key==="Enter"&&(h.preventDefault(),x())},onBlur:x}),!r&&s.length===0&&e.jsx("span",{className:"text-[10px] text-content-tertiary",children:"—"})]})}function tu(){const s=Vn(),r=Vs(),{suiteId:a="",caseId:o=""}=ab(),c=o?"case-editor":a?"suite-detail":"suites",[u,x]=p.useState(""),[h,f]=p.useState("ui"),[g,y]=p.useState(""),{modalProps:N,confirmDelete:E}=Gs(),[S,P]=p.useState(""),[M,k]=p.useState(""),[j,v]=p.useState(""),{data:z=[],isLoading:C}=xg();p.useEffect(()=>{const L=s.state?.openSuiteId;L&&z.length>0&&z.find(D=>D.id===L)&&r(`/tests/${L}`,{replace:!0})},[s.state,z]);const w=p.useMemo(()=>{const L=new Set;return z.forEach(T=>(T.tags??[]).forEach(D=>L.add(D))),Array.from(L).sort()},[z]),F=p.useMemo(()=>z.filter(L=>{const T=!S||L.name.toLowerCase().includes(S.toLowerCase())||(L.description??"").toLowerCase().includes(S.toLowerCase()),D=!M||(L.tags??[]).includes(M),ce=L.type==="performance"?"audit":L.type??"ui";return T&&D&&(!j||ce===j)}),[z,S,M,j]),Q=z.find(L=>L.id===a),Z=GN(),le=QN(),{data:K=[]}=l2(),J=c2(),ue=fg(),ke=rx(),re=oe({mutationFn:L=>ya.start({test:L}),onError:L=>{$t.clear(),$.error(L.message)}}),be=oe({mutationFn:L=>ya.start({suite:L}),onError:L=>{$t.clear(),$.error(L.message)}}),Ne=L=>{$t.startCase(L),re.mutate(L),r("/run")},ye=L=>{$t.startSuite(L),be.mutate(L),r("/run")},_=()=>{u.trim()&&(Z.mutate({name:u,type:h}),x(""))};if(C)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(Me,{size:20,className:"animate-spin text-accent"})});let Y=null;if(c==="suites"){const L=z.filter(G=>(G.type??"ui")==="ui").length,T=z.filter(G=>(G.type??"ui")==="api").length,D=z.filter(G=>G.type==="audit"||G.type==="performance").length,ce=z.reduce((G,xe)=>G+(xe.caseCount??0),0);Y=e.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[e.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:e.jsxs("div",{className:"px-5 py-3.5 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-indigo-500 to-violet-600 flex items-center justify-center shadow-sm shadow-indigo-500/20",children:e.jsx(Mi,{size:18,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-base font-bold text-content tracking-tight",children:"Test Suites"}),e.jsx("p",{className:"text-[11px] text-content-tertiary mt-0.5",children:"Manage and organize your test automation"})]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"flex items-center gap-3",children:[{label:"Suites",val:z.length,cls:"text-indigo-600 dark:text-indigo-400"},{label:"UI",val:L,cls:"text-blue-600 dark:text-blue-400"},{label:"API",val:T,cls:"text-violet-600 dark:text-violet-400"},...D>0?[{label:"Audit",val:D,cls:"text-amber-600 dark:text-amber-400"}]:[],{label:"Cases",val:ce,cls:"text-emerald-600 dark:text-emerald-400"}].map(G=>e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:O("text-sm font-bold tabular-nums",G.cls),children:G.val}),e.jsx("p",{className:"text-[9px] text-content-tertiary font-medium",children:G.label})]},G.label))}),e.jsx("div",{className:"w-px h-8 bg-border"}),e.jsx(Ai,{status:"not-created",variant:"full",label:"Sync All",onClick:()=>J.mutate(),busy:ke.allOp==="create"||ke.allOp==="sync"})]})]})}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface px-4 py-2.5 flex items-center gap-3",children:[e.jsx("div",{className:"flex gap-0.5 flex-shrink-0 bg-surface-inset rounded-lg p-0.5",children:[["","All",z.length],["ui","UI",L],["api","API",T],...D>0?[["audit","Audit",D]]:[]].map(([G,xe,je])=>e.jsxs("button",{type:"button",onClick:()=>v(G),className:O("px-2.5 py-1 rounded-md text-[10px] font-semibold transition-all",j===G?"bg-surface text-accent shadow-sm ring-1 ring-accent/20":"text-content-tertiary hover:text-content-secondary"),children:[xe," ",e.jsx("span",{className:"opacity-50 ml-0.5",children:je})]},G))}),e.jsxs("div",{className:"relative flex-1 min-w-0",children:[e.jsx(Bn,{size:12,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-content-tertiary pointer-events-none"}),e.jsx("input",{className:"w-full text-xs border border-border rounded-lg pl-8 pr-3 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/40 bg-surface placeholder-content-tertiary",placeholder:"Search suites…",value:S,onChange:G=>P(G.target.value)})]}),w.length>0&&e.jsxs("select",{value:M,onChange:G=>k(G.target.value),className:"text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-1 focus:ring-accent bg-surface min-w-[100px]",children:[e.jsx("option",{value:"",children:"All Tags"}),w.map(G=>e.jsx("option",{value:G,children:G},G))]}),(S||M||j)&&e.jsx("button",{type:"button",onClick:()=>{P(""),k(""),v("")},className:"p-1.5 rounded-lg text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:e.jsx(_e,{size:12})}),e.jsx("div",{className:"w-px h-5 bg-border"}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[e.jsx("div",{className:"flex gap-0 bg-surface-inset rounded-lg p-0.5 ring-1 ring-border",children:["ui","api","audit"].map(G=>e.jsx("button",{type:"button",onClick:()=>f(G),className:O("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all",h===G?G==="api"?"bg-violet-500 text-white shadow-sm":G==="audit"?"bg-amber-500 text-white shadow-sm":"bg-blue-500 text-white shadow-sm":"text-content-tertiary hover:text-content-secondary"),children:G==="audit"?"Audit":G},G))}),e.jsx("input",{className:"w-40 text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"New suite name…",value:u,onChange:G=>x(G.target.value),onKeyDown:G=>G.key==="Enter"&&_()}),e.jsxs(we,{size:"sm",onClick:_,disabled:Z.isPending,children:[e.jsx(Ks,{size:11})," Add"]})]})]}),z.length===0?e.jsxs("div",{className:"rounded-xl border-2 border-dashed border-border bg-surface flex flex-col items-center justify-center py-16 gap-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl bg-gradient-to-br from-indigo-50 to-violet-50 dark:from-indigo-900/20 dark:to-violet-900/20 flex items-center justify-center ring-1 ring-border",children:e.jsx(Er,{size:22,className:"text-accent"})}),e.jsx("p",{className:"text-sm font-semibold text-content",children:"No suites yet"}),e.jsx("p",{className:"text-[11px] text-content-tertiary max-w-xs text-center",children:"Create your first test suite using the toolbar above — pick a type (UI, API, or Audit) and give it a name."})]}):F.length===0?e.jsxs("div",{className:"rounded-xl border-2 border-dashed border-border bg-surface flex flex-col items-center justify-center py-12 gap-2.5",children:[e.jsx(If,{size:18,className:"text-content-tertiary"}),e.jsx("p",{className:"text-xs font-medium text-content-secondary",children:"No suites match your filters"}),e.jsx("button",{onClick:()=>{P(""),k(""),v("")},className:"text-[10px] font-medium text-accent hover:underline",children:"Clear all filters"})]}):e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:F.map(G=>e.jsx(T2,{suite:G,xrayStatus:K.find(xe=>xe.suiteId===G.id)?.status??"not-created",xrayKey:K.find(xe=>xe.suiteId===G.id)?.xrayTestSetId??null,onOpen:()=>r(`/tests/${G.id}`),onRun:()=>ye(G.id),onDelete:()=>E(`Delete suite "${G.name}"? All cases and steps will be lost.`,()=>le.mutate(G.id)),onXrayAction:()=>ue.mutate(G.id),isXrayBusy:ke.busySuites.get(G.id)==="create"||ke.busySuites.get(G.id)==="sync"||ke.allOp==="create"||ke.allOp==="sync"},G.id))})]})})})}return c==="suite-detail"&&a&&(Y=e.jsx(z2,{suiteId:a,suite:Q,suites:z,newCaseName:g,onNewCaseNameChange:y,onOpenCase:L=>r(`/tests/${a}/cases/${L}`),onRunCase:L=>Ne(L),onRunSuite:()=>ye(a),onBack:()=>r("/tests")})),c==="case-editor"&&a&&o&&(Y=e.jsx(A2,{suiteId:a,caseId:o,suiteName:Q?.name??"",suiteType:Q?.type??"ui",onBack:()=>r(`/tests/${a}`),onRunCase:()=>Ne(o)})),e.jsxs("div",{className:"flex-1 overflow-hidden relative flex flex-col",children:[Y,e.jsx(Ws,{...N})]})}function T2({suite:s,onOpen:r,onRun:a,onDelete:o,xrayStatus:c="not-created",xrayKey:u=null,onXrayAction:x,isXrayBusy:h=!1}){const{runningCaseIds:f,runningSuiteId:g,suiteLastRun:y}=Kl(),N=g===s.id,E=y.get(s.id),[S,P]=p.useState(!1),[M,k]=p.useState(s.name),[j,v]=p.useState(s.description??""),[z,C]=p.useState(s.tags??[]),[w,F]=p.useState(s.timeout?String(s.timeout):""),Q=mg(),Z=p.useRef(null),le=(s.type??"ui")==="api",K=s.type==="audit"||s.type==="performance";p.useEffect(()=>{S&&Z.current?.focus()},[S]);const J=Y=>{Y.stopPropagation(),P(!0)},ue=Y=>{Y?.stopPropagation(),k(s.name),v(s.description??""),C(s.tags??[]),F(s.timeout?String(s.timeout):""),P(!1)},ke=Y=>{Y?.stopPropagation();const L=w?parseInt(w,10):void 0;Q.mutate({id:s.id,data:{name:M.trim()||s.name,description:j,tags:z,timeout:L}},{onSuccess:()=>P(!1)})},re=Y=>{Y.key==="Enter"&&(Y.preventDefault(),ke()),Y.key==="Escape"&&ue()};if(S)return e.jsxs("div",{className:"rounded-xl border-2 border-accent/30 bg-accent/[0.02] p-3.5 space-y-2.5",onClick:Y=>Y.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:O("w-6 h-6 rounded-lg flex items-center justify-center flex-shrink-0",le?"bg-violet-100":"bg-blue-100"),children:e.jsx(Hs,{size:11,className:le?"text-violet-600":"text-blue-600"})}),e.jsx("input",{ref:Z,className:"flex-1 text-xs font-semibold border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface",value:M,onChange:Y=>k(Y.target.value),onKeyDown:re,placeholder:"Suite name"})]}),e.jsx("input",{className:"w-full text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-1 focus:ring-accent/30 bg-surface",value:j,onChange:Y=>v(Y.target.value),onKeyDown:re,placeholder:"Description (optional)"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"number",min:1e3,step:1e3,className:"w-32 text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-1 focus:ring-accent/30 bg-surface",value:w,onChange:Y=>F(Y.target.value),onKeyDown:re,placeholder:"Timeout (ms)"}),e.jsx("span",{className:"text-[10px] text-content-tertiary",children:"ms timeout"}),e.jsx("div",{className:"ml-auto",children:e.jsx(Oi,{tags:z,editable:!0,onAdd:Y=>C(L=>[...L,Y]),onRemove:Y=>C(L=>L.filter(T=>T!==Y))})})]}),e.jsxs("div",{className:"flex gap-1.5 justify-end pt-0.5",children:[e.jsxs(we,{size:"sm",variant:"secondary",onClick:ue,children:[e.jsx(_e,{size:10})," Cancel"]}),e.jsxs(we,{size:"sm",onClick:ke,loading:Q.isPending,children:[e.jsx(et,{size:10})," Save"]})]})]});const be=le?"bg-gradient-to-b from-violet-500 to-purple-600":K?"bg-gradient-to-b from-amber-500 to-orange-600":"bg-gradient-to-b from-blue-500 to-indigo-600",Ne=le?"bg-violet-50 dark:bg-violet-900/20 text-violet-600 dark:text-violet-400 ring-violet-200 dark:ring-violet-800":K?"bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-amber-200 dark:ring-amber-800":"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 ring-blue-200 dark:ring-blue-800",ye=K?"Audit":le?"API":"UI",_=s.caseCount??0;return e.jsxs("div",{className:"group rounded-xl border border-border bg-surface hover:border-accent/30 hover:shadow-md hover:shadow-accent/5 cursor-pointer transition-all flex overflow-hidden",onClick:r,children:[e.jsx("div",{className:O("w-1 flex-shrink-0 rounded-l-xl",be)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"px-3.5 pt-3 pb-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-[13px] font-bold text-content truncate flex-1",children:s.name}),e.jsxs("span",{className:O("text-[8px] px-1.5 py-0.5 rounded-md font-bold uppercase flex-shrink-0 ring-1 flex items-center gap-0.5",Ne),children:[K&&e.jsx(ct,{size:7})," ",ye]}),e.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",onClick:Y=>Y.stopPropagation(),children:[e.jsx("button",{type:"button",onClick:J,title:"Edit",className:"p-1.5 rounded-lg text-content-tertiary hover:text-accent hover:bg-accent/8 transition-colors",children:e.jsx(Gn,{size:12})}),e.jsx("button",{type:"button",onClick:Y=>{Y.stopPropagation(),o()},title:"Delete",className:"p-1.5 rounded-lg text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:e.jsx(es,{size:12})})]})]}),s.description&&e.jsx("p",{className:"text-[10px] text-content-tertiary truncate mt-1 leading-relaxed",children:s.description})]}),e.jsx("div",{className:"px-3.5 pb-2",children:e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-semibold text-content-secondary bg-surface-inset px-2 py-0.5 rounded-md ring-1 ring-border",children:[e.jsx(Er,{size:9,className:"opacity-50"}),_," case",_!==1?"s":""]}),E&&e.jsxs("span",{className:O("inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1",E.failed>0?"bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 ring-red-200 dark:ring-red-800":"bg-emerald-50 dark:bg-emerald-900/20 text-emerald-600 dark:text-emerald-400 ring-emerald-200 dark:ring-emerald-800"),children:[e.jsx(Cf,{size:5,className:"fill-current"}),E.passed,"p / ",E.failed,"f"]}),e.jsxs("div",{className:"flex items-center gap-1",onClick:Y=>Y.stopPropagation(),children:[e.jsx(nx,{status:c,xrayKey:u}),e.jsx(Ai,{variant:"icon",status:c,onClick:()=>x?.(),busy:h})]}),(s.tags??[]).length>0&&e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(Oi,{tags:s.tags??[]})})]})}),e.jsxs("div",{className:"px-3.5 py-2 border-t border-border/40 bg-surface-inset/20 flex items-center gap-1.5",onClick:Y=>Y.stopPropagation(),children:[N?e.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] text-teal-600 dark:text-teal-400 font-semibold",children:[e.jsx(Me,{size:11,className:"animate-spin"})," Running..."]}):e.jsxs("button",{type:"button",onClick:Y=>{Y.stopPropagation(),a()},className:"flex items-center gap-1 px-2.5 py-1 rounded-lg text-[10px] font-semibold text-teal-700 dark:text-teal-400 bg-teal-50 dark:bg-teal-900/20 hover:bg-teal-100 dark:hover:bg-teal-900/30 ring-1 ring-teal-200 dark:ring-teal-800 transition-colors",title:"Run suite",children:[e.jsx(Xt,{size:10,strokeWidth:2.5})," Run Suite"]}),e.jsxs("button",{type:"button",disabled:!E,onClick:Y=>{Y.stopPropagation(),E&&window.open(`/allure/${E.runId}`,"_blank")},title:E?`Report: ${E.passed}p / ${E.failed}f`:"No report",className:O("flex items-center gap-1 px-2.5 py-1 rounded-lg text-[10px] font-semibold transition-colors ring-1",E?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20 hover:bg-blue-100 dark:hover:bg-blue-900/30 ring-blue-200 dark:ring-blue-800":"text-content-tertiary/40 bg-surface-inset ring-border cursor-not-allowed"),children:[e.jsx(Ts,{size:10})," Report"]}),e.jsx("div",{className:"flex-1"}),e.jsx("span",{className:"text-[9px] text-content-tertiary",children:new Date(s.updatedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})}),e.jsx(Zt,{size:12,className:"text-content-tertiary/40 group-hover:text-accent transition-colors"})]})]})]})}function z2({suiteId:s,suite:r,suites:a,newCaseName:o,onNewCaseNameChange:c,onOpenCase:u,onRunCase:x,onRunSuite:h,onBack:f}){const{runningCaseIds:g,runningSuiteId:y,caseLastRun:N}=Kl(),E=y===s,{data:S=[],isLoading:P}=JN(s),M=Rp(s),k=ZN(s),j=Rp(s),[v,z]=p.useState(!1),[C,w]=p.useState(!1),{modalProps:F,confirmDelete:Q}=Gs(),[Z,le]=p.useState(new Set),K=p.useRef(-1),{data:J}=Oe({queryKey:["flakiness",s],queryFn:()=>mj.get(s),staleTime:6e4});p.useEffect(()=>{le(new Set),K.current=-1},[s]);const{data:ue}=pg(s),ke=fg(),re=gg(),be=d2(),Ne=yg(),ye=rx(),_=()=>{(ue?.status??"not-created")==="not-created"?ke.mutate(s):be.mutate(s)},Y=se=>{(ue?.cases.find($e=>$e.caseId===se)?.status??"not-created")==="not-created"?re.mutate({suiteId:s,caseId:se}):Ne.mutate({suiteId:s,caseId:se})};p.useEffect(()=>{ya.list(20).then(async se=>{const Ue=await Promise.all(se.slice(0,10).map($e=>ya.get($e.runId).catch(()=>null)));$t.seedFromHistory(Ue.filter($e=>$e!==null).map($e=>({runId:$e.runId,passed:$e.passed,failed:$e.failed,skipped:$e.skipped,suites:$e.suites.map(Ge=>({suiteId:Ge.suiteId,cases:Ge.cases.map(Ht=>({caseId:Ht.caseId,status:Ht.status}))}))})))}).catch(()=>{})},[s]);const[L,T]=p.useState(""),[D,ce]=p.useState(new Set),[G,xe]=p.useState(""),je=D.size===0,Ae=p.useMemo(()=>{const se=new Set;return S.forEach(Ue=>(Ue.tags??[]).forEach($e=>se.add($e))),Array.from(se).sort()},[S]),he=p.useMemo(()=>S.filter(se=>{const Ue=!L||se.name.toLowerCase().includes(L.toLowerCase()),$e=D.size===0||(se.tags??[]).some(Ht=>D.has(Ht)),Ge=!G||se.priority===G;return Ue&&$e&&Ge}),[S,L,D,G]),Pe=!!(L||D.size>0||G),[Ke,yt]=p.useState(!1),[qt,Ye]=p.useState(r?.name??""),[ie,Mt]=p.useState(r?.description??""),[xt,Ft]=p.useState(r?.tags??[]),[zs,ys]=p.useState(r?.timeout?String(r.timeout):""),q=mg();p.useEffect(()=>{Ye(r?.name??""),Mt(r?.description??""),Ft(r?.tags??[]),ys(r?.timeout?String(r.timeout):"")},[r?.id]);const pe=()=>{const se=zs?parseInt(zs,10):void 0;q.mutate({id:s,data:{name:qt.trim()||r?.name,description:ie,tags:xt,timeout:se}},{onSuccess:()=>yt(!1)})},Fe=se=>{se.key==="Enter"&&(se.preventDefault(),pe()),se.key==="Escape"&&yt(!1)},bs=()=>{o.trim()&&(M.mutate({name:o}),c(""))},bt=se=>{j.mutate({name:`${se.name} (copy)`,description:se.description,priority:se.priority,tags:se.tags,steps:(se.steps??[]).map(Ue=>({instruction:Ue.instruction}))})},As=se=>`TC-${(r?.name??"TC").replace(/[^a-zA-Z]/g,"").slice(0,3).toUpperCase()||"TC"}-${String(se+1).padStart(3,"0")}`,ts=(r?.type??"ui")==="api",mt=r?.type==="audit"||r?.type==="performance";return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:[e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsx("div",{className:"px-4 py-1.5 bg-surface-inset/30 border-b border-border/50",children:e.jsxs("nav",{className:"flex items-center gap-1.5 text-[10px] text-content-tertiary",children:[e.jsxs("button",{onClick:f,className:"hover:text-accent transition-colors flex items-center gap-1",children:[e.jsx(Df,{size:10})," Suites"]}),e.jsx(Zt,{size:9}),e.jsx("span",{className:"text-content-secondary font-semibold",children:r?.name})]})}),Ke?e.jsxs("div",{className:"px-4 py-3.5 space-y-2.5",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:O("w-7 h-7 rounded-lg flex items-center justify-center flex-shrink-0",ts?"bg-gradient-to-br from-violet-500 to-purple-600":"bg-gradient-to-br from-blue-500 to-indigo-600"),children:e.jsx(Mi,{size:13,className:"text-white"})}),e.jsx("input",{className:"flex-1 text-sm font-bold border border-border rounded-lg px-3 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface",value:qt,onChange:se=>Ye(se.target.value),onKeyDown:Fe,placeholder:"Suite name",autoFocus:!0})]}),e.jsx("input",{className:"w-full text-xs border border-border rounded-lg px-3 py-1.5 focus:outline-none focus:ring-1 focus:ring-accent/30 bg-surface",value:ie,onChange:se=>Mt(se.target.value),onKeyDown:Fe,placeholder:"Description"}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Cr,{size:10,className:"text-content-tertiary"}),e.jsx("input",{type:"number",min:1e3,step:1e3,className:"w-28 text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-1 focus:ring-accent/30 bg-surface",value:zs,onChange:se=>ys(se.target.value),onKeyDown:Fe,placeholder:"Timeout ms"})]}),e.jsx("div",{className:"flex-1",children:e.jsx(Oi,{tags:xt,editable:!0,onAdd:se=>Ft(Ue=>[...Ue,se]),onRemove:se=>Ft(Ue=>Ue.filter($e=>$e!==se))})}),e.jsxs("div",{className:"flex gap-1.5",children:[e.jsxs(we,{size:"sm",variant:"secondary",onClick:()=>yt(!1),children:[e.jsx(_e,{size:10})," Cancel"]}),e.jsxs(we,{size:"sm",onClick:pe,loading:q.isPending,children:[e.jsx(et,{size:10})," Save"]})]})]})]}):e.jsxs("div",{className:"px-4 py-3 flex items-center gap-3 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-2.5 min-w-0 flex-1",children:[e.jsx("div",{className:O("w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0 shadow-sm",ts?"bg-gradient-to-br from-violet-500 to-purple-600 shadow-violet-500/20":mt?"bg-gradient-to-br from-amber-500 to-orange-600 shadow-amber-500/20":"bg-gradient-to-br from-blue-500 to-indigo-600 shadow-blue-500/20"),children:e.jsx(Mi,{size:16,className:"text-white"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("h1",{className:"text-sm font-bold text-content truncate",children:r?.name}),mt?e.jsxs("span",{className:"text-[7px] px-1.5 py-px rounded font-bold flex items-center gap-0.5 ring-1 bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-amber-200 dark:ring-amber-800",children:[e.jsx(ct,{size:7})," Audit"]}):e.jsx("button",{type:"button",onClick:se=>{se.stopPropagation();const Ue=ts?"ui":"api";q.mutate({id:s,data:{type:Ue}})},title:"Toggle type",className:O("text-[7px] px-1.5 py-px rounded font-bold uppercase ring-1 cursor-pointer transition-colors",ts?"bg-violet-50 dark:bg-violet-900/20 text-violet-600 dark:text-violet-400 ring-violet-200 dark:ring-violet-800 hover:bg-violet-100 dark:hover:bg-violet-900/30":"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 ring-blue-200 dark:ring-blue-800 hover:bg-blue-100 dark:hover:bg-blue-900/30"),children:ts?"API":"UI"}),e.jsx("button",{type:"button",onClick:()=>yt(!0),className:"p-0.5 rounded text-content-tertiary hover:text-accent transition-colors",children:e.jsx(Gn,{size:10})})]}),ie&&e.jsx("p",{className:"text-[10px] text-content-tertiary truncate mt-0.5 leading-tight max-w-md",children:ie})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[E?e.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] text-teal-600 dark:text-teal-400 font-medium px-2 py-1 rounded-lg bg-teal-50 dark:bg-teal-900/20 ring-1 ring-teal-200 dark:ring-teal-800",children:[e.jsx(Me,{size:11,className:"animate-spin"})," Running…"]}):e.jsxs(we,{size:"sm",onClick:h,className:"bg-teal-600 hover:bg-teal-700 text-white border-teal-600",children:[e.jsx(Xt,{size:10})," Run Suite"]}),e.jsxs(we,{size:"sm",onClick:()=>z(!0),className:"bg-indigo-600 hover:bg-indigo-700 text-white border-indigo-600",children:[e.jsx(wr,{size:10})," Hooks"]}),e.jsx(Ai,{variant:"full",status:ue?.status??"not-created",label:"Sync",onClick:_,busy:ye.busySuites.get(s)==="create"||ye.busySuites.get(s)==="sync"||ye.allOp==="create"||ye.allOp==="sync"})]})]}),Ae.length>0&&e.jsxs("div",{className:"px-4 py-1.5 border-t border-border/50 flex items-center gap-1.5 flex-wrap",children:[e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mr-0.5",children:"Tags"}),e.jsx("button",{type:"button",onClick:()=>ce(new Set),className:O("text-[9px] px-2 py-0.5 rounded-md font-medium transition-all",je?"bg-accent text-white shadow-sm shadow-accent/20":"text-content-tertiary hover:text-content-secondary bg-surface-inset hover:bg-surface-inset/80 ring-1 ring-border"),children:"All"}),Ae.map(se=>{const Ue=D.has(se);return e.jsx("button",{type:"button",onClick:()=>{ce($e=>{const Ge=new Set($e);return Ue?Ge.delete(se):Ge.add(se),Ge})},className:O("text-[9px] px-2 py-0.5 rounded-md font-medium transition-all",Ue||je?"bg-accent/10 text-accent ring-1 ring-accent/30":"text-content-tertiary bg-surface-inset ring-1 ring-border hover:text-content-secondary"),children:se},se)})]}),e.jsxs("div",{className:"px-4 py-2 bg-surface-inset/40 border-t border-border flex items-center gap-2",children:[e.jsxs("div",{className:"relative flex-1 min-w-[120px]",children:[e.jsx(Bn,{size:11,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-content-tertiary pointer-events-none"}),e.jsx("input",{className:"w-full text-xs border border-border rounded-lg pl-7 pr-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"Search tests…",value:L,onChange:se=>T(se.target.value)})]}),e.jsxs("select",{value:G,onChange:se=>xe(se.target.value),className:"text-xs border border-border rounded-lg px-2 py-1.5 focus:outline-none focus:ring-1 focus:ring-accent bg-surface min-w-[90px]",children:[e.jsx("option",{value:"",children:"All Priority"}),bg.map(se=>e.jsx("option",{value:se,className:"capitalize",children:se.charAt(0).toUpperCase()+se.slice(1)},se))]}),Pe&&e.jsx("button",{type:"button",onClick:()=>{T(""),ce(new Set),xe("")},className:"p-1 rounded-lg text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:e.jsx(_e,{size:11})}),e.jsx("div",{className:"w-px h-4 bg-border"}),e.jsx("input",{className:"w-36 text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"New test case…",value:o,onChange:se=>c(se.target.value),onKeyDown:se=>se.key==="Enter"&&bs()}),e.jsxs(we,{size:"sm",onClick:bs,disabled:M.isPending,children:[e.jsx(Ks,{size:10})," Add"]}),e.jsx(we,{size:"sm",variant:"secondary",onClick:()=>w(!0),children:"From Template"}),e.jsx("span",{className:"text-[9px] text-content-tertiary ml-1 tabular-nums flex-shrink-0",children:Pe?`${he.length}/${S.length}`:`${S.length} test${S.length!==1?"s":""}`})]})]}),P?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(Me,{size:18,className:"animate-spin text-accent"})}):S.length===0?e.jsxs("div",{className:"rounded-xl border border-dashed border-border bg-surface flex flex-col items-center justify-center py-14 gap-2.5",children:[e.jsx("div",{className:"w-11 h-11 rounded-xl bg-surface-inset flex items-center justify-center",children:e.jsx(Er,{size:20,className:"text-content-tertiary"})}),e.jsx("p",{className:"text-xs font-medium text-content-secondary",children:"No test cases yet"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Add your first test case using the toolbar above"})]}):he.length===0?e.jsxs("div",{className:"rounded-xl border border-dashed border-border bg-surface flex flex-col items-center justify-center py-10 gap-2",children:[e.jsx(If,{size:16,className:"text-content-tertiary"}),e.jsx("p",{className:"text-xs text-content-tertiary",children:"No tests match filters"}),e.jsx("button",{onClick:()=>{T(""),ce(new Set),xe("")},className:"text-[10px] text-accent hover:underline",children:"Clear filters"})]}):e.jsxs("div",{className:"space-y-1.5",children:[he.length>0&&e.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-1",children:[e.jsx("input",{type:"checkbox",className:"rounded border-border text-accent cursor-pointer",checked:Z.size===he.length&&he.length>0,onChange:se=>{se.target.checked?le(new Set(he.map(Ue=>Ue.id))):le(new Set)}}),e.jsx("span",{className:"text-[9px] text-content-tertiary",children:"Select all"})]}),he.map((se,Ue)=>{const $e=se.steps.some(Le=>Le.stepType==="api"),Ge=N.get(se.id),Ht=ue?.cases.find(Le=>Le.caseId===se.id),Qs=Ht?.status??"not-created",Qn=ye.busyCases.get(`${s}:${se.id}`)==="create"||ye.busyCases.get(`${s}:${se.id}`)==="sync"||ye.busySuites.get(s)==="create"||ye.busySuites.get(s)==="sync"||ye.allOp==="create"||ye.allOp==="sync",Os=Z.has(se.id),os=J?.cases.find(Le=>Le.caseId===se.id);return e.jsx("div",{className:O("group rounded-xl border bg-surface hover:border-accent/30 hover:shadow-sm hover:shadow-accent/5 cursor-pointer transition-all",Os?"border-accent/40 bg-accent/[0.02]":"border-border"),onClick:()=>u(se.id),children:e.jsxs("div",{className:"px-3.5 py-2.5 flex items-center gap-3",children:[e.jsx("input",{type:"checkbox",className:"rounded border-border text-accent cursor-pointer flex-shrink-0",checked:Os,onClick:Le=>Le.stopPropagation(),onChange:Le=>{Le.stopPropagation(),le(vs=>{const ls=new Set(vs);return Le.target.checked?ls.add(se.id):ls.delete(se.id),K.current=Ue,ls})},onClickCapture:Le=>{if(Le.shiftKey&&K.current>=0){Le.preventDefault();const vs=Math.min(K.current,Ue),ls=Math.max(K.current,Ue);le(Is=>{const Kt=new Set(Is);return he.slice(vs,ls+1).forEach(cs=>Kt.add(cs.id)),Kt})}K.current=Ue}}),e.jsx(Dl,{size:11,className:"text-content-tertiary/40 group-hover:text-content-tertiary cursor-grab flex-shrink-0 transition-colors"}),e.jsx("span",{className:"text-[9px] font-mono text-accent font-semibold bg-accent/5 px-1.5 py-0.5 rounded ring-1 ring-accent/10 flex-shrink-0 tabular-nums",children:As(Ue)}),e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 flex-1",children:[e.jsx("span",{className:"text-xs font-medium text-content truncate",children:se.name}),e.jsx("span",{className:O("text-[7px] px-1 py-px rounded font-bold uppercase flex-shrink-0 ring-1",$e?"bg-violet-50 dark:bg-violet-900/20 text-violet-600 dark:text-violet-400 ring-violet-200 dark:ring-violet-800":mt?"bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-amber-200 dark:ring-amber-800":"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 ring-blue-200 dark:ring-blue-800"),children:$e?"API":mt?"Audit":"UI"}),os&&e.jsx(R2,{passRate:os.passRate,runs:os.runs,flaky:os.flaky})]}),e.jsxs("span",{className:"text-[9px] text-content-tertiary tabular-nums flex-shrink-0",children:[se.steps.length," step",se.steps.length!==1?"s":""]}),e.jsx("span",{className:O("text-[8px] px-1.5 py-0.5 rounded capitalize ring-1 flex-shrink-0 font-medium",Mu[se.priority]??Mu.low),children:se.priority}),(se.tags??[]).length>0&&e.jsx("div",{className:"flex-shrink-0",onClick:Le=>Le.stopPropagation(),children:e.jsx(Oi,{tags:se.tags})}),(()=>{if(!Ge)return e.jsx("span",{className:"text-[8px] px-1.5 py-0.5 rounded ring-1 ring-border text-content-tertiary/60 flex-shrink-0",children:"Never"});const Le={passed:"bg-emerald-50 dark:bg-emerald-900/20 text-emerald-600 dark:text-emerald-400 ring-emerald-200 dark:ring-emerald-800",failed:"bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 ring-red-200 dark:ring-red-800",skipped:"bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-amber-200 dark:ring-amber-800"};return e.jsx("span",{className:O("text-[8px] px-1.5 py-0.5 rounded capitalize ring-1 flex-shrink-0 font-medium",Le[Ge.status]??"ring-border text-content-tertiary"),children:Ge.status})})(),e.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",onClick:Le=>Le.stopPropagation(),children:[e.jsx(nx,{status:Qs,xrayKey:Ht?.xrayTestId}),e.jsx(Ai,{variant:"icon",status:Qs,onClick:()=>Y(se.id),busy:Qn})]}),e.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",onClick:Le=>Le.stopPropagation(),children:[g.has(se.id)?e.jsx(Me,{size:11,className:"animate-spin text-teal-600 dark:text-teal-400"}):e.jsx("button",{type:"button",onClick:()=>x(se.id),title:"Run",className:"p-1 rounded-md text-teal-600 dark:text-teal-400 hover:bg-teal-50 dark:hover:bg-teal-900/20 transition-colors",children:e.jsx(Xt,{size:11})}),e.jsx("button",{type:"button",disabled:!Ge,onClick:()=>{Ge&&window.open(`/allure/${Ge.allureRunId}`,"_blank")},title:"Report",className:O("p-1 rounded-md transition-colors",Ge?"text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900/20":"text-content-tertiary/40 cursor-not-allowed"),children:e.jsx(Ts,{size:11})}),e.jsx("button",{type:"button",onClick:Le=>{Le.stopPropagation(),bt(se)},title:"Duplicate",className:"p-1 rounded-md text-content-tertiary hover:text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900/20 transition-colors",children:e.jsx(Wu,{size:11})}),e.jsx("button",{type:"button",onClick:Le=>{Le.stopPropagation(),Q(`Delete "${se.name}"?`,()=>k.mutate(se.id))},title:"Delete",className:"p-1 rounded-md text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:e.jsx(es,{size:10})})]}),e.jsx(Zt,{size:11,className:"text-content-tertiary/40 flex-shrink-0"})]})},se.id)})]})]})}),e.jsx(j2,{suiteId:s,open:v,onClose:()=>z(!1)}),e.jsx(WN,{open:C,onClose:()=>w(!1),suiteId:s,onCreated:()=>{}}),e.jsx(Ws,{...F}),Z.size>0&&e.jsx(P2,{selectedIds:Z,suiteId:s,suites:a,onClear:()=>le(new Set),onDeleted:()=>le(new Set),onMoved:()=>le(new Set)})]})}function A2({suiteId:s,caseId:r,suiteName:a,suiteType:o,onBack:c,onRunCase:u}){const{runningCaseIds:x,caseLastRun:h}=Kl(),f=x.has(r),g=h.get(r),{data:y,isLoading:N}=YN(s,r),E=XN(s),S=e2(s,r),P=t2(s,r),M=n2(s,r),{modalProps:k,confirmDelete:j}=Gs(),v=s2(s,r),z=r2(s,r),C=a2(s,r),{data:w}=pg(s),F=gg(),Q=yg(),Z=w?.cases.find(W=>W.caseId===r),le=rx(),K=()=>{(Z?.status??"not-created")==="not-created"?F.mutate({suiteId:s,caseId:r}):Q.mutate({suiteId:s,caseId:r})},[J,ue]=p.useState(""),[ke,re]=p.useState(!1),[be,Ne]=p.useState(""),[ye,_]=p.useState("medium"),[Y,L]=p.useState([]),[T,D]=p.useState(""),[ce,G]=p.useState("none"),[xe,je]=p.useState(""),[Ae,he]=p.useState(""),[Pe,Ke]=p.useState(!1),[yt,qt]=p.useState(!1),Ye=p.useRef(null),[ie,Mt]=p.useState(!1),[xt,Ft]=p.useState(""),[zs,ys]=p.useState(""),q=p.useRef(null),[pe,Fe]=p.useState(null),[bs,bt]=p.useState(null),[As,ts]=p.useState("steps"),[mt,se]=p.useState(!1),[Ue,$e]=p.useState([]),[Ge,Ht]=p.useState([]),[Qs,Qn]=p.useState(["performance","accessibility","seo"]),[Os,os]=p.useState(""),[Le,vs]=p.useState(""),[ls,Is]=p.useState(!1),[Kt,cs]=p.useState([]),[Bi,Sa]=p.useState(!1),[qi,Ca]=p.useState(!1),Ar=p.useRef(null);zr({"recorder:action":W=>{const Te=W;cs(Ee=>[...Ee,Te]),setTimeout(()=>{Ar.current?.scrollTo({top:Ar.current.scrollHeight,behavior:"smooth"})},50)},"recorder:stopped":()=>{Is(!1)}});const Ea=async()=>{try{Sa(!0),cs([]),await $d.start(),Is(!0),$.success("Recording started — Shift+Click = assert element, Ctrl+Shift+U = assert URL",{duration:5e3})}catch(W){$.error(W?.message||"Failed to start recorder")}finally{Sa(!1)}},Hi=async()=>{try{Ca(!0);const W=await $d.stop();if(Is(!1),W.actions.length>0){for(const Te of W.actions){const Ee=hj(Te);await S.mutateAsync({instruction:Te.instruction,generatedCode:Ee,strategy:"recorder",...Te.soft?{soft:!0}:{}})}$.success(`Added ${W.actions.length} recorded steps with code`)}else $("No actions were recorded")}catch(W){$.error(W?.message||"Failed to stop recorder")}finally{Ca(!1)}};p.useEffect(()=>{$d.status().then(W=>{W.recording&&(Is(!0),cs(W.actions))}).catch(()=>{})},[]),p.useEffect(()=>{if(!y)return;ue(y.name),Ne(y.description??""),_(y.priority??"medium"),L([...y.tags]),D(y.timeout?String(y.timeout):"");const W=y.dataSource;W?(G(W.type??"none"),je(W.path??""),he(W.data?JSON.stringify(W.data,null,2):"")):(G("none"),je(""),he("")),$e(y.caseHooks?.before.map(Te=>({id:Te.id,instruction:Te.instruction}))??[]),Ht(y.caseHooks?.after.map(Te=>({id:Te.id,instruction:Te.instruction}))??[]),Qn(y.lighthouseCategories??["performance","accessibility","seo"]),qt(!1),Mt(!1)},[y?.id]);const rt=()=>{qt(!0),Mt(!1)},Pa=W=>{W.key==="Enter"&&(W.preventDefault(),Or())},hn=W=>{const Te=q.current;if(!Te){Ft(Fr=>Fr+W);return}const Ee=Te.selectionStart??xt.length,De=Te.selectionEnd??xt.length,Tt=xt.slice(0,Ee)+W+xt.slice(De);Ft(Tt),setTimeout(()=>{Te.focus(),Te.setSelectionRange(Ee+W.length,Ee+W.length)},0)},Or=async()=>{const W=T?parseInt(T,10):void 0;let Te;if(ce!=="none")if(Te={type:ce},ce==="inline")try{Te.data=JSON.parse(Ae)}catch{}else Te.path=xe;const Ee={before:Ue.map((De,Tt)=>({...De,order:Tt})),after:Ge.map((De,Tt)=>({...De,order:Tt}))};await E.mutateAsync({caseId:r,data:{name:J,description:be,priority:ye,tags:Y,timeout:W,dataSource:Te,caseHooks:Ee,lighthouseCategories:Qs}}),qt(!1),Mt(!0)},Jn=async()=>{yt&&await Or(),u()},Yn=()=>{xt.trim()&&(S.mutate({instruction:xt}),Ft(""))},Ir=async W=>{ys(W),await z.mutateAsync(W).finally(()=>ys(""))},Dr=y?`TC-${(y.name||"").replace(/[^a-zA-Z]/g,"").slice(0,3).toUpperCase()||"TST"}-001`:"…";if(N||!y)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(Me,{size:18,className:"animate-spin text-accent"})});const Ds=[...y.steps].sort((W,Te)=>W.order-Te.order),Wl=Ds.some(W=>W.stepType==="api"),Ki=o==="audit"||o==="performance";return e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex-shrink-0 bg-surface border-b border-border z-10",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-5 pt-2 pb-1 text-[10px] text-content-tertiary",children:[e.jsxs("button",{onClick:()=>window.location.assign("/tests"),className:"hover:text-accent flex items-center gap-1",children:[e.jsx(Df,{size:10})," Suites"]}),e.jsx(Zt,{size:9}),e.jsx("button",{onClick:c,className:"hover:text-accent",children:a}),e.jsx(Zt,{size:9}),e.jsx("span",{className:"text-content-secondary font-semibold font-mono",children:Dr})]}),e.jsxs("div",{className:"px-5 pb-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:ke?e.jsx("input",{ref:Ye,className:"flex-1 text-sm font-bold text-content bg-transparent border-b-2 border-accent outline-none p-0 pb-px",value:J,onChange:W=>{ue(W.target.value),rt()},onBlur:()=>re(!1),onKeyDown:W=>{W.key==="Enter"&&re(!1),W.key==="Escape"&&(ue(y?.name??""),re(!1))},autoFocus:!0}):e.jsxs("div",{className:"flex items-center gap-1.5 group min-w-0",children:[e.jsx("h1",{className:"text-sm font-bold text-content truncate",children:J||"Untitled Test Case"}),e.jsx("button",{type:"button",onClick:()=>{re(!0),setTimeout(()=>Ye.current?.focus(),0)},className:"p-0.5 rounded text-content-tertiary opacity-0 group-hover:opacity-100 hover:bg-surface-inset transition-all",children:e.jsx(Gn,{size:10})})]})}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[e.jsx(Ai,{variant:"full",status:Z?.status??"not-created",onClick:K,busy:le.busyCases.get(`${s}:${r}`)==="create"||le.busyCases.get(`${s}:${r}`)==="sync"||le.busySuites.get(s)==="create"||le.busySuites.get(s)==="sync"||le.allOp==="create"||le.allOp==="sync"}),e.jsxs(we,{variant:"secondary",size:"sm",onClick:Or,loading:E.isPending,disabled:!yt,children:[e.jsx(ga,{size:10})," Save"]}),e.jsxs(we,{size:"sm",onClick:Jn,loading:f,disabled:f,children:[!f&&e.jsx(Xt,{size:10})," ",f?"Running…":"Save & Run"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-1.5 flex-wrap",children:[e.jsx("span",{className:"px-1.5 py-px rounded text-[9px] font-mono font-bold bg-teal-50 dark:bg-teal-900/20 text-teal-700 dark:text-teal-400 ring-1 ring-teal-200 dark:ring-teal-800",children:Dr}),f?e.jsxs("span",{className:"flex items-center gap-1 text-[9px] text-teal-600 dark:text-teal-400 font-medium",children:[e.jsx(Me,{size:9,className:"animate-spin"})," Running"]}):(()=>{if(!g)return e.jsx("span",{className:"text-[8px] px-1.5 py-px rounded ring-1 ring-border text-content-tertiary",children:"Never run"});const W={passed:"bg-emerald-50 dark:bg-emerald-900/20 text-emerald-600 dark:text-emerald-400 ring-emerald-200 dark:ring-emerald-800",failed:"bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 ring-red-200 dark:ring-red-800",skipped:"bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-amber-200 dark:ring-amber-800"};return e.jsx("span",{className:O("text-[8px] px-1.5 py-px rounded capitalize ring-1",W[g.status]??"ring-border text-content-tertiary"),children:g.status})})(),e.jsx("button",{type:"button",disabled:!g,onClick:()=>{g&&window.open(`/allure/${g.allureRunId}`,"_blank")},className:O("p-0.5 rounded transition-colors",g?"text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900/20":"text-content-tertiary cursor-not-allowed"),children:e.jsx(Ts,{size:11})}),e.jsx(nx,{status:Z?.status??"not-created",xrayKey:Z?.xrayTestId}),e.jsx("div",{className:"w-px h-3.5 bg-border"}),e.jsx("div",{className:"flex items-center gap-1",children:bg.map(W=>e.jsx("button",{type:"button",onClick:()=>{_(W),rt()},className:O("px-1.5 py-px rounded text-[8px] capitalize font-bold transition-all ring-1",ye===W?Mu[W]:"ring-transparent text-content-tertiary hover:ring-border"),children:W},W))}),e.jsx("div",{className:"w-px h-3.5 bg-border"}),e.jsx(Oi,{tags:Y,editable:!0,onAdd:W=>{L(Te=>[...Te,W]),rt()},onRemove:W=>{L(Te=>Te.filter(Ee=>Ee!==W)),rt()}}),e.jsx("div",{className:"w-px h-3.5 bg-border"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Cr,{size:9,className:"text-content-tertiary"}),e.jsx("input",{type:"number",min:1e3,step:1e3,className:"w-16 text-[9px] bg-transparent border-b border-dashed border-border px-1 py-px text-content-secondary placeholder:text-content-tertiary focus:outline-none focus:border-accent tabular-nums",placeholder:"30000",value:T,onChange:W=>{D(W.target.value),rt()},onKeyDown:Pa}),e.jsx("span",{className:"text-[8px] text-content-tertiary",children:"ms"})]}),e.jsx("div",{className:"w-px h-3.5 bg-border"}),e.jsxs("button",{type:"button",onClick:()=>Ke(W=>!W),className:O("flex items-center gap-1 text-[9px] font-medium px-1.5 py-0.5 rounded transition-colors",Pe?"text-accent bg-accent/5":"text-content-tertiary hover:text-content-secondary hover:bg-surface-inset"),children:[e.jsx(wr,{size:9})," ",Pe?"Less":"More",e.jsx(kt,{size:8,className:O("transition-transform",Pe&&"rotate-180")})]}),yt&&e.jsx("span",{className:"text-[8px] text-amber-500 dark:text-amber-400 font-bold ml-auto",children:"● Unsaved"}),ie&&!yt&&e.jsx("span",{className:"text-[8px] text-emerald-500 dark:text-emerald-400 font-bold ml-auto",children:"✓ Saved"})]})]}),Pe&&e.jsxs("div",{className:"px-5 pb-3 pt-1 border-t border-border bg-surface-inset/30 animate-fade-in",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:"Description"}),e.jsx("textarea",{rows:2,className:"w-full text-xs text-content-secondary bg-surface rounded-lg border border-border outline-none resize-none focus:ring-2 focus:ring-accent/30 px-2.5 py-1.5",placeholder:"Add a description…",value:be,onChange:W=>{Ne(W.target.value),rt()},onKeyDown:W=>{W.key==="Enter"&&!W.shiftKey&&(W.preventDefault(),Or())}})]}),e.jsx("div",{children:e.jsx(O2,{type:ce,filePath:xe,inlineData:Ae,onTypeChange:W=>{G(W),rt()},onFilePathChange:W=>{je(W),rt()},onInlineChange:W=>{he(W),rt()}})})]}),Ki&&e.jsxs("div",{className:"mt-3 pt-3 border-t border-border/50",children:[e.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-2 flex items-center gap-1.5",children:[e.jsx(ct,{size:9,className:"text-amber-500 dark:text-amber-400"})," Non-Functional Checks (Lighthouse)"]}),e.jsxs("div",{className:"flex items-center gap-4",children:[["performance","accessibility","seo"].map(W=>{const Te={performance:"⚡ Performance",accessibility:"♿ Accessibility",seo:"🔍 SEO"},Ee=Qs.includes(W);return e.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[e.jsx("input",{type:"checkbox",checked:Ee,onChange:()=>{Qn(De=>Ee?De.filter(Tt=>Tt!==W):[...De,W]),rt()},className:"w-3 h-3 rounded accent-amber-600 cursor-pointer"}),e.jsx("span",{className:"text-[10px] text-content-secondary",children:Te[W]})]},W)}),Qs.length===0&&e.jsx("span",{className:"text-[9px] text-amber-600",children:"⚠ No checks selected — Lighthouse will be skipped"})]})]})]})]}),e.jsxs("div",{className:"flex-shrink-0 flex items-center gap-1 px-5 pt-2 pb-0 border-b border-border bg-surface",children:[e.jsx("button",{type:"button",onClick:()=>ts("steps"),className:O("px-3 py-1.5 text-xs font-semibold rounded-t-lg transition-colors border-b-2",As==="steps"?"border-accent text-accent":"border-transparent text-content-tertiary hover:text-content-secondary"),children:"Steps"}),e.jsxs("button",{type:"button",onClick:()=>ts("hooks"),className:O("px-3 py-1.5 text-xs font-semibold rounded-t-lg transition-colors border-b-2",As==="hooks"?"border-accent text-accent":"border-transparent text-content-tertiary hover:text-content-secondary"),children:["Hooks",Ue.length+Ge.length>0&&e.jsx("span",{className:"ml-1 text-[9px] bg-accent/10 text-accent rounded px-1",children:Ue.length+Ge.length})]}),e.jsx("div",{className:"flex-1"}),e.jsxs("button",{type:"button",onClick:()=>se(!0),title:"Step Library",className:"flex items-center gap-1.5 text-[10px] text-content-tertiary hover:text-accent hover:bg-accent/5 px-2 py-1 rounded-lg transition-colors mb-1",children:[e.jsx(Ri,{size:11})," Library"]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto bg-surface-inset/20",children:e.jsxs("div",{className:"max-w-4xl mx-auto px-5 py-3",children:[As==="hooks"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-2 border-b border-border bg-surface-inset/30",children:[e.jsx("h3",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest",children:"Before Hooks"}),e.jsx("p",{className:"text-[9px] text-content-tertiary mt-0.5",children:"Run before all steps"})]}),e.jsxs("div",{className:"p-3 space-y-1.5",children:[Ue.map((W,Te)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs bg-surface-inset/50 rounded-lg px-3 py-2 border border-border",children:[e.jsx("span",{className:"text-content-tertiary font-mono text-[9px] w-4",children:Te+1}),e.jsx("span",{className:"flex-1 text-content-secondary",children:W.instruction}),e.jsx("button",{type:"button",onClick:()=>{$e(Ee=>Ee.filter((De,Tt)=>Tt!==Te)),rt()},className:"p-0.5 rounded text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:e.jsx(_e,{size:11})})]},W.id)),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx("input",{className:"flex-1 text-xs border border-border rounded-lg px-3 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"Add before-hook instruction…",value:Os,onChange:W=>os(W.target.value),onKeyDown:W=>{W.key==="Enter"&&Os.trim()&&($e(Te=>[...Te,{id:crypto.randomUUID(),instruction:Os.trim()}]),os(""),rt())}}),e.jsxs(we,{size:"sm",onClick:()=>{Os.trim()&&($e(W=>[...W,{id:crypto.randomUUID(),instruction:Os.trim()}]),os(""),rt())},children:[e.jsx(Ks,{size:11})," Add"]})]})]})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-2 border-b border-border bg-surface-inset/30",children:[e.jsx("h3",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest",children:"After Hooks"}),e.jsx("p",{className:"text-[9px] text-content-tertiary mt-0.5",children:"Run after all steps (always)"})]}),e.jsxs("div",{className:"p-3 space-y-1.5",children:[Ge.map((W,Te)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs bg-surface-inset/50 rounded-lg px-3 py-2 border border-border",children:[e.jsx("span",{className:"text-content-tertiary font-mono text-[9px] w-4",children:Te+1}),e.jsx("span",{className:"flex-1 text-content-secondary",children:W.instruction}),e.jsx("button",{type:"button",onClick:()=>{Ht(Ee=>Ee.filter((De,Tt)=>Tt!==Te)),rt()},className:"p-0.5 rounded text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:e.jsx(_e,{size:11})})]},W.id)),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx("input",{className:"flex-1 text-xs border border-border rounded-lg px-3 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"Add after-hook instruction…",value:Le,onChange:W=>vs(W.target.value),onKeyDown:W=>{W.key==="Enter"&&Le.trim()&&(Ht(Te=>[...Te,{id:crypto.randomUUID(),instruction:Le.trim()}]),vs(""),rt())}}),e.jsxs(we,{size:"sm",onClick:()=>{Le.trim()&&(Ht(W=>[...W,{id:crypto.randomUUID(),instruction:Le.trim()}]),vs(""),rt())},children:[e.jsx(Ks,{size:11})," Add"]})]})]})]})]}),As==="steps"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-2 mb-3",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(ct,{size:12,className:"absolute left-3 top-1/2 -translate-y-1/2 text-accent/50 pointer-events-none"}),e.jsx("input",{ref:q,className:"w-full text-xs border border-border rounded-lg pl-8 pr-3 py-2 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary shadow-xs",placeholder:"Describe a step in plain English and press Enter…",value:xt,onChange:W=>Ft(W.target.value),onKeyDown:W=>W.key==="Enter"&&Yn()})]}),e.jsx(k2,{onInsert:hn}),o!=="api"&&e.jsx(E2,{onInsert:hn}),e.jsxs(we,{size:"sm",onClick:Yn,disabled:S.isPending,className:"border border-transparent",children:[e.jsx(Ks,{size:11})," Add Step"]}),o!=="api"&&(ls?e.jsxs(we,{size:"sm",loading:qi,onClick:Hi,className:"border border-transparent bg-gradient-to-b from-red-500 to-red-600 text-white hover:brightness-110 shadow-sm hover:shadow-md focus-visible:ring-red-500 animate-pulse",children:[e.jsx($f,{size:10,className:"fill-current"})," Stop Recording"]}):e.jsxs(we,{size:"sm",loading:Bi,onClick:Ea,className:"border border-transparent bg-gradient-to-b from-red-400 to-red-500 text-white hover:brightness-110 shadow-sm hover:shadow-md focus-visible:ring-red-500",children:[e.jsx(Cf,{size:10,className:"fill-current"})," Record"]})),e.jsxs(we,{size:"sm",loading:C.isPending,onClick:()=>C.mutate(),className:"border border-transparent bg-gradient-to-b from-emerald-500 to-emerald-600 text-white hover:brightness-110 shadow-sm hover:shadow-md focus-visible:ring-emerald-500",children:[e.jsx(kr,{size:11})," Generate All"]})]}),o!=="api"&&ls&&Kt.length>0&&e.jsxs("div",{className:"mb-3 border border-red-300 dark:border-red-700 rounded-xl overflow-hidden bg-red-50 dark:bg-red-950/30",children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 bg-red-100 dark:bg-red-900/40 border-b border-red-200 dark:border-red-800",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-red-400 opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-red-500"})]}),e.jsxs("span",{className:"text-[11px] font-semibold text-red-700 dark:text-red-300",children:["Recording — ",Kt.length," action",Kt.length!==1?"s":""," captured"]})]}),e.jsx("span",{className:"text-[10px] text-red-500 dark:text-red-400",children:"Interact with the browser to record steps"})]}),e.jsx("div",{ref:Ar,className:"max-h-40 overflow-y-auto px-3 py-2 space-y-1",children:Kt.map((W,Te)=>e.jsxs("div",{className:"flex items-start gap-2 text-[11px]",children:[e.jsx("span",{className:O("flex-shrink-0 w-5 h-5 rounded-full flex items-center justify-center font-mono font-bold text-[9px]",W.action==="assert"?"bg-emerald-200 dark:bg-emerald-800 text-emerald-700 dark:text-emerald-300":"bg-red-200 dark:bg-red-800 text-red-700 dark:text-red-300"),children:Te+1}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[W.action==="assert"&&e.jsx(et,{size:10,className:"text-emerald-500 flex-shrink-0"}),e.jsx("span",{className:O("text-content-secondary",W.action==="assert"&&"text-emerald-700 dark:text-emerald-300 font-medium"),children:W.instruction})]})]},W.id))})]}),e.jsx("div",{className:"space-y-1.5",children:Ds.length===0?e.jsxs("div",{className:"border border-dashed border-border rounded-xl py-10 text-center bg-surface",children:[e.jsx(ct,{size:20,className:"mx-auto text-content-tertiary/40 mb-2"}),e.jsx("p",{className:"text-xs text-content-tertiary",children:"No steps yet — type an instruction above and press Enter"}),e.jsxs("p",{className:"text-[10px] text-content-tertiary mt-1",children:["Or click ",e.jsx("span",{className:"font-semibold",children:"Generate All"})," to let AI write all steps"]})]}):Ds.map((W,Te)=>e.jsx(I2,{step:W,index:Te,suiteId:s,caseId:r,caseIsApi:Wl,suiteIsAudit:Ki,generating:zs===W.id,isDragging:pe===W.id,isDragOver:bs===W.id,onDragStart:()=>Fe(W.id),onDragOver:()=>bt(W.id),onDrop:()=>{if(!pe||pe===W.id){Fe(null),bt(null);return}const Ee=Ds.map(Fr=>Fr.id),De=Ee.indexOf(pe),Tt=Ee.indexOf(W.id);Ee.splice(De,1),Ee.splice(Tt,0,pe),v.mutate(Ee),Fe(null),bt(null)},onDragEnd:()=>{Fe(null),bt(null)},onDelete:Ee=>j("Delete this step?",()=>M.mutate(Ee)),onGenerate:Ee=>{Ir(Ee)},onSaveInstruction:(Ee,De)=>P.mutate({stepId:Ee,instruction:De}),onSaveTimeout:(Ee,De)=>P.mutate({stepId:Ee,timeout:De}),onSaveRetries:(Ee,De)=>P.mutate({stepId:Ee,retries:De??void 0}),onSaveStepType:(Ee,De)=>P.mutate({stepId:Ee,stepType:De}),onSaveMockUrl:(Ee,De)=>P.mutate({stepId:Ee,mockUrl:De}),onSaveMockResponse:(Ee,De)=>P.mutate({stepId:Ee,mockResponse:De}),onSaveMockStatus:(Ee,De)=>P.mutate({stepId:Ee,mockStatus:De}),onSaveRunAudit:(Ee,De)=>P.mutate({stepId:Ee,runAudit:De},{onSuccess:()=>$.success(De?"⚡ Audit checkpoint set":"Audit checkpoint removed")}),onSaveSoft:(Ee,De)=>P.mutate({stepId:Ee,soft:De},{onSuccess:()=>$.success(De?"Soft assertion — test continues on failure":"Hard assertion — test stops on failure")}),onSaveVisualCheck:(Ee,De)=>P.mutate({stepId:Ee,visualCheck:De},{onSuccess:()=>$.success(De?"👁 Visual regression enabled for this step":"Visual regression disabled for this step")})},W.id))}),Ds.length>0&&e.jsxs("p",{className:"text-[9px] text-content-tertiary text-center mt-3",children:[Ds.length," step",Ds.length!==1?"s":""," · ",Ds.filter(W=>!!W.generatedCode?.trim()).length," with code"]})]})]})}),e.jsx(Ws,{...k}),e.jsx(M2,{open:mt,onClose:()=>se(!1),suiteId:s,caseId:r,onInserted:()=>se(!1)})]})}function O2({type:s,filePath:r,inlineData:a,onTypeChange:o,onFilePathChange:c,onInlineChange:u}){const[x,h]=p.useState([]),[f,g]=p.useState([]),[y,N]=p.useState(!1),[E,S]=p.useState(""),[P,M]=p.useState(!1),k=p.useRef(null);p.useEffect(()=>{la.list().then(h).catch(()=>{})},[]),p.useEffect(()=>{if((s==="json-file"||s==="csv-file")&&r){const C=r.replace(/^data\//,"");la.get(C).then(w=>{g(w.rows),S(w.raw)}).catch(()=>g([]))}else if(s==="inline"&&a)try{g(JSON.parse(a))}catch{g([])}else g([])},[s,r,a]);const j=async C=>{const w=C.target.files?.[0];if(w){M(!0);try{const F=await w.text(),Q=await la.upload(w.name,F);c(Q.path),o(w.name.endsWith(".csv")?"csv-file":"json-file");const Z=await la.list();h(Z),$.success(`Uploaded ${w.name} (${Q.rowCount} rows)`)}catch(F){$.error(F instanceof Error?F.message:"Upload failed")}finally{M(!1),C.target.value=""}}},v=async()=>{if((s==="json-file"||s==="csv-file")&&r){const C=r.replace(/^data\//,"");try{await la.update(C,E);const w=await la.get(C);g(w.rows),N(!1),$.success("Data file saved")}catch(w){$.error(w instanceof Error?w.message:"Save failed")}}else if(s==="inline"){u(E);try{g(JSON.parse(E))}catch{g([])}N(!1)}},z=f.length>0?Object.keys(f[0]):[];return e.jsxs("div",{children:[e.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1.5 flex items-center gap-1",children:[e.jsx(Ef,{size:9})," Data-Driven"]}),e.jsxs("div",{className:"flex items-center gap-1.5 mb-2 flex-wrap",children:[["none","inline","json-file","csv-file"].map(C=>e.jsx("button",{type:"button",onClick:()=>o(C),className:O("px-2 py-0.5 rounded-md text-[9px] font-semibold transition-all ring-1",s===C?"bg-violet-50 dark:bg-violet-900/20 text-violet-600 dark:text-violet-400 ring-violet-200 dark:ring-violet-800":"ring-border text-content-tertiary hover:bg-surface-inset"),children:C==="none"?"Off":C==="inline"?"Inline":C==="json-file"?"JSON":"CSV"},C)),(s==="json-file"||s==="csv-file")&&e.jsxs("select",{className:"max-w-[160px] text-[10px] border border-border rounded-md px-1.5 py-0.5 focus:outline-none focus:ring-1 focus:ring-accent bg-surface-inset/50",value:r,onChange:C=>c(C.target.value),children:[e.jsx("option",{value:"",children:"Select file…"}),x.filter(C=>s==="csv-file"?C.type==="csv":C.type==="json").map(C=>e.jsx("option",{value:C.path,children:C.name},C.name))]}),s!=="none"&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:()=>k.current?.click(),className:"flex items-center gap-0.5 px-1.5 py-0.5 rounded-md ring-1 ring-dashed ring-violet-300 dark:ring-violet-700 text-[9px] font-semibold text-violet-600 dark:text-violet-400 hover:bg-violet-50 dark:hover:bg-violet-900/20 transition-colors",children:[P?e.jsx(Me,{size:9,className:"animate-spin"}):e.jsx(Ul,{size:9})," Upload"]}),e.jsx("input",{ref:k,type:"file",accept:".json,.csv",onChange:j,className:"hidden"})]})]}),s==="inline"&&!y&&e.jsx("textarea",{className:"w-full h-14 text-[10px] font-mono border border-border rounded-lg px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 mb-2 bg-surface-inset/50",placeholder:'[{"email":"user1@test.com","password":"pass1"}]',value:a,onChange:C=>u(C.target.value)}),s!=="none"&&f.length>0&&!y&&e.jsxs("div",{className:"mb-2",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsxs("span",{className:"text-[9px] text-content-tertiary",children:[f.length," row",f.length!==1?"s":""]}),e.jsxs("button",{type:"button",onClick:()=>{s==="inline"&&S(a),N(!0)},className:"text-[9px] text-violet-600 dark:text-violet-400 hover:text-violet-800 dark:hover:text-violet-300 font-semibold flex items-center gap-0.5",children:[e.jsx(Gn,{size:8})," Edit"]})]}),e.jsx("div",{className:"overflow-x-auto border border-border rounded-lg",children:e.jsxs("table",{className:"w-full text-[10px]",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-surface-inset border-b border-border",children:[e.jsx("th",{className:"px-2 py-1 text-left font-bold text-content-tertiary w-6",children:"#"}),z.map(C=>e.jsx("th",{className:"px-2 py-1 text-left font-bold text-violet-600 dark:text-violet-400",children:`{{${C}}}`},C))]})}),e.jsxs("tbody",{children:[f.slice(0,8).map((C,w)=>e.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-surface-inset/50",children:[e.jsx("td",{className:"px-2 py-0.5 text-content-tertiary tabular-nums",children:w+1}),z.map(F=>e.jsx("td",{className:"px-2 py-0.5 text-content-secondary font-mono",children:C[F]},F))]},w)),f.length>8&&e.jsx("tr",{children:e.jsxs("td",{colSpan:z.length+1,className:"px-2 py-1 text-center text-content-tertiary text-[9px] italic",children:["+",f.length-8," more"]})})]})]})})]}),y&&e.jsxs("div",{className:"mb-2",children:[e.jsx("textarea",{className:"w-full h-32 text-[10px] font-mono border border-violet-300 dark:border-violet-700 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-violet-300 dark:focus:ring-violet-700 bg-violet-50/20 dark:bg-violet-900/10 text-content",value:E,onChange:C=>S(C.target.value)}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-1.5",children:[e.jsxs("button",{type:"button",onClick:v,className:"flex items-center gap-0.5 px-2.5 py-1 rounded-lg bg-violet-600 text-white text-[10px] font-semibold hover:bg-violet-700",children:[e.jsx(et,{size:10})," Save"]}),e.jsxs("button",{type:"button",onClick:()=>N(!1),className:"flex items-center gap-0.5 px-2.5 py-1 rounded-lg border border-border text-[10px] text-content-secondary hover:bg-surface-inset",children:[e.jsx(_e,{size:10})," Cancel"]})]})]})]})}function I2({step:s,index:r,caseIsApi:a,suiteIsAudit:o,generating:c,isDragging:u,isDragOver:x,onDragStart:h,onDragOver:f,onDrop:g,onDragEnd:y,onDelete:N,onGenerate:E,onSaveInstruction:S,onSaveTimeout:P,onSaveRetries:M,onSaveStepType:k,onSaveMockUrl:j,onSaveMockResponse:v,onSaveMockStatus:z,onSaveRunAudit:C,onSaveSoft:w,onSaveVisualCheck:F}){const[Q,Z]=p.useState(!1),[le,K]=p.useState(!1),[J,ue]=p.useState(s.instruction),[ke,re]=p.useState(s.timeout?String(s.timeout):""),[be,Ne]=p.useState(s.retries!=null?String(s.retries):""),[ye,_]=p.useState(s.mockUrl??""),[Y,L]=p.useState(s.mockResponse??""),[T,D]=p.useState(s.mockStatus?String(s.mockStatus):"200"),ce=p.useRef(null),[G,xe]=p.useState(void 0),je=!!s.generatedCode?.trim(),Ae=s.stepType==="mock",he=!!s.runAudit,Pe=G!==void 0?G:he,Ke=G!==void 0&&G!==he,yt=()=>{G!==void 0&&(C?.(s.id,G),xe(void 0))},qt=()=>xe(void 0);p.useEffect(()=>{Ae&&Z(!0)},[Ae]),p.useEffect(()=>{re(s.timeout?String(s.timeout):"")},[s.timeout]),p.useEffect(()=>{ue(s.instruction)},[s.instruction]),p.useEffect(()=>{le&&ce.current?.focus()},[le]);const Ye=()=>{const ie=J.trim();ie&&ie!==s.instruction&&S(s.id,ie),K(!1)};return e.jsxs("div",{draggable:!0,onDragStart:ie=>{ie.dataTransfer.effectAllowed="move",h()},onDragOver:ie=>{ie.preventDefault(),f()},onDrop:ie=>{ie.preventDefault(),g()},onDragEnd:y,className:O("rounded-lg overflow-hidden transition-all",u?"opacity-40 ring-2 ring-accent":"ring-1 ring-border",x?"ring-2 ring-accent shadow-sm":""),children:[e.jsxs("div",{className:"flex items-start gap-2 px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 pt-0.5",children:[e.jsx(Dl,{size:11,className:"text-content-tertiary hover:text-content-secondary cursor-grab active:cursor-grabbing"}),e.jsx("span",{className:"w-5 h-5 rounded-md bg-gradient-to-br from-accent to-accent-dark text-white text-[9px] font-bold flex items-center justify-center",children:r+1})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start gap-1.5 flex-wrap",children:[le?e.jsx("input",{ref:ce,className:"flex-1 text-xs text-content border border-accent/40 rounded-md px-2 py-0.5 focus:outline-none focus:ring-1 focus:ring-accent/30 min-w-0 bg-surface-inset/50",value:J,onChange:ie=>ue(ie.target.value),onKeyDown:ie=>{ie.key==="Enter"&&(ie.preventDefault(),Ye()),ie.key==="Escape"&&(ue(s.instruction),K(!1))},onBlur:Ye}):e.jsx("span",{className:"text-xs text-content font-medium flex-1",children:s.instruction}),e.jsx("span",{className:O("text-[8px] px-1 py-px rounded font-bold uppercase flex-shrink-0 ring-1",Ae?"bg-purple-50 dark:bg-purple-900/20 text-purple-600 dark:text-purple-400 ring-purple-200 dark:ring-purple-800":s.stepType==="api"||a?"bg-violet-50 dark:bg-violet-900/20 text-violet-600 dark:text-violet-400 ring-violet-200 dark:ring-violet-800":o?"bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-amber-200 dark:ring-amber-800":"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 ring-blue-200 dark:ring-blue-800"),children:Ae?"Mock":s.stepType==="api"||a?"API":o?"Audit":"UI"}),Pe&&e.jsxs("span",{className:O("text-[8px] px-1 py-px rounded font-bold flex items-center gap-0.5 ring-1",Ke?"bg-amber-50 dark:bg-amber-900/20 text-amber-500 dark:text-amber-400 ring-amber-200 dark:ring-amber-800 opacity-60":"bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-amber-200 dark:ring-amber-800"),children:[e.jsx(ct,{size:7}),Ke?"Audit*":"Audit"]}),s.lastHealed&&e.jsx("span",{className:"text-[8px] px-1 py-px rounded bg-amber-50 text-amber-600 ring-1 ring-amber-200 font-bold",children:"healed"})]}),je&&!le&&e.jsx("p",{className:"text-[10px] text-content-tertiary mt-px",children:"Code generated ✓"})]}),e.jsxs("select",{value:s.stepType??"ui",onChange:ie=>{ie.target.value==="mock"&&Z(!0),k?.(s.id,ie.target.value)},className:"text-[10px] border border-border rounded-md px-1 py-0.5 bg-surface-inset/50 text-content-secondary focus:outline-none focus:border-accent flex-shrink-0",children:[e.jsx("option",{value:"ui",children:"UI"}),e.jsx("option",{value:"api",children:"API"}),e.jsx("option",{value:"mock",children:"Mock"})]}),e.jsx("input",{type:"number",min:0,max:5,step:1,className:"w-10 text-[10px] border border-border rounded-md px-1.5 py-0.5 text-content-secondary placeholder:text-content-tertiary focus:outline-none focus:border-accent flex-shrink-0 bg-surface-inset/50",placeholder:"×",title:"Retries",value:be,onChange:ie=>Ne(ie.target.value),onBlur:()=>{const ie=be.trim()?parseInt(be,10):null,Mt=s.retries??null;ie!==Mt&&M?.(s.id,ie!=null&&ie>=0?ie:null)},onKeyDown:ie=>{ie.key==="Enter"&&ie.target.blur()}}),e.jsx("input",{type:"number",min:100,step:100,className:"w-16 text-[10px] border border-border rounded-md px-1.5 py-0.5 text-content-secondary placeholder:text-content-tertiary focus:outline-none focus:border-accent flex-shrink-0 bg-surface-inset/50",placeholder:"ms",value:ke,onChange:ie=>re(ie.target.value),onBlur:()=>{const ie=ke.trim()?parseInt(ke,10):null,Mt=s.timeout??null;ie!==Mt&&P(s.id,ie&&ie>0?ie:null)},onKeyDown:ie=>{ie.key==="Enter"&&ie.target.blur()}}),e.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",children:[le?e.jsx("button",{type:"button",onClick:Ye,className:"p-1 rounded-md text-emerald-500 hover:bg-emerald-50 dark:hover:bg-emerald-900/20 transition-colors",children:e.jsx(et,{size:12})}):e.jsx("button",{type:"button",onClick:()=>K(!0),className:"p-1 rounded-md text-content-tertiary hover:text-accent hover:bg-accent/5 transition-colors",children:e.jsx(Gn,{size:11})}),o&&!a&&s.stepType!=="api"&&s.stepType!=="mock"&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",title:Pe?"Remove Lighthouse audit checkpoint":"Mark as Lighthouse audit checkpoint",onClick:ie=>{ie.stopPropagation(),xe(!Pe)},onMouseDown:ie=>ie.stopPropagation(),className:O("flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[9px] font-bold transition-all cursor-pointer select-none",Pe?"text-amber-700 dark:text-amber-400 bg-amber-100 dark:bg-amber-900/30 hover:bg-amber-200 dark:hover:bg-amber-900/40 ring-1 ring-amber-300 dark:ring-amber-700":"text-content-tertiary hover:text-amber-600 dark:hover:text-amber-400 hover:bg-amber-50 dark:hover:bg-amber-900/20 ring-1 ring-transparent hover:ring-amber-200 dark:hover:ring-amber-800"),children:[e.jsx(ct,{size:9}),e.jsx("span",{children:"Audit"})]}),Ke&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",title:"Save audit change",onClick:ie=>{ie.stopPropagation(),yt()},onMouseDown:ie=>ie.stopPropagation(),className:"p-1 rounded-md text-emerald-600 hover:bg-emerald-50 dark:hover:bg-emerald-900/20 transition-colors",children:e.jsx(et,{size:11})}),e.jsx("button",{type:"button",title:"Cancel",onClick:ie=>{ie.stopPropagation(),qt()},onMouseDown:ie=>ie.stopPropagation(),className:"p-1 rounded-md text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:e.jsx(_e,{size:11})})]})]}),/^(?:soft\s+)?(?:verify|check|assert|ensure|confirm)\b/i.test(s.instruction)&&e.jsx("button",{type:"button",title:s.soft?"Soft assertion (test continues on failure) — click to make hard":"Hard assertion (test stops on failure) — click to make soft",onClick:ie=>{ie.stopPropagation(),w?.(s.id,!s.soft)},onMouseDown:ie=>ie.stopPropagation(),className:O("flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[9px] font-bold transition-all cursor-pointer select-none",s.soft?"text-blue-700 dark:text-blue-400 bg-blue-100 dark:bg-blue-900/30 hover:bg-blue-200 dark:hover:bg-blue-900/40 ring-1 ring-blue-300 dark:ring-blue-700":"text-content-tertiary hover:text-blue-600 dark:hover:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20 ring-1 ring-transparent hover:ring-blue-200 dark:hover:ring-blue-800"),children:e.jsx("span",{children:s.soft?"Soft":"Hard"})}),s.stepType!=="api"&&e.jsx("button",{type:"button",title:s.visualCheck?"Visual regression enabled — click to disable":"Enable visual regression for this step",onClick:ie=>{ie.stopPropagation(),F?.(s.id,!s.visualCheck)},onMouseDown:ie=>ie.stopPropagation(),className:O("flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[9px] font-bold transition-all cursor-pointer select-none",s.visualCheck?"text-emerald-700 dark:text-emerald-400 bg-emerald-100 dark:bg-emerald-900/30 hover:bg-emerald-200 dark:hover:bg-emerald-900/40 ring-1 ring-emerald-300 dark:ring-emerald-700":"text-content-tertiary hover:text-emerald-600 dark:hover:text-emerald-400 hover:bg-emerald-50 dark:hover:bg-emerald-900/20 ring-1 ring-transparent hover:ring-emerald-200 dark:hover:ring-emerald-800"),children:e.jsx(wa,{size:12})}),e.jsx("button",{type:"button",onClick:()=>E(s.id),disabled:c,className:"p-1 rounded-md text-content-tertiary hover:text-accent hover:bg-accent/5 transition-colors disabled:opacity-40",children:c?e.jsx(Me,{size:12,className:"animate-spin"}):e.jsx(kr,{size:12})}),e.jsx("button",{type:"button",onClick:()=>N(s.id),className:"p-1 rounded-md text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:e.jsx(es,{size:11})}),e.jsx("button",{type:"button",onClick:()=>Z(ie=>!ie),className:"p-1 rounded-md text-content-tertiary hover:text-content-secondary hover:bg-surface-inset transition-colors",children:Q?e.jsx(kt,{size:12}):e.jsx(Zt,{size:12})})]})]}),Q&&e.jsxs("div",{className:"border-t border-border",children:[Ae&&e.jsxs("div",{className:"px-3 py-2.5 bg-violet-50/50 dark:bg-violet-900/10 space-y-1.5 border-b border-border",children:[e.jsx("p",{className:"text-[9px] font-bold text-violet-600 dark:text-violet-400 uppercase tracking-widest",children:"Mock Route"}),e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx("input",{className:"flex-1 text-[10px] border border-border rounded px-2 py-1 bg-surface focus:outline-none focus:border-violet-400",placeholder:"URL pattern, e.g. **/api/users",value:ye,onChange:ie=>_(ie.target.value),onBlur:()=>{ye!==(s.mockUrl??"")&&j?.(s.id,ye)}}),e.jsx("input",{type:"number",className:"w-16 text-[10px] border border-border rounded px-2 py-1 bg-surface focus:outline-none focus:border-violet-400",placeholder:"Status",value:T,onChange:ie=>D(ie.target.value),onBlur:()=>{const ie=parseInt(T,10);!isNaN(ie)&&ie!==(s.mockStatus??200)&&z?.(s.id,ie)}})]}),e.jsx("textarea",{rows:3,className:"w-full text-[10px] border border-border rounded px-2 py-1 bg-surface focus:outline-none focus:border-violet-400 font-mono resize-none",placeholder:'{"key":"value"}',value:Y,onChange:ie=>L(ie.target.value),onBlur:()=>{Y!==(s.mockResponse??"")&&v?.(s.id,Y)}})]}),je?e.jsx(sx,{code:s.generatedCode,maxLines:12,className:"rounded-none"}):e.jsxs("div",{className:"px-3 py-2.5 text-[10px] text-content-tertiary italic bg-surface-inset/30",children:["No code yet — click ",e.jsx(kr,{size:9,className:"inline mb-0.5"})," to generate"]})]})]})}let Bs=null,gi=!1;const Tu=new Set;function yi(){Tu.forEach(s=>s())}const Ms={subscribe(s){return Tu.add(s),()=>{Tu.delete(s)}},getSnapshot(){return{job:Bs,showPopup:gi}},start(s,r){const a=`gen-${Date.now()}`;return Bs={id:a,tab:s,label:r,status:"running",startedAt:Date.now()},gi=!1,yi(),a},done(s,r){Bs&&(Bs={...Bs,status:"done",suiteId:s,suiteName:r},gi=!0,yi())},error(s){Bs&&(Bs={...Bs,status:"error",error:s},yi())},dismissPopup(){gi=!1,yi()},clear(){Bs=null,gi=!1,yi()},isRunning(){return Bs?.status==="running"}};function vg(){const[s,r]=p.useState(()=>Ms.getSnapshot());return p.useEffect(()=>Ms.subscribe(()=>r(Ms.getSnapshot())),[]),s}const D2=[{title:"Login Flow",story:"User logs in with valid credentials, navigates to the dashboard, and verifies that the welcome message is displayed."},{title:"E-Commerce Checkout",story:"User searches for a product, adds it to the cart, proceeds to checkout, and completes the purchase."},{title:"Admin Management",story:"Admin user creates a new account, assigns roles, and verifies the account appears in the user list."}],F2=/^(https?:\/\/.+\/(browse|issue)\/[A-Z][A-Z0-9_]+-\d+|https?:\/\/.+selectedIssue=[A-Z][A-Z0-9_]+-\d+|[A-Z][A-Z0-9_]+-\d+)$/i;function Tp(s){return s.trim()?F2.test(s.trim()):!0}function zp(s){const r=s.trim();if(!r)return null;const a=r.match(/([A-Z][A-Z0-9_]+-\d+)/i);return a?a[1].toUpperCase():null}function L2(s){const r=s.trim();if(!r)return[];if(r.startsWith("["))try{const u=JSON.parse(r).map(x=>{if(typeof x=="string")return{story:x.trim()};if(typeof x=="object"&&x!==null&&"story"in x){const h=x;return{story:String(h.story).trim(),suiteName:h.suiteName,jiraUrl:h.jiraUrl}}return null}).filter(x=>x!==null&&x.story.length>=10);if(u.length>0)return u}catch{}const a=r.split(/\n\s*---+\s*\n/).map(c=>c.trim()).filter(Boolean);if(a.length>1)return a.map(c=>c.replace(/^\d+\.\s*/,"").trim()).filter(c=>c.length>=10).map(c=>({story:c}));const o=r.split(`
|
|
905
|
+
`).filter(c=>/^\d+[\.\)]\s/.test(c.trim()));return o.length>1?o.map(c=>c.replace(/^\d+[\.\)]\s*/,"").trim()).filter(c=>c.length>=10).map(c=>({story:c})):r.length>=10?[{story:r}]:[]}function su({icon:s,title:r,desc:a,tag:o,active:c,gradient:u,onClick:x}){return e.jsxs("button",{type:"button",onClick:x,className:O("relative flex items-start gap-2.5 p-3 rounded-xl border-2 text-left transition-all duration-200 group flex-1 min-w-0",c?"border-accent bg-accent/[0.04] shadow-sm":"border-transparent bg-surface hover:bg-surface-inset/50 hover:border-border"),children:[c&&e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 -translate-y-px w-8 h-[3px] rounded-full bg-gradient-to-r from-accent to-accent-light"}),e.jsx("div",{className:O("w-5 h-5 rounded flex items-center justify-center transition-all flex-shrink-0",c?u:"bg-surface-inset"),children:e.jsx(s,{size:14,className:c?"text-white":"text-content-tertiary",strokeWidth:1.8})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:O("text-xs font-semibold transition-colors",c?"text-content":"text-content-secondary"),children:r}),o&&e.jsx("span",{className:O("text-[8px] font-bold uppercase tracking-wider px-1 py-px rounded",c?"bg-accent/10 text-accent":"bg-surface-inset text-content-tertiary"),children:o})]}),e.jsx("p",{className:"text-[10px] text-content-tertiary mt-px leading-snug truncate",children:a})]})]})}function Ap({title:s,icon:r,children:a,defaultOpen:o=!1}){const[c,u]=p.useState(o);return e.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[e.jsxs("button",{type:"button",onClick:()=>u(x=>!x),className:"w-full flex items-center justify-between px-4 py-3 bg-surface-inset/50 hover:bg-surface-inset transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(r,{size:13,className:"text-content-tertiary"}),e.jsx("span",{className:"text-xs font-semibold text-content-secondary",children:s})]}),e.jsx(kt,{size:13,className:O("text-content-tertiary transition-transform duration-200",c&&"rotate-180")})]}),c&&e.jsx("div",{className:"px-4 py-3 border-t border-border bg-surface",children:a})]})}function _2({content:s,onClose:r}){const[a,o]=p.useState(!1);return e.jsxs("div",{className:O("rounded-xl border overflow-hidden transition-all animate-fade-in","border-indigo-200/50 bg-gradient-to-br from-indigo-50/40 via-surface to-violet-50/20"),children:[e.jsxs("div",{className:"px-3 pt-3 pb-1.5 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-indigo-100/80 text-indigo-700 text-xs font-bold",children:[e.jsx(Na,{size:11})," ",s.issueKey]}),e.jsx("span",{className:"px-2 py-0.5 rounded-md bg-surface-inset text-content-secondary text-[10px] font-semibold border border-border",children:s.issueType}),e.jsx("span",{className:"px-2 py-0.5 rounded-md bg-surface-inset text-content-secondary text-[10px] font-semibold border border-border",children:s.status}),e.jsx("span",{className:"px-2 py-0.5 rounded-md bg-amber-50 text-amber-700 text-[10px] font-semibold border border-amber-200/50",children:s.priority})]}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[e.jsx("button",{type:"button",onClick:()=>o(c=>!c),className:"text-indigo-500 hover:text-indigo-700 text-[10px] font-semibold px-2 py-1 rounded-md hover:bg-indigo-50 transition-colors",children:a?"Less":"More"}),e.jsx("button",{type:"button",onClick:r,className:"p-1 rounded-md text-content-tertiary hover:text-content-secondary hover:bg-surface-inset transition-colors",children:e.jsx(_e,{size:13})})]})]}),e.jsx("p",{className:"font-semibold text-content text-xs leading-relaxed",children:s.summary})]}),e.jsxs("div",{className:O("px-3 pb-3 space-y-1.5",a?"overflow-y-auto max-h-[200px]":""),children:[s.description&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:"Description"}),e.jsx("p",{className:O("text-xs text-content-secondary leading-relaxed whitespace-pre-wrap",!a&&"line-clamp-3"),children:s.description})]}),s.acceptanceCriteria&&a&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:"Acceptance Criteria"}),e.jsx("p",{className:"text-xs text-content-secondary leading-relaxed whitespace-pre-wrap",children:s.acceptanceCriteria})]}),s.comments.length>0&&a&&e.jsxs("div",{children:[e.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:["Comments (",s.comments.length,")"]}),s.comments.map((c,u)=>e.jsx("p",{className:"text-xs text-content-secondary italic mt-1 whitespace-pre-wrap",children:c},u))]}),s.labels.length>0&&e.jsx("div",{className:"flex items-center gap-1 flex-wrap pt-1",children:s.labels.map(c=>e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-surface-inset text-content-tertiary text-[9px] font-medium border border-border",children:c},c))})]})]})}function U2({pct:s,size:r=64,stroke:a=5}){const o=(r-a)/2,c=2*Math.PI*o,u=c-s/100*c;return e.jsxs("svg",{width:r,height:r,className:"-rotate-90",children:[e.jsx("circle",{cx:r/2,cy:r/2,r:o,fill:"none",stroke:"currentColor",strokeWidth:a,className:"text-surface-inset"}),e.jsx("circle",{cx:r/2,cy:r/2,r:o,fill:"none",stroke:"url(#prog-grad)",strokeWidth:a,strokeLinecap:"round",strokeDasharray:c,strokeDashoffset:u,className:"transition-all duration-700 ease-out"}),e.jsx("defs",{children:e.jsxs("linearGradient",{id:"prog-grad",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--color-accent)"}),e.jsx("stop",{offset:"100%",stopColor:"var(--color-accent-light, #818cf8)"})]})})]})}const $2={GET:"bg-blue-500/10 text-blue-600 ring-blue-500/20",POST:"bg-emerald-500/10 text-emerald-600 ring-emerald-500/20",PUT:"bg-amber-500/10 text-amber-600 ring-amber-500/20",DELETE:"bg-red-500/10 text-red-600 ring-red-500/20",PATCH:"bg-violet-500/10 text-violet-600 ring-violet-500/20"},B2=[{icon:_f,label:"--- separator",example:`Story one
|
|
906
|
+
---
|
|
907
|
+
Story two`},{icon:Av,label:"Numbered",example:`1. Story one
|
|
908
|
+
2. Story two`},{icon:pv,label:"JSON",example:'[{"story":"…","suiteName":"Auth"}]'},{icon:Hs,label:"CSV Upload",example:`story,suiteName
|
|
909
|
+
"Story","Auth"`}];function q2(){const[s,r]=p.useState("single"),a=Vs(),[o,c]=p.useState(""),[u,x]=p.useState(""),[,h]=p.useState(!1),[f,g]=p.useState(""),[y,N]=p.useState(null),[E,S]=p.useState(!0),[P,M]=p.useState(""),[k,j]=p.useState(3),[v,z]=p.useState([]),[C,w]=p.useState(null),[F,Q]=p.useState(null),[Z,le]=p.useState(null),[K,J]=p.useState(""),[ue,ke]=p.useState([]),re=p.useRef(null);p.useEffect(()=>{const q=L2(P),pe=ue.map(Fe=>({story:[Fe.summary,Fe.description,Fe.acceptanceCriteria].filter(Boolean).join(`
|
|
910
|
+
`),suiteName:Fe.summary,jiraUrl:Fe.issueKey}));z([...pe,...q])},[P,ue]);const[be,Ne]=p.useState(""),[ye,_]=p.useState(""),[Y,L]=p.useState(""),[T,D]=p.useState(null),[ce,G]=p.useState(""),xe=oe({mutationFn:q=>oa.fetchJira(q),onSuccess:q=>{N(q),S(!0),$.success(`Fetched ${q.issueKey}: ${q.summary}`)},onError:q=>{N(null),$.error(q.message)}}),je=oe({mutationFn:q=>oa.fetchJira(q),onSuccess:q=>{if(ue.some(pe=>pe.issueKey===q.issueKey)){$.error(`${q.issueKey} already added`);return}ke(pe=>[...pe,q]),J(""),$.success(`Added ${q.issueKey}`)},onError:q=>{$.error(q.message)}}),Ae=oe({mutationFn:()=>(Ms.start("single",u||"Test Suite"),oa.generate(o,u||void 0,f||void 0)),onSuccess:q=>{h(!0),Ms.done(q.suiteId,q.suiteName)},onError:q=>{Ms.error(q.message),$.error(q.message)}}),he=oe({mutationFn:()=>oa.generateBulk(v,k),onSuccess:q=>$.success(`Processing ${q.total} stories…`),onError:q=>$.error(q.message)}),Pe=oe({mutationFn:()=>oa.swaggerPreview(be),onSuccess:q=>{D(q),_(q.title?`${q.title} API Tests`:""),$.success(`Found ${q.totalEndpoints} endpoints`)},onError:q=>{D(null),$.error(q.message)}}),Ke=oe({mutationFn:()=>{Ms.start("swagger",ye||"API Tests");const q=Y.trim()?Y.split(",").map(pe=>pe.trim()).filter(Boolean):void 0;return oa.generateFromSwagger(be,ye||void 0,q,ce)},onSuccess:q=>{Ms.done(q.suiteId,q.suiteName),$.success(`Generated ${q.endpointsFound} endpoint tests`)},onError:q=>{Ms.error(q.message),$.error(q.message)}});Vd("story:bulk-start",q=>{const pe=q;le(pe.jobId),w({jobId:pe.jobId,total:pe.total,completed:0,failed:0,currentIndex:0,currentStory:""}),Q(null)}),Vd("story:bulk-progress",q=>{const pe=q;pe.jobId===Z&&w(pe)}),Vd("story:bulk-done",q=>{const pe=q;pe.jobId===Z&&(Q(pe),w(null),pe.failed===0?$.success(`All ${pe.completed} suites generated!`):$.success(`${pe.completed} done, ${pe.failed} failed`))});const yt=q=>{const pe=q.target.files?.[0];if(!pe)return;const Fe=new FileReader;Fe.onload=bs=>{const bt=bs.target?.result;if(pe.name.endsWith(".csv")){const ts=bt.split(`
|
|
911
|
+
`).slice(1).map(mt=>mt.split(",").map(se=>se.replace(/^"|"$/g,"").trim())).filter(mt=>mt[0]?.length>=10).map(mt=>({story:mt[0],suiteName:mt[1]||void 0}));M(ts.map((mt,se)=>`${se+1}. ${mt.story}`).join(`
|
|
912
|
+
`))}else M(bt)},Fe.readAsText(pe),q.target.value=""},qt=C?Math.round((C.completed+C.failed)/C.total*100):0,Ye=he.isPending||C!==null&&F===null,ie=Tp(f),Mt=zp(f),xt=Tp(K),Ft=zp(K),zs=q=>ke(pe=>pe.filter(Fe=>Fe.issueKey!==q)),ys=o.trim().length>=10||!!y&&!!f.trim();return e.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-8 h-8 rounded-xl bg-gradient-to-br from-violet-500 via-indigo-500 to-blue-600 flex items-center justify-center shadow-sm shadow-indigo-500/20",children:e.jsx(Bt,{size:16,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-base font-bold text-content tracking-tight",children:"Smart Tests"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"AI-powered test generation from stories, Jira, or API specs"})]})]})}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 p-1 rounded-xl bg-surface border border-border shadow-xs",children:[e.jsx(su,{icon:kr,title:"Single Story",desc:"Describe one user journey — AI creates the full test suite",active:s==="single",gradient:"bg-gradient-to-br from-violet-500 to-indigo-600",onClick:()=>r("single")}),e.jsx(su,{icon:Er,title:"Bulk Import",desc:"Generate multiple suites at once from text, JSON, CSV, or Jira",tag:"batch",active:s==="bulk",gradient:"bg-gradient-to-br from-amber-500 to-orange-600",onClick:()=>r("bulk")}),e.jsx(su,{icon:Vu,title:"API Import",desc:"Import OpenAPI / Swagger specs to auto-generate API tests",tag:"api",active:s==="swagger",gradient:"bg-gradient-to-br from-emerald-500 to-teal-600",onClick:()=>r("swagger")})]}),s==="single"&&e.jsxs("div",{className:"grid grid-cols-5 gap-3 animate-fade-in",children:[e.jsxs("div",{className:"col-span-3 space-y-3",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 rounded bg-indigo-100 flex items-center justify-center",children:e.jsx(vl,{size:14,className:"text-indigo-600"})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[11px] font-bold text-content",children:"Jira Integration"}),e.jsx("span",{className:"ml-2 text-[10px] text-content-tertiary font-medium",children:"Optional"})]})]}),y&&!E&&e.jsxs("button",{type:"button",onClick:()=>S(!0),className:"flex items-center gap-1 text-[10px] text-indigo-600 hover:text-indigo-700 font-semibold",children:[e.jsx(wa,{size:10})," Show ",y.issueKey]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx("input",{className:O("w-full rounded-xl px-3 py-2 text-xs transition-all border focus:outline-none focus:ring-2 placeholder-content-tertiary",f.trim()?ie?"border-indigo-300 focus:ring-indigo-300 bg-indigo-50/20":"border-red-300 focus:ring-red-300 bg-red-50/20":"border-border bg-surface-inset/50 focus:ring-accent/30 focus:border-accent/50"),placeholder:"PROJ-123 or paste full Jira URL",value:f,onChange:q=>{g(q.target.value),q.target.value.trim()||N(null)}}),Mt&&ie&&e.jsx("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-[10px] font-mono font-bold text-indigo-600 bg-indigo-100 px-2 py-0.5 rounded-md",children:Mt})]}),e.jsxs(we,{variant:"secondary",size:"sm",onClick:()=>xe.mutate(f),loading:xe.isPending,disabled:!f.trim()||!ie||xe.isPending,children:[e.jsx(Od,{size:14})," Fetch"]})]}),f.trim()&&!ie&&e.jsxs("p",{className:"text-[10px] text-red-500 flex items-center gap-1",children:[e.jsx(gs,{size:10})," Invalid format — use PROJ-123 or full Jira URL"]}),y&&E&&e.jsx(_2,{content:y,onClose:()=>S(!1)})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 rounded bg-violet-100 flex items-center justify-center",children:e.jsx(Hs,{size:14,className:"text-violet-600"})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[11px] font-bold text-content",children:"User Story"}),y?e.jsx("span",{className:"ml-2 text-[10px] text-content-tertiary font-medium",children:"Optional — Jira content used"}):e.jsx("span",{className:"ml-1 text-red-400 text-xs",children:"*"})]})]}),e.jsx("textarea",{className:"w-full rounded-xl border border-border bg-surface-inset/50 p-4 text-sm text-content leading-relaxed focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/50 resize-vertical min-h-[80px] placeholder-content-tertiary transition-all",rows:y?3:5,placeholder:y?"Add extra context or leave blank — Jira content is enough":`Describe the user journey you want to automate…
|
|
913
|
+
|
|
914
|
+
Example: User logs in with valid credentials, navigates to the dashboard, and verifies that the welcome message is displayed.`,value:o,onChange:q=>{c(q.target.value),h(!1)}})]}),e.jsx("div",{className:"rounded-xl border border-border bg-surface p-3.5",children:e.jsxs("div",{className:"flex items-end gap-3",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("label",{className:"text-[11px] font-bold text-content mb-2 block",children:["Suite Name ",e.jsx("span",{className:"text-content-tertiary font-normal text-[10px]",children:"(AI auto-suggests if blank)"})]}),e.jsx("input",{className:"w-full rounded-xl border border-border bg-surface-inset/50 px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/50 placeholder-content-tertiary transition-all",placeholder:y?`e.g. ${y.summary}`:"e.g. Authentication Tests",value:u,onChange:q=>x(q.target.value)})]}),e.jsxs(we,{onClick:()=>Ae.mutate(),loading:Ae.isPending,disabled:!ys,children:[e.jsx(Bt,{size:14})," Generate Suite"]})]})})]}),e.jsxs("div",{className:"col-span-2 space-y-3",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ct,{size:13,className:"text-amber-500"}),e.jsx("span",{className:"text-[11px] font-bold text-content",children:"Quick Start"})]}),e.jsx("div",{className:"space-y-2",children:D2.map((q,pe)=>e.jsxs("button",{type:"button",onClick:()=>{c(q.story),h(!1)},className:"w-full text-left px-3 py-2 rounded-lg border border-border bg-surface-inset/30 hover:bg-accent/[0.04] hover:border-accent/30 transition-all group",children:[e.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[e.jsx("span",{className:"text-[10px] font-bold text-content group-hover:text-accent transition-colors",children:q.title}),e.jsx(uv,{size:11,className:"text-content-tertiary group-hover:text-accent transition-colors"})]}),e.jsx("p",{className:"text-[10px] text-content-tertiary leading-snug line-clamp-2",children:q.story})]},pe))})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(mp,{size:13,className:"text-accent"}),e.jsx("span",{className:"text-[11px] font-bold text-content",children:"Pro Tips"})]}),e.jsx("div",{className:"space-y-2",children:["Paste a Jira link to auto-fetch story details","Write in plain English — describe the full journey","Include expected outcomes for better assertions","Combine Jira + extra context for best results"].map((q,pe)=>e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(fr,{size:9,className:"text-accent flex-shrink-0 mt-1"}),e.jsx("span",{className:"text-[11px] text-content-tertiary leading-relaxed",children:q})]},pe))})]})]})]}),s==="bulk"&&e.jsxs("div",{className:"space-y-3 animate-fade-in",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 rounded bg-indigo-100 flex items-center justify-center",children:e.jsx(vl,{size:14,className:"text-indigo-600"})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[11px] font-bold text-content",children:"Fetch from Jira"}),e.jsx("span",{className:"ml-2 text-[10px] text-content-tertiary",children:"Paste URL → Fetch → repeat"})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx("input",{className:O("w-full rounded-xl px-3.5 py-2 text-sm border transition-all focus:outline-none focus:ring-2 placeholder-content-tertiary",K.trim()?xt?"border-indigo-300 focus:ring-indigo-300 bg-indigo-50/20":"border-red-300 focus:ring-red-300 bg-red-50/20":"border-border bg-surface-inset/50 focus:ring-accent/30"),placeholder:"PROJ-123 or Jira URL",value:K,onChange:q=>J(q.target.value),onKeyDown:q=>{q.key==="Enter"&&K.trim()&&xt&&!je.isPending&&!Ye&&je.mutate(K)},disabled:Ye}),Ft&&xt&&e.jsx("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-[10px] font-mono font-bold text-indigo-600 bg-indigo-100 px-2 py-0.5 rounded-md",children:Ft})]}),e.jsxs(we,{variant:"secondary",size:"sm",onClick:()=>je.mutate(K),loading:je.isPending,disabled:!K.trim()||!xt||je.isPending||Ye,children:[e.jsx(Od,{size:14})," Fetch"]})]}),K.trim()&&!xt&&e.jsxs("p",{className:"text-[10px] text-red-500 flex items-center gap-1",children:[e.jsx(gs,{size:10})," Invalid Jira URL format"]}),ue.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5 pt-1",children:ue.map(q=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-indigo-50 border border-indigo-200/60 text-xs text-indigo-700 transition-all hover:shadow-sm",title:q.summary,children:[e.jsx(Na,{size:9,className:"text-indigo-400"}),e.jsx("span",{className:"font-mono font-bold text-[10px]",children:q.issueKey}),e.jsx("span",{className:"max-w-[120px] truncate text-[10px]",children:q.summary}),!Ye&&e.jsx("button",{type:"button",onClick:()=>zs(q.issueKey),className:"text-indigo-300 hover:text-red-500 transition-colors",children:e.jsx(_e,{size:10})})]},q.issueKey))})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 rounded bg-amber-100 flex items-center justify-center",children:e.jsx(Hs,{size:14,className:"text-amber-600"})}),e.jsx("span",{className:"text-[11px] font-bold text-content",children:"Supported Formats"})]}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:B2.map(({icon:q,label:pe,example:Fe})=>e.jsxs("div",{className:"p-2.5 rounded-xl bg-surface-inset/50 border border-border",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[e.jsx(q,{size:10,className:"text-content-tertiary"}),e.jsx("span",{className:"text-[10px] font-bold text-content-secondary",children:pe})]}),e.jsx("pre",{className:"text-[9px] text-content-tertiary font-mono leading-relaxed whitespace-pre-wrap line-clamp-2",children:Fe})]},pe))})]})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-3 bg-surface-inset/30 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-xs text-content-secondary",children:v.length>0?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-bold text-accent tabular-nums",children:v.length})," stories",ue.length>0&&e.jsxs("span",{className:"text-content-tertiary ml-1",children:["(",ue.length," Jira",v.length-ue.length>0?` + ${v.length-ue.length} manual`:"",")"]})]}):e.jsx("span",{className:"text-content-tertiary",children:"No stories yet"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Parallel"}),e.jsx("select",{className:"text-xs border border-border rounded-lg px-2 py-1 bg-surface focus:outline-none focus:ring-2 focus:ring-accent/30",value:k,onChange:q=>j(Number(q.target.value)),disabled:Ye,children:[1,2,3,4,5].map(q=>e.jsxs("option",{value:q,children:[q,"×"]},q))})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{ref:re,type:"file",accept:".txt,.csv,.json",className:"hidden",onChange:yt}),e.jsxs(we,{variant:"secondary",size:"sm",onClick:()=>re.current?.click(),disabled:Ye,children:[e.jsx(Ul,{size:12})," Upload"]}),e.jsxs(we,{size:"sm",onClick:()=>{Q(null),he.mutate()},loading:he.isPending,disabled:v.length===0||Ye,children:[e.jsx(ct,{size:13})," Generate ",v.length>0?v.length:""," Suites"]})]})]}),e.jsxs("div",{className:"min-h-[220px]",children:[!Ye&&!F&&e.jsx("textarea",{className:"w-full h-[220px] p-4 text-xs text-content leading-relaxed focus:outline-none resize-none font-mono placeholder-content-tertiary bg-transparent",placeholder:`Paste your stories here…
|
|
915
|
+
|
|
916
|
+
Use --- separators, numbered lists, or JSON array format.
|
|
917
|
+
Or fetch from Jira above.`,value:P,onChange:q=>M(q.target.value),disabled:Ye}),Ye&&C&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx(U2,{pct:qt,size:72,stroke:5}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsxs("span",{className:"text-sm font-bold text-content tabular-nums",children:[qt,"%"]})})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-sm font-semibold text-content",children:"Generating suites…"}),e.jsxs("p",{className:"text-xs text-content-tertiary mt-1",children:[C.completed+C.failed," of ",C.total," complete"]})]}),e.jsx("div",{className:"flex gap-5",children:[["Total",C.total,"text-content"],["Done",C.completed,"text-emerald-600"],["Failed",C.failed,"text-red-500"]].map(([q,pe,Fe])=>e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:`text-lg font-bold tabular-nums ${Fe}`,children:pe}),e.jsx("p",{className:"text-[9px] text-content-tertiary font-semibold uppercase tracking-wider",children:q})]},String(q)))}),C.currentStory&&e.jsxs("div",{className:"max-w-md mx-auto flex items-start gap-2 p-3 bg-accent/5 rounded-xl border border-accent/10",children:[e.jsx(ct,{size:12,className:"text-accent flex-shrink-0 mt-0.5"}),e.jsxs("p",{className:"text-[11px] text-content-secondary line-clamp-2",children:[e.jsxs("span",{className:"font-semibold",children:["#",C.currentIndex+1,":"]})," ",C.currentStory]})]})]}),F&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-4",children:[e.jsx("div",{className:O("w-10 h-10 rounded-xl flex items-center justify-center",F.failed===0?"bg-emerald-100":"bg-amber-100"),children:F.failed===0?e.jsx(He,{size:20,className:"text-emerald-600"}):e.jsx(gs,{size:20,className:"text-amber-600"})}),e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-sm font-bold text-content",children:[F.completed," suites generated",F.failed>0?`, ${F.failed} failed`:" successfully"]}),e.jsx("p",{className:"text-xs text-content-tertiary mt-1",children:"Ready in Test Editor"})]}),e.jsx("div",{className:"flex gap-5",children:[["Total",F.total,"text-content"],["Generated",F.completed,"text-emerald-600"],["Failed",F.failed,"text-red-500"]].map(([q,pe,Fe])=>e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:`text-lg font-bold tabular-nums ${Fe}`,children:pe}),e.jsx("p",{className:"text-[9px] text-content-tertiary font-semibold uppercase tracking-wider",children:q})]},String(q)))}),F.failedItems.length>0&&e.jsx("div",{className:"w-full max-w-lg space-y-1.5 max-h-[140px] overflow-y-auto px-4",children:F.failedItems.map(q=>e.jsxs("div",{className:"flex items-start gap-2 p-2.5 bg-red-50/60 rounded-xl border border-red-200/40",children:[e.jsx(St,{size:12,className:"text-red-500 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] text-red-700 font-medium line-clamp-1",children:q.story}),e.jsx("p",{className:"text-[10px] text-red-400 mt-0.5",children:q.error})]})]},q.index))}),e.jsxs("div",{className:"flex gap-2 pt-2",children:[e.jsxs(we,{size:"sm",onClick:()=>a("/tests"),children:["Open Test Editor ",e.jsx(Zt,{size:13})]}),e.jsxs(we,{variant:"secondary",size:"sm",onClick:()=>{Q(null),M(""),ke([])},children:[e.jsx(_e,{size:13})," Start Over"]})]})]})]})]})]}),s==="swagger"&&e.jsxs("div",{className:"space-y-3 animate-fade-in",children:[e.jsx("div",{className:"flex items-center gap-2.5 px-1",children:[{n:1,label:"Fetch Spec",done:!!T},{n:2,label:"Configure",done:!1},{n:3,label:"Generate",done:!1}].map((q,pe,Fe)=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:O("w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-bold transition-all",q.done?"bg-emerald-500 text-white":"bg-surface-inset text-content-tertiary border border-border"),children:q.done?e.jsx(He,{size:12}):q.n}),e.jsx("span",{className:O("text-xs font-semibold",q.done?"text-emerald-600":"text-content-tertiary"),children:q.label})]}),pe<Fe.length-1&&e.jsx("div",{className:O("w-12 h-px",q.done?"bg-emerald-300":"bg-border")})]},q.n))}),e.jsxs("div",{className:"grid grid-cols-5 gap-3",children:[e.jsxs("div",{className:"col-span-3 rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("div",{className:"w-5 h-5 rounded bg-emerald-100 flex items-center justify-center",children:e.jsx(xn,{size:14,className:"text-emerald-600"})}),e.jsx("span",{className:"text-[11px] font-bold text-content",children:"API Specification URL"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{className:"flex-1 rounded-xl border border-border bg-surface-inset/50 px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/50 placeholder-content-tertiary transition-all",placeholder:"https://api.example.com/v2/api-docs",value:be,onChange:q=>{Ne(q.target.value),D(null)}}),e.jsxs(we,{variant:"secondary",size:"sm",onClick:()=>Pe.mutate(),loading:Pe.isPending,disabled:!be.trim()||Pe.isPending,children:[e.jsx(Od,{size:14})," Fetch & Parse"]})]}),Pe.isError&&e.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-xl bg-red-50/60 border border-red-200/40 text-xs text-red-600",children:[e.jsx(St,{size:13,className:"flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:Pe.error.message}),e.jsx("p",{className:"text-[10px] text-red-400 mt-0.5",children:"Tip: Use the direct spec URL, not a portal page. Check DevTools → Network."})]})]})]}),e.jsxs("div",{className:"col-span-2 rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("div",{className:"w-5 h-5 rounded bg-violet-100 flex items-center justify-center",children:e.jsx(Hs,{size:14,className:"text-violet-600"})}),e.jsx("span",{className:"text-[11px] font-bold text-content",children:"Extra Requirements"}),e.jsx("span",{className:"text-[10px] text-content-tertiary",children:"Optional"})]}),e.jsx("textarea",{className:"w-full rounded-xl border border-border bg-surface-inset/50 px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-accent/30 resize-none placeholder-content-tertiary leading-relaxed",rows:3,placeholder:"e.g. Include Bearer auth, test 400/401/404 errors, validate response schemas…",value:ce,onChange:q=>G(q.target.value)})]})]}),T&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"rounded-xl border border-emerald-200/50 bg-gradient-to-r from-emerald-50/40 via-surface to-teal-50/20 p-3.5 space-y-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-6 h-6 rounded-lg bg-emerald-500 flex items-center justify-center",children:e.jsx(He,{size:13,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold text-content",children:T.title}),e.jsx("p",{className:"text-[10px] text-content-tertiary mt-0.5",children:T.baseUrl})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"text-center px-3",children:[e.jsx("p",{className:"text-base font-bold text-emerald-600 tabular-nums",children:T.totalEndpoints}),e.jsx("p",{className:"text-[8px] font-bold text-content-tertiary uppercase tracking-widest",children:"Endpoints"})]}),e.jsx("div",{className:"w-px h-6 bg-border"}),e.jsxs("div",{className:"text-center px-2",children:[e.jsx("p",{className:"text-base font-bold text-teal-600 tabular-nums",children:T.tags.length}),e.jsx("p",{className:"text-[8px] font-bold text-content-tertiary uppercase tracking-widest",children:"Tags"})]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Bf,{size:11,className:"text-content-tertiary"}),e.jsx("span",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest",children:"Filter by tag"}),Y.trim()&&e.jsx("button",{type:"button",onClick:()=>L(""),className:"text-[9px] text-accent hover:text-accent-dark font-semibold ml-1",children:"Clear all"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:T.tags.map(q=>{const pe=Y.split(",").map(bt=>bt.trim()).filter(Boolean),Fe=pe.includes(q),bs=T.endpoints.filter(bt=>bt.tag===q).length;return e.jsxs("button",{type:"button",onClick:()=>{L(Fe?pe.filter(bt=>bt!==q).join(", "):[...pe,q].join(", "))},className:O("inline-flex items-center gap-1.5 text-[10px] px-2.5 py-1.5 rounded-lg border font-semibold transition-all",Fe?"bg-accent text-white border-accent shadow-sm shadow-accent/20":"bg-surface text-content-secondary border-border hover:border-accent/40"),children:[q,e.jsx("span",{className:O("text-[9px] px-1 py-px rounded font-bold",Fe?"bg-white/20 text-white":"bg-surface-inset text-content-tertiary"),children:bs})]},q)})})]})]}),e.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:e.jsx("div",{className:"max-h-[220px] overflow-y-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{className:"bg-surface-inset/50 sticky top-0 border-b border-border",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left px-4 py-2.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest w-20",children:"Method"}),e.jsx("th",{className:"text-left px-4 py-2.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Path"}),e.jsx("th",{className:"text-left px-4 py-2.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Summary"}),e.jsx("th",{className:"text-left px-4 py-2.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest w-16",children:"Tag"})]})}),e.jsx("tbody",{children:T.endpoints.filter(q=>Y.trim()?Y.split(",").map(pe=>pe.trim()).filter(Boolean).includes(q.tag):!0).map((q,pe)=>e.jsxs("tr",{className:"border-t border-border-muted hover:bg-surface-inset/30 transition-colors",children:[e.jsx("td",{className:"px-4 py-2.5",children:e.jsx("span",{className:O("font-mono font-bold text-[10px] px-2 py-0.5 rounded-md ring-1",$2[q.method]||"bg-surface-inset text-content-secondary ring-border"),children:q.method})}),e.jsx("td",{className:"px-4 py-2.5 font-mono text-content-secondary text-[11px]",children:q.path}),e.jsx("td",{className:"px-4 py-2.5 text-content-tertiary truncate max-w-[240px]",children:q.summary}),e.jsx("td",{className:"px-4 py-2.5",children:e.jsx("span",{className:"text-[9px] text-content-tertiary bg-surface-inset px-1.5 py-0.5 rounded",children:q.tag})})]},pe))})]})})}),e.jsx("div",{className:"rounded-xl border border-border bg-surface p-3.5",children:e.jsxs("div",{className:"flex items-end gap-3",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"text-[11px] font-bold text-content mb-2 block",children:"Suite Name"}),e.jsx("input",{className:"w-full rounded-xl border border-border bg-surface-inset/50 px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-accent/30 placeholder-content-tertiary",placeholder:"e.g. Payment API Tests",value:ye,onChange:q=>_(q.target.value)})]}),e.jsxs(we,{onClick:()=>Ke.mutate(),loading:Ke.isPending,disabled:Ke.isPending,children:[e.jsx(Bt,{size:14})," Generate Suite"]})]})})]}),Ke.isError&&e.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-red-50/60 border border-red-200/40 text-xs text-red-600",children:[e.jsx(St,{size:14,className:"flex-shrink-0 mt-0.5"}),e.jsx("span",{className:"font-medium",children:Ke.error.message})]}),!T&&e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(Ap,{title:"Supported Formats",icon:mp,defaultOpen:!0,children:e.jsx("div",{className:"space-y-1.5",children:["OpenAPI 3.x (JSON / YAML)","Swagger 2.0 (JSON / YAML)","Direct URL, Swagger UI, or /api-docs"].map(q=>e.jsxs("div",{className:"flex items-center gap-2 text-xs text-content-secondary",children:[e.jsx(He,{size:10,className:"text-emerald-500 flex-shrink-0"}),q]},q))})}),e.jsx(Ap,{title:"Pro Tips",icon:ct,defaultOpen:!0,children:e.jsx("div",{className:"space-y-1.5",children:["Use the raw spec URL, not a portal page","Filter by tags to import only relevant endpoints","Generated steps use page.request API","Chained tests use context.setVariable"].map(q=>e.jsxs("div",{className:"flex items-start gap-2 text-xs text-content-secondary",children:[e.jsx(fr,{size:9,className:"text-accent flex-shrink-0 mt-0.5"}),q]},q))})})]})]})]})})})}function Ii({checked:s,onChange:r,label:a,disabled:o}){return e.jsxs("label",{className:O("inline-flex items-center gap-2.5 cursor-pointer select-none",o&&"opacity-40 cursor-not-allowed"),children:[e.jsx("button",{type:"button",role:"switch","aria-checked":s,disabled:o,onClick:()=>r(!s),className:O("relative inline-flex h-[22px] w-10 items-center rounded-full transition-all duration-200","focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus:outline-none",s?"bg-gradient-to-r from-accent to-accent-dark":"bg-slate-200"),children:e.jsx("span",{className:O("inline-block h-4 w-4 rounded-full bg-white shadow-sm transition-transform duration-200",s?"translate-x-[21px]":"translate-x-[3px]")})}),a&&e.jsx("span",{className:"text-sm text-content-secondary",children:a})]})}const H2=[{id:"github",label:"GitHub Actions"},{id:"gitlab",label:"GitLab CI"},{id:"jenkins",label:"Jenkins"}];function K2({open:s,onClose:r,runConfig:a}){const[o,c]=p.useState("github"),[u,x]=p.useState(!1),[h,f]=p.useState(""),[g,y]=p.useState(!1),[N,E]=p.useState(!1),{data:S}=Oe({queryKey:["config"],queryFn:Sr.get}),P=S?.ci?.writeToRepo??!1,M=w=>({platform:w,browsers:a?.browsers??["chromium"],parallel:a?.parallel??2,device:a?.device||void 0}),k=oe({mutationFn:w=>bp.generate(M(w)),onSuccess:w=>{f(w.yaml),y(!1),E(!1)},onError:w=>$.error(w.message)}),j=oe({mutationFn:w=>bp.writeToRepo({...M(w),yaml:h}),onSuccess:w=>$.success(`Written to ${w.path} — review & commit in Git Control`),onError:w=>$.error(w.message)});p.useEffect(()=>{s&&k.mutate(o)},[s,o]);const v=()=>k.mutate(o),z=()=>{h&&navigator.clipboard.writeText(h).then(()=>{x(!0),$.success("Copied to clipboard"),setTimeout(()=>x(!1),2e3)})},C=()=>{if(!h)return;const w=new Blob([h],{type:"text/plain"}),F=URL.createObjectURL(w),Q=document.createElement("a");Q.href=F,Q.download=k.data?.filename??`${o}-ci.yml`,document.body.appendChild(Q),Q.click(),document.body.removeChild(Q),URL.revokeObjectURL(F)};return s?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:r,children:e.jsxs("div",{className:"bg-surface rounded-2xl border border-border shadow-modal w-full max-w-2xl mx-4 overflow-hidden flex flex-col max-h-[85vh]",onClick:w=>w.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border flex-shrink-0",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-bold text-content",children:"CI Config Generator"}),e.jsx("p",{className:"text-[11px] text-content-tertiary mt-0.5",children:"Generate configuration for your CI/CD pipeline"})]}),e.jsx("button",{type:"button",onClick:r,className:"p-1.5 rounded-lg text-content-tertiary hover:bg-surface-inset hover:text-content transition-colors",children:e.jsx(_e,{size:14})})]}),e.jsx("div",{className:"flex border-b border-border px-5 flex-shrink-0",children:H2.map(w=>e.jsx("button",{type:"button",onClick:()=>c(w.id),className:O("px-4 py-2.5 text-xs font-semibold border-b-2 transition-colors -mb-px",o===w.id?"border-accent text-accent":"border-transparent text-content-secondary hover:text-content"),children:w.label},w.id))}),e.jsx("div",{className:"flex-1 overflow-y-auto p-5 min-h-0",children:k.isPending?e.jsx("div",{className:"h-48 flex items-center justify-center",children:e.jsx("p",{className:"text-sm text-content-tertiary",children:"Generating..."})}):e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("p",{className:"text-[11px] text-content-tertiary",children:[N?"Editing — your changes apply to Copy, Download & Write to repo.":"Preview. Click Edit to customise the YAML.",g&&!N&&e.jsx("span",{className:"ml-1 text-amber-500",children:"(edited)"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[g&&e.jsxs("button",{type:"button",onClick:v,className:"flex items-center gap-1 text-[11px] text-content-tertiary hover:text-content transition-colors",title:"Discard edits and regenerate from current run config",children:[e.jsx(_i,{size:11})," Reset"]}),e.jsx("button",{type:"button",onClick:()=>E(w=>!w),className:O("flex items-center gap-1 text-[11px] transition-colors",N?"text-accent":"text-content-tertiary hover:text-content"),title:N?"Finish editing":"Edit the YAML",children:N?e.jsxs(e.Fragment,{children:[e.jsx(et,{size:11})," Done"]}):e.jsxs(e.Fragment,{children:[e.jsx(Gn,{size:11})," Edit"]})})]})]}),e.jsx("textarea",{value:h,onChange:w=>{f(w.target.value),y(!0)},readOnly:!N,spellCheck:!1,className:O("w-full h-72 bg-[#1e1e2e] text-[#cdd6f4] text-xs font-mono p-4 rounded-xl overflow-auto whitespace-pre leading-relaxed resize-y border focus:outline-none",N?"border-accent focus:ring-1 focus:ring-accent cursor-text":"border-border cursor-default")})]})}),e.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-t border-border bg-surface-inset/30 flex-shrink-0",children:[k.data?.filename&&e.jsx("span",{className:"text-[11px] text-content-tertiary font-mono",children:k.data.filename}),e.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[e.jsxs("button",{type:"button",onClick:z,disabled:!h,className:O("flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors","border-border text-content-secondary hover:bg-surface-inset disabled:opacity-40"),children:[u?e.jsx(et,{size:12,className:"text-emerald-500"}):e.jsx(Wu,{size:12}),u?"Copied!":"Copy"]}),e.jsxs("button",{type:"button",onClick:C,disabled:!h,className:O("flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-colors disabled:opacity-40",P?"border border-border text-content-secondary hover:bg-surface-inset":"bg-accent text-white hover:brightness-110"),children:[e.jsx(fa,{size:12}),"Download"]}),P&&e.jsxs("button",{type:"button",onClick:()=>j.mutate(o),disabled:!h||j.isPending,title:"Write this file into the repo at its standard path",className:O("flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-colors","bg-accent text-white hover:brightness-110 disabled:opacity-40"),children:[e.jsx(yr,{size:12}),j.isPending?"Writing…":"Write to repo"]})]})]})]})}):null}const Op=500;let Pl=new Map,Di=new Map,jr=[],ax=0;const zu=new Set;function Au(){ax++,zu.forEach(s=>s())}let Rl={screenshot:null,screenshots:new Map,consoleLogs:[],consoleLogsByCase:new Map,activeCaseIds:[],_v:-1};function V2(){const s=jr[jr.length-1],r=s?Pl.get(s)??null:null,a=Array.from(Di.values()).flat().sort((o,c)=>o.timestamp-c.timestamp);return Rl={screenshot:r,screenshots:new Map(Pl),consoleLogs:a,consoleLogsByCase:new Map(Di),activeCaseIds:[...jr],_v:ax},Rl}const nu={subscribe(s){return zu.add(s),()=>{zu.delete(s)}},getSnapshot(){return Rl._v!==ax?V2():Rl},reset(){Pl=new Map,Di=new Map,jr=[],Au()}};function jg(){const s=p.useSyncExternalStore(nu.subscribe,nu.getSnapshot),r=p.useCallback(c=>{const u=c;Pl.set(u.caseId,u.image),jr.includes(u.caseId)||(jr=[...jr,u.caseId]),Au()},[]),a=p.useCallback(c=>{const u=c,h=[...Di.get(u.caseId)??[],...u.logs];h.length>Op&&h.splice(0,h.length-Op),Di.set(u.caseId,h),Au()},[]);zr({"run:screenshot":r,"run:console":a});const o=p.useCallback(()=>{nu.reset()},[]);return{screenshot:s.screenshot,screenshots:s.screenshots,consoleLogs:s.consoleLogs,consoleLogsByCase:s.consoleLogsByCase,activeCaseIds:s.activeCaseIds,reset:o}}let on=[],Ou=0;const Iu=new Set;function Du(){Ou++,Iu.forEach(s=>s())}let ru={steps:[],_v:-1};const au={subscribe(s){return Iu.add(s),()=>{Iu.delete(s)}},getSnapshot(){return ru._v!==Ou&&(ru={steps:on,_v:Ou}),ru},reset(){on=[],Du()}};function Ng(){const s=p.useSyncExternalStore(au.subscribe,au.getSnapshot),r=p.useCallback(c=>{const u=c;if(u.status!=="running"){if(on.some(x=>x.stepId===u.stepId&&x.status===u.status))return;on=[...on,{...u,timestamp:Date.now()}],on.length>200&&(on=on.slice(-200)),Du()}},[]),a=p.useCallback(()=>{on=[],Du()},[]);zr({"run:step":r,"run:start":a});const o=p.useCallback(()=>{au.reset()},[]);return{stepLogs:s.steps,reset:o}}function wg(s){const[r,a]=p.useState(0),o=p.useRef(null);p.useEffect(()=>(s?(a(0),o.current=setInterval(()=>a(x=>x+1),1e3)):o.current&&(clearInterval(o.current),o.current=null),()=>{o.current&&clearInterval(o.current)}),[s]);const c=Math.floor(r/60).toString().padStart(2,"0"),u=(r%60).toString().padStart(2,"0");return`${c}:${u}`}function ba({browser:s,size:r=16,className:a=""}){const o=(s??"").toLowerCase();return o.includes("chromium")||o.includes("chrome")?e.jsxs("svg",{width:r,height:r,viewBox:"0 0 48 48",className:a,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("circle",{cx:"24",cy:"24",r:"22",fill:"#4285F4"}),e.jsx("path",{d:"M24 14.4h16.97A22 22 0 0 0 24 2 22 22 0 0 0 5.56 33.6L14.08 19A11.6 11.6 0 0 1 24 14.4z",fill:"#EA4335"}),e.jsx("path",{d:"M14.08 19L5.56 33.6A22 22 0 0 0 24 46a22 22 0 0 0 8.52-1.7L24 30.4A11.6 11.6 0 0 1 14.08 19z",fill:"#34A853"}),e.jsx("path",{d:"M24 30.4l8.52 13.9A22 22 0 0 0 40.97 14.4H24a11.6 11.6 0 0 1 8.52 16z",fill:"#FBBC05"}),e.jsx("circle",{cx:"24",cy:"24",r:"8",fill:"white"}),e.jsx("circle",{cx:"24",cy:"24",r:"5.5",fill:"#4285F4"})]}):o.includes("firefox")?e.jsxs("svg",{width:r,height:r,viewBox:"0 0 48 48",className:a,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("circle",{cx:"24",cy:"24",r:"22",fill:"#FF9500"}),e.jsx("path",{d:"M38 16c-1-3-3.5-5.5-5-6.5.8 2 1 3.5.5 5-1-3-3-5-5.5-7.5-.5-.5-1-1-1-1.5 0-.2 0-.3-.2-.3-.1 0-.2.1-.2.2-3 5-1 9 .5 12-2-1-4.5-1-6.5 0-1-2-1-4.5 0-6.5-3 2-5 5-6 8-.2-.5-.3-1.5-.3-2-1.5 1.5-2.5 3.5-3 5.5A18 18 0 0 0 8 30c0 9 7.5 16 16 16s16-7 16-16c0-5-1-10-2-14z",fill:"#FF4500"}),e.jsx("path",{d:"M30 34c-1.5 1.5-4 2.5-6 2.5s-5-1-6.5-3A8 8 0 0 1 16 28c0-2.5 1.5-5 4-6 3-1.5 6-.5 8 1 2 1.5 3 4 3 6.5 0 1.5-.5 3-1 4.5z",fill:"#FFDC00"})]}):o.includes("webkit")||o.includes("safari")?e.jsxs("svg",{width:r,height:r,viewBox:"0 0 48 48",className:a,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("circle",{cx:"24",cy:"24",r:"22",fill:"url(#safari-grad)"}),e.jsx("circle",{cx:"24",cy:"24",r:"18",fill:"white",fillOpacity:"0.15"}),e.jsx("circle",{cx:"24",cy:"24",r:"17",stroke:"white",strokeOpacity:"0.3",strokeWidth:"0.5",fill:"none"}),e.jsx("polygon",{points:"24,8 26,24 24,40 22,24",fill:"white",fillOpacity:"0.9"}),e.jsx("polygon",{points:"24,8 26,24 24,24",fill:"#FF3B30"}),e.jsx("polygon",{points:"24,40 22,24 24,24",fill:"#FF3B30"}),e.jsx("circle",{cx:"24",cy:"24",r:"2.5",fill:"white"}),e.jsx("defs",{children:e.jsxs("linearGradient",{id:"safari-grad",x1:"0",y1:"0",x2:"48",y2:"48",children:[e.jsx("stop",{offset:"0%",stopColor:"#00D4FF"}),e.jsx("stop",{offset:"100%",stopColor:"#0066FF"})]})})]}):e.jsxs("svg",{width:r,height:r,viewBox:"0 0 48 48",className:a,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("circle",{cx:"24",cy:"24",r:"22",stroke:"#94a3b8",strokeWidth:"2",fill:"none"}),e.jsx("ellipse",{cx:"24",cy:"24",rx:"10",ry:"22",stroke:"#94a3b8",strokeWidth:"1.5",fill:"none"}),e.jsx("line",{x1:"2",y1:"24",x2:"46",y2:"24",stroke:"#94a3b8",strokeWidth:"1.5"}),e.jsx("line",{x1:"24",y1:"2",x2:"24",y2:"46",stroke:"#94a3b8",strokeWidth:"1.5"})]})}function ix(s){const r=(s??"").toLowerCase();return r.includes("chromium")||r.includes("chrome")?"Chromium":r.includes("firefox")?"Firefox":r.includes("webkit")||r.includes("safari")?"WebKit":s??"Browser"}const kg=[{id:"desktop-1920",name:"Full HD (1920×1080)",category:"desktop",viewport:{width:1920,height:1080}},{id:"desktop-1440",name:"QHD (1440×900)",category:"desktop",viewport:{width:1440,height:900}},{id:"desktop-1366",name:"Laptop (1366×768)",category:"desktop",viewport:{width:1366,height:768}},{id:"desktop-1280",name:"Default (1280×720)",category:"desktop",viewport:{width:1280,height:720}},{id:"desktop-768",name:"Small Laptop (1024×768)",category:"desktop",viewport:{width:1024,height:768}}],Sg=[{id:"iphone-15-pro",name:"iPhone 15 Pro",category:"mobile",viewport:{width:393,height:852},playwrightDevice:"iPhone 15 Pro",recommendedBrowser:"webkit",dpr:3},{id:"iphone-15",name:"iPhone 15",category:"mobile",viewport:{width:390,height:844},playwrightDevice:"iPhone 15",recommendedBrowser:"webkit",dpr:3},{id:"iphone-14",name:"iPhone 14",category:"mobile",viewport:{width:390,height:844},playwrightDevice:"iPhone 14",recommendedBrowser:"webkit",dpr:3},{id:"iphone-se",name:"iPhone SE",category:"mobile",viewport:{width:375,height:667},playwrightDevice:"iPhone SE",recommendedBrowser:"webkit",dpr:2},{id:"pixel-7",name:"Pixel 7",category:"mobile",viewport:{width:412,height:915},playwrightDevice:"Pixel 7",recommendedBrowser:"chromium",dpr:2.625},{id:"pixel-5",name:"Pixel 5",category:"mobile",viewport:{width:393,height:851},playwrightDevice:"Pixel 5",recommendedBrowser:"chromium",dpr:2.75},{id:"galaxy-s9",name:"Galaxy S9+",category:"mobile",viewport:{width:320,height:658},playwrightDevice:"Galaxy S9+",recommendedBrowser:"chromium",dpr:4.5},{id:"galaxy-s8",name:"Galaxy S8",category:"mobile",viewport:{width:360,height:740},playwrightDevice:"Galaxy S8",recommendedBrowser:"chromium",dpr:3}],Cg=[{id:"ipad-pro-11",name:'iPad Pro 11"',category:"tablet",viewport:{width:834,height:1194},playwrightDevice:"iPad Pro 11",recommendedBrowser:"webkit",dpr:2},{id:"ipad-gen7",name:"iPad (gen 7)",category:"tablet",viewport:{width:810,height:1080},playwrightDevice:"iPad (gen 7)",recommendedBrowser:"webkit",dpr:2},{id:"ipad-mini",name:"iPad Mini",category:"tablet",viewport:{width:768,height:1024},playwrightDevice:"iPad Mini",recommendedBrowser:"webkit",dpr:2},{id:"galaxy-tab-s4",name:"Galaxy Tab S4",category:"tablet",viewport:{width:712,height:1138},playwrightDevice:"Galaxy Tab S4",recommendedBrowser:"chromium",dpr:2.25}],Fu=[...kg,...Sg,...Cg];function Eg(s){if(s)return Fu.find(r=>r.playwrightDevice===s)??Fu.find(r=>r.id===s)}const W2=[{mode:"all",label:"All Tests",desc:"Every suite & case",icon:Qv},{mode:"suite",label:"By Suite",desc:"Specific test suite",icon:Hs},{mode:"tag",label:"By Tag",desc:"Match by tag",icon:Bf},{mode:"test",label:"Single Test",desc:"One test by name",icon:Hs}];function G2(s=60){const[r,a]=p.useState(s),o=p.useRef(!1),c=p.useCallback(u=>{u.preventDefault(),o.current=!0;const x=f=>{if(!o.current)return;const y=u.target.parentElement.getBoundingClientRect(),N=(f.clientX-y.left)/y.width*100;a(Math.max(30,Math.min(80,N)))},h=()=>{o.current=!1,window.removeEventListener("mousemove",x),window.removeEventListener("mouseup",h)};window.addEventListener("mousemove",x),window.addEventListener("mouseup",h)},[]);return{leftPct:r,onMouseDown:c}}function Q2(s=55){const[r,a]=p.useState(s),o=p.useRef(!1),c=p.useCallback(u=>{u.preventDefault(),o.current=!0;const x=f=>{if(!o.current)return;const y=u.target.parentElement.getBoundingClientRect(),N=(f.clientY-y.top)/y.height*100;a(Math.max(25,Math.min(75,N)))},h=()=>{o.current=!1,window.removeEventListener("mousemove",x),window.removeEventListener("mouseup",h)};window.addEventListener("mousemove",x),window.addEventListener("mouseup",h)},[]);return{topPct:r,onMouseDown:c}}const Ip={log:"text-slate-300",info:"text-blue-400",warn:"text-amber-400",error:"text-red-400",debug:"text-slate-500",default:"text-slate-400"},Dp={log:"text-slate-500",info:"text-blue-500",warn:"text-amber-500",error:"text-red-500",debug:"text-slate-600"};function J2(){const[s,r]=p.useState("all"),[a,o]=p.useState(""),[c,u]=p.useState(""),[x,h]=p.useState(""),[f,g]=p.useState(["chromium"]),[y,N]=p.useState(!0),[E,S]=p.useState(!1),[P,M]=p.useState(2),[k,j]=p.useState("only-on-failure"),[v,z]=p.useState("off"),[C,w]=p.useState("off"),[F,Q]=p.useState(""),[Z,le]=p.useState(!1),[K,J]=p.useState(!0),[ue,ke]=p.useState(!1),{data:re=[]}=Oe({queryKey:["suites"],queryFn:()=>Pr.list()}),be=tx(),Ne=jg(),ye=Kl(),_=ye.runningSuiteId!==null||ye.runningCaseIds.size>0,Y=Z||be.isRunning||_,L=wg(Y),T=Y||be.completed;p.useEffect(()=>{Z&&(be.isRunning||be.completed)&&le(!1)},[Z,be.isRunning,be.completed]);const D=oe({mutationFn:he=>ya.start(he),onError:he=>{le(!1),$.error(he.message)}}),ce=oe({mutationFn:()=>ya.stop(),onSuccess:()=>$.success("Stop signal sent — finishing current step…"),onError:()=>$.error("Failed to send stop signal")}),G=he=>{g(Pe=>Pe.includes(he)?Pe.length>1?Pe.filter(Ke=>Ke!==he):Pe:[...Pe,he])},xe=()=>{be.reset(),Ne.reset(),$t.clear(),le(!0);const he={browsers:f,headed:y,noHealing:E,parallel:P,screenshot:k,video:v,trace:C};s==="all"&&(he.all=!0),s==="suite"&&a&&(he.suite=a),s==="tag"&&c&&(he.tag=c),s==="test"&&x&&(he.test=x),F&&(he.device=F),D.mutate(he)},je=()=>{be.reset(),Ne.reset(),$t.clear()},Ae=()=>{$.success("Browser is running in headed mode — check your taskbar")};return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:[T?e.jsx(X2,{progress:be,live:Ne,elapsed:L,runActive:Y,onRunAgain:je,onOpenExternal:Ae,onStop:()=>ce.mutate()}):e.jsx(Y2,{mode:s,setMode:r,suiteId:a,setSuiteId:o,tag:c,setTag:u,testName:x,setTestName:h,browsers:f,toggleBrowser:G,headed:y,setHeaded:N,noHealing:E,setNoHealing:S,parallel:P,setParallel:M,screenshot:k,setScreenshot:j,video:v,setVideo:z,trace:C,setTrace:w,device:F,setDevice:Q,suites:re,runActive:Y,optionsOpen:K,setOptionsOpen:J,onRun:xe,submitting:Z,onCiConfig:()=>ke(!0)}),e.jsx(K2,{open:ue,onClose:()=>ke(!1),runConfig:{browsers:f,parallel:P,device:F||void 0}})]})}function Y2(s){const{mode:r,setMode:a,suiteId:o,setSuiteId:c,tag:u,setTag:x,testName:h,setTestName:f,browsers:g,toggleBrowser:y,headed:N,setHeaded:E,noHealing:S,setNoHealing:P,parallel:M,setParallel:k,screenshot:j,setScreenshot:v,video:z,setVideo:C,trace:w,setTrace:F,device:Q,setDevice:Z,suites:le,runActive:K,onRun:J,submitting:ue,onCiConfig:ke}=s,[re,be]=p.useState("all"),Ne=Eg(Q||void 0),_=(Ne?.category==="mobile"||Ne?.category==="tablet")&&!g.includes("chromium"),Y=re==="all"?Fu:re==="desktop"?kg:re==="mobile"?Sg:Cg;return e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[e.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-emerald-500 to-cyan-600 flex items-center justify-center shadow-sm shadow-emerald-500/20",children:e.jsx(Xt,{size:17,className:"text-white translate-x-0.5"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-sm font-bold text-content",children:"Run Configuration"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Configure and launch your test run"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(we,{size:"sm",variant:"secondary",onClick:ke,children:"CI Config"}),e.jsxs(we,{size:"sm",onClick:J,loading:ue,disabled:K,children:[e.jsx(Xt,{size:10})," Start Run"]})]})]})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-5 gap-3",children:[e.jsxs("div",{className:"lg:col-span-3 space-y-3",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-3.5 py-2 bg-surface-inset/50 border-b border-border flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 rounded-md bg-gradient-to-br from-blue-500 to-indigo-600 flex items-center justify-center",children:e.jsx(ct,{size:10,className:"text-white"})}),e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Run Mode"})]}),e.jsxs("div",{className:"p-3 space-y-2.5",children:[e.jsx("div",{className:"grid grid-cols-2 gap-2",children:W2.map(({mode:L,label:T,desc:D,icon:ce})=>e.jsxs("button",{type:"button",onClick:()=>!K&&a(L),disabled:K,className:O("flex items-start gap-2 p-2.5 rounded-lg border text-left transition-all",K&&"opacity-50 cursor-not-allowed",r===L?"border-accent bg-accent/5 ring-1 ring-accent/20":"border-border hover:border-slate-300 hover:bg-surface-inset/30"),children:[e.jsx(ce,{size:12,className:O("flex-shrink-0 mt-0.5",r===L?"text-accent":"text-content-tertiary")}),e.jsxs("div",{children:[e.jsx("p",{className:O("text-[11px] font-semibold",r===L?"text-accent":"text-content-secondary"),children:T}),e.jsx("p",{className:"text-[9px] text-content-tertiary",children:D})]})]},L))}),r==="suite"&&!K&&e.jsxs("select",{value:o,onChange:L=>c(L.target.value),className:"w-full text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface",children:[e.jsx("option",{value:"",children:"Select a suite..."}),le.map(L=>e.jsx("option",{value:L.name,children:L.name},L.id))]}),r==="tag"&&!K&&e.jsx("input",{className:"w-full text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"e.g. smoke",value:u,onChange:L=>x(L.target.value)}),r==="test"&&!K&&e.jsx("input",{className:"w-full text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"e.g. Login with valid credentials",value:h,onChange:L=>f(L.target.value)})]})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-3.5 py-2 bg-surface-inset/50 border-b border-border flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 rounded-md bg-gradient-to-br from-violet-500 to-purple-600 flex items-center justify-center",children:e.jsx(xn,{size:10,className:"text-white"})}),e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Browsers"})]}),e.jsx("div",{className:"p-3",children:e.jsx("div",{className:"flex gap-2 flex-wrap",children:Kf.map(L=>e.jsxs("button",{type:"button",onClick:()=>!K&&y(L),disabled:K,className:O("flex items-center gap-1.5 px-3 py-1.5 rounded-lg border text-[11px] capitalize transition-all font-medium",K&&"opacity-50 cursor-not-allowed",g.includes(L)?"border-accent bg-accent/10 text-accent ring-1 ring-accent/20":"border-border text-content-secondary hover:border-slate-300"),children:[e.jsx(ba,{browser:L,size:14}),ix(L)]},L))})})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-3.5 py-2 bg-surface-inset/50 border-b border-border flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 rounded-md bg-gradient-to-br from-teal-500 to-cyan-600 flex items-center justify-center",children:e.jsx(vi,{size:10,className:"text-white"})}),e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Device Emulation"}),Ne&&e.jsxs("span",{className:"flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-teal-50 text-teal-600 ring-1 ring-teal-200 text-[9px] font-semibold",children:[Ne.category==="mobile"?e.jsx(vi,{size:8}):Ne.category==="tablet"?e.jsx(ul,{size:8}):e.jsx(gr,{size:8}),Ne.name]})]}),Ne&&e.jsx("button",{type:"button",onClick:()=>Z(""),disabled:K,className:"text-content-tertiary hover:text-content-secondary transition-colors disabled:opacity-50",title:"Clear device",children:e.jsx(_e,{size:12})})]}),e.jsxs("div",{className:"p-3 space-y-2.5",children:[_&&e.jsxs("div",{className:"flex items-start gap-2 px-2.5 py-2 rounded-lg bg-amber-50 border border-amber-200",children:[e.jsx(gs,{size:12,className:"text-amber-500 flex-shrink-0 mt-0.5"}),e.jsxs("p",{className:"text-[10px] text-amber-700 leading-relaxed",children:["Mobile/tablet emulation works best with ",e.jsx("strong",{children:"Chromium"}),". Touch events and mobile UA may not work correctly in Firefox or WebKit."]})]}),e.jsx("div",{className:"flex gap-1 p-0.5 bg-surface-inset rounded-lg",children:[{id:"all",label:"All",icon:null},{id:"desktop",label:"Desktop",icon:gr},{id:"mobile",label:"Mobile",icon:vi},{id:"tablet",label:"Tablet",icon:ul}].map(({id:L,label:T,icon:D})=>e.jsxs("button",{type:"button",onClick:()=>be(L),disabled:K,className:O("flex-1 flex items-center justify-center gap-1 py-1 rounded-md text-[9px] font-semibold transition-all disabled:opacity-50",re===L?"bg-surface shadow-sm text-content":"text-content-tertiary hover:text-content-secondary"),children:[D&&e.jsx(D,{size:9}),T]},L))}),e.jsxs("div",{className:"grid grid-cols-2 gap-1.5 max-h-44 overflow-y-auto pr-0.5",children:[(re==="all"||re==="desktop")&&e.jsxs("button",{type:"button",onClick:()=>!K&&Z(""),disabled:K,className:O("flex flex-col items-start gap-0.5 p-2 rounded-lg border text-left transition-all disabled:opacity-50",Q?"border-border hover:border-slate-300 hover:bg-surface-inset/30":"border-teal-400 bg-teal-50 ring-1 ring-teal-300"),children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(gr,{size:10,className:Q?"text-content-tertiary":"text-teal-500"}),e.jsx("span",{className:O("text-[10px] font-semibold",Q?"text-content-secondary":"text-teal-600"),children:"No Emulation"})]}),e.jsx("span",{className:"text-[9px] text-content-tertiary",children:"Use config viewport"})]}),Y.map(L=>{const T=Q===(L.playwrightDevice??L.id),D=L.category==="mobile"?vi:L.category==="tablet"?ul:gr;return e.jsxs("button",{type:"button",onClick:()=>!K&&Z(L.playwrightDevice??L.id),disabled:K,className:O("flex flex-col items-start gap-0.5 p-2 rounded-lg border text-left transition-all disabled:opacity-50",T?"border-teal-400 bg-teal-50 ring-1 ring-teal-300":"border-border hover:border-slate-300 hover:bg-surface-inset/30"),children:[e.jsxs("div",{className:"flex items-center gap-1 w-full",children:[e.jsx(D,{size:10,className:T?"text-teal-500":"text-content-tertiary"}),e.jsx("span",{className:O("text-[10px] font-semibold truncate flex-1",T?"text-teal-600":"text-content-secondary"),children:L.name}),L.recommendedBrowser&&L.category!=="desktop"&&e.jsx("span",{className:O("text-[8px] px-1 py-0.5 rounded font-medium flex-shrink-0",L.recommendedBrowser==="webkit"?"bg-slate-100 text-slate-500":"bg-blue-50 text-blue-500"),children:L.recommendedBrowser==="webkit"?"Safari":"Chrome"})]}),e.jsxs("span",{className:"text-[9px] text-content-tertiary",children:[L.viewport.width,"×",L.viewport.height,L.dpr?` @${L.dpr}x`:""]})]},L.id)})]})]})]})]}),e.jsxs("div",{className:"lg:col-span-2 space-y-3",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-3.5 py-2 bg-surface-inset/50 border-b border-border flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 rounded-md bg-gradient-to-br from-slate-500 to-slate-700 flex items-center justify-center",children:e.jsx(wr,{size:10,className:"text-white"})}),e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Options"})]}),e.jsxs("div",{className:"p-3 space-y-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-medium text-content-secondary",children:"Headed mode"}),e.jsx("p",{className:"text-[9px] text-content-tertiary",children:"Show browser window"})]}),e.jsx(Ii,{checked:N,onChange:E,disabled:K})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Xu,{size:10,className:"text-amber-500"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-medium text-content-secondary",children:"Disable self-healing"}),e.jsx("p",{className:"text-[9px] text-content-tertiary",children:"Skip AI healing"})]})]}),e.jsx(Ii,{checked:S,onChange:P,disabled:K})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Cv,{size:10,className:"text-blue-500"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-medium text-content-secondary",children:"Parallel workers"}),e.jsx("p",{className:"text-[9px] text-content-tertiary",children:"Concurrent cases"})]})]}),e.jsx("input",{type:"number",min:1,max:10,value:M,disabled:K,onChange:L=>k(Number(L.target.value)),className:"w-12 text-xs border border-border rounded-lg px-1.5 py-1 text-center focus:outline-none focus:ring-2 focus:ring-accent/30 disabled:opacity-50 bg-surface"})]})]})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-3.5 py-2 bg-surface-inset/50 border-b border-border flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 rounded-md bg-gradient-to-br from-pink-500 to-rose-600 flex items-center justify-center",children:e.jsx(Un,{size:10,className:"text-white"})}),e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Capture"})]}),e.jsx("div",{className:"p-3 space-y-2",children:[{label:"Screenshot",icon:Un,cls:"text-blue-400",val:j,set:v,opts:[["off","Off"],["on","Every test"],["only-on-failure","On failure"]]},{label:"Video",icon:$l,cls:"text-purple-400",val:z,set:C,opts:[["off","Off"],["on","Every test"],["on-first-retry","1st retry"],["retain-on-failure","On failure"]]},{label:"Trace",icon:Uf,cls:"text-emerald-400",val:w,set:F,opts:[["off","Off"],["on","Every test"],["on-first-retry","1st retry"],["retain-on-failure","On failure"]]}].map(({label:L,icon:T,cls:D,val:ce,set:G,opts:xe})=>e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-content-secondary min-w-0 flex-shrink-0 font-medium",children:[e.jsx(T,{size:11,className:D}),L]}),e.jsx("select",{value:ce,disabled:K,onChange:je=>G(je.target.value),className:"flex-1 border border-border rounded-lg px-2 py-1 text-[10px] focus:outline-none focus:ring-1 focus:ring-accent/30 bg-surface disabled:opacity-50 min-w-0",children:xe.map(([je,Ae])=>e.jsx("option",{value:je,children:Ae},je))})]},L))})]}),e.jsxs(we,{size:"lg",onClick:J,loading:ue,disabled:K,className:"w-full",children:[e.jsx(Xt,{size:14})," Start Test Run"]})]})]})]})})}function X2({progress:s,live:r,elapsed:a,runActive:o,onRunAgain:c,onOpenExternal:u,onStop:x}){const{leftPct:h,onMouseDown:f}=G2(60),{topPct:g,onMouseDown:y}=Q2(55),N=p.useRef(null),[E,S]=p.useState("steps"),{stepLogs:P}=Ng(),[M,k]=p.useState(null),j=r.activeCaseIds.length>1;p.useEffect(()=>{r.activeCaseIds.length>0&&!M&&k(r.activeCaseIds[0])},[r.activeCaseIds,M]);const v=j&&M?P.filter(C=>C.caseId===M):P,z=j&&M?r.consoleLogsByCase.get(M)??[]:r.consoleLogs;return p.useEffect(()=>{N.current?.scrollIntoView({behavior:"smooth"})},[v.length,z.length]),e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx(Z2,{elapsed:a,runActive:o,progress:s,onRunAgain:c,onStop:x}),j?e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden relative",style:{minHeight:0},children:[e.jsxs("div",{className:"overflow-y-auto bg-slate-900 flex flex-col",style:{height:`${g}%`},children:[e.jsxs("div",{className:"flex-shrink-0 h-8 bg-slate-800 border-b border-slate-700 flex items-center justify-between px-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-red-500/80"}),e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-amber-500/80"}),e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-emerald-500/80"}),e.jsxs("span",{className:"text-[10px] font-semibold text-slate-400 uppercase tracking-wider ml-2",children:["Browser Previews — ",r.activeCaseIds.length," running"]})]}),e.jsx("button",{type:"button",onClick:u,title:"Open in external browser",className:"p-1 rounded text-slate-400 hover:text-white hover:bg-slate-700 transition-colors",children:e.jsx(Na,{size:11})})]}),e.jsx("div",{className:"flex flex-col gap-0 flex-1",children:r.activeCaseIds.map((C,w)=>{const F=r.screenshots.get(C),Q=s.activeCases.get(C)??C.slice(0,8),Z=M===C,le=w===r.activeCaseIds.length-1;return e.jsxs("div",{className:O("flex flex-col cursor-pointer transition-all",!le&&"border-b border-slate-700",Z&&"ring-inset ring-2 ring-accent"),onClick:()=>k(C),children:[e.jsxs("div",{className:O("flex items-center justify-between px-3 py-1.5 flex-shrink-0",Z?"bg-accent/10 border-b border-accent/30":"bg-slate-800/60 border-b border-slate-700"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[s.currentBrowser&&e.jsx(ba,{browser:s.currentBrowser,size:12}),e.jsx("span",{className:"text-[10px] font-mono text-slate-300 truncate max-w-xs",children:Q})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[Z&&e.jsx("span",{className:"text-[8px] font-semibold text-accent uppercase tracking-wider",children:"Selected"}),o&&e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"})]})]}),e.jsx("div",{className:"relative bg-slate-950 flex-1",children:F?e.jsx("img",{src:`data:image/jpeg;base64,${F}`,alt:Q,className:"w-full h-auto object-contain"}):e.jsxs("div",{className:"h-32 flex items-center justify-center gap-2",children:[e.jsx(Me,{size:14,className:"text-slate-600 animate-spin"}),e.jsx("span",{className:"text-[10px] text-slate-600",children:"Waiting for screenshot..."})]})})]},C)})})]}),e.jsxs("div",{className:"flex-shrink-0 h-1.5 bg-slate-700 hover:bg-accent cursor-row-resize flex items-center justify-center transition-colors group relative",onMouseDown:y,children:[e.jsx("div",{className:"absolute inset-x-0 -top-1.5 -bottom-1.5"}),e.jsx("div",{className:"flex gap-0.5",children:e.jsx("div",{className:"w-4 h-0.5 rounded-full bg-slate-500 group-hover:bg-white transition-colors"})})]}),e.jsxs("div",{className:"flex flex-col bg-[#1a1b26] overflow-hidden",style:{height:`${100-g}%`},children:[e.jsx("div",{className:"flex-shrink-0 flex items-center gap-1 px-2 py-1 bg-[#16172a] border-b border-slate-700 overflow-x-auto",children:r.activeCaseIds.map(C=>{const w=s.activeCases.get(C)??C.slice(0,8),F=M===C;return e.jsx("button",{type:"button",onClick:()=>k(C),className:O("px-2 py-0.5 rounded text-[8px] font-mono truncate max-w-[160px] transition-colors flex-shrink-0",F?"bg-accent/20 text-accent ring-1 ring-accent/30":"text-slate-500 hover:text-slate-300 hover:bg-slate-800"),children:w},C)})}),e.jsx(Lp,{tab:E,setTab:S,stepCount:v.length,logCount:z.length}),e.jsx(_p,{tab:E,stepLogs:v,consoleLogs:z,endRef:N}),s.completed&&!o&&e.jsx("div",{className:"flex-shrink-0 border-t border-slate-700 p-3",children:e.jsx(Fp,{completed:s.completed,onRunAgain:c})})]})]}):e.jsxs("div",{className:"flex flex-1 overflow-hidden relative",style:{minHeight:0},children:[e.jsxs("div",{className:"flex flex-col bg-slate-900 overflow-hidden",style:{width:`${h}%`},children:[e.jsx(ew,{onOpenExternal:u,browser:s.currentBrowser}),e.jsxs("div",{className:"flex-1 relative overflow-hidden flex items-center justify-center",children:[r.screenshot?e.jsx("img",{src:`data:image/jpeg;base64,${r.screenshot}`,alt:"Browser",className:O("max-w-full max-h-full object-contain",s.completed&&!o&&"opacity-30")}):o?e.jsx(tw,{progress:s}):null,s.completed&&!o&&e.jsx("div",{className:O("w-full",r.screenshot?"absolute inset-0 flex items-center justify-center bg-black/50 backdrop-blur-sm":"p-6"),children:e.jsx(Fp,{completed:s.completed,onRunAgain:c})}),e.jsx(sw,{step:s.currentStep})]})]}),e.jsx(nw,{onMouseDown:f}),e.jsxs("div",{className:"flex flex-col bg-[#1a1b26] overflow-hidden",style:{width:`${100-h}%`},children:[e.jsx(Lp,{tab:E,setTab:S,stepCount:v.length,logCount:z.length}),e.jsx(_p,{tab:E,stepLogs:v,consoleLogs:z,endRef:N})]})]})]})}function Fp({completed:s,onRunAgain:r}){const a=s.failed===0;return e.jsxs("div",{className:O("w-full max-w-sm rounded-2xl border p-5 shadow-lg",a?"border-emerald-500/30 bg-emerald-950/80":"border-red-500/30 bg-red-950/80"),children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a?e.jsx(He,{size:22,className:"text-emerald-400 flex-shrink-0"}):e.jsx(St,{size:22,className:"text-red-400 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:O("text-sm font-bold",a?"text-emerald-300":"text-red-300"),children:a?"All tests passed!":"Run completed with failures"}),e.jsxs("p",{className:O("text-[10px]",a?"text-emerald-400/70":"text-red-400/70"),children:["Finished in ",Math.round(s.duration/1e3),"s"]})]})]}),e.jsx("div",{className:"grid grid-cols-3 gap-2 mb-4",children:[{label:"Passed",value:s.passed,color:"text-emerald-400",bg:"bg-emerald-500/10 ring-emerald-500/20"},{label:"Failed",value:s.failed,color:"text-red-400",bg:"bg-red-500/10 ring-red-500/20"},{label:"Skipped",value:s.skipped,color:"text-slate-400",bg:"bg-slate-500/10 ring-slate-500/20"}].map(({label:o,value:c,color:u,bg:x})=>e.jsxs("div",{className:O("rounded-xl p-2.5 text-center ring-1",x),children:[e.jsx("p",{className:O("text-lg font-bold tabular-nums",u),children:c}),e.jsx("p",{className:"text-[8px] text-slate-400 uppercase tracking-wider",children:o})]},o))}),e.jsxs("button",{type:"button",onClick:r,className:"w-full flex items-center justify-center gap-2 py-2 rounded-xl ring-1 ring-slate-600 bg-slate-800 hover:bg-slate-700 transition-all text-xs font-medium text-slate-300 hover:text-white",children:[e.jsx(_i,{size:11})," Run Again"]})]})}function Z2({elapsed:s,runActive:r,progress:a,onRunAgain:o,onStop:c}){return e.jsxs("div",{className:"flex-shrink-0 px-4 py-2 bg-surface border-b border-border flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:O("w-7 h-7 rounded-lg flex items-center justify-center",r?"bg-gradient-to-br from-emerald-500 to-cyan-600":a.completed?.failed?"bg-gradient-to-br from-red-500 to-rose-600":"bg-gradient-to-br from-emerald-500 to-green-600"),children:r?e.jsx(Me,{size:13,className:"text-white animate-spin"}):e.jsx(He,{size:13,className:"text-white"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-xs font-bold text-content",children:r?"Running Tests":"Run Complete"}),r&&e.jsx("span",{className:"inline-flex items-center gap-1 text-[8px] font-semibold px-1.5 py-0.5 rounded-md ring-1 bg-emerald-50 text-emerald-600 ring-emerald-200 animate-pulse",children:"LIVE"})]}),a.currentCase&&r&&e.jsx("p",{className:"text-[9px] text-content-tertiary truncate max-w-xs",children:a.currentCase.caseName})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[!r&&a.completed&&e.jsxs("div",{className:"flex items-center gap-1.5 mr-2",children:[e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[9px] font-semibold px-1.5 py-0.5 rounded ring-1 bg-emerald-50 text-emerald-600 ring-emerald-200",children:[e.jsx(He,{size:8})," ",a.completed.passed]}),a.completed.failed>0&&e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[9px] font-semibold px-1.5 py-0.5 rounded ring-1 bg-red-50 text-red-600 ring-red-200",children:[e.jsx(St,{size:8})," ",a.completed.failed]})]}),r&&e.jsxs("button",{type:"button",onClick:c,title:"Stop run",className:"flex items-center gap-1 px-2 py-1 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 hover:bg-red-500/20 hover:text-red-300 transition-all text-[10px] font-semibold",children:[e.jsx($f,{size:9,className:"fill-current"})," Stop"]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-content-tertiary",children:[e.jsx(Cr,{size:10}),e.jsx("p",{className:"text-xs font-mono font-bold text-content-secondary",children:s})]}),!r&&e.jsxs("button",{type:"button",onClick:o,className:"text-[10px] font-medium text-accent hover:text-accent-dark flex items-center gap-1 ml-1",children:[e.jsx(_i,{size:10})," New Run"]})]})]})}function ew({onOpenExternal:s,onToggleFullscreen:r,fullscreen:a,browser:o}){return e.jsxs("div",{className:"flex-shrink-0 h-8 bg-slate-800 border-b border-slate-700 flex items-center justify-between px-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-red-500/80"}),e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-amber-500/80"}),e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-emerald-500/80"})]}),o?e.jsxs("div",{className:"flex items-center gap-1.5 ml-2",children:[e.jsx(ba,{browser:o,size:14}),e.jsx("span",{className:"text-[10px] font-semibold text-slate-300 uppercase tracking-wider",children:ix(o)})]}):e.jsx("span",{className:"text-[10px] font-semibold text-slate-400 uppercase tracking-wider ml-2",children:"Browser Preview"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[r&&e.jsx("button",{type:"button",onClick:r,title:a?"Exit fullscreen":"Fullscreen",className:"p-1 rounded text-slate-400 hover:text-white hover:bg-slate-700 transition-colors",children:a?e.jsx(Fv,{size:11}):e.jsx(Ju,{size:11})}),e.jsx("button",{type:"button",onClick:s,title:"Open in external browser",className:"p-1 rounded text-slate-400 hover:text-white hover:bg-slate-700 transition-colors",children:e.jsx(Na,{size:11})})]})]})}function tw({progress:s}){return e.jsxs("div",{className:"flex flex-col items-center gap-4 p-8 max-w-xs",children:[e.jsxs("div",{className:"w-48 h-32 rounded-xl bg-slate-800 border border-slate-700 overflow-hidden relative",children:[e.jsxs("div",{className:"h-5 bg-slate-750 border-b border-slate-700 flex items-center px-2 gap-1.5",children:[e.jsxs("div",{className:"flex gap-1",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-red-500/50"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-500/50"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500/50"})]}),e.jsx("div",{className:"flex-1 h-2.5 rounded bg-slate-700 ml-1"})]}),e.jsxs("div",{className:"p-2 space-y-1.5",children:[e.jsx("div",{className:"h-2 bg-slate-700 rounded w-3/4 animate-pulse"}),e.jsx("div",{className:"h-2 bg-slate-700 rounded w-1/2 animate-pulse",style:{animationDelay:"200ms"}}),e.jsx("div",{className:"h-2 bg-slate-700 rounded w-5/6 animate-pulse",style:{animationDelay:"400ms"}}),e.jsx("div",{className:"h-6 bg-accent/10 rounded mt-2 animate-pulse border border-accent/20",style:{animationDelay:"600ms"}})]}),e.jsx("div",{className:"absolute inset-x-0 h-0.5 bg-gradient-to-r from-transparent via-accent to-transparent opacity-60",style:{animation:"scan-line 2s ease-in-out infinite",top:"30%"}})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs font-semibold text-slate-300",children:s.currentCase?"Executing test...":"Launching browser..."}),s.currentCase&&e.jsx("p",{className:"text-[10px] text-slate-500 mt-1 truncate max-w-[200px]",children:s.currentCase.caseName})]}),e.jsx("div",{className:"flex items-center gap-1.5",children:[0,160,320].map(r=>e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-accent animate-bounce",style:{animationDelay:`${r}ms`}},r))}),e.jsx("style",{children:`
|
|
918
|
+
@keyframes scan-line {
|
|
919
|
+
0%, 100% { top: 20%; opacity: 0; }
|
|
920
|
+
50% { top: 80%; opacity: 0.6; }
|
|
921
|
+
}
|
|
922
|
+
`})]})}function sw({step:s}){return s?e.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse flex-shrink-0"}),e.jsx("p",{className:"text-[10px] text-white/80 truncate font-mono",children:s.instruction})]})}):null}function nw({onMouseDown:s}){return e.jsxs("div",{className:"flex-shrink-0 w-1.5 bg-slate-700 hover:bg-accent cursor-col-resize flex items-center justify-center transition-colors group relative",onMouseDown:s,children:[e.jsx("div",{className:"absolute inset-y-0 -left-1.5 -right-1.5"})," ",e.jsx(Dl,{size:10,className:"text-slate-500 group-hover:text-white"})]})}function Lp({tab:s,setTab:r,stepCount:a,logCount:o}){return e.jsxs("div",{className:"flex-shrink-0 h-8 bg-[#1e1f2e] border-b border-slate-700 flex items-center px-1",children:[e.jsxs("button",{type:"button",onClick:()=>r("steps"),className:O("flex items-center gap-1.5 px-3 h-full text-[10px] font-semibold uppercase tracking-wider border-b-2 transition-colors",s==="steps"?"text-accent border-accent":"text-slate-500 border-transparent hover:text-slate-300"),children:[e.jsx(Xt,{size:9})," Steps",a>0&&e.jsx("span",{className:"text-[8px] ml-0.5 opacity-60",children:a})]}),e.jsxs("button",{type:"button",onClick:()=>r("console"),className:O("flex items-center gap-1.5 px-3 h-full text-[10px] font-semibold uppercase tracking-wider border-b-2 transition-colors",s==="console"?"text-accent border-accent":"text-slate-500 border-transparent hover:text-slate-300"),children:[e.jsx(_l,{size:9})," Console",o>0&&e.jsx("span",{className:"text-[8px] ml-0.5 opacity-60",children:o})]})]})}function _p({tab:s,stepLogs:r,consoleLogs:a,endRef:o}){return s==="steps"?e.jsxs("div",{className:"flex-1 overflow-y-auto text-[10px] px-3 py-2 space-y-0.5",children:[r.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 text-slate-600",children:[e.jsx(Xt,{size:18}),e.jsx("p",{className:"text-[10px]",children:"Steps will appear as they execute..."})]}):r.map((c,u)=>e.jsxs("div",{className:"flex items-start gap-2 py-1 px-2 rounded hover:bg-white/[0.02] -mx-1",children:[e.jsx("div",{className:"flex-shrink-0 mt-0.5",children:c.status==="passed"?e.jsx(He,{size:11,className:"text-emerald-400"}):c.status==="failed"?e.jsx(St,{size:11,className:"text-red-400"}):e.jsx(Ll,{size:11,className:"text-slate-500"})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("p",{className:O("font-mono truncate",c.status==="passed"?"text-slate-300":c.status==="failed"?"text-red-300":"text-slate-500"),children:c.instruction})}),e.jsxs("span",{className:"text-slate-600 flex-shrink-0 tabular-nums",children:[c.duration,"ms"]})]},`${c.stepId}-${u}`)),e.jsx("div",{ref:o})]}):e.jsxs("div",{className:"flex-1 overflow-y-auto font-mono text-[10px] px-3 py-2 space-y-px",children:[a.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 text-slate-600",children:[e.jsx(_l,{size:18}),e.jsx("p",{className:"text-[10px]",children:"Console logs will appear here..."})]}):a.map((c,u)=>{const x=Ip[c.type]??Ip.default,h=Dp[c.type]??Dp.debug,f=new Date(c.timestamp).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});return e.jsxs("div",{className:"flex items-start gap-2 py-0.5 hover:bg-white/[0.02] rounded px-1 -mx-1",children:[e.jsx("span",{className:"text-slate-600 flex-shrink-0 tabular-nums",children:f}),e.jsx("span",{className:O("flex-shrink-0 uppercase text-[8px] font-bold w-9",h),children:c.type.slice(0,5)}),e.jsx("span",{className:O("break-all",x),children:c.text})]},u)}),e.jsx("div",{ref:o})]})}function Ml({label:s,color:r,className:a}){return e.jsx("span",{className:O("inline-flex items-center px-2 py-0.5 rounded-md text-[11px] font-semibold tracking-wide",r??"bg-surface-inset text-content-secondary",a),children:s})}function ox({status:s}){const r={passed:"bg-emerald-50 text-emerald-700 border border-emerald-200/60",failed:"bg-red-50 text-red-700 border border-red-200/60",running:"bg-blue-50 text-blue-700 border border-blue-200/60",pending:"bg-slate-50 text-slate-600 border border-slate-200/60",skipped:"bg-amber-50 text-amber-700 border border-amber-200/60",partial:"bg-orange-50 text-orange-700 border border-orange-200/60"};return e.jsx(Ml,{label:s,color:r[s]??"bg-slate-100 text-slate-600"})}function Vl({children:s,className:r,padding:a=!0}){return e.jsx("div",{className:O("bg-surface rounded-xl border border-border shadow-card transition-shadow duration-200",a&&"p-5",r),children:s})}const rw={blue:{bg:"bg-blue-50",border:"border-blue-200/60",value:"text-blue-600",icon:"text-blue-500",glow:"shadow-blue-100/50"},teal:{bg:"bg-teal-50",border:"border-teal-200/60",value:"text-teal-600",icon:"text-teal-500",glow:"shadow-teal-100/50"},green:{bg:"bg-green-50",border:"border-green-200/60",value:"text-green-600",icon:"text-green-500",glow:"shadow-green-100/50"},orange:{bg:"bg-orange-50",border:"border-orange-200/60",value:"text-orange-600",icon:"text-orange-500",glow:"shadow-orange-100/50"},rose:{bg:"bg-rose-50",border:"border-rose-200/60",value:"text-rose-500",icon:"text-rose-400",glow:"shadow-rose-100/50"},red:{bg:"bg-red-50",border:"border-red-200/60",value:"text-red-600",icon:"text-red-500",glow:"shadow-red-100/50"},purple:{bg:"bg-purple-50",border:"border-purple-200/60",value:"text-purple-600",icon:"text-purple-500",glow:"shadow-purple-100/50"}};function sl({label:s,value:r,sub:a,color:o,icon:c}){const u=o?rw[o]:null;return e.jsxs("div",{className:O("rounded-xl border px-4 py-3.5 flex items-center gap-3.5 transition-all duration-200",u?`${u.bg} ${u.border}`:"bg-surface border-border"),children:[c&&e.jsx("div",{className:O("flex items-center justify-center w-9 h-9 rounded-lg flex-shrink-0",u?`${u.bg} ${u.icon}`:"bg-surface-inset text-content-tertiary"),children:c}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-content-tertiary leading-none",children:s}),e.jsx("p",{className:O("font-bold mt-1.5 leading-none",typeof r=="string"&&r.length>3?"text-sm":"text-lg",u?u.value:"text-content"),children:r}),a&&e.jsx("p",{className:"text-[11px] text-content-tertiary mt-1",children:a})]})]})}function aw(s){switch(s){case"passed":return"bg-emerald-500";case"failed":return"bg-red-500";case"skipped":return"bg-slate-500";case"healed":return"bg-amber-500";default:return"bg-slate-400"}}function iw({steps:s,onSelect:r}){const a=s.filter(o=>o.screenshotPath);return a.length<2?null:e.jsx("div",{className:"flex gap-2 overflow-x-auto pb-1",style:{scrollbarWidth:"thin"},children:a.map((o,c)=>{const u=ka("screenshots",o.screenshotPath),x=o.healed?"healed":o.status;return e.jsxs("button",{type:"button",onClick:()=>r(u),className:"relative flex-shrink-0 rounded overflow-hidden border border-border hover:border-accent/50 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",style:{width:80,height:60},title:o.instruction,children:[e.jsx("img",{src:u,alt:`Step ${c+1}`,className:"w-full h-full object-cover"}),e.jsx("span",{className:"absolute top-0.5 left-0.5 bg-black/60 text-white text-[8px] font-bold px-1 py-px rounded leading-none",children:c+1}),e.jsx("span",{className:O("absolute bottom-1 right-1 w-2 h-2 rounded-full ring-1 ring-white/50",aw(x))})]},o.stepId)})})}function ow(s){if(s.healed)return"bg-amber-500";switch(s.status){case"passed":return"bg-emerald-500";case"failed":return"bg-red-500";case"skipped":return"bg-slate-500";default:return"bg-slate-400"}}function lw({steps:s}){const[r,a]=p.useState(null),o=s.reduce((u,x)=>u+(x.duration??0),0);if(o===0||s.length===0)return null;let c=0;return e.jsxs("div",{className:"px-3 py-2 border-t border-border bg-surface-inset/20",children:[e.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-wider mb-2",children:"Execution Timeline"}),e.jsx("div",{className:"relative h-5 bg-surface-inset rounded overflow-hidden",children:s.map((u,x)=>{const h=u.duration/o*100,f=c/o*100;return c+=u.duration,e.jsx("div",{className:O("absolute top-0 h-full transition-opacity hover:opacity-80 cursor-default",ow(u)),style:{left:`${f}%`,width:`${Math.max(h,.5)}%`},onMouseEnter:()=>a(`${u.instruction} — ${u.duration}ms`),onMouseLeave:()=>a(null)},u.stepId??x)})}),r&&e.jsx("p",{className:"text-[9px] text-content-secondary mt-1 truncate",children:r}),e.jsx("div",{className:"flex mt-1 relative",style:{height:14},children:(()=>{let u=0;return s.map((x,h)=>{const f=x.duration/o*100,g=u/o*100;u+=x.duration;const y=(x.instruction??"").slice(0,8);return e.jsx("div",{className:"absolute text-[8px] text-content-tertiary truncate overflow-hidden",style:{left:`${g}%`,width:`${Math.max(f,2)}%`,top:0},title:x.instruction,children:y},x.stepId??h)})})()})]})}function cw({stepId:s,currentScreenshotPath:r}){const{data:a,refetch:o}=Oe({queryKey:["baseline",s],queryFn:()=>vp.get(s),enabled:!!s}),c=oe({mutationFn:()=>{if(!r)throw new Error("No screenshot available");return vp.capture(s,r)},onSuccess:()=>{$.success("Baseline saved"),o()},onError:h=>$.error(h.message)}),u=r?ka("screenshots",r):null,x=a?.hasBaseline?`${dj(s)}?t=${a.capturedAt??Date.now()}`:null;return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Visual Regression"}),e.jsxs("div",{className:"flex items-center gap-2",children:[a?.hasBaseline&&e.jsx("span",{className:"text-[8px] px-1.5 py-0.5 rounded bg-emerald-50 text-emerald-600 ring-1 ring-emerald-200 font-semibold",children:"Baseline set"}),r&&e.jsxs("button",{type:"button",onClick:()=>c.mutate(),disabled:c.isPending,className:"inline-flex items-center gap-1 text-[9px] px-2 py-0.5 rounded bg-accent text-white hover:brightness-110 transition-colors disabled:opacity-50",children:[e.jsx(Un,{size:9})," Set as Baseline"]})]})]}),e.jsxs("div",{className:"flex gap-3",children:[u&&e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-[8px] text-content-tertiary mb-1",children:"Current"}),e.jsx("img",{src:u,alt:"Current screenshot",className:"rounded border border-border max-h-32 object-contain"})]}),x&&e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-[8px] text-content-tertiary mb-1",children:"Baseline"}),e.jsx("img",{src:x,alt:"Baseline screenshot",className:"rounded border border-border max-h-32 object-contain"})]}),!x&&u&&e.jsx("div",{className:"flex-1 flex items-center justify-center border border-dashed border-border rounded-lg min-h-[80px]",children:e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"No baseline set"})})]})]})}function lx(s,r){if(r==null)return"na";switch(s){case"fcp":return r<1800?"good":r<3e3?"needs-improvement":"poor";case"lcp":return r<2500?"good":r<4e3?"needs-improvement":"poor";case"cls":return r<.1?"good":r<.25?"needs-improvement":"poor";case"ttfb":return r<800?"good":r<1800?"needs-improvement":"poor";case"tbt":return r<200?"good":r<600?"needs-improvement":"poor";case"si":return r<3400?"good":r<5800?"needs-improvement":"poor";case"tti":return r<3800?"good":r<7300?"needs-improvement":"poor";case"inp":return r<200?"good":r<500?"needs-improvement":"poor"}}const dw={good:"bg-emerald-50 dark:bg-emerald-900/20 text-emerald-700 dark:text-emerald-400 ring-emerald-200 dark:ring-emerald-800","needs-improvement":"bg-amber-50 dark:bg-amber-900/20 text-amber-700 dark:text-amber-400 ring-amber-200 dark:ring-amber-800",poor:"bg-red-50 dark:bg-red-900/20 text-red-700 dark:text-red-400 ring-red-200 dark:ring-red-800",na:"bg-surface-inset text-content-tertiary ring-border"};function uw(s,r){return r==null?"—":s==="cls"?r.toFixed(3):r<1e3?`${Math.round(r)}ms`:`${(r/1e3).toFixed(2)}s`}function cx(s){return s==null?{ring:"ring-border",text:"text-content-tertiary",bg:"bg-surface-inset",label:"—"}:s>=90?{ring:"ring-emerald-300 dark:ring-emerald-700",text:"text-emerald-600 dark:text-emerald-400",bg:"bg-emerald-50 dark:bg-emerald-900/20",label:"Good"}:s>=50?{ring:"ring-amber-300 dark:ring-amber-700",text:"text-amber-600 dark:text-amber-400",bg:"bg-amber-50 dark:bg-amber-900/20",label:"Needs Work"}:{ring:"ring-red-300 dark:ring-red-700",text:"text-red-600 dark:text-red-400",bg:"bg-red-50 dark:bg-red-900/20",label:"Poor"}}const dx=[{key:"fcp",label:"FCP",desc:"First Contentful Paint"},{key:"lcp",label:"LCP",desc:"Largest Contentful Paint"},{key:"cls",label:"CLS",desc:"Cumulative Layout Shift"},{key:"ttfb",label:"TTFB",desc:"Time to First Byte"},{key:"tbt",label:"TBT",desc:"Total Blocking Time"},{key:"si",label:"SI",desc:"Speed Index"},{key:"tti",label:"TTI",desc:"Time to Interactive"},{key:"inp",label:"INP",desc:"Interaction to Next Paint"}];function Up({metricKey:s,value:r}){const a=lx(s,r),o=dx.find(c=>c.key===s);return e.jsxs("div",{className:O("rounded-lg px-2 py-2 ring-1 text-center flex-1 min-w-[70px]",dw[a]),children:[e.jsx("p",{className:"text-[8px] font-bold uppercase tracking-widest opacity-60 mb-0.5",children:o.label}),e.jsx("p",{className:"text-xs font-bold tabular-nums leading-tight",children:uw(s,r)})]})}function iu({score:s,label:r}){const a=cx(s),o=24,c=2*Math.PI*o,u=s!=null?s/100*c:0;return e.jsxs("div",{className:O("flex flex-col items-center justify-center rounded-xl px-3 py-2.5 ring-2 flex-1",a.bg,a.ring),children:[e.jsxs("div",{className:"relative w-14 h-14",children:[e.jsxs("svg",{className:"w-14 h-14 -rotate-90",viewBox:"0 0 60 60",children:[e.jsx("circle",{cx:"30",cy:"30",r:o,fill:"none",stroke:"currentColor",strokeWidth:"5",className:"opacity-10"}),e.jsx("circle",{cx:"30",cy:"30",r:o,fill:"none",stroke:"currentColor",strokeWidth:"5",strokeDasharray:c,strokeDashoffset:c-u,strokeLinecap:"round",className:a.text})]}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("span",{className:O("text-base font-black tabular-nums",a.text),children:s??"—"})})]}),e.jsx("p",{className:O("text-[8px] font-bold mt-1 leading-tight",a.text),children:a.label}),e.jsx("p",{className:"text-[8px] text-content-tertiary mt-px text-center leading-tight",children:r})]})}function $p({audits:s,label:r,score:a}){if(!s||s.length===0)return null;const o=s.filter(f=>!f.passed&&!f.partial&&!f.na),c=s.filter(f=>!!f.partial),u=s.filter(f=>f.passed),x=s.filter(f=>!!f.na),h=cx(a);return e.jsxs("div",{className:"mt-2 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsxs("p",{className:"text-[8px] font-bold text-content-tertiary uppercase tracking-widest flex-1",children:[r," Audits"]}),a!=null&&e.jsx("span",{className:O("text-[9px] font-black px-1.5 py-0.5 rounded-md ring-1",h.bg,h.text,h.ring),children:a})]}),e.jsxs("div",{className:"space-y-0.5 max-h-48 overflow-y-auto pr-1",children:[o.map(f=>e.jsxs("div",{className:"flex items-start gap-1.5 text-[9px] text-red-600 dark:text-red-400 font-medium",children:[e.jsx(St,{size:9,className:"text-red-500 flex-shrink-0 mt-px"}),e.jsx("span",{className:"leading-tight",children:f.title})]},f.id)),c.map(f=>e.jsxs("div",{className:"flex items-start gap-1.5 text-[9px] text-amber-600 dark:text-amber-400 font-medium",children:[e.jsx(gs,{size:9,className:"text-amber-500 flex-shrink-0 mt-px"}),e.jsx("span",{className:"leading-tight",children:f.title})]},f.id)),x.map(f=>e.jsxs("div",{className:"flex items-start gap-1.5 text-[9px] text-content-tertiary",children:[e.jsx(wv,{size:9,className:"text-content-tertiary flex-shrink-0 mt-px"}),e.jsx("span",{className:"leading-tight",children:f.title})]},f.id)),u.map(f=>e.jsxs("div",{className:"flex items-start gap-1.5 text-[9px] text-emerald-600 dark:text-emerald-400",children:[e.jsx(He,{size:9,className:"text-emerald-500 flex-shrink-0 mt-px"}),e.jsx("span",{className:"leading-tight",children:f.title})]},f.id))]})]})}function xw(s,r){let a=0,o=0,c=0;if(r==="performance")for(const u of s)for(const{key:x}of dx){const h=lx(x,u[x]);h==="good"?a++:h==="needs-improvement"?o++:h==="poor"&&c++}else{const u=r==="accessibility"?"a11yAudits":"seoAudits",x=r==="accessibility"?"a11yScore":"seoScore";for(const h of s){const f=h[u]??[];a+=f.filter(y=>y.passed).length,o+=f.filter(y=>!!y.partial).length,c+=f.filter(y=>!y.passed&&!y.partial&&!y.na).length;const g=cx(h[x]);g.label==="Good"?a++:g.label==="Needs Work"?o++:g.label==="Poor"&&c++}}return{good:a,warn:o,poor:c}}function mw({caseName:s,pageLoads:r,focus:a="performance",onClose:o}){const[c,u]=p.useState(a),x=xw(r,c),h=c==="performance"?"metrics":c==="accessibility"?"a11y checks":"seo checks",f=[{key:"performance",label:"Performance",icon:e.jsx(ct,{size:10}),color:"text-violet-600 dark:text-violet-400",activeColor:"bg-violet-50 dark:bg-violet-900/20 text-violet-700 dark:text-violet-300 ring-violet-200 dark:ring-violet-700"},{key:"accessibility",label:"Accessibility",icon:e.jsx(Nu,{size:10}),color:"text-blue-600 dark:text-blue-400",activeColor:"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 ring-blue-200 dark:ring-blue-700"},{key:"seo",label:"SEO",icon:e.jsx(Bn,{size:10}),color:"text-emerald-600 dark:text-emerald-400",activeColor:"bg-emerald-50 dark:bg-emerald-900/20 text-emerald-700 dark:text-emerald-300 ring-emerald-200 dark:ring-emerald-700"}];return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 bg-black/30 z-40",onClick:o}),e.jsxs("div",{className:"fixed right-0 top-0 h-full w-[560px] max-w-full bg-surface shadow-2xl z-50 flex flex-col border-l border-border",children:[e.jsxs("div",{className:"border-b border-border bg-gradient-to-r from-violet-50 to-indigo-50 dark:from-violet-900/20 dark:to-indigo-900/20 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3 px-5 py-3",children:[e.jsx("div",{className:O("w-7 h-7 rounded-lg flex items-center justify-center flex-shrink-0",c==="performance"?"bg-violet-500":c==="accessibility"?"bg-blue-500":"bg-emerald-500"),children:c==="performance"?e.jsx(ct,{size:13,className:"text-white"}):c==="accessibility"?e.jsx(Nu,{size:13,className:"text-white"}):e.jsx(Bn,{size:13,className:"text-white"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs font-bold text-content",children:"Lighthouse Audit"}),e.jsx("p",{className:"text-[10px] text-content-tertiary truncate",children:s})]}),e.jsx("button",{type:"button",onClick:o,className:"p-1.5 rounded-lg text-content-tertiary hover:text-content hover:bg-surface-inset transition-colors",children:e.jsx(_e,{size:14})})]}),e.jsx("div",{className:"flex gap-1 px-5 pb-0",children:f.map(g=>e.jsxs("button",{type:"button",onClick:()=>u(g.key),className:O("flex items-center gap-1.5 px-3 py-1.5 text-[10px] font-semibold rounded-t-lg border-b-2 transition-colors",c===g.key?"border-current "+g.color+" bg-surface/80":"border-transparent text-content-tertiary hover:text-content-secondary"),children:[g.icon," ",g.label]},g.key))})]}),x.good+x.warn+x.poor>0&&e.jsxs("div",{className:"px-5 py-2.5 border-b border-border bg-surface-inset/40 flex items-center gap-4 flex-shrink-0",children:[e.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest flex-shrink-0",children:["Overall ",e.jsxs("span",{className:"normal-case font-normal opacity-60",children:["(",h,")"]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[x.good>0&&e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-emerald-700 dark:text-emerald-400 font-semibold",children:[e.jsx("span",{className:"text-emerald-500 text-[11px] leading-none",children:"●"}),x.good," ",c==="performance"?"Good":"Passed"]}),x.warn>0&&e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-amber-700 dark:text-amber-400 font-semibold",children:[e.jsx("span",{className:"text-amber-400 text-[11px] leading-none",children:"●"}),x.warn," Needs Work"]}),x.poor>0&&e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-red-700 dark:text-red-400 font-semibold",children:[e.jsx("span",{className:"text-red-500 text-[11px] leading-none",children:"●"}),x.poor," ",c==="performance"?"Poor":"Failed"]})]}),e.jsxs("p",{className:"text-[9px] text-content-tertiary",children:[r.length," page",r.length!==1?"s":""]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-5",children:r.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-center",children:[e.jsx(ct,{size:24,className:"text-content-tertiary mb-2 opacity-40"}),e.jsx("p",{className:"text-xs text-content-tertiary",children:"No page navigations recorded"}),e.jsx("p",{className:"text-[10px] text-content-tertiary mt-1 opacity-60",children:"Only available for Chromium browser runs"})]}):r.map((g,y)=>e.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-sm overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-2.5 bg-surface-inset/50 border-b border-border",children:[e.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-0.5",children:["Step ",g.stepIndex+1]}),e.jsx("p",{className:"text-[10px] text-content-secondary truncate mb-1",title:g.stepInstruction,children:g.stepInstruction}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(xn,{size:9,className:"text-indigo-400 dark:text-indigo-500 flex-shrink-0"}),e.jsx("p",{className:"text-[10px] font-mono text-indigo-600 dark:text-indigo-400 truncate font-medium",title:g.url,children:g.url})]})]}),g.lighthouseError?e.jsxs("div",{className:"px-4 py-3 flex items-start gap-2",children:[e.jsx(gs,{size:12,className:"text-amber-500 flex-shrink-0 mt-0.5"}),e.jsx("p",{className:"text-[10px] text-amber-700 dark:text-amber-400",children:g.lighthouseError})]}):e.jsxs("div",{className:"px-4 py-3 space-y-3",children:[c==="performance"&&e.jsxs(e.Fragment,{children:[e.jsx(iu,{score:g.score,label:"Performance"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-[8px] font-bold text-content-tertiary uppercase tracking-widest",children:"Core Web Vitals"}),e.jsx("div",{className:"flex gap-1.5 flex-wrap",children:["fcp","lcp","cls","ttfb"].map(N=>e.jsx(Up,{metricKey:N,value:g[N]},N))}),e.jsx("div",{className:"flex gap-1.5 flex-wrap",children:["tbt","si","tti","inp"].map(N=>e.jsx(Up,{metricKey:N,value:g[N]},N))})]}),e.jsx("div",{className:"pt-1 border-t border-border/50 grid grid-cols-2 gap-x-4 gap-y-0.5",children:dx.map(({key:N,label:E,desc:S})=>{const P=lx(N,g[N]);return e.jsxs("div",{className:"flex items-center gap-1.5 text-[8px] text-content-tertiary",children:[e.jsx("span",{className:O("text-[10px] leading-none flex-shrink-0",P==="good"?"text-emerald-500":P==="needs-improvement"?"text-amber-400":P==="poor"?"text-red-500":"text-slate-300"),children:"●"}),e.jsx("span",{className:"font-medium",children:E}),e.jsx("span",{className:"opacity-60 truncate",children:S})]},N)})})]}),c==="accessibility"&&e.jsxs(e.Fragment,{children:[e.jsx(iu,{score:g.a11yScore,label:"Accessibility"}),(g.a11yAudits?.length??0)>0?e.jsx($p,{audits:g.a11yAudits,label:"Accessibility",score:g.a11yScore}):e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"No accessibility audit data available."})]}),c==="seo"&&e.jsxs(e.Fragment,{children:[e.jsx(iu,{score:g.seoScore,label:"SEO"}),(g.seoAudits?.length??0)>0?e.jsx($p,{audits:g.seoAudits,label:"SEO",score:g.seoScore}):e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"No SEO audit data available."})]})]})]},y))}),e.jsx("div",{className:"px-5 py-2.5 border-t border-border bg-surface-inset/30 flex-shrink-0",children:e.jsx("p",{className:"text-[9px] text-content-tertiary text-center",children:"Powered by Google Lighthouse · Desktop preset · Chromium only"})})]})]})}function hw({src:s,onClose:r}){return e.jsxs("div",{className:"fixed inset-0 bg-black/80 z-50 flex flex-col items-center justify-center p-4",onClick:r,children:[e.jsxs("div",{className:"absolute top-4 right-4 flex items-center gap-2",children:[e.jsx("a",{href:s,download:!0,onClick:a=>a.stopPropagation(),title:"Download",className:"text-white/70 hover:text-white p-2 rounded-lg bg-surface/10 hover:bg-surface/20",children:e.jsx(fa,{size:14})}),e.jsx("button",{type:"button",onClick:r,className:"text-white/70 hover:text-white p-2 rounded-lg bg-surface/10 hover:bg-surface/20",children:e.jsx(_e,{size:14})})]}),e.jsx("img",{src:s,alt:"Screenshot",className:"max-w-full max-h-full rounded-lg shadow-2xl object-contain",onClick:a=>a.stopPropagation()}),e.jsx("p",{className:"text-white/40 text-[10px] mt-2",children:"Click outside to close"})]})}function pw({step:s,onScreenshot:r}){const[a,o]=p.useState(s.status==="failed"),c=s.screenshotPath?ka("screenshots",s.screenshotPath):null,u=s.status==="passed"?e.jsx(He,{size:11,className:"text-emerald-500 flex-shrink-0"}):s.status==="failed"?e.jsx(St,{size:11,className:"text-red-500 flex-shrink-0"}):e.jsx(Ll,{size:11,className:"text-content-tertiary flex-shrink-0"});return e.jsxs("div",{className:"border-t border-border/50 first:border-0",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 cursor-pointer hover:bg-surface-inset/50 text-[10px] select-none transition-colors",onClick:()=>o(x=>!x),children:[u,e.jsx("span",{className:O("text-[8px] px-1 py-px rounded font-bold uppercase ring-1 flex-shrink-0",s.stepType==="api"?"bg-violet-50 text-violet-600 ring-violet-200":"bg-blue-50 text-blue-600 ring-blue-200"),children:s.stepType==="api"?"API":"UI"}),e.jsx("span",{className:O("flex-1 truncate text-[10px]",s.status==="failed"?"text-red-700 font-medium":"text-content-secondary"),children:s.instruction}),s.healed&&e.jsx("span",{className:"text-[8px] bg-amber-50 text-amber-600 px-1.5 py-0.5 rounded font-semibold ring-1 ring-amber-200 flex-shrink-0",children:"✦ healed"}),c&&e.jsx("button",{type:"button",title:"View screenshot",className:"text-content-tertiary hover:text-accent flex-shrink-0 p-0.5",onClick:x=>{x.stopPropagation(),r(c)},children:e.jsx(Un,{size:10})}),e.jsxs("span",{className:"text-content-tertiary w-10 text-right flex-shrink-0 tabular-nums text-[9px]",children:[s.duration,"ms"]}),a?e.jsx(Nv,{size:10,className:"text-content-tertiary flex-shrink-0"}):e.jsx(kt,{size:10,className:"text-content-tertiary flex-shrink-0"})]}),a&&e.jsxs("div",{className:"px-3 pb-2.5 pt-1 space-y-2 bg-surface-inset/30",children:[s.code&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:"Code"}),e.jsx("pre",{className:"text-[10px] font-mono bg-slate-900 text-slate-100 rounded-lg p-2.5 overflow-x-auto whitespace-pre-wrap leading-relaxed",children:s.code})]}),s.error&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-bold text-red-500 uppercase tracking-widest mb-1",children:"Error"}),e.jsx("pre",{className:"text-[10px] text-red-700 bg-red-50 border border-red-100 rounded-lg p-2.5 font-mono whitespace-pre-wrap leading-relaxed",children:s.error})]}),s.healed&&s.healedCode&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-bold text-amber-600 uppercase tracking-widest mb-1",children:"Healed Code"}),e.jsx("pre",{className:"text-[10px] font-mono bg-amber-50 border border-amber-200 text-amber-900 rounded-lg p-2.5 overflow-x-auto whitespace-pre-wrap leading-relaxed",children:s.healedCode})]}),s.apiRequest&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-bold text-violet-500 uppercase tracking-widest mb-1",children:"API Request"}),e.jsx("pre",{className:"text-[10px] font-mono bg-violet-50 border border-violet-100 text-violet-900 rounded-lg p-2.5 overflow-x-auto whitespace-pre-wrap leading-relaxed",children:`${s.apiRequest.method} ${s.apiRequest.url}${s.apiRequest.headers?`
|
|
923
|
+
Headers: `+JSON.stringify(s.apiRequest.headers,null,2):""}${s.apiRequest.body?`
|
|
924
|
+
Body: `+s.apiRequest.body:""}`})]}),s.apiResponse&&e.jsxs("div",{children:[e.jsxs("p",{className:"text-[9px] font-bold text-indigo-500 uppercase tracking-widest mb-1",children:["API Response — ",s.apiResponse.status," ",s.apiResponse.statusText," (",s.apiResponse.duration,"ms)"]}),e.jsx("pre",{className:"text-[10px] font-mono bg-indigo-50 border border-indigo-100 text-indigo-900 rounded-lg p-2.5 overflow-x-auto whitespace-pre-wrap leading-relaxed max-h-48 overflow-y-auto",children:s.apiResponse.body?s.apiResponse.body.slice(0,2e3):"(empty body)"})]}),c&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:"Screenshot"}),e.jsxs("div",{className:"relative group inline-block",children:[e.jsx("img",{src:c,alt:"Step screenshot",className:"rounded-lg border border-border max-w-full max-h-40 object-contain cursor-zoom-in hover:opacity-95 transition-opacity",onClick:()=>r(c)}),e.jsx("button",{type:"button",onClick:()=>r(c),title:"Fullscreen",className:"absolute top-1.5 right-1.5 bg-black/50 text-white p-1 rounded opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx(Ju,{size:10})})]}),e.jsx("div",{className:"mt-2",children:e.jsx(cw,{stepId:s.stepId,currentScreenshotPath:s.screenshotPath})})]})]})]})}function fw({videoPath:s}){const r=ka("videos",s);return e.jsxs("div",{className:"border-t border-border bg-black",children:[e.jsxs("div",{className:"px-3 pt-2 pb-1 flex items-center justify-between",children:[e.jsxs("p",{className:"text-[10px] font-medium text-content-tertiary flex items-center gap-1.5",children:[e.jsx($l,{size:10})," Recording"]}),e.jsxs("a",{href:r,download:!0,title:"Download video",className:"text-[10px] text-content-tertiary hover:text-accent flex items-center gap-1",children:[e.jsx(fa,{size:10})," Download"]})]}),e.jsx("video",{src:r,controls:!0,playsInline:!0,className:"w-full max-h-64 bg-black"})]})}function gw({tracePath:s}){const r=s.replace(/\\/g,"/").split("/").pop()??"",a=ka("traces",s),o=`/trace/index.html?trace=${encodeURIComponent(`${window.location.origin}${a}`)}`;return e.jsxs("div",{className:"border-t border-border px-3 py-2 flex items-center justify-between bg-violet-50/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Rf,{size:12,className:"text-violet-500 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold text-content-secondary",children:"Playwright Trace"}),e.jsx("p",{className:"text-[9px] text-content-tertiary font-mono truncate max-w-[200px]",children:r})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[e.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-[10px] bg-violet-600 hover:bg-violet-700 text-white px-2 py-1 rounded-lg font-semibold transition-colors",children:[e.jsx(Xt,{size:9})," Open Viewer"]}),e.jsxs("a",{href:a,download:!0,title:"Download .zip",className:"inline-flex items-center gap-0.5 text-[10px] text-content-secondary hover:text-content px-1.5 py-1 border border-border rounded-lg hover:border-border transition-colors",children:[e.jsx(fa,{size:9})," .zip"]})]})]})}function yw({tc:s,suiteType:r,onScreenshot:a}){const[o,c]=p.useState(s.status==="failed"),[u,x]=p.useState(!1),[h,f]=p.useState(null),g=s.steps.filter(S=>S.screenshotPath).length,y=s.steps.filter(S=>S.screenshotPath),E=(r==="audit"||r==="performance")&&(s.pageLoads??[]).some(S=>!S.lighthouseError&&(S.score!=null&&S.score<50||S.a11yScore!=null&&S.a11yScore<50||S.seoScore!=null&&S.seoScore<50));return e.jsxs("div",{className:O("border-t",E?"border-red-300 bg-red-50/30":"border-border/50"),children:[e.jsxs("div",{className:O("flex items-center gap-2 px-3 py-2 cursor-pointer select-none transition-colors",E?"hover:bg-red-50/50":"hover:bg-surface-inset/50"),onClick:()=>c(S=>!S),children:[o?e.jsx(kt,{size:11,className:"text-content-tertiary flex-shrink-0"}):e.jsx(Zt,{size:11,className:"text-content-tertiary flex-shrink-0"}),e.jsx(ox,{status:s.status}),e.jsx("span",{className:"text-xs text-content font-medium flex-1 truncate",children:s.caseName}),e.jsxs("div",{className:"flex items-center gap-1.5",onClick:S=>S.stopPropagation(),children:[e.jsxs("button",{type:"button",title:"Toggle execution timeline",onClick:()=>x(S=>!S),className:O("flex items-center gap-0.5 text-[8px] px-1.5 py-0.5 rounded ring-1 transition-colors",u?"bg-indigo-100 text-indigo-600 ring-indigo-200":"bg-surface-inset text-content-tertiary ring-border hover:text-content-secondary"),children:[e.jsx(Ts,{size:8})," timeline"]}),(s.pageLoads?.length??0)>0&&(()=>{const S=s.pageLoads,P=S.some(j=>j.score!=null||j.fcp!=null),M=S.some(j=>j.a11yScore!=null||(j.a11yAudits?.length??0)>0),k=S.some(j=>j.seoScore!=null||(j.seoAudits?.length??0)>0);return e.jsxs(e.Fragment,{children:[P&&e.jsxs("button",{type:"button",onClick:j=>{j.stopPropagation(),f("performance")},title:"Page Speed (Lighthouse)",className:"inline-flex items-center gap-1 text-[9px] px-2 py-0.5 rounded-lg bg-violet-50 text-violet-600 hover:bg-violet-100 ring-1 ring-violet-200 font-semibold transition-colors flex-shrink-0",children:[e.jsx(ct,{size:9})," Speed"]}),M&&e.jsxs("button",{type:"button",onClick:j=>{j.stopPropagation(),f("accessibility")},title:"Accessibility (Lighthouse)",className:"inline-flex items-center gap-1 text-[9px] px-2 py-0.5 rounded-lg bg-blue-50 text-blue-600 hover:bg-blue-100 ring-1 ring-blue-200 font-semibold transition-colors flex-shrink-0",children:[e.jsx(Nu,{size:9})," A11y"]}),k&&e.jsxs("button",{type:"button",onClick:j=>{j.stopPropagation(),f("seo")},title:"SEO (Lighthouse)",className:"inline-flex items-center gap-1 text-[9px] px-2 py-0.5 rounded-lg bg-emerald-50 text-emerald-600 hover:bg-emerald-100 ring-1 ring-emerald-200 font-semibold transition-colors flex-shrink-0",children:[e.jsx(Bn,{size:9})," SEO"]})]})})(),s.device&&(()=>{const S=Eg(s.device),P=S?.category==="mobile"?vi:S?.category==="tablet"?ul:gr,M=S?.name??s.device;return e.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] text-teal-600 bg-teal-50 px-1.5 py-0.5 rounded ring-1 ring-teal-200 max-w-[90px] truncate",title:M,children:[e.jsx(P,{size:8})," ",M]})})(),g>0&&e.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] text-content-secondary bg-surface-inset px-1.5 py-0.5 rounded ring-1 ring-border",children:[e.jsx(Un,{size:8})," ",g]}),s.videoPath&&e.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] text-blue-600 bg-blue-50 px-1.5 py-0.5 rounded ring-1 ring-blue-200",children:[e.jsx($l,{size:8})," video"]}),s.tracePath&&e.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] text-violet-600 bg-violet-50 px-1.5 py-0.5 rounded ring-1 ring-violet-200",children:[e.jsx(Rf,{size:8})," trace"]}),e.jsxs("span",{className:"text-[10px] text-content-tertiary tabular-nums",children:[(s.duration/1e3).toFixed(1),"s"]})]})]}),o&&e.jsxs("div",{className:"bg-surface",children:[y.length>=2&&e.jsxs("div",{className:"px-4 py-3 border-b border-border",children:[e.jsx("p",{className:"text-[10px] text-content-tertiary uppercase tracking-wider mb-2",children:"Screenshot Filmstrip"}),e.jsx(iw,{steps:s.steps,onSelect:a})]}),u&&e.jsx(lw,{steps:s.steps}),s.steps.map(S=>e.jsx(pw,{step:S,onScreenshot:a},S.stepId)),s.videoPath&&e.jsx(fw,{videoPath:s.videoPath}),s.tracePath&&e.jsx(gw,{tracePath:s.tracePath})]}),h&&e.jsx(mw,{caseName:s.caseName,pageLoads:s.pageLoads??[],focus:h,onClose:()=>f(null)})]})}function bw({runId:s}){const{data:r=[]}=Oe({queryKey:["report",s,"downloads"],queryFn:()=>ki.downloads(s)});return r.length===0?null:e.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-surface-inset/50 border-b border-border",children:[e.jsx(fa,{size:12,className:"text-accent"}),e.jsx("span",{className:"text-xs font-semibold text-content",children:"Downloads"}),e.jsxs("span",{className:"text-[10px] text-content-tertiary",children:["· ",r.length," file",r.length!==1?"s":""]})]}),e.jsx("div",{className:"divide-y divide-border",children:r.map(a=>e.jsxs("a",{href:ki.downloadUrl(s,a.name),download:!0,className:"flex items-center justify-between px-3 py-2 hover:bg-surface-inset/50 transition-colors",children:[e.jsx("span",{className:"text-[11px] text-content font-mono truncate",children:a.name}),e.jsxs("span",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-content-tertiary tabular-nums",children:[(a.size/1024).toFixed(1)," KB"]}),e.jsx(fa,{size:12,className:"text-content-tertiary"})]})]},a.name))})]})}function vw({runId:s}){const[r,a]=p.useState(null),{data:o,isLoading:c}=Oe({queryKey:["report",s],queryFn:()=>Nl.get(s)});return c?e.jsx("div",{className:"flex items-center justify-center py-6",children:e.jsx(Me,{size:14,className:"animate-spin text-accent"})}):o?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"px-3.5 pb-3 space-y-2",children:[e.jsx(bw,{runId:s}),o.suites.map(u=>e.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-surface-inset/50 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ox,{status:u.status}),e.jsx("span",{className:"text-xs font-semibold text-content",children:u.suiteName}),e.jsxs("span",{className:"text-[10px] text-content-tertiary",children:["· ",u.browser]})]}),e.jsxs("span",{className:"text-[10px] text-content-tertiary tabular-nums",children:[(u.duration/1e3).toFixed(1),"s"]})]}),u.cases.map(x=>e.jsx(yw,{tc:x,suiteType:u.suiteType,onScreenshot:a},x.caseId))]},u.suiteId))]}),r&&e.jsx(hw,{src:r,onClose:()=>a(null)})]}):null}const dn={listBaselines:()=>fetch("/api/visual-regression/baselines").then(s=>s.json()),deleteBaseline:s=>fetch("/api/visual-regression/baselines",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:s})}).then(r=>r.json()),updateBaseline:s=>fetch("/api/visual-regression/baselines/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).then(r=>r.json()),listDiffRuns:()=>fetch("/api/visual-regression/diffs").then(s=>s.json()),getDiffRun:s=>fetch(`/api/visual-regression/diffs/${s}`).then(r=>r.json()),updateDiffStatus:(s,r,a)=>fetch(`/api/visual-regression/diffs/${s}/${r}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:a})}).then(o=>o.json()),approveAll:s=>fetch(`/api/visual-regression/diffs/${s}/approve-all`,{method:"POST"}).then(r=>r.json())},jw={passed:"bg-emerald-50 text-emerald-700",failed:"bg-red-50 text-red-700",new:"bg-blue-50 text-blue-700",approved:"bg-green-50 text-green-700",rejected:"bg-orange-50 text-orange-700"};function hr(s){const r=s.replace(/\\/g,"/"),a=r.indexOf("baselines/"),o=r.indexOf("results/"),c=Math.min(a>=0?a:1/0,o>=0?o:1/0);return`/api/visual-regression/image/${c<1/0?r.slice(c):r}`}function Nw({diff:s,onClose:r}){const[a,o]=p.useState("side-by-side"),[c,u]=p.useState(50);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:r,children:e.jsxs("div",{className:"bg-surface rounded-xl border border-border shadow-2xl max-w-[90vw] max-h-[90vh] overflow-auto p-6",onClick:x=>x.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-semibold text-content",children:[s.caseName," — ",s.stepId]}),e.jsxs("p",{className:"text-xs text-content-tertiary",children:[s.browser," | ",s.viewport," | Diff: ",s.diffPercentage,"%"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[["side-by-side","slider"].map(x=>e.jsx("button",{onClick:()=>o(x),className:`px-2 py-1 text-xs rounded ${a===x?"bg-accent text-white":"bg-surface-inset text-content-secondary"}`,children:x==="side-by-side"?"Side by Side":"Slider"},x)),e.jsx("button",{onClick:r,className:"p-1 text-content-tertiary hover:text-content ml-2",children:e.jsx(_e,{size:18})})]})]}),a==="side-by-side"?e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-content-tertiary mb-1 text-center",children:"Baseline"}),e.jsx("img",{src:hr(s.baselinePath),alt:"Baseline",className:"rounded border border-border w-full"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-content-tertiary mb-1 text-center",children:"Actual"}),e.jsx("img",{src:hr(s.actualPath),alt:"Actual",className:"rounded border border-border w-full"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-content-tertiary mb-1 text-center",children:"Diff"}),s.status==="new"||s.diffPercentage===0?e.jsx("div",{className:"rounded border border-border w-full h-full min-h-[120px] flex items-center justify-center bg-emerald-50 text-emerald-400",children:e.jsxs("div",{className:"text-center",children:[e.jsx(He,{size:24,className:"mx-auto mb-1"}),e.jsx("p",{className:"text-xs font-medium",children:s.status==="new"?"New Baseline":"No Difference"})]})}):e.jsx("img",{src:hr(s.diffPath),alt:"Diff",className:"rounded border border-border w-full",onError:x=>{x.target.style.display="none"}})]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"relative overflow-hidden rounded border border-border",style:{maxWidth:800},children:[e.jsx("img",{src:hr(s.actualPath),alt:"Actual",className:"w-full block"}),e.jsx("div",{className:"absolute inset-0 overflow-hidden",style:{width:`${c}%`},children:e.jsx("img",{src:hr(s.baselinePath),alt:"Baseline",className:"block",style:{width:"800px",maxWidth:"none"}})}),e.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-accent cursor-col-resize",style:{left:`${c}%`}})]}),e.jsx("input",{type:"range",min:0,max:100,value:c,onChange:x=>u(Number(x.target.value)),className:"w-full mt-2 accent-accent"}),e.jsxs("div",{className:"flex justify-between text-[10px] text-content-tertiary",children:[e.jsx("span",{children:"Baseline"}),e.jsx("span",{children:"Actual"})]})]})]})})}function ww({diff:s,runId:r,onImageClick:a}){const o=Re(),c=oe({mutationFn:()=>dn.updateDiffStatus(r,s.stepId,"approved"),onSuccess:()=>{o.invalidateQueries({queryKey:["visual-diffs"]}),$.success("Approved")}}),u=oe({mutationFn:()=>dn.updateDiffStatus(r,s.stepId,"rejected"),onSuccess:()=>{o.invalidateQueries({queryKey:["visual-diffs"]}),$("Rejected")}}),x=oe({mutationFn:()=>dn.updateBaseline({actualPath:s.actualPath,baselinePath:s.baselinePath}),onSuccess:()=>{o.invalidateQueries({queryKey:["visual-baselines","visual-diffs"]}),$.success("Baseline updated")}});return e.jsxs(Vl,{padding:!1,className:"overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-border bg-surface-inset flex items-center gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-sm font-medium text-content truncate",children:[s.suiteName," / ",s.caseName]}),e.jsxs("p",{className:"text-xs text-content-tertiary mt-0.5",children:["Step: ",s.stepId," | ",s.browser," | ",s.viewport]})]}),e.jsx(Ml,{label:s.status,color:jw[s.status]}),e.jsx(Ml,{label:`${s.diffPercentage}%`,color:s.diffPercentage<=s.threshold?"bg-emerald-50 text-emerald-700":"bg-red-50 text-red-700"})]}),e.jsx("div",{className:"grid grid-cols-3 gap-2 p-3 cursor-pointer",onClick:()=>a(s),children:["Baseline","Actual","Diff"].map(h=>{const f=h==="Baseline"?s.baselinePath:h==="Actual"?s.actualPath:s.diffPath,g=h==="Diff"&&(s.status==="new"||s.diffPercentage===0);return e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-medium text-content-tertiary mb-1 text-center",children:h}),g?e.jsx("div",{className:"rounded border border-border w-full h-24 flex items-center justify-center bg-emerald-50 text-emerald-400",children:e.jsxs("div",{className:"text-center",children:[e.jsx(He,{size:14,className:"mx-auto mb-0.5"}),e.jsx("p",{className:"text-[9px] font-medium",children:s.status==="new"?"New Baseline":"No Diff"})]})}):e.jsx("img",{src:hr(f),alt:h,className:"rounded border border-border w-full h-24 object-cover object-top",onError:y=>{y.target.style.display="none"}})]},h)})}),e.jsxs("div",{className:"px-4 py-2 border-t border-border flex items-center gap-2 justify-end",children:[(s.status==="failed"||s.status==="new")&&e.jsxs(e.Fragment,{children:[e.jsxs(we,{size:"sm",variant:"ghost",loading:x.isPending,onClick:()=>x.mutate(),children:[e.jsx(Qu,{size:14})," Update Baseline"]}),e.jsxs(we,{size:"sm",variant:"ghost",loading:c.isPending,onClick:()=>c.mutate(),children:[e.jsx(et,{size:14})," Approve"]}),e.jsxs(we,{size:"sm",variant:"ghost",loading:u.isPending,onClick:()=>u.mutate(),children:[e.jsx(_e,{size:14})," Reject"]})]}),s.status==="approved"&&e.jsxs("span",{className:"text-xs text-green-600 flex items-center gap-1",children:[e.jsx(He,{size:14})," Approved"]}),s.status==="rejected"&&e.jsxs("span",{className:"text-xs text-red-600 flex items-center gap-1",children:[e.jsx(St,{size:14})," Rejected"]}),s.status==="passed"&&e.jsxs("span",{className:"text-xs text-emerald-600 flex items-center gap-1",children:[e.jsx(He,{size:14})," Passed"]})]})]})}function kw(){const s=Re(),[r,a]=p.useState(""),[o,c]=p.useState(null),{data:u=[],isLoading:x}=Oe({queryKey:["visual-diff-runs"],queryFn:dn.listDiffRuns}),h=r||(u.length>0?u[0].runId:""),{data:f,isLoading:g}=Oe({queryKey:["visual-diffs",h],queryFn:()=>dn.getDiffRun(h),enabled:!!h}),y=oe({mutationFn:()=>dn.approveAll(h),onSuccess:()=>{s.invalidateQueries({queryKey:["visual-diffs","visual-diff-runs"]}),$.success("All diffs approved")}});if(x)return e.jsxs("div",{className:"flex items-center justify-center py-16 text-content-tertiary",children:[e.jsx(Me,{className:"animate-spin mr-2",size:18})," Loading diff runs..."]});if(u.length===0)return e.jsxs("div",{className:"text-center py-12",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-purple-50 text-purple-400 mb-4",children:e.jsx(Ff,{size:28})}),e.jsx("h3",{className:"text-sm font-semibold text-content mb-1",children:"No Visual Diffs Yet"}),e.jsxs("p",{className:"text-xs text-content-tertiary max-w-md mx-auto leading-relaxed mb-4",children:["Visual diffs are generated when tests run with visual regression enabled. Enable it in ",e.jsx("strong",{children:"Settings"}),", toggle the ",e.jsx("strong",{children:"Eye icon"})," on steps you want to compare, then run your tests."]}),e.jsxs("div",{className:"inline-flex flex-col gap-2 text-left bg-surface-inset rounded-xl p-4 border border-border",children:[e.jsx("p",{className:"text-[11px] font-semibold text-content mb-1",children:"To generate diffs:"}),["Enable Visual Regression in Settings → Visual Regression section","Toggle the Eye icon on steps in Test Editor for per-step comparison","Run tests — first run creates baselines, subsequent runs generate diffs","Come back here to review, approve, or reject visual changes"].map((j,v)=>e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-[10px] font-bold bg-purple-100 text-purple-600 w-5 h-5 rounded flex items-center justify-center flex-shrink-0",children:v+1}),e.jsx("p",{className:"text-[11px] text-content-secondary",children:j})]},v))]})]});const N=f?.diffs??[],E=N.filter(j=>j.status==="passed").length,S=N.filter(j=>j.status==="failed").length,P=N.filter(j=>j.status==="new").length,M=N.filter(j=>j.status==="approved").length,k=N.filter(j=>j.status==="rejected").length;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4 flex-wrap",children:[e.jsx("select",{value:h,onChange:j=>a(j.target.value),className:"px-3 py-1.5 text-sm bg-surface border border-border rounded-lg focus:ring-2 focus:ring-accent/40 outline-none",children:u.map(j=>e.jsxs("option",{value:j.runId,children:[j.runId," (",new Date(j.timestamp).toLocaleString(),")"]},j.runId))}),e.jsxs("div",{className:"flex items-center gap-2 text-xs flex-wrap",children:[e.jsxs("span",{className:"text-emerald-600 font-semibold",children:[E," passed"]}),e.jsx("span",{className:"text-content-tertiary",children:"/"}),e.jsxs("span",{className:"text-red-600 font-semibold",children:[S," failed"]}),e.jsx("span",{className:"text-content-tertiary",children:"/"}),e.jsxs("span",{className:"text-blue-600 font-semibold",children:[P," new"]}),M>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-content-tertiary",children:"/"}),e.jsxs("span",{className:"text-green-600 font-semibold",children:[M," approved"]})]}),k>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-content-tertiary",children:"/"}),e.jsxs("span",{className:"text-orange-600 font-semibold",children:[k," rejected"]})]})]}),e.jsx("div",{className:"flex-1"}),(S>0||P>0)&&e.jsxs(we,{size:"sm",variant:"secondary",loading:y.isPending,onClick:()=>y.mutate(),children:[e.jsx(He,{size:14})," Approve All"]})]}),g?e.jsxs("div",{className:"flex items-center justify-center py-12 text-content-tertiary",children:[e.jsx(Me,{className:"animate-spin mr-2",size:18})," Loading diffs..."]}):N.length===0?e.jsx("div",{className:"text-center py-12 text-content-tertiary text-sm",children:"No diffs in this run."}):e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:N.map(j=>e.jsx(ww,{diff:j,runId:h,onImageClick:c},`${j.stepId}-${j.browser}-${j.viewport}`))}),o&&e.jsx(Nw,{diff:o,onClose:()=>c(null)})]})}function Sw(){const s=Re(),[r,a]=p.useState(new Set),{data:o=[],isLoading:c}=Oe({queryKey:["visual-baselines"],queryFn:dn.listBaselines}),u=oe({mutationFn:g=>dn.deleteBaseline(g),onSuccess:()=>{s.invalidateQueries({queryKey:["visual-baselines"]}),$.success("Baseline deleted")}}),x=oe({mutationFn:async()=>{for(const g of r)await dn.deleteBaseline(g)},onSuccess:()=>{a(new Set),s.invalidateQueries({queryKey:["visual-baselines"]}),$.success(`${r.size} baselines deleted`)}}),h=g=>a(y=>{const N=new Set(y);return N.has(g)?N.delete(g):N.add(g),N}),f=()=>a(r.size===o.length?new Set:new Set(o.map(g=>g.path)));return c?e.jsxs("div",{className:"flex items-center justify-center py-16 text-content-tertiary",children:[e.jsx(Me,{className:"animate-spin mr-2",size:18})," Loading baselines..."]}):o.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-purple-50 text-purple-400 mb-4",children:e.jsx(gr,{size:28})}),e.jsx("h3",{className:"text-sm font-semibold text-content mb-1",children:"No Baselines Yet"}),e.jsx("p",{className:"text-xs text-content-tertiary max-w-md mx-auto leading-relaxed mb-4",children:"Baselines are the “golden” reference screenshots. They are created automatically on the first test run with visual regression enabled."}),e.jsxs("div",{className:"inline-flex flex-col gap-2 text-left bg-surface-inset rounded-xl p-4 border border-border",children:[e.jsx("p",{className:"text-[11px] font-semibold text-content mb-1",children:"How baselines work:"}),[{icon:Un,text:"First run — screenshots become baselines automatically"},{icon:Ff,text:"Next runs — new screenshots are compared against baselines"},{icon:He,text:"Update — approve changes to replace old baselines"}].map(({icon:g,text:y})=>e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(g,{size:12,className:"text-purple-500 mt-0.5 flex-shrink-0"}),e.jsx("p",{className:"text-[11px] text-content-secondary",children:y})]},y))]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsxs("label",{className:"flex items-center gap-2 text-xs text-content-secondary cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:r.size===o.length&&o.length>0,onChange:f,className:"rounded border-border accent-accent"}),"Select all (",o.length,")"]}),r.size>0&&e.jsxs(we,{size:"sm",variant:"danger",loading:x.isPending,onClick:()=>x.mutate(),children:[e.jsx(es,{size:14})," Delete ",r.size," selected"]})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:o.map(g=>e.jsxs(Vl,{padding:!1,className:"overflow-hidden group",children:[e.jsxs("div",{className:"relative",children:[e.jsx("img",{src:hr(g.path),alt:g.fileName,className:"w-full h-32 object-cover object-top",onError:y=>{y.target.className="w-full h-32 bg-surface-inset"}}),e.jsx("input",{type:"checkbox",checked:r.has(g.path),onChange:()=>h(g.path),className:"absolute top-2 left-2 rounded border-border accent-accent"})]}),e.jsxs("div",{className:"px-3 py-2",children:[e.jsxs("p",{className:"text-xs font-medium text-content truncate",children:[g.suite," / ",g.caseName]}),e.jsx("p",{className:"text-[10px] text-content-tertiary truncate mt-0.5",children:g.fileName}),e.jsxs("p",{className:"text-[10px] text-content-tertiary",children:[(g.sizeBytes/1024).toFixed(1)," KB"]})]}),e.jsx("div",{className:"px-3 py-2 border-t border-border flex justify-end opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx("button",{onClick:()=>u.mutate(g.path),disabled:u.isPending,className:"p-1 text-content-tertiary hover:text-red-500 transition-colors",title:"Delete baseline",children:e.jsx(es,{size:14})})})]},g.path))})]})}function Cw(){const[s,r]=p.useState(""),[a,o]=p.useState("runs"),{modalProps:c,confirmDelete:u}=Gs(),x=Re(),{data:h=[],isLoading:f}=Oe({queryKey:["reports"],queryFn:()=>Nl.list(30)}),g=oe({mutationFn:Nl.delete,onSuccess:()=>{x.invalidateQueries({queryKey:["reports"]}),$.success("Report deleted")},onError:P=>$.error(P.message)}),y=h.reduce((P,M)=>P+M.passed,0),N=h.reduce((P,M)=>P+M.failed,0),E=h.reduce((P,M)=>P+M.skipped,0),S=[{key:"runs",label:"Run Reports",icon:Ts},{key:"visual-diffs",label:"Visual Diffs",icon:wa},{key:"baselines",label:"Baselines",icon:Qu}];return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:[e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-blue-500 to-indigo-600 flex items-center justify-center shadow-sm shadow-blue-500/20",children:e.jsx(Ts,{size:17,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-sm font-bold text-content",children:"Reports"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Run results · Visual regression · Baselines"})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:a==="runs"&&h.length>0&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1 bg-surface-inset text-content-tertiary ring-border",children:[h.length," ",e.jsx("span",{className:"opacity-60 font-normal",children:"runs"})]}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1 bg-emerald-50 text-emerald-600 ring-emerald-200",children:[y," ",e.jsx("span",{className:"opacity-60 font-normal",children:"passed"})]}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1 bg-red-50 text-red-600 ring-red-200",children:[N," ",e.jsx("span",{className:"opacity-60 font-normal",children:"failed"})]}),E>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1 bg-amber-50 text-amber-600 ring-amber-200",children:[E," ",e.jsx("span",{className:"opacity-60 font-normal",children:"skip"})]})]})})]}),e.jsx("div",{className:"flex items-center gap-0 border-t border-border px-4",children:S.map(({key:P,label:M,icon:k})=>e.jsxs("button",{onClick:()=>o(P),className:O("flex items-center gap-1.5 px-4 py-2 text-xs font-medium border-b-2 transition-colors",a===P?"border-accent text-accent":"border-transparent text-content-tertiary hover:text-content-secondary"),children:[e.jsx(k,{size:13})," ",M]},P))})]}),a==="visual-diffs"&&e.jsx(kw,{}),a==="baselines"&&e.jsx(Sw,{}),a==="runs"&&e.jsxs(e.Fragment,{children:[f&&e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(Me,{size:18,className:"animate-spin text-accent"})}),!f&&h.length===0&&e.jsxs("div",{className:"rounded-xl border border-dashed border-border bg-surface flex flex-col items-center justify-center py-14 gap-2.5",children:[e.jsx("div",{className:"w-11 h-11 rounded-xl bg-surface-inset flex items-center justify-center",children:e.jsx(Ts,{size:20,className:"text-content-tertiary"})}),e.jsx("p",{className:"text-xs font-medium text-content-secondary",children:"No runs yet"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Configure and start a run first. Enable screenshot, video, and trace in Settings."})]}),e.jsx("div",{className:"space-y-2",children:h.map(P=>{const M=s===P.runId;return e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden hover:border-accent/20 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 py-2.5 cursor-pointer hover:bg-surface-inset/30 select-none transition-colors",onClick:()=>r(k=>k===P.runId?"":P.runId),children:[M?e.jsx(kt,{size:12,className:"text-content-tertiary flex-shrink-0"}):e.jsx(Zt,{size:12,className:"text-content-tertiary flex-shrink-0"}),e.jsx(ox,{status:P.status}),P.environment&&e.jsx("span",{className:"text-[8px] px-1.5 py-0.5 rounded font-bold uppercase ring-1 bg-emerald-50 text-emerald-600 ring-emerald-200 flex-shrink-0",children:P.environment}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-[10px] font-mono text-content-secondary",children:[P.runId.slice(0,12),"…"]}),e.jsxs("p",{className:"text-[9px] text-content-tertiary flex items-center gap-1 mt-0.5",children:[e.jsx(Cr,{size:8}),TN(new Date(P.startedAt),"MMM d, HH:mm")," · ",Cl(new Date(P.startedAt),{addSuffix:!0})]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-[10px] flex-shrink-0",children:[e.jsxs("span",{className:"text-emerald-600 font-semibold tabular-nums",children:[P.passed,"✓"]}),e.jsxs("span",{className:"text-red-500 font-semibold tabular-nums",children:[P.failed,"✗"]}),P.skipped>0&&e.jsxs("span",{className:"text-content-tertiary tabular-nums",children:[P.skipped,"skip"]}),e.jsx("div",{className:"w-px h-3 bg-border"}),e.jsx("span",{className:"text-content-tertiary tabular-nums",children:P.duration!=null?(P.duration/1e3).toFixed(1)+"s":"—"})]}),e.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",onClick:k=>k.stopPropagation(),children:[P.logFilePath&&e.jsx("a",{href:ka("logs",P.logFilePath),target:"_blank",rel:"noopener noreferrer",title:"Run Log",className:"p-1 rounded-md text-emerald-500 hover:bg-emerald-50 transition-colors",children:e.jsx(Hs,{size:13})}),e.jsx("a",{href:`/allure/${P.runId}`,target:"_blank",rel:"noopener noreferrer",title:"Allure Report",className:"p-1 rounded-md text-blue-500 hover:bg-blue-50 transition-colors",children:e.jsx(Ts,{size:13})}),e.jsx("button",{type:"button",title:"Delete",onClick:()=>u("Delete this report? This cannot be undone.",()=>g.mutate(P.runId)),className:"p-1 rounded-md text-content-tertiary hover:text-red-500 hover:bg-red-50 transition-colors",children:e.jsx(es,{size:12})})]})]}),M&&e.jsx(vw,{runId:P.runId})]},P.runId)})},"runs")]})]})}),e.jsx(Ws,{...c})]})}function Ew(){const[s,r]=p.useState(""),[a,o]=p.useState(""),[c,u]=p.useState(!1),[x,h]=p.useState(new Set),[f,g]=p.useState(null),[y,N]=p.useState(""),[E,S]=p.useState(!1),{modalProps:P,confirmDelete:M}=Gs(),k=Re(),{data:j={},isLoading:v}=Oe({queryKey:["variables"],queryFn:()=>Ud.getAll()}),z=oe({mutationFn:({key:re,value:be,secret:Ne})=>Ud.set(re,Ne?{value:be,secret:!0}:be),onSuccess:()=>{k.invalidateQueries({queryKey:["variables"]}),r(""),o(""),u(!1),g(null),$.success("Variable saved")},onError:re=>$.error(re.message)}),C=oe({mutationFn:Ud.delete,onSuccess:()=>{k.invalidateQueries({queryKey:["variables"]}),$.success("Variable deleted")},onError:re=>$.error(re.message)}),w=j._system,F=Object.entries(j).filter(([re])=>re!=="_system").map(([re,be])=>typeof be=="string"?{key:re,value:be,secret:!1}:{key:re,value:be.value,secret:!0}),Q=F.filter(re=>re.secret).length,Z=F.filter(re=>w?.[re.key]?.readOnly).length,le=re=>{h(be=>{const Ne=new Set(be);return Ne.has(re)?Ne.delete(re):Ne.add(re),Ne})},K=()=>{if(s.trim()){if(s.trim()==="BASE_URL"){$.error("BASE_URL is managed in Settings → Environment");return}z.mutate({key:s.trim(),value:a,secret:c})}},J=re=>{g(re.key),N(re.value),S(re.secret)},ue=()=>{f&&z.mutate({key:f,value:y,secret:E})},ke=()=>{g(null),N(""),S(!1)};return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:[e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-teal-500 to-emerald-600 flex items-center justify-center shadow-sm shadow-teal-500/20",children:e.jsx(Ef,{size:17,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-sm font-bold text-content",children:"Variables"}),e.jsxs("p",{className:"text-[10px] text-content-tertiary",children:["Global variables available in all tests as ","{{VARIABLE_NAME}}"]})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1 bg-surface-inset text-content-tertiary ring-border",children:[F.length," ",e.jsx("span",{className:"opacity-60 font-normal",children:"total"})]}),Q>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1 bg-amber-50 text-amber-600 ring-amber-200",children:[e.jsx(Id,{size:7})," ",Q," ",e.jsx("span",{className:"opacity-60 font-normal",children:"secret"})]}),Z>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1 bg-blue-50 text-blue-600 ring-blue-200",children:[e.jsx(jl,{size:7})," ",Z," ",e.jsx("span",{className:"opacity-60 font-normal",children:"system"})]})]})]}),e.jsxs("div",{className:"px-4 py-2.5 bg-surface-inset/40 border-t border-border flex items-center gap-2",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"relative",children:[e.jsx(hp,{size:10,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-content-tertiary pointer-events-none"}),e.jsx("input",{className:"w-full text-xs font-mono uppercase tracking-wide border border-border rounded-lg pl-7 pr-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"VARIABLE_NAME",value:s,onChange:re=>r(re.target.value.toUpperCase().replace(/[^A-Z0-9_]/g,"_")),onKeyDown:re=>re.key==="Enter"&&K()})]})}),e.jsx("div",{className:"flex-[2] min-w-0",children:e.jsx("input",{type:c?"password":"text",className:"w-full text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"variable value",value:a,onChange:re=>o(re.target.value),onKeyDown:re=>re.key==="Enter"&&K()})}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsxs("label",{className:"flex items-center gap-1.5 text-[9px] text-content-tertiary cursor-pointer select-none",children:[e.jsx(Ii,{checked:c,onChange:u}),e.jsx(Id,{size:9})]}),e.jsxs(we,{size:"sm",onClick:K,loading:z.isPending&&!f,disabled:!s.trim(),children:[e.jsx(Ks,{size:10})," Add"]})]})]})]}),e.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:v?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(Me,{size:18,className:"animate-spin text-accent"})}):F.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-14 gap-2.5",children:[e.jsx("div",{className:"w-11 h-11 rounded-xl bg-surface-inset flex items-center justify-center",children:e.jsx(hp,{size:20,className:"text-content-tertiary"})}),e.jsx("p",{className:"text-xs font-medium text-content-secondary",children:"No variables yet"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Add your first variable using the toolbar above"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-[1fr_2fr_80px_80px] gap-2 px-3.5 py-2 bg-surface-inset/50 border-b border-border",children:[e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Key"}),e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Value"}),e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest text-center",children:"Type"}),e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest text-center",children:"Actions"})]}),e.jsx("div",{className:"max-h-[500px] overflow-y-auto divide-y divide-border/50",children:F.map(re=>{const be=w?.[re.key]?.readOnly===!0,Ne=w?.[re.key]?.environment?.toUpperCase(),ye=f===re.key;return e.jsxs("div",{className:O("grid grid-cols-[1fr_2fr_80px_80px] gap-2 px-3.5 py-2 items-center transition-colors",ye?"bg-accent/[0.02]":"hover:bg-surface-inset/40"),children:[e.jsx("span",{className:"text-[10px] font-mono text-accent font-medium truncate",children:`{{${re.key}}}`}),e.jsx("div",{className:"min-w-0",children:ye?e.jsx("input",{type:E?"password":"text",className:"w-full text-[10px] font-mono border border-accent/40 rounded-lg px-2 py-1 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface",value:y,onChange:_=>N(_.target.value),onKeyDown:_=>{_.key==="Enter"&&ue(),_.key==="Escape"&&ke()},autoFocus:!0}):e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-[10px] font-mono text-content-secondary truncate",children:re.secret&&!x.has(re.key)?"••••••••":re.value}),re.secret&&e.jsx("button",{type:"button",onClick:()=>le(re.key),className:"text-content-tertiary hover:text-content-secondary flex-shrink-0 p-0.5",children:x.has(re.key)?e.jsx(Pf,{size:9}):e.jsx(wa,{size:9})})]})}),e.jsx("div",{className:"text-center",children:be?e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[8px] bg-blue-50 text-blue-600 px-1.5 py-0.5 rounded ring-1 ring-blue-200 font-medium",children:[e.jsx(jl,{size:7})," ",Ne??"sys"]}):re.secret?e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[8px] bg-amber-50 text-amber-600 px-1.5 py-0.5 rounded ring-1 ring-amber-200 font-medium",children:[e.jsx(Id,{size:7})," secret"]}):e.jsx("span",{className:"text-[8px] text-content-tertiary",children:"plain"})}),e.jsx("div",{className:"flex items-center gap-0.5 justify-center",children:be?e.jsx("span",{className:"text-[8px] text-content-tertiary italic",children:"read-only"}):ye?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:ue,title:"Save",className:"p-1 rounded-md text-emerald-500 hover:bg-emerald-50 transition-colors",children:e.jsx(et,{size:11})}),e.jsx("button",{type:"button",onClick:ke,title:"Cancel",className:"p-1 rounded-md text-content-tertiary hover:bg-surface-inset transition-colors",children:e.jsx(_e,{size:11})})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>J(re),title:"Edit",className:"p-1 rounded-md text-content-tertiary hover:text-accent hover:bg-accent/5 transition-colors",children:e.jsx(Gn,{size:10})}),e.jsx("button",{type:"button",title:"Delete",onClick:()=>M(`Delete "${re.key}"?`,()=>C.mutate(re.key)),className:"p-1 rounded-md text-content-tertiary hover:text-red-500 hover:bg-red-50 transition-colors",children:e.jsx(es,{size:10})})]})})]},re.key)})})]})})]})}),e.jsx(Ws,{...P})]})}const Pw={1:"Smart Retry",2:"AI Regeneration",3:"Multi-Selector",4:"Visual/SoM",5:"Decompose",6:"Manual"};function Rw({event:s}){const r=Re(),{modalProps:a,confirmDelete:o}=Gs(),c=oe({mutationFn:()=>cn.accept(s.id),onSuccess:()=>{r.invalidateQueries({queryKey:["healing"]}),$.success("Healing accepted — test file updated")},onError:h=>$.error(h.message)}),u=oe({mutationFn:()=>cn.reject(s.id),onSuccess:()=>{r.invalidateQueries({queryKey:["healing"]}),$("Healing rejected")},onError:h=>$.error(h.message)}),x=oe({mutationFn:()=>cn.delete(s.id),onSuccess:()=>{r.invalidateQueries({queryKey:["healing"]}),$.success("Event deleted")},onError:h=>$.error(h.message)});return e.jsxs(e.Fragment,{children:[e.jsxs(Vl,{className:"overflow-hidden",padding:!1,children:[e.jsxs("div",{className:"px-4 py-3 border-b border-border bg-surface-inset flex items-center gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-content-secondary truncate",children:s.instruction}),e.jsxs("p",{className:"text-xs text-content-tertiary mt-0.5",children:["Case: ",s.caseId," · Level ",s.level,": ",Pw[s.level]??"Unknown"]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(Ml,{label:s.status,color:s.status==="pending"?"bg-yellow-100 text-yellow-700":s.status==="accepted"?"bg-green-100 text-green-700":"bg-slate-100 text-content-secondary"}),e.jsx("button",{type:"button",onClick:()=>o("Delete this healing event? This cannot be undone.",()=>x.mutate()),disabled:x.isPending,className:"p-1 text-content-tertiary hover:text-red-500 transition-colors",title:"Delete event",children:e.jsx(es,{size:13})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 divide-x divide-border-muted",children:[e.jsxs("div",{className:"p-3",children:[e.jsx("p",{className:"text-xs font-semibold text-red-500 mb-1",children:"Before (failed)"}),e.jsx("pre",{className:"text-xs font-mono text-content-secondary bg-red-50 rounded p-2 overflow-x-auto whitespace-pre-wrap break-all max-h-32",children:s.failedCode||"// (no code)"})]}),e.jsxs("div",{className:"p-3",children:[e.jsx("p",{className:"text-xs font-semibold text-green-600 mb-1",children:"After (healed)"}),e.jsx("pre",{className:"text-xs font-mono text-content-secondary bg-green-50 rounded p-2 overflow-x-auto whitespace-pre-wrap break-all max-h-32",children:s.healedCode})]})]}),s.status==="pending"&&e.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-t border-border bg-surface-inset",children:[e.jsxs(we,{size:"sm",onClick:()=>c.mutate(),loading:c.isPending,children:[e.jsx(et,{size:13})," Accept & Update File"]}),e.jsxs(we,{variant:"secondary",size:"sm",onClick:()=>u.mutate(),loading:u.isPending,children:[e.jsx(_e,{size:13})," Reject"]})]})]}),e.jsx(Ws,{...a})]})}function ou({title:s,events:r}){return e.jsxs("div",{className:"mb-8",children:[e.jsxs("h2",{className:"text-sm font-semibold text-content-secondary mb-3",children:[s," (",r.length,")"]}),e.jsx("div",{className:"space-y-3 max-h-[680px] overflow-y-auto pr-1",children:r.map(a=>e.jsx(Rw,{event:a},a.id))})]})}function Mw(){const s=Re(),{modalProps:r,confirmDelete:a}=Gs(),{data:o=[],isLoading:c}=Oe({queryKey:["healing","pending"],queryFn:()=>cn.pending()}),{data:u}=Oe({queryKey:["healing","stats"],queryFn:()=>cn.stats()}),{data:x=[]}=Oe({queryKey:["healing"],queryFn:()=>cn.list()}),h=oe({mutationFn:cn.acceptAll,onSuccess:P=>{s.invalidateQueries({queryKey:["healing"]}),$.success(`Accepted ${P.accepted} heal(s)`)},onError:P=>$.error(P.message)}),f=oe({mutationFn:cn.deleteAll,onSuccess:P=>{s.invalidateQueries({queryKey:["healing"]}),$.success(`Cleared ${P.deleted} event(s)`)},onError:P=>$.error(P.message)}),g=(P,M)=>P.createdAt<M.createdAt?1:-1,y=[...o].sort(g),N=[...x.filter(P=>P.status==="accepted")].sort(g),E=[...x.filter(P=>P.status==="rejected")].sort(g),S=()=>{a("Delete all healing events? This cannot be undone.",()=>f.mutate())};return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex-shrink-0 px-6 py-4 border-b border-border flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-xl font-bold text-content flex items-center gap-2",children:[e.jsx(bl,{size:20,className:"text-accent"})," Self-Healing"]}),e.jsx("p",{className:"text-sm text-content-tertiary mt-0.5",children:"Review AI-generated fixes for broken test steps"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[x.length>0&&e.jsxs(we,{variant:"secondary",onClick:S,loading:f.isPending,children:[e.jsx(Xv,{size:14})," Delete All"]}),o.length>0&&e.jsxs(we,{onClick:()=>h.mutate(),loading:h.isPending,children:[e.jsx(Sf,{size:15})," Accept All (",o.length,")"]})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[u&&e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsx(sl,{label:"Total Events",value:u.total,color:"blue"}),e.jsx(sl,{label:"Pending Review",value:u.pending,color:"orange"}),e.jsx(sl,{label:"Accepted",value:u.accepted,color:"green"}),e.jsx(sl,{label:"Rejected",value:u.rejected,color:"purple"})]}),c&&e.jsx("p",{className:"text-sm text-content-tertiary text-center py-12",children:"Loading…"}),y.length>0&&e.jsx(ou,{title:"Pending Review",events:y}),!c&&o.length===0&&e.jsxs(Vl,{className:"text-center py-12 mb-6",children:[e.jsx(bl,{size:32,className:"text-slate-200 mx-auto mb-3"}),e.jsx("p",{className:"text-content-secondary font-medium",children:"No pending heals"}),e.jsx("p",{className:"text-content-tertiary text-sm mt-1",children:"Self-healing events appear here when tests fail and AI generates a fix"})]}),N.length>0&&e.jsx(ou,{title:"Accepted",events:N}),E.length>0&&e.jsx(ou,{title:"Rejected",events:E})]}),e.jsx(Ws,{...r})]})}function is({label:s,hint:r,children:a}){return e.jsxs("div",{className:"flex items-start gap-4 py-2.5 border-b border-border/50 last:border-0",children:[e.jsxs("div",{className:"w-40 flex-shrink-0 pt-0.5",children:[e.jsx("p",{className:"text-[11px] font-semibold text-content-secondary",children:s}),r&&e.jsx("p",{className:"text-[10px] text-content-tertiary mt-0.5 leading-relaxed",children:r})]}),e.jsx("div",{className:"flex-1 min-w-0",children:a})]})}function wt({label:s,hint:r,checked:a,onChange:o}){return e.jsxs("div",{className:"flex items-start gap-3 py-2.5 border-b border-border/50 last:border-0",children:[e.jsx("div",{className:"pt-0.5 flex-shrink-0",children:e.jsx(Ii,{checked:a,onChange:o})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-semibold text-content-secondary",children:s}),r&&e.jsx("p",{className:"text-[10px] text-content-tertiary mt-0.5",children:r})]})]})}function Ps({icon:s,iconBg:r,title:a,desc:o,children:c}){return e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center gap-2.5",children:[e.jsx("div",{className:O("w-7 h-7 rounded-lg flex items-center justify-center flex-shrink-0 shadow-sm",r),children:e.jsx(s,{size:13,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-xs font-bold text-content",children:a}),o&&e.jsx("p",{className:"text-[9px] text-content-tertiary",children:o})]})]}),e.jsx("div",{className:"px-4 py-1",children:c})]})}function ln(s){return e.jsx("input",{...s,className:O("border border-border rounded-lg px-2.5 py-1.5 text-xs bg-surface text-content-secondary","focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/40",s.className)})}function Ni({value:s,onChange:r,options:a,className:o}){return e.jsx("select",{value:s,onChange:c=>r(c.target.value),className:O("border border-border rounded-lg px-2.5 py-1.5 text-xs bg-surface text-content-secondary","focus:outline-none focus:ring-2 focus:ring-accent/30",o),children:a.map(c=>e.jsx("option",{value:c.value,children:c.label},c.value))})}const lu=[{label:"Standard (1280×720)",width:1280,height:720},{label:"Laptop (1366×768)",width:1366,height:768},{label:"Full HD (1920×1080)",width:1920,height:1080},{label:"Mobile (390×844)",width:390,height:844},{label:"Tablet (768×1024)",width:768,height:1024},{label:"Custom",width:0,height:0}];function Tw({viewport:s,onChange:r}){const o=lu.find(u=>u.width===s.width&&u.height===s.height)?.label??"Custom",c=u=>{const x=lu.find(h=>h.label===u);x&&x.width!==0&&r({width:x.width,height:x.height})};return e.jsx(is,{label:"Viewport",hint:"Browser window size",children:e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(Ni,{className:"w-44",value:o,onChange:c,options:lu.map(u=>({value:u.label,label:u.label}))}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ln,{type:"number",className:"w-16",value:s.width,min:320,onChange:u=>r({...s,width:Number(u.target.value)})}),e.jsx("span",{className:"text-content-tertiary text-[10px]",children:"×"}),e.jsx(ln,{type:"number",className:"w-16",value:s.height,min:240,onChange:u=>r({...s,height:Number(u.target.value)})}),e.jsx("span",{className:"text-[9px] text-content-tertiary",children:"px"})]})]})})}const Bp={getConfig:()=>fetch("/api/visual-regression/config").then(s=>s.json()),saveConfig:s=>fetch("/api/visual-regression/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).then(r=>r.json())};function zw(){const s=Re(),{data:r,isLoading:a}=Oe({queryKey:["config"],queryFn:()=>Sr.get()}),[o,c]=p.useState({}),{data:u}=Oe({queryKey:["visual-config"],queryFn:Bp.getConfig}),[x,h]=p.useState(null),f=x??u??{enabled:!1,defaultThreshold:.5,fullPage:!1,maskSelectors:[]};p.useEffect(()=>{u&&!x&&h(null)},[u]);const g=v=>h({...f,...v}),y=oe({mutationFn:v=>Bp.saveConfig(v),onSuccess:()=>{s.invalidateQueries({queryKey:["visual-config"]}),h(null),$.success("Visual regression settings saved")},onError:v=>$.error(v.message)}),[N,E]=p.useState(!1),[S,P]=p.useState({name:"",environment:"stage",baseUrl:"",browsers:["chromium"]});p.useEffect(()=>{r&&c(r)},[r]);const M=oe({mutationFn:()=>Sr.update(o),onSuccess:()=>{s.invalidateQueries({queryKey:["config"]}),$.success("Settings saved")},onError:v=>$.error(v.message)}),k=(v,z)=>c(C=>({...C,[v]:z})),j=v=>{const z=o.browsers??[];k("browsers",z.includes(v)?z.length>1?z.filter(C=>C!==v):z:[...z,v])};return a||!o.healing||!o.reporting?e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(Me,{size:20,className:"animate-spin text-accent"})}):e.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[e.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-indigo-500 to-violet-600 flex items-center justify-center shadow-sm shadow-indigo-500/20",children:e.jsx(wr,{size:17,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-sm font-bold text-content",children:"Settings"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Configure AssureMind Studio"})]})]}),e.jsxs(we,{size:"sm",onClick:()=>M.mutate(),loading:M.isPending,children:[e.jsx(ga,{size:11})," Save Settings"]})]})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3 items-start",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs(Ps,{icon:Hv,iconBg:"bg-gradient-to-br from-indigo-500 to-violet-600 shadow-indigo-500/20",title:"Environment",desc:"Target environment & URLs",children:[e.jsx(is,{label:"Active Environment",hint:"Where tests run against",children:e.jsx("div",{className:"flex gap-1 flex-wrap",children:["dev","stage","test","prod"].map(v=>e.jsx("button",{type:"button",onClick:()=>{k("environment",v);const z=o.environmentUrls?.[v];z&&k("baseUrl",z)},className:O("px-2.5 py-1 rounded-lg text-[10px] font-semibold uppercase tracking-wide transition-all",o.environment===v?"bg-accent text-white shadow-sm shadow-accent/20":"text-content-tertiary hover:text-content-secondary bg-surface-inset ring-1 ring-border"),children:v},v))})}),e.jsx(is,{label:"Environment URLs",hint:"Base URL per environment",children:e.jsx("div",{className:"space-y-1.5",children:["dev","stage","test","prod"].map(v=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:O("w-11 text-[9px] font-bold uppercase text-center py-0.5 rounded",o.environment===v?"bg-accent/10 text-accent ring-1 ring-accent/20":"bg-surface-inset text-content-tertiary ring-1 ring-border"),children:v}),e.jsx(ln,{className:"flex-1",placeholder:`https://${v}.example.com`,value:o.environmentUrls?.[v]??"",onChange:z=>{const C={...o.environmentUrls??{dev:"",stage:"",test:"",prod:""},[v]:z.target.value};k("environmentUrls",C),o.environment===v&&k("baseUrl",z.target.value)}})]},v))})}),e.jsx(is,{label:"Base URL",hint:"Auto-resolved from active env",children:e.jsx(ln,{className:"w-full bg-surface-inset/50 text-content-tertiary cursor-not-allowed",placeholder:"http://localhost:3000",value:o.baseUrl??"",readOnly:!0,disabled:!0})})]}),e.jsxs(Ps,{icon:xn,iconBg:"bg-gradient-to-br from-blue-500 to-cyan-600 shadow-blue-500/20",title:"General",desc:"Browser & display settings",children:[e.jsx(is,{label:"Browsers",hint:"One or more browsers",children:e.jsx("div",{className:"flex gap-1.5 flex-wrap",children:Kf.map(v=>{const z=(o.browsers??[]).includes(v);return e.jsxs("button",{type:"button",onClick:()=>j(v),className:O("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[10px] font-semibold capitalize transition-all",z?"bg-accent/10 text-accent ring-1 ring-accent/30":"text-content-tertiary bg-surface-inset ring-1 ring-border hover:text-content-secondary"),children:[e.jsx(ba,{browser:v,size:14}),v]},v)})})}),e.jsx(wt,{label:"Headless mode",hint:"Run browsers without visible window",checked:o.headless??!0,onChange:v=>k("headless",v)}),e.jsx(Tw,{viewport:o.viewport??{width:1280,height:720},onChange:v=>k("viewport",v)})]}),e.jsxs(Ps,{icon:wr,iconBg:"bg-gradient-to-br from-slate-500 to-slate-700 shadow-slate-500/20",title:"Execution",desc:"Timeouts, retries & parallelism",children:[e.jsx(is,{label:"Timeouts & Workers",hint:"Per-test limits",children:e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] text-content-tertiary mb-0.5",children:"Timeout (ms)"}),e.jsx(ln,{type:"number",className:"w-24",value:o.timeout??3e4,onChange:v=>k("timeout",Number(v.target.value))})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] text-content-tertiary mb-0.5",children:"Retries"}),e.jsx(ln,{type:"number",min:0,max:5,className:"w-16",value:o.retries??1,onChange:v=>k("retries",Number(v.target.value))})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] text-content-tertiary mb-0.5",children:"Workers"}),e.jsx(ln,{type:"number",min:1,max:10,className:"w-16",value:o.parallel??2,onChange:v=>k("parallel",Number(v.target.value))})]})]})}),e.jsx(is,{label:"Page load strategy",hint:"Playwright wait after each step",children:e.jsx(Ni,{className:"w-full",value:o.pageLoad??"domcontentloaded",onChange:v=>k("pageLoad",v),options:[{value:"commit",label:"commit — first network response"},{value:"domcontentloaded",label:"domcontentloaded — DOM ready"},{value:"load",label:"load — full page load event"},{value:"networkidle",label:"networkidle — no network 500ms"}]})})]}),e.jsxs(Ps,{icon:Un,iconBg:"bg-gradient-to-br from-pink-500 to-rose-600 shadow-pink-500/20",title:"Capture",desc:"Screenshots, video & traces",children:[e.jsx(is,{label:"Screenshot",hint:"When to capture screenshots",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Un,{size:11,className:"text-pink-400 flex-shrink-0"}),e.jsx(Ni,{className:"w-40",value:o.screenshot??"only-on-failure",onChange:v=>k("screenshot",v),options:[{value:"off",label:"Off"},{value:"on",label:"Every test"},{value:"only-on-failure",label:"On failure only"}]})]})}),e.jsx(is,{label:"Video",hint:"When to record video",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx($l,{size:11,className:"text-violet-400 flex-shrink-0"}),e.jsx(Ni,{className:"w-40",value:o.video??"off",onChange:v=>k("video",v),options:[{value:"off",label:"Off"},{value:"on",label:"Every test"},{value:"on-first-retry",label:"On first retry"},{value:"retain-on-failure",label:"On failure only"}]})]})}),e.jsx(is,{label:"Trace",hint:"Playwright trace for debugging",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Uf,{size:11,className:"text-emerald-400 flex-shrink-0"}),e.jsx(Ni,{className:"w-40",value:o.trace??"on-first-retry",onChange:v=>k("trace",v),options:[{value:"off",label:"Off"},{value:"on",label:"Every test"},{value:"on-first-retry",label:"On first retry"},{value:"retain-on-failure",label:"On failure only"}]})]})})]}),e.jsxs(Ps,{icon:Ts,iconBg:"bg-gradient-to-br from-indigo-500 to-blue-600 shadow-indigo-500/20",title:"Reporting",desc:"Output format & destinations",children:[e.jsx(wt,{label:"Allure report",hint:"Interactive HTML report with history & trends",checked:o.reporting?.allure??!0,onChange:v=>k("reporting",{...o.reporting,allure:v})}),e.jsx(wt,{label:"HTML report",hint:"Standalone summary saved to results/",checked:o.reporting?.html??!0,onChange:v=>k("reporting",{...o.reporting,html:v})}),e.jsx(wt,{label:"JSON report",hint:"Machine-readable run data",checked:o.reporting?.json??!0,onChange:v=>k("reporting",{...o.reporting,json:v})})]}),e.jsx(Ps,{icon:$n,iconBg:"bg-gradient-to-br from-slate-500 to-gray-700 shadow-slate-500/20",title:"CI/CD Integration",desc:"Pipeline file generation",children:e.jsx(wt,{label:"Write CI files to repo",hint:"Adds a 'Write to repo' button in the CI Config Generator that writes the workflow file (.github/workflows/, .gitlab-ci.yml, Jenkinsfile) into your project. Review & commit via Git Control. Off = copy/download only.",checked:o.ci?.writeToRepo??!1,onChange:v=>k("ci",{...o.ci,writeToRepo:v})})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs(Ps,{icon:Xu,iconBg:"bg-gradient-to-br from-amber-500 to-orange-600 shadow-amber-500/20",title:"Self-Healing",desc:"AI-powered selector recovery",children:[e.jsx(wt,{label:"Enable self-healing",hint:"Auto-fix broken selectors during runs",checked:o.healing?.enabled??!0,onChange:v=>k("healing",{...o.healing,enabled:v})}),e.jsx(is,{label:"Max healing level",hint:"1 = retry only · 2 = AI regen · 3 = multi-selector · 4 = visual · 5 = decompose",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ln,{type:"number",min:1,max:5,className:"w-16",value:Math.min(o.healing?.maxLevel??5,5),onChange:v=>k("healing",{...o.healing,maxLevel:Number(v.target.value)})}),e.jsx("div",{className:"flex gap-0.5",children:[1,2,3,4,5].map(v=>e.jsx("div",{className:O("w-4 h-1.5 rounded-full transition-colors",v<=Math.min(o.healing?.maxLevel??5,5)?"bg-amber-400":"bg-surface-inset")},v))})]})}),e.jsx(wt,{label:"Auto-PR on CI heal",hint:"GitHub PR when selector healed in CI",checked:o.healing?.autoPR??!1,onChange:v=>k("healing",{...o.healing,autoPR:v})}),e.jsx(wt,{label:"Heal locators inside assertions",hint:"When a locator inside expect(...) can't be found (e.g. wrong iframe), re-resolve just the locator and keep the assertion. A genuine state/value mismatch is never healed. Off by default.",checked:o.healing?.healAssertionLocators??!1,onChange:v=>k("healing",{...o.healing,healAssertionLocators:v})})]}),e.jsxs(Ps,{icon:Bt,iconBg:"bg-gradient-to-br from-purple-500 to-fuchsia-600 shadow-purple-500/20",title:"MCP Integration",desc:"AI-sighted code generation via Playwright MCP",children:[e.jsx(wt,{label:"Enable MCP",hint:"ON by default — AI sees real page elements during generation. Test execution is unaffected.",checked:o.mcp?.enabled??!0,onChange:v=>k("mcp",{...o.mcp,enabled:v})}),e.jsx(wt,{label:"Headless mode",hint:"Run MCP browser without visible window",checked:o.mcp?.headless??!0,onChange:v=>k("mcp",{...o.mcp,headless:v})}),e.jsx(wt,{label:"Act-then-script",hint:"Execute action via MCP first, then convert to script",checked:o.mcp?.actThenScript??!1,onChange:v=>k("mcp",{...o.mcp,actThenScript:v})}),e.jsx(wt,{label:"Proactive healing",hint:"Validate selectors against live page before test run",checked:o.mcp?.proactiveHealing??!1,onChange:v=>k("mcp",{...o.mcp,proactiveHealing:v})})]}),e.jsxs(Ps,{icon:fv,iconBg:"bg-gradient-to-br from-emerald-500 to-teal-600 shadow-emerald-500/20",title:"RAG Memory",desc:"Semantic memory from past runs — AI learns from every generation & healing",children:[e.jsx(wt,{label:"Enable RAG",hint:"AI retrieves similar past steps & fixes to improve accuracy",checked:o.rag?.enabled??!0,onChange:v=>k("rag",{...o.rag,enabled:v})}),e.jsx(wt,{label:"Code Corpus",hint:"Remember instruction-to-code mappings from successful runs",checked:o.rag?.codeCorpus?.enabled??!0,onChange:v=>k("rag",{...o.rag,codeCorpus:{...o.rag.codeCorpus,enabled:v}})}),e.jsx(wt,{label:"Healing Corpus",hint:"Remember past healing fixes for smarter self-repair",checked:o.rag?.healingCorpus?.enabled??!0,onChange:v=>k("rag",{...o.rag,healingCorpus:{...o.rag.healingCorpus,enabled:v}})}),e.jsx(wt,{label:"Error Catalog",hint:"Track recurring error patterns to avoid known-bad selectors",checked:o.rag?.errorCatalog?.enabled??!0,onChange:v=>k("rag",{...o.rag,errorCatalog:{...o.rag.errorCatalog,enabled:v}})})]}),e.jsxs(Ps,{icon:wa,iconBg:"bg-gradient-to-br from-purple-500 to-indigo-600 shadow-purple-500/20",title:"Visual Regression",desc:"Pixel-diff screenshot comparison",children:[e.jsx(wt,{label:"Enable visual regression",hint:"Compare step screenshots against approved baselines",checked:f.enabled,onChange:v=>g({enabled:v})}),e.jsx(wt,{label:"Full page screenshots",hint:"Capture the entire scrollable page, not just the viewport",checked:f.fullPage,onChange:v=>g({fullPage:v})}),e.jsx(is,{label:"Threshold (%)",hint:"Max pixel diff before flagging. Default 0.5%",children:e.jsx(ln,{type:"number",min:.1,max:10,step:.1,className:"w-24",value:f.defaultThreshold,onChange:v=>g({defaultThreshold:parseFloat(v.target.value)||.5})})}),e.jsx(is,{label:"Mask selectors",hint:"CSS selectors for dynamic content to ignore (one per line)",children:e.jsx("textarea",{rows:3,value:f.maskSelectors.join(`
|
|
925
|
+
`),onChange:v=>g({maskSelectors:v.target.value.split(`
|
|
926
|
+
`).filter(z=>z.trim())}),placeholder:`.dynamic-content
|
|
927
|
+
[data-testid='timestamp']`,className:"w-full px-2.5 py-1.5 text-xs bg-surface border border-border rounded-lg focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/40 font-mono resize-none"})}),x&&e.jsx("div",{className:"flex justify-end pt-2 pb-1",children:e.jsxs(we,{size:"sm",loading:y.isPending,onClick:()=>y.mutate(f),children:[e.jsx(ga,{size:11})," Save VR Settings"]})})]}),e.jsx(Ps,{icon:xn,iconBg:"bg-gradient-to-br from-teal-500 to-cyan-600 shadow-teal-500/20",title:"Environment Profiles",desc:"Quick-switch presets for different environments",children:e.jsxs("div",{id:"profiles",className:"space-y-2",children:[(o.profiles??[]).length===0&&e.jsx("p",{className:"text-[10px] text-content-tertiary py-2",children:"No profiles defined. Add one below."}),(o.profiles??[]).map((v,z)=>e.jsxs("div",{className:"flex items-center gap-2 py-1.5 border-b border-border/40 last:border-0",children:[e.jsx("span",{className:"text-xs font-medium text-content w-24 truncate",children:v.name}),e.jsx("span",{className:"text-[10px] text-content-tertiary w-14",children:v.environment}),e.jsx("span",{className:"text-[10px] text-content-tertiary flex-1 truncate",children:v.baseUrl}),e.jsx("button",{type:"button",onClick:()=>{const C=(o.profiles??[]).filter((w,F)=>F!==z);k("profiles",C)},className:"p-1 rounded text-content-tertiary hover:text-red-500 hover:bg-red-50 transition-colors flex-shrink-0",children:e.jsx(es,{size:11})})]},z)),N?e.jsxs("div",{className:"mt-2 p-3 rounded-lg border border-border bg-surface-alt space-y-2",children:[e.jsx("p",{className:"text-[10px] font-semibold text-content-secondary",children:"New Profile"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] text-content-tertiary uppercase tracking-wide",children:"Name"}),e.jsx("input",{type:"text",value:S.name,onChange:v=>P(z=>({...z,name:v.target.value})),placeholder:"e.g. Staging",className:"w-full mt-0.5 px-2 py-1 text-[11px] rounded border border-border bg-surface focus:outline-none focus:ring-1 focus:ring-accent"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] text-content-tertiary uppercase tracking-wide",children:"Environment"}),e.jsxs("select",{value:S.environment,onChange:v=>P(z=>({...z,environment:v.target.value})),className:"w-full mt-0.5 px-2 py-1 text-[11px] rounded border border-border bg-surface focus:outline-none focus:ring-1 focus:ring-accent",children:[e.jsx("option",{value:"dev",children:"dev"}),e.jsx("option",{value:"stage",children:"stage"}),e.jsx("option",{value:"test",children:"test"}),e.jsx("option",{value:"prod",children:"prod"})]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] text-content-tertiary uppercase tracking-wide",children:"Base URL"}),e.jsx("input",{type:"url",value:S.baseUrl,onChange:v=>P(z=>({...z,baseUrl:v.target.value})),placeholder:"https://your-app.com",className:"w-full mt-0.5 px-2 py-1 text-[11px] rounded border border-border bg-surface focus:outline-none focus:ring-1 focus:ring-accent"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] text-content-tertiary uppercase tracking-wide",children:"Browsers"}),e.jsx("div",{className:"flex gap-3 mt-1",children:["chromium","firefox","webkit"].map(v=>e.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] text-content-secondary cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:S.browsers.includes(v),onChange:z=>P(C=>({...C,browsers:z.target.checked?[...C.browsers,v]:C.browsers.filter(w=>w!==v)})),className:"rounded"}),e.jsx(ba,{browser:v,size:12}),v]},v))})]}),e.jsxs("div",{className:"flex gap-2 pt-1",children:[e.jsx("button",{type:"button",onClick:()=>{if(!S.name.trim()){$.error("Profile name is required");return}if(!S.baseUrl.startsWith("http")){$.error("Base URL must start with http:// or https://");return}if(S.browsers.length===0){$.error("Select at least one browser");return}k("profiles",[...o.profiles??[],{name:S.name.trim(),environment:S.environment,baseUrl:S.baseUrl,browsers:S.browsers}]),P({name:"",environment:"stage",baseUrl:"",browsers:["chromium"]}),E(!1)},className:"px-2.5 py-1 text-[10px] font-medium rounded bg-accent text-white hover:bg-accent-dark transition-colors",children:"Add"}),e.jsx("button",{type:"button",onClick:()=>{E(!1),P({name:"",environment:"stage",baseUrl:"",browsers:["chromium"]})},className:"px-2.5 py-1 text-[10px] rounded border border-border text-content-secondary hover:bg-surface-alt transition-colors",children:"Cancel"})]})]}):e.jsxs("button",{type:"button",onClick:()=>E(!0),className:"inline-flex items-center gap-1 text-[10px] text-accent hover:text-accent-dark py-1 transition-colors",children:[e.jsx(Ks,{size:11})," Add Profile"]})]})})]})]})]})})})}function Aw(){const s=Re(),{data:r,isLoading:a}=Oe({queryKey:["env"],queryFn:wl.get}),[o,c]=p.useState({}),[u,x]=p.useState({}),[h,f]=p.useState({}),[g,y]=p.useState({});p.useEffect(()=>{if(!r)return;const j={...r.values};for(const z of r.groups)for(const C of z.fields)C.default&&!j[C.key]&&!C.provider&&(j[C.key]=C.default);const v=j.AI_PROVIDER??"";for(const z of r.groups)for(const C of z.fields)C.default&&!j[C.key]&&C.provider===v&&(j[C.key]=C.default);c(j)},[r]);const N=oe({mutationFn:()=>{const j={};for(const[v,z]of Object.entries(o))z!==(r?.values[v]??"")&&(j[v]=z);return wl.update(j)},onSuccess:j=>{$.success(j.updated>0?`Saved ${j.updated} setting${j.updated===1?"":"s"} to .env`:"No changes to save"),s.invalidateQueries({queryKey:["env"]}),s.invalidateQueries({queryKey:["config-status"]}),s.invalidateQueries({queryKey:["ai-provider"]})},onError:j=>$.error(j.message)});if(a||!r)return e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(Me,{className:"animate-spin text-accent"})});const E=(j,v)=>c(z=>{const C={...z,[j]:v};if(j==="AI_PROVIDER"){for(const w of r.groups)if(w.provider===v)for(const F of w.fields)F.default&&!C[F.key]&&(C[F.key]=F.default)}return C}),S=o.AI_PROVIDER??"",P=r.groups.filter(j=>!j.provider||j.provider===S),M=j=>{const v=o[j.key]??"",z=j.type==="secret",C=r.secretSet[j.key];if(j.type==="boolean")return e.jsxs("div",{className:"flex items-center justify-between py-2.5 border-b border-border/50 last:border-0",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-semibold text-content-secondary",children:j.label}),j.hint&&e.jsx("p",{className:"text-[10px] text-content-tertiary mt-0.5",children:j.hint})]}),e.jsx(Ii,{checked:v==="true",onChange:F=>E(j.key,F?"true":"false")})]},j.key);const w=j.recommended;if(w&&w.length>0&&(j.type==="text"||j.type==="number")){const F=h[j.key]??(v!==""&&!w.includes(v));return e.jsxs("div",{className:"py-2.5 border-b border-border/50 last:border-0",children:[e.jsx("label",{className:"text-[11px] font-semibold text-content-secondary block mb-1",children:j.label}),e.jsxs("select",{value:F?"__custom__":v,onChange:Q=>{Q.target.value==="__custom__"?f(Z=>({...Z,[j.key]:!0})):(f(Z=>({...Z,[j.key]:!1})),E(j.key,Q.target.value))},className:"w-full border border-border rounded-lg px-2.5 py-1.5 text-xs bg-surface text-content-secondary focus:outline-none focus:ring-2 focus:ring-accent/30",children:[e.jsx("option",{value:"",children:"— select recommended —"}),w.map(Q=>e.jsx("option",{value:Q,children:Q},Q)),e.jsx("option",{value:"__custom__",children:"Other (custom)…"})]}),F&&e.jsx("input",{type:"text",value:v,placeholder:j.placeholder??"Enter a custom value",onChange:Q=>E(j.key,Q.target.value),className:"w-full mt-2 border border-border rounded-lg px-2.5 py-1.5 text-xs bg-surface text-content-secondary focus:outline-none focus:ring-2 focus:ring-accent/30"}),j.hint&&e.jsx("p",{className:"text-[10px] text-content-tertiary mt-1",children:j.hint})]},j.key)}return e.jsxs("div",{className:"py-2.5 border-b border-border/50 last:border-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("label",{className:"text-[11px] font-semibold text-content-secondary",children:j.label}),z&&C&&!v&&e.jsx("span",{className:"text-[9px] text-emerald-500 font-medium",children:"● set — leave blank to keep"})]}),j.type==="select"?e.jsx("select",{value:v,onChange:F=>E(j.key,F.target.value),className:"w-full border border-border rounded-lg px-2.5 py-1.5 text-xs bg-surface text-content-secondary focus:outline-none focus:ring-2 focus:ring-accent/30",children:(j.options??[]).map(F=>e.jsx("option",{value:F,children:F===""?"— none —":r.providerLabels[F]??F},F))}):e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:z&&!u[j.key]?"password":j.type==="number"?"number":"text",value:v,placeholder:z&&C?"•••••••• (saved)":j.placeholder,onChange:F=>E(j.key,F.target.value),className:O("w-full border border-border rounded-lg px-2.5 py-1.5 text-xs bg-surface text-content-secondary","focus:outline-none focus:ring-2 focus:ring-accent/30",z&&"pr-9")}),z&&e.jsx("button",{type:"button",onClick:()=>x(F=>({...F,[j.key]:!F[j.key]})),className:"absolute right-2 top-1/2 -translate-y-1/2 text-content-tertiary hover:text-content",title:u[j.key]?"Hide":"Show",children:u[j.key]?e.jsx(Pf,{size:13}):e.jsx(wa,{size:13})})]}),j.hint&&e.jsx("p",{className:"text-[10px] text-content-tertiary mt-1",children:j.hint})]},j.key)},k=j=>{const v=!(g[j.id]??j.id!=="ai-core");return e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("button",{type:"button",onClick:()=>y(z=>({...z,[j.id]:v})),className:"w-full px-4 py-2.5 border-b border-border flex items-center justify-between text-left hover:bg-surface-inset/40 transition-colors",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xs font-bold text-content",children:j.title}),j.description&&e.jsx("p",{className:"text-[10px] text-content-tertiary mt-0.5",children:j.description})]}),v?e.jsx(kt,{size:15,className:"text-content-tertiary flex-shrink-0"}):e.jsx(Zt,{size:15,className:"text-content-tertiary flex-shrink-0"})]}),v&&e.jsx("div",{className:"px-4 py-1",children:j.fields.map(M)})]},j.id)};return e.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-3xl mx-auto p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between sticky top-0 z-10 bg-surface-inset/80 backdrop-blur rounded-xl border border-border px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-br from-emerald-500 to-teal-600 flex items-center justify-center shadow-sm",children:e.jsx(Lf,{size:15,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-sm font-bold text-content",children:"Environment Configuration"}),e.jsxs("p",{className:"text-[10px] text-content-tertiary",children:["Edit your project's ",e.jsx("code",{className:"text-accent",children:".env"})," — AI providers, Jira, GitHub & more"]})]})]}),e.jsxs(we,{size:"sm",onClick:()=>N.mutate(),loading:N.isPending,children:[e.jsx(ga,{size:12})," Save to .env"]})]}),e.jsx("p",{className:"text-[10px] text-content-tertiary px-1",children:"🔒 Secrets are masked and never displayed. Leave a secret blank to keep its saved value. Most changes apply immediately; a few may need a Studio restart."}),P.map(k),e.jsx("div",{className:"flex justify-end pt-1 pb-4",children:e.jsxs(we,{size:"sm",onClick:()=>N.mutate(),loading:N.isPending,children:[e.jsx(ga,{size:12})," Save to .env"]})})]})})})}function Ow(){const s=Re(),{modalProps:r,confirmDelete:a}=Gs(),[o,c]=p.useState(!1),[u,x]=p.useState(""),[h,f]=p.useState(""),[g,y]=p.useState(""),[N,E]=p.useState(null),[S,P]=p.useState({}),[M,k]=p.useState(null),[j,v]=p.useState(new Set),z=K=>{v(J=>{const ue=new Set(J);return ue.has(K)?ue.delete(K):ue.add(K),ue})},{data:C=[],isLoading:w}=Oe({queryKey:["step-library"],queryFn:()=>mr.list()}),F=oe({mutationFn:()=>mr.create({name:u.trim(),instruction:h.trim(),tags:g.split(",").map(K=>K.trim()).filter(Boolean)}),onSuccess:()=>{s.invalidateQueries({queryKey:["step-library"]}),$.success("Step created"),c(!1),x(""),f(""),y("")},onError:K=>$.error(K.message)}),Q=oe({mutationFn:({id:K,data:J})=>mr.update(K,J),onSuccess:()=>{s.invalidateQueries({queryKey:["step-library"]}),$.success("Step updated"),E(null)},onError:K=>$.error(K.message)}),Z=oe({mutationFn:K=>mr.delete(K),onSuccess:()=>{s.invalidateQueries({queryKey:["step-library"]}),$.success("Step deleted")},onError:K=>$.error(K.message)}),le=oe({mutationFn:K=>mr.generate(K),onSuccess:()=>{s.invalidateQueries({queryKey:["step-library"]}),$.success("Code generated"),k(null)},onError:K=>{$.error(K.message),k(null)}});return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:[e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-4xl mx-auto px-5 py-4 space-y-3",children:[e.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-violet-500 to-purple-600 flex items-center justify-center shadow-sm shadow-violet-500/20",children:e.jsx(Ri,{size:17,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-sm font-bold text-content",children:"Step Library"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Reusable step templates for your test cases"})]})]}),e.jsxs("button",{type:"button",onClick:()=>c(K=>!K),className:"inline-flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-lg bg-accent text-white hover:brightness-110 transition-colors",children:[e.jsx(Ks,{size:13})," Add Step"]})]})}),o&&e.jsxs("div",{className:"rounded-xl border border-accent/30 bg-surface p-4 space-y-2.5",children:[e.jsx("p",{className:"text-xs font-semibold text-content",children:"New Library Step"}),e.jsx("input",{type:"text",placeholder:"Name (e.g. Login as admin)",value:u,onChange:K=>x(K.target.value),className:"w-full px-3 py-2 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30"}),e.jsx("textarea",{placeholder:"Instruction (e.g. Click the login button and fill in admin credentials)",value:h,onChange:K=>f(K.target.value),rows:3,className:"w-full px-3 py-2 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30 resize-none"}),e.jsx("input",{type:"text",placeholder:"Tags (comma-separated, optional)",value:g,onChange:K=>y(K.target.value),className:"w-full px-3 py-2 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"button",onClick:()=>F.mutate(),disabled:!u.trim()||!h.trim()||F.isPending,className:"text-xs px-4 py-1.5 rounded-lg bg-accent text-white hover:brightness-110 transition-colors disabled:opacity-50",children:F.isPending?"Saving…":"Save"}),e.jsx("button",{type:"button",onClick:()=>c(!1),className:"text-xs px-3 py-1.5 rounded-lg border border-border text-content-secondary hover:bg-surface-inset",children:"Cancel"})]})]}),w&&e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Me,{size:18,className:"animate-spin text-accent"})}),!w&&C.length===0&&!o&&e.jsxs("div",{className:"rounded-xl border border-dashed border-border bg-surface flex flex-col items-center justify-center py-14 gap-2.5",children:[e.jsx(Ri,{size:24,className:"text-content-tertiary"}),e.jsx("p",{className:"text-xs font-medium text-content-secondary",children:"No steps in library"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:'Click "Add Step" to create your first reusable step template.'})]}),C.length>0&&e.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{className:"bg-surface-inset/50 border-b border-border",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left px-4 py-2.5 text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Name"}),e.jsx("th",{className:"text-left px-4 py-2.5 text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Instruction"}),e.jsx("th",{className:"text-left px-4 py-2.5 text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Code"}),e.jsx("th",{className:"text-left px-4 py-2.5 text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Tags"}),e.jsx("th",{className:"px-4 py-2.5 w-24"})]})}),e.jsx("tbody",{className:"divide-y divide-border",children:C.map(K=>e.jsxs(p.Fragment,{children:[e.jsxs("tr",{className:"hover:bg-surface-inset/30 transition-colors",children:[e.jsx("td",{className:"px-4 py-2.5 font-medium text-content",children:N===K.id?e.jsx("input",{type:"text",value:S.name??K.name,onChange:J=>P(ue=>({...ue,name:J.target.value})),className:"w-full px-2 py-1 border border-border rounded text-xs focus:outline-none focus:ring-1 focus:ring-accent/30"}):K.name}),e.jsx("td",{className:"px-4 py-2.5 text-content-secondary max-w-xs",children:N===K.id?e.jsx("textarea",{value:S.instruction??K.instruction,onChange:J=>P(ue=>({...ue,instruction:J.target.value})),rows:2,className:"w-full px-2 py-1 border border-border rounded text-xs focus:outline-none focus:ring-1 focus:ring-accent/30 resize-none"}):e.jsx("span",{className:"line-clamp-2",children:K.instruction})}),e.jsx("td",{className:"px-4 py-2.5",children:K.generatedCode?e.jsxs("button",{type:"button",onClick:()=>z(K.id),className:"inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded bg-emerald-50 dark:bg-emerald-900/20 text-emerald-600 dark:text-emerald-400 ring-1 ring-emerald-200 dark:ring-emerald-800 hover:brightness-95 transition-colors cursor-pointer",children:[j.has(K.id)?e.jsx(kt,{size:10}):e.jsx(Zt,{size:10}),e.jsx(Vu,{size:10}),"View"]}):e.jsx("span",{className:"inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-1 ring-amber-200 dark:ring-amber-800",children:"No code"})}),e.jsx("td",{className:"px-4 py-2.5",children:e.jsx("div",{className:"flex flex-wrap gap-0.5",children:K.tags.map(J=>e.jsx("span",{className:"text-[8px] px-1 py-px rounded bg-accent/8 text-accent ring-1 ring-accent/15",children:J},J))})}),e.jsx("td",{className:"px-4 py-2.5",children:e.jsx("div",{className:"flex items-center gap-1",children:N===K.id?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>Q.mutate({id:K.id,data:S}),className:"p-1 rounded text-emerald-600 hover:bg-emerald-50",children:e.jsx(et,{size:12})}),e.jsx("button",{type:"button",onClick:()=>E(null),className:"p-1 rounded text-content-tertiary hover:bg-surface-inset",children:e.jsx(_e,{size:12})})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",title:K.generatedCode?"Regenerate code":"Generate code",onClick:()=>{k(K.id),le.mutate(K.id)},disabled:M===K.id,className:"p-1 rounded text-content-tertiary hover:text-accent hover:bg-accent/5 transition-colors disabled:opacity-40",children:M===K.id?e.jsx(Me,{size:12,className:"animate-spin"}):e.jsx(kr,{size:12})}),e.jsx("button",{type:"button",onClick:()=>{E(K.id),P({name:K.name,instruction:K.instruction,tags:K.tags})},className:"p-1 rounded text-content-tertiary hover:text-content hover:bg-surface-inset",children:e.jsx(Gn,{size:12})}),e.jsx("button",{type:"button",onClick:()=>a(`Delete "${K.name}"?`,()=>Z.mutate(K.id)),className:"p-1 rounded text-content-tertiary hover:text-red-500 hover:bg-red-50",children:e.jsx(es,{size:12})})]})})})]}),j.has(K.id)&&K.generatedCode&&e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"p-0",children:e.jsx(sx,{code:K.generatedCode,maxLines:12,className:"rounded-none"})})})]},K.id))})]})})]})}),e.jsx(Ws,{...r})]})}const wi=[{id:"getting-started",title:"Getting Started",category:"Getting Started",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"AssureMind Studio is an AI-powered test automation platform for web applications. It lets you describe tests in plain English, generate Playwright code automatically, and run them in the cloud or locally."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Prerequisites"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsx("li",{children:"Node.js 18+ (20 LTS recommended)"}),e.jsx("li",{children:"An AI provider API key (Anthropic, OpenAI, Google, Azure…) — or run a local model via Ollama (free)"}),e.jsx("li",{children:"A test target application URL"}),e.jsx("li",{children:"Optional: JDK 17+ for Allure HTML reports"})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Quick Setup"}),e.jsx("pre",{className:"text-[11px] bg-surface-inset rounded-lg px-4 py-3 overflow-x-auto border border-border font-mono",children:`npm install assuremind
|
|
928
|
+
npx assuremind init # folders, config, Playwright browsers
|
|
929
|
+
npx playwright install # if browser install was skipped or failed
|
|
930
|
+
npx assuremind studio # opens http://localhost:4400`}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Open ",e.jsx("code",{className:"text-accent",children:"http://localhost:4400"})," to access the Studio UI. The first run triggers the onboarding wizard and opens in ",e.jsx("strong",{children:"light mode"})," by default (toggle dark/light any time from the top bar)."]}),e.jsxs("p",{className:"text-sm text-content-secondary",children:[e.jsx("code",{className:"text-accent",children:"npx assuremind init"})," installs the Playwright browsers automatically. If that step is skipped (",e.jsx("code",{className:"text-accent",children:"--skip-playwright"}),") or fails, run ",e.jsx("code",{className:"text-accent",children:"npx playwright install"})," manually (add ",e.jsx("code",{className:"text-accent",children:"--with-deps"})," on Linux). Verify with ",e.jsx("code",{className:"text-accent",children:"npx assuremind doctor"}),"."]})]})},{id:"configuration",title:"Configuration",category:"Getting Started",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["Configuration is stored in ",e.jsx("code",{className:"text-accent",children:"tests/autotest.config.json"})," and editable from the Settings page."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Key Settings"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Field"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Description"})]})}),e.jsx("tbody",{className:"text-content-secondary",children:[["baseUrl","Default URL for all test cases"],["environment","Active environment: dev | stage | test | prod"],["browsers","List of browsers: chromium, firefox, webkit"],["headless","Run browsers without a visible window"],["timeout","Global step timeout in ms (default 30000)"],["retries","Global retry count per step (default 0)"],["parallel","Number of parallel workers"],["screenshot","Screenshot mode: always | on-failure | never"]].map(([s,r])=>e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("td",{className:"py-1.5 pr-4 font-mono text-accent",children:s}),e.jsx("td",{className:"py-1.5",children:r})]},s))})]})})]})},{id:"test-suites",title:"Test Suites",category:"Core Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["Test Suites group related test cases. Each suite has a type (",e.jsx("strong",{children:"UI"}),", ",e.jsx("strong",{children:"API"}),", or ",e.jsx("strong",{children:"Audit"}),"), tags, and an optional timeout override."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Suite Types"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Type"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Description"})]})}),e.jsx("tbody",{className:"text-content-secondary",children:[["UI",'Standard Playwright browser automation. Steps show a blue "UI" badge. No Lighthouse.'],["API","API-only tests using HTTP request and assertion steps."],["Audit",'Full Playwright automation with Lighthouse non-functional checks (Performance, Accessibility, SEO). Steps show an amber "Audit" badge. Screenshot, video, and trace are disabled by default. Files stored in tests/audit/.']].map(([s,r])=>e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("td",{className:"py-1.5 pr-4 font-mono text-accent",children:s}),e.jsx("td",{className:"py-1.5",children:r})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Creating a Suite"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["Go to ",e.jsx("strong",{children:"Test Suites"})," in the sidebar."]}),e.jsxs("li",{children:["Click ",e.jsx("strong",{children:"+ New Suite"})," and enter a name."]}),e.jsxs("li",{children:["Select the suite type: ",e.jsx("strong",{children:"UI"}),", ",e.jsx("strong",{children:"API"}),", or ",e.jsx("strong",{children:"Audit"}),"."]}),e.jsx("li",{children:"Optionally set tags and timeout."})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Suite Actions"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"Each suite supports inline rename, duplicate, delete, and direct run via the Run Configuration page."})]})},{id:"audit-suites",title:"Audit Suites",category:"Core Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Audit suites run exactly like UI suites (full Playwright automation) but add non-functional quality checks via Google Lighthouse for Performance, Accessibility, and SEO."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"⚡ Audit Flag on Steps"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["In Audit suites, each step has a ",e.jsx("strong",{children:"⚡ Audit"})," button. Clicking it marks that step as a Lighthouse checkpoint — when the step runs, Lighthouse audits ",e.jsx("code",{className:"text-accent",children:"page.url()"})," at that point. Confirm with ",e.jsx("strong",{children:"✓"})," to save or ",e.jsx("strong",{children:"✗"})," to cancel. If no steps are marked, Lighthouse is skipped entirely."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Non-Functional Checks"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Each test case in an Audit suite has a ",e.jsx("strong",{children:"Non-Functional Checks"})," section with three checkboxes:"]}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"⚡ Performance"})," — Lighthouse Performance score"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"♿ Accessibility"})," — Lighthouse Accessibility score"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"🔍 SEO"})," — Lighthouse SEO score"]})]}),e.jsx("p",{className:"text-sm text-content-secondary",children:"If all three are unchecked, Lighthouse is skipped for that case. A warning is shown if none are selected."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Score Thresholds"}),e.jsxs("div",{className:"flex gap-4 text-sm",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-3 h-3 rounded-full bg-emerald-500 inline-block"})," Good (90–100)"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-3 h-3 rounded-full bg-amber-400 inline-block"})," Needs Work (50–89)"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-3 h-3 rounded-full bg-red-500 inline-block"})," Poor (0–49) — test FAILS"]})]})]})},{id:"test-cases",title:"Test Cases",category:"Core Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Test cases contain steps written in plain English. Each case has priority, tags, timeout, and optional data-driven configuration."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Writing Steps"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Open a case, type a step instruction in the input bar (e.g. ",e.jsx("em",{children:'"Click the Login button"'}),"), and press Enter. The step is saved immediately. Click ",e.jsx("strong",{children:"Generate All"})," to generate Playwright code for all steps at once."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Step Types"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"UI"})," — Playwright browser actions"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"API"})," — HTTP request/assertion steps"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Mock"})," — Intercept and stub network requests"]})]})]})},{id:"writing-steps",title:"Writing Steps — Examples",category:"Core Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["Describe steps in plain English. Put the target name in quotes for reliability, use the"," ",e.jsx("strong",{children:"Fake Data"})," (",e.jsx("code",{className:"text-accent",children:"{{FAKE_*}}"}),") and"," ",e.jsx("strong",{children:"Files"})," (",e.jsx("code",{className:"text-accent",children:"{{FILE:name}}"}),") pickers for dynamic values, and prefix any assertion with ",e.jsx("strong",{children:'"Soft"'})," to keep running on failure."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"UI steps"}),e.jsx("pre",{className:"text-[11px] bg-surface-inset rounded-lg px-4 py-3 overflow-x-auto border border-border font-mono",children:`# Navigation
|
|
931
|
+
Go to https://example.com
|
|
932
|
+
Navigate to /dashboard
|
|
933
|
+
Go back | Refresh the page
|
|
934
|
+
|
|
935
|
+
# Click (name the real role: button / link / tab)
|
|
936
|
+
Click the "Login" button
|
|
937
|
+
Click the "Dashboard" link
|
|
938
|
+
Double click the "Row 1" element
|
|
939
|
+
|
|
940
|
+
# Input
|
|
941
|
+
Enter "deepak" in the Username field
|
|
942
|
+
Type {{FAKE_INTERNET_EMAIL}} in the Email field
|
|
943
|
+
Fill "secret123" in the Password field # password -> getByLabel
|
|
944
|
+
Clear the Search field
|
|
945
|
+
|
|
946
|
+
# Dropdown / checkbox / radio
|
|
947
|
+
Select "India" from the Country dropdown
|
|
948
|
+
Check the "Remember me" checkbox
|
|
949
|
+
Select the "Male" radio button
|
|
950
|
+
|
|
951
|
+
# Keyboard / wait / scroll / hover
|
|
952
|
+
Press Enter | Press "Control+A"
|
|
953
|
+
Wait for 2 seconds | Wait for the page to load
|
|
954
|
+
Scroll down | Hover over the "Profile" menu
|
|
955
|
+
|
|
956
|
+
# File upload / download
|
|
957
|
+
Upload {{FILE:resume.pdf}} to the Resume field and wait for 'Upload complete'
|
|
958
|
+
Download the "Export CSV" link
|
|
959
|
+
Click the "Download" button to download
|
|
960
|
+
|
|
961
|
+
# Assertions (prefix "Soft" to continue on failure)
|
|
962
|
+
Verify "Welcome back" is visible
|
|
963
|
+
Verify "Error" is not visible
|
|
964
|
+
Verify the page title is "Dashboard"
|
|
965
|
+
Verify the URL contains "/dashboard"
|
|
966
|
+
Verify the "Email" field has value "user@test.com"`}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"API steps"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Mark the suite/case as ",e.jsx("strong",{children:"API"}),". Use ",e.jsx("code",{className:"text-accent",children:"{{BASE_URL}}"})," and saved variables."]}),e.jsx("pre",{className:"text-[11px] bg-surface-inset rounded-lg px-4 py-3 overflow-x-auto border border-border font-mono",children:`# Requests
|
|
967
|
+
Send a GET request to {{BASE_URL}}/api/users and verify status is 200
|
|
968
|
+
Send a POST request to {{BASE_URL}}/api/users with body { "name": "John" } and verify status 201
|
|
969
|
+
Send a DELETE request to {{BASE_URL}}/api/users/1 and verify status 204
|
|
970
|
+
|
|
971
|
+
# Auth — extract then reuse a token
|
|
972
|
+
POST to {{BASE_URL}}/api/login with { "email": "{{ADMIN_EMAIL}}", "password": "{{DEFAULT_PASSWORD}}" }, save token as AUTH_TOKEN
|
|
973
|
+
GET {{BASE_URL}}/api/profile with Authorization Bearer {{AUTH_TOKEN}} and verify status 200
|
|
974
|
+
|
|
975
|
+
# Response assertions
|
|
976
|
+
Verify the response body has property "id"
|
|
977
|
+
Verify the response field "name" equals "Admin"
|
|
978
|
+
Verify the content-type header contains "application/json"
|
|
979
|
+
Verify the response time is under 500 ms`}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Full reference with every scenario (iframes, shadow DOM, dialogs, headers, query/form bodies): see ",e.jsx("code",{className:"text-accent",children:"docs/WRITING-STEPS.md"}),"."]})]})},{id:"ai-generation",title:"AI Code Generation",category:"Core Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"AssureMind uses your configured AI provider to convert natural-language instructions into executable Playwright code."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"How It Works"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsx("li",{children:"Write a step instruction in plain English."}),e.jsxs("li",{children:["Click the wand icon or ",e.jsx("strong",{children:"Generate All"}),"."]}),e.jsx("li",{children:"The AI generates strategy-specific Playwright code."}),e.jsx("li",{children:"Review the code by expanding the step row."})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Supported Providers"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"Anthropic Claude, OpenAI GPT-4, Google Gemini, AWS Bedrock, Azure OpenAI, and Ollama (local). Configure via Settings → AI Provider."})]})},{id:"local-models",title:"Local Models (Ollama)",category:"Core Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["Run models entirely on your own machine — no API key, no cost. AssureMind turns plain-English steps into Playwright code, so a ",e.jsx("strong",{children:"code-tuned model with strong instruction-following"})," works best."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Setup"}),e.jsx("pre",{className:"text-[11px] bg-surface-inset rounded-lg px-4 py-3 overflow-x-auto border border-border font-mono",children:`# Install Ollama → https://ollama.com/download
|
|
980
|
+
ollama serve # server on http://localhost:11434
|
|
981
|
+
ollama pull qwen2.5-coder:7b # recommended model
|
|
982
|
+
|
|
983
|
+
# .env
|
|
984
|
+
AI_PROVIDER=ollama
|
|
985
|
+
OLLAMA_MODEL=qwen2.5-coder:7b
|
|
986
|
+
OLLAMA_BASE_URL=http://localhost:11434
|
|
987
|
+
AI_TIMEOUT=120 # local inference is slower`}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Recommended Models (by hardware)"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Hardware"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Model"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Notes"})]})}),e.jsx("tbody",{className:"text-content-secondary",children:[["16 GB+ RAM, GPU 8 GB+ VRAM","qwen2.5-coder:14b","Highest accuracy — complex steps / iframes"],["16 GB RAM (GPU optional) ⭐","qwen2.5-coder:7b","Best balance of quality & speed"],["8 GB RAM, no GPU","llama3.2 (3B) / qwen2.5-coder:3b","Usable; good for simpler steps"],["≤4–6 GB RAM","llama3.2:1b / phi3:mini","Lightweight; navigation & clicks only"]].map(([s,r,a])=>e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("td",{className:"py-1.5 pr-4",children:s}),e.jsx("td",{className:"py-1.5 pr-4 font-mono text-accent",children:r}),e.jsx("td",{className:"py-1.5",children:a})]},r))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"System Requirements"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"RAM is the floor"})," — a model needs roughly its file size + ~2 GB free. A 7B model (~4.7 GB) wants 8 GB free RAM minimum, 16 GB comfortable; a 14B model wants ~16 GB+."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"GPU optional but transformative"})," — CPU-only works (hence the 120s timeout); a GPU with 8 GB+ VRAM (NVIDIA / Apple Silicon / modern AMD) makes 7B models fast."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Disk"})," — a few GB per model; keep 10–20 GB free if trying several."]})]}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Tip: enable ",e.jsx("strong",{children:"MCP"})," (Settings → live page snapshots) for far more accurate locators with local models. Avoid ",e.jsx("code",{className:"text-accent",children:"deepseek-r1"})," here — its reasoning output is slow and pollutes generated code."]})]})},{id:"run-configuration",title:"Run Configuration",category:"Core Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"The Run Configuration page lets you select suites, browsers, and settings before executing a test run."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Options"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsx("li",{children:"Select one or more suites to run"}),e.jsx("li",{children:"Override browsers, headless mode, and parallel count"}),e.jsx("li",{children:"Enable/disable video recording and tracing"}),e.jsx("li",{children:"Set retries and screenshot mode per run"})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Device Emulation"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["The ",e.jsx("strong",{children:"Device Emulation"})," section lets you emulate real mobile and tablet devices using Playwright's built-in device descriptors. Selecting a device applies the correct viewport, user-agent, device pixel ratio, and touch/mobile flags automatically."]}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2 mt-1",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Desktop"})," — Viewport-only presets (1920×1080, 1440×900, 1366×768, 1280×720, 1024×768). No mobile emulation."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Mobile"})," — iPhone 15 Pro/15/14/SE, Pixel 7/5, Galaxy S9+/S8. Full Playwright device descriptor including touch events and mobile UA. Chromium is recommended."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Tablet"})," — iPad Pro 11″, iPad (gen 7), iPad Mini, Galaxy Tab S4. Use WebKit or Chromium for best results."]})]}),e.jsx("p",{className:"text-sm text-content-secondary mt-1",children:"A teal device badge appears on each case in the Reports page when the run used device emulation, making it easy to identify mobile vs desktop results at a glance."}),e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg px-3 py-2 text-[11px] text-amber-700 mt-1",children:["⚠ Mobile and tablet device descriptors work best with ",e.jsx("strong",{children:"Chromium"}),". Firefox and WebKit do not fully support Playwright's mobile emulation flags."]}),e.jsx("h4",{className:"text-sm font-semibold text-content mt-2",children:"Live Progress"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"Run progress is streamed via WebSocket. Status updates appear in real time on the case list and via toast notifications."}),e.jsx("h4",{className:"text-sm font-semibold text-content mt-2",children:"Running from CI/CD (CLI)"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"Every option available in the UI is also available as a CLI flag:"}),e.jsx("pre",{className:"bg-[#1e1e2e] text-[#cdd6f4] text-[10px] font-mono p-3 rounded-lg overflow-x-auto leading-relaxed mt-1",children:`# Run all tests in CI (headless, exit 1 on failure)
|
|
988
|
+
npx assuremind run --all --ci
|
|
989
|
+
|
|
990
|
+
# Filter by type, suite, tag, or test name
|
|
991
|
+
npx assuremind run --type ui --tag smoke
|
|
992
|
+
npx assuremind run --suite "Login Tests" --browser chromium firefox
|
|
993
|
+
|
|
994
|
+
# Device emulation in CI
|
|
995
|
+
npx assuremind run --all --device "iPhone 15 Pro" --browser chromium --ci
|
|
996
|
+
npx assuremind run --tag smoke --device "Pixel 7" --browser chromium --ci
|
|
997
|
+
npx assuremind run --all --device "iPad Pro 11" --browser webkit --ci`})]})},{id:"reports",title:"Reports",category:"Core Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Reports show step-level results with screenshots, error messages, Lighthouse scores (Audit suites), and visual regression baselines."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Report Features"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsx("li",{children:"Per-step pass/fail status and error details"}),e.jsx("li",{children:"Screenshot filmstrip — click any thumbnail to enlarge"}),e.jsx("li",{children:"Execution timeline (Gantt view) per case"}),e.jsx("li",{children:"Visual baseline comparison with diff overlay"}),e.jsx("li",{children:"Allure integration for full HTML reports"})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Lighthouse Results (Audit Suites)"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["For Audit suite cases with Lighthouse data, three tab buttons appear on the case row: ",e.jsx("strong",{children:"⚡ Speed"})," (Performance), ",e.jsx("strong",{children:"♿ A11y"})," (Accessibility), and ",e.jsx("strong",{children:"🔍 SEO"}),". Case rows are highlighted red when any score is Poor (< 50)."]}),e.jsxs("div",{className:"flex gap-4 text-sm mt-1",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-3 h-3 rounded-full bg-emerald-500 inline-block"})," Good (90+)"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-3 h-3 rounded-full bg-amber-400 inline-block"})," Needs Work (50–89)"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-3 h-3 rounded-full bg-red-500 inline-block"})," Poor (< 50) — case FAILS"]})]}),e.jsx("p",{className:"text-sm text-content-secondary mt-1",children:"Allure reports for Audit cases include three separate HTML attachments: Performance Report, Accessibility Report, and SEO Report. The Allure test status is set to FAILED if any score is below 50."})]})},{id:"self-healing",title:"Self-Healing",category:"Core Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Self-healing automatically fixes broken selectors when UI changes cause test failures. Failed steps are re-generated using AI with updated selectors."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Configuration"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Max Level"})," — Healing aggressiveness (1–5)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Daily Budget"})," — Max AI calls per day for healing"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Auto PR"})," — Automatically open a Git PR for healed steps"]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Healed Steps"}),e.jsx("p",{className:"text-sm text-content-secondary",children:'Steps that were healed show an amber "healed" badge in the case editor. View the full healing log in the Self-Healing page.'})]})},{id:"variables",title:"Variables",category:"Core Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["Variables let you inject dynamic data into step instructions using ",e.jsx("code",{className:"text-accent",children:"{{variableName}}"})," tokens."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Types of Variables"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Static"})," — Fixed string values (e.g. credentials)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Environment"})," — Per-environment overrides"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Faker"})," — Randomly generated test data (e.g. fake email)"]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Dynamic Data Picker"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"Click the data picker icon next to the step input to insert variables, faker tokens, or environment values at the cursor position."})]})},{id:"git-control",title:"Git Control Center",category:"Core Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"The Git Control Center provides a visual interface for all Git operations — commit, push, pull, branch switching, and conflict resolution."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Key Operations"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Commit"})," — Stage and commit all changes with a message"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"AI Message"})," — Generate a commit message using AI"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Full Sync"})," — Commit + push in one click"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Conflict Resolution"})," — Visual diff and AI-assisted merge"]})]})]})},{id:"bulk-actions",title:"Bulk Actions",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Select multiple test cases and perform batch operations including delete and move-to-suite."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"How to Use"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsx("li",{children:"Click the checkbox to the left of any test case row."}),e.jsxs("li",{children:["Hold ",e.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-surface-inset border border-border text-[10px]",children:"Shift"})," and click another row to select a range."]}),e.jsx("li",{children:"The Bulk Action Bar appears at the bottom of the screen."}),e.jsxs("li",{children:["Choose ",e.jsx("strong",{children:"Delete"})," or ",e.jsx("strong",{children:"Move to Suite"}),"."]})]})]})},{id:"flakiness-tracker",title:"Flakiness Tracker",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"The Flakiness Tracker analyzes the last 20 runs for each test case and flags cases that intermittently pass and fail."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Flaky Badge"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Cases with a pass rate between 0% and 100% (and at least 3 runs) show an amber ",e.jsx("strong",{children:"~flaky"})," badge in the case list. Hover to see the exact pass rate."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Thresholds"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"A case is considered flaky when it has at least 3 recorded runs and its historical pass rate is between 1% and 99%."})]})},{id:"step-library",title:"Step Library",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"The Step Library stores reusable step templates that can be inserted into any test case with a single click."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Managing the Library"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Go to ",e.jsx("strong",{children:"Step Library"})," in the sidebar. Add steps with a name, instruction, and optional tags. Library steps are stored in ",e.jsx("code",{className:"text-accent",children:"tests/.step-library.json"}),"."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Inserting Steps"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Open a test case, click the ",e.jsx("strong",{children:"Library"})," button in the top-right of the steps area. Search for a step template and click ",e.jsx("strong",{children:"Insert"})," to add it to the current case."]})]})},{id:"environment-profiles",title:"Environment Profiles",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Environment Profiles let you save and switch between different test configurations (URL, browsers, environment) without manually editing settings."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Creating Profiles"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Go to ",e.jsx("strong",{children:"Settings → Environment Profiles"})," and click ",e.jsx("strong",{children:"Add Profile"}),". Enter a name, then configure the profile in the list."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Switching Profiles"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"The profile picker appears in the top bar. Click a profile name to instantly apply it, overriding the active environment and base URL for the next run."})]})},{id:"mcp-integration",title:"MCP Integration",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["MCP (Model Context Protocol) integration connects the AI code generator to a real Playwright browser via the official ",e.jsx("code",{className:"text-accent",children:"@playwright/mcp"})," server. Instead of guessing selectors blindly, the AI sees actual page elements through accessibility snapshots — boosting code generation accuracy from ~50-70% to ~90-95%."]}),e.jsxs("div",{className:"rounded-lg bg-purple-50 border border-purple-200 px-4 py-3 text-sm text-purple-800",children:[e.jsx("strong",{children:"Enabled by default"})," — MCP is ON for code generation and OFF for test execution. Your existing tests and CI/CD pipelines are unaffected."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"How It Works"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["When you click ",e.jsx("strong",{children:"Generate Code"}),", the SmartRouter launches a headless Playwright browser via MCP."]}),e.jsxs("li",{children:["The browser navigates to your app's URL and takes an ",e.jsx("strong",{children:"accessibility snapshot"})," — a structured tree of all interactive elements (buttons, inputs, links, etc.)."]}),e.jsx("li",{children:"The snapshot is fed to the AI alongside the step instruction, so the AI sees exact element roles, names, and attributes."}),e.jsx("li",{children:"The AI generates Playwright code using real selectors from the live page — no guessing."})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Generation Strategies"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Strategy"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Toggle"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Description"})]})}),e.jsx("tbody",{className:"text-content-secondary divide-y divide-border/50",children:[["Snapshot-Driven","Enable MCP","AI sees live accessibility snapshot during generation. Zero overhead for cached/template steps."],["Act-then-Script","Act-then-script","AI plans MCP tool actions → executes them on the real browser → converts successful actions to Playwright code. Near-100% accuracy but higher latency."],["Proactive Healing","Proactive healing","Before a test run, MCP takes a fresh snapshot and validates every selector in generated code against the live page. Missing elements are flagged with suggestions."]].map(([s,r,a])=>e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:s}),e.jsx("td",{className:"py-1.5 pr-4 font-mono text-accent text-[10px]",children:r}),e.jsx("td",{className:"py-1.5",children:a})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Settings"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Go to ",e.jsx("strong",{children:"Settings → MCP Integration"})," to configure:"]}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Enable MCP"})," — Master switch (ON by default). When off, falls back to blind generation."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Headless mode"})," — Run the MCP browser without a visible window (ON by default)."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Act-then-script"})," — Two-phase generation: execute first, then convert to code (OFF by default)."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Proactive healing"})," — Pre-run selector validation against the live page (OFF by default)."]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Fallback Behavior"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Every MCP call is wrapped in a silent try/catch. If the MCP server crashes, the browser fails to launch, or a snapshot times out, the system ",e.jsx("strong",{children:"automatically falls back to blind generation"})," — exactly how it worked before MCP. No test run will ever fail because of MCP."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Performance Impact"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Template steps (~60%)"})," — Zero MCP overhead (bypassed entirely)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Cached steps (~20%)"})," — Zero MCP overhead (bypassed entirely)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"AI-generated steps (~20%)"})," — +2-5s first page load, <500ms for subsequent snapshots on the same page"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Test execution"})," — Zero impact (MCP is never used during runs)"]})]})]})},{id:"rag-memory",title:"RAG Memory",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["RAG (Retrieval-Augmented Generation) gives the AI ",e.jsx("strong",{children:"semantic memory"})," from past test runs. Every successful step, healing fix, and recurring error is indexed so the AI retrieves similar experiences and generates better code over time."]}),e.jsxs("div",{className:"rounded-lg bg-emerald-50 border border-emerald-200 px-4 py-3 text-sm text-emerald-800",children:[e.jsx("strong",{children:"Enabled by default"})," — uses local TF-IDF embeddings and file-based JSON storage. Zero cost, zero database, fully offline."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Three Corpora"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Corpus"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Stores"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Used During"})]})}),e.jsx("tbody",{className:"text-content-secondary divide-y divide-border/50",children:[["Code Corpus","Instruction-to-code mappings from successful runs","Generation — similar past steps as AI examples or direct fuzzy cache hits"],["Healing Corpus","Past healing events (error + fix pairs)","Self-healing — proven past fixes injected into Level 2 repair prompt"],["Error Catalog","Recurring error patterns per URL with fix history","Generation — AI warned about known-bad selectors to avoid"]].map(([s,r,a])=>e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:s}),e.jsx("td",{className:"py-1.5 pr-4",children:r}),e.jsx("td",{className:"py-1.5",children:a})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"How It Works"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Step passes"})," — instruction + code are ingested into the Code Corpus."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Step fails"})," — error pattern is recorded in the Error Catalog."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Healing succeeds"})," — fix is ingested into the Healing Corpus; Error Catalog updated with the fix."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Next generation"})," — SmartRouter queries Code Corpus. Score ≥ 0.90 = direct use ($0). Score 0.65-0.90 = AI prompt examples."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Next healing"})," — Level 2 queries Healing Corpus for similar past fixes."]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"SmartRouter Pipeline"}),e.jsx("pre",{className:"text-[11px] bg-surface-inset rounded-lg px-4 py-3 overflow-x-auto border border-border font-mono leading-relaxed",children:`1. Template ($0) → 2. Cache ($0) → 2.3 RAG ($0) → 2.5 MCP → AI Call
|
|
998
|
+
↑
|
|
999
|
+
Score ≥ 0.90 → direct use (free)
|
|
1000
|
+
Score 0.65–0.90 → inject as examples`}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Storage"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["All RAG data stored in ",e.jsx("code",{className:"text-accent",children:"results/.rag/"})," as JSON files — fully Git-friendly. Delete the directory to reset all memory."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Consumer Experience"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:[e.jsx("strong",{children:"Zero setup required."})," RAG is ON by default and works automatically from the first run:"]}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Run 1"})," — memory is empty, AI generates code normally"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Run 2+"})," — similar instructions retrieved instead of making API calls (free + faster)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Run 10+"})," — most common steps served from memory at zero cost"]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"FAQ"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Question"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Answer"})]})}),e.jsx("tbody",{className:"text-content-secondary divide-y divide-border/50",children:[["Do I need to configure anything?","No. RAG is ON by default with zero setup."],["Does it cost anything?","No. TF-IDF embedder runs locally. RAG hits replace paid AI calls."],["Does it slow down tests?","No. RAG lookup is <1ms. It speeds up generation."],["Works in CI/CD?","Yes. Cache results/.rag/ between runs to persist memory."],["Share memory across team?","Commit results/.rag/ to Git or use a CI cache step."],["How to reset?","Delete the results/.rag/ folder."]].map(([s,r])=>e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:s}),e.jsx("td",{className:"py-1.5",children:r})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"When to Use the Settings Card"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Most users ",e.jsx("strong",{children:"never need to touch RAG settings"}),". The Settings → RAG Memory card exists for power-user scenarios:"]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Scenario"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Action"})]})}),e.jsx("tbody",{className:"text-content-secondary divide-y divide-border/50",children:[["Debugging a flaky test","Turn OFF Code Corpus — forces fresh AI generation"],["Healing keeps suggesting a bad fix","Turn OFF Healing Corpus — clears bad fix influence"],["Major app redesign","Turn OFF RAG entirely — old memory is misleading"],["Want deterministic CI runs","Disable RAG in CI, keep ON locally"],["Error warnings are outdated","Turn OFF Error Catalog — stops AI from avoiding selectors that are fine now"]].map(([s,r])=>e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:s}),e.jsx("td",{className:"py-1.5",children:r})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Settings Reference"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Go to ",e.jsx("strong",{children:"Settings → RAG Memory"})," to configure:"]}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Enable RAG"})," — Master switch (ON by default)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Code Corpus"})," — Toggle instruction-to-code memory"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Healing Corpus"})," — Toggle healing fix memory"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Error Catalog"})," — Toggle error pattern tracking"]})]})]})},{id:"per-step-retry",title:"Per-Step Retry",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Individual steps can be configured to retry on failure, independent of the global retry setting."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Configuration"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["In the case editor, each step row shows a small ",e.jsx("strong",{children:"×"})," number input next to the timeout. Enter a value from 0–5 to set the retry count for that step. The step-level value overrides the global setting."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Retry Behavior"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"On failure, the step is re-executed up to N times. If any attempt passes, the step is marked as passed. All retry attempts are logged in the step result."})]})},{id:"case-hooks",title:"Case-Level Hooks",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Before and After hooks run additional steps around a test case's main step sequence."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Hooks Tab"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Open a test case and click the ",e.jsx("strong",{children:"Hooks"})," tab (next to Steps). Add before-hooks that run before any steps, and after-hooks that always run even if steps fail."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Use Cases"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsx("li",{children:"Before hook: Login, seed test data, navigate to start URL"}),e.jsx("li",{children:"After hook: Logout, clean up created records, capture diagnostics"})]})]})},{id:"network-mocking",title:"Network Mocking",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Mock steps intercept HTTP requests matching a URL pattern and return a custom response — without touching the real backend."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Creating a Mock Step"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["In the case editor, change the step type dropdown to ",e.jsx("strong",{children:"Mock"}),"."]}),e.jsx("li",{children:"Expand the step to reveal the Mock Route fields."}),e.jsxs("li",{children:["Enter the URL pattern (e.g. ",e.jsx("code",{className:"text-accent",children:"**/api/users"}),"), status code, and JSON body."]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Behavior"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"The mock route is active for the duration of that step and is removed immediately after. Subsequent steps run against the real network."})]})},{id:"audit-lighthouse",title:"Audit & Lighthouse",category:"New Features",content:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Audit suites"})," run full Playwright automation and trigger Google Lighthouse at steps explicitly marked with the ",e.jsx("strong",{children:"⚡ Audit"})," flag. Three categories are measured: Performance, Accessibility, and SEO."]}),e.jsxs("div",{className:"rounded-lg bg-violet-50 border border-violet-200 px-4 py-3 text-sm text-violet-800",children:[e.jsx("strong",{children:"Chromium only"}),' — Lighthouse uses Chrome DevTools Protocol (CDP). Firefox and WebKit runs will show a "not available" notice instead.']}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"How It Works"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["Create an ",e.jsx("strong",{children:"Audit"})," suite in the Test Editor."]}),e.jsxs("li",{children:["Mark one or more steps with the ",e.jsx("strong",{children:"⚡ Audit"})," button to designate Lighthouse checkpoints."]}),e.jsxs("li",{children:["In the ",e.jsx("strong",{children:"Non-Functional Checks"})," section on each case, tick ⚡ Performance, ♿ Accessibility, and/or 🔍 SEO."]}),e.jsxs("li",{children:["Run the suite — Lighthouse audits ",e.jsx("code",{className:"text-accent",children:"page.url()"})," at each marked step."]}),e.jsx("li",{children:"Results are saved to the run report with color-coded scores."})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Collected Metrics"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{label:"Performance Score",range:"0–100",good:"≥ 90",desc:"Overall Lighthouse score"},{label:"FCP",range:"ms",good:"< 1.8s",desc:"First Contentful Paint"},{label:"LCP",range:"ms",good:"< 2.5s",desc:"Largest Contentful Paint"},{label:"CLS",range:"score",good:"< 0.1",desc:"Cumulative Layout Shift"},{label:"TTFB",range:"ms",good:"< 800ms",desc:"Time to First Byte"},{label:"TBT",range:"ms",good:"< 200ms",desc:"Total Blocking Time"},{label:"Speed Index",range:"ms",good:"< 3.4s",desc:"Visual load speed"},{label:"TTI",range:"ms",good:"< 3.8s",desc:"Time to Interactive"},{label:"INP",range:"ms",good:"< 200ms",desc:"Interaction to Next Paint"}].map(s=>e.jsxs("div",{className:"rounded-lg border border-border bg-surface-inset/40 px-3 py-2",children:[e.jsx("p",{className:"text-xs font-bold text-content",children:s.label}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:s.desc}),e.jsxs("p",{className:"text-[10px] text-emerald-600 font-medium mt-0.5",children:["Good: ",s.good]})]},s.label))}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Viewing in Reports"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsx("li",{children:"Open the Reports page and expand a completed Audit run."}),e.jsxs("li",{children:["Case rows with Lighthouse data show three tab buttons: ",e.jsx("strong",{children:"⚡ Speed"}),", ",e.jsx("strong",{children:"♿ A11y"}),", ",e.jsx("strong",{children:"🔍 SEO"}),"."]}),e.jsx("li",{children:"Click a tab to view the score and metrics for that category."}),e.jsx("li",{children:"Case rows are highlighted red when any score is Poor (< 50)."})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Allure Attachments"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"Each Audit case produces three separate HTML attachments in the Allure report: Performance Report, Accessibility Report, and SEO Report. The Allure test status is set to FAILED if any score is below 50."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Color Thresholds"}),e.jsxs("div",{className:"flex gap-4 text-sm",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-3 h-3 rounded-full bg-emerald-500 inline-block"})," Good (90–100)"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-3 h-3 rounded-full bg-amber-400 inline-block"})," Needs Work (50–89)"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-3 h-3 rounded-full bg-red-500 inline-block"})," Poor (0–49) — test FAILS"]})]})]})},{id:"visual-regression",title:"Visual Regression",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["Visual regression testing compares step screenshots against saved baselines to detect unintended UI changes. Configure in ",e.jsx("strong",{children:"Settings"})," → Visual Regression. Review results in ",e.jsx("strong",{children:"Reports"})," → Visual Diffs / Baselines tabs."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Setup"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["Go to ",e.jsx("strong",{children:"Settings"})," → Visual Regression and enable it."]}),e.jsxs("li",{children:["In the ",e.jsx("strong",{children:"Test Editor"}),", click the ",e.jsx("strong",{children:"Eye icon"})," on steps you want to compare visually."]}),e.jsx("li",{children:"Run your tests — first run creates baselines automatically."})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Reviewing Diffs"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["After runs, go to ",e.jsx("strong",{children:"Reports"})," → ",e.jsx("strong",{children:"Visual Diffs"})," tab to review side-by-side comparisons. Approve intentional changes or reject bugs. Manage all baselines in the ",e.jsx("strong",{children:"Baselines"})," tab."]})]})},{id:"test-impact",title:"Test Impact Analysis",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Test Impact Analysis identifies which test cases might be affected by the current set of uncommitted file changes."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Running Analysis"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["Open the ",e.jsx("strong",{children:"Git Control Center"}),"."]}),e.jsxs("li",{children:["Expand the ",e.jsx("strong",{children:"Test Impact Analysis"})," section."]}),e.jsxs("li",{children:["Click ",e.jsx("strong",{children:"Analyze Impact"}),"."]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"How It Works"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"Changed file names and paths are compared against test case names, step instructions, and suite names. Matched cases are listed with the matched file as the reason."})]})},{id:"device-emulation",title:"Device Emulation",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["Device Emulation lets you test your application as it appears on real mobile phones and tablets, using Playwright's built-in device descriptor registry. No manual viewport tuning needed — the correct user-agent, device pixel ratio, viewport, touch events, and ",e.jsx("code",{className:"text-[10px] bg-surface-inset px-1 py-0.5 rounded",children:"isMobile"})," flag are all applied automatically."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Using in Studio (Run Config)"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["Go to the ",e.jsx("strong",{children:"Run Config"})," page."]}),e.jsxs("li",{children:["Find the ",e.jsx("strong",{children:"Device Emulation"})," card below the Browsers card."]}),e.jsxs("li",{children:["Use the tabs to filter by ",e.jsx("strong",{children:"All / Desktop / Mobile / Tablet"}),"."]}),e.jsx("li",{children:"Click a device card to select it — it highlights in teal."}),e.jsxs("li",{children:["Click ",e.jsx("strong",{children:"Start Run"})," — the device is applied to every case in the run."]}),e.jsxs("li",{children:["To clear, click the ",e.jsx("strong",{children:"×"})," in the card header or select ",e.jsx("strong",{children:"No Emulation"}),"."]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Using from CLI / CI"}),e.jsx("pre",{className:"bg-[#1e1e2e] text-[#cdd6f4] text-[10px] font-mono p-3 rounded-lg overflow-x-auto leading-relaxed",children:`# Mobile
|
|
1001
|
+
npx assuremind run --all --device "iPhone 15 Pro" --browser chromium --ci
|
|
1002
|
+
npx assuremind run --tag smoke --device "Pixel 7" --browser chromium --ci
|
|
1003
|
+
|
|
1004
|
+
# Tablet
|
|
1005
|
+
npx assuremind run --all --device "iPad Pro 11" --browser webkit --ci
|
|
1006
|
+
npx assuremind run --suite "Mobile" --device "Galaxy Tab S4" --browser chromium --ci
|
|
1007
|
+
|
|
1008
|
+
# Permanent default in autotest.config.ts
|
|
1009
|
+
device: 'iPhone 15 Pro'`}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Available Devices"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Device"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Category"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Viewport"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Best Browser"})]})}),e.jsx("tbody",{className:"text-content-secondary divide-y divide-border/50",children:[["iPhone 15 Pro","Mobile","393×852","Chromium / WebKit"],["iPhone 15","Mobile","390×844","Chromium / WebKit"],["iPhone 14","Mobile","390×844","Chromium / WebKit"],["iPhone SE","Mobile","375×667","Chromium / WebKit"],["Pixel 7","Mobile","412×915","Chromium"],["Pixel 5","Mobile","393×851","Chromium"],["Galaxy S9+","Mobile","320×658","Chromium"],["Galaxy S8","Mobile","360×740","Chromium"],["iPad Pro 11","Tablet","834×1194","WebKit / Chromium"],["iPad (gen 7)","Tablet","810×1080","WebKit / Chromium"],["iPad Mini","Tablet","768×1024","WebKit / Chromium"],["Galaxy Tab S4","Tablet","712×1138","Chromium"]].map(([s,r,a,o])=>e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 pr-4 font-mono text-[10px]",children:s}),e.jsx("td",{className:"py-1.5 pr-4",children:r}),e.jsx("td",{className:"py-1.5 pr-4",children:a}),e.jsx("td",{className:"py-1.5",children:o})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"In Reports"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"When a run uses device emulation, each case row in Reports shows a teal device badge (📱 phone / tablet icon) with the device name, so you can instantly tell mobile runs from desktop runs."}),e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg px-3 py-2 text-[11px] text-amber-700",children:["⚠ Mobile and tablet device descriptors work best with ",e.jsx("strong",{children:"Chromium"}),". Firefox and WebKit do not fully support Playwright's mobile emulation flags (touch events, mobile UA)."]})]})},{id:"test-recorder",title:"Test Recorder",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["The Test Recorder lets you create tests by interacting with your application in a real browser — ",e.jsx("strong",{children:"no coding, no AI, no cost"}),". Click, fill forms, navigate pages, and every action becomes a test step with verified Playwright code. Available for ",e.jsx("strong",{children:"UI"})," and ",e.jsx("strong",{children:"Audit"})," suites only (not API suites)."]}),e.jsxs("div",{className:"rounded-lg bg-red-50 border border-red-200 px-4 py-3 text-sm text-red-800",children:[e.jsx("strong",{children:"Zero AI, zero cost"})," — the recorder resolves locators against Playwright's live accessibility tree. No API keys or AI calls needed."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"How to Record"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["Open a test case in the ",e.jsx("strong",{children:"Test Editor"}),"."]}),e.jsxs("li",{children:["Click the red ",e.jsx("strong",{children:"Record"}),' button (between "Add Step" and "Generate All").']}),e.jsx("li",{children:"A headed Chromium browser opens your app's base URL."}),e.jsxs("li",{children:["Interact naturally — click buttons, fill forms, navigate pages. ",e.jsx("strong",{children:"Iframes are handled automatically."})]}),e.jsx("li",{children:"Each action appears in the live preview panel in real time."}),e.jsxs("li",{children:["Click ",e.jsx("strong",{children:"Stop Recording"})," when done — all actions become steps with pre-generated code."]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Assertion Shortcuts"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Shortcut"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Type"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Behavior"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Example Output"})]})}),e.jsx("tbody",{className:"text-content-secondary divide-y divide-border/50",children:[["Shift+Click","Hard assertion","Test stops on failure","expect(page.getByRole('heading', { name: 'Dashboard' })).toBeVisible()"],["Ctrl+Shift+Click","Soft assertion","Test continues, failures collected","expect.soft(page.getByRole('heading', { name: 'Dashboard' })).toBeVisible()"],["Ctrl+Shift+U","URL check","Hard assertion","expect(page).toHaveURL(/dashboard/)"],["Ctrl+Shift+T","Title check","Hard assertion","expect(page).toHaveTitle(/Dashboard/)"]].map(([s,r,a,o])=>e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-surface-inset border border-border text-[10px] font-mono",children:s})}),e.jsx("td",{className:"py-1.5 pr-4",children:r}),e.jsx("td",{className:"py-1.5 pr-4",children:a}),e.jsx("td",{className:"py-1.5 font-mono text-[10px] text-accent",children:o})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Hard vs Soft Assertions"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Type"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Keyword"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Behavior"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"When to use"})]})}),e.jsx("tbody",{className:"text-content-secondary divide-y divide-border/50",children:[["Hard","Verify ...","Test stops immediately on failure","Critical checks — login worked, page loaded"],["Soft","Soft verify ...","Test continues, all failures reported at end","Multiple checks on one page — verify 5 fields are correct"]].map(([s,r,a,o])=>e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:s}),e.jsx("td",{className:"py-1.5 pr-4 font-mono text-[10px]",children:r}),e.jsx("td",{className:"py-1.5 pr-4",children:a}),e.jsx("td",{className:"py-1.5",children:o})]},s))})]})}),e.jsx("p",{className:"text-sm text-content-secondary",children:e.jsx("strong",{children:"Three ways to use soft assertions:"})}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Recorder"})," — Ctrl+Shift+Click instead of Shift+Click"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Plain English"}),' — Start instruction with "Soft verify..." or "Soft check..." or "Soft assert..."']}),e.jsxs("li",{children:[e.jsx("strong",{children:"Step toggle"})," — Click the blue ",e.jsx("strong",{children:"Hard/Soft"})," badge on any assertion step in the editor"]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Locator Resolution (6 Strategies)"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["The recorder queries Playwright's ",e.jsx("strong",{children:"accessibility tree"})," and tries 6 strategies in priority order, verifying each with ",e.jsx("code",{className:"text-accent",children:"count() === 1"}),":"]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"#"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Strategy"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Example"})]})}),e.jsx("tbody",{className:"text-content-secondary divide-y divide-border/50",children:[["1","data-testid","page.getByTestId('login-btn')"],["2","getByRole (exact + level)","page.getByRole('heading', { name: 'Dashboard', level: 1 })"],["3","getByRole (exact)","page.getByRole('button', { name: 'Login' })"],["4","getByLabel","page.getByLabel('Email')"],["5","getByPlaceholder","page.getByPlaceholder('Enter email')"],["6","getByText","page.getByText('Welcome')"],["7","CSS fallback","page.locator('#login-btn')"]].map(([s,r,a])=>e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:s}),e.jsx("td",{className:"py-1.5 pr-4 font-medium",children:r}),e.jsx("td",{className:"py-1.5 font-mono text-[10px] text-accent",children:a})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"What Makes It Stand Out vs Other Recorders"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Feature"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Selenium IDE"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Playwright Codegen"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"AssureMind Recorder"})]})}),e.jsx("tbody",{className:"text-content-secondary divide-y divide-border/50",children:[["Locator quality","CSS/XPath","Good","Best — 6 strategies, verified"],["Accessibility tree","No","Partial","Full — every locator checked"],["Iframe support","Partial","Manual","Auto — frameLocator() code"],["Assertions","Manual","Manual","Shift+Click shortcuts"],["Plain-English steps","No","No","Yes — auto-generated"],["Self-healing after","No","No","Yes — 5-level AI cascade"],["RAG memory","No","No","Yes — feeds learning loop"],["Cost","Free","Free","Free"]].map(([s,r,a,o])=>e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:s}),e.jsx("td",{className:"py-1.5 pr-4",children:r}),e.jsx("td",{className:"py-1.5 pr-4",children:a}),e.jsx("td",{className:"py-1.5 font-medium text-emerald-600",children:o})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Biggest Pain Points in Test Automation — Solved"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Pain Point"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"How Recorder Solves It"})]})}),e.jsx("tbody",{className:"text-content-secondary divide-y divide-border/50",children:[["Writing tests is slow","Record a full test in 30 seconds"],["Selectors break constantly","Locators verified against Playwright's accessibility tree in real time"],["AI costs money","Recording + code generation = $0, zero AI calls"],["Non-technical testers can't write tests","Anyone who can click a browser can create tests"],["Assertions are hard to write","Shift+Click for visibility, Ctrl+Shift+U for URL, Ctrl+Shift+T for title"],["Recorded tests are fragile","6-strategy locator resolution + post-run 5-level self-healing"],["Apps use iframes (SAP, Salesforce)","Auto-detects iframes, generates frameLocator() chains"]].map(([s,r])=>e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:s}),e.jsx("td",{className:"py-1.5",children:r})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Iframe Support"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["The recorder automatically handles ",e.jsx("strong",{children:"same-origin iframes"})," — common in enterprise apps like SAP, Salesforce, and embedded widgets:"]}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["Capture script injected into ",e.jsx("strong",{children:"all frames"})," (main page + every iframe)"]}),e.jsxs("li",{children:["Elements inside iframes produce ",e.jsx("code",{className:"text-accent",children:"frameLocator()"})," chains automatically"]}),e.jsxs("li",{children:["Example: ",e.jsxs("code",{className:"text-accent text-[10px]",children:["page.frameLocator('#content-frame').getByRole('button', ","{"," name: 'Submit' ","}",").click()"]})]}),e.jsxs("li",{children:["Dynamically loaded iframes detected via ",e.jsx("code",{className:"text-accent",children:"frameattached"})," events"]}),e.jsx("li",{children:"Recording banner only appears in the main frame"}),e.jsxs("li",{children:[e.jsx("strong",{children:"Limitation:"})," Cross-origin iframes (different domain) cannot be instrumented due to browser security"]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Technical Details"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["Uses ",e.jsx("code",{className:"text-accent",children:"context.exposeBinding()"})," — communication survives all page navigations and works across all frames"]}),e.jsxs("li",{children:["Input values captured on ",e.jsx("strong",{children:"blur"})," (when user leaves the field), not on keystrokes — no duplicate steps"]}),e.jsxs("li",{children:["Capture script re-injected on every page load via ",e.jsx("code",{className:"text-accent",children:"page.on('load')"})," and into child frames via ",e.jsx("code",{className:"text-accent",children:"frameattached"})," + ",e.jsx("code",{className:"text-accent",children:"framenavigated"})]}),e.jsxs("li",{children:["Recorded steps use the ",e.jsx("strong",{children:"recorder"})," strategy tag, distinguishing them from AI-generated code"]}),e.jsx("li",{children:'All recorded steps are immediately runnable — no "Generate Code" step required'})]})]})},{id:"keyboard-shortcuts",title:"Keyboard Shortcuts",category:"Reference",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["Press ",e.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-surface-inset border border-border text-[10px]",children:"?"})," anywhere in the app to open the shortcuts modal."]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Shortcut"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Action"})]})}),e.jsx("tbody",{className:"text-content-secondary",children:[["?","Show keyboard shortcuts"],["Ctrl+K / Cmd+K","Open search palette"],["Escape","Close modal / dialog"],["Enter (step input)","Add new step"],["Enter (case name)","Save case"],["Shift+Click (case row)","Range-select cases"]].map(([s,r])=>e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-surface-inset border border-border text-[10px] font-mono",children:s})}),e.jsx("td",{className:"py-1.5",children:r})]},s))})]})})]})},{id:"data-driven",title:"Data-Driven Testing",category:"Reference",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Test cases support data-driven execution — running the same case multiple times with different input data."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Data Sources"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Inline JSON"})," — Enter an array of objects directly in the editor"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"JSON File"})," — Reference a ",e.jsx("code",{className:"text-accent",children:".json"})," file in your project"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"CSV File"})," — Reference a ",e.jsx("code",{className:"text-accent",children:".csv"})," file with headers"]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Accessing Data"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Use ",e.jsx("code",{className:"text-accent",children:"{{row.fieldName}}"})," in step instructions to reference data columns. The case runs once per row."]})]})},{id:"faker-data",title:"Faker / Dynamic Data",category:"Reference",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Faker tokens generate random, realistic test data at runtime. Use them to avoid hardcoded values in test steps."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Available Tokens"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:["faker.email","faker.name","faker.phone","faker.company","faker.uuid","faker.date","faker.number","faker.word"].map(s=>e.jsx("code",{className:"text-[10px] bg-surface-inset rounded px-2 py-0.5 border border-border text-accent font-mono",children:`{{${s}}}`},s))}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Usage"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Type the token directly in a step instruction, or use the ",e.jsx("strong",{children:"Dynamic Data Picker"})," button next to the step input to insert tokens at the cursor position."]})]})},{id:"api-reference",title:"API Reference",category:"Reference",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["AssureMind exposes a REST API at ",e.jsx("code",{className:"text-accent",children:"http://localhost:4400/api"})," for programmatic access."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Key Endpoints"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Endpoint"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Description"})]})}),e.jsx("tbody",{className:"text-content-secondary font-mono",children:[["GET /suites","List all test suites"],["POST /suites","Create a suite"],["GET /suites/:id/cases","List cases in a suite"],["POST /suites/:id/cases","Create a test case"],["POST /run","Start a test run"],["GET /results","List run results"],["GET /flakiness","Get flakiness report"],["GET /step-library","List library steps"],["GET /git/impact","Run test impact analysis"]].map(([s,r])=>e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("td",{className:"py-1.5 pr-4 text-accent text-[10px]",children:s}),e.jsx("td",{className:"py-1.5 font-sans",children:r})]},s))})]})})]})},{id:"faker-data",title:"Faker Data",category:"Enterprise Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Faker Data gives you 100+ realistic data generators across 16 categories, powered by faker.js. Every token produces fresh random values on each test run — no hardcoded data, no duplicates, no code required."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Token Format"}),e.jsxs("p",{children:["Use the pattern ",e.jsx("code",{className:"text-accent",children:"{{FAKE_CATEGORY_METHOD}}"})," anywhere in a step value. The engine replaces it with a random value at runtime."]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Token"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Example Output"})]})}),e.jsx("tbody",{className:"text-content-secondary",children:[["{{FAKE_PERSON_FULLNAME}}","Sarah Johnson"],["{{FAKE_INTERNET_EMAIL}}","sarah.johnson42@example.com"],["{{FAKE_PHONE_NUMBER}}","(555) 867-5309"],["{{FAKE_LOCATION_CITY}}","Portland"],["{{FAKE_COMPANY_NAME}}","Acme Corp"],["{{FAKE_FINANCE_CREDITCARDNUMBER}}","4111-XXXX-XXXX-1234"],["{{FAKE_COMMERCE_PRODUCTNAME}}","Ergonomic Steel Chair"],["{{FAKE_VEHICLE_MODEL}}","Mustang"]].map(([s,r])=>e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{className:"text-accent",children:s})}),e.jsx("td",{className:"py-1.5",children:r})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"16 Categories"}),e.jsxs("p",{children:[e.jsx("code",{className:"text-accent",children:"person"}),","," ",e.jsx("code",{className:"text-accent",children:"internet"}),","," ",e.jsx("code",{className:"text-accent",children:"phone"}),","," ",e.jsx("code",{className:"text-accent",children:"location"}),","," ",e.jsx("code",{className:"text-accent",children:"company"}),","," ",e.jsx("code",{className:"text-accent",children:"finance"}),","," ",e.jsx("code",{className:"text-accent",children:"date"}),","," ",e.jsx("code",{className:"text-accent",children:"lorem"}),","," ",e.jsx("code",{className:"text-accent",children:"string"}),","," ",e.jsx("code",{className:"text-accent",children:"number"}),","," ",e.jsx("code",{className:"text-accent",children:"datatype"}),","," ",e.jsx("code",{className:"text-accent",children:"image"}),","," ",e.jsx("code",{className:"text-accent",children:"color"}),","," ",e.jsx("code",{className:"text-accent",children:"commerce"}),","," ",e.jsx("code",{className:"text-accent",children:"vehicle"}),","," ",e.jsx("code",{className:"text-accent",children:"system"})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Legacy Tokens (Backward-Compatible)"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"These shorthand tokens from earlier versions still work and map to their modern equivalents:"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Legacy Token"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Maps To"})]})}),e.jsx("tbody",{className:"text-content-secondary",children:[["FAKE_FIRST_NAME","{{FAKE_PERSON_FIRSTNAME}}"],["FAKE_LAST_NAME","{{FAKE_PERSON_LASTNAME}}"],["FAKE_AGE","{{FAKE_NUMBER_INT}} (18-65)"],["FAKE_EMAIL","{{FAKE_INTERNET_EMAIL}}"],["FAKE_PHONE","{{FAKE_PHONE_NUMBER}}"],["FAKE_PASSWORD","{{FAKE_INTERNET_PASSWORD}}"],["FAKE_NUMBER_N","{{FAKE_NUMBER_INT}} (0-N)"]].map(([s,r])=>e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{className:"text-accent",children:s})}),e.jsx("td",{className:"py-1.5",children:e.jsx("code",{className:"text-accent",children:r})})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Auto-Refresh"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"Every faker token is resolved at the start of each test run, producing completely fresh random values. No caching, no repeats across runs — ideal for tests that require unique data on every execution."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Modal UI — Multi-Select & Insert"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Click the ",e.jsx("code",{className:"text-accent",children:"fx"})," button on any step input to open the Faker Data picker. The modal lets you search across all 100+ generators, browse by category, and preview sample output."]}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["The picker supports ",e.jsx("strong",{children:"multi-select"})," — click any generator to select it (checkmark + violet highlight). Selected tokens appear as ",e.jsx("strong",{children:"removable chips"})," ","in a bar at the bottom of the modal. For Random Number, use the"," ",e.jsx("code",{className:"text-accent",children:"+ Add"})," button to add it to your selection."]}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Insert N tokens"})," — inserts all selected tokens comma-separated into the step instruction."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Clear all"})," — removes every selection from the chip bar."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Cancel"})," — closes the modal without inserting anything."]})]}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Example: selecting ",e.jsx("code",{className:"text-accent",children:"firstName"}),","," ",e.jsx("code",{className:"text-accent",children:"lastName"}),", and"," ",e.jsx("code",{className:"text-accent",children:"email"})," inserts:"," ",e.jsx("code",{className:"text-accent",children:"{{FAKE_PERSON_FIRSTNAME}}, {{FAKE_PERSON_LASTNAME}}, {{FAKE_INTERNET_EMAIL}}"})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Use Cases"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Form filling"})," — Populate any form with realistic names, emails, addresses, and phone numbers in one step."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Registration testing"}),' — Generate unique users every run so you never hit "email already exists" errors.']}),e.jsxs("li",{children:[e.jsx("strong",{children:"Data-driven testing"})," — Combine faker tokens with data loops to generate hundreds of unique test rows automatically."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Finance workflows"})," — Random credit card numbers, IBAN codes, and currency amounts for payment flow tests."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"E-commerce"})," — Product names, prices, and quantities for realistic order flow coverage."]})]})]})},{id:"file-upload-download",title:"File Upload & Download",category:"Enterprise Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Handle file inputs and downloads with no boilerplate — upload fixtures from the Studio and let the framework capture downloads automatically."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Uploading files"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["In the ",e.jsx("strong",{children:"Test Editor"}),", click the ",e.jsx("strong",{children:"Files"})," button (next to ",e.jsx("em",{children:"Fake Data"}),")."]}),e.jsxs("li",{children:["Choose a file — it's saved in your repo at ",e.jsx("code",{className:"text-accent",children:"fixtures/uploads/"})," (committed, CI-portable)."]}),e.jsxs("li",{children:["Click the file to insert a ",e.jsx("code",{className:"text-accent",children:"{{FILE:name}}"})," token into the step."]})]}),e.jsx("p",{className:"text-sm text-content-secondary",children:"The token resolves to the file's path at runtime:"}),e.jsx("pre",{className:"text-[11px] bg-surface-inset rounded-lg px-4 py-3 overflow-x-auto border border-border font-mono",children:`Step: Upload {{FILE:resume.pdf}} to the Resume field
|
|
1010
|
+
Code: await page.getByLabel('Resume').setInputFiles('{{FILE:resume.pdf}}');
|
|
1011
|
+
|
|
1012
|
+
// File-chooser button (keep listener + click in ONE step):
|
|
1013
|
+
const fileChooserPromise = page.waitForEvent('filechooser');
|
|
1014
|
+
await page.getByRole('button', { name: 'Choose File' }).click();
|
|
1015
|
+
(await fileChooserPromise).setFiles('{{FILE:resume.pdf}}');`}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Inside an iframe, wrap with ",e.jsx("code",{className:"text-accent",children:"frameLocator(...)"})," as usual."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Waiting for the upload"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:[e.jsx("code",{className:"text-accent",children:"setInputFiles"}),' only attaches the file — there is no universal "upload done" event, so the step waits for a completion signal: a success indicator if you name one, otherwise the network settling.']}),e.jsx("p",{className:"text-sm text-content-secondary",children:"Example upload steps:"}),e.jsx("pre",{className:"text-[11px] bg-surface-inset rounded-lg px-4 py-3 overflow-x-auto border border-border font-mono",children:`Upload {{FILE:resume.pdf}} to the Resume field
|
|
1016
|
+
Upload {{FILE:resume.pdf}} to the Resume field and wait for 'Upload complete' // most reliable
|
|
1017
|
+
Upload {{FILE:photo.png}} // page's file input`}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Downloads (auto-captured)"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["No special code needed — just trigger the download with a click. The step waits until the file finishes downloading, and the runner automatically saves every download to"," ",e.jsx("code",{className:"text-accent",children:"results/downloads/<runId>/"}),". Do ",e.jsx("strong",{children:"not"})," use"," ",e.jsx("code",{className:"text-accent",children:"download.saveAs()"})," or ",e.jsx("code",{className:"text-accent",children:"fs"})," in steps — the sandbox blocks them and it isn't needed."]}),e.jsx("p",{className:"text-sm text-content-secondary",children:"Example download steps:"}),e.jsx("pre",{className:"text-[11px] bg-surface-inset rounded-lg px-4 py-3 overflow-x-auto border border-border font-mono",children:`Download the "Export CSV" link
|
|
1018
|
+
Click the "Export" button to download
|
|
1019
|
+
Download the file by clicking "Report PDF"
|
|
1020
|
+
Click "Download invoice" and wait for download`}),e.jsx("p",{className:"text-sm text-content-secondary",children:"Each generates a wait so the step passes only once the download is complete:"}),e.jsx("pre",{className:"text-[11px] bg-surface-inset rounded-lg px-4 py-3 overflow-x-auto border border-border font-mono",children:`const downloadPromise = page.waitForEvent('download');
|
|
1021
|
+
await page.getByRole('link', { name: 'Export CSV' }).click();
|
|
1022
|
+
const download = await downloadPromise;
|
|
1023
|
+
await download.path(); // resolves once the download is complete`}),e.jsx("p",{className:"text-sm text-content-secondary",children:"To view captured files:"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["Open ",e.jsx("strong",{children:"Reports → Run Reports"})," and expand the run."]}),e.jsxs("li",{children:["A ",e.jsx("strong",{children:"Downloads"})," panel lists every file captured during that run."]}),e.jsx("li",{children:"Click any file to save it to your local machine."})]}),e.jsx("p",{className:"text-sm text-content-secondary",children:"The panel appears only when the run produced downloads."})]})},{id:"visual-regression-docs",title:"Visual Regression",category:"Enterprise Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["Visual Regression performs pixel-perfect screenshot comparison using"," ",e.jsx("code",{className:"text-accent",children:"pixelmatch"}),". Enable it on any test step to automatically detect unintended UI changes between runs."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Workflow"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["Enable visual regression in ",e.jsx("strong",{children:"Settings"})," → Visual Regression."]}),e.jsxs("li",{children:["Click the ",e.jsx("strong",{children:"Eye icon"})," on steps in the Test Editor to enable per-step comparison."]}),e.jsxs("li",{children:["First run captures ",e.jsx("strong",{children:"baseline"})," screenshots."]}),e.jsx("li",{children:"Subsequent runs compare against baselines using pixelmatch."}),e.jsx("li",{children:"If the diff exceeds the threshold the step fails with a visual diff image."}),e.jsxs("li",{children:["Review in ",e.jsx("strong",{children:"Reports"})," → Visual Diffs tab → ",e.jsx("strong",{children:"Approve"})," or ",e.jsx("strong",{children:"Reject"}),"."]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Configuration"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Setting"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Description"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Default"})]})}),e.jsx("tbody",{className:"text-content-secondary",children:[["Enabled","Master toggle for visual regression","Off"],["Threshold","Pixel diff percentage to fail","0.5%"],["Full Page","Capture entire scrollable page","Off"],["Mask Selectors","CSS selectors for areas to ignore (e.g. ads, clocks)","Empty"]].map(([s,r,a])=>e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("td",{className:"py-1.5 pr-4",children:s}),e.jsx("td",{className:"py-1.5 pr-4",children:r}),e.jsx("td",{className:"py-1.5",children:a})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Use Cases"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"CSS refactor"})," — Verify no visual regressions across all pages after style changes."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Multi-browser"})," — Separate baselines per browser and viewport combination."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Design review"})," — Catch layout shifts, missing elements, and colour changes automatically."]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Where Files Live"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Baselines"})," — ",e.jsx("code",{className:"text-accent",children:"baselines/{suite}/{case}/{step}-{browser}-{viewport}.png"})," (commit to git)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Diffs"})," — ",e.jsx("code",{className:"text-accent",children:"results/visual-diffs/{runId}/"})," (gitignored)"]})]})]})},{id:"ci-integration",title:"CI/CD Integration",category:"Enterprise Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"CI/CD Integration connects AssureMind to your delivery pipeline with quality gates, PR comments, and notifications."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"CI Config Generator"}),e.jsxs("p",{children:["From ",e.jsx("strong",{children:"Run Config → Generate CI Config"}),", generate a pipeline file for",e.jsx("strong",{children:" GitHub Actions"}),", ",e.jsx("strong",{children:"GitLab CI"}),", or ",e.jsx("strong",{children:"Jenkins"})," based on your current run settings (browsers, parallelism, device)."]}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["The YAML opens in a ",e.jsx("strong",{children:"preview"}),". Click ",e.jsx("strong",{children:"Edit"})," to customise it (branches, Node version, extra steps); your edits apply to Copy, Download, and Write to repo. ",e.jsx("strong",{children:"Reset"})," regenerates from the run config."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Copy"})," and ",e.jsx("strong",{children:"Download"})," are always available."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Write to repo"})," (opt-in) writes the file into your project at its standard path (",e.jsx("code",{className:"text-accent",children:".github/workflows/assuremind.yml"}),", ",e.jsx("code",{className:"text-accent",children:".gitlab-ci.yml"}),", or ",e.jsx("code",{className:"text-accent",children:"Jenkinsfile"}),"). It only ",e.jsx("strong",{children:"writes the file"})," — it does ",e.jsx("strong",{children:"not"})," commit or push. Review and commit it from the ",e.jsx("strong",{children:"Git Control Center"}),"."]}),e.jsxs("li",{children:["Enable the button in ",e.jsx("strong",{children:'Settings → CI/CD Integration → "Write CI files to repo"'})," (off by default)."]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Quality Gates"}),e.jsxs("p",{children:["Define thresholds — minimum pass rate, maximum duration, required tags that must pass. The pipeline exits ",e.jsx("code",{className:"text-accent",children:"1"})," if any gate fails, blocking the merge or deploy."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"PR Comments"}),e.jsx("p",{children:"Auto-post test results as a GitHub PR comment or GitLab MR note with a metrics table, failed test details, and healing summary."}),e.jsx("pre",{className:"text-[11px] bg-surface-inset rounded-lg px-4 py-3 overflow-x-auto border border-border font-mono",children:`## AssureMind Test Results
|
|
1024
|
+
| Metric | Value |
|
|
1025
|
+
|--------------|--------------|
|
|
1026
|
+
| Pass Rate | 95% (47/50) |
|
|
1027
|
+
| Failed | 3 |
|
|
1028
|
+
| Duration | 4m 32s |
|
|
1029
|
+
| Quality Gate | ✅ Passed |`}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Notifications"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Channel"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"How It Works"})]})}),e.jsx("tbody",{className:"text-content-secondary",children:[["Slack","Webhook URL → Block Kit message on failure or every run"],["Microsoft Teams","Webhook → Adaptive Card with run summary"],["Email","SMTP or SendGrid (placeholder)"],["Custom Webhook","POST JSON payload to any URL you configure"]].map(([s,r])=>e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("td",{className:"py-1.5 pr-4",children:s}),e.jsx("td",{className:"py-1.5",children:r})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Use Cases"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"PR workflow"})," — Tests run → quality gate evaluates → PR comment posted → Slack alert on failure."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Nightly regression"})," — Full suite runs on schedule, results pushed to Teams channel."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Deploy pipeline"})," — Deploy → wait for healthy → run smoke tests → notify team."]})]})]})}],Iw=Array.from(new Set(wi.map(s=>s.category)));function Dw(){const[s,r]=p.useState(wi[0].id),a=p.useRef({}),o=p.useRef(null);p.useEffect(()=>{const u=[];return wi.forEach(x=>{const h=a.current[x.id];if(!h)return;const f=new IntersectionObserver(([g])=>{g.isIntersecting&&r(x.id)},{root:o.current,rootMargin:"-20% 0px -60% 0px",threshold:0});f.observe(h),u.push(f)}),()=>u.forEach(x=>x.disconnect())},[]);const c=u=>{const x=a.current[u];if(x&&o.current){const h=o.current,f=x.offsetTop-24;h.scrollTo({top:f,behavior:"smooth"})}};return e.jsxs("div",{className:"flex h-full overflow-hidden bg-background",children:[e.jsx("aside",{className:"w-56 flex-shrink-0 border-r border-border bg-surface overflow-y-auto hidden lg:block",children:e.jsxs("div",{className:"px-4 py-4",children:[e.jsx("h2",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest mb-3",children:"Documentation"}),e.jsx("nav",{className:"space-y-0.5",children:Iw.map(u=>e.jsxs("div",{className:"mb-3",children:[e.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest px-2 py-1",children:u}),wi.filter(x=>x.category===u).map(x=>e.jsx("button",{type:"button",onClick:()=>c(x.id),className:O("w-full text-left px-2 py-1.5 rounded-lg text-xs transition-colors",s===x.id?"bg-accent/8 text-accent font-semibold":"text-content-secondary hover:text-content hover:bg-surface-inset"),children:x.title},x.id))]},u))})]})}),e.jsx("div",{ref:o,className:"flex-1 overflow-y-auto",children:e.jsx("div",{className:"max-w-2xl mx-auto px-6 py-6 space-y-0",children:wi.map(u=>e.jsxs("section",{id:u.id,ref:x=>{x&&(a.current[u.id]=x)},className:"mb-10 scroll-mt-6",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:u.category}),e.jsx("h2",{className:"text-base font-bold text-content mt-0.5",children:u.title})]}),e.jsx("div",{className:"text-sm text-content-secondary leading-relaxed",children:u.content}),e.jsx("div",{className:"mt-8 border-b border-border"})]},u.id))})})]})}const nl={getConfig:()=>fetch("/api/ci-integration/config").then(s=>s.json()),saveConfig:s=>fetch("/api/ci-integration/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).then(r=>r.json()),getQualityGates:()=>fetch("/api/ci-integration/quality-gates").then(s=>s.json()),testNotification:s=>fetch("/api/ci-integration/test-notification",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channel:s})}).then(r=>r.json())};function bi({checked:s,onChange:r,label:a,description:o}){return e.jsxs("label",{className:"flex items-center justify-between gap-3 cursor-pointer group",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-content",children:a}),o&&e.jsx("p",{className:"text-[10px] text-content-tertiary mt-0.5",children:o})]}),e.jsx("button",{type:"button",role:"switch","aria-checked":s,onClick:()=>r(!s),className:`relative w-9 h-5 rounded-full transition-colors ${s?"bg-accent":"bg-gray-300 dark:bg-gray-600"}`,children:e.jsx("span",{className:`absolute top-0.5 left-0.5 w-4 h-4 rounded-full bg-white shadow transition-transform ${s?"translate-x-4":""}`})})]})}function Rs({children:s}){return e.jsx("label",{className:"block text-[10px] font-semibold text-content-tertiary uppercase tracking-wider mb-1",children:s})}function Fw({value:s,onChange:r}){const a=[{key:"every-run",label:"On every run"},{key:"failure",label:"On failure only"},{key:"healing",label:"On healing events"}];return e.jsx("div",{className:"flex flex-wrap gap-3",children:a.map(o=>e.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:s.includes(o.key),onChange:c=>{c.target.checked?r([...s,o.key]):r(s.filter(u=>u!==o.key))},className:"w-3.5 h-3.5 rounded border-border text-accent focus:ring-accent/30"}),e.jsx("span",{className:"text-xs text-content-secondary",children:o.label})]},o.key))})}function Lw(){const s=Re(),[r,a]=p.useState("slack"),{data:o,isLoading:c}=Oe({queryKey:["ci-integration-config"],queryFn:nl.getConfig}),{data:u=[]}=Oe({queryKey:["ci-integration-quality-gates"],queryFn:nl.getQualityGates}),x=oe({mutationFn:nl.saveConfig,onSuccess:()=>{s.invalidateQueries({queryKey:["ci-integration-config"]}),$.success("Configuration saved")},onError:C=>$.error(C.message)}),h=oe({mutationFn:C=>nl.testNotification(C),onSuccess:C=>{C.ok?$.success("Test notification sent"):$.error(C.error??"Failed to send test notification")},onError:C=>$.error(C.message)}),[f,g]=p.useState(null),y=f??o;function N(C){const w=structuredClone(y??o);w&&(C(w),g(w))}function E(){y&&(x.mutate(y),g(null))}const S=f!==null;if(c||!y)return e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx(Me,{size:20,className:"animate-spin text-accent"})});const P=u.slice(0,5),M=[{key:"slack",label:"Slack",icon:pp},{key:"email",label:"Email",icon:Ov},{key:"teams",label:"Teams",icon:xn},{key:"custom",label:"Custom Webhook",icon:tj}];function k(){switch(r){case"slack":return y.notifications.slack;case"email":return y.notifications.email;case"teams":return y.notifications.teams;case"custom":return y.notifications.customWebhook}}function j(C){N(w=>{const F=r==="custom"?w.notifications.customWebhook:w.notifications[r];C(F)})}const v=k(),z=v.enabled&&(r==="email"?(v.recipients?.length??0)>0:r==="custom"?!!v.url:!!v.webhookUrl);return e.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-4xl mx-auto px-5 py-4 space-y-3",children:[e.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-orange-500 to-red-600 flex items-center justify-center shadow-sm shadow-orange-500/20",children:e.jsx(Fl,{size:17,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-sm font-bold text-content",children:"CI/CD Integration"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Quality gates, PR comments, and notifications for your pipeline"})]})]}),S&&e.jsxs("button",{type:"button",onClick:E,disabled:x.isPending,className:"inline-flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-lg bg-accent text-white hover:brightness-110 transition-colors disabled:opacity-50",children:[x.isPending?e.jsx(Me,{size:13,className:"animate-spin"}):e.jsx(He,{size:13}),"Save Changes"]})]})}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center gap-2",children:[e.jsx(Kv,{size:15,className:"text-accent"}),e.jsx("span",{className:"text-xs font-bold text-content",children:"Quality Gate"})]}),e.jsxs("div",{className:"px-4 py-3 space-y-3",children:[e.jsx(bi,{checked:y.qualityGate.enabled,onChange:C=>N(w=>{w.qualityGate.enabled=C}),label:"Enable Quality Gate",description:"Block CI pipeline when thresholds are not met"}),y.qualityGate.enabled&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(Rs,{children:"Min Pass Rate (%)"}),e.jsx("input",{type:"number",min:0,max:100,value:y.qualityGate.minPassRate,onChange:C=>N(w=>{w.qualityGate.minPassRate=Number(C.target.value)}),className:"w-full px-3 py-1.5 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30"})]}),e.jsxs("div",{children:[e.jsx(Rs,{children:"Max Duration (seconds, 0 = unlimited)"}),e.jsx("input",{type:"number",min:0,value:y.qualityGate.maxDuration,onChange:C=>N(w=>{w.qualityGate.maxDuration=Number(C.target.value)}),className:"w-full px-3 py-1.5 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30"})]})]}),e.jsxs("div",{children:[e.jsx(Rs,{children:"Required Tags (comma-separated)"}),e.jsx("input",{type:"text",value:y.qualityGate.requireTags.join(", "),onChange:C=>N(w=>{w.qualityGate.requireTags=C.target.value.split(",").map(F=>F.trim()).filter(Boolean)}),placeholder:"e.g. smoke, critical",className:"w-full px-3 py-1.5 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30"})]})]}),P.length>0&&e.jsxs("div",{className:"pt-2 border-t border-border",children:[e.jsx(Rs,{children:"Recent Quality Gate Results"}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1",children:P.map(C=>e.jsxs("span",{title:`${C.runId} — ${C.passed?"Passed":"Failed"} — ${new Date(C.timestamp).toLocaleString()}`,className:`inline-flex items-center gap-1 text-[10px] px-2 py-0.5 rounded-full ${C.passed?"bg-emerald-50 dark:bg-emerald-900/20 text-emerald-600 dark:text-emerald-400 ring-1 ring-emerald-200 dark:ring-emerald-800":"bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 ring-1 ring-red-200 dark:ring-red-800"}`,children:[C.passed?e.jsx(He,{size:10}):e.jsx(St,{size:10}),new Date(C.timestamp).toLocaleDateString()]},C.runId))})]})]})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center gap-2",children:[e.jsx(pp,{size:15,className:"text-accent"}),e.jsx("span",{className:"text-xs font-bold text-content",children:"PR Comments"})]}),e.jsxs("div",{className:"px-4 py-3 space-y-3",children:[e.jsx(bi,{checked:y.prComments.enabled,onChange:C=>N(w=>{w.prComments.enabled=C}),label:"Enable PR Comments",description:"Post test result summaries on pull requests"}),y.prComments.enabled&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx(Rs,{children:"Provider"}),e.jsxs("select",{value:y.prComments.provider,onChange:C=>N(w=>{w.prComments.provider=C.target.value}),className:"w-full px-3 py-1.5 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30 bg-surface",children:[e.jsx("option",{value:"github",children:"GitHub"}),e.jsx("option",{value:"gitlab",children:"GitLab"}),e.jsx("option",{value:"azure-devops",children:"Azure DevOps"})]})]}),e.jsx(bi,{checked:y.prComments.includeHealingSummary,onChange:C=>N(w=>{w.prComments.includeHealingSummary=C}),label:"Include Healing Summary"}),e.jsx(bi,{checked:y.prComments.includeVisualDiffs,onChange:C=>N(w=>{w.prComments.includeVisualDiffs=C}),label:"Include Visual Diffs"}),e.jsx("div",{className:"rounded-lg bg-blue-50 dark:bg-blue-900/10 border border-blue-200 dark:border-blue-800 px-3 py-2",children:e.jsxs("p",{className:"text-[10px] text-blue-700 dark:text-blue-300",children:["Requires ",e.jsx("code",{className:"font-mono bg-blue-100 dark:bg-blue-800/40 px-1 rounded",children:"GITHUB_TOKEN"})," /"," ",e.jsx("code",{className:"font-mono bg-blue-100 dark:bg-blue-800/40 px-1 rounded",children:"GITLAB_TOKEN"})," set in your CI environment."]})})]})]})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center gap-2",children:[e.jsx(yl,{size:15,className:"text-accent"}),e.jsx("span",{className:"text-xs font-bold text-content",children:"Notifications"})]}),e.jsx("div",{className:"flex border-b border-border",children:M.map(C=>{const w=C.icon,F=r===C.key;return e.jsxs("button",{type:"button",onClick:()=>a(C.key),className:`flex items-center gap-1.5 px-4 py-2.5 text-xs font-medium transition-colors border-b-2 ${F?"border-accent text-accent":"border-transparent text-content-tertiary hover:text-content-secondary"}`,children:[e.jsx(w,{size:13}),C.label]},C.key)})}),e.jsxs("div",{className:"px-4 py-3 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(bi,{checked:v.enabled,onChange:C=>j(w=>{w.enabled=C}),label:`Enable ${M.find(C=>C.key===r)?.label}`}),z?e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] px-2 py-0.5 rounded-full bg-emerald-50 dark:bg-emerald-900/20 text-emerald-600 dark:text-emerald-400 ring-1 ring-emerald-200 dark:ring-emerald-800",children:[e.jsx(He,{size:10})," Connected"]}):e.jsx("span",{className:"inline-flex items-center gap-1 text-[10px] px-2 py-0.5 rounded-full bg-gray-100 dark:bg-gray-800 text-content-tertiary ring-1 ring-border",children:"Not configured"})]}),v.enabled&&e.jsxs(e.Fragment,{children:[r==="slack"&&e.jsxs("div",{children:[e.jsx(Rs,{children:"Webhook URL"}),e.jsx("input",{type:"text",value:y.notifications.slack.webhookUrl??"",onChange:C=>N(w=>{w.notifications.slack.webhookUrl=C.target.value}),placeholder:"https://hooks.slack.com/services/...",className:"w-full px-3 py-1.5 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30"})]}),r==="email"&&e.jsxs("div",{children:[e.jsx(Rs,{children:"Recipients (comma-separated)"}),e.jsx("input",{type:"text",value:(y.notifications.email.recipients??[]).join(", "),onChange:C=>N(w=>{w.notifications.email.recipients=C.target.value.split(",").map(F=>F.trim()).filter(Boolean)}),placeholder:"team@example.com, qa@example.com",className:"w-full px-3 py-1.5 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30"})]}),r==="teams"&&e.jsxs("div",{children:[e.jsx(Rs,{children:"Webhook URL"}),e.jsx("input",{type:"text",value:y.notifications.teams.webhookUrl??"",onChange:C=>N(w=>{w.notifications.teams.webhookUrl=C.target.value}),placeholder:"https://outlook.office.com/webhook/...",className:"w-full px-3 py-1.5 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30"})]}),r==="custom"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx(Rs,{children:"Webhook URL"}),e.jsx("input",{type:"text",value:y.notifications.customWebhook.url??"",onChange:C=>N(w=>{w.notifications.customWebhook.url=C.target.value}),placeholder:"https://api.example.com/webhook",className:"w-full px-3 py-1.5 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30"})]}),e.jsxs("div",{children:[e.jsx(Rs,{children:"Custom Headers (JSON)"}),e.jsx("textarea",{value:JSON.stringify(y.notifications.customWebhook.headers??{},null,2),onChange:C=>{try{const w=JSON.parse(C.target.value);N(F=>{F.notifications.customWebhook.headers=w})}catch{}},rows:3,placeholder:'{"Authorization": "Bearer ..."}',className:"w-full px-3 py-1.5 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30 resize-none font-mono"})]})]}),e.jsxs("div",{children:[e.jsx(Rs,{children:"Notify On"}),e.jsx(Fw,{value:v.on,onChange:C=>j(w=>{w.on=C})})]}),r!=="email"&&e.jsxs("button",{type:"button",onClick:()=>h.mutate(r==="custom"?"custom":r),disabled:h.isPending||!z,className:"inline-flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-lg border border-border text-content-secondary hover:bg-surface-inset transition-colors disabled:opacity-50",children:[h.isPending?e.jsx(Me,{size:12,className:"animate-spin"}):e.jsx(qv,{size:12}),"Send Test Notification"]})]})]})]})]})})})}function _w(s){const r=new Date(s),a=Math.floor((Date.now()-r.getTime())/1e3);if(a<60)return`${a}s ago`;const o=Math.floor(a/60);if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}const Uw={M:{icon:Tf,color:"text-blue-500",bg:"bg-blue-50",ring:"ring-blue-200",label:"Modified"},A:{icon:zf,color:"text-emerald-500",bg:"bg-emerald-50",ring:"ring-emerald-200",label:"Added"},D:{icon:Mf,color:"text-red-500",bg:"bg-red-50",ring:"ring-red-200",label:"Deleted"},"?":{icon:Af,color:"text-content-tertiary",bg:"bg-surface-inset",ring:"ring-border",label:"Untracked"}};function $w(){const{operationInProgress:s,logSteps:r,hasConflict:a,conflictFiles:o}=Bl(),{data:c,isLoading:u}=ex(),{data:x}=Vf(),{data:h,refetch:f}=Wf(20),g=Gf(),y=Qf(),N=Jf(),E=Yf(),S=Xf(),P=Zf(),[M,k]=p.useState(""),[j,v]=p.useState(!0),[z,C]=p.useState(!1),[w,F]=p.useState(!0),[Q,Z]=p.useState(!1),[le,K]=p.useState(!1),{data:J,isFetching:ue,refetch:ke}=Oe({queryKey:["git-impact"],queryFn:()=>ut.impact(),enabled:le,staleTime:0}),re=p.useRef(null),be=!!s,Ne=(c?.modified.length??0)+(c?.added.length??0)+(c?.deleted.length??0)+(c?.untracked.length??0);p.useEffect(()=>{re.current?.scrollIntoView({behavior:"smooth"})},[r.length]);const ye=()=>{M.trim()?S.mutate(M):P.mutate(void 0,{onSuccess:_=>{k(_.message),S.mutate(_.message)}})};return e.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 flex items-center gap-3 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-orange-500 to-rose-600 flex items-center justify-center shadow-sm shadow-orange-500/20",children:e.jsx($n,{size:17,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-sm font-bold text-content",children:"Git Control Center"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Commit, push, pull and resolve conflicts"})]})]}),e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"relative flex-shrink-0",children:[e.jsxs("button",{onClick:()=>C(!z),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg bg-surface-inset hover:bg-surface-inset/80 border border-border text-xs font-medium text-content-secondary transition-colors",children:[e.jsx($n,{size:12,className:"text-accent flex-shrink-0"}),e.jsx("span",{className:"max-w-[160px] truncate",children:c?.branch??"..."}),e.jsx(kt,{size:11,className:O("transition-transform text-content-tertiary",z&&"rotate-180")})]}),z&&x&&e.jsxs("div",{className:"absolute top-full right-0 mt-1 w-56 bg-surface border border-border rounded-xl shadow-lg z-20 max-h-56 overflow-y-auto",children:[e.jsx("div",{className:"px-3 py-1.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Local"}),x.all.map(_=>e.jsx("button",{onClick:()=>{C(!1),_!==c?.branch&&g.mutate(_)},className:O("w-full text-left px-3 py-1.5 text-xs hover:bg-surface-inset transition-colors",_===c?.branch&&"font-semibold text-accent bg-accent/5"),children:_},_)),x.remote.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 py-1.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest border-t border-border",children:"Remote"}),x.remote.map(_=>e.jsx("button",{onClick:()=>{C(!1),g.mutate(_.replace(/^origin\//,""))},className:"w-full text-left px-3 py-1.5 text-xs text-content-secondary hover:bg-surface-inset",children:_},_))]})]})]}),e.jsxs("span",{className:O("inline-flex items-center gap-1.5 text-[10px] px-2.5 py-1 rounded-lg font-semibold ring-1",c?.conflicted.length?"bg-red-50 text-red-600 ring-red-200":c?.isClean?"bg-emerald-50 text-emerald-600 ring-emerald-200":"bg-amber-50 text-amber-600 ring-amber-200"),children:[e.jsx("span",{className:O("w-1.5 h-1.5 rounded-full",c?.conflicted.length?"bg-red-500":c?.isClean?"bg-emerald-500":"bg-amber-500")}),u?"Loading…":c?.conflicted.length?"Conflict":c?.isClean?"Clean":`${Ne} pending`]}),c&&(c.ahead>0||c.behind>0)&&e.jsxs("span",{className:"text-[10px] text-content-tertiary font-mono tabular-nums",children:[c.ahead>0&&e.jsxs("span",{className:"text-emerald-600",children:["↑",c.ahead]}),c.ahead>0&&c.behind>0&&" ",c.behind>0&&e.jsxs("span",{className:"text-amber-600",children:["↓",c.behind]})]})]}),e.jsxs("div",{className:"px-4 py-2.5 bg-surface-inset/40 border-t border-border flex items-center gap-2",children:[e.jsxs("div",{className:"relative flex-1 min-w-0",children:[e.jsx(yr,{size:11,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-content-tertiary pointer-events-none"}),e.jsx("input",{type:"text",value:M,onChange:_=>k(_.target.value),placeholder:"Commit message…",className:"w-full text-xs border border-border rounded-lg pl-7 pr-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/40 bg-surface placeholder-content-tertiary",onKeyDown:_=>{_.key==="Enter"&&M.trim()&&y.mutate(M)}})]}),e.jsx("button",{onClick:()=>P.mutate(void 0,{onSuccess:_=>k(_.message)}),disabled:P.isPending,title:"AI commit message",className:"p-1.5 rounded-lg border border-border bg-surface text-violet-500 hover:bg-violet-50 hover:border-violet-200 transition-colors flex-shrink-0 disabled:opacity-50",children:P.isPending?e.jsx(Me,{size:12,className:"animate-spin"}):e.jsx(Bt,{size:12})}),e.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] text-content-tertiary cursor-pointer select-none flex-shrink-0",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:_=>v(_.target.checked),className:"rounded border-border text-accent focus:ring-accent w-3 h-3"}),"Rebase"]}),e.jsx("div",{className:"w-px h-5 bg-border"}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[e.jsx(al,{icon:e.jsx(yr,{size:11}),label:"Commit",onClick:()=>M.trim()&&y.mutate(M),disabled:be||!M.trim(),loading:s==="commit"}),e.jsx(al,{icon:e.jsx(kf,{size:11}),label:"Push",onClick:()=>E.mutate(),disabled:be,loading:s==="push"}),e.jsx(al,{icon:e.jsx(wf,{size:11}),label:"Pull",onClick:()=>N.mutate(j),disabled:be,loading:s==="pull"}),e.jsx(al,{icon:e.jsx(Fl,{size:11}),label:"Full Sync",onClick:ye,disabled:be,loading:s==="full-sync",primary:!0})]})]})]}),a&&e.jsx(Bw,{conflictFiles:o}),!a&&e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-5 gap-3",children:[e.jsxs("div",{className:"lg:col-span-2 rounded-xl border border-border bg-surface overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"px-3.5 py-2 border-b border-border flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Changes"}),Ne>0&&e.jsx("span",{className:"text-[9px] font-bold text-accent bg-accent/8 px-1.5 py-px rounded ring-1 ring-accent/15",children:Ne})]}),Ne>0&&e.jsx("div",{className:"flex items-center gap-2",children:[{type:"M",count:c?.modified.length??0,color:"text-blue-500"},{type:"A",count:c?.added.length??0,color:"text-emerald-500"},{type:"D",count:c?.deleted.length??0,color:"text-red-500"},{type:"?",count:c?.untracked.length??0,color:"text-content-tertiary"}].filter(_=>_.count>0).map(_=>e.jsxs("span",{className:O("text-[9px] font-mono font-bold",_.color),children:[_.type,_.count]},_.type))})]}),e.jsx("div",{className:"flex-1 overflow-y-auto max-h-[400px]",children:Ne===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-10 gap-1.5",children:[e.jsx(et,{size:18,className:"text-emerald-400"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Working tree clean"})]}):e.jsxs("div",{className:"px-1.5 py-1",children:[c?.modified.map(_=>e.jsx(rl,{file:_,type:"M"},`M-${_}`)),c?.added.map(_=>e.jsx(rl,{file:_,type:"A"},`A-${_}`)),c?.deleted.map(_=>e.jsx(rl,{file:_,type:"D"},`D-${_}`)),c?.untracked.map(_=>e.jsx(rl,{file:_,type:"?"},`?-${_}`))]})})]}),e.jsxs("div",{className:"lg:col-span-3 rounded-xl border border-border bg-surface overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"px-3.5 py-2 border-b border-border flex items-center justify-between",children:[e.jsx("h2",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Commit History"}),e.jsx("button",{onClick:()=>f(),className:"p-1 rounded-md text-content-tertiary hover:text-accent hover:bg-accent/5 transition-colors",title:"Refresh",children:e.jsx(Yu,{size:11})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto max-h-[400px]",children:!h||h.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-10 gap-1.5",children:[e.jsx(yr,{size:18,className:"text-content-tertiary/40"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"No commits yet"})]}):e.jsxs("div",{className:"relative px-3.5 py-2",children:[e.jsx("div",{className:"absolute left-[22px] top-4 bottom-4 w-px bg-border"}),e.jsx("div",{className:"space-y-0.5",children:h.map((_,Y)=>e.jsxs("div",{className:"flex items-start gap-2.5 relative group py-1.5 rounded-lg hover:bg-surface-inset/50 px-1 -mx-1 transition-colors",children:[e.jsx("div",{className:O("mt-1 w-3 h-3 rounded-full border-2 flex-shrink-0 z-[1]",Y===0?"border-accent bg-accent/20":"border-border bg-surface")}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs text-content font-medium leading-snug truncate",title:_.message,children:_.message}),e.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-content-tertiary mt-0.5",children:[e.jsx("code",{className:"font-mono text-accent/70 text-[9px]",children:_.shortHash}),e.jsxs("span",{className:"flex items-center gap-0.5",children:[e.jsx(Zu,{size:8})," ",_.author]}),e.jsxs("span",{className:"flex items-center gap-0.5",children:[e.jsx(Cr,{size:8})," ",_w(_.date)]})]})]})]},_.hash))})]})})]})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("button",{onClick:()=>Z(!Q),className:"w-full px-3.5 py-2 flex items-center justify-between hover:bg-surface-inset/30 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ct,{size:12,className:"text-amber-500"}),e.jsx("h2",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Test Impact Analysis"}),J&&J.impactedCases.length>0&&e.jsxs("span",{className:"text-[9px] font-bold text-amber-600 bg-amber-50 px-1.5 py-px rounded ring-1 ring-amber-200",children:[J.impactedCases.length," impacted"]})]}),e.jsx(kt,{size:11,className:O("text-content-tertiary transition-transform",Q&&"rotate-180")})]}),Q&&e.jsxs("div",{className:"border-t border-border px-3.5 py-3",children:[e.jsx("p",{className:"text-[10px] text-content-tertiary mb-3",children:"Finds test cases that may be affected by uncommitted file changes."}),e.jsxs("button",{onClick:()=>{K(!0),setTimeout(()=>ke(),0)},disabled:ue,className:"flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-lg bg-amber-500 text-white hover:bg-amber-600 transition-colors disabled:opacity-50 mb-3",children:[ue?e.jsx(Me,{size:12,className:"animate-spin"}):e.jsx(ct,{size:12}),"Analyze Impact"]}),J&&e.jsxs(e.Fragment,{children:[J.changedFiles.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:["Changed Files (",J.changedFiles.length,")"]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:J.changedFiles.map(_=>e.jsx("span",{className:"text-[9px] font-mono bg-surface-inset px-2 py-0.5 rounded border border-border text-content-secondary",children:_},_))})]}),J.impactedCases.length===0?e.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-emerald-600 bg-emerald-50 rounded-lg px-3 py-2",children:[e.jsx(et,{size:12})," No test cases appear to be impacted by current changes."]}):e.jsxs("div",{children:[e.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:["Impacted Cases (",J.impactedCases.length,")"]}),e.jsx("div",{className:"space-y-1",children:J.impactedCases.map(_=>e.jsxs("div",{className:"flex items-start gap-2 text-[10px] bg-amber-50 rounded-lg px-3 py-2 border border-amber-200",children:[e.jsx(gs,{size:11,className:"text-amber-500 mt-px flex-shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-semibold text-content",children:_.caseName}),e.jsxs("p",{className:"text-content-tertiary",children:[_.suiteName," · ",_.reason]})]})]},_.caseId))})]})]})]})]}),r.length>0&&e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("button",{onClick:()=>F(!w),className:"w-full px-3.5 py-2 border-b border-border flex items-center justify-between hover:bg-surface-inset/30 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_l,{size:12,className:"text-content-tertiary"}),e.jsx("h2",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Execution Log"}),e.jsxs("span",{className:"text-[9px] font-medium text-content-tertiary bg-surface-inset px-1.5 py-px rounded ring-1 ring-border",children:[r.length," step",r.length!==1?"s":""]}),s&&e.jsxs("span",{className:"flex items-center gap-1 text-[9px] text-blue-500 font-medium",children:[e.jsx(Me,{size:9,className:"animate-spin"})," ",s]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("button",{onClick:_=>{_.stopPropagation(),Je.clearLogs()},className:"text-[9px] text-content-tertiary hover:text-red-500 px-1.5 py-0.5 rounded hover:bg-red-50 transition-colors",children:"Clear"}),e.jsx(kt,{size:11,className:O("text-content-tertiary transition-transform",w&&"rotate-180")})]})]}),w&&e.jsx("div",{className:"px-3.5 py-2 max-h-[200px] overflow-y-auto bg-surface-inset/20",children:e.jsxs("div",{className:"space-y-1",children:[r.map((_,Y)=>e.jsxs("div",{className:"flex items-start gap-2 text-[10px] py-0.5",children:[_.status==="running"&&e.jsx(Me,{size:11,className:"mt-px text-blue-500 animate-spin flex-shrink-0"}),_.status==="done"&&e.jsx(et,{size:11,className:"mt-px text-emerald-500 flex-shrink-0"}),_.status==="error"&&e.jsx(St,{size:11,className:"mt-px text-red-500 flex-shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:O("font-medium",_.status==="error"?"text-red-600":"text-content-secondary"),children:_.step}),_.message&&e.jsxs("span",{className:O("ml-1.5 font-normal",_.status==="error"?"text-red-400":"text-content-tertiary"),children:["— ",_.message]})]})]},Y)),e.jsx("div",{ref:re})]})})]})]})})})}function Bw({conflictFiles:s}){const r=eg(),a=tg(),o=sg(),c=ng(),[u,x]=p.useState({}),h=j=>u[j]??{mode:"none",ours:"",theirs:"",merged:"",resolved:!1,loading:!1},f=(j,v)=>x(z=>({...z,[j]:{...h(j),...v}})),g=async j=>{f(j,{loading:!0});try{const v=await ut.conflictContent(j);f(j,{ours:v.ours,theirs:v.theirs,merged:v.ours,loading:!1})}catch{f(j,{ours:"(error)",theirs:"(error)",loading:!1})}},y=async j=>{let z=h(j).ours;z||(z=(await ut.conflictContent(j)).ours),f(j,{loading:!0}),r.mutate({filePath:j,content:z},{onSuccess:()=>f(j,{resolved:!0,loading:!1})})},N=async j=>{let z=h(j).theirs;z||(z=(await ut.conflictContent(j)).theirs),f(j,{loading:!0}),r.mutate({filePath:j,content:z},{onSuccess:()=>f(j,{resolved:!0,loading:!1})})},E=async j=>{let v=h(j);v.ours||(await g(j),v=h(j)),f(j,{mode:"ai",loading:!0}),a.mutate({filePath:j,ours:v.ours,theirs:v.theirs},{onSuccess:z=>f(j,{merged:z.resolved,loading:!1}),onError:()=>f(j,{loading:!1})})},S=async j=>{h(j).ours||await g(j),f(j,{mode:"manual"})},P=j=>{const v=h(j);f(j,{loading:!0}),r.mutate({filePath:j,content:v.merged},{onSuccess:()=>f(j,{resolved:!0,loading:!1,mode:"none"})})},M=s.every(j=>h(j).resolved),k=s.filter(j=>h(j).resolved).length;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"rounded-xl border border-red-200 bg-red-50/80 overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-red-100 flex items-center justify-center flex-shrink-0",children:e.jsx(gs,{size:15,className:"text-red-500"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-xs font-bold text-red-800",children:"Merge Conflict Detected"}),e.jsxs("p",{className:"text-[10px] text-red-600",children:[k,"/",s.length," file",s.length>1?"s":""," resolved"]})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("button",{onClick:()=>c.mutate(),disabled:c.isPending,className:"flex items-center gap-1 px-2.5 py-1.5 text-[10px] font-medium text-red-600 bg-surface border border-red-200 rounded-lg hover:bg-red-50 transition-colors disabled:opacity-50",children:[e.jsx(_i,{size:10}),c.isPending?"Aborting…":"Abort"]}),e.jsxs("button",{onClick:()=>o.mutate(),disabled:!M||o.isPending,className:O("flex items-center gap-1 px-3 py-1.5 text-[10px] font-semibold rounded-lg transition-colors",M?"bg-emerald-600 hover:bg-emerald-700 text-white shadow-sm shadow-emerald-500/20":"bg-surface-inset text-content-tertiary cursor-not-allowed ring-1 ring-border"),children:[e.jsx(et,{size:10}),o.isPending?"Continuing…":"Continue Rebase"]})]})]}),e.jsx("div",{className:"h-0.5 bg-red-100",children:e.jsx("div",{className:"h-full bg-emerald-500 transition-all",style:{width:`${s.length>0?k/s.length*100:0}%`}})})]}),s.map(j=>{const v=h(j);return e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-3.5 py-2.5 border-b border-border flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Of,{size:13,className:v.resolved?"text-emerald-500":"text-amber-500"}),e.jsx("code",{className:"text-xs font-mono text-content-secondary",children:j}),v.resolved&&e.jsxs("span",{className:"text-[9px] text-emerald-600 bg-emerald-50 px-1.5 py-0.5 rounded-md flex items-center gap-0.5 font-semibold ring-1 ring-emerald-200",children:[e.jsx(et,{size:9})," Resolved"]})]}),!v.resolved&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(il,{label:"Keep Local",onClick:()=>y(j),loading:v.loading&&v.mode==="none"}),e.jsx(il,{label:"Accept Incoming",onClick:()=>N(j),loading:v.loading&&v.mode==="none"}),e.jsx(il,{label:"Manual",onClick:()=>S(j)}),e.jsx(il,{label:"AI Resolve",onClick:()=>E(j),loading:v.loading&&v.mode==="ai",icon:e.jsx(Bt,{size:9}),accent:!0})]})]}),v.mode!=="none"&&!v.resolved&&e.jsx("div",{className:"p-3.5",children:v.loading&&!v.ours?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Me,{size:16,className:"animate-spin text-content-tertiary"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-bold text-blue-600 uppercase tracking-widest mb-1 block",children:"Local (Ours)"}),e.jsx("textarea",{value:v.ours,readOnly:!0,rows:12,className:"w-full text-[10px] font-mono p-2.5 border border-blue-200 rounded-lg bg-blue-50/50 resize-y focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-bold text-orange-600 uppercase tracking-widest mb-1 block",children:"Incoming (Theirs)"}),e.jsx("textarea",{value:v.theirs,readOnly:!0,rows:12,className:"w-full text-[10px] font-mono p-2.5 border border-orange-200 rounded-lg bg-orange-50/50 resize-y focus:outline-none"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-bold text-emerald-600 uppercase tracking-widest mb-1 block",children:"Merged Output (editable)"}),e.jsx("textarea",{value:v.merged,onChange:z=>f(j,{merged:z.target.value}),rows:12,className:"w-full text-[10px] font-mono p-2.5 border border-emerald-200 rounded-lg bg-emerald-50/50 resize-y focus:outline-none focus:ring-2 focus:ring-emerald-300"})]}),e.jsx("div",{className:"flex justify-end mt-2.5",children:e.jsxs("button",{onClick:()=>P(j),disabled:v.loading,className:"flex items-center gap-1 px-3 py-1.5 bg-emerald-600 hover:bg-emerald-700 text-white text-[10px] font-semibold rounded-lg transition-colors disabled:opacity-50 shadow-sm shadow-emerald-500/20",children:[v.loading?e.jsx(Me,{size:10,className:"animate-spin"}):e.jsx(et,{size:10}),"Mark as Resolved"]})})]})})]},j)})]})}function rl({file:s,type:r}){const a=Uw[r],o=a.icon;return e.jsxs("div",{className:"flex items-center gap-2 py-1 px-2 rounded-lg hover:bg-surface-inset/60 group transition-colors",children:[e.jsx("div",{className:O("w-5 h-5 rounded flex items-center justify-center flex-shrink-0",a.bg),children:e.jsx(o,{size:10,className:a.color})}),e.jsx("span",{className:O("text-[10px] font-mono truncate flex-1",a.color),title:s,children:s}),e.jsx("span",{className:O("text-[8px] px-1.5 py-px rounded font-medium ring-1",a.bg,a.color,a.ring),children:a.label})]})}function al({icon:s,label:r,onClick:a,disabled:o,loading:c,primary:u}){return e.jsxs("button",{onClick:a,disabled:o,className:O("flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[10px] font-semibold transition-all",u?"bg-accent hover:bg-accent-dark text-white shadow-sm shadow-accent/20":"bg-surface hover:bg-surface-inset text-content-secondary border border-border",o&&"opacity-50 cursor-not-allowed",c&&"cursor-wait"),children:[c?e.jsx(Me,{size:11,className:"animate-spin"}):s,r]})}function il({label:s,onClick:r,loading:a,icon:o,accent:c}){return e.jsxs("button",{onClick:r,disabled:a,className:O("flex items-center gap-0.5 px-2 py-1 text-[9px] font-medium rounded-lg transition-colors",c?"bg-violet-50 text-violet-600 hover:bg-violet-100 ring-1 ring-violet-200":"bg-surface-inset text-content-secondary hover:bg-surface-inset/80 ring-1 ring-border",a&&"opacity-60 cursor-wait"),children:[a?e.jsx(Me,{size:9,className:"animate-spin"}):o,s]})}function qw(s){const r=new Date(s),a=Math.floor((Date.now()-r.getTime())/1e3);if(a<60)return`${a}s ago`;const o=Math.floor(a/60);if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}const Hw={M:{icon:Tf,color:"text-blue-500",bg:"bg-blue-50",label:"M"},A:{icon:zf,color:"text-emerald-500",bg:"bg-emerald-50",label:"A"},D:{icon:Mf,color:"text-red-500",bg:"bg-red-50",label:"D"},"?":{icon:Af,color:"text-content-tertiary",bg:"bg-surface-inset",label:"?"}};function Kw(){const{panelOpen:s,operationInProgress:r,logSteps:a,hasConflict:o}=Bl(),{data:c,isLoading:u}=ex(),{data:x}=Vf(),{data:h,refetch:f}=Wf(15),g=Gf(),y=Qf(),N=Jf(),E=Yf(),S=Xf(),P=Zf(),[M,k]=p.useState(""),[j,v]=p.useState(!0),[z,C]=p.useState(!1),[w,F]=p.useState(!0),Q=p.useRef(null),Z=!!r,le=(c?.modified.length??0)+(c?.added.length??0)+(c?.deleted.length??0)+(c?.untracked.length??0);p.useEffect(()=>{Q.current?.scrollIntoView({behavior:"smooth"})},[a.length]);const K=()=>{M.trim()?S.mutate(M):P.mutate(void 0,{onSuccess:J=>{k(J.message),S.mutate(J.message)}})};return e.jsxs(e.Fragment,{children:[s&&e.jsx("div",{className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-[1px] transition-opacity",onClick:()=>Je.closePanel()}),e.jsxs("div",{className:O("fixed top-0 right-0 h-full z-50 w-[400px] max-w-[90vw] bg-surface border-l border-border shadow-2xl","flex flex-col transition-transform duration-300 ease-in-out",s?"translate-x-0":"translate-x-full"),children:[e.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2.5 border-b border-border bg-surface flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-gradient-to-br from-orange-500 to-rose-600 flex items-center justify-center shadow-sm shadow-orange-500/20",children:e.jsx($n,{size:13,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-xs font-bold text-content",children:"Git Control"}),e.jsx("p",{className:"text-[9px] text-content-tertiary",children:"Quick operations"})]})]}),e.jsx("button",{onClick:()=>Je.closePanel(),className:"p-1 rounded-lg hover:bg-surface-inset text-content-tertiary hover:text-content-secondary transition-colors",children:e.jsx(_e,{size:14})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[o&&e.jsxs("div",{className:"mx-3 mt-3 px-3 py-2 bg-red-50 border border-red-200 rounded-lg flex items-center gap-2",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-500 flex-shrink-0"}),e.jsx("span",{className:"text-[10px] text-red-700 font-medium",children:"Merge conflict — open full Git page to resolve"})]}),e.jsx("div",{className:"px-3.5 py-2.5 border-b border-border",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative flex-1 min-w-0",children:[e.jsxs("button",{onClick:()=>C(!z),className:"w-full flex items-center justify-between gap-2 px-2.5 py-1.5 rounded-lg bg-surface-inset hover:bg-surface-inset/80 border border-border text-xs font-medium text-content-secondary transition-colors",children:[e.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[e.jsx($n,{size:11,className:"text-accent flex-shrink-0"}),c?.branch??"..."]}),e.jsx(kt,{size:10,className:O("transition-transform text-content-tertiary",z&&"rotate-180")})]}),z&&x&&e.jsxs("div",{className:"absolute top-full left-0 right-0 mt-1 bg-surface border border-border rounded-xl shadow-lg z-10 max-h-48 overflow-y-auto",children:[e.jsx("div",{className:"px-2.5 py-1 text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Local"}),x.all.map(J=>e.jsx("button",{onClick:()=>{C(!1),J!==c?.branch&&g.mutate(J)},className:O("w-full text-left px-2.5 py-1.5 text-[10px] hover:bg-surface-inset transition-colors",J===c?.branch&&"font-semibold text-accent bg-accent/5"),children:J},J)),x.remote.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-2.5 py-1 text-[9px] font-bold text-content-tertiary uppercase tracking-widest border-t border-border",children:"Remote"}),x.remote.map(J=>e.jsx("button",{onClick:()=>{C(!1),g.mutate(J.replace(/^origin\//,""))},className:"w-full text-left px-2.5 py-1.5 text-[10px] text-content-secondary hover:bg-surface-inset",children:J},J))]})]})]}),e.jsxs("span",{className:O("inline-flex items-center gap-1.5 text-[9px] px-2 py-1 rounded-lg font-semibold ring-1 flex-shrink-0",c?.conflicted?.length?"bg-red-50 text-red-600 ring-red-200":c?.isClean?"bg-emerald-50 text-emerald-600 ring-emerald-200":"bg-amber-50 text-amber-600 ring-amber-200"),children:[e.jsx("span",{className:O("w-1.5 h-1.5 rounded-full",c?.conflicted?.length?"bg-red-500":c?.isClean?"bg-emerald-500":"bg-amber-500")}),u?"…":c?.conflicted?.length?"Conflict":c?.isClean?"Clean":`${le} pending`]}),c&&(c.ahead>0||c.behind>0)&&e.jsxs("span",{className:"text-[9px] text-content-tertiary font-mono tabular-nums flex-shrink-0",children:[c.ahead>0&&e.jsxs("span",{className:"text-emerald-600",children:["↑",c.ahead]}),c.behind>0&&e.jsxs("span",{className:"text-amber-600 ml-0.5",children:["↓",c.behind]})]})]})}),e.jsxs("div",{className:"px-3.5 py-2.5 border-b border-border",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Changes"}),le>0&&e.jsx("span",{className:"text-[9px] font-bold text-accent bg-accent/8 px-1.5 py-px rounded ring-1 ring-accent/15",children:le})]}),le>0&&e.jsx("div",{className:"flex items-center gap-1.5",children:[{type:"M",count:c?.modified.length??0,color:"text-blue-500"},{type:"A",count:c?.added.length??0,color:"text-emerald-500"},{type:"D",count:c?.deleted.length??0,color:"text-red-500"},{type:"?",count:c?.untracked.length??0,color:"text-content-tertiary"}].filter(J=>J.count>0).map(J=>e.jsxs("span",{className:O("text-[8px] font-mono font-bold",J.color),children:[J.type,J.count]},J.type))})]}),le===0?e.jsxs("div",{className:"flex items-center gap-1.5 py-2",children:[e.jsx(et,{size:12,className:"text-emerald-400"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Working tree clean"})]}):e.jsxs("div",{className:"space-y-px max-h-[150px] overflow-y-auto",children:[c?.modified.map(J=>e.jsx(ol,{file:J,type:"M"},`M-${J}`)),c?.added.map(J=>e.jsx(ol,{file:J,type:"A"},`A-${J}`)),c?.deleted.map(J=>e.jsx(ol,{file:J,type:"D"},`D-${J}`)),c?.untracked.map(J=>e.jsx(ol,{file:J,type:"?"},`?-${J}`))]})]}),e.jsxs("div",{className:"px-3.5 py-2.5 border-b border-border space-y-2.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("div",{className:"relative flex-1 min-w-0",children:[e.jsx(yr,{size:10,className:"absolute left-2 top-1/2 -translate-y-1/2 text-content-tertiary pointer-events-none"}),e.jsx("input",{type:"text",value:M,onChange:J=>k(J.target.value),placeholder:"Commit message…",className:"w-full text-[10px] border border-border rounded-lg pl-6 pr-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/40 bg-surface-inset/50 placeholder-content-tertiary",onKeyDown:J=>{J.key==="Enter"&&M.trim()&&y.mutate(M)}})]}),e.jsx("button",{onClick:()=>P.mutate(void 0,{onSuccess:J=>k(J.message)}),disabled:P.isPending,title:"AI commit message",className:"p-1.5 rounded-lg border border-border bg-surface text-violet-500 hover:bg-violet-50 hover:border-violet-200 transition-colors flex-shrink-0 disabled:opacity-50",children:P.isPending?e.jsx(Me,{size:10,className:"animate-spin"}):e.jsx(Bt,{size:10})})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-[9px] text-content-tertiary cursor-pointer select-none",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:J=>v(J.target.checked),className:"rounded border-border text-accent focus:ring-accent w-3 h-3"}),"Pull latest (rebase) before commit"]}),e.jsxs("div",{className:"grid grid-cols-4 gap-1",children:[e.jsx(ll,{icon:e.jsx(yr,{size:10}),label:"Commit",onClick:()=>M.trim()&&y.mutate(M),disabled:Z||!M.trim(),loading:r==="commit"}),e.jsx(ll,{icon:e.jsx(kf,{size:10}),label:"Push",onClick:()=>E.mutate(),disabled:Z,loading:r==="push"}),e.jsx(ll,{icon:e.jsx(wf,{size:10}),label:"Pull",onClick:()=>N.mutate(j),disabled:Z,loading:r==="pull"}),e.jsx(ll,{icon:e.jsx(Fl,{size:10}),label:"Sync",onClick:K,disabled:Z,loading:r==="full-sync",primary:!0})]}),e.jsx("p",{className:"text-[8px] text-content-tertiary text-center",children:"Sync: pull --rebase → stage → commit → push"})]}),a.length>0&&e.jsxs("div",{className:"border-b border-border",children:[e.jsxs("button",{onClick:()=>F(!w),className:"w-full px-3.5 py-2 flex items-center justify-between hover:bg-surface-inset/30 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(_l,{size:10,className:"text-content-tertiary"}),e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Log"}),e.jsx("span",{className:"text-[8px] font-medium text-content-tertiary bg-surface-inset px-1.5 py-px rounded ring-1 ring-border",children:a.length}),r&&e.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] text-blue-500 font-medium",children:[e.jsx(Me,{size:8,className:"animate-spin"})," ",r]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:J=>{J.stopPropagation(),Je.clearLogs()},className:"text-[8px] text-content-tertiary hover:text-red-500 px-1 py-0.5 rounded hover:bg-red-50 transition-colors",children:"Clear"}),e.jsx(kt,{size:10,className:O("text-content-tertiary transition-transform",w&&"rotate-180")})]})]}),w&&e.jsx("div",{className:"px-3.5 pb-2.5 max-h-[150px] overflow-y-auto",children:e.jsxs("div",{className:"space-y-0.5",children:[a.map((J,ue)=>e.jsxs("div",{className:"flex items-start gap-1.5 text-[9px] py-0.5",children:[J.status==="running"&&e.jsx(Me,{size:9,className:"mt-px text-blue-500 animate-spin flex-shrink-0"}),J.status==="done"&&e.jsx(et,{size:9,className:"mt-px text-emerald-500 flex-shrink-0"}),J.status==="error"&&e.jsx(St,{size:9,className:"mt-px text-red-500 flex-shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:O("font-medium",J.status==="error"?"text-red-600":"text-content-secondary"),children:J.step}),J.message&&e.jsxs("span",{className:O("ml-1 font-normal",J.status==="error"?"text-red-400":"text-content-tertiary"),children:["— ",J.message]})]})]},ue)),e.jsx("div",{ref:Q})]})})]}),e.jsxs("div",{className:"px-3.5 py-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"History"}),e.jsx("button",{onClick:()=>f(),className:"p-1 rounded-md text-content-tertiary hover:text-accent hover:bg-accent/5 transition-colors",title:"Refresh",children:e.jsx(Yu,{size:10})})]}),!h||h.length===0?e.jsxs("div",{className:"flex items-center gap-1.5 py-3",children:[e.jsx(yr,{size:12,className:"text-content-tertiary/40"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"No commits yet"})]}):e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute left-[5px] top-2 bottom-2 w-px bg-border"}),e.jsx("div",{className:"space-y-0.5",children:h.map((J,ue)=>e.jsxs("div",{className:"flex items-start gap-2 relative py-1 rounded-lg hover:bg-surface-inset/50 px-0.5 -mx-0.5 transition-colors",children:[e.jsx("div",{className:O("mt-1.5 w-[9px] h-[9px] rounded-full border-[1.5px] flex-shrink-0 z-[1]",ue===0?"border-accent bg-accent/20":"border-border bg-surface")}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-[10px] text-content font-medium leading-snug truncate",title:J.message,children:J.message}),e.jsxs("div",{className:"flex items-center gap-1.5 text-[8px] text-content-tertiary mt-0.5",children:[e.jsx("code",{className:"font-mono text-accent/70",children:J.shortHash}),e.jsxs("span",{className:"flex items-center gap-0.5",children:[e.jsx(Zu,{size:7})," ",J.author]}),e.jsxs("span",{className:"flex items-center gap-0.5",children:[e.jsx(Cr,{size:7})," ",qw(J.date)]})]})]})]},J.hash))})]})]})]})]})]})}function ol({file:s,type:r}){const a=Hw[r],o=a.icon;return e.jsxs("div",{className:"flex items-center gap-1.5 py-0.5 px-1.5 rounded-md hover:bg-surface-inset/60 transition-colors",children:[e.jsx("div",{className:O("w-4 h-4 rounded flex items-center justify-center flex-shrink-0",a.bg),children:e.jsx(o,{size:9,className:a.color})}),e.jsx("span",{className:O("text-[9px] font-mono truncate flex-1",a.color),title:s,children:s})]})}function ll({icon:s,label:r,onClick:a,disabled:o,loading:c,primary:u}){return e.jsxs("button",{onClick:a,disabled:o,className:O("flex flex-col items-center justify-center gap-0.5 px-2 py-1.5 rounded-lg text-[9px] font-semibold transition-all",u?"bg-accent hover:bg-accent-dark text-white shadow-sm shadow-accent/20":"bg-surface hover:bg-surface-inset text-content-secondary border border-border",o&&"opacity-50 cursor-not-allowed",c&&"cursor-wait"),children:[c?e.jsx(Me,{size:10,className:"animate-spin"}):s,r]})}function Vw(){const s=Vs(),r=Vn(),a=tx(),o=jg(),{stepLogs:c}=Ng(),u=a.isRunning,x=wg(u),[h,f]=p.useState(!1),[g,y]=p.useState(!1),[N,E]=p.useState(!1),S=r.pathname==="/run";p.useEffect(()=>{u&&!N&&(f(!0),y(!1))},[u,N]),p.useEffect(()=>{u&&E(!1)},[a.runId]);const P=()=>{f(!1),E(!0)},M=()=>{f(!1),E(!0),s("/run")};return!h&&!u&&!a.completed||!h||S?null:g?e.jsx(Ww,{runActive:u,elapsed:x,completed:a.completed,onExpand:()=>y(!1),onClose:P}):e.jsx(Gw,{progress:a,live:o,elapsed:x,runActive:u,stepLogs:c,onMinimise:()=>y(!0),onClose:P,onGoToRunConfig:M})}function Ww({runActive:s,elapsed:r,completed:a,onExpand:o,onClose:c}){return e.jsxs("div",{className:"fixed bottom-4 right-4 z-[9999] flex items-center gap-2 bg-slate-900 rounded-full px-3 py-1.5 shadow-2xl border border-slate-700 cursor-pointer hover:bg-slate-800 transition-colors",onClick:o,children:[s?e.jsxs(e.Fragment,{children:[e.jsx(Me,{size:12,className:"text-emerald-400 animate-spin"}),e.jsx("span",{className:"text-[10px] font-semibold text-white",children:"Running"}),e.jsx("span",{className:"text-[9px] font-mono text-slate-400",children:r})]}):a?e.jsxs(e.Fragment,{children:[a.failed>0?e.jsx(St,{size:12,className:"text-red-400"}):e.jsx(He,{size:12,className:"text-emerald-400"}),e.jsxs("span",{className:"text-[10px] font-semibold text-white",children:[a.passed,"✓ ",a.failed>0&&`${a.failed}✗`]})]}):null,e.jsx("button",{type:"button",onClick:u=>{u.stopPropagation(),c()},className:"p-0.5 rounded-full hover:bg-slate-700 text-slate-500 hover:text-white transition-colors",children:e.jsx(_e,{size:10})})]})}function Gw({progress:s,live:r,elapsed:a,runActive:o,stepLogs:c,onMinimise:u,onClose:x,onGoToRunConfig:h}){const f=p.useRef(null),[g,y]=p.useState(null),N=p.useRef(!1),E=p.useRef({x:0,y:0}),S=p.useRef(null);p.useEffect(()=>{S.current?.scrollIntoView({behavior:"smooth"})},[c.length]);const P=p.useCallback(j=>{j.preventDefault(),N.current=!0;const v=f.current,z=g?.x??(v?v.getBoundingClientRect().left:window.innerWidth-400),C=g?.y??(v?v.getBoundingClientRect().top:window.innerHeight-400);E.current={x:j.clientX-z,y:j.clientY-C};const w=Q=>{N.current&&y({x:Math.max(0,Math.min(window.innerWidth-200,Q.clientX-E.current.x)),y:Math.max(0,Math.min(window.innerHeight-60,Q.clientY-E.current.y))})},F=()=>{N.current=!1,window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",F)};window.addEventListener("mousemove",w),window.addEventListener("mouseup",F)},[g]),M=!!r.screenshot,k=s.completed;return e.jsxs("div",{ref:f,className:"fixed z-[9999] w-[340px] rounded-xl bg-slate-900 border border-slate-700 shadow-2xl overflow-hidden flex flex-col",style:g?{left:g.x,top:g.y,maxHeight:420}:{bottom:16,right:16,maxHeight:420},children:[e.jsxs("div",{className:"flex-shrink-0 flex items-center justify-between px-3 py-2 bg-slate-800 border-b border-slate-700 cursor-move select-none",onMouseDown:P,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Rv,{size:12,className:"text-slate-500"}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-red-500/80"}),e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-amber-500/80"}),e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-emerald-500/80"})]}),s.currentBrowser&&e.jsx(ba,{browser:s.currentBrowser,size:14,className:"ml-1"}),e.jsx("span",{className:"text-[10px] font-semibold text-slate-400 uppercase tracking-wider ml-1",children:s.currentBrowser?ix(s.currentBrowser):o?"Browser Preview":"Run Complete"}),o&&e.jsx("span",{className:"text-[8px] font-bold px-1.5 py-0.5 rounded bg-emerald-500/20 text-emerald-400 animate-pulse",children:"LIVE"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{type:"button",onClick:j=>{j.stopPropagation(),h()},title:"Open in Run Config (full view)",className:"p-1.5 rounded text-slate-300 hover:text-accent hover:bg-slate-600 transition-colors",onMouseDown:j=>j.stopPropagation(),children:e.jsx(Ju,{size:14})}),e.jsx("button",{type:"button",onClick:j=>{j.stopPropagation(),u()},title:"Minimise",className:"p-1.5 rounded text-slate-300 hover:text-white hover:bg-slate-600 transition-colors",onMouseDown:j=>j.stopPropagation(),children:e.jsx(_f,{size:14})}),e.jsx("button",{type:"button",onClick:j=>{j.stopPropagation(),x()},title:"Close",className:"p-1.5 rounded text-slate-300 hover:text-red-400 hover:bg-slate-600 transition-colors",onMouseDown:j=>j.stopPropagation(),children:e.jsx(_e,{size:14})})]})]}),e.jsxs("div",{className:"relative bg-slate-950 flex items-center justify-center overflow-hidden",style:{minHeight:120,maxHeight:180},children:[M&&e.jsx("img",{src:`data:image/jpeg;base64,${r.screenshot}`,alt:"Browser",className:O("w-full h-auto object-contain",k&&!o&&"opacity-30"),style:{maxHeight:180}}),!M&&o&&e.jsxs("div",{className:"flex flex-col items-center gap-2 py-6",children:[e.jsxs("div",{className:"w-12 h-8 rounded-lg bg-slate-800 border border-slate-700 overflow-hidden relative",children:[e.jsxs("div",{className:"h-2 bg-slate-750 border-b border-slate-700 flex items-center px-1 gap-0.5",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-red-500/50"}),e.jsx("div",{className:"w-1 h-1 rounded-full bg-amber-500/50"}),e.jsx("div",{className:"w-1 h-1 rounded-full bg-emerald-500/50"})]}),e.jsxs("div",{className:"p-1 space-y-0.5",children:[e.jsx("div",{className:"h-0.5 bg-slate-700 rounded w-3/4 animate-pulse"}),e.jsx("div",{className:"h-0.5 bg-slate-700 rounded w-1/2 animate-pulse"})]})]}),e.jsx("p",{className:"text-[9px] text-slate-500",children:"Waiting for screenshots..."}),e.jsx("div",{className:"flex gap-1",children:[0,120,240].map(j=>e.jsx("div",{className:"w-1 h-1 rounded-full bg-accent animate-bounce",style:{animationDelay:`${j}ms`}},j))})]}),k&&!o&&e.jsx("div",{className:O("w-full",M?"absolute inset-0 flex items-center justify-center bg-black/50 backdrop-blur-sm":"py-4 px-6"),children:e.jsxs("div",{className:O(M?"px-5 py-4":""),children:[e.jsxs("div",{className:"flex items-center gap-2.5 mb-3",children:[k.failed===0?e.jsx(He,{size:18,className:"text-emerald-400"}):e.jsx(St,{size:18,className:"text-red-400"}),e.jsxs("div",{children:[e.jsx("p",{className:O("text-xs font-bold",k.failed===0?"text-emerald-300":"text-red-300"),children:k.failed===0?"All tests passed!":"Completed with failures"}),e.jsxs("p",{className:"text-[9px] text-slate-400",children:[Math.round(k.duration/1e3),"s elapsed"]})]})]}),e.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:[{label:"Passed",v:k.passed,c:"text-emerald-400 bg-emerald-500/10 ring-emerald-500/20"},{label:"Failed",v:k.failed,c:"text-red-400 bg-red-500/10 ring-red-500/20"},{label:"Skipped",v:k.skipped,c:"text-slate-400 bg-slate-500/10 ring-slate-500/20"}].map(({label:j,v,c:z})=>e.jsxs("div",{className:O("rounded-lg p-2 text-center ring-1",z),children:[e.jsx("p",{className:"text-sm font-bold tabular-nums",children:v}),e.jsx("p",{className:"text-[7px] uppercase tracking-wider text-slate-500",children:j})]},j))})]})}),o&&s.currentStep&&e.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/90 to-transparent px-3 py-2",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-emerald-400 animate-pulse flex-shrink-0"}),e.jsx("p",{className:"text-[8px] text-white/70 truncate font-mono",children:s.currentStep.instruction})]})})]}),e.jsxs("div",{className:"flex-shrink-0 border-t border-slate-700",children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-1 bg-slate-800/50",children:[e.jsx("div",{className:"flex items-center gap-2",children:o?e.jsxs(e.Fragment,{children:[e.jsx(Me,{size:9,className:"text-emerald-400 animate-spin"}),e.jsx("span",{className:"text-[9px] text-slate-300 font-medium truncate max-w-[180px]",children:s.currentCase?.caseName??"Starting..."})]}):e.jsxs("span",{className:"text-[9px] text-slate-400",children:[c.length," step",c.length!==1&&"s"," executed"]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[9px] font-mono text-slate-500",children:a}),e.jsxs("button",{type:"button",onClick:h,className:"flex items-center gap-1 text-[8px] font-semibold text-accent hover:text-accent-light transition-colors",title:"Open full view in Run Config",children:[e.jsx(Na,{size:8})," Full View"]})]})]}),c.length>0&&e.jsxs("div",{className:"max-h-[72px] overflow-y-auto px-2 py-1 space-y-px",children:[c.slice(-5).map((j,v)=>e.jsxs("div",{className:"flex items-center gap-1.5 py-px text-[8px]",children:[j.status==="passed"?e.jsx(He,{size:8,className:"text-emerald-400 flex-shrink-0"}):j.status==="failed"?e.jsx(St,{size:8,className:"text-red-400 flex-shrink-0"}):e.jsx(Xt,{size:8,className:"text-slate-600 flex-shrink-0"}),e.jsx("span",{className:O("truncate flex-1 font-mono",j.status==="passed"?"text-slate-400":j.status==="failed"?"text-red-300":"text-slate-600"),children:j.instruction}),e.jsxs("span",{className:"text-slate-600 tabular-nums flex-shrink-0",children:[j.duration,"ms"]})]},`${j.stepId}-${v}`)),e.jsx("div",{ref:S})]})]})]})}function Qw(){const{hasConflict:s,conflictFiles:r}=Bl(),a=eg(),o=tg(),c=sg(),u=ng(),[x,h]=p.useState({});if(!s||r.length===0)return null;const f=j=>x[j]??{mode:"none",ours:"",theirs:"",merged:"",resolved:!1,loading:!1},g=(j,v)=>h(z=>({...z,[j]:{...f(j),...v}})),y=async j=>{g(j,{loading:!0});try{const v=await ut.conflictContent(j);g(j,{ours:v.ours,theirs:v.theirs,merged:v.ours,loading:!1})}catch{g(j,{ours:"(error loading)",theirs:"(error loading)",loading:!1})}},N=async j=>{let z=f(j).ours;z||(z=(await ut.conflictContent(j)).ours),g(j,{loading:!0}),a.mutate({filePath:j,content:z},{onSuccess:()=>g(j,{resolved:!0,loading:!1})})},E=async j=>{let z=f(j).theirs;z||(z=(await ut.conflictContent(j)).theirs),g(j,{loading:!0}),a.mutate({filePath:j,content:z},{onSuccess:()=>g(j,{resolved:!0,loading:!1})})},S=async j=>{let v=f(j);v.ours||(await y(j),v=f(j)),g(j,{mode:"ai",loading:!0}),o.mutate({filePath:j,ours:v.ours,theirs:v.theirs},{onSuccess:z=>g(j,{merged:z.resolved,loading:!1}),onError:()=>g(j,{loading:!1})})},P=async j=>{f(j).ours||await y(j),g(j,{mode:"manual"})},M=j=>{const v=f(j);g(j,{loading:!0}),a.mutate({filePath:j,content:v.merged},{onSuccess:()=>g(j,{resolved:!0,loading:!1,mode:"none"})})},k=r.every(j=>f(j).resolved);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:e.jsxs("div",{className:"bg-surface rounded-2xl shadow-2xl w-full max-w-4xl mx-4 max-h-[90vh] flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-slate-100 bg-red-50 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(gs,{size:20,className:"text-red-500"}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-bold text-red-800",children:"Merge Conflict Detected"}),e.jsxs("p",{className:"text-xs text-red-600",children:[r.length," file",r.length>1?"s":""," with conflicts"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>u.mutate(),disabled:u.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-red-600 bg-surface border border-red-200 rounded-lg hover:bg-red-50 transition-colors disabled:opacity-50",children:[e.jsx(_i,{size:11}),u.isPending?"Aborting...":"Abort Rebase"]}),e.jsxs("button",{onClick:()=>c.mutate(),disabled:!k||c.isPending,className:O("flex items-center gap-1.5 px-4 py-1.5 text-xs font-medium rounded-lg transition-colors",k?"bg-green-600 hover:bg-green-700 text-white":"bg-slate-200 text-content-tertiary cursor-not-allowed"),children:[e.jsx(et,{size:11}),c.isPending?"Continuing...":"Continue Rebase"]}),e.jsx("button",{onClick:()=>Je.clearConflict(),className:"p-1.5 rounded hover:bg-red-100 text-red-400 transition-colors",children:e.jsx(_e,{size:16})})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4",children:r.map(j=>{const v=f(j);return e.jsxs("div",{className:"border border-slate-200 rounded-xl overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-2.5 bg-surface-inset border-b border-slate-100 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Of,{size:14,className:v.resolved?"text-green-500":"text-amber-500"}),e.jsx("code",{className:"text-xs font-mono text-content-secondary",children:j}),v.resolved&&e.jsxs("span",{className:"text-[10px] text-green-600 bg-green-100 px-2 py-0.5 rounded-full flex items-center gap-1 font-medium",children:[e.jsx(et,{size:9})," Resolved"]})]}),!v.resolved&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(cl,{label:"Keep Local",onClick:()=>N(j),loading:v.loading&&v.mode==="none"}),e.jsx(cl,{label:"Accept Incoming",onClick:()=>E(j),loading:v.loading&&v.mode==="none"}),e.jsx(cl,{label:"Manual",onClick:()=>P(j)}),e.jsx(cl,{label:"AI Resolve",onClick:()=>S(j),loading:v.loading&&v.mode==="ai",icon:e.jsx(Bt,{size:9}),accent:!0})]})]}),v.mode!=="none"&&!v.resolved&&e.jsx("div",{className:"p-4",children:v.loading&&!v.ours?e.jsx("div",{className:"flex items-center justify-center py-6",children:e.jsx(Me,{size:18,className:"animate-spin text-content-tertiary"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-bold text-blue-600 uppercase tracking-wider mb-1 block",children:"Local (Ours)"}),e.jsx("textarea",{value:v.ours,readOnly:!0,rows:10,className:"w-full text-[11px] font-mono p-2.5 border border-blue-200 rounded-lg bg-blue-50/50 resize-y focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-bold text-orange-600 uppercase tracking-wider mb-1 block",children:"Incoming (Theirs)"}),e.jsx("textarea",{value:v.theirs,readOnly:!0,rows:10,className:"w-full text-[11px] font-mono p-2.5 border border-orange-200 rounded-lg bg-orange-50/50 resize-y focus:outline-none"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-bold text-green-600 uppercase tracking-wider mb-1 block",children:"Merged Output (editable)"}),e.jsx("textarea",{value:v.merged,onChange:z=>g(j,{merged:z.target.value}),rows:10,className:"w-full text-[11px] font-mono p-2.5 border border-green-200 rounded-lg bg-green-50/50 resize-y focus:outline-none focus:ring-2 focus:ring-green-300"})]}),e.jsx("div",{className:"flex justify-end mt-2",children:e.jsxs("button",{onClick:()=>M(j),disabled:v.loading,className:"flex items-center gap-1.5 px-4 py-1.5 bg-green-600 hover:bg-green-700 text-white text-xs font-medium rounded-lg transition-colors disabled:opacity-50",children:[v.loading?e.jsx(Me,{size:12,className:"animate-spin"}):e.jsx(et,{size:12}),"Mark as Resolved"]})})]})})]},j)})})]})})}function cl({label:s,onClick:r,loading:a,icon:o,accent:c}){return e.jsxs("button",{onClick:r,disabled:a,className:O("flex items-center gap-1 px-2 py-1 text-[10px] font-medium rounded-lg transition-colors",c?"bg-purple-100 text-purple-700 hover:bg-purple-200":"bg-slate-100 text-content-secondary hover:bg-slate-200",a&&"opacity-60 cursor-wait"),children:[a?e.jsx(Me,{size:9,className:"animate-spin"}):o,s]})}function Jw(s){p.useEffect(()=>{function r(a){const o=a.target;if(!(o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement||o instanceof HTMLSelectElement))for(const c of s){const u=a.key===c.key,x=!!c.ctrl,h=!!c.meta,f=!!c.shift,g=x?a.ctrlKey:!a.ctrlKey,y=h?a.metaKey:!a.metaKey,N=f?a.shiftKey:!a.shiftKey,E=(()=>{if(x||h){const S=x?a.ctrlKey:!0,P=h?a.metaKey:!0,M=f?a.shiftKey:!a.shiftKey;return x&&!h&&a.metaKey||h&&!x&&a.ctrlKey?!1:S&&P&&M}return g&&y&&N})();if(u&&E){a.preventDefault(),c.action();return}}}return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[s])}const Yw=[{keys:["?"],description:"Show keyboard shortcuts"},{keys:["Ctrl","K"],description:"Search (Cmd+K)"},{keys:["Esc"],description:"Close modal / cancel"}];function Xw({open:s,onClose:r}){return p.useEffect(()=>{if(!s)return;function a(o){o.key==="Escape"&&r()}return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[s,r]),s?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:r,children:e.jsxs("div",{className:"bg-surface rounded-2xl border border-border shadow-modal w-full max-w-lg mx-4 overflow-hidden",onClick:a=>a.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[e.jsx("h2",{className:"text-sm font-bold text-content",children:"Keyboard Shortcuts"}),e.jsx("button",{type:"button",onClick:r,className:"p-1.5 rounded-lg text-content-tertiary hover:bg-surface-inset hover:text-content transition-colors","aria-label":"Close",children:e.jsx(_e,{size:14})})]}),e.jsx("div",{className:"px-5 py-4 grid grid-cols-2 gap-x-6 gap-y-3",children:Yw.map(a=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-content-secondary",children:a.description}),e.jsx("div",{className:"flex items-center gap-1 flex-shrink-0",children:a.keys.map(o=>e.jsx("kbd",{className:"inline-flex items-center justify-center px-1.5 py-0.5 rounded text-[10px] font-mono font-semibold bg-surface-inset border border-border text-content-secondary min-w-[22px]",children:o},o))})]},a.description))}),e.jsx("div",{className:"px-5 py-3 border-t border-border bg-surface-inset/30",children:e.jsxs("p",{className:"text-[10px] text-content-tertiary",children:["Press ",e.jsx("kbd",{className:"inline-flex items-center justify-center px-1 py-px rounded text-[9px] font-mono bg-surface-inset border border-border text-content-tertiary",children:"Esc"})," or click outside to close"]})})]})}):null}const Zw={suite:"Suites",case:"Cases",step:"Steps"},ek={name:"name",description:"description",tag:"tag",instruction:"instruction"};function tk({type:s}){return s==="suite"?e.jsx(Er,{size:13,className:"text-indigo-500 flex-shrink-0"}):s==="case"?e.jsx(Hs,{size:13,className:"text-blue-500 flex-shrink-0"}):e.jsx(Gu,{size:13,className:"text-teal-500 flex-shrink-0"})}function sk({open:s,onClose:r}){const a=Vs(),[o,c]=p.useState(""),[u,x]=p.useState(""),[h,f]=p.useState(-1),g=p.useRef(null);p.useEffect(()=>{const k=setTimeout(()=>x(o),300);return()=>clearTimeout(k)},[o]),p.useEffect(()=>{s&&(c(""),x(""),f(-1),setTimeout(()=>g.current?.focus(),50))},[s]);const{data:y=[]}=Oe({queryKey:["search",u],queryFn:()=>uj.search(u),enabled:u.trim().length>1,staleTime:0}),N={suite:y.filter(k=>k.type==="suite"),case:y.filter(k=>k.type==="case"),step:y.filter(k=>k.type==="step")},E=y,S=k=>{k.type==="suite"?a(`/tests/${k.suiteId}`):k.type==="case"?a(`/tests/${k.suiteId}/cases/${k.caseId}`):a(`/tests/${k.suiteId}/cases/${k.caseId}`),r()},P=k=>{k.key==="ArrowDown"?(k.preventDefault(),f(j=>Math.min(j+1,E.length-1))):k.key==="ArrowUp"?(k.preventDefault(),f(j=>Math.max(j-1,-1))):k.key==="Enter"&&h>=0&&E[h]?(k.preventDefault(),S(E[h])):k.key==="Escape"&&r()};if(!s)return null;let M=-1;return e.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/60 backdrop-blur-sm pt-[15vh]",onClick:r,children:e.jsxs("div",{className:"bg-surface rounded-2xl border border-border shadow-modal w-full max-w-xl mx-4 overflow-hidden",onClick:k=>k.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border",children:[e.jsx(Bn,{size:15,className:"text-content-tertiary flex-shrink-0"}),e.jsx("input",{ref:g,type:"text",placeholder:"Search suites, cases, steps...",value:o,onChange:k=>{c(k.target.value),f(-1)},onKeyDown:P,className:"flex-1 text-sm bg-transparent text-content placeholder-content-tertiary outline-none"}),o&&e.jsx("button",{type:"button",onClick:()=>{c(""),x("")},className:"p-1 rounded text-content-tertiary hover:text-content transition-colors",children:e.jsx(_e,{size:13})}),e.jsx("kbd",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded border border-border bg-surface-inset text-content-tertiary",children:"Esc"})]}),e.jsx("div",{className:"overflow-y-auto max-h-[50vh]",children:u.trim().length<2?e.jsx("div",{className:"px-5 py-8 text-center",children:e.jsx("p",{className:"text-sm text-content-tertiary",children:"Type at least 2 characters to search"})}):y.length===0?e.jsx("div",{className:"px-5 py-8 text-center",children:e.jsxs("p",{className:"text-sm text-content-tertiary",children:['No results for "',u,'"']})}):e.jsx("div",{className:"py-1",children:["suite","case","step"].map(k=>{const j=N[k];return j.length===0?null:e.jsxs("div",{children:[e.jsx("div",{className:"px-4 py-1.5 text-[10px] font-bold text-content-tertiary uppercase tracking-wider bg-surface-inset/50",children:Zw[k]}),j.map(v=>{M++;const C=h===M;return e.jsxs("button",{type:"button",onClick:()=>S(v),className:O("w-full flex items-center gap-3 px-4 py-2.5 text-left transition-colors",C?"bg-accent/10":"hover:bg-surface-inset"),children:[e.jsx(tk,{type:v.type}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-content truncate",children:v.type==="step"?v.instruction:v.type==="case"?v.caseName:v.suiteName}),e.jsx("span",{className:O("text-[9px] px-1.5 py-0.5 rounded font-semibold uppercase flex-shrink-0",v.matchedOn==="name"?"bg-accent/10 text-accent":v.matchedOn==="tag"?"bg-purple-50 text-purple-600":"bg-surface-inset text-content-tertiary"),children:ek[v.matchedOn]})]}),e.jsxs("p",{className:"text-[11px] text-content-tertiary truncate mt-0.5",children:[v.type!=="suite"&&`${v.suiteName}`,v.type==="step"&&v.caseName&&` › ${v.caseName}`]})]}),e.jsx(fr,{size:11,className:O("text-content-tertiary transition-opacity flex-shrink-0",C?"opacity-100":"opacity-0")})]},`${v.suiteId}-${v.caseId??""}-${v.stepId??""}`)})]},k)})})}),y.length>0&&e.jsxs("div",{className:"px-4 py-2.5 border-t border-border bg-surface-inset/30 flex items-center gap-3 text-[10px] text-content-tertiary",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("kbd",{className:"px-1 py-px rounded border border-border bg-surface font-mono",children:"↑↓"})," navigate"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("kbd",{className:"px-1 py-px rounded border border-border bg-surface font-mono",children:"↵"})," select"]})]})]})})}const Pg="assuremind_onboarding_done";function cu(){localStorage.setItem(Pg,"true")}function nk(){const{data:s=[],isLoading:r}=xg(),[a,o]=p.useState(0),[c,u]=p.useState(""),[x,h]=p.useState(""),f=Vs(),g=!!localStorage.getItem(Pg),y=oe({mutationFn:S=>Sr.update({baseUrl:S}),onError:S=>$.error(S.message)}),N=oe({mutationFn:S=>Pr.create({name:S,type:"ui"}),onSuccess:()=>{cu(),f("/tests")},onError:S=>$.error(S.message)});if(r||s.length>0||g)return null;const E=[0,1,2].map(S=>e.jsx("span",{className:`w-2 h-2 rounded-full transition-colors ${S===a?"bg-accent":"bg-border"}`},S));return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:e.jsxs("div",{className:"bg-surface rounded-2xl border border-border shadow-modal w-full max-w-md mx-4 overflow-hidden",children:[a===0&&e.jsxs("div",{className:"flex flex-col items-center px-8 py-8 gap-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-2xl bg-gradient-to-br from-accent to-accent-dark flex items-center justify-center shadow-lg",children:e.jsx(ct,{size:28,className:"text-white"})}),e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-lg font-bold text-content",children:"Welcome to AssureMind Studio"}),e.jsx("p",{className:"text-sm text-content-secondary mt-2 leading-relaxed",children:"AI-powered test automation that writes, runs, and self-heals your tests. Let's get you set up in just a few steps."})]}),e.jsx("div",{className:"flex items-center gap-2 mt-2",children:E}),e.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[e.jsx(we,{onClick:()=>o(1),className:"w-full",children:"Get Started"}),e.jsx("button",{type:"button",onClick:()=>{cu()},className:"text-xs text-content-tertiary hover:text-content-secondary transition-colors py-1",children:"Skip for now"})]})]}),a===1&&e.jsxs("div",{className:"flex flex-col items-center px-8 py-8 gap-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-2xl bg-gradient-to-br from-blue-500 to-indigo-600 flex items-center justify-center shadow-lg",children:e.jsx(xn,{size:28,className:"text-white"})}),e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-lg font-bold text-content",children:"Set your Base URL"}),e.jsx("p",{className:"text-sm text-content-secondary mt-2 leading-relaxed",children:"This is the URL of the application you want to test."})]}),e.jsx("input",{type:"url",placeholder:"https://your-app.example.com",value:c,onChange:S=>u(S.target.value),className:"w-full px-3 py-2 rounded-lg border border-border bg-surface-inset text-sm text-content placeholder:text-content-tertiary outline-none focus:ring-2 focus:ring-accent/40 focus:border-accent transition-all"}),e.jsx("div",{className:"flex items-center gap-2",children:E}),e.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[e.jsx(we,{onClick:async()=>{c&&await y.mutateAsync(c),o(2)},loading:y.isPending,className:"w-full",children:"Next"}),e.jsx("button",{type:"button",onClick:()=>{cu()},className:"text-xs text-content-tertiary hover:text-content-secondary transition-colors py-1",children:"Skip for now"})]})]}),a===2&&e.jsxs("div",{className:"flex flex-col items-center px-8 py-8 gap-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-2xl bg-gradient-to-br from-emerald-500 to-teal-600 flex items-center justify-center shadow-lg",children:e.jsx(Pv,{size:28,className:"text-white"})}),e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-lg font-bold text-content",children:"Create your first test suite"}),e.jsx("p",{className:"text-sm text-content-secondary mt-2 leading-relaxed",children:"Give your first test suite a name. You can add test cases to it right after."})]}),e.jsx("input",{type:"text",placeholder:"e.g. Login flow",value:x,onChange:S=>h(S.target.value),className:"w-full px-3 py-2 rounded-lg border border-border bg-surface-inset text-sm text-content placeholder:text-content-tertiary outline-none focus:ring-2 focus:ring-accent/40 focus:border-accent transition-all",onKeyDown:S=>{S.key==="Enter"&&x.trim()&&N.mutate(x.trim())}}),e.jsx("div",{className:"flex items-center gap-2",children:E}),e.jsx(we,{onClick:()=>{x.trim()&&N.mutate(x.trim())},loading:N.isPending,disabled:!x.trim(),className:"w-full",children:"Create Suite & Continue"})]})]})})}const rk={AI_NOT_CONFIGURED:{icon:e.jsx(Bt,{size:20,className:"text-indigo-500"}),iconBg:"bg-indigo-50 border-indigo-200/50 dark:bg-indigo-900/30 dark:border-indigo-700/50",title:"AI Provider Setup Required",description:"To use AI-powered features like test generation, code generation, and self-healing, you need to configure an AI provider and its API key.",envVars:[{name:"AI_PROVIDER",example:"openai | anthropic | google | azure-openai | bedrock | ..."},{name:"<PROVIDER>_API_KEY",example:"sk-... (your provider API key)"}]},JIRA_NOT_CONFIGURED:{icon:e.jsx(vl,{size:20,className:"text-blue-500"}),iconBg:"bg-blue-50 border-blue-200/50 dark:bg-blue-900/30 dark:border-blue-700/50",title:"Jira Integration Setup Required",description:"To fetch Jira issues and enrich test generation with Jira stories, you need to configure your Jira credentials.",envVars:[{name:"JIRA_BASE_URL",example:"https://your-domain.atlassian.net"},{name:"JIRA_EMAIL",example:"your-email@company.com"},{name:"JIRA_API_TOKEN",example:"your-jira-api-token"}]},XRAY_NOT_CONFIGURED:{icon:e.jsx(vl,{size:20,className:"text-emerald-500"}),iconBg:"bg-emerald-50 border-emerald-200/50 dark:bg-emerald-900/30 dark:border-emerald-700/50",title:"Xray Integration Setup Required",description:"To sync test suites and cases with Jira Xray, you need to configure both Jira credentials and the Xray project key.",envVars:[{name:"JIRA_BASE_URL",example:"https://your-domain.atlassian.net"},{name:"JIRA_EMAIL",example:"your-email@company.com"},{name:"JIRA_API_TOKEN",example:"your-jira-api-token"},{name:"XRAY_PROJECT_KEY",example:"PROJ"}]}};function ak(){const{activeModal:s}=lj(),[r,a]=p.useState(!1);if(p.useEffect(()=>{if(!s)return;a(!1);const c=u=>{u.key==="Escape"&&br.dismiss()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s]),!s)return null;const o=rk[s];return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center animate-fade-in",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>br.dismiss()}),e.jsxs("div",{className:"relative bg-surface rounded-2xl shadow-modal w-full max-w-md mx-4 overflow-hidden border border-border animate-scale-in",children:[e.jsxs("div",{className:"flex items-start gap-3.5 p-6 pb-4",children:[e.jsx("div",{className:`flex-shrink-0 w-11 h-11 rounded-xl border flex items-center justify-center ${o.iconBg}`,children:o.icon}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-base font-semibold text-content",children:o.title}),e.jsx("p",{className:"mt-1.5 text-sm text-content-secondary leading-relaxed",children:o.description})]})]}),e.jsxs("div",{className:"mx-6 mb-4 rounded-xl bg-surface-inset border border-border p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(jl,{size:14,className:"text-content-tertiary"}),e.jsx("span",{className:"text-xs font-semibold text-content-secondary uppercase tracking-wider",children:"Add to your .env file"})]}),e.jsx("div",{className:"space-y-2",children:o.envVars.map(c=>e.jsxs("div",{className:"font-mono text-xs",children:[e.jsx("span",{className:"text-accent font-semibold",children:c.name}),e.jsx("span",{className:"text-content-tertiary",children:"="}),e.jsx("span",{className:"text-content-secondary",children:c.example})]},c.name))})]}),e.jsxs("div",{className:"mx-6 mb-5 text-xs text-content-tertiary leading-relaxed",children:["After updating your ",e.jsx("code",{className:"px-1 py-0.5 rounded bg-surface-inset text-content-secondary",children:".env"})," file, restart the Studio server for changes to take effect."]}),e.jsxs("div",{className:"flex items-center justify-between px-6 pb-6",children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[e.jsx("input",{type:"checkbox",checked:r,onChange:c=>a(c.target.checked),className:"w-3.5 h-3.5 rounded border-border accent-accent cursor-pointer"}),e.jsx("span",{className:"text-xs text-content-tertiary",children:"Don't show this again"})]}),e.jsx(we,{variant:"secondary",size:"sm",onClick:()=>br.dismiss(r),children:"Close"})]})]})]})}function ik(){const{job:s,showPopup:r}=vg(),a=Vs();return!r||!s||s.status!=="done"?null:e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm animate-fade-in",children:e.jsxs("div",{className:"bg-surface rounded-2xl shadow-modal w-full max-w-sm mx-4 overflow-hidden border border-border animate-scale-in",children:[e.jsxs("div",{className:"flex flex-col items-center pt-8 pb-5 px-6 bg-gradient-to-b from-emerald-50/80 to-surface",children:[e.jsx("div",{className:"w-14 h-14 rounded-2xl bg-emerald-100 border border-emerald-200/50 flex items-center justify-center mb-3",children:e.jsx(He,{size:28,className:"text-emerald-500"})}),e.jsx("h2",{className:"text-lg font-bold text-content",children:"Suite Generated!"}),s.suiteName&&e.jsx("span",{className:"mt-2 px-3 py-1 rounded-lg bg-accent-muted text-accent text-xs font-semibold",children:s.suiteName}),e.jsx("p",{className:"text-sm text-content-secondary text-center mt-2.5 leading-relaxed",children:"Your test suite has been created. Open the Test Editor to review and run the generated test cases."})]}),e.jsxs("div",{className:"flex flex-col gap-2.5 px-6 pb-6",children:[e.jsxs("button",{type:"button",onClick:()=>{Ms.dismissPopup(),a("/tests",{state:{openSuiteId:s.suiteId}})},className:"w-full py-2.5 rounded-xl bg-gradient-to-b from-accent to-accent-dark text-white font-semibold text-sm hover:brightness-110 transition-all flex items-center justify-center gap-2 shadow-sm",children:[e.jsx(Zt,{size:16})," Open Test Cases"]}),e.jsx("button",{type:"button",onClick:()=>Ms.dismissPopup(),className:"w-full py-2.5 rounded-xl border border-border text-content-secondary font-medium text-sm hover:bg-surface-inset transition-colors",children:"Stay on this page"})]})]})})}function ok(){const{job:s}=vg(),[r,a]=p.useState(null),o=p.useRef(null),c=p.useRef(null);p.useEffect(()=>{s?.status==="running"&&a(null)},[s?.id]);const u=p.useCallback(g=>{g.preventDefault();const y=c.current;if(!y)return;y.setPointerCapture(g.pointerId);const N=y.getBoundingClientRect();o.current={startX:g.clientX,startY:g.clientY,origX:N.left,origY:N.top}},[]),x=p.useCallback(g=>{if(!o.current)return;const y=c.current;if(!y)return;const N=g.clientX-o.current.startX,E=g.clientY-o.current.startY,S=o.current.origX+N,P=o.current.origY+E,M=window.innerWidth-y.offsetWidth,k=window.innerHeight-y.offsetHeight;a({x:Math.max(0,Math.min(S,M)),y:Math.max(0,Math.min(P,k))})},[]),h=p.useCallback(()=>{o.current=null},[]);if(!s||s.status!=="running")return null;const f=r?{left:r.x,top:r.y,right:"auto",bottom:"auto"}:{right:24,bottom:80};return e.jsxs("div",{ref:c,onPointerDown:u,onPointerMove:x,onPointerUp:h,style:{...f,position:"fixed",zIndex:40,touchAction:"none",cursor:"grab",userSelect:"none"},className:"flex items-center gap-2.5 px-4 py-2.5 rounded-xl bg-gradient-to-r from-accent to-accent-dark text-white shadow-elevated text-xs font-semibold animate-pulse",children:[e.jsx(Me,{size:14,className:"animate-spin"}),"Generating: ",s.label]})}function lk(){return zr({"run:start":s=>{$t.onRunStart(s.runId)},"run:case":s=>{const r=s;r.status==="running"&&$t.onCaseRunning(r.runId,r.caseId)},"run:case:done":s=>{const r=s;$t.onCaseDone(r.runId,r.caseId,r.status)},"run:complete":s=>{const r=s;$t.onComplete(r.runId,{passed:r.passed,failed:r.failed,skipped:r.skipped});const a=r.passed+r.failed+r.skipped;r.failed>0?$.error(`Run complete — ${r.passed}/${a} passed, ${r.failed} failed`):$.success(`Run complete — ${r.passed}/${a} passed`),vr.push({id:crypto.randomUUID(),type:"run-complete",message:`Run complete — ${r.passed} passed, ${r.failed} failed`,timestamp:Date.now(),read:!1,link:"/reports"})},"run:error":s=>{const r=s;$t.clear(),$.error(`Run error: ${r.error??"unknown"}`),vr.push({id:crypto.randomUUID(),type:"run-error",message:`Run error: ${r.error??"unknown"}`,timestamp:Date.now(),read:!1,link:"/reports"})}}),null}function ck(){return zr({"git:log":s=>{Je.addLogStep(s)},"git:conflict":s=>{const r=s;Je.setConflict(r.files)},"git:operation-done":()=>{Je.finishOperation()}}),null}const dk={"/":"Dashboard","/tests":"Test Suites","/story":"Smart Tests","/run":"Run Configuration","/reports":"Reports","/variables":"Variables","/healing":"Self-Healing","/git":"Git Control Center","/settings":"Settings","/library":"Step Library","/ci-integration":"CI/CD Integration","/docs":"Documentation"};function uk(){const s=Vn();return s.pathname.startsWith("/tests")?"Test Suites":dk[s.pathname]??"AssureMind Studio"}function xk(){const{collapsed:s,mobileOpen:r,toggle:a}=ij(),o=uk(),[c,u]=p.useState(!1),[x,h]=p.useState(!1);return Jw([{key:"?",description:"Show shortcuts",action:()=>u(!0)},{key:"Escape",description:"Close modal",action:()=>{u(!1),h(!1)}},{key:"k",ctrl:!0,description:"Search (Cmd+K)",action:()=>h(!0)},{key:"k",meta:!0,description:"Search (Cmd+K)",action:()=>h(!0)}]),e.jsxs("div",{className:"flex h-full overflow-hidden",children:[e.jsx(lk,{}),e.jsx(ck,{}),e.jsx(aj,{collapsed:s,onToggle:a,mobileOpen:r}),e.jsxs("div",{className:"flex flex-col flex-1 min-w-0 overflow-hidden",children:[e.jsx(UN,{title:o,onMenuClick:a}),e.jsx("main",{className:"flex flex-col flex-1 overflow-hidden bg-background",children:e.jsxs(jb,{children:[e.jsx(Dt,{path:"/",element:e.jsx(HN,{})}),e.jsx(Dt,{path:"/tests",element:e.jsx(tu,{})}),e.jsx(Dt,{path:"/tests/:suiteId",element:e.jsx(tu,{})}),e.jsx(Dt,{path:"/tests/:suiteId/cases/:caseId",element:e.jsx(tu,{})}),e.jsx(Dt,{path:"/story",element:e.jsx(q2,{})}),e.jsx(Dt,{path:"/run",element:e.jsx(J2,{})}),e.jsx(Dt,{path:"/reports",element:e.jsx(Cw,{})}),e.jsx(Dt,{path:"/variables",element:e.jsx(Ew,{})}),e.jsx(Dt,{path:"/healing",element:e.jsx(Mw,{})}),e.jsx(Dt,{path:"/git",element:e.jsx($w,{})}),e.jsx(Dt,{path:"/settings",element:e.jsx(zw,{})}),e.jsx(Dt,{path:"/env-config",element:e.jsx(Aw,{})}),e.jsx(Dt,{path:"/library",element:e.jsx(Ow,{})}),e.jsx(Dt,{path:"/ci-integration",element:e.jsx(Lw,{})}),e.jsx(Dt,{path:"/docs",element:e.jsx(Dw,{})})]})})]}),e.jsx(Xw,{open:c,onClose:()=>u(!1)}),e.jsx(sk,{open:x,onClose:()=>h(!1)})]})}function mk(){return e.jsxs(e.Fragment,{children:[e.jsx(xk,{}),e.jsx(Kw,{}),e.jsx(Qw,{}),e.jsx(ik,{}),e.jsx(ok,{}),e.jsx(Vw,{}),e.jsx(nk,{}),e.jsx(ak,{}),e.jsx(iv,{position:"bottom-right",toastOptions:{style:{fontSize:"13px",borderRadius:"12px",padding:"10px 16px",boxShadow:"0 4px 16px -2px rgb(0 0 0 / 0.08), 0 2px 6px -2px rgb(0 0 0 / 0.04)"}}})]})}const hk=new i1({defaultOptions:{queries:{retry:1,staleTime:1e4,refetchOnWindowFocus:!1}}}),Rg=document.getElementById("root");if(!Rg)throw new Error("Root element not found");My.createRoot(Rg).render(e.jsx(p.StrictMode,{children:e.jsx(Rb,{children:e.jsx(o1,{client:hk,children:e.jsx(mk,{})})})}));
|