assuremind 1.3.0 → 1.4.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.
@@ -0,0 +1,1024 @@
1
+ var sh=e=>{throw TypeError(e)};var Yc=(e,t,n)=>t.has(e)||sh("Cannot "+n);var C=(e,t,n)=>(Yc(e,t,"read from private field"),n?n.call(e):t.get(e)),ee=(e,t,n)=>t.has(e)?sh("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Q=(e,t,n,r)=>(Yc(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),de=(e,t,n)=>(Yc(e,t,"access private method"),n);var Il=(e,t,n,r)=>({set _(a){Q(e,t,a,n)},get _(){return C(e,t,r)}});function kb(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();function Sb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vf={exports:{}},fc={},jf={exports:{}},pe={};/**
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 wl=Symbol.for("react.element"),Cb=Symbol.for("react.portal"),Eb=Symbol.for("react.fragment"),Pb=Symbol.for("react.strict_mode"),Rb=Symbol.for("react.profiler"),Mb=Symbol.for("react.provider"),Tb=Symbol.for("react.context"),zb=Symbol.for("react.forward_ref"),Ab=Symbol.for("react.suspense"),Ob=Symbol.for("react.memo"),Db=Symbol.for("react.lazy"),nh=Symbol.iterator;function Ib(e){return e===null||typeof e!="object"?null:(e=nh&&e[nh]||e["@@iterator"],typeof e=="function"?e:null)}var Nf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},wf=Object.assign,kf={};function Xa(e,t,n){this.props=e,this.context=t,this.refs=kf,this.updater=n||Nf}Xa.prototype.isReactComponent={};Xa.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Xa.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Sf(){}Sf.prototype=Xa.prototype;function Mx(e,t,n){this.props=e,this.context=t,this.refs=kf,this.updater=n||Nf}var Tx=Mx.prototype=new Sf;Tx.constructor=Mx;wf(Tx,Xa.prototype);Tx.isPureReactComponent=!0;var rh=Array.isArray,Cf=Object.prototype.hasOwnProperty,zx={current:null},Ef={key:!0,ref:!0,__self:!0,__source:!0};function Pf(e,t,n){var r,a={},i=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)Cf.call(t,r)&&!Ef.hasOwnProperty(r)&&(a[r]=t[r]);var o=arguments.length-2;if(o===1)a.children=n;else if(1<o){for(var c=Array(o),d=0;d<o;d++)c[d]=arguments[d+2];a.children=c}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)a[r]===void 0&&(a[r]=o[r]);return{$$typeof:wl,type:e,key:i,ref:l,props:a,_owner:zx.current}}function Fb(e,t){return{$$typeof:wl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ax(e){return typeof e=="object"&&e!==null&&e.$$typeof===wl}function Lb(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ah=/\/+/g;function Jc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Lb(""+e.key):t.toString(36)}function xo(e,t,n,r,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(i){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case wl:case Cb:l=!0}}if(l)return l=e,a=a(l),e=r===""?"."+Jc(l,0):r,rh(a)?(n="",e!=null&&(n=e.replace(ah,"$&/")+"/"),xo(a,t,n,"",function(d){return d})):a!=null&&(Ax(a)&&(a=Fb(a,n+(!a.key||l&&l.key===a.key?"":(""+a.key).replace(ah,"$&/")+"/")+e)),t.push(a)),1;if(l=0,r=r===""?".":r+":",rh(e))for(var o=0;o<e.length;o++){i=e[o];var c=r+Jc(i,o);l+=xo(i,t,n,c,a)}else if(c=Ib(e),typeof c=="function")for(e=c.call(e),o=0;!(i=e.next()).done;)i=i.value,c=r+Jc(i,o++),l+=xo(i,t,n,c,a);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function Fl(e,t,n){if(e==null)return e;var r=[],a=0;return xo(e,r,"","",function(i){return t.call(n,i,a++)}),r}function _b(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var kt={current:null},mo={transition:null},$b={ReactCurrentDispatcher:kt,ReactCurrentBatchConfig:mo,ReactCurrentOwner:zx};function Rf(){throw Error("act(...) is not supported in production builds of React.")}pe.Children={map:Fl,forEach:function(e,t,n){Fl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Fl(e,function(){t++}),t},toArray:function(e){return Fl(e,function(t){return t})||[]},only:function(e){if(!Ax(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};pe.Component=Xa;pe.Fragment=Eb;pe.Profiler=Rb;pe.PureComponent=Mx;pe.StrictMode=Pb;pe.Suspense=Ab;pe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$b;pe.act=Rf;pe.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=wf({},e.props),a=e.key,i=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,l=zx.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(c in t)Cf.call(t,c)&&!Ef.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&o!==void 0?o[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){o=Array(c);for(var d=0;d<c;d++)o[d]=arguments[d+2];r.children=o}return{$$typeof:wl,type:e.type,key:a,ref:i,props:r,_owner:l}};pe.createContext=function(e){return e={$$typeof:Tb,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Mb,_context:e},e.Consumer=e};pe.createElement=Pf;pe.createFactory=function(e){var t=Pf.bind(null,e);return t.type=e,t};pe.createRef=function(){return{current:null}};pe.forwardRef=function(e){return{$$typeof:zb,render:e}};pe.isValidElement=Ax;pe.lazy=function(e){return{$$typeof:Db,_payload:{_status:-1,_result:e},_init:_b}};pe.memo=function(e,t){return{$$typeof:Ob,type:e,compare:t===void 0?null:t}};pe.startTransition=function(e){var t=mo.transition;mo.transition={};try{e()}finally{mo.transition=t}};pe.unstable_act=Rf;pe.useCallback=function(e,t){return kt.current.useCallback(e,t)};pe.useContext=function(e){return kt.current.useContext(e)};pe.useDebugValue=function(){};pe.useDeferredValue=function(e){return kt.current.useDeferredValue(e)};pe.useEffect=function(e,t){return kt.current.useEffect(e,t)};pe.useId=function(){return kt.current.useId()};pe.useImperativeHandle=function(e,t,n){return kt.current.useImperativeHandle(e,t,n)};pe.useInsertionEffect=function(e,t){return kt.current.useInsertionEffect(e,t)};pe.useLayoutEffect=function(e,t){return kt.current.useLayoutEffect(e,t)};pe.useMemo=function(e,t){return kt.current.useMemo(e,t)};pe.useReducer=function(e,t,n){return kt.current.useReducer(e,t,n)};pe.useRef=function(e){return kt.current.useRef(e)};pe.useState=function(e){return kt.current.useState(e)};pe.useSyncExternalStore=function(e,t,n){return kt.current.useSyncExternalStore(e,t,n)};pe.useTransition=function(){return kt.current.useTransition()};pe.version="18.3.1";jf.exports=pe;var m=jf.exports;const Ub=Sb(m),Bb=kb({__proto__:null,default:Ub},[m]);/**
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 qb=m,Hb=Symbol.for("react.element"),Kb=Symbol.for("react.fragment"),Wb=Object.prototype.hasOwnProperty,Vb=qb.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Gb={key:!0,ref:!0,__self:!0,__source:!0};function Mf(e,t,n){var r,a={},i=null,l=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(l=t.ref);for(r in t)Wb.call(t,r)&&!Gb.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)a[r]===void 0&&(a[r]=t[r]);return{$$typeof:Hb,type:e,key:i,ref:l,props:a,_owner:Vb.current}}fc.Fragment=Kb;fc.jsx=Mf;fc.jsxs=Mf;vf.exports=fc;var s=vf.exports,Tf={exports:{}},Wt={},zf={exports:{}},Af={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(T,_){var z=T.length;T.push(_);e:for(;0<z;){var R=z-1>>>1,I=T[R];if(0<a(I,_))T[R]=_,T[z]=I,z=R;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var _=T[0],z=T.pop();if(z!==_){T[0]=z;e:for(var R=0,I=T.length,X=I>>>1;R<X;){var B=2*(R+1)-1,xe=T[B],he=B+1,Ee=T[he];if(0>a(xe,z))he<I&&0>a(Ee,xe)?(T[R]=Ee,T[he]=z,R=he):(T[R]=xe,T[B]=z,R=B);else if(he<I&&0>a(Ee,z))T[R]=Ee,T[he]=z,R=he;else break e}}return _}function a(T,_){var z=T.sortIndex-_.sortIndex;return z!==0?z:T.id-_.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,o=l.now();e.unstable_now=function(){return l.now()-o}}var c=[],d=[],x=1,p=null,y=3,b=!1,f=!1,v=!1,w=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,u=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(T){for(var _=n(d);_!==null;){if(_.callback===null)r(d);else if(_.startTime<=T)r(d),_.sortIndex=_.expirationTime,t(c,_);else break;_=n(d)}}function j(T){if(v=!1,g(T),!f)if(n(c)!==null)f=!0,ne(k);else{var _=n(d);_!==null&&le(j,_.startTime-T)}}function k(T,_){f=!1,v&&(v=!1,h(P),P=-1),b=!0;var z=y;try{for(g(_),p=n(c);p!==null&&(!(p.expirationTime>_)||T&&!V());){var R=p.callback;if(typeof R=="function"){p.callback=null,y=p.priorityLevel;var I=R(p.expirationTime<=_);_=e.unstable_now(),typeof I=="function"?p.callback=I:p===n(c)&&r(c),g(_)}else r(c);p=n(c)}if(p!==null)var X=!0;else{var B=n(d);B!==null&&le(j,B.startTime-_),X=!1}return X}finally{p=null,y=z,b=!1}}var N=!1,S=null,P=-1,$=5,M=-1;function V(){return!(e.unstable_now()-M<$)}function G(){if(S!==null){var T=e.unstable_now();M=T;var _=!0;try{_=S(!0,T)}finally{_?re():(N=!1,S=null)}}else N=!1}var re;if(typeof u=="function")re=function(){u(G)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,Y=O.port2;O.port1.onmessage=G,re=function(){Y.postMessage(null)}}else re=function(){w(G,0)};function ne(T){S=T,N||(N=!0,re())}function le(T,_){P=w(function(){T(e.unstable_now())},_)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(T){T.callback=null},e.unstable_continueExecution=function(){f||b||(f=!0,ne(k))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(T){switch(y){case 1:case 2:case 3:var _=3;break;default:_=y}var z=y;y=_;try{return T()}finally{y=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,_){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var z=y;y=T;try{return _()}finally{y=z}},e.unstable_scheduleCallback=function(T,_,z){var R=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?R+z:R):z=R,T){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=z+I,T={id:x++,callback:_,priorityLevel:T,startTime:z,expirationTime:I,sortIndex:-1},z>R?(T.sortIndex=z,t(d,T),n(c)===null&&T===n(d)&&(v?(h(P),P=-1):v=!0,le(j,z-R))):(T.sortIndex=I,t(c,T),f||b||(f=!0,ne(k))),T},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(T){var _=y;return function(){var z=y;y=_;try{return T.apply(this,arguments)}finally{y=z}}}})(Af);zf.exports=Af;var Qb=zf.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 Yb=m,Ht=Qb;function q(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Of=new Set,Hi={};function qr(e,t){$a(e,t),$a(e+"Capture",t)}function $a(e,t){for(Hi[e]=t,e=0;e<t.length;e++)Of.add(t[e])}var Xs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),eu=Object.prototype.hasOwnProperty,Jb=/^[: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]*$/,ih={},lh={};function Xb(e){return eu.call(lh,e)?!0:eu.call(ih,e)?!1:Jb.test(e)?lh[e]=!0:(ih[e]=!0,!1)}function Zb(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function e1(e,t,n,r){if(t===null||typeof t>"u"||Zb(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function St(e,t,n,r,a,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var lt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){lt[e]=new St(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];lt[t]=new St(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){lt[e]=new St(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){lt[e]=new St(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){lt[e]=new St(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){lt[e]=new St(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){lt[e]=new St(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){lt[e]=new St(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){lt[e]=new St(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ox=/[\-:]([a-z])/g;function Dx(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ox,Dx);lt[t]=new St(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ox,Dx);lt[t]=new St(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ox,Dx);lt[t]=new St(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){lt[e]=new St(e,1,!1,e.toLowerCase(),null,!1,!1)});lt.xlinkHref=new St("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){lt[e]=new St(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ix(e,t,n,r){var a=lt.hasOwnProperty(t)?lt[t]:null;(a!==null?a.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(e1(t,n,a,r)&&(n=null),r||a===null?Xb(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=n===null?a.type===3?!1:"":n:(t=a.attributeName,r=a.attributeNamespace,n===null?e.removeAttribute(t):(a=a.type,n=a===3||a===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var an=Yb.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ll=Symbol.for("react.element"),da=Symbol.for("react.portal"),ua=Symbol.for("react.fragment"),Fx=Symbol.for("react.strict_mode"),tu=Symbol.for("react.profiler"),Df=Symbol.for("react.provider"),If=Symbol.for("react.context"),Lx=Symbol.for("react.forward_ref"),su=Symbol.for("react.suspense"),nu=Symbol.for("react.suspense_list"),_x=Symbol.for("react.memo"),pn=Symbol.for("react.lazy"),Ff=Symbol.for("react.offscreen"),oh=Symbol.iterator;function ii(e){return e===null||typeof e!="object"?null:(e=oh&&e[oh]||e["@@iterator"],typeof e=="function"?e:null)}var Le=Object.assign,Xc;function Si(e){if(Xc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Xc=t&&t[1]||""}return`
34
+ `+Xc+e}var Zc=!1;function ed(e,t){if(!e||Zc)return"";Zc=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var r=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){r=d}e.call(t.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var a=d.stack.split(`
35
+ `),i=r.stack.split(`
36
+ `),l=a.length-1,o=i.length-1;1<=l&&0<=o&&a[l]!==i[o];)o--;for(;1<=l&&0<=o;l--,o--)if(a[l]!==i[o]){if(l!==1||o!==1)do if(l--,o--,0>o||a[l]!==i[o]){var c=`
37
+ `+a[l].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=l&&0<=o);break}}}finally{Zc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Si(e):""}function t1(e){switch(e.tag){case 5:return Si(e.type);case 16:return Si("Lazy");case 13:return Si("Suspense");case 19:return Si("SuspenseList");case 0:case 2:case 15:return e=ed(e.type,!1),e;case 11:return e=ed(e.type.render,!1),e;case 1:return e=ed(e.type,!0),e;default:return""}}function ru(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ua:return"Fragment";case da:return"Portal";case tu:return"Profiler";case Fx:return"StrictMode";case su:return"Suspense";case nu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case If:return(e.displayName||"Context")+".Consumer";case Df:return(e._context.displayName||"Context")+".Provider";case Lx:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _x:return t=e.displayName||null,t!==null?t:ru(e.type)||"Memo";case pn:t=e._payload,e=e._init;try{return ru(e(t))}catch{}}return null}function s1(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ru(t);case 8:return t===Fx?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Bn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Lf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function n1(e){var t=Lf(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(l){r=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _l(e){e._valueTracker||(e._valueTracker=n1(e))}function _f(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Lf(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Po(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function au(e,t){var n=t.checked;return Le({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ch(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Bn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function $f(e,t){t=t.checked,t!=null&&Ix(e,"checked",t,!1)}function iu(e,t){$f(e,t);var n=Bn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?lu(e,t.type,n):t.hasOwnProperty("defaultValue")&&lu(e,t.type,Bn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function dh(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function lu(e,t,n){(t!=="number"||Po(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ci=Array.isArray;function Na(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Bn(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function ou(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(q(91));return Le({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function uh(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(q(92));if(Ci(n)){if(1<n.length)throw Error(q(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Bn(n)}}function Uf(e,t){var n=Bn(t.value),r=Bn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function xh(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Bf(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function cu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Bf(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var $l,qf=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,a){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for($l=$l||document.createElement("div"),$l.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=$l.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ki(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Oi={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},r1=["Webkit","ms","Moz","O"];Object.keys(Oi).forEach(function(e){r1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Oi[t]=Oi[e]})});function Hf(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Oi.hasOwnProperty(e)&&Oi[e]?(""+t).trim():t+"px"}function Kf(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,a=Hf(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}var a1=Le({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 du(e,t){if(t){if(a1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(q(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(q(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(q(61))}if(t.style!=null&&typeof t.style!="object")throw Error(q(62))}}function uu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xu=null;function $x(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mu=null,wa=null,ka=null;function mh(e){if(e=Cl(e)){if(typeof mu!="function")throw Error(q(280));var t=e.stateNode;t&&(t=jc(t),mu(e.stateNode,e.type,t))}}function Wf(e){wa?ka?ka.push(e):ka=[e]:wa=e}function Vf(){if(wa){var e=wa,t=ka;if(ka=wa=null,mh(e),t)for(e=0;e<t.length;e++)mh(t[e])}}function Gf(e,t){return e(t)}function Qf(){}var td=!1;function Yf(e,t,n){if(td)return e(t,n);td=!0;try{return Gf(e,t,n)}finally{td=!1,(wa!==null||ka!==null)&&(Qf(),Vf())}}function Wi(e,t){var n=e.stateNode;if(n===null)return null;var r=jc(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(q(231,t,typeof n));return n}var hu=!1;if(Xs)try{var li={};Object.defineProperty(li,"passive",{get:function(){hu=!0}}),window.addEventListener("test",li,li),window.removeEventListener("test",li,li)}catch{hu=!1}function i1(e,t,n,r,a,i,l,o,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(x){this.onError(x)}}var Di=!1,Ro=null,Mo=!1,pu=null,l1={onError:function(e){Di=!0,Ro=e}};function o1(e,t,n,r,a,i,l,o,c){Di=!1,Ro=null,i1.apply(l1,arguments)}function c1(e,t,n,r,a,i,l,o,c){if(o1.apply(this,arguments),Di){if(Di){var d=Ro;Di=!1,Ro=null}else throw Error(q(198));Mo||(Mo=!0,pu=d)}}function Hr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Jf(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function hh(e){if(Hr(e)!==e)throw Error(q(188))}function d1(e){var t=e.alternate;if(!t){if(t=Hr(e),t===null)throw Error(q(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var i=a.alternate;if(i===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===n)return hh(a),e;if(i===r)return hh(a),t;i=i.sibling}throw Error(q(188))}if(n.return!==r.return)n=a,r=i;else{for(var l=!1,o=a.child;o;){if(o===n){l=!0,n=a,r=i;break}if(o===r){l=!0,r=a,n=i;break}o=o.sibling}if(!l){for(o=i.child;o;){if(o===n){l=!0,n=i,r=a;break}if(o===r){l=!0,r=i,n=a;break}o=o.sibling}if(!l)throw Error(q(189))}}if(n.alternate!==r)throw Error(q(190))}if(n.tag!==3)throw Error(q(188));return n.stateNode.current===n?e:t}function Xf(e){return e=d1(e),e!==null?Zf(e):null}function Zf(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Zf(e);if(t!==null)return t;e=e.sibling}return null}var e0=Ht.unstable_scheduleCallback,ph=Ht.unstable_cancelCallback,u1=Ht.unstable_shouldYield,x1=Ht.unstable_requestPaint,Be=Ht.unstable_now,m1=Ht.unstable_getCurrentPriorityLevel,Ux=Ht.unstable_ImmediatePriority,t0=Ht.unstable_UserBlockingPriority,To=Ht.unstable_NormalPriority,h1=Ht.unstable_LowPriority,s0=Ht.unstable_IdlePriority,gc=null,Cs=null;function p1(e){if(Cs&&typeof Cs.onCommitFiberRoot=="function")try{Cs.onCommitFiberRoot(gc,e,void 0,(e.current.flags&128)===128)}catch{}}var fs=Math.clz32?Math.clz32:y1,f1=Math.log,g1=Math.LN2;function y1(e){return e>>>=0,e===0?32:31-(f1(e)/g1|0)|0}var Ul=64,Bl=4194304;function Ei(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function zo(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,a=e.suspendedLanes,i=e.pingedLanes,l=n&268435455;if(l!==0){var o=l&~a;o!==0?r=Ei(o):(i&=l,i!==0&&(r=Ei(i)))}else l=n&~a,l!==0?r=Ei(l):i!==0&&(r=Ei(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&a)&&(a=r&-r,i=t&-t,a>=i||a===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-fs(t),a=1<<n,r|=e[n],t&=~a;return r}function b1(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function v1(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes;0<i;){var l=31-fs(i),o=1<<l,c=a[l];c===-1?(!(o&n)||o&r)&&(a[l]=b1(o,t)):c<=t&&(e.expiredLanes|=o),i&=~o}}function fu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function n0(){var e=Ul;return Ul<<=1,!(Ul&4194240)&&(Ul=64),e}function sd(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function kl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-fs(t),e[t]=n}function j1(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var a=31-fs(n),i=1<<a;t[a]=0,r[a]=-1,e[a]=-1,n&=~i}}function Bx(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-fs(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}var Ce=0;function r0(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var a0,qx,i0,l0,o0,gu=!1,ql=[],zn=null,An=null,On=null,Vi=new Map,Gi=new Map,gn=[],N1="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 fh(e,t){switch(e){case"focusin":case"focusout":zn=null;break;case"dragenter":case"dragleave":An=null;break;case"mouseover":case"mouseout":On=null;break;case"pointerover":case"pointerout":Vi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gi.delete(t.pointerId)}}function oi(e,t,n,r,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[a]},t!==null&&(t=Cl(t),t!==null&&qx(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function w1(e,t,n,r,a){switch(t){case"focusin":return zn=oi(zn,e,t,n,r,a),!0;case"dragenter":return An=oi(An,e,t,n,r,a),!0;case"mouseover":return On=oi(On,e,t,n,r,a),!0;case"pointerover":var i=a.pointerId;return Vi.set(i,oi(Vi.get(i)||null,e,t,n,r,a)),!0;case"gotpointercapture":return i=a.pointerId,Gi.set(i,oi(Gi.get(i)||null,e,t,n,r,a)),!0}return!1}function c0(e){var t=hr(e.target);if(t!==null){var n=Hr(t);if(n!==null){if(t=n.tag,t===13){if(t=Jf(n),t!==null){e.blockedOn=t,o0(e.priority,function(){i0(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ho(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=yu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);xu=r,n.target.dispatchEvent(r),xu=null}else return t=Cl(n),t!==null&&qx(t),e.blockedOn=n,!1;t.shift()}return!0}function gh(e,t,n){ho(e)&&n.delete(t)}function k1(){gu=!1,zn!==null&&ho(zn)&&(zn=null),An!==null&&ho(An)&&(An=null),On!==null&&ho(On)&&(On=null),Vi.forEach(gh),Gi.forEach(gh)}function ci(e,t){e.blockedOn===t&&(e.blockedOn=null,gu||(gu=!0,Ht.unstable_scheduleCallback(Ht.unstable_NormalPriority,k1)))}function Qi(e){function t(a){return ci(a,e)}if(0<ql.length){ci(ql[0],e);for(var n=1;n<ql.length;n++){var r=ql[n];r.blockedOn===e&&(r.blockedOn=null)}}for(zn!==null&&ci(zn,e),An!==null&&ci(An,e),On!==null&&ci(On,e),Vi.forEach(t),Gi.forEach(t),n=0;n<gn.length;n++)r=gn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<gn.length&&(n=gn[0],n.blockedOn===null);)c0(n),n.blockedOn===null&&gn.shift()}var Sa=an.ReactCurrentBatchConfig,Ao=!0;function S1(e,t,n,r){var a=Ce,i=Sa.transition;Sa.transition=null;try{Ce=1,Hx(e,t,n,r)}finally{Ce=a,Sa.transition=i}}function C1(e,t,n,r){var a=Ce,i=Sa.transition;Sa.transition=null;try{Ce=4,Hx(e,t,n,r)}finally{Ce=a,Sa.transition=i}}function Hx(e,t,n,r){if(Ao){var a=yu(e,t,n,r);if(a===null)xd(e,t,r,Oo,n),fh(e,r);else if(w1(a,e,t,n,r))r.stopPropagation();else if(fh(e,r),t&4&&-1<N1.indexOf(e)){for(;a!==null;){var i=Cl(a);if(i!==null&&a0(i),i=yu(e,t,n,r),i===null&&xd(e,t,r,Oo,n),i===a)break;a=i}a!==null&&r.stopPropagation()}else xd(e,t,r,null,n)}}var Oo=null;function yu(e,t,n,r){if(Oo=null,e=$x(r),e=hr(e),e!==null)if(t=Hr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Jf(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Oo=e,null}function d0(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(m1()){case Ux:return 1;case t0:return 4;case To:case h1:return 16;case s0:return 536870912;default:return 16}default:return 16}}var Rn=null,Kx=null,po=null;function u0(){if(po)return po;var e,t=Kx,n=t.length,r,a="value"in Rn?Rn.value:Rn.textContent,i=a.length;for(e=0;e<n&&t[e]===a[e];e++);var l=n-e;for(r=1;r<=l&&t[n-r]===a[i-r];r++);return po=a.slice(e,1<r?1-r:void 0)}function fo(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Hl(){return!0}function yh(){return!1}function Vt(e){function t(n,r,a,i,l){this._reactName=n,this._targetInst=a,this.type=r,this.nativeEvent=i,this.target=l,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Hl:yh,this.isPropagationStopped=yh,this}return Le(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Hl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Hl)},persist:function(){},isPersistent:Hl}),t}var Za={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wx=Vt(Za),Sl=Le({},Za,{view:0,detail:0}),E1=Vt(Sl),nd,rd,di,yc=Le({},Sl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vx,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==di&&(di&&e.type==="mousemove"?(nd=e.screenX-di.screenX,rd=e.screenY-di.screenY):rd=nd=0,di=e),nd)},movementY:function(e){return"movementY"in e?e.movementY:rd}}),bh=Vt(yc),P1=Le({},yc,{dataTransfer:0}),R1=Vt(P1),M1=Le({},Sl,{relatedTarget:0}),ad=Vt(M1),T1=Le({},Za,{animationName:0,elapsedTime:0,pseudoElement:0}),z1=Vt(T1),A1=Le({},Za,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),O1=Vt(A1),D1=Le({},Za,{data:0}),vh=Vt(D1),I1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},F1={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"},L1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=L1[e])?!!t[e]:!1}function Vx(){return _1}var $1=Le({},Sl,{key:function(e){if(e.key){var t=I1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=fo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?F1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vx,charCode:function(e){return e.type==="keypress"?fo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?fo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),U1=Vt($1),B1=Le({},yc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jh=Vt(B1),q1=Le({},Sl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vx}),H1=Vt(q1),K1=Le({},Za,{propertyName:0,elapsedTime:0,pseudoElement:0}),W1=Vt(K1),V1=Le({},yc,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),G1=Vt(V1),Q1=[9,13,27,32],Gx=Xs&&"CompositionEvent"in window,Ii=null;Xs&&"documentMode"in document&&(Ii=document.documentMode);var Y1=Xs&&"TextEvent"in window&&!Ii,x0=Xs&&(!Gx||Ii&&8<Ii&&11>=Ii),Nh=" ",wh=!1;function m0(e,t){switch(e){case"keyup":return Q1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function h0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xa=!1;function J1(e,t){switch(e){case"compositionend":return h0(t);case"keypress":return t.which!==32?null:(wh=!0,Nh);case"textInput":return e=t.data,e===Nh&&wh?null:e;default:return null}}function X1(e,t){if(xa)return e==="compositionend"||!Gx&&m0(e,t)?(e=u0(),po=Kx=Rn=null,xa=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return x0&&t.locale!=="ko"?null:t.data;default:return null}}var Z1={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 kh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Z1[e.type]:t==="textarea"}function p0(e,t,n,r){Wf(r),t=Do(t,"onChange"),0<t.length&&(n=new Wx("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Fi=null,Yi=null;function ev(e){C0(e,0)}function bc(e){var t=pa(e);if(_f(t))return e}function tv(e,t){if(e==="change")return t}var f0=!1;if(Xs){var id;if(Xs){var ld="oninput"in document;if(!ld){var Sh=document.createElement("div");Sh.setAttribute("oninput","return;"),ld=typeof Sh.oninput=="function"}id=ld}else id=!1;f0=id&&(!document.documentMode||9<document.documentMode)}function Ch(){Fi&&(Fi.detachEvent("onpropertychange",g0),Yi=Fi=null)}function g0(e){if(e.propertyName==="value"&&bc(Yi)){var t=[];p0(t,Yi,e,$x(e)),Yf(ev,t)}}function sv(e,t,n){e==="focusin"?(Ch(),Fi=t,Yi=n,Fi.attachEvent("onpropertychange",g0)):e==="focusout"&&Ch()}function nv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return bc(Yi)}function rv(e,t){if(e==="click")return bc(t)}function av(e,t){if(e==="input"||e==="change")return bc(t)}function iv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ys=typeof Object.is=="function"?Object.is:iv;function Ji(e,t){if(ys(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var a=n[r];if(!eu.call(t,a)||!ys(e[a],t[a]))return!1}return!0}function Eh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ph(e,t){var n=Eh(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Eh(n)}}function y0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?y0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function b0(){for(var e=window,t=Po();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Po(e.document)}return t}function Qx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function lv(e){var t=b0(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&y0(n.ownerDocument.documentElement,n)){if(r!==null&&Qx(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=n.textContent.length,i=Math.min(r.start,a);r=r.end===void 0?i:Math.min(r.end,a),!e.extend&&i>r&&(a=r,r=i,i=a),a=Ph(n,i);var l=Ph(n,r);a&&l&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ov=Xs&&"documentMode"in document&&11>=document.documentMode,ma=null,bu=null,Li=null,vu=!1;function Rh(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;vu||ma==null||ma!==Po(r)||(r=ma,"selectionStart"in r&&Qx(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Li&&Ji(Li,r)||(Li=r,r=Do(bu,"onSelect"),0<r.length&&(t=new Wx("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ma)))}function Kl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ha={animationend:Kl("Animation","AnimationEnd"),animationiteration:Kl("Animation","AnimationIteration"),animationstart:Kl("Animation","AnimationStart"),transitionend:Kl("Transition","TransitionEnd")},od={},v0={};Xs&&(v0=document.createElement("div").style,"AnimationEvent"in window||(delete ha.animationend.animation,delete ha.animationiteration.animation,delete ha.animationstart.animation),"TransitionEvent"in window||delete ha.transitionend.transition);function vc(e){if(od[e])return od[e];if(!ha[e])return e;var t=ha[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in v0)return od[e]=t[n];return e}var j0=vc("animationend"),N0=vc("animationiteration"),w0=vc("animationstart"),k0=vc("transitionend"),S0=new Map,Mh="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 Gn(e,t){S0.set(e,t),qr(t,[e])}for(var cd=0;cd<Mh.length;cd++){var dd=Mh[cd],cv=dd.toLowerCase(),dv=dd[0].toUpperCase()+dd.slice(1);Gn(cv,"on"+dv)}Gn(j0,"onAnimationEnd");Gn(N0,"onAnimationIteration");Gn(w0,"onAnimationStart");Gn("dblclick","onDoubleClick");Gn("focusin","onFocus");Gn("focusout","onBlur");Gn(k0,"onTransitionEnd");$a("onMouseEnter",["mouseout","mouseover"]);$a("onMouseLeave",["mouseout","mouseover"]);$a("onPointerEnter",["pointerout","pointerover"]);$a("onPointerLeave",["pointerout","pointerover"]);qr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));qr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));qr("onBeforeInput",["compositionend","keypress","textInput","paste"]);qr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));qr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));qr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pi="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(" "),uv=new Set("cancel close invalid load scroll toggle".split(" ").concat(Pi));function Th(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,c1(r,t,void 0,e),e.currentTarget=null}function C0(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var l=r.length-1;0<=l;l--){var o=r[l],c=o.instance,d=o.currentTarget;if(o=o.listener,c!==i&&a.isPropagationStopped())break e;Th(a,o,d),i=c}else for(l=0;l<r.length;l++){if(o=r[l],c=o.instance,d=o.currentTarget,o=o.listener,c!==i&&a.isPropagationStopped())break e;Th(a,o,d),i=c}}}if(Mo)throw e=pu,Mo=!1,pu=null,e}function Me(e,t){var n=t[Su];n===void 0&&(n=t[Su]=new Set);var r=e+"__bubble";n.has(r)||(E0(t,e,2,!1),n.add(r))}function ud(e,t,n){var r=0;t&&(r|=4),E0(n,e,r,t)}var Wl="_reactListening"+Math.random().toString(36).slice(2);function Xi(e){if(!e[Wl]){e[Wl]=!0,Of.forEach(function(n){n!=="selectionchange"&&(uv.has(n)||ud(n,!1,e),ud(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Wl]||(t[Wl]=!0,ud("selectionchange",!1,t))}}function E0(e,t,n,r){switch(d0(t)){case 1:var a=S1;break;case 4:a=C1;break;default:a=Hx}n=a.bind(null,t,n,e),a=void 0,!hu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),r?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function xd(e,t,n,r,a){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var l=r.tag;if(l===3||l===4){var o=r.stateNode.containerInfo;if(o===a||o.nodeType===8&&o.parentNode===a)break;if(l===4)for(l=r.return;l!==null;){var c=l.tag;if((c===3||c===4)&&(c=l.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;l=l.return}for(;o!==null;){if(l=hr(o),l===null)return;if(c=l.tag,c===5||c===6){r=i=l;continue e}o=o.parentNode}}r=r.return}Yf(function(){var d=i,x=$x(n),p=[];e:{var y=S0.get(e);if(y!==void 0){var b=Wx,f=e;switch(e){case"keypress":if(fo(n)===0)break e;case"keydown":case"keyup":b=U1;break;case"focusin":f="focus",b=ad;break;case"focusout":f="blur",b=ad;break;case"beforeblur":case"afterblur":b=ad;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":b=bh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":b=R1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":b=H1;break;case j0:case N0:case w0:b=z1;break;case k0:b=W1;break;case"scroll":b=E1;break;case"wheel":b=G1;break;case"copy":case"cut":case"paste":b=O1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":b=jh}var v=(t&4)!==0,w=!v&&e==="scroll",h=v?y!==null?y+"Capture":null:y;v=[];for(var u=d,g;u!==null;){g=u;var j=g.stateNode;if(g.tag===5&&j!==null&&(g=j,h!==null&&(j=Wi(u,h),j!=null&&v.push(Zi(u,j,g)))),w)break;u=u.return}0<v.length&&(y=new b(y,f,null,n,x),p.push({event:y,listeners:v}))}}if(!(t&7)){e:{if(y=e==="mouseover"||e==="pointerover",b=e==="mouseout"||e==="pointerout",y&&n!==xu&&(f=n.relatedTarget||n.fromElement)&&(hr(f)||f[Zs]))break e;if((b||y)&&(y=x.window===x?x:(y=x.ownerDocument)?y.defaultView||y.parentWindow:window,b?(f=n.relatedTarget||n.toElement,b=d,f=f?hr(f):null,f!==null&&(w=Hr(f),f!==w||f.tag!==5&&f.tag!==6)&&(f=null)):(b=null,f=d),b!==f)){if(v=bh,j="onMouseLeave",h="onMouseEnter",u="mouse",(e==="pointerout"||e==="pointerover")&&(v=jh,j="onPointerLeave",h="onPointerEnter",u="pointer"),w=b==null?y:pa(b),g=f==null?y:pa(f),y=new v(j,u+"leave",b,n,x),y.target=w,y.relatedTarget=g,j=null,hr(x)===d&&(v=new v(h,u+"enter",f,n,x),v.target=g,v.relatedTarget=w,j=v),w=j,b&&f)t:{for(v=b,h=f,u=0,g=v;g;g=ea(g))u++;for(g=0,j=h;j;j=ea(j))g++;for(;0<u-g;)v=ea(v),u--;for(;0<g-u;)h=ea(h),g--;for(;u--;){if(v===h||h!==null&&v===h.alternate)break t;v=ea(v),h=ea(h)}v=null}else v=null;b!==null&&zh(p,y,b,v,!1),f!==null&&w!==null&&zh(p,w,f,v,!0)}}e:{if(y=d?pa(d):window,b=y.nodeName&&y.nodeName.toLowerCase(),b==="select"||b==="input"&&y.type==="file")var k=tv;else if(kh(y))if(f0)k=av;else{k=nv;var N=sv}else(b=y.nodeName)&&b.toLowerCase()==="input"&&(y.type==="checkbox"||y.type==="radio")&&(k=rv);if(k&&(k=k(e,d))){p0(p,k,n,x);break e}N&&N(e,y,d),e==="focusout"&&(N=y._wrapperState)&&N.controlled&&y.type==="number"&&lu(y,"number",y.value)}switch(N=d?pa(d):window,e){case"focusin":(kh(N)||N.contentEditable==="true")&&(ma=N,bu=d,Li=null);break;case"focusout":Li=bu=ma=null;break;case"mousedown":vu=!0;break;case"contextmenu":case"mouseup":case"dragend":vu=!1,Rh(p,n,x);break;case"selectionchange":if(ov)break;case"keydown":case"keyup":Rh(p,n,x)}var S;if(Gx)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else xa?m0(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(x0&&n.locale!=="ko"&&(xa||P!=="onCompositionStart"?P==="onCompositionEnd"&&xa&&(S=u0()):(Rn=x,Kx="value"in Rn?Rn.value:Rn.textContent,xa=!0)),N=Do(d,P),0<N.length&&(P=new vh(P,e,null,n,x),p.push({event:P,listeners:N}),S?P.data=S:(S=h0(n),S!==null&&(P.data=S)))),(S=Y1?J1(e,n):X1(e,n))&&(d=Do(d,"onBeforeInput"),0<d.length&&(x=new vh("onBeforeInput","beforeinput",null,n,x),p.push({event:x,listeners:d}),x.data=S))}C0(p,t)})}function Zi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Do(e,t){for(var n=t+"Capture",r=[];e!==null;){var a=e,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=Wi(e,n),i!=null&&r.unshift(Zi(e,i,a)),i=Wi(e,t),i!=null&&r.push(Zi(e,i,a))),e=e.return}return r}function ea(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function zh(e,t,n,r,a){for(var i=t._reactName,l=[];n!==null&&n!==r;){var o=n,c=o.alternate,d=o.stateNode;if(c!==null&&c===r)break;o.tag===5&&d!==null&&(o=d,a?(c=Wi(n,i),c!=null&&l.unshift(Zi(n,c,o))):a||(c=Wi(n,i),c!=null&&l.push(Zi(n,c,o)))),n=n.return}l.length!==0&&e.push({event:t,listeners:l})}var xv=/\r\n?/g,mv=/\u0000|\uFFFD/g;function Ah(e){return(typeof e=="string"?e:""+e).replace(xv,`
38
+ `).replace(mv,"")}function Vl(e,t,n){if(t=Ah(t),Ah(e)!==t&&n)throw Error(q(425))}function Io(){}var ju=null,Nu=null;function wu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ku=typeof setTimeout=="function"?setTimeout:void 0,hv=typeof clearTimeout=="function"?clearTimeout:void 0,Oh=typeof Promise=="function"?Promise:void 0,pv=typeof queueMicrotask=="function"?queueMicrotask:typeof Oh<"u"?function(e){return Oh.resolve(null).then(e).catch(fv)}:ku;function fv(e){setTimeout(function(){throw e})}function md(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(r===0){e.removeChild(a),Qi(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=a}while(n);Qi(t)}function Dn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Dh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var ei=Math.random().toString(36).slice(2),ks="__reactFiber$"+ei,el="__reactProps$"+ei,Zs="__reactContainer$"+ei,Su="__reactEvents$"+ei,gv="__reactListeners$"+ei,yv="__reactHandles$"+ei;function hr(e){var t=e[ks];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Zs]||n[ks]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Dh(e);e!==null;){if(n=e[ks])return n;e=Dh(e)}return t}e=n,n=e.parentNode}return null}function Cl(e){return e=e[ks]||e[Zs],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function pa(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(q(33))}function jc(e){return e[el]||null}var Cu=[],fa=-1;function Qn(e){return{current:e}}function Te(e){0>fa||(e.current=Cu[fa],Cu[fa]=null,fa--)}function Pe(e,t){fa++,Cu[fa]=e.current,e.current=t}var qn={},pt=Qn(qn),zt=Qn(!1),Dr=qn;function Ua(e,t){var n=e.type.contextTypes;if(!n)return qn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in n)a[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function At(e){return e=e.childContextTypes,e!=null}function Fo(){Te(zt),Te(pt)}function Ih(e,t,n){if(pt.current!==qn)throw Error(q(168));Pe(pt,t),Pe(zt,n)}function P0(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var a in r)if(!(a in t))throw Error(q(108,s1(e)||"Unknown",a));return Le({},n,r)}function Lo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||qn,Dr=pt.current,Pe(pt,e),Pe(zt,zt.current),!0}function Fh(e,t,n){var r=e.stateNode;if(!r)throw Error(q(169));n?(e=P0(e,t,Dr),r.__reactInternalMemoizedMergedChildContext=e,Te(zt),Te(pt),Pe(pt,e)):Te(zt),Pe(zt,n)}var Us=null,Nc=!1,hd=!1;function R0(e){Us===null?Us=[e]:Us.push(e)}function bv(e){Nc=!0,R0(e)}function Yn(){if(!hd&&Us!==null){hd=!0;var e=0,t=Ce;try{var n=Us;for(Ce=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Us=null,Nc=!1}catch(a){throw Us!==null&&(Us=Us.slice(e+1)),e0(Ux,Yn),a}finally{Ce=t,hd=!1}}return null}var ga=[],ya=0,_o=null,$o=0,Jt=[],Xt=0,Ir=null,Vs=1,Gs="";function cr(e,t){ga[ya++]=$o,ga[ya++]=_o,_o=e,$o=t}function M0(e,t,n){Jt[Xt++]=Vs,Jt[Xt++]=Gs,Jt[Xt++]=Ir,Ir=e;var r=Vs;e=Gs;var a=32-fs(r)-1;r&=~(1<<a),n+=1;var i=32-fs(t)+a;if(30<i){var l=a-a%5;i=(r&(1<<l)-1).toString(32),r>>=l,a-=l,Vs=1<<32-fs(t)+a|n<<a|r,Gs=i+e}else Vs=1<<i|n<<a|r,Gs=e}function Yx(e){e.return!==null&&(cr(e,1),M0(e,1,0))}function Jx(e){for(;e===_o;)_o=ga[--ya],ga[ya]=null,$o=ga[--ya],ga[ya]=null;for(;e===Ir;)Ir=Jt[--Xt],Jt[Xt]=null,Gs=Jt[--Xt],Jt[Xt]=null,Vs=Jt[--Xt],Jt[Xt]=null}var qt=null,Bt=null,Oe=!1,ms=null;function T0(e,t){var n=Zt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Lh(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,qt=e,Bt=Dn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,qt=e,Bt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ir!==null?{id:Vs,overflow:Gs}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Zt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,qt=e,Bt=null,!0):!1;default:return!1}}function Eu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Pu(e){if(Oe){var t=Bt;if(t){var n=t;if(!Lh(e,t)){if(Eu(e))throw Error(q(418));t=Dn(n.nextSibling);var r=qt;t&&Lh(e,t)?T0(r,n):(e.flags=e.flags&-4097|2,Oe=!1,qt=e)}}else{if(Eu(e))throw Error(q(418));e.flags=e.flags&-4097|2,Oe=!1,qt=e}}}function _h(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;qt=e}function Gl(e){if(e!==qt)return!1;if(!Oe)return _h(e),Oe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!wu(e.type,e.memoizedProps)),t&&(t=Bt)){if(Eu(e))throw z0(),Error(q(418));for(;t;)T0(e,t),t=Dn(t.nextSibling)}if(_h(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(q(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Bt=Dn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Bt=null}}else Bt=qt?Dn(e.stateNode.nextSibling):null;return!0}function z0(){for(var e=Bt;e;)e=Dn(e.nextSibling)}function Ba(){Bt=qt=null,Oe=!1}function Xx(e){ms===null?ms=[e]:ms.push(e)}var vv=an.ReactCurrentBatchConfig;function ui(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(q(309));var r=n.stateNode}if(!r)throw Error(q(147,e));var a=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(l){var o=a.refs;l===null?delete o[i]:o[i]=l},t._stringRef=i,t)}if(typeof e!="string")throw Error(q(284));if(!n._owner)throw Error(q(290,e))}return e}function Ql(e,t){throw e=Object.prototype.toString.call(t),Error(q(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function $h(e){var t=e._init;return t(e._payload)}function A0(e){function t(h,u){if(e){var g=h.deletions;g===null?(h.deletions=[u],h.flags|=16):g.push(u)}}function n(h,u){if(!e)return null;for(;u!==null;)t(h,u),u=u.sibling;return null}function r(h,u){for(h=new Map;u!==null;)u.key!==null?h.set(u.key,u):h.set(u.index,u),u=u.sibling;return h}function a(h,u){return h=_n(h,u),h.index=0,h.sibling=null,h}function i(h,u,g){return h.index=g,e?(g=h.alternate,g!==null?(g=g.index,g<u?(h.flags|=2,u):g):(h.flags|=2,u)):(h.flags|=1048576,u)}function l(h){return e&&h.alternate===null&&(h.flags|=2),h}function o(h,u,g,j){return u===null||u.tag!==6?(u=jd(g,h.mode,j),u.return=h,u):(u=a(u,g),u.return=h,u)}function c(h,u,g,j){var k=g.type;return k===ua?x(h,u,g.props.children,j,g.key):u!==null&&(u.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===pn&&$h(k)===u.type)?(j=a(u,g.props),j.ref=ui(h,u,g),j.return=h,j):(j=wo(g.type,g.key,g.props,null,h.mode,j),j.ref=ui(h,u,g),j.return=h,j)}function d(h,u,g,j){return u===null||u.tag!==4||u.stateNode.containerInfo!==g.containerInfo||u.stateNode.implementation!==g.implementation?(u=Nd(g,h.mode,j),u.return=h,u):(u=a(u,g.children||[]),u.return=h,u)}function x(h,u,g,j,k){return u===null||u.tag!==7?(u=Mr(g,h.mode,j,k),u.return=h,u):(u=a(u,g),u.return=h,u)}function p(h,u,g){if(typeof u=="string"&&u!==""||typeof u=="number")return u=jd(""+u,h.mode,g),u.return=h,u;if(typeof u=="object"&&u!==null){switch(u.$$typeof){case Ll:return g=wo(u.type,u.key,u.props,null,h.mode,g),g.ref=ui(h,null,u),g.return=h,g;case da:return u=Nd(u,h.mode,g),u.return=h,u;case pn:var j=u._init;return p(h,j(u._payload),g)}if(Ci(u)||ii(u))return u=Mr(u,h.mode,g,null),u.return=h,u;Ql(h,u)}return null}function y(h,u,g,j){var k=u!==null?u.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return k!==null?null:o(h,u,""+g,j);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Ll:return g.key===k?c(h,u,g,j):null;case da:return g.key===k?d(h,u,g,j):null;case pn:return k=g._init,y(h,u,k(g._payload),j)}if(Ci(g)||ii(g))return k!==null?null:x(h,u,g,j,null);Ql(h,g)}return null}function b(h,u,g,j,k){if(typeof j=="string"&&j!==""||typeof j=="number")return h=h.get(g)||null,o(u,h,""+j,k);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Ll:return h=h.get(j.key===null?g:j.key)||null,c(u,h,j,k);case da:return h=h.get(j.key===null?g:j.key)||null,d(u,h,j,k);case pn:var N=j._init;return b(h,u,g,N(j._payload),k)}if(Ci(j)||ii(j))return h=h.get(g)||null,x(u,h,j,k,null);Ql(u,j)}return null}function f(h,u,g,j){for(var k=null,N=null,S=u,P=u=0,$=null;S!==null&&P<g.length;P++){S.index>P?($=S,S=null):$=S.sibling;var M=y(h,S,g[P],j);if(M===null){S===null&&(S=$);break}e&&S&&M.alternate===null&&t(h,S),u=i(M,u,P),N===null?k=M:N.sibling=M,N=M,S=$}if(P===g.length)return n(h,S),Oe&&cr(h,P),k;if(S===null){for(;P<g.length;P++)S=p(h,g[P],j),S!==null&&(u=i(S,u,P),N===null?k=S:N.sibling=S,N=S);return Oe&&cr(h,P),k}for(S=r(h,S);P<g.length;P++)$=b(S,h,P,g[P],j),$!==null&&(e&&$.alternate!==null&&S.delete($.key===null?P:$.key),u=i($,u,P),N===null?k=$:N.sibling=$,N=$);return e&&S.forEach(function(V){return t(h,V)}),Oe&&cr(h,P),k}function v(h,u,g,j){var k=ii(g);if(typeof k!="function")throw Error(q(150));if(g=k.call(g),g==null)throw Error(q(151));for(var N=k=null,S=u,P=u=0,$=null,M=g.next();S!==null&&!M.done;P++,M=g.next()){S.index>P?($=S,S=null):$=S.sibling;var V=y(h,S,M.value,j);if(V===null){S===null&&(S=$);break}e&&S&&V.alternate===null&&t(h,S),u=i(V,u,P),N===null?k=V:N.sibling=V,N=V,S=$}if(M.done)return n(h,S),Oe&&cr(h,P),k;if(S===null){for(;!M.done;P++,M=g.next())M=p(h,M.value,j),M!==null&&(u=i(M,u,P),N===null?k=M:N.sibling=M,N=M);return Oe&&cr(h,P),k}for(S=r(h,S);!M.done;P++,M=g.next())M=b(S,h,P,M.value,j),M!==null&&(e&&M.alternate!==null&&S.delete(M.key===null?P:M.key),u=i(M,u,P),N===null?k=M:N.sibling=M,N=M);return e&&S.forEach(function(G){return t(h,G)}),Oe&&cr(h,P),k}function w(h,u,g,j){if(typeof g=="object"&&g!==null&&g.type===ua&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case Ll:e:{for(var k=g.key,N=u;N!==null;){if(N.key===k){if(k=g.type,k===ua){if(N.tag===7){n(h,N.sibling),u=a(N,g.props.children),u.return=h,h=u;break e}}else if(N.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===pn&&$h(k)===N.type){n(h,N.sibling),u=a(N,g.props),u.ref=ui(h,N,g),u.return=h,h=u;break e}n(h,N);break}else t(h,N);N=N.sibling}g.type===ua?(u=Mr(g.props.children,h.mode,j,g.key),u.return=h,h=u):(j=wo(g.type,g.key,g.props,null,h.mode,j),j.ref=ui(h,u,g),j.return=h,h=j)}return l(h);case da:e:{for(N=g.key;u!==null;){if(u.key===N)if(u.tag===4&&u.stateNode.containerInfo===g.containerInfo&&u.stateNode.implementation===g.implementation){n(h,u.sibling),u=a(u,g.children||[]),u.return=h,h=u;break e}else{n(h,u);break}else t(h,u);u=u.sibling}u=Nd(g,h.mode,j),u.return=h,h=u}return l(h);case pn:return N=g._init,w(h,u,N(g._payload),j)}if(Ci(g))return f(h,u,g,j);if(ii(g))return v(h,u,g,j);Ql(h,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,u!==null&&u.tag===6?(n(h,u.sibling),u=a(u,g),u.return=h,h=u):(n(h,u),u=jd(g,h.mode,j),u.return=h,h=u),l(h)):n(h,u)}return w}var qa=A0(!0),O0=A0(!1),Uo=Qn(null),Bo=null,ba=null,Zx=null;function em(){Zx=ba=Bo=null}function tm(e){var t=Uo.current;Te(Uo),e._currentValue=t}function Ru(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Ca(e,t){Bo=e,Zx=ba=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Tt=!0),e.firstContext=null)}function ss(e){var t=e._currentValue;if(Zx!==e)if(e={context:e,memoizedValue:t,next:null},ba===null){if(Bo===null)throw Error(q(308));ba=e,Bo.dependencies={lanes:0,firstContext:e}}else ba=ba.next=e;return t}var pr=null;function sm(e){pr===null?pr=[e]:pr.push(e)}function D0(e,t,n,r){var a=t.interleaved;return a===null?(n.next=n,sm(t)):(n.next=a.next,a.next=n),t.interleaved=n,en(e,r)}function en(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var fn=!1;function nm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function I0(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Qs(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function In(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ve&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,en(e,n)}return a=r.interleaved,a===null?(t.next=t,sm(r)):(t.next=a.next,a.next=t),r.interleaved=t,en(e,n)}function go(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bx(e,n)}}function Uh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?a=i=l:i=i.next=l,n=n.next}while(n!==null);i===null?a=i=t:i=i.next=t}else a=i=t;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function qo(e,t,n,r){var a=e.updateQueue;fn=!1;var i=a.firstBaseUpdate,l=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var c=o,d=c.next;c.next=null,l===null?i=d:l.next=d,l=c;var x=e.alternate;x!==null&&(x=x.updateQueue,o=x.lastBaseUpdate,o!==l&&(o===null?x.firstBaseUpdate=d:o.next=d,x.lastBaseUpdate=c))}if(i!==null){var p=a.baseState;l=0,x=d=c=null,o=i;do{var y=o.lane,b=o.eventTime;if((r&y)===y){x!==null&&(x=x.next={eventTime:b,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var f=e,v=o;switch(y=t,b=n,v.tag){case 1:if(f=v.payload,typeof f=="function"){p=f.call(b,p,y);break e}p=f;break e;case 3:f.flags=f.flags&-65537|128;case 0:if(f=v.payload,y=typeof f=="function"?f.call(b,p,y):f,y==null)break e;p=Le({},p,y);break e;case 2:fn=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,y=a.effects,y===null?a.effects=[o]:y.push(o))}else b={eventTime:b,lane:y,tag:o.tag,payload:o.payload,callback:o.callback,next:null},x===null?(d=x=b,c=p):x=x.next=b,l|=y;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;y=o,o=y.next,y.next=null,a.lastBaseUpdate=y,a.shared.pending=null}}while(!0);if(x===null&&(c=p),a.baseState=c,a.firstBaseUpdate=d,a.lastBaseUpdate=x,t=a.shared.interleaved,t!==null){a=t;do l|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);Lr|=l,e.lanes=l,e.memoizedState=p}}function Bh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(a!==null){if(r.callback=null,r=n,typeof a!="function")throw Error(q(191,a));a.call(r)}}}var El={},Es=Qn(El),tl=Qn(El),sl=Qn(El);function fr(e){if(e===El)throw Error(q(174));return e}function rm(e,t){switch(Pe(sl,t),Pe(tl,e),Pe(Es,El),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:cu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=cu(t,e)}Te(Es),Pe(Es,t)}function Ha(){Te(Es),Te(tl),Te(sl)}function F0(e){fr(sl.current);var t=fr(Es.current),n=cu(t,e.type);t!==n&&(Pe(tl,e),Pe(Es,n))}function am(e){tl.current===e&&(Te(Es),Te(tl))}var Ie=Qn(0);function Ho(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var pd=[];function im(){for(var e=0;e<pd.length;e++)pd[e]._workInProgressVersionPrimary=null;pd.length=0}var yo=an.ReactCurrentDispatcher,fd=an.ReactCurrentBatchConfig,Fr=0,Fe=null,Ge=null,et=null,Ko=!1,_i=!1,nl=0,jv=0;function dt(){throw Error(q(321))}function lm(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ys(e[n],t[n]))return!1;return!0}function om(e,t,n,r,a,i){if(Fr=i,Fe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,yo.current=e===null||e.memoizedState===null?Sv:Cv,e=n(r,a),_i){i=0;do{if(_i=!1,nl=0,25<=i)throw Error(q(301));i+=1,et=Ge=null,t.updateQueue=null,yo.current=Ev,e=n(r,a)}while(_i)}if(yo.current=Wo,t=Ge!==null&&Ge.next!==null,Fr=0,et=Ge=Fe=null,Ko=!1,t)throw Error(q(300));return e}function cm(){var e=nl!==0;return nl=0,e}function vs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return et===null?Fe.memoizedState=et=e:et=et.next=e,et}function ns(){if(Ge===null){var e=Fe.alternate;e=e!==null?e.memoizedState:null}else e=Ge.next;var t=et===null?Fe.memoizedState:et.next;if(t!==null)et=t,Ge=e;else{if(e===null)throw Error(q(310));Ge=e,e={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},et===null?Fe.memoizedState=et=e:et=et.next=e}return et}function rl(e,t){return typeof t=="function"?t(e):t}function gd(e){var t=ns(),n=t.queue;if(n===null)throw Error(q(311));n.lastRenderedReducer=e;var r=Ge,a=r.baseQueue,i=n.pending;if(i!==null){if(a!==null){var l=a.next;a.next=i.next,i.next=l}r.baseQueue=a=i,n.pending=null}if(a!==null){i=a.next,r=r.baseState;var o=l=null,c=null,d=i;do{var x=d.lane;if((Fr&x)===x)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var p={lane:x,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(o=c=p,l=r):c=c.next=p,Fe.lanes|=x,Lr|=x}d=d.next}while(d!==null&&d!==i);c===null?l=r:c.next=o,ys(r,t.memoizedState)||(Tt=!0),t.memoizedState=r,t.baseState=l,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){a=e;do i=a.lane,Fe.lanes|=i,Lr|=i,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function yd(e){var t=ns(),n=t.queue;if(n===null)throw Error(q(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,i=t.memoizedState;if(a!==null){n.pending=null;var l=a=a.next;do i=e(i,l.action),l=l.next;while(l!==a);ys(i,t.memoizedState)||(Tt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function L0(){}function _0(e,t){var n=Fe,r=ns(),a=t(),i=!ys(r.memoizedState,a);if(i&&(r.memoizedState=a,Tt=!0),r=r.queue,dm(B0.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||et!==null&&et.memoizedState.tag&1){if(n.flags|=2048,al(9,U0.bind(null,n,r,a,t),void 0,null),tt===null)throw Error(q(349));Fr&30||$0(n,t,a)}return a}function $0(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Fe.updateQueue,t===null?(t={lastEffect:null,stores:null},Fe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function U0(e,t,n,r){t.value=n,t.getSnapshot=r,q0(t)&&H0(e)}function B0(e,t,n){return n(function(){q0(t)&&H0(e)})}function q0(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ys(e,n)}catch{return!0}}function H0(e){var t=en(e,1);t!==null&&gs(t,e,1,-1)}function qh(e){var t=vs();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:rl,lastRenderedState:e},t.queue=e,e=e.dispatch=kv.bind(null,Fe,e),[t.memoizedState,e]}function al(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Fe.updateQueue,t===null?(t={lastEffect:null,stores:null},Fe.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function K0(){return ns().memoizedState}function bo(e,t,n,r){var a=vs();Fe.flags|=e,a.memoizedState=al(1|t,n,void 0,r===void 0?null:r)}function wc(e,t,n,r){var a=ns();r=r===void 0?null:r;var i=void 0;if(Ge!==null){var l=Ge.memoizedState;if(i=l.destroy,r!==null&&lm(r,l.deps)){a.memoizedState=al(t,n,i,r);return}}Fe.flags|=e,a.memoizedState=al(1|t,n,i,r)}function Hh(e,t){return bo(8390656,8,e,t)}function dm(e,t){return wc(2048,8,e,t)}function W0(e,t){return wc(4,2,e,t)}function V0(e,t){return wc(4,4,e,t)}function G0(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Q0(e,t,n){return n=n!=null?n.concat([e]):null,wc(4,4,G0.bind(null,t,e),n)}function um(){}function Y0(e,t){var n=ns();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&lm(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function J0(e,t){var n=ns();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&lm(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function X0(e,t,n){return Fr&21?(ys(n,t)||(n=n0(),Fe.lanes|=n,Lr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Tt=!0),e.memoizedState=n)}function Nv(e,t){var n=Ce;Ce=n!==0&&4>n?n:4,e(!0);var r=fd.transition;fd.transition={};try{e(!1),t()}finally{Ce=n,fd.transition=r}}function Z0(){return ns().memoizedState}function wv(e,t,n){var r=Ln(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},eg(e))tg(t,n);else if(n=D0(e,t,n,r),n!==null){var a=Nt();gs(n,e,r,a),sg(n,t,r)}}function kv(e,t,n){var r=Ln(e),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(eg(e))tg(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,o=i(l,n);if(a.hasEagerState=!0,a.eagerState=o,ys(o,l)){var c=t.interleaved;c===null?(a.next=a,sm(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}n=D0(e,t,a,r),n!==null&&(a=Nt(),gs(n,e,r,a),sg(n,t,r))}}function eg(e){var t=e.alternate;return e===Fe||t!==null&&t===Fe}function tg(e,t){_i=Ko=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function sg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bx(e,n)}}var Wo={readContext:ss,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useInsertionEffect:dt,useLayoutEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useMutableSource:dt,useSyncExternalStore:dt,useId:dt,unstable_isNewReconciler:!1},Sv={readContext:ss,useCallback:function(e,t){return vs().memoizedState=[e,t===void 0?null:t],e},useContext:ss,useEffect:Hh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,bo(4194308,4,G0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return bo(4194308,4,e,t)},useInsertionEffect:function(e,t){return bo(4,2,e,t)},useMemo:function(e,t){var n=vs();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=vs();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=wv.bind(null,Fe,e),[r.memoizedState,e]},useRef:function(e){var t=vs();return e={current:e},t.memoizedState=e},useState:qh,useDebugValue:um,useDeferredValue:function(e){return vs().memoizedState=e},useTransition:function(){var e=qh(!1),t=e[0];return e=Nv.bind(null,e[1]),vs().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Fe,a=vs();if(Oe){if(n===void 0)throw Error(q(407));n=n()}else{if(n=t(),tt===null)throw Error(q(349));Fr&30||$0(r,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,Hh(B0.bind(null,r,i,e),[e]),r.flags|=2048,al(9,U0.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=vs(),t=tt.identifierPrefix;if(Oe){var n=Gs,r=Vs;n=(r&~(1<<32-fs(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=nl++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=jv++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Cv={readContext:ss,useCallback:Y0,useContext:ss,useEffect:dm,useImperativeHandle:Q0,useInsertionEffect:W0,useLayoutEffect:V0,useMemo:J0,useReducer:gd,useRef:K0,useState:function(){return gd(rl)},useDebugValue:um,useDeferredValue:function(e){var t=ns();return X0(t,Ge.memoizedState,e)},useTransition:function(){var e=gd(rl)[0],t=ns().memoizedState;return[e,t]},useMutableSource:L0,useSyncExternalStore:_0,useId:Z0,unstable_isNewReconciler:!1},Ev={readContext:ss,useCallback:Y0,useContext:ss,useEffect:dm,useImperativeHandle:Q0,useInsertionEffect:W0,useLayoutEffect:V0,useMemo:J0,useReducer:yd,useRef:K0,useState:function(){return yd(rl)},useDebugValue:um,useDeferredValue:function(e){var t=ns();return Ge===null?t.memoizedState=e:X0(t,Ge.memoizedState,e)},useTransition:function(){var e=yd(rl)[0],t=ns().memoizedState;return[e,t]},useMutableSource:L0,useSyncExternalStore:_0,useId:Z0,unstable_isNewReconciler:!1};function ds(e,t){if(e&&e.defaultProps){t=Le({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Mu(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Le({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var kc={isMounted:function(e){return(e=e._reactInternals)?Hr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Nt(),a=Ln(e),i=Qs(r,a);i.payload=t,n!=null&&(i.callback=n),t=In(e,i,a),t!==null&&(gs(t,e,a,r),go(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Nt(),a=Ln(e),i=Qs(r,a);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=In(e,i,a),t!==null&&(gs(t,e,a,r),go(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Nt(),r=Ln(e),a=Qs(n,r);a.tag=2,t!=null&&(a.callback=t),t=In(e,a,r),t!==null&&(gs(t,e,r,n),go(t,e,r))}};function Kh(e,t,n,r,a,i,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,l):t.prototype&&t.prototype.isPureReactComponent?!Ji(n,r)||!Ji(a,i):!0}function ng(e,t,n){var r=!1,a=qn,i=t.contextType;return typeof i=="object"&&i!==null?i=ss(i):(a=At(t)?Dr:pt.current,r=t.contextTypes,i=(r=r!=null)?Ua(e,a):qn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=kc,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),t}function Wh(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&kc.enqueueReplaceState(t,t.state,null)}function Tu(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},nm(e);var i=t.contextType;typeof i=="object"&&i!==null?a.context=ss(i):(i=At(t)?Dr:pt.current,a.context=Ua(e,i)),a.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Mu(e,t,i,n),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&kc.enqueueReplaceState(a,a.state,null),qo(e,n,a,r),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Ka(e,t){try{var n="",r=t;do n+=t1(r),r=r.return;while(r);var a=n}catch(i){a=`
39
+ Error generating stack: `+i.message+`
40
+ `+i.stack}return{value:e,source:t,stack:a,digest:null}}function bd(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function zu(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Pv=typeof WeakMap=="function"?WeakMap:Map;function rg(e,t,n){n=Qs(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Go||(Go=!0,Bu=r),zu(e,t)},n}function ag(e,t,n){n=Qs(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var a=t.value;n.payload=function(){return r(a)},n.callback=function(){zu(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){zu(e,t),typeof r!="function"&&(Fn===null?Fn=new Set([this]):Fn.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),n}function Vh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Pv;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(n)||(a.add(n),e=Bv.bind(null,e,t,n),t.then(e,e))}function Gh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Qh(e,t,n,r,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Qs(-1,1),t.tag=2,In(n,t,1))),n.lanes|=1),e)}var Rv=an.ReactCurrentOwner,Tt=!1;function bt(e,t,n,r){t.child=e===null?O0(t,null,n,r):qa(t,e.child,n,r)}function Yh(e,t,n,r,a){n=n.render;var i=t.ref;return Ca(t,a),r=om(e,t,n,r,i,a),n=cm(),e!==null&&!Tt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,tn(e,t,a)):(Oe&&n&&Yx(t),t.flags|=1,bt(e,t,r,a),t.child)}function Jh(e,t,n,r,a){if(e===null){var i=n.type;return typeof i=="function"&&!bm(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,ig(e,t,i,r,a)):(e=wo(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&a)){var l=i.memoizedProps;if(n=n.compare,n=n!==null?n:Ji,n(l,r)&&e.ref===t.ref)return tn(e,t,a)}return t.flags|=1,e=_n(i,r),e.ref=t.ref,e.return=t,t.child=e}function ig(e,t,n,r,a){if(e!==null){var i=e.memoizedProps;if(Ji(i,r)&&e.ref===t.ref)if(Tt=!1,t.pendingProps=r=i,(e.lanes&a)!==0)e.flags&131072&&(Tt=!0);else return t.lanes=e.lanes,tn(e,t,a)}return Au(e,t,n,r,a)}function lg(e,t,n){var r=t.pendingProps,a=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Pe(ja,$t),$t|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Pe(ja,$t),$t|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Pe(ja,$t),$t|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Pe(ja,$t),$t|=r;return bt(e,t,a,n),t.child}function og(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Au(e,t,n,r,a){var i=At(n)?Dr:pt.current;return i=Ua(t,i),Ca(t,a),n=om(e,t,n,r,i,a),r=cm(),e!==null&&!Tt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,tn(e,t,a)):(Oe&&r&&Yx(t),t.flags|=1,bt(e,t,n,a),t.child)}function Xh(e,t,n,r,a){if(At(n)){var i=!0;Lo(t)}else i=!1;if(Ca(t,a),t.stateNode===null)vo(e,t),ng(t,n,r),Tu(t,n,r,a),r=!0;else if(e===null){var l=t.stateNode,o=t.memoizedProps;l.props=o;var c=l.context,d=n.contextType;typeof d=="object"&&d!==null?d=ss(d):(d=At(n)?Dr:pt.current,d=Ua(t,d));var x=n.getDerivedStateFromProps,p=typeof x=="function"||typeof l.getSnapshotBeforeUpdate=="function";p||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(o!==r||c!==d)&&Wh(t,l,r,d),fn=!1;var y=t.memoizedState;l.state=y,qo(t,r,l,a),c=t.memoizedState,o!==r||y!==c||zt.current||fn?(typeof x=="function"&&(Mu(t,n,x,r),c=t.memoizedState),(o=fn||Kh(t,n,o,r,y,c,d))?(p||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),l.props=r,l.state=c,l.context=d,r=o):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,I0(e,t),o=t.memoizedProps,d=t.type===t.elementType?o:ds(t.type,o),l.props=d,p=t.pendingProps,y=l.context,c=n.contextType,typeof c=="object"&&c!==null?c=ss(c):(c=At(n)?Dr:pt.current,c=Ua(t,c));var b=n.getDerivedStateFromProps;(x=typeof b=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(o!==p||y!==c)&&Wh(t,l,r,c),fn=!1,y=t.memoizedState,l.state=y,qo(t,r,l,a);var f=t.memoizedState;o!==p||y!==f||zt.current||fn?(typeof b=="function"&&(Mu(t,n,b,r),f=t.memoizedState),(d=fn||Kh(t,n,d,r,y,f,c)||!1)?(x||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,f,c),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,f,c)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||o===e.memoizedProps&&y===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&y===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=f),l.props=r,l.state=f,l.context=c,r=d):(typeof l.componentDidUpdate!="function"||o===e.memoizedProps&&y===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&y===e.memoizedState||(t.flags|=1024),r=!1)}return Ou(e,t,n,r,i,a)}function Ou(e,t,n,r,a,i){og(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return a&&Fh(t,n,!1),tn(e,t,i);r=t.stateNode,Rv.current=t;var o=l&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&l?(t.child=qa(t,e.child,null,i),t.child=qa(t,null,o,i)):bt(e,t,o,i),t.memoizedState=r.state,a&&Fh(t,n,!0),t.child}function cg(e){var t=e.stateNode;t.pendingContext?Ih(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ih(e,t.context,!1),rm(e,t.containerInfo)}function Zh(e,t,n,r,a){return Ba(),Xx(a),t.flags|=256,bt(e,t,n,r),t.child}var Du={dehydrated:null,treeContext:null,retryLane:0};function Iu(e){return{baseLanes:e,cachePool:null,transitions:null}}function dg(e,t,n){var r=t.pendingProps,a=Ie.current,i=!1,l=(t.flags&128)!==0,o;if((o=l)||(o=e!==null&&e.memoizedState===null?!1:(a&2)!==0),o?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),Pe(Ie,a&1),e===null)return Pu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=r.children,e=r.fallback,i?(r=t.mode,i=t.child,l={mode:"hidden",children:l},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=l):i=Ec(l,r,0,null),e=Mr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Iu(n),t.memoizedState=Du,e):xm(t,l));if(a=e.memoizedState,a!==null&&(o=a.dehydrated,o!==null))return Mv(e,t,l,r,o,a,n);if(i){i=r.fallback,l=t.mode,a=e.child,o=a.sibling;var c={mode:"hidden",children:r.children};return!(l&1)&&t.child!==a?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=_n(a,c),r.subtreeFlags=a.subtreeFlags&14680064),o!==null?i=_n(o,i):(i=Mr(i,l,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,l=e.child.memoizedState,l=l===null?Iu(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},i.memoizedState=l,i.childLanes=e.childLanes&~n,t.memoizedState=Du,r}return i=e.child,e=i.sibling,r=_n(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function xm(e,t){return t=Ec({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Yl(e,t,n,r){return r!==null&&Xx(r),qa(t,e.child,null,n),e=xm(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Mv(e,t,n,r,a,i,l){if(n)return t.flags&256?(t.flags&=-257,r=bd(Error(q(422))),Yl(e,t,l,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,a=t.mode,r=Ec({mode:"visible",children:r.children},a,0,null),i=Mr(i,a,l,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&qa(t,e.child,null,l),t.child.memoizedState=Iu(l),t.memoizedState=Du,i);if(!(t.mode&1))return Yl(e,t,l,null);if(a.data==="$!"){if(r=a.nextSibling&&a.nextSibling.dataset,r)var o=r.dgst;return r=o,i=Error(q(419)),r=bd(i,r,void 0),Yl(e,t,l,r)}if(o=(l&e.childLanes)!==0,Tt||o){if(r=tt,r!==null){switch(l&-l){case 4:a=2;break;case 16:a=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:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(r.suspendedLanes|l)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,en(e,a),gs(r,e,a,-1))}return ym(),r=bd(Error(q(421))),Yl(e,t,l,r)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=qv.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,Bt=Dn(a.nextSibling),qt=t,Oe=!0,ms=null,e!==null&&(Jt[Xt++]=Vs,Jt[Xt++]=Gs,Jt[Xt++]=Ir,Vs=e.id,Gs=e.overflow,Ir=t),t=xm(t,r.children),t.flags|=4096,t)}function ep(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ru(e.return,t,n)}function vd(e,t,n,r,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=a)}function ug(e,t,n){var r=t.pendingProps,a=r.revealOrder,i=r.tail;if(bt(e,t,r.children,n),r=Ie.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ep(e,n,t);else if(e.tag===19)ep(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Pe(Ie,r),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&Ho(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),vd(t,!1,a,n,i);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Ho(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}vd(t,!0,n,null,i);break;case"together":vd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function vo(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function tn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Lr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(q(153));if(t.child!==null){for(e=t.child,n=_n(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=_n(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Tv(e,t,n){switch(t.tag){case 3:cg(t),Ba();break;case 5:F0(t);break;case 1:At(t.type)&&Lo(t);break;case 4:rm(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,a=t.memoizedProps.value;Pe(Uo,r._currentValue),r._currentValue=a;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Pe(Ie,Ie.current&1),t.flags|=128,null):n&t.child.childLanes?dg(e,t,n):(Pe(Ie,Ie.current&1),e=tn(e,t,n),e!==null?e.sibling:null);Pe(Ie,Ie.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return ug(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),Pe(Ie,Ie.current),r)break;return null;case 22:case 23:return t.lanes=0,lg(e,t,n)}return tn(e,t,n)}var xg,Fu,mg,hg;xg=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Fu=function(){};mg=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,fr(Es.current);var i=null;switch(n){case"input":a=au(e,a),r=au(e,r),i=[];break;case"select":a=Le({},a,{value:void 0}),r=Le({},r,{value:void 0}),i=[];break;case"textarea":a=ou(e,a),r=ou(e,r),i=[];break;default:typeof a.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Io)}du(n,r);var l;n=null;for(d in a)if(!r.hasOwnProperty(d)&&a.hasOwnProperty(d)&&a[d]!=null)if(d==="style"){var o=a[d];for(l in o)o.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(Hi.hasOwnProperty(d)?i||(i=[]):(i=i||[]).push(d,null));for(d in r){var c=r[d];if(o=a!=null?a[d]:void 0,r.hasOwnProperty(d)&&c!==o&&(c!=null||o!=null))if(d==="style")if(o){for(l in o)!o.hasOwnProperty(l)||c&&c.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in c)c.hasOwnProperty(l)&&o[l]!==c[l]&&(n||(n={}),n[l]=c[l])}else n||(i||(i=[]),i.push(d,n)),n=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,o=o?o.__html:void 0,c!=null&&o!==c&&(i=i||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(Hi.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&Me("scroll",e),i||o===c||(i=[])):(i=i||[]).push(d,c))}n&&(i=i||[]).push("style",n);var d=i;(t.updateQueue=d)&&(t.flags|=4)}};hg=function(e,t,n,r){n!==r&&(t.flags|=4)};function xi(e,t){if(!Oe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ut(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&14680064,r|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function zv(e,t,n){var r=t.pendingProps;switch(Jx(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(t),null;case 1:return At(t.type)&&Fo(),ut(t),null;case 3:return r=t.stateNode,Ha(),Te(zt),Te(pt),im(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Gl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ms!==null&&(Ku(ms),ms=null))),Fu(e,t),ut(t),null;case 5:am(t);var a=fr(sl.current);if(n=t.type,e!==null&&t.stateNode!=null)mg(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(q(166));return ut(t),null}if(e=fr(Es.current),Gl(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[ks]=t,r[el]=i,e=(t.mode&1)!==0,n){case"dialog":Me("cancel",r),Me("close",r);break;case"iframe":case"object":case"embed":Me("load",r);break;case"video":case"audio":for(a=0;a<Pi.length;a++)Me(Pi[a],r);break;case"source":Me("error",r);break;case"img":case"image":case"link":Me("error",r),Me("load",r);break;case"details":Me("toggle",r);break;case"input":ch(r,i),Me("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Me("invalid",r);break;case"textarea":uh(r,i),Me("invalid",r)}du(n,i),a=null;for(var l in i)if(i.hasOwnProperty(l)){var o=i[l];l==="children"?typeof o=="string"?r.textContent!==o&&(i.suppressHydrationWarning!==!0&&Vl(r.textContent,o,e),a=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(i.suppressHydrationWarning!==!0&&Vl(r.textContent,o,e),a=["children",""+o]):Hi.hasOwnProperty(l)&&o!=null&&l==="onScroll"&&Me("scroll",r)}switch(n){case"input":_l(r),dh(r,i,!0);break;case"textarea":_l(r),xh(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Io)}r=a,t.updateQueue=r,r!==null&&(t.flags|=4)}else{l=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Bf(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[ks]=t,e[el]=r,xg(e,t,!1,!1),t.stateNode=e;e:{switch(l=uu(n,r),n){case"dialog":Me("cancel",e),Me("close",e),a=r;break;case"iframe":case"object":case"embed":Me("load",e),a=r;break;case"video":case"audio":for(a=0;a<Pi.length;a++)Me(Pi[a],e);a=r;break;case"source":Me("error",e),a=r;break;case"img":case"image":case"link":Me("error",e),Me("load",e),a=r;break;case"details":Me("toggle",e),a=r;break;case"input":ch(e,r),a=au(e,r),Me("invalid",e);break;case"option":a=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=Le({},r,{value:void 0}),Me("invalid",e);break;case"textarea":uh(e,r),a=ou(e,r),Me("invalid",e);break;default:a=r}du(n,a),o=a;for(i in o)if(o.hasOwnProperty(i)){var c=o[i];i==="style"?Kf(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&qf(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Ki(e,c):typeof c=="number"&&Ki(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Hi.hasOwnProperty(i)?c!=null&&i==="onScroll"&&Me("scroll",e):c!=null&&Ix(e,i,c,l))}switch(n){case"input":_l(e),dh(e,r,!1);break;case"textarea":_l(e),xh(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Bn(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Na(e,!!r.multiple,i,!1):r.defaultValue!=null&&Na(e,!!r.multiple,r.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=Io)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ut(t),null;case 6:if(e&&t.stateNode!=null)hg(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(q(166));if(n=fr(sl.current),fr(Es.current),Gl(t)){if(r=t.stateNode,n=t.memoizedProps,r[ks]=t,(i=r.nodeValue!==n)&&(e=qt,e!==null))switch(e.tag){case 3:Vl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Vl(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ks]=t,t.stateNode=r}return ut(t),null;case 13:if(Te(Ie),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Oe&&Bt!==null&&t.mode&1&&!(t.flags&128))z0(),Ba(),t.flags|=98560,i=!1;else if(i=Gl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(q(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(q(317));i[ks]=t}else Ba(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ut(t),i=!1}else ms!==null&&(Ku(ms),ms=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ie.current&1?Je===0&&(Je=3):ym())),t.updateQueue!==null&&(t.flags|=4),ut(t),null);case 4:return Ha(),Fu(e,t),e===null&&Xi(t.stateNode.containerInfo),ut(t),null;case 10:return tm(t.type._context),ut(t),null;case 17:return At(t.type)&&Fo(),ut(t),null;case 19:if(Te(Ie),i=t.memoizedState,i===null)return ut(t),null;if(r=(t.flags&128)!==0,l=i.rendering,l===null)if(r)xi(i,!1);else{if(Je!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=Ho(e),l!==null){for(t.flags|=128,xi(i,!1),r=l.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,l=i.alternate,l===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=l.childLanes,i.lanes=l.lanes,i.child=l.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=l.memoizedProps,i.memoizedState=l.memoizedState,i.updateQueue=l.updateQueue,i.type=l.type,e=l.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Pe(Ie,Ie.current&1|2),t.child}e=e.sibling}i.tail!==null&&Be()>Wa&&(t.flags|=128,r=!0,xi(i,!1),t.lanes=4194304)}else{if(!r)if(e=Ho(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),xi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!Oe)return ut(t),null}else 2*Be()-i.renderingStartTime>Wa&&n!==1073741824&&(t.flags|=128,r=!0,xi(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(n=i.last,n!==null?n.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Be(),t.sibling=null,n=Ie.current,Pe(Ie,r?n&1|2:n&1),t):(ut(t),null);case 22:case 23:return gm(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?$t&1073741824&&(ut(t),t.subtreeFlags&6&&(t.flags|=8192)):ut(t),null;case 24:return null;case 25:return null}throw Error(q(156,t.tag))}function Av(e,t){switch(Jx(t),t.tag){case 1:return At(t.type)&&Fo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ha(),Te(zt),Te(pt),im(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return am(t),null;case 13:if(Te(Ie),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(q(340));Ba()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Te(Ie),null;case 4:return Ha(),null;case 10:return tm(t.type._context),null;case 22:case 23:return gm(),null;case 24:return null;default:return null}}var Jl=!1,mt=!1,Ov=typeof WeakSet=="function"?WeakSet:Set,J=null;function va(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){$e(e,t,r)}else n.current=null}function Lu(e,t,n){try{n()}catch(r){$e(e,t,r)}}var tp=!1;function Dv(e,t){if(ju=Ao,e=b0(),Qx(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var l=0,o=-1,c=-1,d=0,x=0,p=e,y=null;t:for(;;){for(var b;p!==n||a!==0&&p.nodeType!==3||(o=l+a),p!==i||r!==0&&p.nodeType!==3||(c=l+r),p.nodeType===3&&(l+=p.nodeValue.length),(b=p.firstChild)!==null;)y=p,p=b;for(;;){if(p===e)break t;if(y===n&&++d===a&&(o=l),y===i&&++x===r&&(c=l),(b=p.nextSibling)!==null)break;p=y,y=p.parentNode}p=b}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Nu={focusedElem:e,selectionRange:n},Ao=!1,J=t;J!==null;)if(t=J,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,J=e;else for(;J!==null;){t=J;try{var f=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(f!==null){var v=f.memoizedProps,w=f.memoizedState,h=t.stateNode,u=h.getSnapshotBeforeUpdate(t.elementType===t.type?v:ds(t.type,v),w);h.__reactInternalSnapshotBeforeUpdate=u}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(q(163))}}catch(j){$e(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,J=e;break}J=t.return}return f=tp,tp=!1,f}function $i(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&Lu(t,n,i)}a=a.next}while(a!==r)}}function Sc(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function _u(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function pg(e){var t=e.alternate;t!==null&&(e.alternate=null,pg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ks],delete t[el],delete t[Su],delete t[gv],delete t[yv])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function fg(e){return e.tag===5||e.tag===3||e.tag===4}function sp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $u(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Io));else if(r!==4&&(e=e.child,e!==null))for($u(e,t,n),e=e.sibling;e!==null;)$u(e,t,n),e=e.sibling}function Uu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Uu(e,t,n),e=e.sibling;e!==null;)Uu(e,t,n),e=e.sibling}var at=null,xs=!1;function un(e,t,n){for(n=n.child;n!==null;)gg(e,t,n),n=n.sibling}function gg(e,t,n){if(Cs&&typeof Cs.onCommitFiberUnmount=="function")try{Cs.onCommitFiberUnmount(gc,n)}catch{}switch(n.tag){case 5:mt||va(n,t);case 6:var r=at,a=xs;at=null,un(e,t,n),at=r,xs=a,at!==null&&(xs?(e=at,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):at.removeChild(n.stateNode));break;case 18:at!==null&&(xs?(e=at,n=n.stateNode,e.nodeType===8?md(e.parentNode,n):e.nodeType===1&&md(e,n),Qi(e)):md(at,n.stateNode));break;case 4:r=at,a=xs,at=n.stateNode.containerInfo,xs=!0,un(e,t,n),at=r,xs=a;break;case 0:case 11:case 14:case 15:if(!mt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){a=r=r.next;do{var i=a,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&Lu(n,t,l),a=a.next}while(a!==r)}un(e,t,n);break;case 1:if(!mt&&(va(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){$e(n,t,o)}un(e,t,n);break;case 21:un(e,t,n);break;case 22:n.mode&1?(mt=(r=mt)||n.memoizedState!==null,un(e,t,n),mt=r):un(e,t,n);break;default:un(e,t,n)}}function np(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Ov),t.forEach(function(r){var a=Hv.bind(null,e,r);n.has(r)||(n.add(r),r.then(a,a))})}}function ls(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r];try{var i=e,l=t,o=l;e:for(;o!==null;){switch(o.tag){case 5:at=o.stateNode,xs=!1;break e;case 3:at=o.stateNode.containerInfo,xs=!0;break e;case 4:at=o.stateNode.containerInfo,xs=!0;break e}o=o.return}if(at===null)throw Error(q(160));gg(i,l,a),at=null,xs=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(d){$e(a,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)yg(t,e),t=t.sibling}function yg(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ls(t,e),bs(e),r&4){try{$i(3,e,e.return),Sc(3,e)}catch(v){$e(e,e.return,v)}try{$i(5,e,e.return)}catch(v){$e(e,e.return,v)}}break;case 1:ls(t,e),bs(e),r&512&&n!==null&&va(n,n.return);break;case 5:if(ls(t,e),bs(e),r&512&&n!==null&&va(n,n.return),e.flags&32){var a=e.stateNode;try{Ki(a,"")}catch(v){$e(e,e.return,v)}}if(r&4&&(a=e.stateNode,a!=null)){var i=e.memoizedProps,l=n!==null?n.memoizedProps:i,o=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{o==="input"&&i.type==="radio"&&i.name!=null&&$f(a,i),uu(o,l);var d=uu(o,i);for(l=0;l<c.length;l+=2){var x=c[l],p=c[l+1];x==="style"?Kf(a,p):x==="dangerouslySetInnerHTML"?qf(a,p):x==="children"?Ki(a,p):Ix(a,x,p,d)}switch(o){case"input":iu(a,i);break;case"textarea":Uf(a,i);break;case"select":var y=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var b=i.value;b!=null?Na(a,!!i.multiple,b,!1):y!==!!i.multiple&&(i.defaultValue!=null?Na(a,!!i.multiple,i.defaultValue,!0):Na(a,!!i.multiple,i.multiple?[]:"",!1))}a[el]=i}catch(v){$e(e,e.return,v)}}break;case 6:if(ls(t,e),bs(e),r&4){if(e.stateNode===null)throw Error(q(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(v){$e(e,e.return,v)}}break;case 3:if(ls(t,e),bs(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Qi(t.containerInfo)}catch(v){$e(e,e.return,v)}break;case 4:ls(t,e),bs(e);break;case 13:ls(t,e),bs(e),a=e.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||(pm=Be())),r&4&&np(e);break;case 22:if(x=n!==null&&n.memoizedState!==null,e.mode&1?(mt=(d=mt)||x,ls(t,e),mt=d):ls(t,e),bs(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!x&&e.mode&1)for(J=e,x=e.child;x!==null;){for(p=J=x;J!==null;){switch(y=J,b=y.child,y.tag){case 0:case 11:case 14:case 15:$i(4,y,y.return);break;case 1:va(y,y.return);var f=y.stateNode;if(typeof f.componentWillUnmount=="function"){r=y,n=y.return;try{t=r,f.props=t.memoizedProps,f.state=t.memoizedState,f.componentWillUnmount()}catch(v){$e(r,n,v)}}break;case 5:va(y,y.return);break;case 22:if(y.memoizedState!==null){ap(p);continue}}b!==null?(b.return=y,J=b):ap(p)}x=x.sibling}e:for(x=null,p=e;;){if(p.tag===5){if(x===null){x=p;try{a=p.stateNode,d?(i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(o=p.stateNode,c=p.memoizedProps.style,l=c!=null&&c.hasOwnProperty("display")?c.display:null,o.style.display=Hf("display",l))}catch(v){$e(e,e.return,v)}}}else if(p.tag===6){if(x===null)try{p.stateNode.nodeValue=d?"":p.memoizedProps}catch(v){$e(e,e.return,v)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;x===p&&(x=null),p=p.return}x===p&&(x=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:ls(t,e),bs(e),r&4&&np(e);break;case 21:break;default:ls(t,e),bs(e)}}function bs(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(fg(n)){var r=n;break e}n=n.return}throw Error(q(160))}switch(r.tag){case 5:var a=r.stateNode;r.flags&32&&(Ki(a,""),r.flags&=-33);var i=sp(e);Uu(e,i,a);break;case 3:case 4:var l=r.stateNode.containerInfo,o=sp(e);$u(e,o,l);break;default:throw Error(q(161))}}catch(c){$e(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Iv(e,t,n){J=e,bg(e)}function bg(e,t,n){for(var r=(e.mode&1)!==0;J!==null;){var a=J,i=a.child;if(a.tag===22&&r){var l=a.memoizedState!==null||Jl;if(!l){var o=a.alternate,c=o!==null&&o.memoizedState!==null||mt;o=Jl;var d=mt;if(Jl=l,(mt=c)&&!d)for(J=a;J!==null;)l=J,c=l.child,l.tag===22&&l.memoizedState!==null?ip(a):c!==null?(c.return=l,J=c):ip(a);for(;i!==null;)J=i,bg(i),i=i.sibling;J=a,Jl=o,mt=d}rp(e)}else a.subtreeFlags&8772&&i!==null?(i.return=a,J=i):rp(e)}}function rp(e){for(;J!==null;){var t=J;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:mt||Sc(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!mt)if(n===null)r.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:ds(t.type,n.memoizedProps);r.componentDidUpdate(a,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Bh(t,i,r);break;case 3:var l=t.updateQueue;if(l!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Bh(t,l,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var x=d.memoizedState;if(x!==null){var p=x.dehydrated;p!==null&&Qi(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(q(163))}mt||t.flags&512&&_u(t)}catch(y){$e(t,t.return,y)}}if(t===e){J=null;break}if(n=t.sibling,n!==null){n.return=t.return,J=n;break}J=t.return}}function ap(e){for(;J!==null;){var t=J;if(t===e){J=null;break}var n=t.sibling;if(n!==null){n.return=t.return,J=n;break}J=t.return}}function ip(e){for(;J!==null;){var t=J;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Sc(4,t)}catch(c){$e(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var a=t.return;try{r.componentDidMount()}catch(c){$e(t,a,c)}}var i=t.return;try{_u(t)}catch(c){$e(t,i,c)}break;case 5:var l=t.return;try{_u(t)}catch(c){$e(t,l,c)}}}catch(c){$e(t,t.return,c)}if(t===e){J=null;break}var o=t.sibling;if(o!==null){o.return=t.return,J=o;break}J=t.return}}var Fv=Math.ceil,Vo=an.ReactCurrentDispatcher,mm=an.ReactCurrentOwner,es=an.ReactCurrentBatchConfig,ve=0,tt=null,We=null,it=0,$t=0,ja=Qn(0),Je=0,il=null,Lr=0,Cc=0,hm=0,Ui=null,Mt=null,pm=0,Wa=1/0,Ls=null,Go=!1,Bu=null,Fn=null,Xl=!1,Mn=null,Qo=0,Bi=0,qu=null,jo=-1,No=0;function Nt(){return ve&6?Be():jo!==-1?jo:jo=Be()}function Ln(e){return e.mode&1?ve&2&&it!==0?it&-it:vv.transition!==null?(No===0&&(No=n0()),No):(e=Ce,e!==0||(e=window.event,e=e===void 0?16:d0(e.type)),e):1}function gs(e,t,n,r){if(50<Bi)throw Bi=0,qu=null,Error(q(185));kl(e,n,r),(!(ve&2)||e!==tt)&&(e===tt&&(!(ve&2)&&(Cc|=n),Je===4&&yn(e,it)),Ot(e,r),n===1&&ve===0&&!(t.mode&1)&&(Wa=Be()+500,Nc&&Yn()))}function Ot(e,t){var n=e.callbackNode;v1(e,t);var r=zo(e,e===tt?it:0);if(r===0)n!==null&&ph(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&ph(n),t===1)e.tag===0?bv(lp.bind(null,e)):R0(lp.bind(null,e)),pv(function(){!(ve&6)&&Yn()}),n=null;else{switch(r0(r)){case 1:n=Ux;break;case 4:n=t0;break;case 16:n=To;break;case 536870912:n=s0;break;default:n=To}n=Eg(n,vg.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function vg(e,t){if(jo=-1,No=0,ve&6)throw Error(q(327));var n=e.callbackNode;if(Ea()&&e.callbackNode!==n)return null;var r=zo(e,e===tt?it:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Yo(e,r);else{t=r;var a=ve;ve|=2;var i=Ng();(tt!==e||it!==t)&&(Ls=null,Wa=Be()+500,Rr(e,t));do try{$v();break}catch(o){jg(e,o)}while(!0);em(),Vo.current=i,ve=a,We!==null?t=0:(tt=null,it=0,t=Je)}if(t!==0){if(t===2&&(a=fu(e),a!==0&&(r=a,t=Hu(e,a))),t===1)throw n=il,Rr(e,0),yn(e,r),Ot(e,Be()),n;if(t===6)yn(e,r);else{if(a=e.current.alternate,!(r&30)&&!Lv(a)&&(t=Yo(e,r),t===2&&(i=fu(e),i!==0&&(r=i,t=Hu(e,i))),t===1))throw n=il,Rr(e,0),yn(e,r),Ot(e,Be()),n;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(q(345));case 2:dr(e,Mt,Ls);break;case 3:if(yn(e,r),(r&130023424)===r&&(t=pm+500-Be(),10<t)){if(zo(e,0)!==0)break;if(a=e.suspendedLanes,(a&r)!==r){Nt(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=ku(dr.bind(null,e,Mt,Ls),t);break}dr(e,Mt,Ls);break;case 4:if(yn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,a=-1;0<r;){var l=31-fs(r);i=1<<l,l=t[l],l>a&&(a=l),r&=~i}if(r=a,r=Be()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Fv(r/1960))-r,10<r){e.timeoutHandle=ku(dr.bind(null,e,Mt,Ls),r);break}dr(e,Mt,Ls);break;case 5:dr(e,Mt,Ls);break;default:throw Error(q(329))}}}return Ot(e,Be()),e.callbackNode===n?vg.bind(null,e):null}function Hu(e,t){var n=Ui;return e.current.memoizedState.isDehydrated&&(Rr(e,t).flags|=256),e=Yo(e,t),e!==2&&(t=Mt,Mt=n,t!==null&&Ku(t)),e}function Ku(e){Mt===null?Mt=e:Mt.push.apply(Mt,e)}function Lv(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var a=n[r],i=a.getSnapshot;a=a.value;try{if(!ys(i(),a))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function yn(e,t){for(t&=~hm,t&=~Cc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-fs(t),r=1<<n;e[n]=-1,t&=~r}}function lp(e){if(ve&6)throw Error(q(327));Ea();var t=zo(e,0);if(!(t&1))return Ot(e,Be()),null;var n=Yo(e,t);if(e.tag!==0&&n===2){var r=fu(e);r!==0&&(t=r,n=Hu(e,r))}if(n===1)throw n=il,Rr(e,0),yn(e,t),Ot(e,Be()),n;if(n===6)throw Error(q(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,dr(e,Mt,Ls),Ot(e,Be()),null}function fm(e,t){var n=ve;ve|=1;try{return e(t)}finally{ve=n,ve===0&&(Wa=Be()+500,Nc&&Yn())}}function _r(e){Mn!==null&&Mn.tag===0&&!(ve&6)&&Ea();var t=ve;ve|=1;var n=es.transition,r=Ce;try{if(es.transition=null,Ce=1,e)return e()}finally{Ce=r,es.transition=n,ve=t,!(ve&6)&&Yn()}}function gm(){$t=ja.current,Te(ja)}function Rr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,hv(n)),We!==null)for(n=We.return;n!==null;){var r=n;switch(Jx(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Fo();break;case 3:Ha(),Te(zt),Te(pt),im();break;case 5:am(r);break;case 4:Ha();break;case 13:Te(Ie);break;case 19:Te(Ie);break;case 10:tm(r.type._context);break;case 22:case 23:gm()}n=n.return}if(tt=e,We=e=_n(e.current,null),it=$t=t,Je=0,il=null,hm=Cc=Lr=0,Mt=Ui=null,pr!==null){for(t=0;t<pr.length;t++)if(n=pr[t],r=n.interleaved,r!==null){n.interleaved=null;var a=r.next,i=n.pending;if(i!==null){var l=i.next;i.next=a,r.next=l}n.pending=r}pr=null}return e}function jg(e,t){do{var n=We;try{if(em(),yo.current=Wo,Ko){for(var r=Fe.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}Ko=!1}if(Fr=0,et=Ge=Fe=null,_i=!1,nl=0,mm.current=null,n===null||n.return===null){Je=1,il=t,We=null;break}e:{var i=e,l=n.return,o=n,c=t;if(t=it,o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,x=o,p=x.tag;if(!(x.mode&1)&&(p===0||p===11||p===15)){var y=x.alternate;y?(x.updateQueue=y.updateQueue,x.memoizedState=y.memoizedState,x.lanes=y.lanes):(x.updateQueue=null,x.memoizedState=null)}var b=Gh(l);if(b!==null){b.flags&=-257,Qh(b,l,o,i,t),b.mode&1&&Vh(i,d,t),t=b,c=d;var f=t.updateQueue;if(f===null){var v=new Set;v.add(c),t.updateQueue=v}else f.add(c);break e}else{if(!(t&1)){Vh(i,d,t),ym();break e}c=Error(q(426))}}else if(Oe&&o.mode&1){var w=Gh(l);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Qh(w,l,o,i,t),Xx(Ka(c,o));break e}}i=c=Ka(c,o),Je!==4&&(Je=2),Ui===null?Ui=[i]:Ui.push(i),i=l;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var h=rg(i,c,t);Uh(i,h);break e;case 1:o=c;var u=i.type,g=i.stateNode;if(!(i.flags&128)&&(typeof u.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Fn===null||!Fn.has(g)))){i.flags|=65536,t&=-t,i.lanes|=t;var j=ag(i,o,t);Uh(i,j);break e}}i=i.return}while(i!==null)}kg(n)}catch(k){t=k,We===n&&n!==null&&(We=n=n.return);continue}break}while(!0)}function Ng(){var e=Vo.current;return Vo.current=Wo,e===null?Wo:e}function ym(){(Je===0||Je===3||Je===2)&&(Je=4),tt===null||!(Lr&268435455)&&!(Cc&268435455)||yn(tt,it)}function Yo(e,t){var n=ve;ve|=2;var r=Ng();(tt!==e||it!==t)&&(Ls=null,Rr(e,t));do try{_v();break}catch(a){jg(e,a)}while(!0);if(em(),ve=n,Vo.current=r,We!==null)throw Error(q(261));return tt=null,it=0,Je}function _v(){for(;We!==null;)wg(We)}function $v(){for(;We!==null&&!u1();)wg(We)}function wg(e){var t=Cg(e.alternate,e,$t);e.memoizedProps=e.pendingProps,t===null?kg(e):We=t,mm.current=null}function kg(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Av(n,t),n!==null){n.flags&=32767,We=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Je=6,We=null;return}}else if(n=zv(n,t,$t),n!==null){We=n;return}if(t=t.sibling,t!==null){We=t;return}We=t=e}while(t!==null);Je===0&&(Je=5)}function dr(e,t,n){var r=Ce,a=es.transition;try{es.transition=null,Ce=1,Uv(e,t,n,r)}finally{es.transition=a,Ce=r}return null}function Uv(e,t,n,r){do Ea();while(Mn!==null);if(ve&6)throw Error(q(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(q(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(j1(e,i),e===tt&&(We=tt=null,it=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Xl||(Xl=!0,Eg(To,function(){return Ea(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=es.transition,es.transition=null;var l=Ce;Ce=1;var o=ve;ve|=4,mm.current=null,Dv(e,n),yg(n,e),lv(Nu),Ao=!!ju,Nu=ju=null,e.current=n,Iv(n),x1(),ve=o,Ce=l,es.transition=i}else e.current=n;if(Xl&&(Xl=!1,Mn=e,Qo=a),i=e.pendingLanes,i===0&&(Fn=null),p1(n.stateNode),Ot(e,Be()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],r(a.value,{componentStack:a.stack,digest:a.digest});if(Go)throw Go=!1,e=Bu,Bu=null,e;return Qo&1&&e.tag!==0&&Ea(),i=e.pendingLanes,i&1?e===qu?Bi++:(Bi=0,qu=e):Bi=0,Yn(),null}function Ea(){if(Mn!==null){var e=r0(Qo),t=es.transition,n=Ce;try{if(es.transition=null,Ce=16>e?16:e,Mn===null)var r=!1;else{if(e=Mn,Mn=null,Qo=0,ve&6)throw Error(q(331));var a=ve;for(ve|=4,J=e.current;J!==null;){var i=J,l=i.child;if(J.flags&16){var o=i.deletions;if(o!==null){for(var c=0;c<o.length;c++){var d=o[c];for(J=d;J!==null;){var x=J;switch(x.tag){case 0:case 11:case 15:$i(8,x,i)}var p=x.child;if(p!==null)p.return=x,J=p;else for(;J!==null;){x=J;var y=x.sibling,b=x.return;if(pg(x),x===d){J=null;break}if(y!==null){y.return=b,J=y;break}J=b}}}var f=i.alternate;if(f!==null){var v=f.child;if(v!==null){f.child=null;do{var w=v.sibling;v.sibling=null,v=w}while(v!==null)}}J=i}}if(i.subtreeFlags&2064&&l!==null)l.return=i,J=l;else e:for(;J!==null;){if(i=J,i.flags&2048)switch(i.tag){case 0:case 11:case 15:$i(9,i,i.return)}var h=i.sibling;if(h!==null){h.return=i.return,J=h;break e}J=i.return}}var u=e.current;for(J=u;J!==null;){l=J;var g=l.child;if(l.subtreeFlags&2064&&g!==null)g.return=l,J=g;else e:for(l=u;J!==null;){if(o=J,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:Sc(9,o)}}catch(k){$e(o,o.return,k)}if(o===l){J=null;break e}var j=o.sibling;if(j!==null){j.return=o.return,J=j;break e}J=o.return}}if(ve=a,Yn(),Cs&&typeof Cs.onPostCommitFiberRoot=="function")try{Cs.onPostCommitFiberRoot(gc,e)}catch{}r=!0}return r}finally{Ce=n,es.transition=t}}return!1}function op(e,t,n){t=Ka(n,t),t=rg(e,t,1),e=In(e,t,1),t=Nt(),e!==null&&(kl(e,1,t),Ot(e,t))}function $e(e,t,n){if(e.tag===3)op(e,e,n);else for(;t!==null;){if(t.tag===3){op(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Fn===null||!Fn.has(r))){e=Ka(n,e),e=ag(t,e,1),t=In(t,e,1),e=Nt(),t!==null&&(kl(t,1,e),Ot(t,e));break}}t=t.return}}function Bv(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Nt(),e.pingedLanes|=e.suspendedLanes&n,tt===e&&(it&n)===n&&(Je===4||Je===3&&(it&130023424)===it&&500>Be()-pm?Rr(e,0):hm|=n),Ot(e,t)}function Sg(e,t){t===0&&(e.mode&1?(t=Bl,Bl<<=1,!(Bl&130023424)&&(Bl=4194304)):t=1);var n=Nt();e=en(e,t),e!==null&&(kl(e,t,n),Ot(e,n))}function qv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Sg(e,n)}function Hv(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(q(314))}r!==null&&r.delete(t),Sg(e,n)}var Cg;Cg=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||zt.current)Tt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Tt=!1,Tv(e,t,n);Tt=!!(e.flags&131072)}else Tt=!1,Oe&&t.flags&1048576&&M0(t,$o,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;vo(e,t),e=t.pendingProps;var a=Ua(t,pt.current);Ca(t,n),a=om(null,t,r,e,a,n);var i=cm();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,At(r)?(i=!0,Lo(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,nm(t),a.updater=kc,t.stateNode=a,a._reactInternals=t,Tu(t,r,e,n),t=Ou(null,t,r,!0,i,n)):(t.tag=0,Oe&&i&&Yx(t),bt(null,t,a,n),t=t.child),t;case 16:r=t.elementType;e:{switch(vo(e,t),e=t.pendingProps,a=r._init,r=a(r._payload),t.type=r,a=t.tag=Wv(r),e=ds(r,e),a){case 0:t=Au(null,t,r,e,n);break e;case 1:t=Xh(null,t,r,e,n);break e;case 11:t=Yh(null,t,r,e,n);break e;case 14:t=Jh(null,t,r,ds(r.type,e),n);break e}throw Error(q(306,r,""))}return t;case 0:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:ds(r,a),Au(e,t,r,a,n);case 1:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:ds(r,a),Xh(e,t,r,a,n);case 3:e:{if(cg(t),e===null)throw Error(q(387));r=t.pendingProps,i=t.memoizedState,a=i.element,I0(e,t),qo(t,r,null,n);var l=t.memoizedState;if(r=l.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=Ka(Error(q(423)),t),t=Zh(e,t,r,n,a);break e}else if(r!==a){a=Ka(Error(q(424)),t),t=Zh(e,t,r,n,a);break e}else for(Bt=Dn(t.stateNode.containerInfo.firstChild),qt=t,Oe=!0,ms=null,n=O0(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ba(),r===a){t=tn(e,t,n);break e}bt(e,t,r,n)}t=t.child}return t;case 5:return F0(t),e===null&&Pu(t),r=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,l=a.children,wu(r,a)?l=null:i!==null&&wu(r,i)&&(t.flags|=32),og(e,t),bt(e,t,l,n),t.child;case 6:return e===null&&Pu(t),null;case 13:return dg(e,t,n);case 4:return rm(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=qa(t,null,r,n):bt(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:ds(r,a),Yh(e,t,r,a,n);case 7:return bt(e,t,t.pendingProps,n),t.child;case 8:return bt(e,t,t.pendingProps.children,n),t.child;case 12:return bt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,a=t.pendingProps,i=t.memoizedProps,l=a.value,Pe(Uo,r._currentValue),r._currentValue=l,i!==null)if(ys(i.value,l)){if(i.children===a.children&&!zt.current){t=tn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var o=i.dependencies;if(o!==null){l=i.child;for(var c=o.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Qs(-1,n&-n),c.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var x=d.pending;x===null?c.next=c:(c.next=x.next,x.next=c),d.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),Ru(i.return,n,t),o.lanes|=n;break}c=c.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(q(341));l.lanes|=n,o=l.alternate,o!==null&&(o.lanes|=n),Ru(l,n,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}bt(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,Ca(t,n),a=ss(a),r=r(a),t.flags|=1,bt(e,t,r,n),t.child;case 14:return r=t.type,a=ds(r,t.pendingProps),a=ds(r.type,a),Jh(e,t,r,a,n);case 15:return ig(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:ds(r,a),vo(e,t),t.tag=1,At(r)?(e=!0,Lo(t)):e=!1,Ca(t,n),ng(t,r,a),Tu(t,r,a,n),Ou(null,t,r,!0,e,n);case 19:return ug(e,t,n);case 22:return lg(e,t,n)}throw Error(q(156,t.tag))};function Eg(e,t){return e0(e,t)}function Kv(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zt(e,t,n,r){return new Kv(e,t,n,r)}function bm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Wv(e){if(typeof e=="function")return bm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Lx)return 11;if(e===_x)return 14}return 2}function _n(e,t){var n=e.alternate;return n===null?(n=Zt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function wo(e,t,n,r,a,i){var l=2;if(r=e,typeof e=="function")bm(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case ua:return Mr(n.children,a,i,t);case Fx:l=8,a|=8;break;case tu:return e=Zt(12,n,t,a|2),e.elementType=tu,e.lanes=i,e;case su:return e=Zt(13,n,t,a),e.elementType=su,e.lanes=i,e;case nu:return e=Zt(19,n,t,a),e.elementType=nu,e.lanes=i,e;case Ff:return Ec(n,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Df:l=10;break e;case If:l=9;break e;case Lx:l=11;break e;case _x:l=14;break e;case pn:l=16,r=null;break e}throw Error(q(130,e==null?e:typeof e,""))}return t=Zt(l,n,t,a),t.elementType=e,t.type=r,t.lanes=i,t}function Mr(e,t,n,r){return e=Zt(7,e,r,t),e.lanes=n,e}function Ec(e,t,n,r){return e=Zt(22,e,r,t),e.elementType=Ff,e.lanes=n,e.stateNode={isHidden:!1},e}function jd(e,t,n){return e=Zt(6,e,null,t),e.lanes=n,e}function Nd(e,t,n){return t=Zt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Vv(e,t,n,r,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=sd(0),this.expirationTimes=sd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sd(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function vm(e,t,n,r,a,i,l,o,c){return e=new Vv(e,t,n,o,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Zt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},nm(i),e}function Gv(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:da,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Pg(e){if(!e)return qn;e=e._reactInternals;e:{if(Hr(e)!==e||e.tag!==1)throw Error(q(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(At(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(q(171))}if(e.tag===1){var n=e.type;if(At(n))return P0(e,n,t)}return t}function Rg(e,t,n,r,a,i,l,o,c){return e=vm(n,r,!0,e,a,i,l,o,c),e.context=Pg(null),n=e.current,r=Nt(),a=Ln(n),i=Qs(r,a),i.callback=t??null,In(n,i,a),e.current.lanes=a,kl(e,a,r),Ot(e,r),e}function Pc(e,t,n,r){var a=t.current,i=Nt(),l=Ln(a);return n=Pg(n),t.context===null?t.context=n:t.pendingContext=n,t=Qs(i,l),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=In(a,t,l),e!==null&&(gs(e,a,l,i),go(e,a,l)),l}function Jo(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function cp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function jm(e,t){cp(e,t),(e=e.alternate)&&cp(e,t)}function Qv(){return null}var Mg=typeof reportError=="function"?reportError:function(e){console.error(e)};function Nm(e){this._internalRoot=e}Rc.prototype.render=Nm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(q(409));Pc(e,t,null,null)};Rc.prototype.unmount=Nm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;_r(function(){Pc(null,e,null,null)}),t[Zs]=null}};function Rc(e){this._internalRoot=e}Rc.prototype.unstable_scheduleHydration=function(e){if(e){var t=l0();e={blockedOn:null,target:e,priority:t};for(var n=0;n<gn.length&&t!==0&&t<gn[n].priority;n++);gn.splice(n,0,e),n===0&&c0(e)}};function wm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Mc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function dp(){}function Yv(e,t,n,r,a){if(a){if(typeof r=="function"){var i=r;r=function(){var d=Jo(l);i.call(d)}}var l=Rg(t,r,e,0,null,!1,!1,"",dp);return e._reactRootContainer=l,e[Zs]=l.current,Xi(e.nodeType===8?e.parentNode:e),_r(),l}for(;a=e.lastChild;)e.removeChild(a);if(typeof r=="function"){var o=r;r=function(){var d=Jo(c);o.call(d)}}var c=vm(e,0,!1,null,null,!1,!1,"",dp);return e._reactRootContainer=c,e[Zs]=c.current,Xi(e.nodeType===8?e.parentNode:e),_r(function(){Pc(t,c,n,r)}),c}function Tc(e,t,n,r,a){var i=n._reactRootContainer;if(i){var l=i;if(typeof a=="function"){var o=a;a=function(){var c=Jo(l);o.call(c)}}Pc(t,l,e,a)}else l=Yv(n,t,e,a,r);return Jo(l)}a0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ei(t.pendingLanes);n!==0&&(Bx(t,n|1),Ot(t,Be()),!(ve&6)&&(Wa=Be()+500,Yn()))}break;case 13:_r(function(){var r=en(e,1);if(r!==null){var a=Nt();gs(r,e,1,a)}}),jm(e,1)}};qx=function(e){if(e.tag===13){var t=en(e,134217728);if(t!==null){var n=Nt();gs(t,e,134217728,n)}jm(e,134217728)}};i0=function(e){if(e.tag===13){var t=Ln(e),n=en(e,t);if(n!==null){var r=Nt();gs(n,e,t,r)}jm(e,t)}};l0=function(){return Ce};o0=function(e,t){var n=Ce;try{return Ce=e,t()}finally{Ce=n}};mu=function(e,t,n){switch(t){case"input":if(iu(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=jc(r);if(!a)throw Error(q(90));_f(r),iu(r,a)}}}break;case"textarea":Uf(e,n);break;case"select":t=n.value,t!=null&&Na(e,!!n.multiple,t,!1)}};Gf=fm;Qf=_r;var Jv={usingClientEntryPoint:!1,Events:[Cl,pa,jc,Wf,Vf,fm]},mi={findFiberByHostInstance:hr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Xv={bundleType:mi.bundleType,version:mi.version,rendererPackageName:mi.rendererPackageName,rendererConfig:mi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:an.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Xf(e),e===null?null:e.stateNode},findFiberByHostInstance:mi.findFiberByHostInstance||Qv,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zl.isDisabled&&Zl.supportsFiber)try{gc=Zl.inject(Xv),Cs=Zl}catch{}}Wt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Jv;Wt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!wm(t))throw Error(q(200));return Gv(e,t,null,n)};Wt.createRoot=function(e,t){if(!wm(e))throw Error(q(299));var n=!1,r="",a=Mg;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=vm(e,1,!1,null,null,n,!1,r,a),e[Zs]=t.current,Xi(e.nodeType===8?e.parentNode:e),new Nm(t)};Wt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(q(188)):(e=Object.keys(e).join(","),Error(q(268,e)));return e=Xf(t),e=e===null?null:e.stateNode,e};Wt.flushSync=function(e){return _r(e)};Wt.hydrate=function(e,t,n){if(!Mc(t))throw Error(q(200));return Tc(null,e,t,!0,n)};Wt.hydrateRoot=function(e,t,n){if(!wm(e))throw Error(q(405));var r=n!=null&&n.hydratedSources||null,a=!1,i="",l=Mg;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(l=n.onRecoverableError)),t=Rg(t,null,e,1,n??null,a,!1,i,l),e[Zs]=t.current,Xi(e),r)for(e=0;e<r.length;e++)n=r[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new Rc(t)};Wt.render=function(e,t,n){if(!Mc(t))throw Error(q(200));return Tc(null,e,t,!1,n)};Wt.unmountComponentAtNode=function(e){if(!Mc(e))throw Error(q(40));return e._reactRootContainer?(_r(function(){Tc(null,null,e,!1,function(){e._reactRootContainer=null,e[Zs]=null})}),!0):!1};Wt.unstable_batchedUpdates=fm;Wt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Mc(n))throw Error(q(200));if(e==null||e._reactInternals===void 0)throw Error(q(38));return Tc(e,t,n,!1,r)};Wt.version="18.3.1-next-f1338f8080-20240426";function Tg(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Tg)}catch(e){console.error(e)}}Tg(),Tf.exports=Wt;var Zv=Tf.exports,zg,up=Zv;zg=up.createRoot,up.hydrateRoot;/**
41
+ * @remix-run/router v1.23.2
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 ll(){return ll=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ll.apply(this,arguments)}var Tn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Tn||(Tn={}));const xp="popstate";function ej(e){e===void 0&&(e={});function t(r,a){let{pathname:i,search:l,hash:o}=r.location;return Wu("",{pathname:i,search:l,hash:o},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:Xo(a)}return sj(t,n,null,e)}function Ue(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function km(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function tj(){return Math.random().toString(36).substr(2,8)}function mp(e,t){return{usr:e.state,key:e.key,idx:t}}function Wu(e,t,n,r){return n===void 0&&(n=null),ll({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ti(t):t,{state:n,key:t&&t.key||r||tj()})}function Xo(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function ti(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function sj(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,l=a.history,o=Tn.Pop,c=null,d=x();d==null&&(d=0,l.replaceState(ll({},l.state,{idx:d}),""));function x(){return(l.state||{idx:null}).idx}function p(){o=Tn.Pop;let w=x(),h=w==null?null:w-d;d=w,c&&c({action:o,location:v.location,delta:h})}function y(w,h){o=Tn.Push;let u=Wu(v.location,w,h);d=x()+1;let g=mp(u,d),j=v.createHref(u);try{l.pushState(g,"",j)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;a.location.assign(j)}i&&c&&c({action:o,location:v.location,delta:1})}function b(w,h){o=Tn.Replace;let u=Wu(v.location,w,h);d=x();let g=mp(u,d),j=v.createHref(u);l.replaceState(g,"",j),i&&c&&c({action:o,location:v.location,delta:0})}function f(w){let h=a.location.origin!=="null"?a.location.origin:a.location.href,u=typeof w=="string"?w:Xo(w);return u=u.replace(/ $/,"%20"),Ue(h,"No window.location.(origin|href) available to create URL for href: "+u),new URL(u,h)}let v={get action(){return o},get location(){return e(a,l)},listen(w){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(xp,p),c=w,()=>{a.removeEventListener(xp,p),c=null}},createHref(w){return t(a,w)},createURL:f,encodeLocation(w){let h=f(w);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:y,replace:b,go(w){return l.go(w)}};return v}var hp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(hp||(hp={}));function nj(e,t,n){return n===void 0&&(n="/"),rj(e,t,n)}function rj(e,t,n,r){let a=typeof t=="string"?ti(t):t,i=Va(a.pathname||"/",n);if(i==null)return null;let l=Ag(e);aj(l);let o=null;for(let c=0;o==null&&c<l.length;++c){let d=fj(i);o=hj(l[c],d)}return o}function Ag(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(i,l,o)=>{let c={relativePath:o===void 0?i.path||"":o,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};c.relativePath.startsWith("/")&&(Ue(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let d=$n([r,c.relativePath]),x=n.concat(c);i.children&&i.children.length>0&&(Ue(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),Ag(i.children,t,x,d)),!(i.path==null&&!i.index)&&t.push({path:d,score:xj(d,i.index),routesMeta:x})};return e.forEach((i,l)=>{var o;if(i.path===""||!((o=i.path)!=null&&o.includes("?")))a(i,l);else for(let c of Og(i.path))a(i,l,c)}),t}function Og(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let l=Og(r.join("/")),o=[];return o.push(...l.map(c=>c===""?i:[i,c].join("/"))),a&&o.push(...l),o.map(c=>e.startsWith("/")&&c===""?"/":c)}function aj(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:mj(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const ij=/^:[\w-]+$/,lj=3,oj=2,cj=1,dj=10,uj=-2,pp=e=>e==="*";function xj(e,t){let n=e.split("/"),r=n.length;return n.some(pp)&&(r+=uj),t&&(r+=oj),n.filter(a=>!pp(a)).reduce((a,i)=>a+(ij.test(i)?lj:i===""?cj:dj),r)}function mj(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function hj(e,t,n){let{routesMeta:r}=e,a={},i="/",l=[];for(let o=0;o<r.length;++o){let c=r[o],d=o===r.length-1,x=i==="/"?t:t.slice(i.length)||"/",p=Vu({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},x),y=c.route;if(!p)return null;Object.assign(a,p.params),l.push({params:a,pathname:$n([i,p.pathname]),pathnameBase:jj($n([i,p.pathnameBase])),route:y}),p.pathnameBase!=="/"&&(i=$n([i,p.pathnameBase]))}return l}function Vu(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=pj(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let i=a[0],l=i.replace(/(.)\/+$/,"$1"),o=a.slice(1);return{params:r.reduce((d,x,p)=>{let{paramName:y,isOptional:b}=x;if(y==="*"){let v=o[p]||"";l=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const f=o[p];return b&&!f?d[y]=void 0:d[y]=(f||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:l,pattern:e}}function pj(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),km(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,o,c)=>(r.push({paramName:o,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function fj(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return km(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Va(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const gj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yj=e=>gj.test(e);function bj(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?ti(e):e,i;if(n)if(yj(n))i=n;else{if(n.includes("//")){let l=n;n=n.replace(/\/\/+/g,"/"),km(!1,"Pathnames cannot have embedded double slashes - normalizing "+(l+" -> "+n))}n.startsWith("/")?i=fp(n.substring(1),"/"):i=fp(n,t)}else i=t;return{pathname:i,search:Nj(r),hash:wj(a)}}function fp(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function wd(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function vj(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Dg(e,t){let n=vj(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Ig(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=ti(e):(a=ll({},e),Ue(!a.pathname||!a.pathname.includes("?"),wd("?","pathname","search",a)),Ue(!a.pathname||!a.pathname.includes("#"),wd("#","pathname","hash",a)),Ue(!a.search||!a.search.includes("#"),wd("#","search","hash",a)));let i=e===""||a.pathname==="",l=i?"/":a.pathname,o;if(l==null)o=n;else{let p=t.length-1;if(!r&&l.startsWith("..")){let y=l.split("/");for(;y[0]==="..";)y.shift(),p-=1;a.pathname=y.join("/")}o=p>=0?t[p]:"/"}let c=bj(a,o),d=l&&l!=="/"&&l.endsWith("/"),x=(i||l===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||x)&&(c.pathname+="/"),c}const $n=e=>e.join("/").replace(/\/\/+/g,"/"),jj=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Nj=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,wj=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function kj(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Fg=["post","put","patch","delete"];new Set(Fg);const Sj=["get",...Fg];new Set(Sj);/**
50
+ * React Router v6.30.3
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 ol(){return ol=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ol.apply(this,arguments)}const zc=m.createContext(null),Lg=m.createContext(null),Jn=m.createContext(null),Ac=m.createContext(null),Xn=m.createContext({outlet:null,matches:[],isDataRoute:!1}),_g=m.createContext(null);function Cj(e,t){let{relative:n}=t===void 0?{}:t;Pl()||Ue(!1);let{basename:r,navigator:a}=m.useContext(Jn),{hash:i,pathname:l,search:o}=Oc(e,{relative:n}),c=l;return r!=="/"&&(c=l==="/"?r:$n([r,l])),a.createHref({pathname:c,search:o,hash:i})}function Pl(){return m.useContext(Ac)!=null}function Zn(){return Pl()||Ue(!1),m.useContext(Ac).location}function $g(e){m.useContext(Jn).static||m.useLayoutEffect(e)}function Ms(){let{isDataRoute:e}=m.useContext(Xn);return e?$j():Ej()}function Ej(){Pl()||Ue(!1);let e=m.useContext(zc),{basename:t,future:n,navigator:r}=m.useContext(Jn),{matches:a}=m.useContext(Xn),{pathname:i}=Zn(),l=JSON.stringify(Dg(a,n.v7_relativeSplatPath)),o=m.useRef(!1);return $g(()=>{o.current=!0}),m.useCallback(function(d,x){if(x===void 0&&(x={}),!o.current)return;if(typeof d=="number"){r.go(d);return}let p=Ig(d,JSON.parse(l),i,x.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:$n([t,p.pathname])),(x.replace?r.replace:r.push)(p,x.state,x)},[t,r,l,i,e])}function Pj(){let{matches:e}=m.useContext(Xn),t=e[e.length-1];return t?t.params:{}}function Oc(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(Jn),{matches:a}=m.useContext(Xn),{pathname:i}=Zn(),l=JSON.stringify(Dg(a,r.v7_relativeSplatPath));return m.useMemo(()=>Ig(e,JSON.parse(l),i,n==="path"),[e,l,i,n])}function Rj(e,t){return Mj(e,t)}function Mj(e,t,n,r){Pl()||Ue(!1);let{navigator:a}=m.useContext(Jn),{matches:i}=m.useContext(Xn),l=i[i.length-1],o=l?l.params:{};l&&l.pathname;let c=l?l.pathnameBase:"/";l&&l.route;let d=Zn(),x;if(t){var p;let w=typeof t=="string"?ti(t):t;c==="/"||(p=w.pathname)!=null&&p.startsWith(c)||Ue(!1),x=w}else x=d;let y=x.pathname||"/",b=y;if(c!=="/"){let w=c.replace(/^\//,"").split("/");b="/"+y.replace(/^\//,"").split("/").slice(w.length).join("/")}let f=nj(e,{pathname:b}),v=Dj(f&&f.map(w=>Object.assign({},w,{params:Object.assign({},o,w.params),pathname:$n([c,a.encodeLocation?a.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?c:$n([c,a.encodeLocation?a.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),i,n,r);return t&&v?m.createElement(Ac.Provider,{value:{location:ol({pathname:"/",search:"",hash:"",state:null,key:"default"},x),navigationType:Tn.Pop}},v):v}function Tj(){let e=_j(),t=kj(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:a},n):null,null)}const zj=m.createElement(Tj,null);class Aj extends m.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?m.createElement(Xn.Provider,{value:this.props.routeContext},m.createElement(_g.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Oj(e){let{routeContext:t,match:n,children:r}=e,a=m.useContext(zc);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(Xn.Provider,{value:t},r)}function Dj(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,o=(a=n)==null?void 0:a.errors;if(o!=null){let x=l.findIndex(p=>p.route.id&&(o==null?void 0:o[p.route.id])!==void 0);x>=0||Ue(!1),l=l.slice(0,Math.min(l.length,x+1))}let c=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let x=0;x<l.length;x++){let p=l[x];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(d=x),p.route.id){let{loaderData:y,errors:b}=n,f=p.route.loader&&y[p.route.id]===void 0&&(!b||b[p.route.id]===void 0);if(p.route.lazy||f){c=!0,d>=0?l=l.slice(0,d+1):l=[l[0]];break}}}return l.reduceRight((x,p,y)=>{let b,f=!1,v=null,w=null;n&&(b=o&&p.route.id?o[p.route.id]:void 0,v=p.route.errorElement||zj,c&&(d<0&&y===0?(Uj("route-fallback"),f=!0,w=null):d===y&&(f=!0,w=p.route.hydrateFallbackElement||null)));let h=t.concat(l.slice(0,y+1)),u=()=>{let g;return b?g=v:f?g=w:p.route.Component?g=m.createElement(p.route.Component,null):p.route.element?g=p.route.element:g=x,m.createElement(Oj,{match:p,routeContext:{outlet:x,matches:h,isDataRoute:n!=null},children:g})};return n&&(p.route.ErrorBoundary||p.route.errorElement||y===0)?m.createElement(Aj,{location:n.location,revalidation:n.revalidation,component:v,error:b,children:u(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):u()},null)}var Ug=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Ug||{}),Bg=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Bg||{});function Ij(e){let t=m.useContext(zc);return t||Ue(!1),t}function Fj(e){let t=m.useContext(Lg);return t||Ue(!1),t}function Lj(e){let t=m.useContext(Xn);return t||Ue(!1),t}function qg(e){let t=Lj(),n=t.matches[t.matches.length-1];return n.route.id||Ue(!1),n.route.id}function _j(){var e;let t=m.useContext(_g),n=Fj(),r=qg();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function $j(){let{router:e}=Ij(Ug.UseNavigateStable),t=qg(Bg.UseNavigateStable),n=m.useRef(!1);return $g(()=>{n.current=!0}),m.useCallback(function(a,i){i===void 0&&(i={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,ol({fromRouteId:t},i)))},[e,t])}const gp={};function Uj(e,t,n){gp[e]||(gp[e]=!0)}function Bj(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function gt(e){Ue(!1)}function qj(e){let{basename:t="/",children:n=null,location:r,navigationType:a=Tn.Pop,navigator:i,static:l=!1,future:o}=e;Pl()&&Ue(!1);let c=t.replace(/^\/*/,"/"),d=m.useMemo(()=>({basename:c,navigator:i,static:l,future:ol({v7_relativeSplatPath:!1},o)}),[c,o,i,l]);typeof r=="string"&&(r=ti(r));let{pathname:x="/",search:p="",hash:y="",state:b=null,key:f="default"}=r,v=m.useMemo(()=>{let w=Va(x,c);return w==null?null:{location:{pathname:w,search:p,hash:y,state:b,key:f},navigationType:a}},[c,x,p,y,b,f,a]);return v==null?null:m.createElement(Jn.Provider,{value:d},m.createElement(Ac.Provider,{children:n,value:v}))}function Hj(e){let{children:t,location:n}=e;return Rj(Gu(t),n)}new Promise(()=>{});function Gu(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(r,a)=>{if(!m.isValidElement(r))return;let i=[...t,a];if(r.type===m.Fragment){n.push.apply(n,Gu(r.props.children,i));return}r.type!==gt&&Ue(!1),!r.props.index||!r.props.children||Ue(!1);let l={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=Gu(r.props.children,i)),n.push(l)}),n}/**
59
+ * React Router DOM v6.30.3
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 Zo(){return Zo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zo.apply(this,arguments)}function Hg(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function Kj(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Wj(e,t){return e.button===0&&(!t||t==="_self")&&!Kj(e)}const Vj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Gj=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Qj="6";try{window.__reactRouterVersion=Qj}catch{}const Yj=m.createContext({isTransitioning:!1}),Jj="startTransition",yp=Bb[Jj];function Xj(e){let{basename:t,children:n,future:r,window:a}=e,i=m.useRef();i.current==null&&(i.current=ej({window:a,v5Compat:!0}));let l=i.current,[o,c]=m.useState({action:l.action,location:l.location}),{v7_startTransition:d}=r||{},x=m.useCallback(p=>{d&&yp?yp(()=>c(p)):c(p)},[c,d]);return m.useLayoutEffect(()=>l.listen(x),[l,x]),m.useEffect(()=>Bj(r),[r]),m.createElement(qj,{basename:t,children:n,location:o.location,navigationType:o.action,navigator:l,future:r})}const Zj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",eN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,tN=m.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:i,replace:l,state:o,target:c,to:d,preventScrollReset:x,viewTransition:p}=t,y=Hg(t,Vj),{basename:b}=m.useContext(Jn),f,v=!1;if(typeof d=="string"&&eN.test(d)&&(f=d,Zj))try{let g=new URL(window.location.href),j=d.startsWith("//")?new URL(g.protocol+d):new URL(d),k=Va(j.pathname,b);j.origin===g.origin&&k!=null?d=k+j.search+j.hash:v=!0}catch{}let w=Cj(d,{relative:a}),h=rN(d,{replace:l,state:o,target:c,preventScrollReset:x,relative:a,viewTransition:p});function u(g){r&&r(g),g.defaultPrevented||h(g)}return m.createElement("a",Zo({},y,{href:f||w,onClick:v||i?r:u,ref:n,target:c}))}),sN=m.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:a=!1,className:i="",end:l=!1,style:o,to:c,viewTransition:d,children:x}=t,p=Hg(t,Gj),y=Oc(c,{relative:p.relative}),b=Zn(),f=m.useContext(Lg),{navigator:v,basename:w}=m.useContext(Jn),h=f!=null&&aN(y)&&d===!0,u=v.encodeLocation?v.encodeLocation(y).pathname:y.pathname,g=b.pathname,j=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;a||(g=g.toLowerCase(),j=j?j.toLowerCase():null,u=u.toLowerCase()),j&&w&&(j=Va(j,w)||j);const k=u!=="/"&&u.endsWith("/")?u.length-1:u.length;let N=g===u||!l&&g.startsWith(u)&&g.charAt(k)==="/",S=j!=null&&(j===u||!l&&j.startsWith(u)&&j.charAt(u.length)==="/"),P={isActive:N,isPending:S,isTransitioning:h},$=N?r:void 0,M;typeof i=="function"?M=i(P):M=[i,N?"active":null,S?"pending":null,h?"transitioning":null].filter(Boolean).join(" ");let V=typeof o=="function"?o(P):o;return m.createElement(tN,Zo({},p,{"aria-current":$,className:M,ref:n,style:V,to:c,viewTransition:d}),typeof x=="function"?x(P):x)});var Qu;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Qu||(Qu={}));var bp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(bp||(bp={}));function nN(e){let t=m.useContext(zc);return t||Ue(!1),t}function rN(e,t){let{target:n,replace:r,state:a,preventScrollReset:i,relative:l,viewTransition:o}=t===void 0?{}:t,c=Ms(),d=Zn(),x=Oc(e,{relative:l});return m.useCallback(p=>{if(Wj(p,n)){p.preventDefault();let y=r!==void 0?r:Xo(d)===Xo(x);c(e,{replace:y,state:a,preventScrollReset:i,relative:l,viewTransition:o})}},[d,c,x,r,a,n,e,i,l,o])}function aN(e,t){t===void 0&&(t={});let n=m.useContext(Yj);n==null&&Ue(!1);let{basename:r}=nN(Qu.useViewTransitionState),a=Oc(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Va(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Va(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Vu(a.pathname,l)!=null||Vu(a.pathname,i)!=null}var si=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},vr,vn,Pa,cf,iN=(cf=class extends si{constructor(){super();ee(this,vr);ee(this,vn);ee(this,Pa);Q(this,Pa,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){C(this,vn)||this.setEventListener(C(this,Pa))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,vn))==null||t.call(this),Q(this,vn,void 0))}setEventListener(t){var n;Q(this,Pa,t),(n=C(this,vn))==null||n.call(this),Q(this,vn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){C(this,vr)!==t&&(Q(this,vr,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof C(this,vr)=="boolean"?C(this,vr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},vr=new WeakMap,vn=new WeakMap,Pa=new WeakMap,cf),Sm=new iN,lN={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},jn,Rx,df,oN=(df=class{constructor(){ee(this,jn,lN);ee(this,Rx,!1)}setTimeoutProvider(e){Q(this,jn,e)}setTimeout(e,t){return C(this,jn).setTimeout(e,t)}clearTimeout(e){C(this,jn).clearTimeout(e)}setInterval(e,t){return C(this,jn).setInterval(e,t)}clearInterval(e){C(this,jn).clearInterval(e)}},jn=new WeakMap,Rx=new WeakMap,df),gr=new oN;function cN(e){setTimeout(e,0)}var dN=typeof window>"u"||"Deno"in globalThis;function vt(){}function uN(e,t){return typeof e=="function"?e(t):e}function Yu(e){return typeof e=="number"&&e>=0&&e!==1/0}function Kg(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Un(e,t){return typeof e=="function"?e(t):e}function Yt(e,t){return typeof e=="function"?e(t):e}function vp(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:l,stale:o}=e;if(l){if(r){if(t.queryHash!==Cm(l,t.options))return!1}else if(!cl(t.queryKey,l))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||a&&a!==t.state.fetchStatus||i&&!i(t))}function jp(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if($r(t.options.mutationKey)!==$r(i))return!1}else if(!cl(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function Cm(e,t){return((t==null?void 0:t.queryKeyHashFn)||$r)(e)}function $r(e){return JSON.stringify(e,(t,n)=>Ju(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function cl(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>cl(e[n],t[n])):!1}var xN=Object.prototype.hasOwnProperty;function Wg(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Np(e)&&Np(t);if(!r&&!(Ju(e)&&Ju(t)))return t;const i=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),o=l.length,c=r?new Array(o):{};let d=0;for(let x=0;x<o;x++){const p=r?x:l[x],y=e[p],b=t[p];if(y===b){c[p]=y,(r?x<i:xN.call(e,p))&&d++;continue}if(y===null||b===null||typeof y!="object"||typeof b!="object"){c[p]=b;continue}const f=Wg(y,b,n+1);c[p]=f,f===y&&d++}return i===o&&d===i?e:c}function ec(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Np(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ju(e){if(!wp(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!wp(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function wp(e){return Object.prototype.toString.call(e)==="[object Object]"}function mN(e){return new Promise(t=>{gr.setTimeout(t,e)})}function Xu(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Wg(e,t):t}function hN(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function pN(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Em=Symbol();function Vg(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Em?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Pm(e,t){return typeof e=="function"?e(...t):!!e}function fN(e,t,n){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),r||(r=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var dl=(()=>{let e=()=>dN;return{isServer(){return e()},setIsServer(t){e=t}}})();function Zu(){let e,t;const n=new Promise((a,i)=>{e=a,t=i});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}var gN=cN;function yN(){let e=[],t=0,n=o=>{o()},r=o=>{o()},a=gN;const i=o=>{t?e.push(o):a(()=>{n(o)})},l=()=>{const o=e;e=[],o.length&&a(()=>{r(()=>{o.forEach(c=>{n(c)})})})};return{batch:o=>{let c;t++;try{c=o()}finally{t--,t||l()}return c},batchCalls:o=>(...c)=>{i(()=>{o(...c)})},schedule:i,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{a=o}}}var Qe=yN(),Ra,Nn,Ma,uf,bN=(uf=class extends si{constructor(){super();ee(this,Ra,!0);ee(this,Nn);ee(this,Ma);Q(this,Ma,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){C(this,Nn)||this.setEventListener(C(this,Ma))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,Nn))==null||t.call(this),Q(this,Nn,void 0))}setEventListener(t){var n;Q(this,Ma,t),(n=C(this,Nn))==null||n.call(this),Q(this,Nn,t(this.setOnline.bind(this)))}setOnline(t){C(this,Ra)!==t&&(Q(this,Ra,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return C(this,Ra)}},Ra=new WeakMap,Nn=new WeakMap,Ma=new WeakMap,uf),tc=new bN;function vN(e){return Math.min(1e3*2**e,3e4)}function Gg(e){return(e??"online")==="online"?tc.isOnline():!0}var ex=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Qg(e){let t=!1,n=0,r;const a=Zu(),i=()=>a.status!=="pending",l=v=>{var w;if(!i()){const h=new ex(v);y(h),(w=e.onCancel)==null||w.call(e,h)}},o=()=>{t=!0},c=()=>{t=!1},d=()=>Sm.isFocused()&&(e.networkMode==="always"||tc.isOnline())&&e.canRun(),x=()=>Gg(e.networkMode)&&e.canRun(),p=v=>{i()||(r==null||r(),a.resolve(v))},y=v=>{i()||(r==null||r(),a.reject(v))},b=()=>new Promise(v=>{var w;r=h=>{(i()||d())&&v(h)},(w=e.onPause)==null||w.call(e)}).then(()=>{var v;r=void 0,i()||(v=e.onContinue)==null||v.call(e)}),f=()=>{if(i())return;let v;const w=n===0?e.initialPromise:void 0;try{v=w??e.fn()}catch(h){v=Promise.reject(h)}Promise.resolve(v).then(p).catch(h=>{var N;if(i())return;const u=e.retry??(dl.isServer()?0:3),g=e.retryDelay??vN,j=typeof g=="function"?g(n,h):g,k=u===!0||typeof u=="number"&&n<u||typeof u=="function"&&u(n,h);if(t||!k){y(h);return}n++,(N=e.onFail)==null||N.call(e,n,h),mN(j).then(()=>d()?void 0:b()).then(()=>{t?y(h):f()})})};return{promise:a,status:()=>a.status,cancel:l,continue:()=>(r==null||r(),a),cancelRetry:o,continueRetry:c,canStart:x,start:()=>(x()?f():b().then(f),a)}}var jr,xf,Yg=(xf=class{constructor(){ee(this,jr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Yu(this.gcTime)&&Q(this,jr,gr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(dl.isServer()?1/0:5*60*1e3))}clearGcTimeout(){C(this,jr)&&(gr.clearTimeout(C(this,jr)),Q(this,jr,void 0))}},jr=new WeakMap,xf),Nr,Ta,Qt,wr,Ze,yl,kr,Ut,Jg,Fs,mf,jN=(mf=class extends Yg{constructor(t){super();ee(this,Ut);ee(this,Nr);ee(this,Ta);ee(this,Qt);ee(this,wr);ee(this,Ze);ee(this,yl);ee(this,kr);Q(this,kr,!1),Q(this,yl,t.defaultOptions),this.setOptions(t.options),this.observers=[],Q(this,wr,t.client),Q(this,Qt,C(this,wr).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Q(this,Nr,Sp(this.options)),this.state=t.state??C(this,Nr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=C(this,Ze))==null?void 0:t.promise}setOptions(t){if(this.options={...C(this,yl),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Sp(this.options);n.data!==void 0&&(this.setState(kp(n.data,n.dataUpdatedAt)),Q(this,Nr,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,Qt).remove(this)}setData(t,n){const r=Xu(this.state.data,t,this.options);return de(this,Ut,Fs).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){de(this,Ut,Fs).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=C(this,Ze))==null?void 0:r.promise;return(a=C(this,Ze))==null||a.cancel(t),n?n.then(vt).catch(vt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return C(this,Nr)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Yt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Em||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Un(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Kg(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=C(this,Ze))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=C(this,Ze))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),C(this,Qt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(C(this,Ze)&&(C(this,kr)||de(this,Ut,Jg).call(this)?C(this,Ze).cancel({revert:!0}):C(this,Ze).cancelRetry()),this.scheduleGc()),C(this,Qt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||de(this,Ut,Fs).call(this,{type:"invalidate"})}async fetch(t,n){var c,d,x,p,y,b,f,v,w,h,u,g;if(this.state.fetchStatus!=="idle"&&((c=C(this,Ze))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(C(this,Ze))return C(this,Ze).continueRetry(),C(this,Ze).promise}if(t&&this.setOptions(t),!this.options.queryFn){const j=this.observers.find(k=>k.options.queryFn);j&&this.setOptions(j.options)}const r=new AbortController,a=j=>{Object.defineProperty(j,"signal",{enumerable:!0,get:()=>(Q(this,kr,!0),r.signal)})},i=()=>{const j=Vg(this.options,n),N=(()=>{const S={client:C(this,wr),queryKey:this.queryKey,meta:this.meta};return a(S),S})();return Q(this,kr,!1),this.options.persister?this.options.persister(j,N,this):j(N)},o=(()=>{const j={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:C(this,wr),state:this.state,fetchFn:i};return a(j),j})();(d=this.options.behavior)==null||d.onFetch(o,this),Q(this,Ta,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((x=o.fetchOptions)==null?void 0:x.meta))&&de(this,Ut,Fs).call(this,{type:"fetch",meta:(p=o.fetchOptions)==null?void 0:p.meta}),Q(this,Ze,Qg({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,onCancel:j=>{j instanceof ex&&j.revert&&this.setState({...C(this,Ta),fetchStatus:"idle"}),r.abort()},onFail:(j,k)=>{de(this,Ut,Fs).call(this,{type:"failed",failureCount:j,error:k})},onPause:()=>{de(this,Ut,Fs).call(this,{type:"pause"})},onContinue:()=>{de(this,Ut,Fs).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const j=await C(this,Ze).start();if(j===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(j),(b=(y=C(this,Qt).config).onSuccess)==null||b.call(y,j,this),(v=(f=C(this,Qt).config).onSettled)==null||v.call(f,j,this.state.error,this),j}catch(j){if(j instanceof ex){if(j.silent)return C(this,Ze).promise;if(j.revert){if(this.state.data===void 0)throw j;return this.state.data}}throw de(this,Ut,Fs).call(this,{type:"error",error:j}),(h=(w=C(this,Qt).config).onError)==null||h.call(w,j,this),(g=(u=C(this,Qt).config).onSettled)==null||g.call(u,this.state.data,j,this),j}finally{this.scheduleGc()}}},Nr=new WeakMap,Ta=new WeakMap,Qt=new WeakMap,wr=new WeakMap,Ze=new WeakMap,yl=new WeakMap,kr=new WeakMap,Ut=new WeakSet,Jg=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Fs=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Xg(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,...kp(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Q(this,Ta,t.manual?a:void 0),a;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Qe.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),C(this,Qt).notify({query:this,type:"updated",action:t})})},mf);function Xg(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Gg(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function kp(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Sp(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Pt,ge,bl,yt,Sr,za,Bs,wn,vl,Aa,Oa,Cr,Er,kn,Da,ke,Ri,tx,sx,nx,rx,ax,ix,lx,Zg,hf,NN=(hf=class extends si{constructor(t,n){super();ee(this,ke);ee(this,Pt);ee(this,ge);ee(this,bl);ee(this,yt);ee(this,Sr);ee(this,za);ee(this,Bs);ee(this,wn);ee(this,vl);ee(this,Aa);ee(this,Oa);ee(this,Cr);ee(this,Er);ee(this,kn);ee(this,Da,new Set);this.options=n,Q(this,Pt,t),Q(this,wn,null),Q(this,Bs,Zu()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(C(this,ge).addObserver(this),Cp(C(this,ge),this.options)?de(this,ke,Ri).call(this):this.updateResult(),de(this,ke,rx).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ox(C(this,ge),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ox(C(this,ge),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,de(this,ke,ax).call(this),de(this,ke,ix).call(this),C(this,ge).removeObserver(this)}setOptions(t){const n=this.options,r=C(this,ge);if(this.options=C(this,Pt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Yt(this.options.enabled,C(this,ge))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");de(this,ke,lx).call(this),C(this,ge).setOptions(this.options),n._defaulted&&!ec(this.options,n)&&C(this,Pt).getQueryCache().notify({type:"observerOptionsUpdated",query:C(this,ge),observer:this});const a=this.hasListeners();a&&Ep(C(this,ge),r,this.options,n)&&de(this,ke,Ri).call(this),this.updateResult(),a&&(C(this,ge)!==r||Yt(this.options.enabled,C(this,ge))!==Yt(n.enabled,C(this,ge))||Un(this.options.staleTime,C(this,ge))!==Un(n.staleTime,C(this,ge)))&&de(this,ke,tx).call(this);const i=de(this,ke,sx).call(this);a&&(C(this,ge)!==r||Yt(this.options.enabled,C(this,ge))!==Yt(n.enabled,C(this,ge))||i!==C(this,kn))&&de(this,ke,nx).call(this,i)}getOptimisticResult(t){const n=C(this,Pt).getQueryCache().build(C(this,Pt),t),r=this.createResult(n,t);return kN(this,r)&&(Q(this,yt,r),Q(this,za,this.options),Q(this,Sr,C(this,ge).state)),r}getCurrentResult(){return C(this,yt)}trackResult(t,n){return new Proxy(t,{get:(r,a)=>(this.trackProp(a),n==null||n(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&C(this,Bs).status==="pending"&&C(this,Bs).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(t){C(this,Da).add(t)}getCurrentQuery(){return C(this,ge)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=C(this,Pt).defaultQueryOptions(t),r=C(this,Pt).getQueryCache().build(C(this,Pt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return de(this,ke,Ri).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),C(this,yt)))}createResult(t,n){var $;const r=C(this,ge),a=this.options,i=C(this,yt),l=C(this,Sr),o=C(this,za),d=t!==r?t.state:C(this,bl),{state:x}=t;let p={...x},y=!1,b;if(n._optimisticResults){const M=this.hasListeners(),V=!M&&Cp(t,n),G=M&&Ep(t,r,n,a);(V||G)&&(p={...p,...Xg(x.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:f,errorUpdatedAt:v,status:w}=p;b=p.data;let h=!1;if(n.placeholderData!==void 0&&b===void 0&&w==="pending"){let M;i!=null&&i.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData)?(M=i.data,h=!0):M=typeof n.placeholderData=="function"?n.placeholderData(($=C(this,Oa))==null?void 0:$.state.data,C(this,Oa)):n.placeholderData,M!==void 0&&(w="success",b=Xu(i==null?void 0:i.data,M,n),y=!0)}if(n.select&&b!==void 0&&!h)if(i&&b===(l==null?void 0:l.data)&&n.select===C(this,vl))b=C(this,Aa);else try{Q(this,vl,n.select),b=n.select(b),b=Xu(i==null?void 0:i.data,b,n),Q(this,Aa,b),Q(this,wn,null)}catch(M){Q(this,wn,M)}C(this,wn)&&(f=C(this,wn),b=C(this,Aa),v=Date.now(),w="error");const u=p.fetchStatus==="fetching",g=w==="pending",j=w==="error",k=g&&u,N=b!==void 0,P={status:w,fetchStatus:p.fetchStatus,isPending:g,isSuccess:w==="success",isError:j,isInitialLoading:k,isLoading:k,data:b,dataUpdatedAt:p.dataUpdatedAt,error:f,errorUpdatedAt:v,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:u,isRefetching:u&&!g,isLoadingError:j&&!N,isPaused:p.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:j&&N,isStale:Rm(t,n),refetch:this.refetch,promise:C(this,Bs),isEnabled:Yt(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const M=P.data!==void 0,V=P.status==="error"&&!M,G=Y=>{V?Y.reject(P.error):M&&Y.resolve(P.data)},re=()=>{const Y=Q(this,Bs,P.promise=Zu());G(Y)},O=C(this,Bs);switch(O.status){case"pending":t.queryHash===r.queryHash&&G(O);break;case"fulfilled":(V||P.data!==O.value)&&re();break;case"rejected":(!V||P.error!==O.reason)&&re();break}}return P}updateResult(){const t=C(this,yt),n=this.createResult(C(this,ge),this.options);if(Q(this,Sr,C(this,ge).state),Q(this,za,this.options),C(this,Sr).data!==void 0&&Q(this,Oa,C(this,ge)),ec(n,t))return;Q(this,yt,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,i=typeof a=="function"?a():a;if(i==="all"||!i&&!C(this,Da).size)return!0;const l=new Set(i??C(this,Da));return this.options.throwOnError&&l.add("error"),Object.keys(C(this,yt)).some(o=>{const c=o;return C(this,yt)[c]!==t[c]&&l.has(c)})};de(this,ke,Zg).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&de(this,ke,rx).call(this)}},Pt=new WeakMap,ge=new WeakMap,bl=new WeakMap,yt=new WeakMap,Sr=new WeakMap,za=new WeakMap,Bs=new WeakMap,wn=new WeakMap,vl=new WeakMap,Aa=new WeakMap,Oa=new WeakMap,Cr=new WeakMap,Er=new WeakMap,kn=new WeakMap,Da=new WeakMap,ke=new WeakSet,Ri=function(t){de(this,ke,lx).call(this);let n=C(this,ge).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(vt)),n},tx=function(){de(this,ke,ax).call(this);const t=Un(this.options.staleTime,C(this,ge));if(dl.isServer()||C(this,yt).isStale||!Yu(t))return;const r=Kg(C(this,yt).dataUpdatedAt,t)+1;Q(this,Cr,gr.setTimeout(()=>{C(this,yt).isStale||this.updateResult()},r))},sx=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(C(this,ge)):this.options.refetchInterval)??!1},nx=function(t){de(this,ke,ix).call(this),Q(this,kn,t),!(dl.isServer()||Yt(this.options.enabled,C(this,ge))===!1||!Yu(C(this,kn))||C(this,kn)===0)&&Q(this,Er,gr.setInterval(()=>{(this.options.refetchIntervalInBackground||Sm.isFocused())&&de(this,ke,Ri).call(this)},C(this,kn)))},rx=function(){de(this,ke,tx).call(this),de(this,ke,nx).call(this,de(this,ke,sx).call(this))},ax=function(){C(this,Cr)&&(gr.clearTimeout(C(this,Cr)),Q(this,Cr,void 0))},ix=function(){C(this,Er)&&(gr.clearInterval(C(this,Er)),Q(this,Er,void 0))},lx=function(){const t=C(this,Pt).getQueryCache().build(C(this,Pt),this.options);if(t===C(this,ge))return;const n=C(this,ge);Q(this,ge,t),Q(this,bl,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Zg=function(t){Qe.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(C(this,yt))}),C(this,Pt).getQueryCache().notify({query:C(this,ge),type:"observerResultsUpdated"})})},hf);function wN(e,t){return Yt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Cp(e,t){return wN(e,t)||e.state.data!==void 0&&ox(e,t,t.refetchOnMount)}function ox(e,t,n){if(Yt(t.enabled,e)!==!1&&Un(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Rm(e,t)}return!1}function Ep(e,t,n,r){return(e!==t||Yt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Rm(e,n)}function Rm(e,t){return Yt(t.enabled,e)!==!1&&e.isStaleByTime(Un(t.staleTime,e))}function kN(e,t){return!ec(e.getCurrentResult(),t)}function Pp(e){return{onFetch:(t,n)=>{var x,p,y,b,f;const r=t.options,a=(y=(p=(x=t.fetchOptions)==null?void 0:x.meta)==null?void 0:p.fetchMore)==null?void 0:y.direction,i=((b=t.state.data)==null?void 0:b.pages)||[],l=((f=t.state.data)==null?void 0:f.pageParams)||[];let o={pages:[],pageParams:[]},c=0;const d=async()=>{let v=!1;const w=g=>{fN(g,()=>t.signal,()=>v=!0)},h=Vg(t.options,t.fetchOptions),u=async(g,j,k)=>{if(v)return Promise.reject();if(j==null&&g.pages.length)return Promise.resolve(g);const S=(()=>{const V={client:t.client,queryKey:t.queryKey,pageParam:j,direction:k?"backward":"forward",meta:t.options.meta};return w(V),V})(),P=await h(S),{maxPages:$}=t.options,M=k?pN:hN;return{pages:M(g.pages,P,$),pageParams:M(g.pageParams,j,$)}};if(a&&i.length){const g=a==="backward",j=g?SN:Rp,k={pages:i,pageParams:l},N=j(r,k);o=await u(k,N,g)}else{const g=e??i.length;do{const j=c===0?l[0]??r.initialPageParam:Rp(r,o);if(c>0&&j==null)break;o=await u(o,j),c++}while(c<g)}return o};t.options.persister?t.fetchFn=()=>{var v,w;return(w=(v=t.options).persister)==null?void 0:w.call(v,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function Rp(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function SN(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var jl,js,xt,Pr,Ns,hn,pf,CN=(pf=class extends Yg{constructor(t){super();ee(this,Ns);ee(this,jl);ee(this,js);ee(this,xt);ee(this,Pr);Q(this,jl,t.client),this.mutationId=t.mutationId,Q(this,xt,t.mutationCache),Q(this,js,[]),this.state=t.state||ey(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){C(this,js).includes(t)||(C(this,js).push(t),this.clearGcTimeout(),C(this,xt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Q(this,js,C(this,js).filter(n=>n!==t)),this.scheduleGc(),C(this,xt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){C(this,js).length||(this.state.status==="pending"?this.scheduleGc():C(this,xt).remove(this))}continue(){var t;return((t=C(this,Pr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,o,c,d,x,p,y,b,f,v,w,h,u,g,j,k,N,S;const n=()=>{de(this,Ns,hn).call(this,{type:"continue"})},r={client:C(this,jl),meta:this.options.meta,mutationKey:this.options.mutationKey};Q(this,Pr,Qg({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(P,$)=>{de(this,Ns,hn).call(this,{type:"failed",failureCount:P,error:$})},onPause:()=>{de(this,Ns,hn).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,xt).canRun(this)}));const a=this.state.status==="pending",i=!C(this,Pr).canStart();try{if(a)n();else{de(this,Ns,hn).call(this,{type:"pending",variables:t,isPaused:i}),C(this,xt).config.onMutate&&await C(this,xt).config.onMutate(t,this,r);const $=await((o=(l=this.options).onMutate)==null?void 0:o.call(l,t,r));$!==this.state.context&&de(this,Ns,hn).call(this,{type:"pending",context:$,variables:t,isPaused:i})}const P=await C(this,Pr).start();return await((d=(c=C(this,xt).config).onSuccess)==null?void 0:d.call(c,P,t,this.state.context,this,r)),await((p=(x=this.options).onSuccess)==null?void 0:p.call(x,P,t,this.state.context,r)),await((b=(y=C(this,xt).config).onSettled)==null?void 0:b.call(y,P,null,this.state.variables,this.state.context,this,r)),await((v=(f=this.options).onSettled)==null?void 0:v.call(f,P,null,t,this.state.context,r)),de(this,Ns,hn).call(this,{type:"success",data:P}),P}catch(P){try{await((h=(w=C(this,xt).config).onError)==null?void 0:h.call(w,P,t,this.state.context,this,r))}catch($){Promise.reject($)}try{await((g=(u=this.options).onError)==null?void 0:g.call(u,P,t,this.state.context,r))}catch($){Promise.reject($)}try{await((k=(j=C(this,xt).config).onSettled)==null?void 0:k.call(j,void 0,P,this.state.variables,this.state.context,this,r))}catch($){Promise.reject($)}try{await((S=(N=this.options).onSettled)==null?void 0:S.call(N,void 0,P,t,this.state.context,r))}catch($){Promise.reject($)}throw de(this,Ns,hn).call(this,{type:"error",error:P}),P}finally{C(this,xt).runNext(this)}}},jl=new WeakMap,js=new WeakMap,xt=new WeakMap,Pr=new WeakMap,Ns=new WeakSet,hn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Qe.batch(()=>{C(this,js).forEach(r=>{r.onMutationUpdate(t)}),C(this,xt).notify({mutation:this,type:"updated",action:t})})},pf);function ey(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var qs,us,Nl,ff,EN=(ff=class extends si{constructor(t={}){super();ee(this,qs);ee(this,us);ee(this,Nl);this.config=t,Q(this,qs,new Set),Q(this,us,new Map),Q(this,Nl,0)}build(t,n,r){const a=new CN({client:t,mutationCache:this,mutationId:++Il(this,Nl)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){C(this,qs).add(t);const n=eo(t);if(typeof n=="string"){const r=C(this,us).get(n);r?r.push(t):C(this,us).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(C(this,qs).delete(t)){const n=eo(t);if(typeof n=="string"){const r=C(this,us).get(n);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&C(this,us).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=eo(t);if(typeof n=="string"){const r=C(this,us).get(n),a=r==null?void 0:r.find(i=>i.state.status==="pending");return!a||a===t}else return!0}runNext(t){var r;const n=eo(t);if(typeof n=="string"){const a=(r=C(this,us).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Qe.batch(()=>{C(this,qs).forEach(t=>{this.notify({type:"removed",mutation:t})}),C(this,qs).clear(),C(this,us).clear()})}getAll(){return Array.from(C(this,qs))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>jp(n,r))}findAll(t={}){return this.getAll().filter(n=>jp(t,n))}notify(t){Qe.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Qe.batch(()=>Promise.all(t.map(n=>n.continue().catch(vt))))}},qs=new WeakMap,us=new WeakMap,Nl=new WeakMap,ff);function eo(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Hs,Sn,Rt,Ks,Js,ko,cx,gf,PN=(gf=class extends si{constructor(n,r){super();ee(this,Js);ee(this,Hs);ee(this,Sn);ee(this,Rt);ee(this,Ks);Q(this,Hs,n),this.setOptions(r),this.bindMethods(),de(this,Js,ko).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var a;const r=this.options;this.options=C(this,Hs).defaultMutationOptions(n),ec(this.options,r)||C(this,Hs).getMutationCache().notify({type:"observerOptionsUpdated",mutation:C(this,Rt),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&$r(r.mutationKey)!==$r(this.options.mutationKey)?this.reset():((a=C(this,Rt))==null?void 0:a.state.status)==="pending"&&C(this,Rt).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=C(this,Rt))==null||n.removeObserver(this)}onMutationUpdate(n){de(this,Js,ko).call(this),de(this,Js,cx).call(this,n)}getCurrentResult(){return C(this,Sn)}reset(){var n;(n=C(this,Rt))==null||n.removeObserver(this),Q(this,Rt,void 0),de(this,Js,ko).call(this),de(this,Js,cx).call(this)}mutate(n,r){var a;return Q(this,Ks,r),(a=C(this,Rt))==null||a.removeObserver(this),Q(this,Rt,C(this,Hs).getMutationCache().build(C(this,Hs),this.options)),C(this,Rt).addObserver(this),C(this,Rt).execute(n)}},Hs=new WeakMap,Sn=new WeakMap,Rt=new WeakMap,Ks=new WeakMap,Js=new WeakSet,ko=function(){var r;const n=((r=C(this,Rt))==null?void 0:r.state)??ey();Q(this,Sn,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},cx=function(n){Qe.batch(()=>{var r,a,i,l,o,c,d,x;if(C(this,Ks)&&this.hasListeners()){const p=C(this,Sn).variables,y=C(this,Sn).context,b={client:C(this,Hs),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(a=(r=C(this,Ks)).onSuccess)==null||a.call(r,n.data,p,y,b)}catch(f){Promise.reject(f)}try{(l=(i=C(this,Ks)).onSettled)==null||l.call(i,n.data,null,p,y,b)}catch(f){Promise.reject(f)}}else if((n==null?void 0:n.type)==="error"){try{(c=(o=C(this,Ks)).onError)==null||c.call(o,n.error,p,y,b)}catch(f){Promise.reject(f)}try{(x=(d=C(this,Ks)).onSettled)==null||x.call(d,void 0,n.error,p,y,b)}catch(f){Promise.reject(f)}}}this.listeners.forEach(p=>{p(C(this,Sn))})})},gf),ws,yf,RN=(yf=class extends si{constructor(t={}){super();ee(this,ws);this.config=t,Q(this,ws,new Map)}build(t,n,r){const a=n.queryKey,i=n.queryHash??Cm(a,n);let l=this.get(i);return l||(l=new jN({client:t,queryKey:a,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(l)),l}add(t){C(this,ws).has(t.queryHash)||(C(this,ws).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=C(this,ws).get(t.queryHash);n&&(t.destroy(),n===t&&C(this,ws).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Qe.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return C(this,ws).get(t)}getAll(){return[...C(this,ws).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>vp(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>vp(t,r)):n}notify(t){Qe.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Qe.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Qe.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ws=new WeakMap,yf),_e,Cn,En,Ia,Fa,Pn,La,_a,bf,MN=(bf=class{constructor(e={}){ee(this,_e);ee(this,Cn);ee(this,En);ee(this,Ia);ee(this,Fa);ee(this,Pn);ee(this,La);ee(this,_a);Q(this,_e,e.queryCache||new RN),Q(this,Cn,e.mutationCache||new EN),Q(this,En,e.defaultOptions||{}),Q(this,Ia,new Map),Q(this,Fa,new Map),Q(this,Pn,0)}mount(){Il(this,Pn)._++,C(this,Pn)===1&&(Q(this,La,Sm.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,_e).onFocus())})),Q(this,_a,tc.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,_e).onOnline())})))}unmount(){var e,t;Il(this,Pn)._--,C(this,Pn)===0&&((e=C(this,La))==null||e.call(this),Q(this,La,void 0),(t=C(this,_a))==null||t.call(this),Q(this,_a,void 0))}isFetching(e){return C(this,_e).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return C(this,Cn).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=C(this,_e).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=C(this,_e).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Un(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return C(this,_e).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=C(this,_e).get(r.queryHash),i=a==null?void 0:a.state.data,l=uN(t,i);if(l!==void 0)return C(this,_e).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Qe.batch(()=>C(this,_e).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=C(this,_e).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=C(this,_e);Qe.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=C(this,_e);return Qe.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Qe.batch(()=>C(this,_e).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(vt).catch(vt)}invalidateQueries(e,t={}){return Qe.batch(()=>(C(this,_e).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Qe.batch(()=>C(this,_e).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,n);return n.throwOnError||(i=i.catch(vt)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(vt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=C(this,_e).build(this,t);return n.isStaleByTime(Un(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vt).catch(vt)}fetchInfiniteQuery(e){return e.behavior=Pp(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vt).catch(vt)}ensureInfiniteQueryData(e){return e.behavior=Pp(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return tc.isOnline()?C(this,Cn).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,_e)}getMutationCache(){return C(this,Cn)}getDefaultOptions(){return C(this,En)}setDefaultOptions(e){Q(this,En,e)}setQueryDefaults(e,t){C(this,Ia).set($r(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...C(this,Ia).values()],n={};return t.forEach(r=>{cl(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){C(this,Fa).set($r(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...C(this,Fa).values()],n={};return t.forEach(r=>{cl(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...C(this,En).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Cm(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Em&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...C(this,En).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){C(this,_e).clear(),C(this,Cn).clear()}},_e=new WeakMap,Cn=new WeakMap,En=new WeakMap,Ia=new WeakMap,Fa=new WeakMap,Pn=new WeakMap,La=new WeakMap,_a=new WeakMap,bf),ty=m.createContext(void 0),ie=e=>{const t=m.useContext(ty);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},TN=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(ty.Provider,{value:e,children:t})),sy=m.createContext(!1),zN=()=>m.useContext(sy);sy.Provider;function AN(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ON=m.createContext(AN()),DN=()=>m.useContext(ON),IN=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Pm(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},FN=e=>{m.useEffect(()=>{e.clearReset()},[e])},LN=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||Pm(n,[e.error,r])),_N=e=>{if(e.suspense){const n=a=>a==="static"?a:Math.max(a??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...a)=>n(r(...a)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},$N=(e,t)=>e.isLoading&&e.isFetching&&!t,UN=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Mp=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function BN(e,t,n){var y,b,f,v;const r=zN(),a=DN(),i=ie(),l=i.defaultQueryOptions(e);(b=(y=i.getDefaultOptions().queries)==null?void 0:y._experimental_beforeQuery)==null||b.call(y,l);const o=i.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",_N(l),IN(l,a,o),FN(a);const c=!i.getQueryCache().get(l.queryHash),[d]=m.useState(()=>new t(i,l)),x=d.getOptimisticResult(l),p=!r&&e.subscribed!==!1;if(m.useSyncExternalStore(m.useCallback(w=>{const h=p?d.subscribe(Qe.batchCalls(w)):vt;return d.updateResult(),h},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),m.useEffect(()=>{d.setOptions(l)},[l,d]),UN(l,x))throw Mp(l,d,a);if(LN({result:x,errorResetBoundary:a,throwOnError:l.throwOnError,query:o,suspense:l.suspense}))throw x.error;if((v=(f=i.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||v.call(f,l,x),l.experimental_prefetchInRender&&!dl.isServer()&&$N(x,r)){const w=c?Mp(l,d,a):o==null?void 0:o.promise;w==null||w.catch(vt).finally(()=>{d.updateResult()})}return l.notifyOnChangeProps?x:d.trackResult(x)}function me(e,t){return BN(e,NN)}function W(e,t){const n=ie(),[r]=m.useState(()=>new PN(n,e));m.useEffect(()=>{r.setOptions(e)},[r,e]);const a=m.useSyncExternalStore(m.useCallback(l=>r.subscribe(Qe.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=m.useCallback((l,o)=>{r.mutate(l,o).catch(vt)},[r]);if(a.error&&Pm(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:i,mutateAsync:a.mutate}}let qN={data:""},HN=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||qN},KN=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,WN=/\/\*[^]*?\*\/| +/g,Tp=/\n+/g,bn=(e,t)=>{let n="",r="",a="";for(let i in e){let l=e[i];i[0]=="@"?i[1]=="i"?n=i+" "+l+";":r+=i[1]=="f"?bn(l,i):i+"{"+bn(l,i[1]=="k"?"":t)+"}":typeof l=="object"?r+=bn(l,t?t.replace(/([^,])+/g,o=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,o):o?o+" "+c:c)):i):l!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),a+=bn.p?bn.p(i,l):i+":"+l+";")}return n+(t&&a?t+"{"+a+"}":a)+r},Ds={},ny=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+ny(e[n]);return t}return e},VN=(e,t,n,r,a)=>{let i=ny(e),l=Ds[i]||(Ds[i]=(c=>{let d=0,x=11;for(;d<c.length;)x=101*x+c.charCodeAt(d++)>>>0;return"go"+x})(i));if(!Ds[l]){let c=i!==e?e:(d=>{let x,p,y=[{}];for(;x=KN.exec(d.replace(WN,""));)x[4]?y.shift():x[3]?(p=x[3].replace(Tp," ").trim(),y.unshift(y[0][p]=y[0][p]||{})):y[0][x[1]]=x[2].replace(Tp," ").trim();return y[0]})(e);Ds[l]=bn(a?{["@keyframes "+l]:c}:c,n?"":"."+l)}let o=n&&Ds.g?Ds.g:null;return n&&(Ds.g=Ds[l]),((c,d,x,p)=>{p?d.data=d.data.replace(p,c):d.data.indexOf(c)===-1&&(d.data=x?c+d.data:d.data+c)})(Ds[l],t,r,o),l},GN=(e,t,n)=>e.reduce((r,a,i)=>{let l=t[i];if(l&&l.call){let o=l(n),c=o&&o.props&&o.props.className||/^go/.test(o)&&o;l=c?"."+c:o&&typeof o=="object"?o.props?"":bn(o,""):o===!1?"":o}return r+a+(l??"")},"");function Dc(e){let t=this||{},n=e.call?e(t.p):e;return VN(n.unshift?n.raw?GN(n,[].slice.call(arguments,1),t.p):n.reduce((r,a)=>Object.assign(r,a&&a.call?a(t.p):a),{}):n,HN(t.target),t.g,t.o,t.k)}let ry,dx,ux;Dc.bind({g:1});let sn=Dc.bind({k:1});function QN(e,t,n,r){bn.p=t,ry=e,dx=n,ux=r}function er(e,t){let n=this||{};return function(){let r=arguments;function a(i,l){let o=Object.assign({},i),c=o.className||a.className;n.p=Object.assign({theme:dx&&dx()},o),n.o=/ *go\d+/.test(c),o.className=Dc.apply(n,r)+(c?" "+c:"");let d=e;return e[0]&&(d=o.as||e,delete o.as),ux&&d[0]&&ux(o),ry(d,o)}return a}}var YN=e=>typeof e=="function",sc=(e,t)=>YN(e)?e(t):e,JN=(()=>{let e=0;return()=>(++e).toString()})(),ay=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),XN=20,Mm="default",iy=(e,t)=>{let{toastLimit:n}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,n)};case 1:return{...e,toasts:e.toasts.map(l=>l.id===t.toast.id?{...l,...t.toast}:l)};case 2:let{toast:r}=t;return iy(e,{type:e.toasts.find(l=>l.id===r.id)?1:0,toast:r});case 3:let{toastId:a}=t;return{...e,toasts:e.toasts.map(l=>l.id===a||a===void 0?{...l,dismissed:!0,visible:!1}:l)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(l=>l.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(l=>({...l,pauseDuration:l.pauseDuration+i}))}}},So=[],ly={toasts:[],pausedAt:void 0,settings:{toastLimit:XN}},Ss={},oy=(e,t=Mm)=>{Ss[t]=iy(Ss[t]||ly,e),So.forEach(([n,r])=>{n===t&&r(Ss[t])})},cy=e=>Object.keys(Ss).forEach(t=>oy(e,t)),ZN=e=>Object.keys(Ss).find(t=>Ss[t].toasts.some(n=>n.id===e)),Ic=(e=Mm)=>t=>{oy(t,e)},e2={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},t2=(e={},t=Mm)=>{let[n,r]=m.useState(Ss[t]||ly),a=m.useRef(Ss[t]);m.useEffect(()=>(a.current!==Ss[t]&&r(Ss[t]),So.push([t,r]),()=>{let l=So.findIndex(([o])=>o===t);l>-1&&So.splice(l,1)}),[t]);let i=n.toasts.map(l=>{var o,c,d;return{...e,...e[l.type],...l,removeDelay:l.removeDelay||((o=e[l.type])==null?void 0:o.removeDelay)||(e==null?void 0:e.removeDelay),duration:l.duration||((c=e[l.type])==null?void 0:c.duration)||(e==null?void 0:e.duration)||e2[l.type],style:{...e.style,...(d=e[l.type])==null?void 0:d.style,...l.style}}});return{...n,toasts:i}},s2=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||JN()}),Rl=e=>(t,n)=>{let r=s2(t,e,n);return Ic(r.toasterId||ZN(r.id))({type:2,toast:r}),r.id},Ye=(e,t)=>Rl("blank")(e,t);Ye.error=Rl("error");Ye.success=Rl("success");Ye.loading=Rl("loading");Ye.custom=Rl("custom");Ye.dismiss=(e,t)=>{let n={type:3,toastId:e};t?Ic(t)(n):cy(n)};Ye.dismissAll=e=>Ye.dismiss(void 0,e);Ye.remove=(e,t)=>{let n={type:4,toastId:e};t?Ic(t)(n):cy(n)};Ye.removeAll=e=>Ye.remove(void 0,e);Ye.promise=(e,t,n)=>{let r=Ye.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then(a=>{let i=t.success?sc(t.success,a):void 0;return i?Ye.success(i,{id:r,...n,...n==null?void 0:n.success}):Ye.dismiss(r),a}).catch(a=>{let i=t.error?sc(t.error,a):void 0;i?Ye.error(i,{id:r,...n,...n==null?void 0:n.error}):Ye.dismiss(r)}),e};var n2=1e3,r2=(e,t="default")=>{let{toasts:n,pausedAt:r}=t2(e,t),a=m.useRef(new Map).current,i=m.useCallback((p,y=n2)=>{if(a.has(p))return;let b=setTimeout(()=>{a.delete(p),l({type:4,toastId:p})},y);a.set(p,b)},[]);m.useEffect(()=>{if(r)return;let p=Date.now(),y=n.map(b=>{if(b.duration===1/0)return;let f=(b.duration||0)+b.pauseDuration-(p-b.createdAt);if(f<0){b.visible&&Ye.dismiss(b.id);return}return setTimeout(()=>Ye.dismiss(b.id,t),f)});return()=>{y.forEach(b=>b&&clearTimeout(b))}},[n,r,t]);let l=m.useCallback(Ic(t),[t]),o=m.useCallback(()=>{l({type:5,time:Date.now()})},[l]),c=m.useCallback((p,y)=>{l({type:1,toast:{id:p,height:y}})},[l]),d=m.useCallback(()=>{r&&l({type:6,time:Date.now()})},[r,l]),x=m.useCallback((p,y)=>{let{reverseOrder:b=!1,gutter:f=8,defaultPosition:v}=y||{},w=n.filter(g=>(g.position||v)===(p.position||v)&&g.height),h=w.findIndex(g=>g.id===p.id),u=w.filter((g,j)=>j<h&&g.visible).length;return w.filter(g=>g.visible).slice(...b?[u+1]:[0,u]).reduce((g,j)=>g+(j.height||0)+f,0)},[n]);return m.useEffect(()=>{n.forEach(p=>{if(p.dismissed)i(p.id,p.removeDelay);else{let y=a.get(p.id);y&&(clearTimeout(y),a.delete(p.id))}})},[n,i]),{toasts:n,handlers:{updateHeight:c,startPause:o,endPause:d,calculateOffset:x}}},a2=sn`
68
+ from {
69
+ transform: scale(0) rotate(45deg);
70
+ opacity: 0;
71
+ }
72
+ to {
73
+ transform: scale(1) rotate(45deg);
74
+ opacity: 1;
75
+ }`,i2=sn`
76
+ from {
77
+ transform: scale(0);
78
+ opacity: 0;
79
+ }
80
+ to {
81
+ transform: scale(1);
82
+ opacity: 1;
83
+ }`,l2=sn`
84
+ from {
85
+ transform: scale(0) rotate(90deg);
86
+ opacity: 0;
87
+ }
88
+ to {
89
+ transform: scale(1) rotate(90deg);
90
+ opacity: 1;
91
+ }`,o2=er("div")`
92
+ width: 20px;
93
+ opacity: 0;
94
+ height: 20px;
95
+ border-radius: 10px;
96
+ background: ${e=>e.primary||"#ff4b4b"};
97
+ position: relative;
98
+ transform: rotate(45deg);
99
+
100
+ animation: ${a2} 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: ${i2} 0.15s ease-out forwards;
108
+ animation-delay: 150ms;
109
+ position: absolute;
110
+ border-radius: 3px;
111
+ opacity: 0;
112
+ background: ${e=>e.secondary||"#fff"};
113
+ bottom: 9px;
114
+ left: 4px;
115
+ height: 2px;
116
+ width: 12px;
117
+ }
118
+
119
+ &:before {
120
+ animation: ${l2} 0.15s ease-out forwards;
121
+ animation-delay: 180ms;
122
+ transform: rotate(90deg);
123
+ }
124
+ `,c2=sn`
125
+ from {
126
+ transform: rotate(0deg);
127
+ }
128
+ to {
129
+ transform: rotate(360deg);
130
+ }
131
+ `,d2=er("div")`
132
+ width: 12px;
133
+ height: 12px;
134
+ box-sizing: border-box;
135
+ border: 2px solid;
136
+ border-radius: 100%;
137
+ border-color: ${e=>e.secondary||"#e0e0e0"};
138
+ border-right-color: ${e=>e.primary||"#616161"};
139
+ animation: ${c2} 1s linear infinite;
140
+ `,u2=sn`
141
+ from {
142
+ transform: scale(0) rotate(45deg);
143
+ opacity: 0;
144
+ }
145
+ to {
146
+ transform: scale(1) rotate(45deg);
147
+ opacity: 1;
148
+ }`,x2=sn`
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
+ }`,m2=er("div")`
163
+ width: 20px;
164
+ opacity: 0;
165
+ height: 20px;
166
+ border-radius: 10px;
167
+ background: ${e=>e.primary||"#61d345"};
168
+ position: relative;
169
+ transform: rotate(45deg);
170
+
171
+ animation: ${u2} 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: ${x2} 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: ${e=>e.secondary||"#fff"};
184
+ bottom: 6px;
185
+ left: 6px;
186
+ height: 10px;
187
+ width: 6px;
188
+ }
189
+ `,h2=er("div")`
190
+ position: absolute;
191
+ `,p2=er("div")`
192
+ position: relative;
193
+ display: flex;
194
+ justify-content: center;
195
+ align-items: center;
196
+ min-width: 20px;
197
+ min-height: 20px;
198
+ `,f2=sn`
199
+ from {
200
+ transform: scale(0.6);
201
+ opacity: 0.4;
202
+ }
203
+ to {
204
+ transform: scale(1);
205
+ opacity: 1;
206
+ }`,g2=er("div")`
207
+ position: relative;
208
+ transform: scale(0.6);
209
+ opacity: 0.4;
210
+ min-width: 20px;
211
+ animation: ${f2} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
212
+ forwards;
213
+ `,y2=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?m.createElement(g2,null,t):t:n==="blank"?null:m.createElement(p2,null,m.createElement(d2,{...r}),n!=="loading"&&m.createElement(h2,null,n==="error"?m.createElement(o2,{...r}):m.createElement(m2,{...r})))},b2=e=>`
214
+ 0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
215
+ 100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
216
+ `,v2=e=>`
217
+ 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
218
+ 100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
219
+ `,j2="0%{opacity:0;} 100%{opacity:1;}",N2="0%{opacity:1;} 100%{opacity:0;}",w2=er("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
+ `,k2=er("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
+ `,S2=(e,t)=>{let n=e.includes("top")?1:-1,[r,a]=ay()?[j2,N2]:[b2(n),v2(n)];return{animation:t?`${sn(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${sn(a)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},C2=m.memo(({toast:e,position:t,style:n,children:r})=>{let a=e.height?S2(e.position||t||"top-center",e.visible):{opacity:0},i=m.createElement(y2,{toast:e}),l=m.createElement(k2,{...e.ariaProps},sc(e.message,e));return m.createElement(w2,{className:e.className,style:{...a,...n,...e.style}},typeof r=="function"?r({icon:i,message:l}):m.createElement(m.Fragment,null,i,l))});QN(m.createElement);var E2=({id:e,className:t,style:n,onHeightUpdate:r,children:a})=>{let i=m.useCallback(l=>{if(l){let o=()=>{let c=l.getBoundingClientRect().height;r(e,c)};o(),new MutationObserver(o).observe(l,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return m.createElement("div",{ref:i,className:t,style:n},a)},P2=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},a=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:ay()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...a}},R2=Dc`
239
+ z-index: 9999;
240
+ > * {
241
+ pointer-events: auto;
242
+ }
243
+ `,to=16,M2=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:a,toasterId:i,containerStyle:l,containerClassName:o})=>{let{toasts:c,handlers:d}=r2(n,i);return m.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:to,left:to,right:to,bottom:to,pointerEvents:"none",...l},className:o,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(x=>{let p=x.position||t,y=d.calculateOffset(x,{reverseOrder:e,gutter:r,defaultPosition:t}),b=P2(p,y);return m.createElement(E2,{id:x.id,key:x.id,onHeightUpdate:d.updateHeight,className:x.visible?R2:"",style:b},x.type==="custom"?sc(x.message,x):a?a(x):m.createElement(C2,{toast:x,position:p}))}))},A=Ye;/**
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 T2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),dy=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).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 z2={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 A2=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:l,...o},c)=>m.createElement("svg",{ref:c,...z2,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:dy("lucide",a),...o},[...l.map(([d,x])=>m.createElement(d,x)),...Array.isArray(i)?i:[i]]));/**
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 F=(e,t)=>{const n=m.forwardRef(({className:r,...a},i)=>m.createElement(A2,{ref:i,iconNode:t,className:dy(`lucide-${T2(e)}`,r),...a}));return n.displayName=`${e}`,n};/**
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 xx=F("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 O2=F("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 uy=F("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 yr=F("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 xy=F("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 D2=F("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 I2=F("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 nc=F("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 F2=F("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 ul=F("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 L2=F("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 _2=F("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 $2=F("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 U2=F("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 B2=F("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 Hn=F("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 q2=F("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 H2=F("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 ps=F("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 my=F("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 ze=F("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 ht=F("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 K2=F("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 Kt=F("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 W2=F("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 we=F("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 V2=F("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 G2=F("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 Q2=F("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=F("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 hy=F("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 Kr=F("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 kd=F("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 Tm=F("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 zm=F("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 Y2=F("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 py=F("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 Ga=F("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 ni=F("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 J2=F("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 Ml=F("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 fy=F("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 gy=F("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 yy=F("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 by=F("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 vy=F("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 Ps=F("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 jy=F("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 X2=F("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 Ny=F("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 xl=F("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 wy=F("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 Z2=F("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 Kn=F("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 Tr=F("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 ky=F("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 nn=F("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 ew=F("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 Fc=F("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 tw=F("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 Am=F("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 rc=F("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 Om=F("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 zp=F("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 Ap=F("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"}]]);/**
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 Wr=F("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"}]]);/**
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 sw=F("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"}]]);/**
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 nw=F("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"}]]);/**
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 ac=F("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"}]]);/**
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 rw=F("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"}]]);/**
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 ae=F("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
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 Sd=F("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"}]]);/**
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 aw=F("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"}]]);/**
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 iw=F("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"}]]);/**
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 Dm=F("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"}]]);/**
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 lw=F("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"}]]);/**
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 Op=F("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"}]]);/**
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 ow=F("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"}]]);/**
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 Sy=F("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
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 br=F("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"}]]);/**
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 cw=F("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
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 dw=F("MoveRight",[["path",{d:"M18 8L22 12L18 16",key:"1r0oui"}],["path",{d:"M2 12H22",key:"1m8cig"}]]);/**
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 uw=F("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"}]]);/**
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 Dp=F("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"}]]);/**
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 tr=F("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"}]]);/**
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 xw=F("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"}]]);/**
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 Dt=F("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
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 mw=F("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"}]]);/**
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 Rs=F("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
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 Im=F("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"}]]);/**
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 Lc=F("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"}]]);/**
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 Tl=F("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"}]]);/**
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 mx=F("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"}]]);/**
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 Cy=F("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"}]]);/**
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 Wn=F("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
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 hw=F("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"}]]);/**
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 pw=F("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"}]]);/**
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 Qa=F("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"}]]);/**
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 ic=F("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"}]]);/**
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 fw=F("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"}]]);/**
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 Fm=F("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"}]]);/**
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 gw=F("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"}]]);/**
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 yw=F("SkipBack",[["polygon",{points:"19 20 9 12 19 4 19 20",key:"o2sva"}],["line",{x1:"5",x2:"5",y1:"19",y2:"5",key:"1ocqjk"}]]);/**
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 _c=F("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/**
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 bw=F("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"}]]);/**
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 Mi=F("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
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 wt=F("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"}]]);/**
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 vw=F("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"}]]);/**
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 Ey=F("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
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 jw=F("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"}]]);/**
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 Co=F("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"}]]);/**
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 Py=F("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"}]]);/**
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 $c=F("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
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 Ip=F("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"}]]);/**
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 Nw=F("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"}]]);/**
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 It=F("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"}]]);/**
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 ww=F("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"}]]);/**
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 kw=F("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"}]]);/**
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 ts=F("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"}]]);/**
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 Sw=F("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"}]]);/**
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 Uc=F("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"}]]);/**
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 Lm=F("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"}]]);/**
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 Bc=F("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"}]]);/**
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 Ur=F("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"}]]);/**
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 Cw=F("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"}]]);/**
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 ye=F("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
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 qe=F("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 Ry(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=Ry(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function E(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=Ry(e))&&(r&&(r+=" "),r+=t);return r}function My({size:e=40}){return s.jsx("img",{src:"/favicon.svg",alt:"AssureMind",width:e,height:e,style:{flexShrink:0,borderRadius:e*.22},draggable:!1})}function Ew(){return s.jsxs("div",{className:"flex items-center gap-3 select-none min-w-0 px-1",children:[s.jsx(My,{size:46}),s.jsxs("div",{className:"flex flex-col justify-center leading-none min-w-0",children:[s.jsx("span",{className:"text-[20px] font-bold text-white truncate",style:{letterSpacing:"-0.02em"},children:"AssureMind"}),s.jsx("span",{className:"text-[9px] font-semibold text-slate-400 uppercase mt-1.5",style:{letterSpacing:"0.18em"},children:"Studio"})]})]})}function Pw(){return s.jsxs("div",{className:"flex flex-col items-center gap-1 select-none",children:[s.jsx(My,{size:36}),s.jsx("span",{className:"text-[8px] font-bold text-white/70 whitespace-nowrap",style:{letterSpacing:"-0.01em"},children:"AssureMind"})]})}const Rw=[{to:"/",icon:sw,label:"Dashboard"},{to:"/story",icon:wt,label:"Smart Tests"},{to:"/tests",icon:xl,label:"Test Editor"},{to:"/run",icon:Dt,label:"Run Config"},{to:"/reports",icon:H2,label:"Reports"},{to:"/variables",icon:bw,label:"Variables"},{to:"/healing",icon:rc,label:"Self-Healing"},{to:"/git",icon:Kn,label:"Git Control Center"},{to:"/library",icon:nw,label:"Step Library"},{to:"/ci-integration",icon:Lc,label:"CI/CD"},{to:"/docs",icon:ul,label:"Docs"},{to:"/settings",icon:ic,label:"Settings"}];function Mw({collapsed:e=!1,onToggle:t,mobileOpen:n=!1}){return s.jsxs(s.Fragment,{children:[n&&s.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-20 lg:hidden",onClick:t}),s.jsxs("aside",{className:E("fixed lg:relative z-30 flex flex-col h-full bg-sidebar text-white transition-all duration-300 ease-in-out flex-shrink-0",e?"w-[84px]":"w-[248px]",n?"translate-x-0":"-translate-x-full lg:translate-x-0"),children:[s.jsx("div",{className:E("flex items-center border-b border-white/[0.06] flex-shrink-0",e?"justify-center px-2 py-3":"px-3 py-4"),children:e?s.jsx(Pw,{}):s.jsx(Ew,{})}),s.jsx("nav",{className:E("flex-1 overflow-y-auto py-2 space-y-0.5 sidebar-nav-scroll",e?"px-2":"px-3"),style:{paddingTop:e?void 0:"0.75rem"},children:Rw.map(({to:r,icon:a,label:i})=>s.jsxs(sN,{to:r,end:r==="/",className:({isActive:l})=>E("sidebar-item",l&&"active",e&&"justify-center !px-0"),title:e?i:void 0,children:[s.jsx(a,{size:18,className:"flex-shrink-0",strokeWidth:1.8}),!e&&s.jsx("span",{className:"truncate",children:i})]},r))}),s.jsx("button",{type:"button",onClick:t,className:E("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:e?"Expand sidebar":"Collapse sidebar",children:e?s.jsx(Kt,{size:16}):s.jsx(K2,{size:16})})]})]})}function Tw(){const[e,t]=m.useState(!1),[n,r]=m.useState(!1);return{collapsed:e,mobileOpen:n,toggle:()=>{t(i=>!i),r(i=>!i)}}}const qc="/api",zw=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}/ws`,Ty=["chromium","firefox","webkit"],Cd=e=>`assuremind:suppress:${e}`;let hi=null;const hx=new Set;function Fp(){hx.forEach(e=>e())}const zr={subscribe(e){return hx.add(e),()=>{hx.delete(e)}},getSnapshot(){return{activeModal:hi}},showModal(e){localStorage.getItem(Cd(e))!=="1"&&(hi=e,Fp())},dismiss(e){e&&hi&&localStorage.setItem(Cd(hi),"1"),hi=null,Fp()},isSuppressed(e){return localStorage.getItem(Cd(e))==="1"}};function Aw(){const[e,t]=m.useState(zr.getSnapshot);return m.useEffect(()=>zr.subscribe(()=>t(zr.getSnapshot())),[]),e}const Ow=new Set(["AI_NOT_CONFIGURED","JIRA_NOT_CONFIGURED","XRAY_NOT_CONFIGURED"]);async function U(e,t){const n=(t==null?void 0:t.body)!==void 0,r=await fetch(`${qc}${e}`,{headers:{...n?{"Content-Type":"application/json"}:{},...t==null?void 0:t.headers},...t});if(!r.ok){const a=await r.text();if(r.status===422)try{const i=JSON.parse(a);if(i.featureHint&&Ow.has(i.featureHint))throw zr.showModal(i.featureHint),new Error("Configuration required — check the setup instructions in the dialog.")}catch(i){if(i instanceof Error&&i.message.startsWith("Configuration required"))throw i}throw new Error(`API ${(t==null?void 0:t.method)??"GET"} ${e} → ${r.status}: ${a}`)}if(r.status!==204)return r.json()}const Br={get:()=>U("/config"),update:e=>U("/config",{method:"PUT",body:JSON.stringify(e)}),getAiProvider:()=>U("/ai-provider"),getMcpStatus:()=>U("/mcp/status")},Vr={list:e=>U(`/suites${e?`?type=${e}`:""}`),get:e=>U(`/suites/${e}`),create:e=>U("/suites",{method:"POST",body:JSON.stringify(e)}),update:(e,t)=>U(`/suites/${e}`,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>U(`/suites/${e}`,{method:"DELETE"})},Vn={list:e=>U(`/suites/${e}/cases`),get:(e,t)=>U(`/suites/${e}/cases/${t}`),create:(e,t)=>U(`/suites/${e}/cases`,{method:"POST",body:JSON.stringify(t)}),update:(e,t,n)=>U(`/suites/${e}/cases/${t}`,{method:"PATCH",body:JSON.stringify(n)}),delete:(e,t)=>U(`/suites/${e}/cases/${t}`,{method:"DELETE"}),bulkDelete:(e,t)=>U(`/suites/${e}/cases/bulk-delete`,{method:"POST",body:JSON.stringify({ids:t})}),bulkMove:(e,t,n)=>U(`/suites/${e}/cases/bulk-move`,{method:"POST",body:JSON.stringify({ids:t,targetSuiteId:n})})},Gr={add:(e,t,n)=>U(`/suites/${e}/cases/${t}/steps`,{method:"POST",body:JSON.stringify(n)}),update:(e,t,n,r)=>U(`/suites/${e}/cases/${t}/steps/${n}`,{method:"PATCH",body:JSON.stringify(r)}),delete:(e,t,n)=>U(`/suites/${e}/cases/${t}/steps/${n}`,{method:"DELETE"}),generate:(e,t,n)=>U(`/suites/${e}/cases/${t}/steps/${n}/generate`,{method:"POST"}),generateAll:(e,t)=>U(`/suites/${e}/cases/${t}/steps/generate-all`,{method:"POST"}),reorder:(e,t,n)=>U(`/suites/${e}/cases/${t}/steps/reorder`,{method:"PATCH",body:JSON.stringify({stepIds:n})})},Qr={get:e=>U(`/suites/${e}/hooks`),addStep:(e,t,n)=>U(`/suites/${e}/hooks/${t}/steps`,{method:"POST",body:JSON.stringify(n)}),updateStep:(e,t,n,r)=>U(`/suites/${e}/hooks/${t}/steps/${n}`,{method:"PATCH",body:JSON.stringify(r)}),deleteStep:(e,t,n)=>U(`/suites/${e}/hooks/${t}/steps/${n}`,{method:"DELETE"}),reorderSteps:(e,t,n)=>U(`/suites/${e}/hooks/${t}/steps/reorder`,{method:"PATCH",body:JSON.stringify({stepIds:n})}),generateStep:(e,t,n)=>U(`/suites/${e}/hooks/${t}/steps/${n}/generate`,{method:"POST"}),generateAll:(e,t)=>U(`/suites/${e}/hooks/${t}/steps/generate-all`,{method:"POST"})},Ed={getAll:()=>U("/variables"),getEnv:e=>U(`/variables/env/${e}`),set:(e,t)=>U(`/variables/${e}`,{method:"PUT",body:JSON.stringify({value:t})}),delete:e=>U(`/variables/${e}`,{method:"DELETE"})},Ws={list:()=>U("/healing"),pending:()=>U("/healing/pending"),stats:()=>U("/healing/stats"),accept:e=>U(`/healing/${e}/accept`,{method:"PATCH"}),reject:e=>U(`/healing/${e}/reject`,{method:"PATCH"}),acceptAll:()=>U("/healing/accept-all",{method:"POST"}),delete:e=>U(`/healing/${e}`,{method:"DELETE"}),deleteBulk:e=>U("/healing/delete-bulk",{method:"POST",body:JSON.stringify({ids:e})}),deleteAll:()=>U("/healing/clear-all",{method:"POST"})},Ya={start:e=>U("/run",{method:"POST",body:JSON.stringify(e)}),stop:()=>U("/run/stop",{method:"POST"}),list:e=>U(`/run${e!==void 0?`?limit=${e}`:""}`),get:e=>U(`/run/${e}`)},lc={list:e=>U(`/report${e!==void 0?`?limit=${e}`:""}`),get:e=>U(`/report/${e}`),delete:e=>U(`/report/${e}`,{method:"DELETE"})},ta={generate:(e,t,n)=>U("/story/generate",{method:"POST",body:JSON.stringify({story:e,suiteName:t,jiraUrl:n})}),generateBulk:(e,t=3)=>U("/story/generate-bulk",{method:"POST",body:JSON.stringify({stories:e,concurrency:t})}),fetchJira:e=>U("/story/fetch-jira",{method:"POST",body:JSON.stringify({jiraUrl:e})}),swaggerPreview:e=>U("/story/swagger-preview",{method:"POST",body:JSON.stringify({specUrl:e})}),generateFromSwagger:(e,t,n,r)=>U("/story/generate-from-swagger",{method:"POST",body:JSON.stringify({specUrl:e,suiteName:t,tags:n,requirements:r||void 0})})},Yr={enabled:()=>U("/xray/enabled"),status:()=>U("/xray/status"),suiteStatus:e=>U(`/xray/status/${e}`),createAll:()=>U("/xray/create-all",{method:"POST"}),createSuite:e=>U(`/xray/create/suite/${e}`,{method:"POST"}),createCase:(e,t)=>U(`/xray/create/case/${e}/${t}`,{method:"POST"}),syncAll:()=>U("/xray/sync-all",{method:"POST"}),syncSuite:e=>U(`/xray/sync/suite/${e}`,{method:"POST"}),syncCase:(e,t)=>U(`/xray/sync/case/${e}/${t}`,{method:"POST"}),validate:()=>U("/xray/validate")},sa={list:()=>U("/data-files"),get:e=>U(`/data-files/${encodeURIComponent(e)}`),upload:(e,t)=>U("/data-files/upload",{method:"POST",body:JSON.stringify({filename:e,content:t})}),update:(e,t)=>U(`/data-files/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({content:t})}),delete:e=>U(`/data-files/${encodeURIComponent(e)}`,{method:"DELETE"})},Ve={status:()=>U("/git/status"),branches:()=>U("/git/branches"),checkout:e=>U("/git/checkout",{method:"POST",body:JSON.stringify({branch:e})}),commit:e=>U("/git/commit",{method:"POST",body:JSON.stringify({message:e})}),pull:e=>U("/git/pull",{method:"POST",body:JSON.stringify({rebase:e})}),push:()=>U("/git/push",{method:"POST"}),fullSync:e=>U("/git/full-sync",{method:"POST",body:JSON.stringify({message:e})}),log:e=>U(`/git/log${e?`?count=${e}`:""}`),diff:e=>U(`/git/diff${e?"?staged=true":""}`),conflictContent:e=>U(`/git/conflict-content/${encodeURIComponent(e)}`),resolveConflict:(e,t)=>U("/git/resolve-conflict",{method:"POST",body:JSON.stringify({filePath:e,content:t})}),continueRebase:()=>U("/git/continue-rebase",{method:"POST"}),abortRebase:()=>U("/git/abort-rebase",{method:"POST"}),generateCommitMessage:()=>U("/git/generate-commit-message",{method:"POST"}),resolveConflictAI:(e,t,n)=>U("/git/resolve-conflict-ai",{method:"POST",body:JSON.stringify({filePath:e,ours:t,theirs:n})}),impact:()=>U("/git/impact")};function ri(e,t){const n=t.replace(/\\/g,"/").split("/").pop()??t;return`${qc}/results/${e}/${encodeURIComponent(n)}`}function Dw(e){return`${qc}/results/baselines/${encodeURIComponent(e)}.png`}const Iw={search:e=>U(`/search?q=${encodeURIComponent(e)}`)},qi={list:()=>U("/files"),upload:(e,t)=>U("/files/upload",{method:"POST",body:JSON.stringify({name:e,dataBase64:t})}),remove:e=>U(`/files/${encodeURIComponent(e)}`,{method:"DELETE"}),downloads:e=>U(`/report/${encodeURIComponent(e)}/downloads`),downloadUrl:(e,t)=>`${qc}/report/${encodeURIComponent(e)}/downloads/${encodeURIComponent(t)}`},Lp={generate:e=>U("/ci-config",{method:"POST",body:JSON.stringify(e)}),writeToRepo:e=>U("/ci-config/write",{method:"POST",body:JSON.stringify(e)})},Fw={list:()=>U("/templates")},Lw={get:(e,t)=>{const n=new URLSearchParams;return e&&n.set("suiteId",e),t&&n.set("caseId",t),U(`/flakiness?${n}`)}},xr={list:()=>U("/step-library"),create:e=>U("/step-library",{method:"POST",body:JSON.stringify(e)}),update:(e,t)=>U(`/step-library/${e}`,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>U(`/step-library/${e}`,{method:"DELETE"}),generate:e=>U(`/step-library/${e}/generate`,{method:"POST"})},_p={capture:(e,t)=>U(`/baselines/${e}/capture`,{method:"POST",body:JSON.stringify({screenshotPath:t})}),get:e=>U(`/baselines/${e}`)},Pd={start:(e,t)=>U("/recorder/start",{method:"POST",body:JSON.stringify({url:e,viewport:t})}),stop:()=>U("/recorder/stop",{method:"POST"}),status:()=>U("/recorder/status")};function _w(e){const t=e.locator,n=e.dialogHandler?`page.once('dialog', dialog => dialog.${e.dialogHandler.type}());
899
+ `:"";switch(e.action){case"navigate":return`await page.goto('${lr(e.url||"")}');`;case"click":return`${n}await page.${t}.click();`;case"fill":return`${n}await page.${t}.fill('${lr(e.value||"")}');`;case"select":return`await page.${t}.selectOption('${lr(e.value||"")}');`;case"check":return`await page.${t}.check();`;case"uncheck":return`await page.${t}.uncheck();`;case"press":return t?`await page.${t}.press('${lr(e.value||"")}');`:`await page.keyboard.press('${lr(e.value||"")}');`;case"hover":return`await page.${t}.click();`;case"assert":{const r=e.instruction,a=e.soft?"expect.soft":"expect";if(r.includes("current URL contains")){const i=r.match(/contains "(.+)"/),l=i?i[1]:"/";return`await ${a}(page).toHaveURL(/${$w(l)}/);`}if(r.includes("page title is")){const i=r.match(/title is "(.+)"/),l=i?i[1]:"";return`await ${a}(page).toHaveTitle('${lr(l)}');`}if(r.includes("has value")){const i=r.match(/has value "(.+)"/),l=i?i[1]:"";return`await ${a}(page.${t}).toHaveValue('${lr(l)}');`}return r.includes("is checked")?`await ${a}(page.${t}).toBeChecked();`:r.includes("is unchecked")?`await ${a}(page.${t}).not.toBeChecked();`:t?`await ${a}(page.${t}).toBeVisible();`:`// TODO: ${r}`}default:return`// Unhandled action: ${e.action}`}}function lr(e){return e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}function $w(e){return e.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&")}let pi=!1,Rd=null;const na=[];let Md=!1,Td=[];const px=new Set;function Is(){for(const e of px)e()}const Re={subscribe(e){return px.add(e),()=>{px.delete(e)}},getSnapshot(){return{panelOpen:pi,operationInProgress:Rd,logSteps:[...na],hasConflict:Md,conflictFiles:[...Td]}},togglePanel(){pi=!pi,Is()},openPanel(){pi=!0,Is()},closePanel(){pi=!1,Is()},startOperation(e){Rd=e,na.length=0,Is()},finishOperation(){Rd=null,Is()},addLogStep(e){const t=na.findIndex(n=>n.step===e.step&&n.status==="running");t>=0&&e.status!=="running"?na[t]=e:t<0&&na.push(e),Is()},clearLogs(){na.length=0,Is()},setConflict(e){Md=e.length>0,Td=e,Is()},clearConflict(){Md=!1,Td=[],Is()}};function Hc(){const[e,t]=m.useState(()=>Re.getSnapshot());return m.useEffect(()=>Re.subscribe(()=>t(Re.getSnapshot())),[]),e}function _m(){return me({queryKey:["git","status"],queryFn:Ve.status,refetchInterval:5e3,retry:1})}function zy(){return me({queryKey:["git","branches"],queryFn:Ve.branches,staleTime:3e4,retry:1})}function Ay(e){return me({queryKey:["git","log",e],queryFn:()=>Ve.log(e),staleTime:1e4,retry:1})}function Oy(){const e=ie();return W({mutationFn:t=>Ve.checkout(t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["git"]}),A.success(`Switched to ${n}`)},onError:t=>A.error(`Checkout failed: ${t.message}`)})}function Dy(){const e=ie();return W({mutationFn:t=>(Re.startOperation("commit"),Ve.commit(t)),onSuccess:t=>{Re.finishOperation(),e.invalidateQueries({queryKey:["git"]}),A.success(`Committed: ${t.hash}`)},onError:t=>{Re.finishOperation(),A.error(`Commit failed: ${t.message}`)}})}function Iy(){const e=ie();return W({mutationFn:t=>(Re.startOperation("pull"),Ve.pull(t)),onSuccess:()=>{Re.finishOperation(),e.invalidateQueries({queryKey:["git"]}),A.success("Pull successful")},onError:t=>{Re.finishOperation(),A.error(`Pull failed: ${t.message}`)}})}function Fy(){const e=ie();return W({mutationFn:()=>(Re.startOperation("push"),Ve.push()),onSuccess:()=>{Re.finishOperation(),e.invalidateQueries({queryKey:["git"]}),A.success("Pushed to remote")},onError:t=>{Re.finishOperation(),A.error(`Push failed: ${t.message}`)}})}function Ly(){const e=ie();return W({mutationFn:t=>(Re.startOperation("full-sync"),Ve.fullSync(t)),onSuccess:()=>{Re.finishOperation(),e.invalidateQueries({queryKey:["git"]}),A.success("Full sync complete")},onError:t=>{Re.finishOperation(),A.error(`Sync failed: ${t.message}`)}})}function _y(){return W({mutationFn:()=>Ve.generateCommitMessage(),onError:e=>A.error(`AI generation failed: ${e.message}`)})}function $y(){const e=ie();return W({mutationFn:({filePath:t,content:n})=>Ve.resolveConflict(t,n),onSuccess:()=>{e.invalidateQueries({queryKey:["git"]}),A.success("Conflict resolved")},onError:t=>A.error(`Resolve failed: ${t.message}`)})}function Uy(){return W({mutationFn:({filePath:e,ours:t,theirs:n})=>Ve.resolveConflictAI(e,t,n),onError:e=>A.error(`AI resolve failed: ${e.message}`)})}function By(){const e=ie();return W({mutationFn:()=>Ve.continueRebase(),onSuccess:()=>{Re.clearConflict(),e.invalidateQueries({queryKey:["git"]}),A.success("Rebase continued")},onError:t=>A.error(`Continue rebase failed: ${t.message}`)})}function qy(){const e=ie();return W({mutationFn:()=>Ve.abortRebase(),onSuccess:()=>{Re.clearConflict(),e.invalidateQueries({queryKey:["git"]}),A.success("Rebase aborted")},onError:t=>A.error(`Abort rebase failed: ${t.message}`)})}const Hy="assuremind-theme";function Uw(){const e=localStorage.getItem(Hy);return e==="dark"||e==="light"?e:"light"}let ca=Uw();const fx=new Set;function Ky(e){const t=document.documentElement;e==="dark"?t.classList.add("dark"):t.classList.remove("dark")}Ky(ca);function Bw(){for(const e of fx)e()}const zd={subscribe(e){return fx.add(e),()=>{fx.delete(e)}},getSnapshot(){return ca},toggle(){ca=ca==="light"?"dark":"light",localStorage.setItem(Hy,ca),Ky(ca),Bw()}};function qw(){return{theme:m.useSyncExternalStore(zd.subscribe,zd.getSnapshot),toggle:zd.toggle}}const Wy=6048e5,Hw=864e5,so=43200,$p=1440,Up=Symbol.for("constructDateFrom");function rn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Up in e?e[Up](t):e instanceof Date?new e.constructor(t):new Date(t)}function rt(e,t){return rn(t||e,e)}let Kw={};function zl(){return Kw}function ml(e,t){var o,c,d,x;const n=zl(),r=(t==null?void 0:t.weekStartsOn)??((c=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((x=(d=n.locale)==null?void 0:d.options)==null?void 0:x.weekStartsOn)??0,a=rt(e,t==null?void 0:t.in),i=a.getDay(),l=(i<r?7:0)+i-r;return a.setDate(a.getDate()-l),a.setHours(0,0,0,0),a}function oc(e,t){return ml(e,{...t,weekStartsOn:1})}function Vy(e,t){const n=rt(e,t==null?void 0:t.in),r=n.getFullYear(),a=rn(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const i=oc(a),l=rn(n,0);l.setFullYear(r,0,4),l.setHours(0,0,0,0);const o=oc(l);return n.getTime()>=i.getTime()?r+1:n.getTime()>=o.getTime()?r:r-1}function cc(e){const t=rt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Kc(e,...t){const n=rn.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function Bp(e,t){const n=rt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function Ww(e,t,n){const[r,a]=Kc(n==null?void 0:n.in,e,t),i=Bp(r),l=Bp(a),o=+i-cc(i),c=+l-cc(l);return Math.round((o-c)/Hw)}function Vw(e,t){const n=Vy(e,t),r=rn(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),oc(r)}function Eo(e,t){const n=+rt(e)-+rt(t);return n<0?-1:n>0?1:n}function Gw(e){return rn(e,Date.now())}function Qw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Yw(e){return!(!Qw(e)&&typeof e!="number"||isNaN(+rt(e)))}function Jw(e,t,n){const[r,a]=Kc(n==null?void 0:n.in,e,t),i=r.getFullYear()-a.getFullYear(),l=r.getMonth()-a.getMonth();return i*12+l}function Xw(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function Zw(e,t){return+rt(e)-+rt(t)}function ek(e,t){const n=rt(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function tk(e,t){const n=rt(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function sk(e,t){const n=rt(e,t==null?void 0:t.in);return+ek(n,t)==+tk(n,t)}function nk(e,t,n){const[r,a,i]=Kc(n==null?void 0:n.in,e,e,t),l=Eo(a,i),o=Math.abs(Jw(a,i));if(o<1)return 0;a.getMonth()===1&&a.getDate()>27&&a.setDate(30),a.setMonth(a.getMonth()-l*o);let c=Eo(a,i)===-l;sk(r)&&o===1&&Eo(r,i)===1&&(c=!1);const d=l*(o-+c);return d===0?0:d}function rk(e,t,n){const r=Zw(e,t)/1e3;return Xw(n==null?void 0:n.roundingMethod)(r)}function ak(e,t){const n=rt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const ik={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"}},lk=(e,t,n)=>{let r;const a=ik[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Ad(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const ok={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ck={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dk={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},uk={date:Ad({formats:ok,defaultWidth:"full"}),time:Ad({formats:ck,defaultWidth:"full"}),dateTime:Ad({formats:dk,defaultWidth:"full"})},xk={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},mk=(e,t,n,r)=>xk[e];function fi(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):l;a=e.formattingValues[o]||e.formattingValues[l]}else{const l=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[o]||e.values[l]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const hk={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},pk={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},fk={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"]},gk={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"]},yk={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"}},bk={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"}},vk=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},jk={ordinalNumber:vk,era:fi({values:hk,defaultWidth:"wide"}),quarter:fi({values:pk,defaultWidth:"wide",argumentCallback:e=>e-1}),month:fi({values:fk,defaultWidth:"wide"}),day:fi({values:gk,defaultWidth:"wide"}),dayPeriod:fi({values:yk,defaultWidth:"wide",formattingValues:bk,defaultFormattingWidth:"wide"})};function gi(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const l=i[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(o)?wk(o,p=>p.test(l)):Nk(o,p=>p.test(l));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const x=t.slice(l.length);return{value:d,rest:x}}}function Nk(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function wk(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function kk(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],i=t.match(e.parsePattern);if(!i)return null;let l=e.valueCallback?e.valueCallback(i[0]):i[0];l=n.valueCallback?n.valueCallback(l):l;const o=t.slice(a.length);return{value:l,rest:o}}}const Sk=/^(\d+)(th|st|nd|rd)?/i,Ck=/\d+/i,Ek={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},Pk={any:[/^b/i,/^(a|c)/i]},Rk={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Mk={any:[/1/i,/2/i,/3/i,/4/i]},Tk={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},zk={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]},Ak={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},Ok={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]},Dk={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},Ik={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}},Fk={ordinalNumber:kk({matchPattern:Sk,parsePattern:Ck,valueCallback:e=>parseInt(e,10)}),era:gi({matchPatterns:Ek,defaultMatchWidth:"wide",parsePatterns:Pk,defaultParseWidth:"any"}),quarter:gi({matchPatterns:Rk,defaultMatchWidth:"wide",parsePatterns:Mk,defaultParseWidth:"any",valueCallback:e=>e+1}),month:gi({matchPatterns:Tk,defaultMatchWidth:"wide",parsePatterns:zk,defaultParseWidth:"any"}),day:gi({matchPatterns:Ak,defaultMatchWidth:"wide",parsePatterns:Ok,defaultParseWidth:"any"}),dayPeriod:gi({matchPatterns:Dk,defaultMatchWidth:"any",parsePatterns:Ik,defaultParseWidth:"any"})},Gy={code:"en-US",formatDistance:lk,formatLong:uk,formatRelative:mk,localize:jk,match:Fk,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Lk(e,t){const n=rt(e,t==null?void 0:t.in);return Ww(n,ak(n))+1}function _k(e,t){const n=rt(e,t==null?void 0:t.in),r=+oc(n)-+Vw(n);return Math.round(r/Wy)+1}function Qy(e,t){var x,p,y,b;const n=rt(e,t==null?void 0:t.in),r=n.getFullYear(),a=zl(),i=(t==null?void 0:t.firstWeekContainsDate)??((p=(x=t==null?void 0:t.locale)==null?void 0:x.options)==null?void 0:p.firstWeekContainsDate)??a.firstWeekContainsDate??((b=(y=a.locale)==null?void 0:y.options)==null?void 0:b.firstWeekContainsDate)??1,l=rn((t==null?void 0:t.in)||e,0);l.setFullYear(r+1,0,i),l.setHours(0,0,0,0);const o=ml(l,t),c=rn((t==null?void 0:t.in)||e,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const d=ml(c,t);return+n>=+o?r+1:+n>=+d?r:r-1}function $k(e,t){var o,c,d,x;const n=zl(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((x=(d=n.locale)==null?void 0:d.options)==null?void 0:x.firstWeekContainsDate)??1,a=Qy(e,t),i=rn((t==null?void 0:t.in)||e,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),ml(i,t)}function Uk(e,t){const n=rt(e,t==null?void 0:t.in),r=+ml(n,t)-+$k(n,t);return Math.round(r/Wy)+1}function Se(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const xn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Se(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Se(n+1,2)},d(e,t){return Se(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Se(e.getHours()%12||12,t.length)},H(e,t){return Se(e.getHours(),t.length)},m(e,t){return Se(e.getMinutes(),t.length)},s(e,t){return Se(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return Se(a,t.length)}},ra={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},qp={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return xn.y(e,t)},Y:function(e,t,n,r){const a=Qy(e,r),i=a>0?a:1-a;if(t==="YY"){const l=i%100;return Se(l,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):Se(i,t.length)},R:function(e,t){const n=Vy(e);return Se(n,t.length)},u:function(e,t){const n=e.getFullYear();return Se(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Se(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Se(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return xn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Se(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=Uk(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):Se(a,t.length)},I:function(e,t,n){const r=_k(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Se(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):xn.d(e,t)},D:function(e,t,n){const r=Lk(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Se(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Se(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Se(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return Se(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=ra.noon:r===0?a=ra.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=ra.evening:r>=12?a=ra.afternoon:r>=4?a=ra.morning:a=ra.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return xn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):xn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Se(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Se(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):xn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):xn.s(e,t)},S:function(e,t){return xn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Kp(r);case"XXXX":case"XX":return ur(r);case"XXXXX":case"XXX":default:return ur(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Kp(r);case"xxxx":case"xx":return ur(r);case"xxxxx":case"xxx":default:return ur(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Hp(r,":");case"OOOO":default:return"GMT"+ur(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Hp(r,":");case"zzzz":default:return"GMT"+ur(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Se(r,t.length)},T:function(e,t,n){return Se(+e,t.length)}};function Hp(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+t+Se(i,2)}function Kp(e,t){return e%60===0?(e>0?"-":"+")+Se(Math.abs(e)/60,2):ur(e,t)}function ur(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Se(Math.trunc(r/60),2),i=Se(r%60,2);return n+a+t+i}const Wp=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Yy=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Bk=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return Wp(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",Wp(r,t)).replace("{{time}}",Yy(a,t))},qk={p:Yy,P:Bk},Hk=/^D+$/,Kk=/^Y+$/,Wk=["D","DD","YY","YYYY"];function Vk(e){return Hk.test(e)}function Gk(e){return Kk.test(e)}function Qk(e,t,n){const r=Yk(e,t,n);if(console.warn(r),Wk.includes(e))throw new RangeError(r)}function Yk(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Jk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Xk=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Zk=/^'([^]*?)'?$/,e5=/''/g,t5=/[a-zA-Z]/;function s5(e,t,n){var x,p,y,b;const r=zl(),a=r.locale??Gy,i=r.firstWeekContainsDate??((p=(x=r.locale)==null?void 0:x.options)==null?void 0:p.firstWeekContainsDate)??1,l=r.weekStartsOn??((b=(y=r.locale)==null?void 0:y.options)==null?void 0:b.weekStartsOn)??0,o=rt(e,n==null?void 0:n.in);if(!Yw(o))throw new RangeError("Invalid time value");let c=t.match(Xk).map(f=>{const v=f[0];if(v==="p"||v==="P"){const w=qk[v];return w(f,a.formatLong)}return f}).join("").match(Jk).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const v=f[0];if(v==="'")return{isToken:!1,value:n5(f)};if(qp[v])return{isToken:!0,value:f};if(v.match(t5))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");return{isToken:!1,value:f}});a.localize.preprocessor&&(c=a.localize.preprocessor(o,c));const d={firstWeekContainsDate:i,weekStartsOn:l,locale:a};return c.map(f=>{if(!f.isToken)return f.value;const v=f.value;(Gk(v)||Vk(v))&&Qk(v,t,String(e));const w=qp[v[0]];return w(o,v,a.localize,d)}).join("")}function n5(e){const t=e.match(Zk);return t?t[1].replace(e5,"'"):e}function r5(e,t,n){const r=zl(),a=(n==null?void 0:n.locale)??r.locale??Gy,i=2520,l=Eo(e,t);if(isNaN(l))throw new RangeError("Invalid time value");const o=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:l}),[c,d]=Kc(n==null?void 0:n.in,...l>0?[t,e]:[e,t]),x=rk(d,c),p=(cc(d)-cc(c))/1e3,y=Math.round((x-p)/60);let b;if(y<2)return n!=null&&n.includeSeconds?x<5?a.formatDistance("lessThanXSeconds",5,o):x<10?a.formatDistance("lessThanXSeconds",10,o):x<20?a.formatDistance("lessThanXSeconds",20,o):x<40?a.formatDistance("halfAMinute",0,o):x<60?a.formatDistance("lessThanXMinutes",1,o):a.formatDistance("xMinutes",1,o):y===0?a.formatDistance("lessThanXMinutes",1,o):a.formatDistance("xMinutes",y,o);if(y<45)return a.formatDistance("xMinutes",y,o);if(y<90)return a.formatDistance("aboutXHours",1,o);if(y<$p){const f=Math.round(y/60);return a.formatDistance("aboutXHours",f,o)}else{if(y<i)return a.formatDistance("xDays",1,o);if(y<so){const f=Math.round(y/$p);return a.formatDistance("xDays",f,o)}else if(y<so*2)return b=Math.round(y/so),a.formatDistance("aboutXMonths",b,o)}if(b=nk(d,c),b<12){const f=Math.round(y/so);return a.formatDistance("xMonths",f,o)}else{const f=b%12,v=Math.trunc(b/12);return f<3?a.formatDistance("aboutXYears",v,o):f<9?a.formatDistance("overXYears",v,o):a.formatDistance("almostXYears",v+1,o)}}function dc(e,t){return r5(e,Gw(e),t)}let or=[];const gx=new Set;function Od(){gx.forEach(e=>e())}const Ar={subscribe(e){return gx.add(e),()=>{gx.delete(e)}},getSnapshot(){return{notifications:or,unreadCount:or.filter(e=>!e.read).length}},push(e){or=[e,...or].slice(0,20),Od()},markAllRead(){or=or.map(e=>({...e,read:!0})),Od()},clear(){or=[],Od()}};function a5(){const[e,t]=m.useState(()=>Ar.getSnapshot());return m.useEffect(()=>Ar.subscribe(()=>t(Ar.getSnapshot())),[]),e}function i5({type:e}){switch(e){case"run-complete":return s.jsx(we,{size:13,className:"text-emerald-500 flex-shrink-0"});case"run-error":return s.jsx(st,{size:13,className:"text-red-500 flex-shrink-0"});case"healing":return s.jsx(qe,{size:13,className:"text-amber-500 flex-shrink-0"});case"git":return s.jsx(Kn,{size:13,className:"text-blue-500 flex-shrink-0"});default:return s.jsx(nc,{size:13,className:"text-content-tertiary flex-shrink-0"})}}function l5(){const[e,t]=m.useState(!1),{notifications:n,unreadCount:r}=a5(),a=m.useRef(null),i=Ms();return m.useEffect(()=>{if(!e)return;function l(o){a.current&&!a.current.contains(o.target)&&t(!1)}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[e]),s.jsxs("div",{className:"relative",ref:a,children:[s.jsxs("button",{type:"button",onClick:()=>t(l=>!l),className:E("relative p-2 rounded-lg transition-all duration-200",e?"bg-accent-muted text-accent":"text-content-tertiary hover:bg-surface-inset hover:text-content-secondary"),"aria-label":"Notifications",title:"Notifications",children:[s.jsx(nc,{size:16}),r>0&&s.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:r>9?"9+":r})]}),e&&s.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:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border bg-surface-inset/50",children:[s.jsx("span",{className:"text-xs font-semibold text-content",children:"Notifications"}),s.jsxs("div",{className:"flex items-center gap-1",children:[r>0&&s.jsx("button",{type:"button",onClick:()=>Ar.markAllRead(),className:"p-1 rounded text-content-tertiary hover:text-content hover:bg-surface-inset transition-colors",title:"Mark all read",children:s.jsx(my,{size:12})}),s.jsx("button",{type:"button",onClick:()=>Ar.clear(),className:"p-1 rounded text-content-tertiary hover:text-red-500 hover:bg-red-50 transition-colors",title:"Clear all",children:s.jsx(It,{size:12})})]})]}),s.jsx("div",{className:"max-h-80 overflow-y-auto divide-y divide-border/50",children:n.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-2",children:[s.jsx(nc,{size:20,className:"text-content-tertiary/40"}),s.jsx("p",{className:"text-xs text-content-tertiary",children:"No notifications"})]}):n.map(l=>s.jsxs("div",{className:E("flex items-start gap-2.5 px-3 py-2.5 transition-colors",!l.read&&"bg-accent-muted/20",l.link&&"cursor-pointer hover:bg-surface-inset/50"),onClick:()=>{l.link&&(t(!1),i(l.link))},children:[s.jsx("div",{className:"mt-0.5",children:s.jsx(i5,{type:l.type})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:E("text-xs leading-relaxed",l.read?"text-content-secondary":"text-content font-medium"),children:l.message}),s.jsx("p",{className:"text-[9px] text-content-tertiary mt-0.5",children:dc(new Date(l.timestamp),{addSuffix:!0})})]}),l.link&&s.jsx(ni,{size:10,className:"text-content-tertiary/60 flex-shrink-0 mt-0.5"}),!l.read&&s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-accent flex-shrink-0 mt-1.5"})]},l.id))})]})]})}function o5(){const e=ie(),t=Ms(),[n,r]=m.useState(!1),a=m.useRef(null),{data:i}=me({queryKey:["config"],queryFn:()=>Br.get(),staleTime:3e4}),l=W({mutationFn:d=>{var p;const x=(p=i==null?void 0:i.profiles)==null?void 0:p.find(y=>y.name===d);if(!x)throw new Error("Profile not found");return Br.update({activeProfile:x.name,environment:x.environment,baseUrl:x.baseUrl,browsers:x.browsers,...x.headless!==void 0?{headless:x.headless}:{}})},onSuccess:()=>{e.invalidateQueries({queryKey:["config"]}),r(!1)}});m.useEffect(()=>{const d=x=>{a.current&&!a.current.contains(x.target)&&r(!1)};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[]);const o=(i==null?void 0:i.profiles)??[];if(o.length===0)return null;const c=(i==null?void 0:i.activeProfile)??(i==null?void 0:i.environment)??"env";return s.jsxs("div",{ref:a,className:"relative",children:[s.jsxs("button",{type:"button",onClick:()=>r(d=>!d),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:[s.jsx(nn,{size:12,className:"text-accent flex-shrink-0"}),s.jsx("span",{className:"hidden sm:inline max-w-[100px] truncate",children:c}),s.jsx(ht,{size:11,className:"text-content-tertiary"})]}),n&&s.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:[s.jsx("div",{className:"px-3 py-2 border-b border-border",children:s.jsx("p",{className:"text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Environment Profiles"})}),s.jsx("div",{className:"py-1",children:o.map(d=>s.jsxs("button",{type:"button",onClick:()=>l.mutate(d.name),className:E("w-full text-left px-3 py-2 text-xs hover:bg-surface-inset transition-colors flex items-center justify-between gap-2",(i==null?void 0:i.activeProfile)===d.name&&"text-accent font-semibold"),children:[s.jsx("span",{className:"truncate",children:d.name}),s.jsx("span",{className:"text-[9px] text-content-tertiary flex-shrink-0",children:d.environment})]},d.name))}),s.jsx("div",{className:"border-t border-border px-3 py-2",children:s.jsxs("button",{type:"button",onClick:()=>{r(!1),t("/settings#profiles")},className:"flex items-center gap-1 text-[10px] text-content-tertiary hover:text-accent transition-colors",children:[s.jsx(Qa,{size:10})," Manage profiles"]})})]})]})}const c5={anthropic:"Anthropic",bedrock:"Bedrock",openai:"OpenAI",google:"Google","azure-openai":"Azure OpenAI",ollama:"Ollama",unknown:"AI"};function d5({title:e,onMenuClick:t}){const{data:n}=me({queryKey:["ai-provider"],queryFn:()=>Br.getAiProvider(),staleTime:6e4,retry:!1}),{panelOpen:r}=Hc(),{data:a}=_m(),{theme:i,toggle:l}=qw(),o=c5[(n==null?void 0:n.provider)??""]??(n==null?void 0:n.provider)??"...",c=(n==null?void 0:n.model)??"...",d=((a==null?void 0:a.modified.length)??0)+((a==null?void 0:a.added.length)??0)+((a==null?void 0:a.deleted.length)??0)+((a==null?void 0:a.untracked.length)??0);return s.jsxs("header",{className:"h-14 bg-surface border-b border-border flex items-center px-5 gap-3 flex-shrink-0",children:[s.jsx("button",{type:"button",onClick:t,className:"p-1.5 rounded-lg hover:bg-surface-inset text-content-tertiary lg:hidden transition-colors","aria-label":"Toggle sidebar",children:s.jsx(lw,{size:18})}),s.jsx("h1",{className:"text-sm font-semibold text-content tracking-tight flex-1",children:e}),n&&s.jsxs("div",{className:"hidden sm:flex items-center gap-1.5 text-xs bg-surface-inset border border-border rounded-lg px-3 py-1.5",children:[s.jsx(L2,{size:13,className:"text-accent flex-shrink-0"}),s.jsx("span",{className:"font-medium text-content-secondary",children:o}),s.jsx("span",{className:"text-content-tertiary/50",children:"/"}),s.jsx("span",{className:"text-content-tertiary truncate max-w-[140px]",children:c})]}),s.jsx(o5,{}),s.jsx(l5,{}),s.jsx("button",{type:"button",onClick:l,className:E("p-2 rounded-lg transition-all duration-200",i==="dark"?"bg-surface-inset text-amber-400 hover:bg-surface-overlay":"text-content-tertiary hover:bg-surface-inset hover:text-content-secondary"),"aria-label":i==="dark"?"Switch to light mode":"Switch to dark mode",title:i==="dark"?"Light mode":"Dark mode",children:i==="dark"?s.jsx(jw,{size:16}):s.jsx(cw,{size:16})}),s.jsxs("button",{type:"button",onClick:()=>Re.togglePanel(),className:E("relative flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-all duration-200",r?"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:[s.jsx(Kn,{size:14}),s.jsx("span",{className:"hidden sm:inline",children:"Git"}),d>0&&s.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:d>9?"9+":d})]})]})}function se({variant:e="primary",size:t="md",loading:n=!1,children:r,className:a,disabled:i,...l}){return s.jsxs("button",{...l,disabled:i||n,className:E("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":e==="primary","bg-surface border border-border text-content-secondary hover:bg-surface-inset hover:text-content hover:border-border-strong focus-visible:ring-accent":e==="secondary","text-content-secondary hover:bg-surface-inset hover:text-content focus-visible:ring-accent/40":e==="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":e==="danger","px-2.5 py-1.5 text-xs gap-1.5":t==="sm","px-4 py-2 text-sm":t==="md","px-5 py-2.5 text-sm":t==="lg","opacity-40 cursor-not-allowed pointer-events-none":i||n},a),children:[n&&s.jsxs("svg",{className:"animate-spin h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-20",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),s.jsx("path",{className:"opacity-80",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),r]})}function Jr(e){const t=m.useRef(null),n=m.useRef(e);n.current=e;const r=m.useCallback(()=>{var i;if(((i=t.current)==null?void 0:i.readyState)===WebSocket.OPEN)return;const a=new WebSocket(zw);t.current=a,a.onmessage=l=>{try{const o=JSON.parse(l.data),c=n.current[o.event];c&&c(o.data)}catch{}},a.onclose=()=>{setTimeout(r,3e3)},a.onerror=()=>{a.close()}},[]);m.useEffect(()=>(r(),()=>{var a;(a=t.current)==null||a.close()}),[r])}let uc={isRunning:!1,runId:null,currentBrowser:null,currentCase:null,currentStep:null,completed:null,error:null,activeCases:new Map};const yx=new Set;function Jy(){yx.forEach(e=>e())}function aa(e){uc=e(uc),Jy()}const Dd={subscribe(e){return yx.add(e),()=>{yx.delete(e)}},getSnapshot(){return uc},reset(){uc={isRunning:!1,runId:null,currentBrowser:null,currentCase:null,currentStep:null,completed:null,error:null,activeCases:new Map},Jy()}};function $m(){const e=m.useSyncExternalStore(Dd.subscribe,Dd.getSnapshot),t=m.useCallback(c=>{const d=c;aa(()=>({isRunning:!0,runId:d.runId,currentBrowser:null,currentCase:null,currentStep:null,completed:null,error:null,activeCases:new Map}))},[]),n=m.useCallback(c=>{const d=c;aa(x=>{const p=new Map(x.activeCases);return p.set(d.caseId,d.caseName),{...x,isRunning:!0,currentBrowser:d.browser??x.currentBrowser,currentCase:d,currentStep:null,activeCases:p}})},[]),r=m.useCallback(c=>{aa(d=>({...d,isRunning:!0,currentStep:c}))},[]),a=m.useCallback(c=>{aa(d=>({...d,isRunning:!1,completed:c,currentCase:null,currentStep:null}))},[]),i=m.useCallback(c=>{const d=c;aa(x=>({...x,isRunning:!1,error:d.error}))},[]),l=m.useCallback(()=>{aa(c=>({...c,isRunning:!1,completed:c.completed??{runId:c.runId??"",passed:0,failed:0,skipped:0,duration:0},currentCase:null,currentStep:null}))},[]);Jr({"run:start":t,"run:case":n,"run:step":r,"run:complete":a,"run:error":i,"run:stopped":l});const o=m.useCallback(()=>{Dd.reset()},[]);return{...e,reset:o}}function Id(e,t){Jr({[e]:t})}function Vp({data:e,maxHeight:t=32}){const n=Math.max(...e.map(r=>r.value),1);return s.jsx("div",{className:"flex items-end gap-[3px]",style:{height:t},children:e.map((r,a)=>s.jsx("div",{className:E("w-[6px] rounded-full transition-all duration-500",r.color),style:{height:`${Math.max(r.value/n*100,6)}%`}},a))})}function u5({rate:e,hasData:t=!1,size:n=80}){const a=(n-6)/2,i=2*Math.PI*a,l=i-e/100*i,o=t?"#ef4444":"var(--color-border)";return s.jsxs("div",{className:"relative",style:{width:n,height:n},children:[s.jsxs("svg",{width:n,height:n,className:"-rotate-90",children:[s.jsx("circle",{cx:n/2,cy:n/2,r:a,fill:"none",stroke:o,strokeWidth:6}),s.jsx("circle",{cx:n/2,cy:n/2,r:a,fill:"none",stroke:"#10b981",strokeWidth:6,strokeLinecap:"round",strokeDasharray:i,strokeDashoffset:l,className:"transition-all duration-1000 ease-out"})]}),s.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:s.jsxs("span",{className:"text-lg font-bold text-content tabular-nums",children:[e,"%"]})})]})}function x5({status:e}){const t={passed:"bg-emerald-500",failed:"bg-red-500",partial:"bg-amber-500",running:"bg-blue-500 animate-pulse",skipped:"bg-slate-400"};return s.jsx("span",{className:E("w-2 h-2 rounded-full flex-shrink-0",t[e]??"bg-slate-400")})}function m5(e,t){return e.filter(n=>{var r;return(r=n.suiteIds)==null?void 0:r.includes(t)}).slice(-7).map(n=>({value:n.totalTests>0?Math.round(n.passed/n.totalTests*100):0,color:n.failed>0?"bg-red-400":"bg-emerald-400"}))}function h5(){const e=Ms(),{data:t=[],isLoading:n}=me({queryKey:["reports"],queryFn:()=>lc.list(20)}),{data:r=[],isLoading:a}=me({queryKey:["suites"],queryFn:()=>Vr.list()}),{data:i}=me({queryKey:["healing-stats"],queryFn:()=>Ws.stats(),staleTime:3e4,retry:!1}),l=$m(),o=n||a,c=t[0],d=r.reduce((k,N)=>k+(N.caseCount??0),0),x=r.filter(k=>(k.type??"ui")==="ui"),p=r.filter(k=>(k.type??"ui")==="api"),y=x.reduce((k,N)=>k+(N.caseCount??0),0),b=p.reduce((k,N)=>k+(N.caseCount??0),0),f=t.reduce((k,N)=>k+N.passed,0),v=t.reduce((k,N)=>k+N.failed,0),w=t.reduce((k,N)=>k+N.skipped,0),h=f+v>0?Math.round(f/(f+v)*100):0,u=f+v+w,g=t.filter(k=>k.duration).length>0?Math.round(t.filter(k=>k.duration).reduce((k,N)=>k+(N.duration??0),0)/t.filter(k=>k.duration).length/1e3):0,j=[...t].reverse().map(k=>({value:k.passed+k.failed+k.skipped,color:k.status==="passed"?"bg-emerald-400":k.status==="failed"?"bg-red-400":"bg-amber-400"}));return o?s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[s.jsxs("div",{className:"flex-shrink-0 px-8 pt-6 pb-4",children:[s.jsx("div",{className:"h-7 w-48 rounded-lg skeleton-shimmer"}),s.jsx("div",{className:"h-4 w-72 rounded-lg skeleton-shimmer mt-2"})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto px-8 pb-8",children:[s.jsx("div",{className:"grid grid-cols-4 gap-4 mb-6",children:[1,2,3,4].map(k=>s.jsx("div",{className:"h-28 rounded-2xl skeleton-shimmer"},k))}),s.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(k=>s.jsx("div",{className:"h-64 rounded-2xl skeleton-shimmer"},k))})]})]}):s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[s.jsxs("div",{className:"flex-shrink-0 px-8 pt-6 pb-4 flex items-end justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold text-content tracking-tight",children:"Dashboard"}),s.jsx("p",{className:"text-sm text-content-tertiary mt-0.5",children:"Test automation health at a glance"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(se,{size:"sm",variant:"secondary",onClick:()=>e("/run"),children:[s.jsx(Dt,{size:13})," Run Tests"]}),s.jsxs(se,{size:"sm",onClick:()=>e("/story"),children:[s.jsx(wt,{size:13})," Generate"]})]})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto px-8 pb-8 space-y-5",children:[l.isRunning&&s.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:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"relative w-8 h-8 flex-shrink-0",children:[s.jsx("div",{className:"absolute inset-0 rounded-full border-2 border-accent/20"}),s.jsx("div",{className:"absolute inset-0 rounded-full border-2 border-transparent border-t-accent animate-spin"})]}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"text-sm font-semibold text-content",children:"Run in progress..."}),l.currentCase&&s.jsxs("p",{className:"text-xs text-content-secondary truncate mt-0.5",children:[l.currentCase.caseName,l.currentStep&&` › ${l.currentStep.instruction}`]})]}),s.jsxs(se,{size:"sm",variant:"ghost",onClick:()=>e("/run"),children:["View ",s.jsx(yr,{size:12})]})]})}),l.completed&&!l.isRunning&&(()=>{const k=l.completed,N=k.failed===0&&k.passed>0,S=k.failed>0,P=N?{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"}:S?{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"},$=N?we:S?st:ts;return s.jsx("div",{className:E("rounded-2xl border p-4 animate-fade-in",P.border,P.bg),children:s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx($,{size:20,className:E(P.icon,"flex-shrink-0")}),s.jsxs("div",{children:[s.jsx("p",{className:E("text-sm font-semibold",P.title),children:P.label}),s.jsxs("p",{className:E("text-xs mt-0.5",P.subtitle),children:[k.passed," passed / ",k.failed," failed / ",k.skipped," skipped"]})]})]}),s.jsx(se,{variant:"secondary",size:"sm",onClick:()=>e("/reports"),children:"View Report"})]})})})(),s.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[s.jsxs("div",{className:"rounded-2xl border border-border bg-surface p-5 flex flex-col justify-between",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-indigo-50 border border-indigo-100 flex items-center justify-center",children:s.jsx(Wr,{size:18,className:"text-indigo-500"})}),s.jsx("span",{className:"text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Coverage"})]}),s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"text-3xl font-extrabold text-content tabular-nums tracking-tight",children:r.length}),s.jsx("p",{className:"text-xs text-content-tertiary mt-0.5",children:"test suites"})]}),s.jsxs("div",{className:"mt-3 pt-3 border-t border-border-muted flex items-center gap-4",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(br,{size:11,className:"text-blue-500"}),s.jsxs("span",{className:"text-[11px] text-content-secondary font-medium",children:[x.length," UI"]}),s.jsxs("span",{className:"text-[10px] text-content-tertiary",children:["(",y,")"]})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(mw,{size:11,className:"text-purple-500"}),s.jsxs("span",{className:"text-[11px] text-content-secondary font-medium",children:[p.length," API"]}),s.jsxs("span",{className:"text-[10px] text-content-tertiary",children:["(",b,")"]})]})]})]}),s.jsxs("div",{className:"rounded-2xl border border-border bg-surface p-5 flex flex-col items-center justify-center",children:[s.jsx("span",{className:"text-[10px] font-semibold text-content-tertiary uppercase tracking-wider mb-3",children:"Pass Rate"}),s.jsx(u5,{rate:t.length>0?h:0,hasData:f+v>0}),s.jsx("p",{className:"text-[11px] text-content-tertiary mt-2",children:f+v>0?`${f} of ${f+v} cases passed`:"no runs yet"})]}),s.jsxs("div",{className:"rounded-2xl border border-border bg-surface p-5 flex flex-col justify-between",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-teal-50 border border-teal-100 flex items-center justify-center",children:s.jsx(O2,{size:18,className:"text-teal-500"})}),s.jsx("span",{className:"text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Execution"})]}),s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"text-3xl font-extrabold text-content tabular-nums tracking-tight",children:u}),s.jsx("p",{className:"text-xs text-content-tertiary mt-0.5",children:"tests executed"})]}),s.jsxs("div",{className:"mt-3 pt-3 border-t border-border-muted grid grid-cols-3 gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(we,{size:10,className:"text-emerald-500"}),s.jsx("span",{className:"text-[11px] font-semibold text-emerald-600 tabular-nums",children:f})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(st,{size:10,className:"text-red-500"}),s.jsx("span",{className:"text-[11px] font-semibold text-red-500 tabular-nums",children:v})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(_c,{size:10,className:"text-content-tertiary"}),s.jsx("span",{className:"text-[11px] font-semibold text-content-tertiary tabular-nums",children:w})]})]})]}),s.jsxs("div",{className:"rounded-2xl border border-border bg-surface p-5 flex flex-col justify-between",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-amber-50 border border-amber-100 flex items-center justify-center",children:s.jsx(qe,{size:18,className:"text-amber-500"})}),s.jsx("span",{className:"text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Insights"})]}),s.jsxs("div",{className:"mt-4 space-y-2.5",children:[s.jsx("div",{children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-[11px] text-content-tertiary",children:"Avg Duration"}),s.jsx("span",{className:"text-sm font-bold text-content tabular-nums",children:g>0?`${g}s`:"—"})]})}),s.jsx("div",{children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-[11px] text-content-tertiary",children:"Self-Healed"}),s.jsx("span",{className:"text-sm font-bold text-emerald-600 tabular-nums",children:(i==null?void 0:i.accepted)??0})]})}),s.jsx("div",{children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-[11px] text-content-tertiary",children:"Pending Review"}),s.jsx("span",{className:E("text-sm font-bold tabular-nums",((i==null?void 0:i.pending)??0)>0?"text-amber-500":"text-content-tertiary"),children:(i==null?void 0:i.pending)??0})]})})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[s.jsxs("div",{className:"lg:col-span-2 rounded-2xl border border-border bg-surface overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-border",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("div",{className:"w-7 h-7 rounded-lg bg-accent-muted flex items-center justify-center",children:s.jsx(kw,{size:14,className:"text-accent"})}),s.jsx("h2",{className:"text-sm font-semibold text-content",children:"Recent Runs"})]}),t.length>0&&s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Vp,{data:j,maxHeight:24}),s.jsxs("button",{onClick:()=>e("/reports"),className:"text-xs text-accent font-medium hover:underline flex items-center gap-0.5",children:["View all ",s.jsx(yr,{size:11})]})]})]}),t.length===0?s.jsxs("div",{className:"px-5 py-12 text-center",children:[s.jsx("div",{className:"w-12 h-12 rounded-2xl bg-surface-inset flex items-center justify-center mx-auto mb-3",children:s.jsx(ps,{size:20,className:"text-content-tertiary"})}),s.jsx("p",{className:"text-sm font-medium text-content-secondary",children:"No runs yet"}),s.jsx("p",{className:"text-xs text-content-tertiary mt-1 mb-4",children:"Execute your first test run to see results here"}),s.jsxs(se,{size:"sm",onClick:()=>e("/run"),children:[s.jsx(Dt,{size:12})," Start a Run"]})]}):s.jsxs("div",{className:"divide-y divide-border-muted",children:[s.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:[s.jsx("span",{children:"Run ID"}),s.jsx("span",{children:"Status"}),s.jsx("span",{children:"Results"}),s.jsx("span",{children:"Duration"}),s.jsx("span",{className:"text-right",children:"Time"})]}),t.slice(0,6).map(k=>{const N=k.passed+k.failed+k.skipped,S=N>0?Math.round(k.passed/N*100):0;return s.jsxs("div",{onClick:()=>e("/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:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(x5,{status:k.status}),s.jsx("span",{className:"text-xs font-mono text-content-secondary truncate",children:k.runId.slice(0,10)})]}),s.jsx("div",{children:s.jsx("span",{className:E("text-[10px] font-semibold px-2 py-0.5 rounded-md uppercase tracking-wide",k.status==="passed"?"bg-emerald-50 text-emerald-700":k.status==="failed"?"bg-red-50 text-red-700":"bg-amber-50 text-amber-700"),children:k.status})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex-1 h-1.5 bg-surface-inset rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full bg-emerald-400 rounded-full transition-all duration-500",style:{width:`${S}%`}})}),s.jsxs("span",{className:"text-[11px] text-content-secondary tabular-nums w-12 text-right",children:[k.passed,"/",N]})]}),s.jsx("span",{className:"text-[11px] text-content-tertiary tabular-nums",children:k.duration?`${(k.duration/1e3).toFixed(1)}s`:"—"}),s.jsx("span",{className:"text-[10px] text-content-tertiary text-right",children:dc(new Date(k.startedAt),{addSuffix:!1})})]},k.runId)})]})]}),s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"rounded-2xl border border-border bg-surface overflow-hidden flex-1",children:[s.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-border",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("div",{className:"w-7 h-7 rounded-lg bg-indigo-50 border border-indigo-100 flex items-center justify-center",children:s.jsx(xl,{size:14,className:"text-indigo-500"})}),s.jsx("h2",{className:"text-sm font-semibold text-content",children:"Test Suites"})]}),s.jsxs("span",{className:"text-[10px] font-semibold text-content-tertiary bg-surface-inset px-2 py-0.5 rounded-md",children:[d," cases"]})]}),r.length===0?s.jsxs("div",{className:"px-5 py-8 text-center",children:[s.jsx("p",{className:"text-sm text-content-tertiary mb-3",children:"No suites yet"}),s.jsx(se,{size:"sm",onClick:()=>e("/tests"),children:"Create Suite"})]}):s.jsx("ul",{className:"divide-y divide-border-muted max-h-[200px] overflow-y-auto",children:r.map(k=>s.jsxs("li",{onClick:()=>e("/tests"),className:"flex items-center justify-between px-5 py-2.5 hover:bg-surface-inset cursor-pointer transition-colors group",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("p",{className:"text-sm text-content font-medium truncate",children:k.name}),s.jsx("span",{className:E("text-[9px] px-1.5 py-0.5 rounded font-bold uppercase flex-shrink-0",(k.type??"ui")==="api"?"bg-purple-50 text-purple-600":"bg-blue-50 text-blue-600"),children:(k.type??"ui").toUpperCase()})]}),s.jsxs("p",{className:"text-[11px] text-content-tertiary mt-0.5",children:[k.caseCount??0," cases"]})]}),s.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[s.jsx(Vp,{data:m5(t,k.id),maxHeight:24}),s.jsx(yr,{size:13,className:"text-content-tertiary opacity-0 group-hover:opacity-100 transition-opacity"})]})]},k.id))})]}),s.jsx("div",{className:"grid grid-cols-2 gap-2.5",children:[{label:"Smart Tests",icon:wt,to:"/story",gradient:"from-violet-500 to-indigo-600"},{label:"Self-Healing",icon:rc,to:"/healing",gradient:"from-rose-500 to-pink-600"},{label:"Variables",icon:Fm,to:"/variables",gradient:"from-teal-500 to-cyan-600"},{label:"Reports",icon:ps,to:"/reports",gradient:"from-amber-500 to-orange-600"}].map(({label:k,icon:N,to:S,gradient:P})=>s.jsxs("button",{type:"button",onClick:()=>e(S),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:[s.jsx("div",{className:E("w-8 h-8 rounded-lg bg-gradient-to-br flex items-center justify-center flex-shrink-0",P),children:s.jsx(N,{size:14,className:"text-white"})}),s.jsx("p",{className:"text-xs font-semibold text-content group-hover:text-accent transition-colors",children:k})]},S))})]})]}),c&&s.jsx("div",{className:"rounded-2xl border border-border bg-surface px-6 py-4",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:E("w-10 h-10 rounded-xl flex items-center justify-center",c.status==="passed"?"bg-emerald-50 border border-emerald-100":c.status==="failed"?"bg-red-50 border border-red-100":"bg-amber-50 border border-amber-100"),children:c.status==="passed"?s.jsx(we,{size:18,className:"text-emerald-500"}):c.status==="failed"?s.jsx(ts,{size:18,className:"text-red-500"}):s.jsx(Ip,{size:18,className:"text-amber-500"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-semibold text-content-secondary uppercase tracking-wider",children:"Last Run"}),s.jsxs("p",{className:"text-sm font-bold text-content mt-0.5",children:[c.passed," passed, ",c.failed," failed",c.skipped>0&&`, ${c.skipped} skipped`]})]})]}),s.jsxs("div",{className:"flex items-center gap-6 text-xs text-content-tertiary",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(Kr,{size:12}),s.jsx("span",{children:dc(new Date(c.startedAt),{addSuffix:!0})})]}),c.duration&&s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(Ip,{size:12}),s.jsxs("span",{children:[(c.duration/1e3).toFixed(1),"s"]})]}),s.jsx("div",{className:"flex items-center gap-1.5 font-mono",children:s.jsxs("span",{children:["#",c.runId.slice(0,8)]})}),s.jsxs(se,{size:"sm",variant:"ghost",onClick:()=>e("/reports"),children:["Details ",s.jsx(yr,{size:11})]})]})]})})]})]})}function Ts({open:e,title:t="Confirm Delete",message:n,confirmLabel:r="Delete",onConfirm:a,onCancel:i}){return m.useEffect(()=>{if(!e)return;const l=o=>{o.key==="Escape"&&i(),o.key==="Enter"&&(o.preventDefault(),a())};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e,i]),e?s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center animate-fade-in",children:[s.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:i}),s.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:[s.jsxs("div",{className:"flex items-start gap-3.5",children:[s.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:s.jsx(ts,{size:18,className:"text-red-500"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-sm font-semibold text-content",children:t}),s.jsx("p",{className:"mt-1 text-sm text-content-secondary leading-relaxed",children:n})]})]}),s.jsxs("div",{className:"mt-6 flex items-center justify-end gap-2.5",children:[s.jsx(se,{variant:"secondary",size:"sm",onClick:i,children:"Cancel"}),s.jsx(se,{variant:"danger",size:"sm",onClick:a,children:r})]})]})]}):null}function zs(){const[e,t]=m.useState({open:!1,message:"",onConfirm:()=>{}}),n=m.useCallback((i,l)=>{t({open:!0,message:i,onConfirm:l})},[]),r=m.useCallback(()=>{t(i=>({...i,open:!1}))},[]),a=m.useCallback(()=>{e.onConfirm(),t(i=>({...i,open:!1}))},[e.onConfirm]);return{modalProps:{open:e.open,message:e.message,onConfirm:a,onCancel:r},confirmDelete:n}}const p5=[{id:"all",label:"All"},{id:"auth",label:"Auth"},{id:"crud",label:"CRUD"},{id:"navigation",label:"Navigation"},{id:"form",label:"Form"},{id:"api",label:"API"}],f5={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 g5({open:e,onClose:t,suiteId:n,onCreated:r}){const[a,i]=m.useState("all"),[l,o]=m.useState(null),{data:c=[],isLoading:d}=me({queryKey:["templates"],queryFn:()=>Fw.list(),enabled:e}),x=W({mutationFn:b=>Vn.create(n,{name:b.name,description:b.description,steps:b.steps.map((f,v)=>({...f,id:crypto.randomUUID(),order:v+1}))}),onSuccess:()=>{A.success("Test case created from template"),r(),t()},onError:b=>{A.error(b.message),o(null)}}),p=b=>{o(b.id),x.mutate(b)},y=a==="all"?c:c.filter(b=>b.category===a);return e?s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:t,children:s.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:b=>b.stopPropagation(),children:[s.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border flex-shrink-0",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-sm font-bold text-content",children:"Test Case Templates"}),s.jsx("p",{className:"text-[11px] text-content-tertiary mt-0.5",children:"Start from a pre-built template"})]}),s.jsx("button",{type:"button",onClick:t,className:"p-1.5 rounded-lg text-content-tertiary hover:bg-surface-inset hover:text-content transition-colors",children:s.jsx(ye,{size:14})})]}),s.jsx("div",{className:"flex gap-1 px-5 py-2.5 border-b border-border flex-shrink-0 overflow-x-auto",children:p5.map(b=>s.jsx("button",{type:"button",onClick:()=>i(b.id),className:E("px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors flex-shrink-0",a===b.id?"bg-accent text-white":"text-content-secondary hover:bg-surface-inset"),children:b.label},b.id))}),s.jsx("div",{className:"flex-1 overflow-y-auto p-5 min-h-0",children:d?s.jsx("div",{className:"grid grid-cols-2 gap-3",children:[1,2,3,4].map(b=>s.jsx("div",{className:"h-28 rounded-xl skeleton-shimmer"},b))}):y.length===0?s.jsx("div",{className:"py-12 text-center",children:s.jsx("p",{className:"text-sm text-content-tertiary",children:"No templates in this category"})}):s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:y.map(b=>s.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:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("div",{className:"w-7 h-7 rounded-lg bg-surface-inset flex items-center justify-center flex-shrink-0",children:s.jsx(Ps,{size:13,className:"text-content-secondary"})}),s.jsx("div",{className:"min-w-0",children:s.jsx("p",{className:"text-sm font-bold text-content truncate",children:b.name})})]}),s.jsx("span",{className:E("text-[9px] px-1.5 py-0.5 rounded font-bold uppercase flex-shrink-0",f5[b.category]??"bg-surface-inset text-content-tertiary"),children:b.category})]}),s.jsx("p",{className:"text-xs text-content-secondary leading-relaxed",children:b.description}),s.jsxs("div",{className:"flex items-center justify-between mt-auto",children:[s.jsxs("span",{className:"text-[10px] text-content-tertiary",children:[b.steps.length," step",b.steps.length!==1?"s":""]}),s.jsx("button",{type:"button",onClick:()=>p(b),disabled:x.isPending,className:E("flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",l===b.id?"bg-emerald-50 text-emerald-600 border border-emerald-200":"bg-accent/10 text-accent hover:bg-accent/20",x.isPending&&"opacity-50 cursor-not-allowed"),children:l===b.id?s.jsxs(s.Fragment,{children:[s.jsx(we,{size:11})," Creating..."]}):"Use Template"})]})]},b.id))})})]})}):null}function Xy(){return me({queryKey:["suites"],queryFn:()=>Vr.list()})}function y5(){const e=ie();return W({mutationFn:Vr.create,onSuccess:()=>{e.invalidateQueries({queryKey:["suites"]}),A.success("Suite created")},onError:t=>A.error(t.message)})}function Zy(){const e=ie();return W({mutationFn:({id:t,data:n})=>Vr.update(t,n),onSuccess:()=>{e.invalidateQueries({queryKey:["suites"]}),A.success("Suite updated")},onError:t=>A.error(t.message)})}function b5(){const e=ie();return W({mutationFn:Vr.delete,onSuccess:()=>{e.invalidateQueries({queryKey:["suites"]}),A.success("Suite deleted")},onError:t=>A.error(t.message)})}function v5(e){return me({queryKey:["cases",e],queryFn:()=>Vn.list(e),enabled:!!e})}function j5(e,t){return me({queryKey:["cases",e,t],queryFn:()=>Vn.get(e,t),enabled:!!e&&!!t})}function Gp(e){const t=ie();return W({mutationFn:n=>Vn.create(e,n),onSuccess:()=>{t.invalidateQueries({queryKey:["cases",e]}),A.success("Test case created")},onError:n=>A.error(n.message)})}function N5(e){const t=ie();return W({mutationFn:({caseId:n,data:r})=>Vn.update(e,n,r),onSuccess:(n,{caseId:r})=>{t.invalidateQueries({queryKey:["cases",e]}),t.invalidateQueries({queryKey:["cases",e,r]}),A.success("Test case updated")},onError:n=>A.error(n.message)})}function w5(e){const t=ie();return W({mutationFn:n=>Vn.delete(e,n),onSuccess:()=>{t.invalidateQueries({queryKey:["cases",e]}),A.success("Test case deleted")},onError:n=>A.error(n.message)})}function k5(e,t){const n=ie();return W({mutationFn:r=>Gr.add(e,t,r),onSuccess:()=>{n.invalidateQueries({queryKey:["cases",e,t]})},onError:r=>A.error(r.message)})}function S5(e,t){const n=ie();return W({mutationFn:({stepId:r,instruction:a,timeout:i,stepType:l,retries:o,mockUrl:c,mockResponse:d,mockStatus:x,runAudit:p,soft:y,visualCheck:b})=>Gr.update(e,t,r,{instruction:a,timeout:i,stepType:l,retries:o,mockUrl:c,mockResponse:d,mockStatus:x,runAudit:p,soft:y,visualCheck:b}),onSuccess:()=>{n.invalidateQueries({queryKey:["cases",e,t]})},onError:r=>A.error(r.message)})}function C5(e,t){const n=ie();return W({mutationFn:r=>Gr.reorder(e,t,r),onSuccess:()=>{n.invalidateQueries({queryKey:["cases",e,t]})},onError:r=>A.error(r.message)})}function E5(e,t){const n=ie();return W({mutationFn:r=>Gr.delete(e,t,r),onSuccess:()=>{n.invalidateQueries({queryKey:["cases",e,t]})},onError:r=>A.error(r.message)})}function P5(e,t){const n=ie();return W({mutationFn:r=>Gr.generate(e,t,r),onSuccess:()=>{n.invalidateQueries({queryKey:["cases",e,t]}),A.success("Code generated")},onError:r=>A.error(r.message)})}function R5(e,t){const n=ie();return W({mutationFn:()=>Gr.generateAll(e,t),onSuccess:r=>{n.invalidateQueries({queryKey:["cases",e,t]}),A.success(`Generated code for ${r.generated} step(s)`)},onError:r=>A.error(r.message)})}const hl=new Map,bx=new Set;function eb(){for(const e of bx)e()}function Fd(){return"all"}function Ld(e){return`suite:${e}`}function _d(e,t){return`case:${e}:${t}`}function $d(e,t){hl.set(e,{op:t,startedAt:Date.now()}),eb()}function Ud(e){hl.delete(e),eb()}function Bd(e){var t;return((t=hl.get(e))==null?void 0:t.op)??null}function M5(){const e=new Map,t=new Map;let n=null;for(const[r,a]of hl)r==="all"?n=a.op:r.startsWith("suite:")?e.set(r.slice(6),a.op):r.startsWith("case:")&&t.set(r.slice(5),a.op);return{allOp:n,busySuites:e,busyCases:t,activeCount:hl.size}}function T5(e){return bx.add(e),()=>{bx.delete(e)}}const nt={startAll:e=>$d(Fd(),e),finishAll:()=>Ud(Fd()),startSuite:(e,t)=>$d(Ld(e),t),finishSuite:e=>Ud(Ld(e)),startCase:(e,t,n)=>$d(_d(e,t),n),finishCase:(e,t)=>Ud(_d(e,t)),isAllBusy:()=>Bd(Fd()),isSuiteBusy:e=>Bd(Ld(e)),isCaseBusy:(e,t)=>Bd(_d(e,t)),getSnapshot:M5,subscribe:T5};function Al(e,t){var n;if(e.failed>0){const r=e.results.filter(a=>a.action==="failed");A.error(`${t}: ${e.failed} failed — ${((n=r[0])==null?void 0:n.error)??"Unknown error"}`)}else if(e.created>0||e.synced>0){const r=[];e.created>0&&r.push(`${e.created} created`),e.synced>0&&r.push(`${e.synced} synced`),e.skipped>0&&r.push(`${e.skipped} skipped`),A.success(`Xray: ${r.join(", ")}`)}else e.skipped>0&&A.success(`Xray: ${e.skipped} already up to date`)}function z5(){return me({queryKey:["xray","status"],queryFn:()=>Yr.status(),retry:1,staleTime:1e4})}function tb(e){return me({queryKey:["xray","status",e],queryFn:()=>Yr.suiteStatus(e),enabled:!!e,retry:1,staleTime:1e4})}function A5(){const e=ie();return W({mutationFn:()=>(nt.startAll("create"),Yr.createAll()),onSuccess:t=>{nt.finishAll(),e.invalidateQueries({queryKey:["xray"]}),Al(t,"Create in Xray")},onError:t=>{nt.finishAll(),A.error(`Xray create failed: ${t.message}`)}})}function sb(){const e=ie();return W({mutationFn:t=>(nt.startSuite(t,"create"),Yr.createSuite(t)),onSuccess:(t,n)=>{nt.finishSuite(n),e.invalidateQueries({queryKey:["xray"]}),Al(t,"Create Suite")},onError:(t,n)=>{nt.finishSuite(n),A.error(`Xray create failed: ${t.message}`)}})}function nb(){const e=ie();return W({mutationFn:({suiteId:t,caseId:n})=>(nt.startCase(t,n,"create"),Yr.createCase(t,n)),onSuccess:(t,{suiteId:n,caseId:r})=>{nt.finishCase(n,r),e.invalidateQueries({queryKey:["xray"]}),Al(t,"Create Case")},onError:(t,{suiteId:n,caseId:r})=>{nt.finishCase(n,r),A.error(`Xray create failed: ${t.message}`)}})}function O5(){const e=ie();return W({mutationFn:t=>(nt.startSuite(t,"sync"),Yr.syncSuite(t)),onSuccess:(t,n)=>{nt.finishSuite(n),e.invalidateQueries({queryKey:["xray"]}),Al(t,"Sync Suite")},onError:(t,n)=>{nt.finishSuite(n),A.error(`Xray sync failed: ${t.message}`)}})}function rb(){const e=ie();return W({mutationFn:({suiteId:t,caseId:n})=>(nt.startCase(t,n,"sync"),Yr.syncCase(t,n)),onSuccess:(t,{suiteId:n,caseId:r})=>{nt.finishCase(n,r),e.invalidateQueries({queryKey:["xray"]}),Al(t,"Sync Case")},onError:(t,{suiteId:n,caseId:r})=>{nt.finishCase(n,r),A.error(`Xray sync failed: ${t.message}`)}})}function Um({code:e,maxLines:t,className:n}){const[r,a]=m.useState(!1),i=async()=>{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),1500)},l=!e.trim();return s.jsxs("div",{className:E("relative rounded-xl bg-[#0d1117] text-slate-300 ring-1 ring-white/5 overflow-hidden",n),children:[!l&&s.jsx("button",{type:"button",onClick:()=>void i(),className:E("absolute top-2.5 right-2.5 p-1.5 rounded-md transition-all duration-150",r?"bg-emerald-500/20 text-emerald-400":"text-slate-500 hover:text-slate-300 hover:bg-white/10"),title:"Copy code",children:r?s.jsx(ze,{size:13}):s.jsx(zm,{size:13})}),s.jsx("pre",{className:E("p-4 text-xs font-mono leading-relaxed overflow-x-auto",t&&`line-clamp-${t}`),style:t?{maxHeight:`${t*1.5}rem`,overflow:"auto"}:void 0,children:s.jsx("code",{children:l?"// No code generated yet":e})})]})}const D5={"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 Bm({status:e,xrayKey:t}){const n=D5[e];return s.jsxs("span",{className:E("inline-flex items-center gap-1.5 px-2 py-0.5 rounded-md text-[10px] font-semibold whitespace-nowrap border tracking-wide",n.bg,n.text,n.border),children:[s.jsx("span",{className:E("w-1.5 h-1.5 rounded-full flex-shrink-0",n.dot)}),n.label,t&&s.jsxs("span",{className:"text-[9px] opacity-60 truncate max-w-[80px]",title:t,children:["(",t,")"]})]})}const I5={"not-created":{icon:Uc,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:Im,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:we,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:we,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 pl({status:e,onClick:t,busy:n=!1,variant:r="full",label:a}){const i=I5[e],l=i.icon,o=a??i.label;return r==="icon"?s.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),t()},title:n?"Processing...":i.title,className:E("p-1.5 rounded-lg transition-all duration-150",n?"cursor-wait opacity-50":E(i.iconClass,i.iconHover)),children:n?s.jsx(ae,{size:14,className:"animate-spin text-accent"}):s.jsx(l,{size:14})}):s.jsxs("button",{type:"button",onClick:()=>t(),title:n?"Processing...":i.title,className:E("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-all duration-150",n?"bg-surface-inset text-content-tertiary cursor-wait":i.btnClass),children:[n?s.jsx(ae,{size:13,className:"animate-spin"}):s.jsx(l,{size:13}),n?"Processing...":o]})}function F5(e){return me({queryKey:["hooks",e],queryFn:()=>Qr.get(e),enabled:!!e})}function L5(e){const t=ie();return W({mutationFn:({hookType:n,instruction:r,order:a})=>Qr.addStep(e,n,{instruction:r,order:a}),onSuccess:()=>{t.invalidateQueries({queryKey:["hooks",e]})},onError:n=>A.error(n.message)})}function _5(e){const t=ie();return W({mutationFn:({hookType:n,stepId:r,instruction:a,timeout:i})=>Qr.updateStep(e,n,r,{instruction:a,timeout:i}),onSuccess:()=>{t.invalidateQueries({queryKey:["hooks",e]})},onError:n=>A.error(n.message)})}function $5(e){const t=ie();return W({mutationFn:({hookType:n,stepId:r})=>Qr.deleteStep(e,n,r),onSuccess:()=>{t.invalidateQueries({queryKey:["hooks",e]})},onError:n=>A.error(n.message)})}function U5(e){const t=ie();return W({mutationFn:({hookType:n,stepIds:r})=>Qr.reorderSteps(e,n,r),onSuccess:()=>{t.invalidateQueries({queryKey:["hooks",e]})},onError:n=>A.error(n.message)})}function B5(e){const t=ie();return W({mutationFn:({hookType:n,stepId:r})=>Qr.generateStep(e,n,r),onSuccess:()=>{t.invalidateQueries({queryKey:["hooks",e]}),A.success("Hook step code generated")},onError:n=>A.error(n.message)})}function q5(e){const t=ie();return W({mutationFn:n=>Qr.generateAll(e,n),onSuccess:n=>{t.invalidateQueries({queryKey:["hooks",e]}),A.success(`Generated code for ${n.generated} hook step(s)`)},onError:n=>A.error(n.message)})}const H5=[{type:"before_all",label:"Before All",desc:"Runs once before all test cases in the suite",icon:s.jsx(G2,{size:16}),color:"text-emerald-600"},{type:"before_each",label:"Before Each",desc:"Runs before every test case",icon:s.jsx(_c,{size:16}),color:"text-blue-600"},{type:"after_each",label:"After Each",desc:"Runs after every test case",icon:s.jsx(yw,{size:16}),color:"text-amber-600"},{type:"after_all",label:"After All",desc:"Runs once after all test cases in the suite",icon:s.jsx(Q2,{size:16}),color:"text-red-500"}];function K5({suiteId:e,open:t,onClose:n}){const{data:r,isLoading:a}=F5(e);return t?s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[s.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:n}),s.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:[s.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:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-bold text-content",children:"Suite Hooks"}),s.jsx("p",{className:"text-xs text-content-tertiary mt-0.5",children:"Lifecycle hooks run setup/teardown around your test cases (Playwright hooks)"})]}),s.jsx("button",{onClick:n,className:"p-1.5 rounded-lg hover:bg-surface-inset transition-colors text-content-tertiary hover:text-content-secondary",children:s.jsx(ye,{size:18})})]}),s.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:a?s.jsx("div",{className:"flex items-center justify-center py-16",children:s.jsx(ae,{size:24,className:"animate-spin text-accent"})}):H5.map(i=>s.jsx(W5,{suiteId:e,hookType:i.type,label:i.label,description:i.desc,icon:i.icon,color:i.color,steps:(r==null?void 0:r[i.type])??[]},i.type))})]})]}):null}function W5({suiteId:e,hookType:t,label:n,description:r,icon:a,color:i,steps:l}){const[o,c]=m.useState(l.length>0),[d,x]=m.useState(""),[p,y]=m.useState(""),[b,f]=m.useState(null),[v,w]=m.useState(""),[h,u]=m.useState(new Set),[g,j]=m.useState(null),[k,N]=m.useState(null),S=L5(e),P=$5(e),{modalProps:$,confirmDelete:M}=zs(),V=U5(e),G=_5(e),re=B5(e),O=q5(e),Y=()=>{d.trim()&&(S.mutate({hookType:t,instruction:d.trim()}),x(""))},ne=I=>{y(I),re.mutate({hookType:t,stepId:I},{onSettled:()=>y("")})},le=()=>{O.mutate(t)},T=I=>{if(!g||g===I){j(null),N(null);return}const X=l.map(he=>he.id),B=X.indexOf(g),xe=X.indexOf(I);B<0||xe<0||(X.splice(B,1),X.splice(xe,0,g),V.mutate({hookType:t,stepIds:X}),j(null),N(null))},_=I=>{f(I.id),w(I.instruction)},z=I=>{var X;v.trim()&&v!==((X=l.find(B=>B.id===I))==null?void 0:X.instruction)&&G.mutate({hookType:t,stepId:I,instruction:v.trim()}),f(null)},R=l.filter(I=>{var X;return!((X=I.generatedCode)!=null&&X.trim())}).length;return s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[s.jsxs("button",{type:"button",onClick:()=>c(!o),className:"w-full flex items-center gap-3 px-4 py-3 bg-surface-inset hover:bg-surface-inset transition-colors text-left",children:[o?s.jsx(ht,{size:14,className:"text-content-tertiary"}):s.jsx(Kt,{size:14,className:"text-content-tertiary"}),s.jsx("span",{className:E("flex-shrink-0",i),children:a}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("span",{className:"text-sm font-semibold text-content-secondary",children:n}),s.jsx("span",{className:"text-[10px] text-content-tertiary ml-2",children:r})]}),s.jsxs("span",{className:E("text-[10px] font-semibold px-2 py-0.5 rounded-full",l.length>0?"bg-accent/10 text-accent":"bg-slate-200 text-content-tertiary"),children:[l.length," step",l.length!==1?"s":""]})]}),o&&s.jsxs("div",{className:"border-t border-border bg-surface",children:[l.length===0?s.jsx("div",{className:"px-4 py-6 text-center",children:s.jsx("p",{className:"text-xs text-content-tertiary",children:"No steps yet — add one below"})}):s.jsx("div",{className:"divide-y divide-slate-100",children:l.map((I,X)=>s.jsxs("div",{draggable:!0,onDragStart:()=>j(I.id),onDragOver:B=>{B.preventDefault(),N(I.id)},onDragLeave:()=>N(null),onDrop:()=>T(I.id),onDragEnd:()=>{j(null),N(null)},className:E("flex items-start gap-2 px-4 py-2.5 group transition-colors",k===I.id&&"bg-accent/5 border-l-2 border-accent",g===I.id&&"opacity-40"),children:[s.jsx("div",{className:"pt-0.5 cursor-grab text-content-tertiary opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(Fc,{size:12})}),s.jsx("span",{className:"text-[10px] font-bold text-content-tertiary pt-0.5 w-4 flex-shrink-0",children:X+1}),s.jsxs("div",{className:"flex-1 min-w-0",children:[b===I.id?s.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:v,onChange:B=>w(B.target.value),onBlur:()=>z(I.id),onKeyDown:B=>{B.key==="Enter"&&z(I.id),B.key==="Escape"&&f(null)}}):s.jsxs("p",{className:"text-xs text-content-secondary cursor-pointer hover:text-accent transition-colors flex items-center gap-1.5",onClick:()=>_(I),title:"Click to edit",children:[I.instruction,I.generatedCode&&!h.has(I.id)&&s.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-green-400 flex-shrink-0",title:"Code generated"})]}),I.generatedCode&&h.has(I.id)&&s.jsx("div",{className:"mt-1",children:s.jsx(Um,{code:I.generatedCode,maxLines:6})})]}),s.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[I.generatedCode&&s.jsx("button",{title:h.has(I.id)?"Hide code":"Show code",onClick:()=>u(B=>{const xe=new Set(B);return xe.has(I.id)?xe.delete(I.id):xe.add(I.id),xe}),className:E("p-1 rounded transition-colors",h.has(I.id)?"text-content-secondary bg-slate-100":"text-content-tertiary hover:bg-surface-inset"),children:s.jsx(Tm,{size:12})}),s.jsx("button",{title:"Generate code",onClick:()=>ne(I.id),disabled:p===I.id,className:"p-1 rounded hover:bg-purple-50 text-purple-500 transition-colors",children:p===I.id?s.jsx(ae,{size:12,className:"animate-spin"}):s.jsx(Ur,{size:12})}),s.jsx("button",{title:"Delete step",onClick:()=>M("Delete this hook step? This cannot be undone.",()=>P.mutate({hookType:t,stepId:I.id})),className:"p-1 rounded hover:bg-red-50 text-red-400 transition-colors",children:s.jsx(It,{size:12})})]})]},I.id))}),s.jsxs("div",{className:"px-4 py-3 border-t border-slate-100 bg-surface-inset/50 flex items-center gap-2",children:[s.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:d,onChange:I=>x(I.target.value),onKeyDown:I=>{I.key==="Enter"&&Y()},placeholder:"Add a step (e.g. Navigate to login page)"}),s.jsxs("button",{type:"button",onClick:Y,disabled:!d.trim()||S.isPending,className:E("inline-flex items-center gap-1 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-colors",d.trim()?"bg-accent text-white hover:bg-accent/90":"bg-slate-200 text-content-tertiary cursor-not-allowed"),children:[S.isPending?s.jsx(ae,{size:11,className:"animate-spin"}):s.jsx(Rs,{size:11}),"Add"]}),l.length>0&&R>0&&s.jsxs("button",{type:"button",onClick:le,disabled:O.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:[O.isPending?s.jsx(ae,{size:11,className:"animate-spin"}):s.jsx(Ur,{size:11}),"Generate All (",R,")"]})]})]}),s.jsx(Ts,{...$})]})}const Qp={person:{icon:Lm,label:"Person"},internet:{icon:nn,label:"Internet"},phone:{icon:xw,label:"Phone"},location:{icon:iw,label:"Location"},company:{icon:U2,label:"Company"},finance:{icon:I2,label:"Finance"},date:{icon:B2,label:"Date"},lorem:{icon:Sw,label:"Lorem"},string:{icon:F2,label:"String"},number:{icon:Am,label:"Number"},datatype:{icon:Nw,label:"Datatype"},image:{icon:Om,label:"Image"},color:{icon:uw,label:"Color"},commerce:{icon:gw,label:"Commerce"},vehicle:{icon:q2,label:"Vehicle"},system:{icon:tw,label:"System"}},qd=[{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 Ti(e,t){return e==="classic"?`{{FAKE_${t}}}`:`{{FAKE_${e}_${t}}}`.toUpperCase()}async function V5(){const e=await fetch("/api/faker/generators");if(!e.ok)throw new Error("Failed to load generators");return e.json()}function G5({onInsert:e}){var k;const[t,n]=m.useState(!1),[r,a]=m.useState("person"),[i,l]=m.useState(""),[o,c]=m.useState("6"),[d,x]=m.useState([]),{data:p=[],isLoading:y}=me({queryKey:["faker-generators"],queryFn:V5,enabled:t,staleTime:1/0}),b=m.useMemo(()=>{if(!i.trim())return null;const N=i.toLowerCase(),S=[];for(const P of p)for(const $ of P.methods){const M=`${P.category}_${$.name}`.toLowerCase();($.name.toLowerCase().includes(N)||P.category.toLowerCase().includes(N)||M.includes(N)||$.example.toLowerCase().includes(N))&&S.push({category:P.category,method:$})}for(const P of qd)(P.name.toLowerCase().includes(N)||P.example.toLowerCase().includes(N))&&S.push({category:"classic",method:P});return S},[i,p]),f=m.useMemo(()=>{var N;return r==="classic"?null:((N=p.find(S=>S.category===r))==null?void 0:N.methods)??[]},[r,p]),v=m.useCallback((N,S)=>{const P=Ti(N,S);x($=>$.includes(P)?$.filter(M=>M!==P):[...$,P])},[]),w=m.useCallback(()=>{d.length>0&&e(d.join(", ")),x([]),n(!1),l("")},[d,e]),h=m.useCallback(()=>{d.length>0&&e(d.join(", ")),x([]),n(!1),l("")},[d,e]),u=m.useCallback(N=>{x(S=>S.filter(P=>P!==N))},[]),g=()=>{const S=`{{FAKE_NUMBER_${Math.max(1,Math.min(20,parseInt(o,10)||6))}}}`;x(P=>P.includes(S)?P:[...P,S])},j=m.useMemo(()=>[...p.map(S=>S.category),"classic"],[p]);return s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",onClick:()=>n(!0),title:"Insert dynamic data token",className:E("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:[s.jsx(wt,{size:12}),s.jsx("span",{className:"hidden sm:inline",children:"Fake Data"}),s.jsx(ht,{size:10})]}),t&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm animate-fade-in",onClick:N=>{N.target===N.currentTarget&&h()},children:s.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:[s.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:[s.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[s.jsx(wt,{size:16,className:"text-violet-500 dark:text-violet-400"}),s.jsx("h2",{className:"text-sm font-bold text-violet-800 dark:text-violet-200",children:"Faker Data"}),s.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:[p.reduce((N,S)=>N+S.methods.length,0)+qd.length,"+ generators"]})]}),s.jsx("button",{type:"button",onClick:h,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:s.jsx(ye,{size:16})})]}),s.jsx("div",{className:"px-5 py-3 border-b border-border flex-shrink-0",children:s.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:[s.jsx(Wn,{size:14,className:"text-content-tertiary flex-shrink-0"}),s.jsx("input",{type:"text",value:i,onChange:N=>l(N.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}),i&&s.jsx("button",{type:"button",onClick:()=>l(""),className:"text-content-tertiary hover:text-content transition-colors",children:s.jsx(ye,{size:12})})]})}),s.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[s.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:y?s.jsx("div",{className:"space-y-2 px-1",children:Array.from({length:8}).map((N,S)=>s.jsx("div",{className:"h-7 rounded-lg bg-surface-inset animate-pulse"},S))}):j.map(N=>{const S=Qp[N]??{icon:Wr,label:N.charAt(0).toUpperCase()+N.slice(1)},P=N==="classic"?wt:S.icon,$=N==="classic"?"Classic":S.label;return s.jsxs("button",{type:"button",onClick:()=>{a(N),l("")},className:E("w-full flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-[11px] font-medium transition-all text-left",r===N&&!i?"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:[s.jsx(P,{size:13,className:"flex-shrink-0"}),s.jsx("span",{className:"truncate",children:$})]},N)})}),s.jsx("div",{className:"flex-1 overflow-y-auto py-2 px-3",children:y?s.jsx("div",{className:"space-y-2",children:Array.from({length:6}).map((N,S)=>s.jsx("div",{className:"h-12 rounded-xl bg-surface-inset animate-pulse"},S))}):b?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest px-1 mb-2",children:[b.length," result",b.length!==1?"s":"",' for "',i,'"']}),b.length===0?s.jsx("p",{className:"text-sm text-content-tertiary text-center py-8",children:"No generators found. Try a different search term."}):s.jsx("div",{className:"space-y-1",children:b.map(({category:N,method:S})=>s.jsx(Hd,{category:N,method:S,selected:d.includes(Ti(N,S.name)),onToggle:v},`${N}-${S.name}`))})]}):r==="classic"?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest px-1 mb-2",children:"Classic Tokens (backward-compatible)"}),s.jsx("div",{className:"space-y-1",children:qd.map(N=>s.jsx(Hd,{category:"classic",method:N,selected:d.includes(Ti("classic",N.name)),onToggle:v},N.name))}),s.jsxs("div",{className:"mt-4 pt-3 border-t border-border",children:[s.jsxs("p",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest px-1 mb-2 flex items-center gap-1",children:[s.jsx(Am,{size:10})," Random Number"]}),s.jsxs("div",{className:"flex items-center gap-2 px-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5 flex-1 bg-surface-inset rounded-lg px-3 py-2 border border-border",children:[s.jsx("span",{className:"text-[11px] text-content-tertiary",children:"Digits:"}),s.jsx("input",{type:"number",min:1,max:20,value:o,onChange:N=>c(N.target.value),onKeyDown:N=>N.key==="Enter"&&g(),className:"w-12 text-sm bg-transparent outline-none text-content font-mono tabular-nums"})]}),s.jsx("button",{type:"button",onClick:g,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"})]}),s.jsx("p",{className:"text-[10px] text-content-tertiary px-1 mt-2 font-mono",children:`→ {{FAKE_NUMBER_${Math.max(1,parseInt(o,10)||6)}}}`})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest px-1 mb-2",children:[((k=Qp[r])==null?void 0:k.label)??r," — ",(f==null?void 0:f.length)??0," generators"]}),s.jsx("div",{className:"space-y-1",children:(f??[]).map(N=>s.jsx(Hd,{category:r,method:N,selected:d.includes(Ti(r,N.name)),onToggle:v},N.name))})]})})]}),d.length>0&&s.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:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsxs("span",{className:"text-[10px] font-bold text-violet-600 dark:text-violet-300 uppercase tracking-wider",children:["Selected (",d.length,")"]}),s.jsx("button",{type:"button",onClick:()=>x([]),className:"text-[10px] text-violet-400 hover:text-violet-600 dark:hover:text-violet-300 transition-colors underline",children:"Clear all"})]}),s.jsx("div",{className:"flex flex-wrap gap-1.5 max-h-16 overflow-y-auto",children:d.map(N=>s.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:[N,s.jsx("button",{type:"button",onClick:()=>u(N),className:"text-violet-400 hover:text-violet-700 dark:hover:text-violet-200 transition-colors",children:s.jsx(ye,{size:10})})]},N))})]}),s.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:[s.jsxs("p",{className:"text-[10px] text-content-tertiary",children:["Click to select multiple tokens. They will be inserted ",s.jsx("strong",{children:"comma-separated"}),"."]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{type:"button",onClick:()=>{x([]),n(!1),l("")},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"}),s.jsxs("button",{type:"button",onClick:w,disabled:d.length===0,className:E("px-4 py-1.5 rounded-lg text-xs font-semibold transition-all",d.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 ",d.length>0?`${d.length} token${d.length>1?"s":""}`:""]})]})]})]})})]})}function Hd({category:e,method:t,selected:n,onToggle:r}){const a=Ti(e,t.name);return s.jsxs("button",{type:"button",onClick:()=>r(e,t.name),className:E("w-full flex items-center justify-between gap-3 px-3 py-2 rounded-xl transition-colors group text-left",n?"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:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[s.jsx("div",{className:E("flex-shrink-0 w-4 h-4 rounded flex items-center justify-center border transition-all",n?"bg-violet-600 border-violet-600":"border-gray-300 dark:border-gray-600 group-hover:border-violet-400"),children:n&&s.jsx(ze,{size:10,className:"text-white",strokeWidth:3})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[e!=="classic"&&s.jsx("span",{className:E("text-[9px] px-1.5 py-0.5 rounded font-medium uppercase flex-shrink-0",n?"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:e}),s.jsx("p",{className:E("text-[12px] font-medium truncate",n?"text-violet-700 dark:text-violet-200":"text-content group-hover:text-violet-700 dark:group-hover:text-violet-300"),children:t.name})]}),s.jsx("p",{className:"text-[9px] text-content-tertiary font-mono truncate mt-0.5",children:a})]})]}),s.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:t.example})]})}function Q5(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Y5(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{const a=String(r.result);t(a.slice(a.indexOf(",")+1))},r.onerror=()=>n(r.error),r.readAsDataURL(e)})}function J5({onInsert:e}){const[t,n]=m.useState(!1),r=m.useRef(null),a=ie(),{data:i=[],isLoading:l}=me({queryKey:["files"],queryFn:qi.list,enabled:t}),o=W({mutationFn:async x=>{const p=await Y5(x);return qi.upload(x.name,p)},onSuccess:x=>{A.success(`Uploaded ${x.name}`),a.invalidateQueries({queryKey:["files"]})},onError:x=>A.error(x.message)}),c=W({mutationFn:x=>qi.remove(x),onSuccess:()=>a.invalidateQueries({queryKey:["files"]}),onError:x=>A.error(x.message)}),d=x=>{e(x.token),A.success(`Inserted ${x.token}`),n(!1)};return s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",onClick:()=>n(!0),title:"Insert an uploaded file token",className:E("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:[s.jsx(Dp,{size:12}),s.jsx("span",{className:"hidden sm:inline",children:"Files"}),s.jsx(ht,{size:10})]}),t&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm animate-fade-in",onClick:x=>{x.target===x.currentTarget&&n(!1)},children:s.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:[s.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:[s.jsx(Dp,{size:16,className:"text-sky-500 dark:text-sky-400"}),s.jsx("h2",{className:"text-sm font-bold text-sky-800 dark:text-sky-200 flex-1",children:"Upload Files"}),s.jsx("button",{type:"button",onClick:()=>n(!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:s.jsx(ye,{size:16})})]}),s.jsxs("div",{className:"px-5 py-3 border-b border-border flex-shrink-0",children:[s.jsx("input",{ref:r,type:"file",className:"hidden",onChange:x=>{var y;const p=(y=x.target.files)==null?void 0:y[0];p&&o.mutate(p),x.target.value=""}}),s.jsxs("button",{type:"button",onClick:()=>{var x;return(x=r.current)==null?void 0:x.click()},disabled:o.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:[s.jsx(Uc,{size:13}),o.isPending?"Uploading…":"Choose a file to upload"]}),s.jsxs("p",{className:"text-[10px] text-content-tertiary mt-1.5",children:["Saved to ",s.jsx("code",{className:"text-accent",children:"fixtures/uploads/"})," and inserted as a ",s.jsx("code",{className:"text-accent",children:"{{FILE:…}}"})," token."]})]}),s.jsx("div",{className:"flex-1 overflow-y-auto p-3 min-h-0",children:l?s.jsx("p",{className:"text-sm text-content-tertiary text-center py-6",children:"Loading…"}):i.length===0?s.jsx("p",{className:"text-sm text-content-tertiary text-center py-6",children:"No files uploaded yet."}):s.jsx("div",{className:"space-y-1",children:i.map(x=>s.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:[s.jsx(X2,{size:14,className:"text-sky-500 dark:text-sky-400 flex-shrink-0"}),s.jsxs("button",{type:"button",onClick:()=>d(x),className:"flex-1 text-left min-w-0",children:[s.jsx("div",{className:"text-[12px] font-medium text-content truncate",children:x.name}),s.jsxs("div",{className:"text-[10px] text-content-tertiary font-mono truncate",children:[x.token," · ",Q5(x.size)]})]}),s.jsx("button",{type:"button",onClick:()=>c.mutate(x.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:s.jsx(It,{size:12})})]},x.name))})}),s.jsx("div",{className:"px-5 py-2.5 border-t border-border bg-surface-inset/30 flex-shrink-0",children:s.jsx("p",{className:"text-[11px] text-content-tertiary",children:"Click a file to insert its token into the step."})})]})})]})}function X5({selectedIds:e,suiteId:t,suites:n,onClear:r,onDeleted:a,onMoved:i}){const l=ie(),{modalProps:o,confirmDelete:c}=zs(),[d,x]=m.useState(""),p=W({mutationFn:()=>Vn.bulkDelete(t,Array.from(e)),onSuccess:v=>{A.success(`Deleted ${v.deleted} case${v.deleted!==1?"s":""}`),l.invalidateQueries({queryKey:["cases",t]}),a(),r()},onError:v=>A.error(v.message)}),y=W({mutationFn:v=>Vn.bulkMove(t,Array.from(e),v),onSuccess:v=>{A.success(`Moved ${v.moved} case${v.moved!==1?"s":""}`),l.invalidateQueries({queryKey:["cases",t]}),i(),r(),x("")},onError:v=>A.error(v.message)}),b=n.filter(v=>v.id!==t),f=e.size;return s.jsxs(s.Fragment,{children:[s.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:[s.jsxs("span",{className:"text-sm font-semibold text-content flex-shrink-0",children:[f," case",f!==1?"s":""," selected"]}),s.jsx("button",{type:"button",onClick:()=>A("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"}),s.jsxs("button",{type:"button",onClick:()=>c(`Delete ${f} selected case${f!==1?"s":""}? This cannot be undone.`,()=>p.mutate()),disabled:p.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:[s.jsx(It,{size:12})," Delete Selected"]}),b.length>0&&s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(dw,{size:13,className:"text-content-tertiary flex-shrink-0"}),s.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:d,onChange:v=>x(v.target.value),children:[s.jsx("option",{value:"",children:"Move to suite…"}),b.map(v=>s.jsx("option",{value:v.id,children:v.name},v.id))]}),d&&s.jsx("button",{type:"button",onClick:()=>y.mutate(d),disabled:y.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"})]}),s.jsx("div",{className:"flex-1"}),s.jsx("button",{type:"button",onClick:r,className:"p-1.5 rounded-lg text-content-tertiary hover:bg-surface-inset transition-colors",children:s.jsx(ye,{size:14})})]}),s.jsx(Ts,{...o})]})}function Z5({passRate:e,runs:t,flaky:n}){if(!n||t<3||e===1)return null;const r=Math.round(e*100);return s.jsx("span",{title:`Flaky: ${r}% pass rate over ${t} 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 eS({open:e,onClose:t,suiteId:n,caseId:r,onInserted:a}){const i=ie(),[l,o]=m.useState(""),[c,d]=m.useState(!1),[x,p]=m.useState(""),[y,b]=m.useState(""),{data:f=[]}=me({queryKey:["step-library"],queryFn:()=>xr.list()}),v=W({mutationFn:u=>Gr.add(n,r,{instruction:u.instruction,...u.generatedCode?{generatedCode:u.generatedCode,strategy:"cache"}:{}}),onSuccess:()=>{i.invalidateQueries({queryKey:["cases",n,r]}),A.success("Step inserted"),a()},onError:u=>A.error(u.message)}),w=W({mutationFn:()=>xr.create({name:x,instruction:y}),onSuccess:()=>{i.invalidateQueries({queryKey:["step-library"]}),A.success("Step saved to library"),d(!1),p(""),b("")},onError:u=>A.error(u.message)}),h=f.filter(u=>!l||u.name.toLowerCase().includes(l.toLowerCase())||u.instruction.toLowerCase().includes(l.toLowerCase())||u.tags.some(g=>g.toLowerCase().includes(l.toLowerCase())));return e?s.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:[s.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border flex-shrink-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ul,{size:14,className:"text-accent"}),s.jsx("span",{className:"text-sm font-semibold text-content",children:"Step Library"})]}),s.jsx("button",{type:"button",onClick:t,className:"p-1 rounded text-content-tertiary hover:text-content hover:bg-surface-inset",children:s.jsx(ye,{size:14})})]}),s.jsx("div",{className:"px-3 py-2 border-b border-border flex-shrink-0",children:s.jsxs("div",{className:"relative",children:[s.jsx(Wn,{size:12,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-content-tertiary"}),s.jsx("input",{type:"text",placeholder:"Search steps…",value:l,onChange:u=>o(u.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"})]})}),s.jsxs("div",{className:"flex-1 overflow-y-auto py-2 px-2 space-y-1",children:[h.length===0&&s.jsx("p",{className:"text-[11px] text-content-tertiary text-center py-6",children:f.length===0?"No steps in library yet":"No results"}),h.map(u=>s.jsx("div",{className:"border border-border rounded-lg p-2.5 hover:border-accent/30 hover:bg-surface-inset/50 transition-colors",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("p",{className:"text-xs font-semibold text-content truncate",children:u.name}),u.generatedCode?s.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"}):s.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"})]}),s.jsx("p",{className:"text-[10px] text-content-tertiary mt-0.5 line-clamp-2",children:u.instruction}),u.tags.length>0&&s.jsx("div",{className:"flex flex-wrap gap-0.5 mt-1",children:u.tags.map(g=>s.jsx("span",{className:"text-[8px] px-1 py-px rounded bg-accent/8 text-accent ring-1 ring-accent/15",children:g},g))})]}),s.jsx("button",{type:"button",onClick:()=>v.mutate({instruction:u.instruction,generatedCode:u.generatedCode}),disabled:v.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"})]})},u.id))]}),s.jsx("div",{className:"border-t border-border p-3 flex-shrink-0",children:c?s.jsxs("div",{className:"space-y-2",children:[s.jsx("input",{type:"text",placeholder:"Step name",value:x,onChange:u=>p(u.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"}),s.jsx("textarea",{placeholder:"Step instruction",value:y,onChange:u=>b(u.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"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{type:"button",onClick:()=>w.mutate(),disabled:!x.trim()||!y.trim()||w.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"}),s.jsx("button",{type:"button",onClick:()=>d(!1),className:"text-xs px-3 py-1.5 rounded-lg border border-border text-content-secondary hover:bg-surface-inset",children:"Cancel"})]})]}):s.jsxs("button",{type:"button",onClick:()=>d(!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:[s.jsx(Rs,{size:12})," Save current step to library"]})})]}):null}const yi=new Set,ia=new Map;let mn=null,bi=null,vi=null;const la=new Map,ji=new Map,vx=new Set;function oa(){vx.forEach(e=>e())}const jt={subscribe(e){return vx.add(e),()=>vx.delete(e)},getSnapshot(){return{runningCaseIds:yi,runningSuiteId:mn,caseLastRun:la,suiteLastRun:ji}},startCase(e){yi.add(e),oa()},startSuite(e){vi=e,mn=e,oa()},onRunStart(e){vi&&(bi=e,vi=null)},onCaseRunning(e,t){ia.has(e)||ia.set(e,t)},onCaseDone(e,t,n){const r=e===bi,a=la.get(t),i=r?(a==null?void 0:a.allureRunId)??e:e;la.set(t,{status:n,runId:e,allureRunId:i}),oa()},onComplete(e,t){const n=ia.get(e);n&&(yi.delete(n),ia.delete(e)),yi.clear(),ia.clear(),e===bi&&mn?ji.set(mn,{...t,runId:e}):mn&&ji.set(mn,{...t,runId:e}),mn=null,bi=null,vi=null,oa()},seedFromHistory(e){for(const t of e)for(const n of t.suites){ji.has(n.suiteId)||ji.set(n.suiteId,{passed:t.passed,failed:t.failed,skipped:t.skipped,runId:t.runId});const a=t.suites.reduce((i,l)=>i+l.cases.length,0)===1;for(const i of n.cases){const l=la.get(i.caseId);l?a&&!l.allureRunId&&la.set(i.caseId,{...l,allureRunId:t.runId}):la.set(i.caseId,{status:i.status,runId:t.runId,allureRunId:t.runId})}}oa()},clear(){yi.clear(),ia.clear(),mn=null,bi=null,vi=null,oa()}};function Wc(){const[e,t]=m.useState(()=>jt.getSnapshot());return m.useEffect(()=>jt.subscribe(()=>t(jt.getSnapshot())),[]),e}function qm(){const[e,t]=m.useState(()=>nt.getSnapshot());return m.useEffect(()=>nt.subscribe(()=>t(nt.getSnapshot())),[]),e}const ab=["critical","high","medium","low"],jx={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 fl({tags:e,editable:t=!1,onAdd:n,onRemove:r}){const[a,i]=m.useState(""),l=()=>{const o=a.trim().toLowerCase().replace(/\s+/g,"-");if(!o||e.includes(o)){i("");return}n==null||n(o),i("")};return s.jsxs("div",{className:"flex flex-wrap gap-0.5 items-center",children:[e.map(o=>s.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:[o,t&&s.jsx("button",{type:"button",onClick:()=>r==null?void 0:r(o),children:s.jsx(ye,{size:8,className:"hover:text-red-500"})})]},o)),t&&s.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:a,onChange:o=>i(o.target.value),onKeyDown:o=>{o.key==="Enter"&&(o.preventDefault(),l())},onBlur:l}),!t&&e.length===0&&s.jsx("span",{className:"text-[10px] text-content-tertiary",children:"—"})]})}function Kd(){const e=Zn(),t=Ms(),{suiteId:n="",caseId:r=""}=Pj(),a=r?"case-editor":n?"suite-detail":"suites",[i,l]=m.useState(""),[o,c]=m.useState("ui"),[d,x]=m.useState(""),{modalProps:p,confirmDelete:y}=zs(),[b,f]=m.useState(""),[v,w]=m.useState(""),[h,u]=m.useState(""),{data:g=[],isLoading:j}=Xy();m.useEffect(()=>{var R;const z=(R=e.state)==null?void 0:R.openSuiteId;z&&g.length>0&&g.find(X=>X.id===z)&&t(`/tests/${z}`,{replace:!0})},[e.state,g]);const k=m.useMemo(()=>{const z=new Set;return g.forEach(R=>(R.tags??[]).forEach(I=>z.add(I))),Array.from(z).sort()},[g]),N=m.useMemo(()=>g.filter(z=>{const R=!b||z.name.toLowerCase().includes(b.toLowerCase())||(z.description??"").toLowerCase().includes(b.toLowerCase()),I=!v||(z.tags??[]).includes(v),X=z.type==="performance"?"audit":z.type??"ui";return R&&I&&(!h||X===h)}),[g,b,v,h]),S=g.find(z=>z.id===n),P=y5(),$=b5(),{data:M=[]}=z5(),V=A5(),G=sb(),re=qm(),O=W({mutationFn:z=>Ya.start({test:z}),onError:z=>{jt.clear(),A.error(z.message)}}),Y=W({mutationFn:z=>Ya.start({suite:z}),onError:z=>{jt.clear(),A.error(z.message)}}),ne=z=>{jt.startCase(z),O.mutate(z),t("/run")},le=z=>{jt.startSuite(z),Y.mutate(z),t("/run")},T=()=>{i.trim()&&(P.mutate({name:i,type:o}),l(""))};if(j)return s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(ae,{size:20,className:"animate-spin text-accent"})});let _=null;if(a==="suites"){const z=g.filter(B=>(B.type??"ui")==="ui").length,R=g.filter(B=>(B.type??"ui")==="api").length,I=g.filter(B=>B.type==="audit"||B.type==="performance").length,X=g.reduce((B,xe)=>B+(xe.caseCount??0),0);_=s.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:s.jsx("div",{className:"flex-1 overflow-y-auto",children:s.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[s.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:s.jsxs("div",{className:"px-5 py-3.5 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.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:s.jsx(xl,{size:18,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-base font-bold text-content tracking-tight",children:"Test Suites"}),s.jsx("p",{className:"text-[11px] text-content-tertiary mt-0.5",children:"Manage and organize your test automation"})]})]}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"flex items-center gap-3",children:[{label:"Suites",val:g.length,cls:"text-indigo-600 dark:text-indigo-400"},{label:"UI",val:z,cls:"text-blue-600 dark:text-blue-400"},{label:"API",val:R,cls:"text-violet-600 dark:text-violet-400"},...I>0?[{label:"Audit",val:I,cls:"text-amber-600 dark:text-amber-400"}]:[],{label:"Cases",val:X,cls:"text-emerald-600 dark:text-emerald-400"}].map(B=>s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:E("text-sm font-bold tabular-nums",B.cls),children:B.val}),s.jsx("p",{className:"text-[9px] text-content-tertiary font-medium",children:B.label})]},B.label))}),s.jsx("div",{className:"w-px h-8 bg-border"}),s.jsx(pl,{status:"not-created",variant:"full",label:"Sync All",onClick:()=>V.mutate(),busy:re.allOp==="create"||re.allOp==="sync"})]})]})}),s.jsxs("div",{className:"rounded-xl border border-border bg-surface px-4 py-2.5 flex items-center gap-3",children:[s.jsx("div",{className:"flex gap-0.5 flex-shrink-0 bg-surface-inset rounded-lg p-0.5",children:[["","All",g.length],["ui","UI",z],["api","API",R],...I>0?[["audit","Audit",I]]:[]].map(([B,xe,he])=>s.jsxs("button",{type:"button",onClick:()=>u(B),className:E("px-2.5 py-1 rounded-md text-[10px] font-semibold transition-all",h===B?"bg-surface text-accent shadow-sm ring-1 ring-accent/20":"text-content-tertiary hover:text-content-secondary"),children:[xe," ",s.jsx("span",{className:"opacity-50 ml-0.5",children:he})]},B))}),s.jsxs("div",{className:"relative flex-1 min-w-0",children:[s.jsx(Wn,{size:12,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-content-tertiary pointer-events-none"}),s.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:b,onChange:B=>f(B.target.value)})]}),k.length>0&&s.jsxs("select",{value:v,onChange:B=>w(B.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:[s.jsx("option",{value:"",children:"All Tags"}),k.map(B=>s.jsx("option",{value:B,children:B},B))]}),(b||v||h)&&s.jsx("button",{type:"button",onClick:()=>{f(""),w(""),u("")},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:s.jsx(ye,{size:12})}),s.jsx("div",{className:"w-px h-5 bg-border"}),s.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[s.jsx("div",{className:"flex gap-0 bg-surface-inset rounded-lg p-0.5 ring-1 ring-border",children:["ui","api","audit"].map(B=>s.jsx("button",{type:"button",onClick:()=>c(B),className:E("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all",o===B?B==="api"?"bg-violet-500 text-white shadow-sm":B==="audit"?"bg-amber-500 text-white shadow-sm":"bg-blue-500 text-white shadow-sm":"text-content-tertiary hover:text-content-secondary"),children:B==="audit"?"Audit":B},B))}),s.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:i,onChange:B=>l(B.target.value),onKeyDown:B=>B.key==="Enter"&&T()}),s.jsxs(se,{size:"sm",onClick:T,disabled:P.isPending,children:[s.jsx(Rs,{size:11})," Add"]})]})]}),g.length===0?s.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:[s.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:s.jsx(Wr,{size:22,className:"text-accent"})}),s.jsx("p",{className:"text-sm font-semibold text-content",children:"No suites yet"}),s.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."})]}):N.length===0?s.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:[s.jsx(Ny,{size:18,className:"text-content-tertiary"}),s.jsx("p",{className:"text-xs font-medium text-content-secondary",children:"No suites match your filters"}),s.jsx("button",{onClick:()=>{f(""),w(""),u("")},className:"text-[10px] font-medium text-accent hover:underline",children:"Clear all filters"})]}):s.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:N.map(B=>{var xe,he;return s.jsx(tS,{suite:B,xrayStatus:((xe=M.find(Ee=>Ee.suiteId===B.id))==null?void 0:xe.status)??"not-created",xrayKey:((he=M.find(Ee=>Ee.suiteId===B.id))==null?void 0:he.xrayTestSetId)??null,onOpen:()=>t(`/tests/${B.id}`),onRun:()=>le(B.id),onDelete:()=>y(`Delete suite "${B.name}"? All cases and steps will be lost.`,()=>$.mutate(B.id)),onXrayAction:()=>G.mutate(B.id),isXrayBusy:re.busySuites.get(B.id)==="create"||re.busySuites.get(B.id)==="sync"||re.allOp==="create"||re.allOp==="sync"},B.id)})})]})})})}return a==="suite-detail"&&n&&(_=s.jsx(sS,{suiteId:n,suite:S,suites:g,newCaseName:d,onNewCaseNameChange:x,onOpenCase:z=>t(`/tests/${n}/cases/${z}`),onRunCase:z=>ne(z),onRunSuite:()=>le(n),onBack:()=>t("/tests")})),a==="case-editor"&&n&&r&&(_=s.jsx(nS,{suiteId:n,caseId:r,suiteName:(S==null?void 0:S.name)??"",suiteType:(S==null?void 0:S.type)??"ui",onBack:()=>t(`/tests/${n}`),onRunCase:()=>ne(r)})),s.jsxs("div",{className:"flex-1 overflow-hidden relative flex flex-col",children:[_,s.jsx(Ts,{...p})]})}function tS({suite:e,onOpen:t,onRun:n,onDelete:r,xrayStatus:a="not-created",xrayKey:i=null,onXrayAction:l,isXrayBusy:o=!1}){const{runningCaseIds:c,runningSuiteId:d,suiteLastRun:x}=Wc(),p=d===e.id,y=x.get(e.id),[b,f]=m.useState(!1),[v,w]=m.useState(e.name),[h,u]=m.useState(e.description??""),[g,j]=m.useState(e.tags??[]),[k,N]=m.useState(e.timeout?String(e.timeout):""),S=Zy(),P=m.useRef(null),$=(e.type??"ui")==="api",M=e.type==="audit"||e.type==="performance";m.useEffect(()=>{var _;b&&((_=P.current)==null||_.focus())},[b]);const V=_=>{_.stopPropagation(),f(!0)},G=_=>{_==null||_.stopPropagation(),w(e.name),u(e.description??""),j(e.tags??[]),N(e.timeout?String(e.timeout):""),f(!1)},re=_=>{_==null||_.stopPropagation();const z=k?parseInt(k,10):void 0;S.mutate({id:e.id,data:{name:v.trim()||e.name,description:h,tags:g,timeout:z}},{onSuccess:()=>f(!1)})},O=_=>{_.key==="Enter"&&(_.preventDefault(),re()),_.key==="Escape"&&G()};if(b)return s.jsxs("div",{className:"rounded-xl border-2 border-accent/30 bg-accent/[0.02] p-3.5 space-y-2.5",onClick:_=>_.stopPropagation(),children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:E("w-6 h-6 rounded-lg flex items-center justify-center flex-shrink-0",$?"bg-violet-100":"bg-blue-100"),children:s.jsx(Ps,{size:11,className:$?"text-violet-600":"text-blue-600"})}),s.jsx("input",{ref:P,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:v,onChange:_=>w(_.target.value),onKeyDown:O,placeholder:"Suite name"})]}),s.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:h,onChange:_=>u(_.target.value),onKeyDown:O,placeholder:"Description (optional)"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.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:k,onChange:_=>N(_.target.value),onKeyDown:O,placeholder:"Timeout (ms)"}),s.jsx("span",{className:"text-[10px] text-content-tertiary",children:"ms timeout"}),s.jsx("div",{className:"ml-auto",children:s.jsx(fl,{tags:g,editable:!0,onAdd:_=>j(z=>[...z,_]),onRemove:_=>j(z=>z.filter(R=>R!==_))})})]}),s.jsxs("div",{className:"flex gap-1.5 justify-end pt-0.5",children:[s.jsxs(se,{size:"sm",variant:"secondary",onClick:G,children:[s.jsx(ye,{size:10})," Cancel"]}),s.jsxs(se,{size:"sm",onClick:re,loading:S.isPending,children:[s.jsx(ze,{size:10})," Save"]})]})]});const Y=$?"bg-gradient-to-b from-violet-500 to-purple-600":M?"bg-gradient-to-b from-amber-500 to-orange-600":"bg-gradient-to-b from-blue-500 to-indigo-600",ne=$?"bg-violet-50 dark:bg-violet-900/20 text-violet-600 dark:text-violet-400 ring-violet-200 dark:ring-violet-800":M?"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",le=M?"Audit":$?"API":"UI",T=e.caseCount??0;return s.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:t,children:[s.jsx("div",{className:E("w-1 flex-shrink-0 rounded-l-xl",Y)}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"px-3.5 pt-3 pb-1.5",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h3",{className:"text-[13px] font-bold text-content truncate flex-1",children:e.name}),s.jsxs("span",{className:E("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:[M&&s.jsx(qe,{size:7})," ",le]}),s.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",onClick:_=>_.stopPropagation(),children:[s.jsx("button",{type:"button",onClick:V,title:"Edit",className:"p-1.5 rounded-lg text-content-tertiary hover:text-accent hover:bg-accent/8 transition-colors",children:s.jsx(tr,{size:12})}),s.jsx("button",{type:"button",onClick:_=>{_.stopPropagation(),r()},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:s.jsx(It,{size:12})})]})]}),e.description&&s.jsx("p",{className:"text-[10px] text-content-tertiary truncate mt-1 leading-relaxed",children:e.description})]}),s.jsx("div",{className:"px-3.5 pb-2",children:s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.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:[s.jsx(Wr,{size:9,className:"opacity-50"}),T," case",T!==1?"s":""]}),y&&s.jsxs("span",{className:E("inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1",y.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:[s.jsx(hy,{size:5,className:"fill-current"}),y.passed,"p / ",y.failed,"f"]}),s.jsxs("div",{className:"flex items-center gap-1",onClick:_=>_.stopPropagation(),children:[s.jsx(Bm,{status:a,xrayKey:i}),s.jsx(pl,{variant:"icon",status:a,onClick:()=>l==null?void 0:l(),busy:o})]}),(e.tags??[]).length>0&&s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(fl,{tags:e.tags??[]})})]})}),s.jsxs("div",{className:"px-3.5 py-2 border-t border-border/40 bg-surface-inset/20 flex items-center gap-1.5",onClick:_=>_.stopPropagation(),children:[p?s.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] text-teal-600 dark:text-teal-400 font-semibold",children:[s.jsx(ae,{size:11,className:"animate-spin"})," Running..."]}):s.jsxs("button",{type:"button",onClick:_=>{_.stopPropagation(),n()},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:[s.jsx(Dt,{size:10,strokeWidth:2.5})," Run Suite"]}),s.jsxs("button",{type:"button",disabled:!y,onClick:_=>{_.stopPropagation(),y&&window.open(`/allure/${y.runId}`,"_blank")},title:y?`Report: ${y.passed}p / ${y.failed}f`:"No report",className:E("flex items-center gap-1 px-2.5 py-1 rounded-lg text-[10px] font-semibold transition-colors ring-1",y?"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:[s.jsx(ps,{size:10})," Report"]}),s.jsx("div",{className:"flex-1"}),s.jsx("span",{className:"text-[9px] text-content-tertiary",children:new Date(e.updatedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})}),s.jsx(Kt,{size:12,className:"text-content-tertiary/40 group-hover:text-accent transition-colors"})]})]})]})}function sS({suiteId:e,suite:t,suites:n,newCaseName:r,onNewCaseNameChange:a,onOpenCase:i,onRunCase:l,onRunSuite:o,onBack:c}){const{runningCaseIds:d,runningSuiteId:x,caseLastRun:p}=Wc(),y=x===e,{data:b=[],isLoading:f}=v5(e),v=Gp(e),w=w5(e),h=Gp(e),[u,g]=m.useState(!1),[j,k]=m.useState(!1),{modalProps:N,confirmDelete:S}=zs(),[P,$]=m.useState(new Set),M=m.useRef(-1),{data:V}=me({queryKey:["flakiness",e],queryFn:()=>Lw.get(e),staleTime:6e4});m.useEffect(()=>{$(new Set),M.current=-1},[e]);const{data:G}=tb(e),re=sb(),O=nb(),Y=O5(),ne=rb(),le=qm(),T=()=>{((G==null?void 0:G.status)??"not-created")==="not-created"?re.mutate(e):Y.mutate(e)},_=H=>{var fe;(((fe=G==null?void 0:G.cases.find(De=>De.caseId===H))==null?void 0:fe.status)??"not-created")==="not-created"?O.mutate({suiteId:e,caseId:H}):ne.mutate({suiteId:e,caseId:H})};m.useEffect(()=>{Ya.list(20).then(async H=>{const ue=await Promise.all(H.slice(0,10).map(fe=>Ya.get(fe.runId).catch(()=>null)));jt.seedFromHistory(ue.filter(fe=>fe!==null).map(fe=>({runId:fe.runId,passed:fe.passed,failed:fe.failed,skipped:fe.skipped,suites:fe.suites.map(De=>({suiteId:De.suiteId,cases:De.cases.map(ot=>({caseId:ot.caseId,status:ot.status}))}))})))}).catch(()=>{})},[e]);const[z,R]=m.useState(""),[I,X]=m.useState(new Set),[B,xe]=m.useState(""),he=I.size===0,Ee=m.useMemo(()=>{const H=new Set;return b.forEach(ue=>(ue.tags??[]).forEach(fe=>H.add(fe))),Array.from(H).sort()},[b]),be=m.useMemo(()=>b.filter(H=>{const ue=!z||H.name.toLowerCase().includes(z.toLowerCase()),fe=I.size===0||(H.tags??[]).some(ot=>I.has(ot)),De=!B||H.priority===B;return ue&&fe&&De}),[b,z,I,B]),Ae=!!(z||I.size>0||B),[ft,Ft]=m.useState(!1),[rs,He]=m.useState((t==null?void 0:t.name)??""),[Ct,K]=m.useState((t==null?void 0:t.description)??""),[Ke,as]=m.useState((t==null?void 0:t.tags)??[]),[sr,nr]=m.useState(t!=null&&t.timeout?String(t.timeout):""),D=Zy();m.useEffect(()=>{He((t==null?void 0:t.name)??""),K((t==null?void 0:t.description)??""),as((t==null?void 0:t.tags)??[]),nr(t!=null&&t.timeout?String(t.timeout):"")},[t==null?void 0:t.id]);const Z=()=>{const H=sr?parseInt(sr,10):void 0;D.mutate({id:e,data:{name:rs.trim()||(t==null?void 0:t.name),description:Ct,tags:Ke,timeout:H}},{onSuccess:()=>Ft(!1)})},je=H=>{H.key==="Enter"&&(H.preventDefault(),Z()),H.key==="Escape"&&Ft(!1)},As=()=>{r.trim()&&(v.mutate({name:r}),a(""))},Et=H=>{h.mutate({name:`${H.name} (copy)`,description:H.description,priority:H.priority,tags:H.tags,steps:(H.steps??[]).map(ue=>({instruction:ue.instruction}))})},Os=H=>`TC-${((t==null?void 0:t.name)??"TC").replace(/[^a-zA-Z]/g,"").slice(0,3).toUpperCase()||"TC"}-${String(H+1).padStart(3,"0")}`,is=((t==null?void 0:t.type)??"ui")==="api",rr=(t==null?void 0:t.type)==="audit"||(t==null?void 0:t.type)==="performance";return s.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:[s.jsx("div",{className:"flex-1 overflow-y-auto",children:s.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[s.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[s.jsx("div",{className:"px-4 py-1.5 bg-surface-inset/30 border-b border-border/50",children:s.jsxs("nav",{className:"flex items-center gap-1.5 text-[10px] text-content-tertiary",children:[s.jsxs("button",{onClick:c,className:"hover:text-accent transition-colors flex items-center gap-1",children:[s.jsx(wy,{size:10})," Suites"]}),s.jsx(Kt,{size:9}),s.jsx("span",{className:"text-content-secondary font-semibold",children:t==null?void 0:t.name})]})}),ft?s.jsxs("div",{className:"px-4 py-3.5 space-y-2.5",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("div",{className:E("w-7 h-7 rounded-lg flex items-center justify-center flex-shrink-0",is?"bg-gradient-to-br from-violet-500 to-purple-600":"bg-gradient-to-br from-blue-500 to-indigo-600"),children:s.jsx(xl,{size:13,className:"text-white"})}),s.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:rs,onChange:H=>He(H.target.value),onKeyDown:je,placeholder:"Suite name",autoFocus:!0})]}),s.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:Ct,onChange:H=>K(H.target.value),onKeyDown:je,placeholder:"Description"}),s.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(Kr,{size:10,className:"text-content-tertiary"}),s.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:sr,onChange:H=>nr(H.target.value),onKeyDown:je,placeholder:"Timeout ms"})]}),s.jsx("div",{className:"flex-1",children:s.jsx(fl,{tags:Ke,editable:!0,onAdd:H=>as(ue=>[...ue,H]),onRemove:H=>as(ue=>ue.filter(fe=>fe!==H))})}),s.jsxs("div",{className:"flex gap-1.5",children:[s.jsxs(se,{size:"sm",variant:"secondary",onClick:()=>Ft(!1),children:[s.jsx(ye,{size:10})," Cancel"]}),s.jsxs(se,{size:"sm",onClick:Z,loading:D.isPending,children:[s.jsx(ze,{size:10})," Save"]})]})]})]}):s.jsxs("div",{className:"px-4 py-3 flex items-center gap-3 flex-wrap",children:[s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0 flex-1",children:[s.jsx("div",{className:E("w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0 shadow-sm",is?"bg-gradient-to-br from-violet-500 to-purple-600 shadow-violet-500/20":rr?"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:s.jsx(xl,{size:16,className:"text-white"})}),s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("h1",{className:"text-sm font-bold text-content truncate",children:t==null?void 0:t.name}),rr?s.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:[s.jsx(qe,{size:7})," Audit"]}):s.jsx("button",{type:"button",onClick:H=>{H.stopPropagation();const ue=is?"ui":"api";D.mutate({id:e,data:{type:ue}})},title:"Toggle type",className:E("text-[7px] px-1.5 py-px rounded font-bold uppercase ring-1 cursor-pointer transition-colors",is?"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:is?"API":"UI"}),s.jsx("button",{type:"button",onClick:()=>Ft(!0),className:"p-0.5 rounded text-content-tertiary hover:text-accent transition-colors",children:s.jsx(tr,{size:10})})]}),Ct&&s.jsx("p",{className:"text-[10px] text-content-tertiary truncate mt-0.5 leading-tight max-w-md",children:Ct})]})]}),s.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[y?s.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:[s.jsx(ae,{size:11,className:"animate-spin"})," Running…"]}):s.jsxs(se,{size:"sm",onClick:o,className:"bg-teal-600 hover:bg-teal-700 text-white border-teal-600",children:[s.jsx(Dt,{size:10})," Run Suite"]}),s.jsxs(se,{size:"sm",onClick:()=>g(!0),className:"bg-indigo-600 hover:bg-indigo-700 text-white border-indigo-600",children:[s.jsx(Qa,{size:10})," Hooks"]}),s.jsx(pl,{variant:"full",status:(G==null?void 0:G.status)??"not-created",label:"Sync",onClick:T,busy:le.busySuites.get(e)==="create"||le.busySuites.get(e)==="sync"||le.allOp==="create"||le.allOp==="sync"})]})]}),Ee.length>0&&s.jsxs("div",{className:"px-4 py-1.5 border-t border-border/50 flex items-center gap-1.5 flex-wrap",children:[s.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mr-0.5",children:"Tags"}),s.jsx("button",{type:"button",onClick:()=>X(new Set),className:E("text-[9px] px-2 py-0.5 rounded-md font-medium transition-all",he?"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"}),Ee.map(H=>{const ue=I.has(H);return s.jsx("button",{type:"button",onClick:()=>{X(fe=>{const De=new Set(fe);return ue?De.delete(H):De.add(H),De})},className:E("text-[9px] px-2 py-0.5 rounded-md font-medium transition-all",ue||he?"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:H},H)})]}),s.jsxs("div",{className:"px-4 py-2 bg-surface-inset/40 border-t border-border flex items-center gap-2",children:[s.jsxs("div",{className:"relative flex-1 min-w-[120px]",children:[s.jsx(Wn,{size:11,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-content-tertiary pointer-events-none"}),s.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:z,onChange:H=>R(H.target.value)})]}),s.jsxs("select",{value:B,onChange:H=>xe(H.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:[s.jsx("option",{value:"",children:"All Priority"}),ab.map(H=>s.jsx("option",{value:H,className:"capitalize",children:H.charAt(0).toUpperCase()+H.slice(1)},H))]}),Ae&&s.jsx("button",{type:"button",onClick:()=>{R(""),X(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:s.jsx(ye,{size:11})}),s.jsx("div",{className:"w-px h-4 bg-border"}),s.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:r,onChange:H=>a(H.target.value),onKeyDown:H=>H.key==="Enter"&&As()}),s.jsxs(se,{size:"sm",onClick:As,disabled:v.isPending,children:[s.jsx(Rs,{size:10})," Add"]}),s.jsx(se,{size:"sm",variant:"secondary",onClick:()=>k(!0),children:"From Template"}),s.jsx("span",{className:"text-[9px] text-content-tertiary ml-1 tabular-nums flex-shrink-0",children:Ae?`${be.length}/${b.length}`:`${b.length} test${b.length!==1?"s":""}`})]})]}),f?s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsx(ae,{size:18,className:"animate-spin text-accent"})}):b.length===0?s.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:[s.jsx("div",{className:"w-11 h-11 rounded-xl bg-surface-inset flex items-center justify-center",children:s.jsx(Wr,{size:20,className:"text-content-tertiary"})}),s.jsx("p",{className:"text-xs font-medium text-content-secondary",children:"No test cases yet"}),s.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Add your first test case using the toolbar above"})]}):be.length===0?s.jsxs("div",{className:"rounded-xl border border-dashed border-border bg-surface flex flex-col items-center justify-center py-10 gap-2",children:[s.jsx(Ny,{size:16,className:"text-content-tertiary"}),s.jsx("p",{className:"text-xs text-content-tertiary",children:"No tests match filters"}),s.jsx("button",{onClick:()=>{R(""),X(new Set),xe("")},className:"text-[10px] text-accent hover:underline",children:"Clear filters"})]}):s.jsxs("div",{className:"space-y-1.5",children:[be.length>0&&s.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-1",children:[s.jsx("input",{type:"checkbox",className:"rounded border-border text-accent cursor-pointer",checked:P.size===be.length&&be.length>0,onChange:H=>{H.target.checked?$(new Set(be.map(ue=>ue.id))):$(new Set)}}),s.jsx("span",{className:"text-[9px] text-content-tertiary",children:"Select all"})]}),be.map((H,ue)=>{const fe=H.steps.some(Ne=>Ne.stepType==="api"),De=p.get(H.id),ot=G==null?void 0:G.cases.find(Ne=>Ne.caseId===H.id),Xr=(ot==null?void 0:ot.status)??"not-created",Ol=le.busyCases.get(`${e}:${H.id}`)==="create"||le.busyCases.get(`${e}:${H.id}`)==="sync"||le.busySuites.get(e)==="create"||le.busySuites.get(e)==="sync"||le.allOp==="create"||le.allOp==="sync",ln=P.has(H.id),on=V==null?void 0:V.cases.find(Ne=>Ne.caseId===H.id);return s.jsx("div",{className:E("group rounded-xl border bg-surface hover:border-accent/30 hover:shadow-sm hover:shadow-accent/5 cursor-pointer transition-all",ln?"border-accent/40 bg-accent/[0.02]":"border-border"),onClick:()=>i(H.id),children:s.jsxs("div",{className:"px-3.5 py-2.5 flex items-center gap-3",children:[s.jsx("input",{type:"checkbox",className:"rounded border-border text-accent cursor-pointer flex-shrink-0",checked:ln,onClick:Ne=>Ne.stopPropagation(),onChange:Ne=>{Ne.stopPropagation(),$(ar=>{const cn=new Set(ar);return Ne.target.checked?cn.add(H.id):cn.delete(H.id),M.current=ue,cn})},onClickCapture:Ne=>{if(Ne.shiftKey&&M.current>=0){Ne.preventDefault();const ar=Math.min(M.current,ue),cn=Math.max(M.current,ue);$(Zr=>{const ir=new Set(Zr);return be.slice(ar,cn+1).forEach(ai=>ir.add(ai.id)),ir})}M.current=ue}}),s.jsx(Fc,{size:11,className:"text-content-tertiary/40 group-hover:text-content-tertiary cursor-grab flex-shrink-0 transition-colors"}),s.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:Os(ue)}),s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 flex-1",children:[s.jsx("span",{className:"text-xs font-medium text-content truncate",children:H.name}),s.jsx("span",{className:E("text-[7px] px-1 py-px rounded font-bold uppercase flex-shrink-0 ring-1",fe?"bg-violet-50 dark:bg-violet-900/20 text-violet-600 dark:text-violet-400 ring-violet-200 dark:ring-violet-800":rr?"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:fe?"API":rr?"Audit":"UI"}),on&&s.jsx(Z5,{passRate:on.passRate,runs:on.runs,flaky:on.flaky})]}),s.jsxs("span",{className:"text-[9px] text-content-tertiary tabular-nums flex-shrink-0",children:[H.steps.length," step",H.steps.length!==1?"s":""]}),s.jsx("span",{className:E("text-[8px] px-1.5 py-0.5 rounded capitalize ring-1 flex-shrink-0 font-medium",jx[H.priority]??jx.low),children:H.priority}),(H.tags??[]).length>0&&s.jsx("div",{className:"flex-shrink-0",onClick:Ne=>Ne.stopPropagation(),children:s.jsx(fl,{tags:H.tags})}),(()=>{if(!De)return s.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 Ne={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 s.jsx("span",{className:E("text-[8px] px-1.5 py-0.5 rounded capitalize ring-1 flex-shrink-0 font-medium",Ne[De.status]??"ring-border text-content-tertiary"),children:De.status})})(),s.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",onClick:Ne=>Ne.stopPropagation(),children:[s.jsx(Bm,{status:Xr,xrayKey:ot==null?void 0:ot.xrayTestId}),s.jsx(pl,{variant:"icon",status:Xr,onClick:()=>_(H.id),busy:Ol})]}),s.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",onClick:Ne=>Ne.stopPropagation(),children:[d.has(H.id)?s.jsx(ae,{size:11,className:"animate-spin text-teal-600 dark:text-teal-400"}):s.jsx("button",{type:"button",onClick:()=>l(H.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:s.jsx(Dt,{size:11})}),s.jsx("button",{type:"button",disabled:!De,onClick:()=>{De&&window.open(`/allure/${De.allureRunId}`,"_blank")},title:"Report",className:E("p-1 rounded-md transition-colors",De?"text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900/20":"text-content-tertiary/40 cursor-not-allowed"),children:s.jsx(ps,{size:11})}),s.jsx("button",{type:"button",onClick:Ne=>{Ne.stopPropagation(),Et(H)},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:s.jsx(zm,{size:11})}),s.jsx("button",{type:"button",onClick:Ne=>{Ne.stopPropagation(),S(`Delete "${H.name}"?`,()=>w.mutate(H.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:s.jsx(It,{size:10})})]}),s.jsx(Kt,{size:11,className:"text-content-tertiary/40 flex-shrink-0"})]})},H.id)})]})]})}),s.jsx(K5,{suiteId:e,open:u,onClose:()=>g(!1)}),s.jsx(g5,{open:j,onClose:()=>k(!1),suiteId:e,onCreated:()=>{}}),s.jsx(Ts,{...N}),P.size>0&&s.jsx(X5,{selectedIds:P,suiteId:e,suites:n,onClear:()=>$(new Set),onDeleted:()=>$(new Set),onMoved:()=>$(new Set)})]})}function nS({suiteId:e,caseId:t,suiteName:n,suiteType:r,onBack:a,onRunCase:i}){const{runningCaseIds:l,caseLastRun:o}=Wc(),c=l.has(t),d=o.get(t),{data:x,isLoading:p}=j5(e,t),y=N5(e),b=k5(e,t),f=S5(e,t),v=E5(e,t),{modalProps:w,confirmDelete:h}=zs(),u=C5(e,t),g=P5(e,t),j=R5(e,t),{data:k}=tb(e),N=nb(),S=rb(),P=k==null?void 0:k.cases.find(L=>L.caseId===t),$=qm(),M=()=>{((P==null?void 0:P.status)??"not-created")==="not-created"?N.mutate({suiteId:e,caseId:t}):S.mutate({suiteId:e,caseId:t})},[V,G]=m.useState(""),[re,O]=m.useState(!1),[Y,ne]=m.useState(""),[le,T]=m.useState("medium"),[_,z]=m.useState([]),[R,I]=m.useState(""),[X,B]=m.useState("none"),[xe,he]=m.useState(""),[Ee,be]=m.useState(""),[Ae,ft]=m.useState(!1),[Ft,rs]=m.useState(!1),He=m.useRef(null),[Ct,K]=m.useState(!1),[Ke,as]=m.useState(""),[sr,nr]=m.useState(""),D=m.useRef(null),[Z,je]=m.useState(null),[As,Et]=m.useState(null),[Os,is]=m.useState("steps"),[rr,H]=m.useState(!1),[ue,fe]=m.useState([]),[De,ot]=m.useState([]),[Xr,Ol]=m.useState(["performance","accessibility","seo"]),[ln,on]=m.useState(""),[Ne,ar]=m.useState(""),[cn,Zr]=m.useState(!1),[ir,ai]=m.useState([]),[fb,Ym]=m.useState(!1),[gb,Jm]=m.useState(!1),Gc=m.useRef(null);Jr({"recorder:action":L=>{const oe=L;ai(te=>[...te,oe]),setTimeout(()=>{var te;(te=Gc.current)==null||te.scrollTo({top:Gc.current.scrollHeight,behavior:"smooth"})},50)},"recorder:stopped":()=>{Zr(!1)}});const yb=async()=>{try{Ym(!0),ai([]),await Pd.start(),Zr(!0),A.success("Recording started — Shift+Click = assert element, Ctrl+Shift+U = assert URL",{duration:5e3})}catch(L){A.error((L==null?void 0:L.message)||"Failed to start recorder")}finally{Ym(!1)}},bb=async()=>{try{Jm(!0);const L=await Pd.stop();if(Zr(!1),L.actions.length>0){for(const oe of L.actions){const te=_w(oe);await b.mutateAsync({instruction:oe.instruction,generatedCode:te,strategy:"recorder",...oe.soft?{soft:!0}:{}})}A.success(`Added ${L.actions.length} recorded steps with code`)}else A("No actions were recorded")}catch(L){A.error((L==null?void 0:L.message)||"Failed to stop recorder")}finally{Jm(!1)}};m.useEffect(()=>{Pd.status().then(L=>{L.recording&&(Zr(!0),ai(L.actions))}).catch(()=>{})},[]),m.useEffect(()=>{var oe,te;if(!x)return;G(x.name),ne(x.description??""),T(x.priority??"medium"),z([...x.tags]),I(x.timeout?String(x.timeout):"");const L=x.dataSource;L?(B(L.type??"none"),he(L.path??""),be(L.data?JSON.stringify(L.data,null,2):"")):(B("none"),he(""),be("")),fe(((oe=x.caseHooks)==null?void 0:oe.before.map(ce=>({id:ce.id,instruction:ce.instruction})))??[]),ot(((te=x.caseHooks)==null?void 0:te.after.map(ce=>({id:ce.id,instruction:ce.instruction})))??[]),Ol(x.lighthouseCategories??["performance","accessibility","seo"]),rs(!1),K(!1)},[x==null?void 0:x.id]);const ct=()=>{rs(!0),K(!1)},vb=L=>{L.key==="Enter"&&(L.preventDefault(),Dl())},Xm=L=>{const oe=D.current;if(!oe){as(Qc=>Qc+L);return}const te=oe.selectionStart??Ke.length,ce=oe.selectionEnd??Ke.length,Lt=Ke.slice(0,te)+L+Ke.slice(ce);as(Lt),setTimeout(()=>{oe.focus(),oe.setSelectionRange(te+L.length,te+L.length)},0)},Dl=async()=>{const L=R?parseInt(R,10):void 0;let oe;if(X!=="none")if(oe={type:X},X==="inline")try{oe.data=JSON.parse(Ee)}catch{}else oe.path=xe;const te={before:ue.map((ce,Lt)=>({...ce,order:Lt})),after:De.map((ce,Lt)=>({...ce,order:Lt}))};await y.mutateAsync({caseId:t,data:{name:V,description:Y,priority:le,tags:_,timeout:L,dataSource:oe,caseHooks:te,lighthouseCategories:Xr}}),rs(!1),K(!0)},jb=async()=>{Ft&&await Dl(),i()},Zm=()=>{Ke.trim()&&(b.mutate({instruction:Ke}),as(""))},Nb=async L=>{nr(L),await g.mutateAsync(L).finally(()=>nr(""))},eh=x?`TC-${(x.name||"").replace(/[^a-zA-Z]/g,"").slice(0,3).toUpperCase()||"TST"}-001`:"…";if(p||!x)return s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(ae,{size:18,className:"animate-spin text-accent"})});const dn=[...x.steps].sort((L,oe)=>L.order-oe.order),wb=dn.some(L=>L.stepType==="api"),th=r==="audit"||r==="performance";return s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex-shrink-0 bg-surface border-b border-border z-10",children:[s.jsxs("div",{className:"flex items-center gap-1.5 px-5 pt-2 pb-1 text-[10px] text-content-tertiary",children:[s.jsxs("button",{onClick:()=>window.location.assign("/tests"),className:"hover:text-accent flex items-center gap-1",children:[s.jsx(wy,{size:10})," Suites"]}),s.jsx(Kt,{size:9}),s.jsx("button",{onClick:a,className:"hover:text-accent",children:n}),s.jsx(Kt,{size:9}),s.jsx("span",{className:"text-content-secondary font-semibold font-mono",children:eh})]}),s.jsxs("div",{className:"px-5 pb-2.5",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:re?s.jsx("input",{ref:He,className:"flex-1 text-sm font-bold text-content bg-transparent border-b-2 border-accent outline-none p-0 pb-px",value:V,onChange:L=>{G(L.target.value),ct()},onBlur:()=>O(!1),onKeyDown:L=>{L.key==="Enter"&&O(!1),L.key==="Escape"&&(G((x==null?void 0:x.name)??""),O(!1))},autoFocus:!0}):s.jsxs("div",{className:"flex items-center gap-1.5 group min-w-0",children:[s.jsx("h1",{className:"text-sm font-bold text-content truncate",children:V||"Untitled Test Case"}),s.jsx("button",{type:"button",onClick:()=>{O(!0),setTimeout(()=>{var L;return(L=He.current)==null?void 0:L.focus()},0)},className:"p-0.5 rounded text-content-tertiary opacity-0 group-hover:opacity-100 hover:bg-surface-inset transition-all",children:s.jsx(tr,{size:10})})]})}),s.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[s.jsx(pl,{variant:"full",status:(P==null?void 0:P.status)??"not-created",onClick:M,busy:$.busyCases.get(`${e}:${t}`)==="create"||$.busyCases.get(`${e}:${t}`)==="sync"||$.busySuites.get(e)==="create"||$.busySuites.get(e)==="sync"||$.allOp==="create"||$.allOp==="sync"}),s.jsxs(se,{variant:"secondary",size:"sm",onClick:Dl,loading:y.isPending,disabled:!Ft,children:[s.jsx(mx,{size:10})," Save"]}),s.jsxs(se,{size:"sm",onClick:jb,loading:c,disabled:c,children:[!c&&s.jsx(Dt,{size:10})," ",c?"Running…":"Save & Run"]})]})]}),s.jsxs("div",{className:"flex items-center gap-2 mt-1.5 flex-wrap",children:[s.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:eh}),c?s.jsxs("span",{className:"flex items-center gap-1 text-[9px] text-teal-600 dark:text-teal-400 font-medium",children:[s.jsx(ae,{size:9,className:"animate-spin"})," Running"]}):(()=>{if(!d)return s.jsx("span",{className:"text-[8px] px-1.5 py-px rounded ring-1 ring-border text-content-tertiary",children:"Never run"});const L={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 s.jsx("span",{className:E("text-[8px] px-1.5 py-px rounded capitalize ring-1",L[d.status]??"ring-border text-content-tertiary"),children:d.status})})(),s.jsx("button",{type:"button",disabled:!d,onClick:()=>{d&&window.open(`/allure/${d.allureRunId}`,"_blank")},className:E("p-0.5 rounded transition-colors",d?"text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900/20":"text-content-tertiary cursor-not-allowed"),children:s.jsx(ps,{size:11})}),s.jsx(Bm,{status:(P==null?void 0:P.status)??"not-created",xrayKey:P==null?void 0:P.xrayTestId}),s.jsx("div",{className:"w-px h-3.5 bg-border"}),s.jsx("div",{className:"flex items-center gap-1",children:ab.map(L=>s.jsx("button",{type:"button",onClick:()=>{T(L),ct()},className:E("px-1.5 py-px rounded text-[8px] capitalize font-bold transition-all ring-1",le===L?jx[L]:"ring-transparent text-content-tertiary hover:ring-border"),children:L},L))}),s.jsx("div",{className:"w-px h-3.5 bg-border"}),s.jsx(fl,{tags:_,editable:!0,onAdd:L=>{z(oe=>[...oe,L]),ct()},onRemove:L=>{z(oe=>oe.filter(te=>te!==L)),ct()}}),s.jsx("div",{className:"w-px h-3.5 bg-border"}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Kr,{size:9,className:"text-content-tertiary"}),s.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:R,onChange:L=>{I(L.target.value),ct()},onKeyDown:vb}),s.jsx("span",{className:"text-[8px] text-content-tertiary",children:"ms"})]}),s.jsx("div",{className:"w-px h-3.5 bg-border"}),s.jsxs("button",{type:"button",onClick:()=>ft(L=>!L),className:E("flex items-center gap-1 text-[9px] font-medium px-1.5 py-0.5 rounded transition-colors",Ae?"text-accent bg-accent/5":"text-content-tertiary hover:text-content-secondary hover:bg-surface-inset"),children:[s.jsx(Qa,{size:9})," ",Ae?"Less":"More",s.jsx(ht,{size:8,className:E("transition-transform",Ae&&"rotate-180")})]}),Ft&&s.jsx("span",{className:"text-[8px] text-amber-500 dark:text-amber-400 font-bold ml-auto",children:"● Unsaved"}),Ct&&!Ft&&s.jsx("span",{className:"text-[8px] text-emerald-500 dark:text-emerald-400 font-bold ml-auto",children:"✓ Saved"})]})]}),Ae&&s.jsxs("div",{className:"px-5 pb-3 pt-1 border-t border-border bg-surface-inset/30 animate-fade-in",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:"Description"}),s.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:Y,onChange:L=>{ne(L.target.value),ct()},onKeyDown:L=>{L.key==="Enter"&&!L.shiftKey&&(L.preventDefault(),Dl())}})]}),s.jsx("div",{children:s.jsx(rS,{type:X,filePath:xe,inlineData:Ee,onTypeChange:L=>{B(L),ct()},onFilePathChange:L=>{he(L),ct()},onInlineChange:L=>{be(L),ct()}})})]}),th&&s.jsxs("div",{className:"mt-3 pt-3 border-t border-border/50",children:[s.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-2 flex items-center gap-1.5",children:[s.jsx(qe,{size:9,className:"text-amber-500 dark:text-amber-400"})," Non-Functional Checks (Lighthouse)"]}),s.jsxs("div",{className:"flex items-center gap-4",children:[["performance","accessibility","seo"].map(L=>{const oe={performance:"⚡ Performance",accessibility:"♿ Accessibility",seo:"🔍 SEO"},te=Xr.includes(L);return s.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",checked:te,onChange:()=>{Ol(ce=>te?ce.filter(Lt=>Lt!==L):[...ce,L]),ct()},className:"w-3 h-3 rounded accent-amber-600 cursor-pointer"}),s.jsx("span",{className:"text-[10px] text-content-secondary",children:oe[L]})]},L)}),Xr.length===0&&s.jsx("span",{className:"text-[9px] text-amber-600",children:"⚠ No checks selected — Lighthouse will be skipped"})]})]})]})]}),s.jsxs("div",{className:"flex-shrink-0 flex items-center gap-1 px-5 pt-2 pb-0 border-b border-border bg-surface",children:[s.jsx("button",{type:"button",onClick:()=>is("steps"),className:E("px-3 py-1.5 text-xs font-semibold rounded-t-lg transition-colors border-b-2",Os==="steps"?"border-accent text-accent":"border-transparent text-content-tertiary hover:text-content-secondary"),children:"Steps"}),s.jsxs("button",{type:"button",onClick:()=>is("hooks"),className:E("px-3 py-1.5 text-xs font-semibold rounded-t-lg transition-colors border-b-2",Os==="hooks"?"border-accent text-accent":"border-transparent text-content-tertiary hover:text-content-secondary"),children:["Hooks",ue.length+De.length>0&&s.jsx("span",{className:"ml-1 text-[9px] bg-accent/10 text-accent rounded px-1",children:ue.length+De.length})]}),s.jsx("div",{className:"flex-1"}),s.jsxs("button",{type:"button",onClick:()=>H(!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:[s.jsx(ul,{size:11})," Library"]})]}),s.jsx("div",{className:"flex-1 overflow-y-auto bg-surface-inset/20",children:s.jsxs("div",{className:"max-w-4xl mx-auto px-5 py-3",children:[Os==="hooks"&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[s.jsxs("div",{className:"px-4 py-2 border-b border-border bg-surface-inset/30",children:[s.jsx("h3",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest",children:"Before Hooks"}),s.jsx("p",{className:"text-[9px] text-content-tertiary mt-0.5",children:"Run before all steps"})]}),s.jsxs("div",{className:"p-3 space-y-1.5",children:[ue.map((L,oe)=>s.jsxs("div",{className:"flex items-center gap-2 text-xs bg-surface-inset/50 rounded-lg px-3 py-2 border border-border",children:[s.jsx("span",{className:"text-content-tertiary font-mono text-[9px] w-4",children:oe+1}),s.jsx("span",{className:"flex-1 text-content-secondary",children:L.instruction}),s.jsx("button",{type:"button",onClick:()=>{fe(te=>te.filter((ce,Lt)=>Lt!==oe)),ct()},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:s.jsx(ye,{size:11})})]},L.id)),s.jsxs("div",{className:"flex gap-2 mt-2",children:[s.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:ln,onChange:L=>on(L.target.value),onKeyDown:L=>{L.key==="Enter"&&ln.trim()&&(fe(oe=>[...oe,{id:crypto.randomUUID(),instruction:ln.trim()}]),on(""),ct())}}),s.jsxs(se,{size:"sm",onClick:()=>{ln.trim()&&(fe(L=>[...L,{id:crypto.randomUUID(),instruction:ln.trim()}]),on(""),ct())},children:[s.jsx(Rs,{size:11})," Add"]})]})]})]}),s.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[s.jsxs("div",{className:"px-4 py-2 border-b border-border bg-surface-inset/30",children:[s.jsx("h3",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest",children:"After Hooks"}),s.jsx("p",{className:"text-[9px] text-content-tertiary mt-0.5",children:"Run after all steps (always)"})]}),s.jsxs("div",{className:"p-3 space-y-1.5",children:[De.map((L,oe)=>s.jsxs("div",{className:"flex items-center gap-2 text-xs bg-surface-inset/50 rounded-lg px-3 py-2 border border-border",children:[s.jsx("span",{className:"text-content-tertiary font-mono text-[9px] w-4",children:oe+1}),s.jsx("span",{className:"flex-1 text-content-secondary",children:L.instruction}),s.jsx("button",{type:"button",onClick:()=>{ot(te=>te.filter((ce,Lt)=>Lt!==oe)),ct()},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:s.jsx(ye,{size:11})})]},L.id)),s.jsxs("div",{className:"flex gap-2 mt-2",children:[s.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:Ne,onChange:L=>ar(L.target.value),onKeyDown:L=>{L.key==="Enter"&&Ne.trim()&&(ot(oe=>[...oe,{id:crypto.randomUUID(),instruction:Ne.trim()}]),ar(""),ct())}}),s.jsxs(se,{size:"sm",onClick:()=>{Ne.trim()&&(ot(L=>[...L,{id:crypto.randomUUID(),instruction:Ne.trim()}]),ar(""),ct())},children:[s.jsx(Rs,{size:11})," Add"]})]})]})]})]}),Os==="steps"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex gap-2 mb-3",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(qe,{size:12,className:"absolute left-3 top-1/2 -translate-y-1/2 text-accent/50 pointer-events-none"}),s.jsx("input",{ref:D,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:Ke,onChange:L=>as(L.target.value),onKeyDown:L=>L.key==="Enter"&&Zm()})]}),s.jsx(G5,{onInsert:Xm}),r!=="api"&&s.jsx(J5,{onInsert:Xm}),s.jsxs(se,{size:"sm",onClick:Zm,disabled:b.isPending,className:"border border-transparent",children:[s.jsx(Rs,{size:11})," Add Step"]}),r!=="api"&&(cn?s.jsxs(se,{size:"sm",loading:gb,onClick:bb,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:[s.jsx(Ey,{size:10,className:"fill-current"})," Stop Recording"]}):s.jsxs(se,{size:"sm",loading:fb,onClick:yb,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:[s.jsx(hy,{size:10,className:"fill-current"})," Record"]})),s.jsxs(se,{size:"sm",loading:j.isPending,onClick:()=>j.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:[s.jsx(Ur,{size:11})," Generate All"]})]}),r!=="api"&&cn&&ir.length>0&&s.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:[s.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:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"relative flex h-2 w-2",children:[s.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-red-400 opacity-75"}),s.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-red-500"})]}),s.jsxs("span",{className:"text-[11px] font-semibold text-red-700 dark:text-red-300",children:["Recording — ",ir.length," action",ir.length!==1?"s":""," captured"]})]}),s.jsx("span",{className:"text-[10px] text-red-500 dark:text-red-400",children:"Interact with the browser to record steps"})]}),s.jsx("div",{ref:Gc,className:"max-h-40 overflow-y-auto px-3 py-2 space-y-1",children:ir.map((L,oe)=>s.jsxs("div",{className:"flex items-start gap-2 text-[11px]",children:[s.jsx("span",{className:E("flex-shrink-0 w-5 h-5 rounded-full flex items-center justify-center font-mono font-bold text-[9px]",L.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:oe+1}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[L.action==="assert"&&s.jsx(ze,{size:10,className:"text-emerald-500 flex-shrink-0"}),s.jsx("span",{className:E("text-content-secondary",L.action==="assert"&&"text-emerald-700 dark:text-emerald-300 font-medium"),children:L.instruction})]})]},L.id))})]}),s.jsx("div",{className:"space-y-1.5",children:dn.length===0?s.jsxs("div",{className:"border border-dashed border-border rounded-xl py-10 text-center bg-surface",children:[s.jsx(qe,{size:20,className:"mx-auto text-content-tertiary/40 mb-2"}),s.jsx("p",{className:"text-xs text-content-tertiary",children:"No steps yet — type an instruction above and press Enter"}),s.jsxs("p",{className:"text-[10px] text-content-tertiary mt-1",children:["Or click ",s.jsx("span",{className:"font-semibold",children:"Generate All"})," to let AI write all steps"]})]}):dn.map((L,oe)=>s.jsx(aS,{step:L,index:oe,suiteId:e,caseId:t,caseIsApi:wb,suiteIsAudit:th,generating:sr===L.id,isDragging:Z===L.id,isDragOver:As===L.id,onDragStart:()=>je(L.id),onDragOver:()=>Et(L.id),onDrop:()=>{if(!Z||Z===L.id){je(null),Et(null);return}const te=dn.map(Qc=>Qc.id),ce=te.indexOf(Z),Lt=te.indexOf(L.id);te.splice(ce,1),te.splice(Lt,0,Z),u.mutate(te),je(null),Et(null)},onDragEnd:()=>{je(null),Et(null)},onDelete:te=>h("Delete this step?",()=>v.mutate(te)),onGenerate:te=>void Nb(te),onSaveInstruction:(te,ce)=>f.mutate({stepId:te,instruction:ce}),onSaveTimeout:(te,ce)=>f.mutate({stepId:te,timeout:ce}),onSaveRetries:(te,ce)=>f.mutate({stepId:te,retries:ce??void 0}),onSaveStepType:(te,ce)=>f.mutate({stepId:te,stepType:ce}),onSaveMockUrl:(te,ce)=>f.mutate({stepId:te,mockUrl:ce}),onSaveMockResponse:(te,ce)=>f.mutate({stepId:te,mockResponse:ce}),onSaveMockStatus:(te,ce)=>f.mutate({stepId:te,mockStatus:ce}),onSaveRunAudit:(te,ce)=>f.mutate({stepId:te,runAudit:ce},{onSuccess:()=>A.success(ce?"⚡ Audit checkpoint set":"Audit checkpoint removed")}),onSaveSoft:(te,ce)=>f.mutate({stepId:te,soft:ce},{onSuccess:()=>A.success(ce?"Soft assertion — test continues on failure":"Hard assertion — test stops on failure")}),onSaveVisualCheck:(te,ce)=>f.mutate({stepId:te,visualCheck:ce},{onSuccess:()=>A.success(ce?"👁 Visual regression enabled for this step":"Visual regression disabled for this step")})},L.id))}),dn.length>0&&s.jsxs("p",{className:"text-[9px] text-content-tertiary text-center mt-3",children:[dn.length," step",dn.length!==1?"s":""," · ",dn.filter(L=>{var oe;return!!((oe=L.generatedCode)!=null&&oe.trim())}).length," with code"]})]})]})}),s.jsx(Ts,{...w}),s.jsx(eS,{open:rr,onClose:()=>H(!1),suiteId:e,caseId:t,onInserted:()=>H(!1)})]})}function rS({type:e,filePath:t,inlineData:n,onTypeChange:r,onFilePathChange:a,onInlineChange:i}){const[l,o]=m.useState([]),[c,d]=m.useState([]),[x,p]=m.useState(!1),[y,b]=m.useState(""),[f,v]=m.useState(!1),w=m.useRef(null);m.useEffect(()=>{sa.list().then(o).catch(()=>{})},[]),m.useEffect(()=>{if((e==="json-file"||e==="csv-file")&&t){const j=t.replace(/^data\//,"");sa.get(j).then(k=>{d(k.rows),b(k.raw)}).catch(()=>d([]))}else if(e==="inline"&&n)try{d(JSON.parse(n))}catch{d([])}else d([])},[e,t,n]);const h=async j=>{var N;const k=(N=j.target.files)==null?void 0:N[0];if(k){v(!0);try{const S=await k.text(),P=await sa.upload(k.name,S);a(P.path),r(k.name.endsWith(".csv")?"csv-file":"json-file");const $=await sa.list();o($),A.success(`Uploaded ${k.name} (${P.rowCount} rows)`)}catch(S){A.error(S instanceof Error?S.message:"Upload failed")}finally{v(!1),j.target.value=""}}},u=async()=>{if((e==="json-file"||e==="csv-file")&&t){const j=t.replace(/^data\//,"");try{await sa.update(j,y);const k=await sa.get(j);d(k.rows),p(!1),A.success("Data file saved")}catch(k){A.error(k instanceof Error?k.message:"Save failed")}}else if(e==="inline"){i(y);try{d(JSON.parse(y))}catch{d([])}p(!1)}},g=c.length>0?Object.keys(c[0]):[];return s.jsxs("div",{children:[s.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1.5 flex items-center gap-1",children:[s.jsx(py,{size:9})," Data-Driven"]}),s.jsxs("div",{className:"flex items-center gap-1.5 mb-2 flex-wrap",children:[["none","inline","json-file","csv-file"].map(j=>s.jsx("button",{type:"button",onClick:()=>r(j),className:E("px-2 py-0.5 rounded-md text-[9px] font-semibold transition-all ring-1",e===j?"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:j==="none"?"Off":j==="inline"?"Inline":j==="json-file"?"JSON":"CSV"},j)),(e==="json-file"||e==="csv-file")&&s.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:t,onChange:j=>a(j.target.value),children:[s.jsx("option",{value:"",children:"Select file…"}),l.filter(j=>e==="csv-file"?j.type==="csv":j.type==="json").map(j=>s.jsx("option",{value:j.path,children:j.name},j.name))]}),e!=="none"&&s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",onClick:()=>{var j;return(j=w.current)==null?void 0:j.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:[f?s.jsx(ae,{size:9,className:"animate-spin"}):s.jsx(Uc,{size:9})," Upload"]}),s.jsx("input",{ref:w,type:"file",accept:".json,.csv",onChange:h,className:"hidden"})]})]}),e==="inline"&&!x&&s.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:n,onChange:j=>i(j.target.value)}),e!=="none"&&c.length>0&&!x&&s.jsxs("div",{className:"mb-2",children:[s.jsxs("div",{className:"flex items-center justify-between mb-1",children:[s.jsxs("span",{className:"text-[9px] text-content-tertiary",children:[c.length," row",c.length!==1?"s":""]}),s.jsxs("button",{type:"button",onClick:()=>{e==="inline"&&b(n),p(!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:[s.jsx(tr,{size:8})," Edit"]})]}),s.jsx("div",{className:"overflow-x-auto border border-border rounded-lg",children:s.jsxs("table",{className:"w-full text-[10px]",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-surface-inset border-b border-border",children:[s.jsx("th",{className:"px-2 py-1 text-left font-bold text-content-tertiary w-6",children:"#"}),g.map(j=>s.jsx("th",{className:"px-2 py-1 text-left font-bold text-violet-600 dark:text-violet-400",children:`{{${j}}}`},j))]})}),s.jsxs("tbody",{children:[c.slice(0,8).map((j,k)=>s.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-surface-inset/50",children:[s.jsx("td",{className:"px-2 py-0.5 text-content-tertiary tabular-nums",children:k+1}),g.map(N=>s.jsx("td",{className:"px-2 py-0.5 text-content-secondary font-mono",children:j[N]},N))]},k)),c.length>8&&s.jsx("tr",{children:s.jsxs("td",{colSpan:g.length+1,className:"px-2 py-1 text-center text-content-tertiary text-[9px] italic",children:["+",c.length-8," more"]})})]})]})})]}),x&&s.jsxs("div",{className:"mb-2",children:[s.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:y,onChange:j=>b(j.target.value)}),s.jsxs("div",{className:"flex items-center gap-1.5 mt-1.5",children:[s.jsxs("button",{type:"button",onClick:u,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:[s.jsx(ze,{size:10})," Save"]}),s.jsxs("button",{type:"button",onClick:()=>p(!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:[s.jsx(ye,{size:10})," Cancel"]})]})]})]})}function aS({step:e,index:t,caseIsApi:n,suiteIsAudit:r,generating:a,isDragging:i,isDragOver:l,onDragStart:o,onDragOver:c,onDrop:d,onDragEnd:x,onDelete:p,onGenerate:y,onSaveInstruction:b,onSaveTimeout:f,onSaveRetries:v,onSaveStepType:w,onSaveMockUrl:h,onSaveMockResponse:u,onSaveMockStatus:g,onSaveRunAudit:j,onSaveSoft:k,onSaveVisualCheck:N}){var Ct;const[S,P]=m.useState(!1),[$,M]=m.useState(!1),[V,G]=m.useState(e.instruction),[re,O]=m.useState(e.timeout?String(e.timeout):""),[Y,ne]=m.useState(e.retries!=null?String(e.retries):""),[le,T]=m.useState(e.mockUrl??""),[_,z]=m.useState(e.mockResponse??""),[R,I]=m.useState(e.mockStatus?String(e.mockStatus):"200"),X=m.useRef(null),[B,xe]=m.useState(void 0),he=!!((Ct=e.generatedCode)!=null&&Ct.trim()),Ee=e.stepType==="mock",be=!!e.runAudit,Ae=B!==void 0?B:be,ft=B!==void 0&&B!==be,Ft=()=>{B!==void 0&&(j==null||j(e.id,B),xe(void 0))},rs=()=>xe(void 0);m.useEffect(()=>{Ee&&P(!0)},[Ee]),m.useEffect(()=>{O(e.timeout?String(e.timeout):"")},[e.timeout]),m.useEffect(()=>{G(e.instruction)},[e.instruction]),m.useEffect(()=>{var K;$&&((K=X.current)==null||K.focus())},[$]);const He=()=>{const K=V.trim();K&&K!==e.instruction&&b(e.id,K),M(!1)};return s.jsxs("div",{draggable:!0,onDragStart:K=>{K.dataTransfer.effectAllowed="move",o()},onDragOver:K=>{K.preventDefault(),c()},onDrop:K=>{K.preventDefault(),d()},onDragEnd:x,className:E("rounded-lg overflow-hidden transition-all",i?"opacity-40 ring-2 ring-accent":"ring-1 ring-border",l?"ring-2 ring-accent shadow-sm":""),children:[s.jsxs("div",{className:"flex items-start gap-2 px-3 py-2",children:[s.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 pt-0.5",children:[s.jsx(Fc,{size:11,className:"text-content-tertiary hover:text-content-secondary cursor-grab active:cursor-grabbing"}),s.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:t+1})]}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-start gap-1.5 flex-wrap",children:[$?s.jsx("input",{ref:X,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:V,onChange:K=>G(K.target.value),onKeyDown:K=>{K.key==="Enter"&&(K.preventDefault(),He()),K.key==="Escape"&&(G(e.instruction),M(!1))},onBlur:He}):s.jsx("span",{className:"text-xs text-content font-medium flex-1",children:e.instruction}),s.jsx("span",{className:E("text-[8px] px-1 py-px rounded font-bold uppercase flex-shrink-0 ring-1",Ee?"bg-purple-50 dark:bg-purple-900/20 text-purple-600 dark:text-purple-400 ring-purple-200 dark:ring-purple-800":e.stepType==="api"||n?"bg-violet-50 dark:bg-violet-900/20 text-violet-600 dark:text-violet-400 ring-violet-200 dark:ring-violet-800":r?"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:Ee?"Mock":e.stepType==="api"||n?"API":r?"Audit":"UI"}),Ae&&s.jsxs("span",{className:E("text-[8px] px-1 py-px rounded font-bold flex items-center gap-0.5 ring-1",ft?"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:[s.jsx(qe,{size:7}),ft?"Audit*":"Audit"]}),e.lastHealed&&s.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"})]}),he&&!$&&s.jsx("p",{className:"text-[10px] text-content-tertiary mt-px",children:"Code generated ✓"})]}),s.jsxs("select",{value:e.stepType??"ui",onChange:K=>{K.target.value==="mock"&&P(!0),w==null||w(e.id,K.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:[s.jsx("option",{value:"ui",children:"UI"}),s.jsx("option",{value:"api",children:"API"}),s.jsx("option",{value:"mock",children:"Mock"})]}),s.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:Y,onChange:K=>ne(K.target.value),onBlur:()=>{const K=Y.trim()?parseInt(Y,10):null,Ke=e.retries??null;K!==Ke&&(v==null||v(e.id,K!=null&&K>=0?K:null))},onKeyDown:K=>{K.key==="Enter"&&K.target.blur()}}),s.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:re,onChange:K=>O(K.target.value),onBlur:()=>{const K=re.trim()?parseInt(re,10):null,Ke=e.timeout??null;K!==Ke&&f(e.id,K&&K>0?K:null)},onKeyDown:K=>{K.key==="Enter"&&K.target.blur()}}),s.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",children:[$?s.jsx("button",{type:"button",onClick:He,className:"p-1 rounded-md text-emerald-500 hover:bg-emerald-50 dark:hover:bg-emerald-900/20 transition-colors",children:s.jsx(ze,{size:12})}):s.jsx("button",{type:"button",onClick:()=>M(!0),className:"p-1 rounded-md text-content-tertiary hover:text-accent hover:bg-accent/5 transition-colors",children:s.jsx(tr,{size:11})}),r&&!n&&e.stepType!=="api"&&e.stepType!=="mock"&&s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",title:Ae?"Remove Lighthouse audit checkpoint":"Mark as Lighthouse audit checkpoint",onClick:K=>{K.stopPropagation(),xe(!Ae)},onMouseDown:K=>K.stopPropagation(),className:E("flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[9px] font-bold transition-all cursor-pointer select-none",Ae?"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:[s.jsx(qe,{size:9}),s.jsx("span",{children:"Audit"})]}),ft&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",title:"Save audit change",onClick:K=>{K.stopPropagation(),Ft()},onMouseDown:K=>K.stopPropagation(),className:"p-1 rounded-md text-emerald-600 hover:bg-emerald-50 dark:hover:bg-emerald-900/20 transition-colors",children:s.jsx(ze,{size:11})}),s.jsx("button",{type:"button",title:"Cancel",onClick:K=>{K.stopPropagation(),rs()},onMouseDown:K=>K.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:s.jsx(ye,{size:11})})]})]}),/^(?:soft\s+)?(?:verify|check|assert|ensure|confirm)\b/i.test(e.instruction)&&s.jsx("button",{type:"button",title:e.soft?"Soft assertion (test continues on failure) — click to make hard":"Hard assertion (test stops on failure) — click to make soft",onClick:K=>{K.stopPropagation(),k==null||k(e.id,!e.soft)},onMouseDown:K=>K.stopPropagation(),className:E("flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[9px] font-bold transition-all cursor-pointer select-none",e.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:s.jsx("span",{children:e.soft?"Soft":"Hard"})}),e.stepType!=="api"&&s.jsx("button",{type:"button",title:e.visualCheck?"Visual regression enabled — click to disable":"Enable visual regression for this step",onClick:K=>{K.stopPropagation(),N==null||N(e.id,!e.visualCheck)},onMouseDown:K=>K.stopPropagation(),className:E("flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[9px] font-bold transition-all cursor-pointer select-none",e.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:s.jsx(Ml,{size:12})}),s.jsx("button",{type:"button",onClick:()=>y(e.id),disabled:a,className:"p-1 rounded-md text-content-tertiary hover:text-accent hover:bg-accent/5 transition-colors disabled:opacity-40",children:a?s.jsx(ae,{size:12,className:"animate-spin"}):s.jsx(Ur,{size:12})}),s.jsx("button",{type:"button",onClick:()=>p(e.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:s.jsx(It,{size:11})}),s.jsx("button",{type:"button",onClick:()=>P(K=>!K),className:"p-1 rounded-md text-content-tertiary hover:text-content-secondary hover:bg-surface-inset transition-colors",children:S?s.jsx(ht,{size:12}):s.jsx(Kt,{size:12})})]})]}),S&&s.jsxs("div",{className:"border-t border-border",children:[Ee&&s.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:[s.jsx("p",{className:"text-[9px] font-bold text-violet-600 dark:text-violet-400 uppercase tracking-widest",children:"Mock Route"}),s.jsxs("div",{className:"flex gap-2 items-center",children:[s.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:le,onChange:K=>T(K.target.value),onBlur:()=>{le!==(e.mockUrl??"")&&(h==null||h(e.id,le))}}),s.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:R,onChange:K=>I(K.target.value),onBlur:()=>{const K=parseInt(R,10);!isNaN(K)&&K!==(e.mockStatus??200)&&(g==null||g(e.id,K))}})]}),s.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:_,onChange:K=>z(K.target.value),onBlur:()=>{_!==(e.mockResponse??"")&&(u==null||u(e.id,_))}})]}),he?s.jsx(Um,{code:e.generatedCode,maxLines:12,className:"rounded-none"}):s.jsxs("div",{className:"px-3 py-2.5 text-[10px] text-content-tertiary italic bg-surface-inset/30",children:["No code yet — click ",s.jsx(Ur,{size:9,className:"inline mb-0.5"})," to generate"]})]})]})}let Gt=null,Ni=!1;const Nx=new Set;function wi(){Nx.forEach(e=>e())}const hs={subscribe(e){return Nx.add(e),()=>{Nx.delete(e)}},getSnapshot(){return{job:Gt,showPopup:Ni}},start(e,t){const n=`gen-${Date.now()}`;return Gt={id:n,tab:e,label:t,status:"running",startedAt:Date.now()},Ni=!1,wi(),n},done(e,t){Gt&&(Gt={...Gt,status:"done",suiteId:e,suiteName:t},Ni=!0,wi())},error(e){Gt&&(Gt={...Gt,status:"error",error:e},wi())},dismissPopup(){Ni=!1,wi()},clear(){Gt=null,Ni=!1,wi()},isRunning(){return(Gt==null?void 0:Gt.status)==="running"}};function ib(){const[e,t]=m.useState(()=>hs.getSnapshot());return m.useEffect(()=>hs.subscribe(()=>t(hs.getSnapshot())),[]),e}const iS=[{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."}],lS=/^(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 Yp(e){return e.trim()?lS.test(e.trim()):!0}function Jp(e){const t=e.trim();if(!t)return null;const n=t.match(/([A-Z][A-Z0-9_]+-\d+)/i);return n?n[1].toUpperCase():null}function oS(e){const t=e.trim();if(!t)return[];if(t.startsWith("["))try{const i=JSON.parse(t).map(l=>{if(typeof l=="string")return{story:l.trim()};if(typeof l=="object"&&l!==null&&"story"in l){const o=l;return{story:String(o.story).trim(),suiteName:o.suiteName,jiraUrl:o.jiraUrl}}return null}).filter(l=>l!==null&&l.story.length>=10);if(i.length>0)return i}catch{}const n=t.split(/\n\s*---+\s*\n/).map(a=>a.trim()).filter(Boolean);if(n.length>1)return n.map(a=>a.replace(/^\d+\.\s*/,"").trim()).filter(a=>a.length>=10).map(a=>({story:a}));const r=t.split(`
900
+ `).filter(a=>/^\d+[\.\)]\s/.test(a.trim()));return r.length>1?r.map(a=>a.replace(/^\d+[\.\)]\s*/,"").trim()).filter(a=>a.length>=10).map(a=>({story:a})):t.length>=10?[{story:t}]:[]}function Wd({icon:e,title:t,desc:n,tag:r,active:a,gradient:i,onClick:l}){return s.jsxs("button",{type:"button",onClick:l,className:E("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",a?"border-accent bg-accent/[0.04] shadow-sm":"border-transparent bg-surface hover:bg-surface-inset/50 hover:border-border"),children:[a&&s.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"}),s.jsx("div",{className:E("w-5 h-5 rounded flex items-center justify-center transition-all flex-shrink-0",a?i:"bg-surface-inset"),children:s.jsx(e,{size:14,className:a?"text-white":"text-content-tertiary",strokeWidth:1.8})}),s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:E("text-xs font-semibold transition-colors",a?"text-content":"text-content-secondary"),children:t}),r&&s.jsx("span",{className:E("text-[8px] font-bold uppercase tracking-wider px-1 py-px rounded",a?"bg-accent/10 text-accent":"bg-surface-inset text-content-tertiary"),children:r})]}),s.jsx("p",{className:"text-[10px] text-content-tertiary mt-px leading-snug truncate",children:n})]})]})}function Xp({title:e,icon:t,children:n,defaultOpen:r=!1}){const[a,i]=m.useState(r);return s.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[s.jsxs("button",{type:"button",onClick:()=>i(l=>!l),className:"w-full flex items-center justify-between px-4 py-3 bg-surface-inset/50 hover:bg-surface-inset transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(t,{size:13,className:"text-content-tertiary"}),s.jsx("span",{className:"text-xs font-semibold text-content-secondary",children:e})]}),s.jsx(ht,{size:13,className:E("text-content-tertiary transition-transform duration-200",a&&"rotate-180")})]}),a&&s.jsx("div",{className:"px-4 py-3 border-t border-border bg-surface",children:n})]})}function cS({content:e,onClose:t}){const[n,r]=m.useState(!1);return s.jsxs("div",{className:E("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:[s.jsxs("div",{className:"px-3 pt-3 pb-1.5 space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.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:[s.jsx(ni,{size:11})," ",e.issueKey]}),s.jsx("span",{className:"px-2 py-0.5 rounded-md bg-surface-inset text-content-secondary text-[10px] font-semibold border border-border",children:e.issueType}),s.jsx("span",{className:"px-2 py-0.5 rounded-md bg-surface-inset text-content-secondary text-[10px] font-semibold border border-border",children:e.status}),s.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:e.priority})]}),s.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[s.jsx("button",{type:"button",onClick:()=>r(a=>!a),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:n?"Less":"More"}),s.jsx("button",{type:"button",onClick:t,className:"p-1 rounded-md text-content-tertiary hover:text-content-secondary hover:bg-surface-inset transition-colors",children:s.jsx(ye,{size:13})})]})]}),s.jsx("p",{className:"font-semibold text-content text-xs leading-relaxed",children:e.summary})]}),s.jsxs("div",{className:E("px-3 pb-3 space-y-1.5",n?"overflow-y-auto max-h-[200px]":""),children:[e.description&&s.jsxs("div",{children:[s.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:"Description"}),s.jsx("p",{className:E("text-xs text-content-secondary leading-relaxed whitespace-pre-wrap",!n&&"line-clamp-3"),children:e.description})]}),e.acceptanceCriteria&&n&&s.jsxs("div",{children:[s.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:"Acceptance Criteria"}),s.jsx("p",{className:"text-xs text-content-secondary leading-relaxed whitespace-pre-wrap",children:e.acceptanceCriteria})]}),e.comments.length>0&&n&&s.jsxs("div",{children:[s.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:["Comments (",e.comments.length,")"]}),e.comments.map((a,i)=>s.jsx("p",{className:"text-xs text-content-secondary italic mt-1 whitespace-pre-wrap",children:a},i))]}),e.labels.length>0&&s.jsx("div",{className:"flex items-center gap-1 flex-wrap pt-1",children:e.labels.map(a=>s.jsx("span",{className:"px-2 py-0.5 rounded-full bg-surface-inset text-content-tertiary text-[9px] font-medium border border-border",children:a},a))})]})]})}function dS({pct:e,size:t=64,stroke:n=5}){const r=(t-n)/2,a=2*Math.PI*r,i=a-e/100*a;return s.jsxs("svg",{width:t,height:t,className:"-rotate-90",children:[s.jsx("circle",{cx:t/2,cy:t/2,r,fill:"none",stroke:"currentColor",strokeWidth:n,className:"text-surface-inset"}),s.jsx("circle",{cx:t/2,cy:t/2,r,fill:"none",stroke:"url(#prog-grad)",strokeWidth:n,strokeLinecap:"round",strokeDasharray:a,strokeDashoffset:i,className:"transition-all duration-700 ease-out"}),s.jsx("defs",{children:s.jsxs("linearGradient",{id:"prog-grad",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[s.jsx("stop",{offset:"0%",stopColor:"var(--color-accent)"}),s.jsx("stop",{offset:"100%",stopColor:"var(--color-accent-light, #818cf8)"})]})})]})}const uS={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"},xS=[{icon:Sy,label:"--- separator",example:`Story one
901
+ ---
902
+ Story two`},{icon:rw,label:"Numbered",example:`1. Story one
903
+ 2. Story two`},{icon:_2,label:"JSON",example:'[{"story":"…","suiteName":"Auth"}]'},{icon:Ps,label:"CSV Upload",example:`story,suiteName
904
+ "Story","Auth"`}];function mS(){const[e,t]=m.useState("single"),n=Ms(),[r,a]=m.useState(""),[i,l]=m.useState(""),[,o]=m.useState(!1),[c,d]=m.useState(""),[x,p]=m.useState(null),[y,b]=m.useState(!0),[f,v]=m.useState(""),[w,h]=m.useState(3),[u,g]=m.useState([]),[j,k]=m.useState(null),[N,S]=m.useState(null),[P,$]=m.useState(null),[M,V]=m.useState(""),[G,re]=m.useState([]),O=m.useRef(null);m.useEffect(()=>{const D=oS(f),Z=G.map(je=>({story:[je.summary,je.description,je.acceptanceCriteria].filter(Boolean).join(`
905
+ `),suiteName:je.summary,jiraUrl:je.issueKey}));g([...Z,...D])},[f,G]);const[Y,ne]=m.useState(""),[le,T]=m.useState(""),[_,z]=m.useState(""),[R,I]=m.useState(null),[X,B]=m.useState(""),xe=W({mutationFn:D=>ta.fetchJira(D),onSuccess:D=>{p(D),b(!0),A.success(`Fetched ${D.issueKey}: ${D.summary}`)},onError:D=>{p(null),A.error(D.message)}}),he=W({mutationFn:D=>ta.fetchJira(D),onSuccess:D=>{if(G.some(Z=>Z.issueKey===D.issueKey)){A.error(`${D.issueKey} already added`);return}re(Z=>[...Z,D]),V(""),A.success(`Added ${D.issueKey}`)},onError:D=>{A.error(D.message)}}),Ee=W({mutationFn:()=>(hs.start("single",i||"Test Suite"),ta.generate(r,i||void 0,c||void 0)),onSuccess:D=>{o(!0),hs.done(D.suiteId,D.suiteName)},onError:D=>{hs.error(D.message),A.error(D.message)}}),be=W({mutationFn:()=>ta.generateBulk(u,w),onSuccess:D=>A.success(`Processing ${D.total} stories…`),onError:D=>A.error(D.message)}),Ae=W({mutationFn:()=>ta.swaggerPreview(Y),onSuccess:D=>{I(D),T(D.title?`${D.title} API Tests`:""),A.success(`Found ${D.totalEndpoints} endpoints`)},onError:D=>{I(null),A.error(D.message)}}),ft=W({mutationFn:()=>{hs.start("swagger",le||"API Tests");const D=_.trim()?_.split(",").map(Z=>Z.trim()).filter(Boolean):void 0;return ta.generateFromSwagger(Y,le||void 0,D,X)},onSuccess:D=>{hs.done(D.suiteId,D.suiteName),A.success(`Generated ${D.endpointsFound} endpoint tests`)},onError:D=>{hs.error(D.message),A.error(D.message)}});Id("story:bulk-start",D=>{const Z=D;$(Z.jobId),k({jobId:Z.jobId,total:Z.total,completed:0,failed:0,currentIndex:0,currentStory:""}),S(null)}),Id("story:bulk-progress",D=>{const Z=D;Z.jobId===P&&k(Z)}),Id("story:bulk-done",D=>{const Z=D;Z.jobId===P&&(S(Z),k(null),Z.failed===0?A.success(`All ${Z.completed} suites generated!`):A.success(`${Z.completed} done, ${Z.failed} failed`))});const Ft=D=>{var As;const Z=(As=D.target.files)==null?void 0:As[0];if(!Z)return;const je=new FileReader;je.onload=Et=>{var is;const Os=(is=Et.target)==null?void 0:is.result;if(Z.name.endsWith(".csv")){const H=Os.split(`
906
+ `).slice(1).map(ue=>ue.split(",").map(fe=>fe.replace(/^"|"$/g,"").trim())).filter(ue=>{var fe;return((fe=ue[0])==null?void 0:fe.length)>=10}).map(ue=>({story:ue[0],suiteName:ue[1]||void 0}));v(H.map((ue,fe)=>`${fe+1}. ${ue.story}`).join(`
907
+ `))}else v(Os)},je.readAsText(Z),D.target.value=""},rs=j?Math.round((j.completed+j.failed)/j.total*100):0,He=be.isPending||j!==null&&N===null,Ct=Yp(c),K=Jp(c),Ke=Yp(M),as=Jp(M),sr=D=>re(Z=>Z.filter(je=>je.issueKey!==D)),nr=r.trim().length>=10||!!x&&!!c.trim();return s.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:s.jsx("div",{className:"flex-1 overflow-y-auto",children:s.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.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:s.jsx(wt,{size:16,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-base font-bold text-content tracking-tight",children:"Smart Tests"}),s.jsx("p",{className:"text-[10px] text-content-tertiary",children:"AI-powered test generation from stories, Jira, or API specs"})]})]})}),s.jsxs("div",{className:"grid grid-cols-3 gap-2 p-1 rounded-xl bg-surface border border-border shadow-xs",children:[s.jsx(Wd,{icon:Ur,title:"Single Story",desc:"Describe one user journey — AI creates the full test suite",active:e==="single",gradient:"bg-gradient-to-br from-violet-500 to-indigo-600",onClick:()=>t("single")}),s.jsx(Wd,{icon:Wr,title:"Bulk Import",desc:"Generate multiple suites at once from text, JSON, CSV, or Jira",tag:"batch",active:e==="bulk",gradient:"bg-gradient-to-br from-amber-500 to-orange-600",onClick:()=>t("bulk")}),s.jsx(Wd,{icon:Tm,title:"API Import",desc:"Import OpenAPI / Swagger specs to auto-generate API tests",tag:"api",active:e==="swagger",gradient:"bg-gradient-to-br from-emerald-500 to-teal-600",onClick:()=>t("swagger")})]}),e==="single"&&s.jsxs("div",{className:"grid grid-cols-5 gap-3 animate-fade-in",children:[s.jsxs("div",{className:"col-span-3 space-y-3",children:[s.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-5 h-5 rounded bg-indigo-100 flex items-center justify-center",children:s.jsx(ac,{size:14,className:"text-indigo-600"})}),s.jsxs("div",{children:[s.jsx("span",{className:"text-[11px] font-bold text-content",children:"Jira Integration"}),s.jsx("span",{className:"ml-2 text-[10px] text-content-tertiary font-medium",children:"Optional"})]})]}),x&&!y&&s.jsxs("button",{type:"button",onClick:()=>b(!0),className:"flex items-center gap-1 text-[10px] text-indigo-600 hover:text-indigo-700 font-semibold",children:[s.jsx(Ml,{size:10})," Show ",x.issueKey]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx("input",{className:E("w-full rounded-xl px-3 py-2 text-xs transition-all border focus:outline-none focus:ring-2 placeholder-content-tertiary",c.trim()?Ct?"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:c,onChange:D=>{d(D.target.value),D.target.value.trim()||p(null)}}),K&&Ct&&s.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:K})]}),s.jsxs(se,{variant:"secondary",size:"sm",onClick:()=>xe.mutate(c),loading:xe.isPending,disabled:!c.trim()||!Ct||xe.isPending,children:[s.jsx(kd,{size:14})," Fetch"]})]}),c.trim()&&!Ct&&s.jsxs("p",{className:"text-[10px] text-red-500 flex items-center gap-1",children:[s.jsx(ts,{size:10})," Invalid format — use PROJ-123 or full Jira URL"]}),x&&y&&s.jsx(cS,{content:x,onClose:()=>b(!1)})]}),s.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-5 h-5 rounded bg-violet-100 flex items-center justify-center",children:s.jsx(Ps,{size:14,className:"text-violet-600"})}),s.jsxs("div",{children:[s.jsx("span",{className:"text-[11px] font-bold text-content",children:"User Story"}),x?s.jsx("span",{className:"ml-2 text-[10px] text-content-tertiary font-medium",children:"Optional — Jira content used"}):s.jsx("span",{className:"ml-1 text-red-400 text-xs",children:"*"})]})]}),s.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:x?3:5,placeholder:x?"Add extra context or leave blank — Jira content is enough":`Describe the user journey you want to automate…
908
+
909
+ Example: User logs in with valid credentials, navigates to the dashboard, and verifies that the welcome message is displayed.`,value:r,onChange:D=>{a(D.target.value),o(!1)}})]}),s.jsx("div",{className:"rounded-xl border border-border bg-surface p-3.5",children:s.jsxs("div",{className:"flex items-end gap-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs("label",{className:"text-[11px] font-bold text-content mb-2 block",children:["Suite Name ",s.jsx("span",{className:"text-content-tertiary font-normal text-[10px]",children:"(AI auto-suggests if blank)"})]}),s.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:x?`e.g. ${x.summary}`:"e.g. Authentication Tests",value:i,onChange:D=>l(D.target.value)})]}),s.jsxs(se,{onClick:()=>Ee.mutate(),loading:Ee.isPending,disabled:!nr,children:[s.jsx(wt,{size:14})," Generate Suite"]})]})})]}),s.jsxs("div",{className:"col-span-2 space-y-3",children:[s.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(qe,{size:13,className:"text-amber-500"}),s.jsx("span",{className:"text-[11px] font-bold text-content",children:"Quick Start"})]}),s.jsx("div",{className:"space-y-2",children:iS.map((D,Z)=>s.jsxs("button",{type:"button",onClick:()=>{a(D.story),o(!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:[s.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[s.jsx("span",{className:"text-[10px] font-bold text-content group-hover:text-accent transition-colors",children:D.title}),s.jsx(D2,{size:11,className:"text-content-tertiary group-hover:text-accent transition-colors"})]}),s.jsx("p",{className:"text-[10px] text-content-tertiary leading-snug line-clamp-2",children:D.story})]},Z))})]}),s.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(zp,{size:13,className:"text-accent"}),s.jsx("span",{className:"text-[11px] font-bold text-content",children:"Pro Tips"})]}),s.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((D,Z)=>s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(yr,{size:9,className:"text-accent flex-shrink-0 mt-1"}),s.jsx("span",{className:"text-[11px] text-content-tertiary leading-relaxed",children:D})]},Z))})]})]})]}),e==="bulk"&&s.jsxs("div",{className:"space-y-3 animate-fade-in",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-5 h-5 rounded bg-indigo-100 flex items-center justify-center",children:s.jsx(ac,{size:14,className:"text-indigo-600"})}),s.jsxs("div",{children:[s.jsx("span",{className:"text-[11px] font-bold text-content",children:"Fetch from Jira"}),s.jsx("span",{className:"ml-2 text-[10px] text-content-tertiary",children:"Paste URL → Fetch → repeat"})]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx("input",{className:E("w-full rounded-xl px-3.5 py-2 text-sm border transition-all focus:outline-none focus:ring-2 placeholder-content-tertiary",M.trim()?Ke?"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:M,onChange:D=>V(D.target.value),onKeyDown:D=>{D.key==="Enter"&&M.trim()&&Ke&&!he.isPending&&!He&&he.mutate(M)},disabled:He}),as&&Ke&&s.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:as})]}),s.jsxs(se,{variant:"secondary",size:"sm",onClick:()=>he.mutate(M),loading:he.isPending,disabled:!M.trim()||!Ke||he.isPending||He,children:[s.jsx(kd,{size:14})," Fetch"]})]}),M.trim()&&!Ke&&s.jsxs("p",{className:"text-[10px] text-red-500 flex items-center gap-1",children:[s.jsx(ts,{size:10})," Invalid Jira URL format"]}),G.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1.5 pt-1",children:G.map(D=>s.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:D.summary,children:[s.jsx(ni,{size:9,className:"text-indigo-400"}),s.jsx("span",{className:"font-mono font-bold text-[10px]",children:D.issueKey}),s.jsx("span",{className:"max-w-[120px] truncate text-[10px]",children:D.summary}),!He&&s.jsx("button",{type:"button",onClick:()=>sr(D.issueKey),className:"text-indigo-300 hover:text-red-500 transition-colors",children:s.jsx(ye,{size:10})})]},D.issueKey))})]}),s.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-5 h-5 rounded bg-amber-100 flex items-center justify-center",children:s.jsx(Ps,{size:14,className:"text-amber-600"})}),s.jsx("span",{className:"text-[11px] font-bold text-content",children:"Supported Formats"})]}),s.jsx("div",{className:"grid grid-cols-2 gap-2",children:xS.map(({icon:D,label:Z,example:je})=>s.jsxs("div",{className:"p-2.5 rounded-xl bg-surface-inset/50 border border-border",children:[s.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[s.jsx(D,{size:10,className:"text-content-tertiary"}),s.jsx("span",{className:"text-[10px] font-bold text-content-secondary",children:Z})]}),s.jsx("pre",{className:"text-[9px] text-content-tertiary font-mono leading-relaxed whitespace-pre-wrap line-clamp-2",children:je})]},Z))})]})]}),s.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-5 py-3 bg-surface-inset/30 border-b border-border",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("span",{className:"text-xs text-content-secondary",children:u.length>0?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"font-bold text-accent tabular-nums",children:u.length})," stories",G.length>0&&s.jsxs("span",{className:"text-content-tertiary ml-1",children:["(",G.length," Jira",u.length-G.length>0?` + ${u.length-G.length} manual`:"",")"]})]}):s.jsx("span",{className:"text-content-tertiary",children:"No stories yet"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Parallel"}),s.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:w,onChange:D=>h(Number(D.target.value)),disabled:He,children:[1,2,3,4,5].map(D=>s.jsxs("option",{value:D,children:[D,"×"]},D))})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{ref:O,type:"file",accept:".txt,.csv,.json",className:"hidden",onChange:Ft}),s.jsxs(se,{variant:"secondary",size:"sm",onClick:()=>{var D;return(D=O.current)==null?void 0:D.click()},disabled:He,children:[s.jsx(Uc,{size:12})," Upload"]}),s.jsxs(se,{size:"sm",onClick:()=>{S(null),be.mutate()},loading:be.isPending,disabled:u.length===0||He,children:[s.jsx(qe,{size:13})," Generate ",u.length>0?u.length:""," Suites"]})]})]}),s.jsxs("div",{className:"min-h-[220px]",children:[!He&&!N&&s.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…
910
+
911
+ Use --- separators, numbered lists, or JSON array format.
912
+ Or fetch from Jira above.`,value:f,onChange:D=>v(D.target.value),disabled:He}),He&&j&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-4",children:[s.jsxs("div",{className:"relative",children:[s.jsx(dS,{pct:rs,size:72,stroke:5}),s.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:s.jsxs("span",{className:"text-sm font-bold text-content tabular-nums",children:[rs,"%"]})})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-sm font-semibold text-content",children:"Generating suites…"}),s.jsxs("p",{className:"text-xs text-content-tertiary mt-1",children:[j.completed+j.failed," of ",j.total," complete"]})]}),s.jsx("div",{className:"flex gap-5",children:[["Total",j.total,"text-content"],["Done",j.completed,"text-emerald-600"],["Failed",j.failed,"text-red-500"]].map(([D,Z,je])=>s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:`text-lg font-bold tabular-nums ${je}`,children:Z}),s.jsx("p",{className:"text-[9px] text-content-tertiary font-semibold uppercase tracking-wider",children:D})]},String(D)))}),j.currentStory&&s.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:[s.jsx(qe,{size:12,className:"text-accent flex-shrink-0 mt-0.5"}),s.jsxs("p",{className:"text-[11px] text-content-secondary line-clamp-2",children:[s.jsxs("span",{className:"font-semibold",children:["#",j.currentIndex+1,":"]})," ",j.currentStory]})]})]}),N&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-4",children:[s.jsx("div",{className:E("w-10 h-10 rounded-xl flex items-center justify-center",N.failed===0?"bg-emerald-100":"bg-amber-100"),children:N.failed===0?s.jsx(we,{size:20,className:"text-emerald-600"}):s.jsx(ts,{size:20,className:"text-amber-600"})}),s.jsxs("div",{className:"text-center",children:[s.jsxs("p",{className:"text-sm font-bold text-content",children:[N.completed," suites generated",N.failed>0?`, ${N.failed} failed`:" successfully"]}),s.jsx("p",{className:"text-xs text-content-tertiary mt-1",children:"Ready in Test Editor"})]}),s.jsx("div",{className:"flex gap-5",children:[["Total",N.total,"text-content"],["Generated",N.completed,"text-emerald-600"],["Failed",N.failed,"text-red-500"]].map(([D,Z,je])=>s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:`text-lg font-bold tabular-nums ${je}`,children:Z}),s.jsx("p",{className:"text-[9px] text-content-tertiary font-semibold uppercase tracking-wider",children:D})]},String(D)))}),N.failedItems.length>0&&s.jsx("div",{className:"w-full max-w-lg space-y-1.5 max-h-[140px] overflow-y-auto px-4",children:N.failedItems.map(D=>s.jsxs("div",{className:"flex items-start gap-2 p-2.5 bg-red-50/60 rounded-xl border border-red-200/40",children:[s.jsx(st,{size:12,className:"text-red-500 flex-shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[11px] text-red-700 font-medium line-clamp-1",children:D.story}),s.jsx("p",{className:"text-[10px] text-red-400 mt-0.5",children:D.error})]})]},D.index))}),s.jsxs("div",{className:"flex gap-2 pt-2",children:[s.jsxs(se,{size:"sm",onClick:()=>n("/tests"),children:["Open Test Editor ",s.jsx(Kt,{size:13})]}),s.jsxs(se,{variant:"secondary",size:"sm",onClick:()=>{S(null),v(""),re([])},children:[s.jsx(ye,{size:13})," Start Over"]})]})]})]})]})]}),e==="swagger"&&s.jsxs("div",{className:"space-y-3 animate-fade-in",children:[s.jsx("div",{className:"flex items-center gap-2.5 px-1",children:[{n:1,label:"Fetch Spec",done:!!R},{n:2,label:"Configure",done:!1},{n:3,label:"Generate",done:!1}].map((D,Z,je)=>s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:E("w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-bold transition-all",D.done?"bg-emerald-500 text-white":"bg-surface-inset text-content-tertiary border border-border"),children:D.done?s.jsx(we,{size:12}):D.n}),s.jsx("span",{className:E("text-xs font-semibold",D.done?"text-emerald-600":"text-content-tertiary"),children:D.label})]}),Z<je.length-1&&s.jsx("div",{className:E("w-12 h-px",D.done?"bg-emerald-300":"bg-border")})]},D.n))}),s.jsxs("div",{className:"grid grid-cols-5 gap-3",children:[s.jsxs("div",{className:"col-span-3 rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("div",{className:"w-5 h-5 rounded bg-emerald-100 flex items-center justify-center",children:s.jsx(nn,{size:14,className:"text-emerald-600"})}),s.jsx("span",{className:"text-[11px] font-bold text-content",children:"API Specification URL"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.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:Y,onChange:D=>{ne(D.target.value),I(null)}}),s.jsxs(se,{variant:"secondary",size:"sm",onClick:()=>Ae.mutate(),loading:Ae.isPending,disabled:!Y.trim()||Ae.isPending,children:[s.jsx(kd,{size:14})," Fetch & Parse"]})]}),Ae.isError&&s.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:[s.jsx(st,{size:13,className:"flex-shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:Ae.error.message}),s.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."})]})]})]}),s.jsxs("div",{className:"col-span-2 rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("div",{className:"w-5 h-5 rounded bg-violet-100 flex items-center justify-center",children:s.jsx(Ps,{size:14,className:"text-violet-600"})}),s.jsx("span",{className:"text-[11px] font-bold text-content",children:"Extra Requirements"}),s.jsx("span",{className:"text-[10px] text-content-tertiary",children:"Optional"})]}),s.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:X,onChange:D=>B(D.target.value)})]})]}),R&&s.jsxs(s.Fragment,{children:[s.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:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-6 h-6 rounded-lg bg-emerald-500 flex items-center justify-center",children:s.jsx(we,{size:13,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-bold text-content",children:R.title}),s.jsx("p",{className:"text-[10px] text-content-tertiary mt-0.5",children:R.baseUrl})]})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"text-center px-3",children:[s.jsx("p",{className:"text-base font-bold text-emerald-600 tabular-nums",children:R.totalEndpoints}),s.jsx("p",{className:"text-[8px] font-bold text-content-tertiary uppercase tracking-widest",children:"Endpoints"})]}),s.jsx("div",{className:"w-px h-6 bg-border"}),s.jsxs("div",{className:"text-center px-2",children:[s.jsx("p",{className:"text-base font-bold text-teal-600 tabular-nums",children:R.tags.length}),s.jsx("p",{className:"text-[8px] font-bold text-content-tertiary uppercase tracking-widest",children:"Tags"})]})]})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(Py,{size:11,className:"text-content-tertiary"}),s.jsx("span",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest",children:"Filter by tag"}),_.trim()&&s.jsx("button",{type:"button",onClick:()=>z(""),className:"text-[9px] text-accent hover:text-accent-dark font-semibold ml-1",children:"Clear all"})]}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:R.tags.map(D=>{const Z=_.split(",").map(Et=>Et.trim()).filter(Boolean),je=Z.includes(D),As=R.endpoints.filter(Et=>Et.tag===D).length;return s.jsxs("button",{type:"button",onClick:()=>{z(je?Z.filter(Et=>Et!==D).join(", "):[...Z,D].join(", "))},className:E("inline-flex items-center gap-1.5 text-[10px] px-2.5 py-1.5 rounded-lg border font-semibold transition-all",je?"bg-accent text-white border-accent shadow-sm shadow-accent/20":"bg-surface text-content-secondary border-border hover:border-accent/40"),children:[D,s.jsx("span",{className:E("text-[9px] px-1 py-px rounded font-bold",je?"bg-white/20 text-white":"bg-surface-inset text-content-tertiary"),children:As})]},D)})})]})]}),s.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:s.jsx("div",{className:"max-h-[220px] overflow-y-auto",children:s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{className:"bg-surface-inset/50 sticky top-0 border-b border-border",children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left px-4 py-2.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest w-20",children:"Method"}),s.jsx("th",{className:"text-left px-4 py-2.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Path"}),s.jsx("th",{className:"text-left px-4 py-2.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Summary"}),s.jsx("th",{className:"text-left px-4 py-2.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest w-16",children:"Tag"})]})}),s.jsx("tbody",{children:R.endpoints.filter(D=>_.trim()?_.split(",").map(Z=>Z.trim()).filter(Boolean).includes(D.tag):!0).map((D,Z)=>s.jsxs("tr",{className:"border-t border-border-muted hover:bg-surface-inset/30 transition-colors",children:[s.jsx("td",{className:"px-4 py-2.5",children:s.jsx("span",{className:E("font-mono font-bold text-[10px] px-2 py-0.5 rounded-md ring-1",uS[D.method]||"bg-surface-inset text-content-secondary ring-border"),children:D.method})}),s.jsx("td",{className:"px-4 py-2.5 font-mono text-content-secondary text-[11px]",children:D.path}),s.jsx("td",{className:"px-4 py-2.5 text-content-tertiary truncate max-w-[240px]",children:D.summary}),s.jsx("td",{className:"px-4 py-2.5",children:s.jsx("span",{className:"text-[9px] text-content-tertiary bg-surface-inset px-1.5 py-0.5 rounded",children:D.tag})})]},Z))})]})})}),s.jsx("div",{className:"rounded-xl border border-border bg-surface p-3.5",children:s.jsxs("div",{className:"flex items-end gap-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{className:"text-[11px] font-bold text-content mb-2 block",children:"Suite Name"}),s.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:le,onChange:D=>T(D.target.value)})]}),s.jsxs(se,{onClick:()=>ft.mutate(),loading:ft.isPending,disabled:ft.isPending,children:[s.jsx(wt,{size:14})," Generate Suite"]})]})})]}),ft.isError&&s.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:[s.jsx(st,{size:14,className:"flex-shrink-0 mt-0.5"}),s.jsx("span",{className:"font-medium",children:ft.error.message})]}),!R&&s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsx(Xp,{title:"Supported Formats",icon:zp,defaultOpen:!0,children:s.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(D=>s.jsxs("div",{className:"flex items-center gap-2 text-xs text-content-secondary",children:[s.jsx(we,{size:10,className:"text-emerald-500 flex-shrink-0"}),D]},D))})}),s.jsx(Xp,{title:"Pro Tips",icon:qe,defaultOpen:!0,children:s.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(D=>s.jsxs("div",{className:"flex items-start gap-2 text-xs text-content-secondary",children:[s.jsx(yr,{size:9,className:"text-accent flex-shrink-0 mt-0.5"}),D]},D))})})]})]})]})})})}function xc({checked:e,onChange:t,label:n,disabled:r}){return s.jsxs("label",{className:E("inline-flex items-center gap-2.5 cursor-pointer select-none",r&&"opacity-40 cursor-not-allowed"),children:[s.jsx("button",{type:"button",role:"switch","aria-checked":e,disabled:r,onClick:()=>t(!e),className:E("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",e?"bg-gradient-to-r from-accent to-accent-dark":"bg-slate-200"),children:s.jsx("span",{className:E("inline-block h-4 w-4 rounded-full bg-white shadow-sm transition-transform duration-200",e?"translate-x-[21px]":"translate-x-[3px]")})}),n&&s.jsx("span",{className:"text-sm text-content-secondary",children:n})]})}const hS=[{id:"github",label:"GitHub Actions"},{id:"gitlab",label:"GitLab CI"},{id:"jenkins",label:"Jenkins"}];function pS({open:e,onClose:t,runConfig:n}){var k,N;const[r,a]=m.useState("github"),[i,l]=m.useState(!1),[o,c]=m.useState(""),[d,x]=m.useState(!1),[p,y]=m.useState(!1),{data:b}=me({queryKey:["config"],queryFn:Br.get}),f=((k=b==null?void 0:b.ci)==null?void 0:k.writeToRepo)??!1,v=S=>({platform:S,browsers:(n==null?void 0:n.browsers)??["chromium"],parallel:(n==null?void 0:n.parallel)??2,device:(n==null?void 0:n.device)||void 0}),w=W({mutationFn:S=>Lp.generate(v(S)),onSuccess:S=>{c(S.yaml),x(!1),y(!1)},onError:S=>A.error(S.message)}),h=W({mutationFn:S=>Lp.writeToRepo({...v(S),yaml:o}),onSuccess:S=>A.success(`Written to ${S.path} — review & commit in Git Control`),onError:S=>A.error(S.message)});m.useEffect(()=>{e&&w.mutate(r)},[e,r]);const u=()=>w.mutate(r),g=()=>{o&&navigator.clipboard.writeText(o).then(()=>{l(!0),A.success("Copied to clipboard"),setTimeout(()=>l(!1),2e3)})},j=()=>{var M;if(!o)return;const S=new Blob([o],{type:"text/plain"}),P=URL.createObjectURL(S),$=document.createElement("a");$.href=P,$.download=((M=w.data)==null?void 0:M.filename)??`${r}-ci.yml`,document.body.appendChild($),$.click(),document.body.removeChild($),URL.revokeObjectURL(P)};return e?s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:t,children:s.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:[s.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border flex-shrink-0",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-sm font-bold text-content",children:"CI Config Generator"}),s.jsx("p",{className:"text-[11px] text-content-tertiary mt-0.5",children:"Generate configuration for your CI/CD pipeline"})]}),s.jsx("button",{type:"button",onClick:t,className:"p-1.5 rounded-lg text-content-tertiary hover:bg-surface-inset hover:text-content transition-colors",children:s.jsx(ye,{size:14})})]}),s.jsx("div",{className:"flex border-b border-border px-5 flex-shrink-0",children:hS.map(S=>s.jsx("button",{type:"button",onClick:()=>a(S.id),className:E("px-4 py-2.5 text-xs font-semibold border-b-2 transition-colors -mb-px",r===S.id?"border-accent text-accent":"border-transparent text-content-secondary hover:text-content"),children:S.label},S.id))}),s.jsx("div",{className:"flex-1 overflow-y-auto p-5 min-h-0",children:w.isPending?s.jsx("div",{className:"h-48 flex items-center justify-center",children:s.jsx("p",{className:"text-sm text-content-tertiary",children:"Generating..."})}):s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("p",{className:"text-[11px] text-content-tertiary",children:[p?"Editing — your changes apply to Copy, Download & Write to repo.":"Preview. Click Edit to customise the YAML.",d&&!p&&s.jsx("span",{className:"ml-1 text-amber-500",children:"(edited)"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[d&&s.jsxs("button",{type:"button",onClick:u,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:[s.jsx(Tl,{size:11})," Reset"]}),s.jsx("button",{type:"button",onClick:()=>y(S=>!S),className:E("flex items-center gap-1 text-[11px] transition-colors",p?"text-accent":"text-content-tertiary hover:text-content"),title:p?"Finish editing":"Edit the YAML",children:p?s.jsxs(s.Fragment,{children:[s.jsx(ze,{size:11})," Done"]}):s.jsxs(s.Fragment,{children:[s.jsx(tr,{size:11})," Edit"]})})]})]}),s.jsx("textarea",{value:o,onChange:S=>{c(S.target.value),x(!0)},readOnly:!p,spellCheck:!1,className:E("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",p?"border-accent focus:ring-1 focus:ring-accent cursor-text":"border-border cursor-default")})]})}),s.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-t border-border bg-surface-inset/30 flex-shrink-0",children:[((N=w.data)==null?void 0:N.filename)&&s.jsx("span",{className:"text-[11px] text-content-tertiary font-mono",children:w.data.filename}),s.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[s.jsxs("button",{type:"button",onClick:g,disabled:!o,className:E("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:[i?s.jsx(ze,{size:12,className:"text-emerald-500"}):s.jsx(zm,{size:12}),i?"Copied!":"Copy"]}),s.jsxs("button",{type:"button",onClick:j,disabled:!o,className:E("flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-colors disabled:opacity-40",f?"border border-border text-content-secondary hover:bg-surface-inset":"bg-accent text-white hover:brightness-110"),children:[s.jsx(Ga,{size:12}),"Download"]}),f&&s.jsxs("button",{type:"button",onClick:()=>h.mutate(r),disabled:!o||h.isPending,title:"Write this file into the repo at its standard path",className:E("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:[s.jsx(Tr,{size:12}),h.isPending?"Writing…":"Write to repo"]})]})]})]})}):null}const Zp=500;let mc=new Map,gl=new Map,Or=[],Hm=0;const wx=new Set;function kx(){Hm++,wx.forEach(e=>e())}let hc={screenshot:null,screenshots:new Map,consoleLogs:[],consoleLogsByCase:new Map,activeCaseIds:[],_v:-1};function fS(){const e=Or[Or.length-1],t=e?mc.get(e)??null:null,n=Array.from(gl.values()).flat().sort((r,a)=>r.timestamp-a.timestamp);return hc={screenshot:t,screenshots:new Map(mc),consoleLogs:n,consoleLogsByCase:new Map(gl),activeCaseIds:[...Or],_v:Hm},hc}const Vd={subscribe(e){return wx.add(e),()=>{wx.delete(e)}},getSnapshot(){return hc._v!==Hm?fS():hc},reset(){mc=new Map,gl=new Map,Or=[],kx()}};function lb(){const e=m.useSyncExternalStore(Vd.subscribe,Vd.getSnapshot),t=m.useCallback(a=>{const i=a;mc.set(i.caseId,i.image),Or.includes(i.caseId)||(Or=[...Or,i.caseId]),kx()},[]),n=m.useCallback(a=>{const i=a,o=[...gl.get(i.caseId)??[],...i.logs];o.length>Zp&&o.splice(0,o.length-Zp),gl.set(i.caseId,o),kx()},[]);Jr({"run:screenshot":t,"run:console":n});const r=m.useCallback(()=>{Vd.reset()},[]);return{screenshot:e.screenshot,screenshots:e.screenshots,consoleLogs:e.consoleLogs,consoleLogsByCase:e.consoleLogsByCase,activeCaseIds:e.activeCaseIds,reset:r}}let _s=[],Sx=0;const Cx=new Set;function Ex(){Sx++,Cx.forEach(e=>e())}let Gd={steps:[],_v:-1};const Qd={subscribe(e){return Cx.add(e),()=>{Cx.delete(e)}},getSnapshot(){return Gd._v!==Sx&&(Gd={steps:_s,_v:Sx}),Gd},reset(){_s=[],Ex()}};function ob(){const e=m.useSyncExternalStore(Qd.subscribe,Qd.getSnapshot),t=m.useCallback(a=>{const i=a;if(i.status!=="running"){if(_s.some(l=>l.stepId===i.stepId&&l.status===i.status))return;_s=[..._s,{...i,timestamp:Date.now()}],_s.length>200&&(_s=_s.slice(-200)),Ex()}},[]),n=m.useCallback(()=>{_s=[],Ex()},[]);Jr({"run:step":t,"run:start":n});const r=m.useCallback(()=>{Qd.reset()},[]);return{stepLogs:e.steps,reset:r}}function cb(e){const[t,n]=m.useState(0),r=m.useRef(null);m.useEffect(()=>(e?(n(0),r.current=setInterval(()=>n(l=>l+1),1e3)):r.current&&(clearInterval(r.current),r.current=null),()=>{r.current&&clearInterval(r.current)}),[e]);const a=Math.floor(t/60).toString().padStart(2,"0"),i=(t%60).toString().padStart(2,"0");return`${a}:${i}`}function Ja({browser:e,size:t=16,className:n=""}){const r=(e??"").toLowerCase();return r.includes("chromium")||r.includes("chrome")?s.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",className:n,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("circle",{cx:"24",cy:"24",r:"22",fill:"#4285F4"}),s.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"}),s.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"}),s.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"}),s.jsx("circle",{cx:"24",cy:"24",r:"8",fill:"white"}),s.jsx("circle",{cx:"24",cy:"24",r:"5.5",fill:"#4285F4"})]}):r.includes("firefox")?s.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",className:n,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("circle",{cx:"24",cy:"24",r:"22",fill:"#FF9500"}),s.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"}),s.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"})]}):r.includes("webkit")||r.includes("safari")?s.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",className:n,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("circle",{cx:"24",cy:"24",r:"22",fill:"url(#safari-grad)"}),s.jsx("circle",{cx:"24",cy:"24",r:"18",fill:"white",fillOpacity:"0.15"}),s.jsx("circle",{cx:"24",cy:"24",r:"17",stroke:"white",strokeOpacity:"0.3",strokeWidth:"0.5",fill:"none"}),s.jsx("polygon",{points:"24,8 26,24 24,40 22,24",fill:"white",fillOpacity:"0.9"}),s.jsx("polygon",{points:"24,8 26,24 24,24",fill:"#FF3B30"}),s.jsx("polygon",{points:"24,40 22,24 24,24",fill:"#FF3B30"}),s.jsx("circle",{cx:"24",cy:"24",r:"2.5",fill:"white"}),s.jsx("defs",{children:s.jsxs("linearGradient",{id:"safari-grad",x1:"0",y1:"0",x2:"48",y2:"48",children:[s.jsx("stop",{offset:"0%",stopColor:"#00D4FF"}),s.jsx("stop",{offset:"100%",stopColor:"#0066FF"})]})})]}):s.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",className:n,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("circle",{cx:"24",cy:"24",r:"22",stroke:"#94a3b8",strokeWidth:"2",fill:"none"}),s.jsx("ellipse",{cx:"24",cy:"24",rx:"10",ry:"22",stroke:"#94a3b8",strokeWidth:"1.5",fill:"none"}),s.jsx("line",{x1:"2",y1:"24",x2:"46",y2:"24",stroke:"#94a3b8",strokeWidth:"1.5"}),s.jsx("line",{x1:"24",y1:"2",x2:"24",y2:"46",stroke:"#94a3b8",strokeWidth:"1.5"})]})}function Km(e){const t=(e??"").toLowerCase();return t.includes("chromium")||t.includes("chrome")?"Chromium":t.includes("firefox")?"Firefox":t.includes("webkit")||t.includes("safari")?"WebKit":e??"Browser"}const db=[{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}}],ub=[{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}],xb=[{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}],Px=[...db,...ub,...xb];function mb(e){if(e)return Px.find(t=>t.playwrightDevice===e)??Px.find(t=>t.id===e)}const gS=[{mode:"all",label:"All Tests",desc:"Every suite & case",icon:vw},{mode:"suite",label:"By Suite",desc:"Specific test suite",icon:Ps},{mode:"tag",label:"By Tag",desc:"Match by tag",icon:Py},{mode:"test",label:"Single Test",desc:"One test by name",icon:Ps}];function yS(e=60){const[t,n]=m.useState(e),r=m.useRef(!1),a=m.useCallback(i=>{i.preventDefault(),r.current=!0;const l=c=>{if(!r.current)return;const x=i.target.parentElement.getBoundingClientRect(),p=(c.clientX-x.left)/x.width*100;n(Math.max(30,Math.min(80,p)))},o=()=>{r.current=!1,window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",o)};window.addEventListener("mousemove",l),window.addEventListener("mouseup",o)},[]);return{leftPct:t,onMouseDown:a}}function bS(e=55){const[t,n]=m.useState(e),r=m.useRef(!1),a=m.useCallback(i=>{i.preventDefault(),r.current=!0;const l=c=>{if(!r.current)return;const x=i.target.parentElement.getBoundingClientRect(),p=(c.clientY-x.top)/x.height*100;n(Math.max(25,Math.min(75,p)))},o=()=>{r.current=!1,window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",o)};window.addEventListener("mousemove",l),window.addEventListener("mouseup",o)},[]);return{topPct:t,onMouseDown:a}}const ef={log:"text-slate-300",info:"text-blue-400",warn:"text-amber-400",error:"text-red-400",debug:"text-slate-500",default:"text-slate-400"},tf={log:"text-slate-500",info:"text-blue-500",warn:"text-amber-500",error:"text-red-500",debug:"text-slate-600"};function vS(){const[e,t]=m.useState("all"),[n,r]=m.useState(""),[a,i]=m.useState(""),[l,o]=m.useState(""),[c,d]=m.useState(["chromium"]),[x,p]=m.useState(!0),[y,b]=m.useState(!1),[f,v]=m.useState(2),[w,h]=m.useState("only-on-failure"),[u,g]=m.useState("off"),[j,k]=m.useState("off"),[N,S]=m.useState(""),[P,$]=m.useState(!1),[M,V]=m.useState(!0),[G,re]=m.useState(!1),{data:O=[]}=me({queryKey:["suites"],queryFn:()=>Vr.list()}),Y=$m(),ne=lb(),le=Wc(),T=le.runningSuiteId!==null||le.runningCaseIds.size>0,_=P||Y.isRunning||T,z=cb(_),R=_||Y.completed;m.useEffect(()=>{P&&(Y.isRunning||Y.completed)&&$(!1)},[P,Y.isRunning,Y.completed]);const I=W({mutationFn:be=>Ya.start(be),onError:be=>{$(!1),A.error(be.message)}}),X=W({mutationFn:()=>Ya.stop(),onSuccess:()=>A.success("Stop signal sent — finishing current step…"),onError:()=>A.error("Failed to send stop signal")}),B=be=>{d(Ae=>Ae.includes(be)?Ae.length>1?Ae.filter(ft=>ft!==be):Ae:[...Ae,be])},xe=()=>{Y.reset(),ne.reset(),jt.clear(),$(!0);const be={browsers:c,headed:x,noHealing:y,parallel:f,screenshot:w,video:u,trace:j};e==="all"&&(be.all=!0),e==="suite"&&n&&(be.suite=n),e==="tag"&&a&&(be.tag=a),e==="test"&&l&&(be.test=l),N&&(be.device=N),I.mutate(be)},he=()=>{Y.reset(),ne.reset(),jt.clear()},Ee=()=>{A.success("Browser is running in headed mode — check your taskbar")};return s.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:[R?s.jsx(NS,{progress:Y,live:ne,elapsed:z,runActive:_,onRunAgain:he,onOpenExternal:Ee,onStop:()=>X.mutate()}):s.jsx(jS,{mode:e,setMode:t,suiteId:n,setSuiteId:r,tag:a,setTag:i,testName:l,setTestName:o,browsers:c,toggleBrowser:B,headed:x,setHeaded:p,noHealing:y,setNoHealing:b,parallel:f,setParallel:v,screenshot:w,setScreenshot:h,video:u,setVideo:g,trace:j,setTrace:k,device:N,setDevice:S,suites:O,runActive:_,optionsOpen:M,setOptionsOpen:V,onRun:xe,submitting:P,onCiConfig:()=>re(!0)}),s.jsx(pS,{open:G,onClose:()=>re(!1),runConfig:{browsers:c,parallel:f,device:N||void 0}})]})}function jS(e){const{mode:t,setMode:n,suiteId:r,setSuiteId:a,tag:i,setTag:l,testName:o,setTestName:c,browsers:d,toggleBrowser:x,headed:p,setHeaded:y,noHealing:b,setNoHealing:f,parallel:v,setParallel:w,screenshot:h,setScreenshot:u,video:g,setVideo:j,trace:k,setTrace:N,device:S,setDevice:P,suites:$,runActive:M,onRun:V,submitting:G,onCiConfig:re}=e,[O,Y]=m.useState("all"),ne=mb(S||void 0),T=((ne==null?void 0:ne.category)==="mobile"||(ne==null?void 0:ne.category)==="tablet")&&!d.includes("chromium"),_=O==="all"?Px:O==="desktop"?db:O==="mobile"?ub:xb;return s.jsx("div",{className:"flex-1 overflow-y-auto",children:s.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[s.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:s.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.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:s.jsx(Dt,{size:17,className:"text-white translate-x-0.5"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-sm font-bold text-content",children:"Run Configuration"}),s.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Configure and launch your test run"})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(se,{size:"sm",variant:"secondary",onClick:re,children:"CI Config"}),s.jsxs(se,{size:"sm",onClick:V,loading:G,disabled:M,children:[s.jsx(Dt,{size:10})," Start Run"]})]})]})}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-5 gap-3",children:[s.jsxs("div",{className:"lg:col-span-3 space-y-3",children:[s.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[s.jsxs("div",{className:"px-3.5 py-2 bg-surface-inset/50 border-b border-border flex items-center gap-2",children:[s.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:s.jsx(qe,{size:10,className:"text-white"})}),s.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Run Mode"})]}),s.jsxs("div",{className:"p-3 space-y-2.5",children:[s.jsx("div",{className:"grid grid-cols-2 gap-2",children:gS.map(({mode:z,label:R,desc:I,icon:X})=>s.jsxs("button",{type:"button",onClick:()=>!M&&n(z),disabled:M,className:E("flex items-start gap-2 p-2.5 rounded-lg border text-left transition-all",M&&"opacity-50 cursor-not-allowed",t===z?"border-accent bg-accent/5 ring-1 ring-accent/20":"border-border hover:border-slate-300 hover:bg-surface-inset/30"),children:[s.jsx(X,{size:12,className:E("flex-shrink-0 mt-0.5",t===z?"text-accent":"text-content-tertiary")}),s.jsxs("div",{children:[s.jsx("p",{className:E("text-[11px] font-semibold",t===z?"text-accent":"text-content-secondary"),children:R}),s.jsx("p",{className:"text-[9px] text-content-tertiary",children:I})]})]},z))}),t==="suite"&&!M&&s.jsxs("select",{value:r,onChange:z=>a(z.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:[s.jsx("option",{value:"",children:"Select a suite..."}),$.map(z=>s.jsx("option",{value:z.name,children:z.name},z.id))]}),t==="tag"&&!M&&s.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:i,onChange:z=>l(z.target.value)}),t==="test"&&!M&&s.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:o,onChange:z=>c(z.target.value)})]})]}),s.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[s.jsxs("div",{className:"px-3.5 py-2 bg-surface-inset/50 border-b border-border flex items-center gap-2",children:[s.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:s.jsx(nn,{size:10,className:"text-white"})}),s.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Browsers"})]}),s.jsx("div",{className:"p-3",children:s.jsx("div",{className:"flex gap-2 flex-wrap",children:Ty.map(z=>s.jsxs("button",{type:"button",onClick:()=>!M&&x(z),disabled:M,className:E("flex items-center gap-1.5 px-3 py-1.5 rounded-lg border text-[11px] capitalize transition-all font-medium",M&&"opacity-50 cursor-not-allowed",d.includes(z)?"border-accent bg-accent/10 text-accent ring-1 ring-accent/20":"border-border text-content-secondary hover:border-slate-300"),children:[s.jsx(Ja,{browser:z,size:14}),Km(z)]},z))})})]}),s.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[s.jsxs("div",{className:"px-3.5 py-2 bg-surface-inset/50 border-b border-border flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.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:s.jsx(Mi,{size:10,className:"text-white"})}),s.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Device Emulation"}),ne&&s.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"?s.jsx(Mi,{size:8}):ne.category==="tablet"?s.jsx(Co,{size:8}):s.jsx(br,{size:8}),ne.name]})]}),ne&&s.jsx("button",{type:"button",onClick:()=>P(""),disabled:M,className:"text-content-tertiary hover:text-content-secondary transition-colors disabled:opacity-50",title:"Clear device",children:s.jsx(ye,{size:12})})]}),s.jsxs("div",{className:"p-3 space-y-2.5",children:[T&&s.jsxs("div",{className:"flex items-start gap-2 px-2.5 py-2 rounded-lg bg-amber-50 border border-amber-200",children:[s.jsx(ts,{size:12,className:"text-amber-500 flex-shrink-0 mt-0.5"}),s.jsxs("p",{className:"text-[10px] text-amber-700 leading-relaxed",children:["Mobile/tablet emulation works best with ",s.jsx("strong",{children:"Chromium"}),". Touch events and mobile UA may not work correctly in Firefox or WebKit."]})]}),s.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:br},{id:"mobile",label:"Mobile",icon:Mi},{id:"tablet",label:"Tablet",icon:Co}].map(({id:z,label:R,icon:I})=>s.jsxs("button",{type:"button",onClick:()=>Y(z),disabled:M,className:E("flex-1 flex items-center justify-center gap-1 py-1 rounded-md text-[9px] font-semibold transition-all disabled:opacity-50",O===z?"bg-surface shadow-sm text-content":"text-content-tertiary hover:text-content-secondary"),children:[I&&s.jsx(I,{size:9}),R]},z))}),s.jsxs("div",{className:"grid grid-cols-2 gap-1.5 max-h-44 overflow-y-auto pr-0.5",children:[(O==="all"||O==="desktop")&&s.jsxs("button",{type:"button",onClick:()=>!M&&P(""),disabled:M,className:E("flex flex-col items-start gap-0.5 p-2 rounded-lg border text-left transition-all disabled:opacity-50",S?"border-border hover:border-slate-300 hover:bg-surface-inset/30":"border-teal-400 bg-teal-50 ring-1 ring-teal-300"),children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(br,{size:10,className:S?"text-content-tertiary":"text-teal-500"}),s.jsx("span",{className:E("text-[10px] font-semibold",S?"text-content-secondary":"text-teal-600"),children:"No Emulation"})]}),s.jsx("span",{className:"text-[9px] text-content-tertiary",children:"Use config viewport"})]}),_.map(z=>{const R=S===(z.playwrightDevice??z.id),I=z.category==="mobile"?Mi:z.category==="tablet"?Co:br;return s.jsxs("button",{type:"button",onClick:()=>!M&&P(z.playwrightDevice??z.id),disabled:M,className:E("flex flex-col items-start gap-0.5 p-2 rounded-lg border text-left transition-all disabled:opacity-50",R?"border-teal-400 bg-teal-50 ring-1 ring-teal-300":"border-border hover:border-slate-300 hover:bg-surface-inset/30"),children:[s.jsxs("div",{className:"flex items-center gap-1 w-full",children:[s.jsx(I,{size:10,className:R?"text-teal-500":"text-content-tertiary"}),s.jsx("span",{className:E("text-[10px] font-semibold truncate flex-1",R?"text-teal-600":"text-content-secondary"),children:z.name}),z.recommendedBrowser&&z.category!=="desktop"&&s.jsx("span",{className:E("text-[8px] px-1 py-0.5 rounded font-medium flex-shrink-0",z.recommendedBrowser==="webkit"?"bg-slate-100 text-slate-500":"bg-blue-50 text-blue-500"),children:z.recommendedBrowser==="webkit"?"Safari":"Chrome"})]}),s.jsxs("span",{className:"text-[9px] text-content-tertiary",children:[z.viewport.width,"×",z.viewport.height,z.dpr?` @${z.dpr}x`:""]})]},z.id)})]})]})]})]}),s.jsxs("div",{className:"lg:col-span-2 space-y-3",children:[s.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[s.jsxs("div",{className:"px-3.5 py-2 bg-surface-inset/50 border-b border-border flex items-center gap-2",children:[s.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:s.jsx(Qa,{size:10,className:"text-white"})}),s.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Options"})]}),s.jsxs("div",{className:"p-3 space-y-2.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[11px] font-medium text-content-secondary",children:"Headed mode"}),s.jsx("p",{className:"text-[9px] text-content-tertiary",children:"Show browser window"})]}),s.jsx(xc,{checked:p,onChange:y,disabled:M})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(Fm,{size:10,className:"text-amber-500"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[11px] font-medium text-content-secondary",children:"Disable self-healing"}),s.jsx("p",{className:"text-[9px] text-content-tertiary",children:"Skip AI healing"})]})]}),s.jsx(xc,{checked:b,onChange:f,disabled:M})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(Y2,{size:10,className:"text-blue-500"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[11px] font-medium text-content-secondary",children:"Parallel workers"}),s.jsx("p",{className:"text-[9px] text-content-tertiary",children:"Concurrent cases"})]})]}),s.jsx("input",{type:"number",min:1,max:10,value:v,disabled:M,onChange:z=>w(Number(z.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"})]})]})]}),s.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[s.jsxs("div",{className:"px-3.5 py-2 bg-surface-inset/50 border-b border-border flex items-center gap-2",children:[s.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:s.jsx(Hn,{size:10,className:"text-white"})}),s.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Capture"})]}),s.jsx("div",{className:"p-3 space-y-2",children:[{label:"Screenshot",icon:Hn,cls:"text-blue-400",val:h,set:u,opts:[["off","Off"],["on","Every test"],["only-on-failure","On failure"]]},{label:"Video",icon:Bc,cls:"text-purple-400",val:g,set:j,opts:[["off","Off"],["on","Every test"],["on-first-retry","1st retry"],["retain-on-failure","On failure"]]},{label:"Trace",icon:Cy,cls:"text-emerald-400",val:k,set:N,opts:[["off","Off"],["on","Every test"],["on-first-retry","1st retry"],["retain-on-failure","On failure"]]}].map(({label:z,icon:R,cls:I,val:X,set:B,opts:xe})=>s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-content-secondary min-w-0 flex-shrink-0 font-medium",children:[s.jsx(R,{size:11,className:I}),z]}),s.jsx("select",{value:X,disabled:M,onChange:he=>B(he.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(([he,Ee])=>s.jsx("option",{value:he,children:Ee},he))})]},z))})]}),s.jsxs(se,{size:"lg",onClick:V,loading:G,disabled:M,className:"w-full",children:[s.jsx(Dt,{size:14})," Start Test Run"]})]})]})]})})}function NS({progress:e,live:t,elapsed:n,runActive:r,onRunAgain:a,onOpenExternal:i,onStop:l}){const{leftPct:o,onMouseDown:c}=yS(60),{topPct:d,onMouseDown:x}=bS(55),p=m.useRef(null),[y,b]=m.useState("steps"),{stepLogs:f}=ob(),[v,w]=m.useState(null),h=t.activeCaseIds.length>1;m.useEffect(()=>{t.activeCaseIds.length>0&&!v&&w(t.activeCaseIds[0])},[t.activeCaseIds,v]);const u=h&&v?f.filter(j=>j.caseId===v):f,g=h&&v?t.consoleLogsByCase.get(v)??[]:t.consoleLogs;return m.useEffect(()=>{var j;(j=p.current)==null||j.scrollIntoView({behavior:"smooth"})},[u.length,g.length]),s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[s.jsx(wS,{elapsed:n,runActive:r,progress:e,onRunAgain:a,onStop:l}),h?s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden relative",style:{minHeight:0},children:[s.jsxs("div",{className:"overflow-y-auto bg-slate-900 flex flex-col",style:{height:`${d}%`},children:[s.jsxs("div",{className:"flex-shrink-0 h-8 bg-slate-800 border-b border-slate-700 flex items-center justify-between px-3",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-red-500/80"}),s.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-amber-500/80"}),s.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-emerald-500/80"}),s.jsxs("span",{className:"text-[10px] font-semibold text-slate-400 uppercase tracking-wider ml-2",children:["Browser Previews — ",t.activeCaseIds.length," running"]})]}),s.jsx("button",{type:"button",onClick:i,title:"Open in external browser",className:"p-1 rounded text-slate-400 hover:text-white hover:bg-slate-700 transition-colors",children:s.jsx(ni,{size:11})})]}),s.jsx("div",{className:"flex flex-col gap-0 flex-1",children:t.activeCaseIds.map((j,k)=>{const N=t.screenshots.get(j),S=e.activeCases.get(j)??j.slice(0,8),P=v===j,$=k===t.activeCaseIds.length-1;return s.jsxs("div",{className:E("flex flex-col cursor-pointer transition-all",!$&&"border-b border-slate-700",P&&"ring-inset ring-2 ring-accent"),onClick:()=>w(j),children:[s.jsxs("div",{className:E("flex items-center justify-between px-3 py-1.5 flex-shrink-0",P?"bg-accent/10 border-b border-accent/30":"bg-slate-800/60 border-b border-slate-700"),children:[s.jsxs("div",{className:"flex items-center gap-2",children:[e.currentBrowser&&s.jsx(Ja,{browser:e.currentBrowser,size:12}),s.jsx("span",{className:"text-[10px] font-mono text-slate-300 truncate max-w-xs",children:S})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[P&&s.jsx("span",{className:"text-[8px] font-semibold text-accent uppercase tracking-wider",children:"Selected"}),r&&s.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"})]})]}),s.jsx("div",{className:"relative bg-slate-950 flex-1",children:N?s.jsx("img",{src:`data:image/jpeg;base64,${N}`,alt:S,className:"w-full h-auto object-contain"}):s.jsxs("div",{className:"h-32 flex items-center justify-center gap-2",children:[s.jsx(ae,{size:14,className:"text-slate-600 animate-spin"}),s.jsx("span",{className:"text-[10px] text-slate-600",children:"Waiting for screenshot..."})]})})]},j)})})]}),s.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:x,children:[s.jsx("div",{className:"absolute inset-x-0 -top-1.5 -bottom-1.5"}),s.jsx("div",{className:"flex gap-0.5",children:s.jsx("div",{className:"w-4 h-0.5 rounded-full bg-slate-500 group-hover:bg-white transition-colors"})})]}),s.jsxs("div",{className:"flex flex-col bg-[#1a1b26] overflow-hidden",style:{height:`${100-d}%`},children:[s.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:t.activeCaseIds.map(j=>{const k=e.activeCases.get(j)??j.slice(0,8),N=v===j;return s.jsx("button",{type:"button",onClick:()=>w(j),className:E("px-2 py-0.5 rounded text-[8px] font-mono truncate max-w-[160px] transition-colors flex-shrink-0",N?"bg-accent/20 text-accent ring-1 ring-accent/30":"text-slate-500 hover:text-slate-300 hover:bg-slate-800"),children:k},j)})}),s.jsx(nf,{tab:y,setTab:b,stepCount:u.length,logCount:g.length}),s.jsx(rf,{tab:y,stepLogs:u,consoleLogs:g,endRef:p}),e.completed&&!r&&s.jsx("div",{className:"flex-shrink-0 border-t border-slate-700 p-3",children:s.jsx(sf,{completed:e.completed,onRunAgain:a})})]})]}):s.jsxs("div",{className:"flex flex-1 overflow-hidden relative",style:{minHeight:0},children:[s.jsxs("div",{className:"flex flex-col bg-slate-900 overflow-hidden",style:{width:`${o}%`},children:[s.jsx(kS,{onOpenExternal:i,browser:e.currentBrowser}),s.jsxs("div",{className:"flex-1 relative overflow-hidden flex items-center justify-center",children:[t.screenshot?s.jsx("img",{src:`data:image/jpeg;base64,${t.screenshot}`,alt:"Browser",className:E("max-w-full max-h-full object-contain",e.completed&&!r&&"opacity-30")}):r?s.jsx(SS,{progress:e}):null,e.completed&&!r&&s.jsx("div",{className:E("w-full",t.screenshot?"absolute inset-0 flex items-center justify-center bg-black/50 backdrop-blur-sm":"p-6"),children:s.jsx(sf,{completed:e.completed,onRunAgain:a})}),s.jsx(CS,{step:e.currentStep})]})]}),s.jsx(ES,{onMouseDown:c}),s.jsxs("div",{className:"flex flex-col bg-[#1a1b26] overflow-hidden",style:{width:`${100-o}%`},children:[s.jsx(nf,{tab:y,setTab:b,stepCount:u.length,logCount:g.length}),s.jsx(rf,{tab:y,stepLogs:u,consoleLogs:g,endRef:p})]})]})]})}function sf({completed:e,onRunAgain:t}){const n=e.failed===0;return s.jsxs("div",{className:E("w-full max-w-sm rounded-2xl border p-5 shadow-lg",n?"border-emerald-500/30 bg-emerald-950/80":"border-red-500/30 bg-red-950/80"),children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[n?s.jsx(we,{size:22,className:"text-emerald-400 flex-shrink-0"}):s.jsx(st,{size:22,className:"text-red-400 flex-shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:E("text-sm font-bold",n?"text-emerald-300":"text-red-300"),children:n?"All tests passed!":"Run completed with failures"}),s.jsxs("p",{className:E("text-[10px]",n?"text-emerald-400/70":"text-red-400/70"),children:["Finished in ",Math.round(e.duration/1e3),"s"]})]})]}),s.jsx("div",{className:"grid grid-cols-3 gap-2 mb-4",children:[{label:"Passed",value:e.passed,color:"text-emerald-400",bg:"bg-emerald-500/10 ring-emerald-500/20"},{label:"Failed",value:e.failed,color:"text-red-400",bg:"bg-red-500/10 ring-red-500/20"},{label:"Skipped",value:e.skipped,color:"text-slate-400",bg:"bg-slate-500/10 ring-slate-500/20"}].map(({label:r,value:a,color:i,bg:l})=>s.jsxs("div",{className:E("rounded-xl p-2.5 text-center ring-1",l),children:[s.jsx("p",{className:E("text-lg font-bold tabular-nums",i),children:a}),s.jsx("p",{className:"text-[8px] text-slate-400 uppercase tracking-wider",children:r})]},r))}),s.jsxs("button",{type:"button",onClick:t,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:[s.jsx(Tl,{size:11})," Run Again"]})]})}function wS({elapsed:e,runActive:t,progress:n,onRunAgain:r,onStop:a}){var i;return s.jsxs("div",{className:"flex-shrink-0 px-4 py-2 bg-surface border-b border-border flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("div",{className:E("w-7 h-7 rounded-lg flex items-center justify-center",t?"bg-gradient-to-br from-emerald-500 to-cyan-600":(i=n.completed)!=null&&i.failed?"bg-gradient-to-br from-red-500 to-rose-600":"bg-gradient-to-br from-emerald-500 to-green-600"),children:t?s.jsx(ae,{size:13,className:"text-white animate-spin"}):s.jsx(we,{size:13,className:"text-white"})}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("p",{className:"text-xs font-bold text-content",children:t?"Running Tests":"Run Complete"}),t&&s.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"})]}),n.currentCase&&t&&s.jsx("p",{className:"text-[9px] text-content-tertiary truncate max-w-xs",children:n.currentCase.caseName})]})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[!t&&n.completed&&s.jsxs("div",{className:"flex items-center gap-1.5 mr-2",children:[s.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:[s.jsx(we,{size:8})," ",n.completed.passed]}),n.completed.failed>0&&s.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:[s.jsx(st,{size:8})," ",n.completed.failed]})]}),t&&s.jsxs("button",{type:"button",onClick:a,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:[s.jsx(Ey,{size:9,className:"fill-current"})," Stop"]}),s.jsxs("div",{className:"flex items-center gap-1.5 text-content-tertiary",children:[s.jsx(Kr,{size:10}),s.jsx("p",{className:"text-xs font-mono font-bold text-content-secondary",children:e})]}),!t&&s.jsxs("button",{type:"button",onClick:r,className:"text-[10px] font-medium text-accent hover:text-accent-dark flex items-center gap-1 ml-1",children:[s.jsx(Tl,{size:10})," New Run"]})]})]})}function kS({onOpenExternal:e,onToggleFullscreen:t,fullscreen:n,browser:r}){return s.jsxs("div",{className:"flex-shrink-0 h-8 bg-slate-800 border-b border-slate-700 flex items-center justify-between px-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-red-500/80"}),s.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-amber-500/80"}),s.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-emerald-500/80"})]}),r?s.jsxs("div",{className:"flex items-center gap-1.5 ml-2",children:[s.jsx(Ja,{browser:r,size:14}),s.jsx("span",{className:"text-[10px] font-semibold text-slate-300 uppercase tracking-wider",children:Km(r)})]}):s.jsx("span",{className:"text-[10px] font-semibold text-slate-400 uppercase tracking-wider ml-2",children:"Browser Preview"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[t&&s.jsx("button",{type:"button",onClick:t,title:n?"Exit fullscreen":"Fullscreen",className:"p-1 rounded text-slate-400 hover:text-white hover:bg-slate-700 transition-colors",children:n?s.jsx(ow,{size:11}):s.jsx(Dm,{size:11})}),s.jsx("button",{type:"button",onClick:e,title:"Open in external browser",className:"p-1 rounded text-slate-400 hover:text-white hover:bg-slate-700 transition-colors",children:s.jsx(ni,{size:11})})]})]})}function SS({progress:e}){return s.jsxs("div",{className:"flex flex-col items-center gap-4 p-8 max-w-xs",children:[s.jsxs("div",{className:"w-48 h-32 rounded-xl bg-slate-800 border border-slate-700 overflow-hidden relative",children:[s.jsxs("div",{className:"h-5 bg-slate-750 border-b border-slate-700 flex items-center px-2 gap-1.5",children:[s.jsxs("div",{className:"flex gap-1",children:[s.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-red-500/50"}),s.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-500/50"}),s.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500/50"})]}),s.jsx("div",{className:"flex-1 h-2.5 rounded bg-slate-700 ml-1"})]}),s.jsxs("div",{className:"p-2 space-y-1.5",children:[s.jsx("div",{className:"h-2 bg-slate-700 rounded w-3/4 animate-pulse"}),s.jsx("div",{className:"h-2 bg-slate-700 rounded w-1/2 animate-pulse",style:{animationDelay:"200ms"}}),s.jsx("div",{className:"h-2 bg-slate-700 rounded w-5/6 animate-pulse",style:{animationDelay:"400ms"}}),s.jsx("div",{className:"h-6 bg-accent/10 rounded mt-2 animate-pulse border border-accent/20",style:{animationDelay:"600ms"}})]}),s.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%"}})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-xs font-semibold text-slate-300",children:e.currentCase?"Executing test...":"Launching browser..."}),e.currentCase&&s.jsx("p",{className:"text-[10px] text-slate-500 mt-1 truncate max-w-[200px]",children:e.currentCase.caseName})]}),s.jsx("div",{className:"flex items-center gap-1.5",children:[0,160,320].map(t=>s.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-accent animate-bounce",style:{animationDelay:`${t}ms`}},t))}),s.jsx("style",{children:`
913
+ @keyframes scan-line {
914
+ 0%, 100% { top: 20%; opacity: 0; }
915
+ 50% { top: 80%; opacity: 0.6; }
916
+ }
917
+ `})]})}function CS({step:e}){return e?s.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent px-4 py-3",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse flex-shrink-0"}),s.jsx("p",{className:"text-[10px] text-white/80 truncate font-mono",children:e.instruction})]})}):null}function ES({onMouseDown:e}){return s.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:e,children:[s.jsx("div",{className:"absolute inset-y-0 -left-1.5 -right-1.5"})," ",s.jsx(Fc,{size:10,className:"text-slate-500 group-hover:text-white"})]})}function nf({tab:e,setTab:t,stepCount:n,logCount:r}){return s.jsxs("div",{className:"flex-shrink-0 h-8 bg-[#1e1f2e] border-b border-slate-700 flex items-center px-1",children:[s.jsxs("button",{type:"button",onClick:()=>t("steps"),className:E("flex items-center gap-1.5 px-3 h-full text-[10px] font-semibold uppercase tracking-wider border-b-2 transition-colors",e==="steps"?"text-accent border-accent":"text-slate-500 border-transparent hover:text-slate-300"),children:[s.jsx(Dt,{size:9})," Steps",n>0&&s.jsx("span",{className:"text-[8px] ml-0.5 opacity-60",children:n})]}),s.jsxs("button",{type:"button",onClick:()=>t("console"),className:E("flex items-center gap-1.5 px-3 h-full text-[10px] font-semibold uppercase tracking-wider border-b-2 transition-colors",e==="console"?"text-accent border-accent":"text-slate-500 border-transparent hover:text-slate-300"),children:[s.jsx($c,{size:9})," Console",r>0&&s.jsx("span",{className:"text-[8px] ml-0.5 opacity-60",children:r})]})]})}function rf({tab:e,stepLogs:t,consoleLogs:n,endRef:r}){return e==="steps"?s.jsxs("div",{className:"flex-1 overflow-y-auto text-[10px] px-3 py-2 space-y-0.5",children:[t.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 text-slate-600",children:[s.jsx(Dt,{size:18}),s.jsx("p",{className:"text-[10px]",children:"Steps will appear as they execute..."})]}):t.map((a,i)=>s.jsxs("div",{className:"flex items-start gap-2 py-1 px-2 rounded hover:bg-white/[0.02] -mx-1",children:[s.jsx("div",{className:"flex-shrink-0 mt-0.5",children:a.status==="passed"?s.jsx(we,{size:11,className:"text-emerald-400"}):a.status==="failed"?s.jsx(st,{size:11,className:"text-red-400"}):s.jsx(_c,{size:11,className:"text-slate-500"})}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:E("font-mono truncate",a.status==="passed"?"text-slate-300":a.status==="failed"?"text-red-300":"text-slate-500"),children:a.instruction})}),s.jsxs("span",{className:"text-slate-600 flex-shrink-0 tabular-nums",children:[a.duration,"ms"]})]},`${a.stepId}-${i}`)),s.jsx("div",{ref:r})]}):s.jsxs("div",{className:"flex-1 overflow-y-auto font-mono text-[10px] px-3 py-2 space-y-px",children:[n.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 text-slate-600",children:[s.jsx($c,{size:18}),s.jsx("p",{className:"text-[10px]",children:"Console logs will appear here..."})]}):n.map((a,i)=>{const l=ef[a.type]??ef.default,o=tf[a.type]??tf.debug,c=new Date(a.timestamp).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});return s.jsxs("div",{className:"flex items-start gap-2 py-0.5 hover:bg-white/[0.02] rounded px-1 -mx-1",children:[s.jsx("span",{className:"text-slate-600 flex-shrink-0 tabular-nums",children:c}),s.jsx("span",{className:E("flex-shrink-0 uppercase text-[8px] font-bold w-9",o),children:a.type.slice(0,5)}),s.jsx("span",{className:E("break-all",l),children:a.text})]},i)}),s.jsx("div",{ref:r})]})}function pc({label:e,color:t,className:n}){return s.jsx("span",{className:E("inline-flex items-center px-2 py-0.5 rounded-md text-[11px] font-semibold tracking-wide",t??"bg-surface-inset text-content-secondary",n),children:e})}function Wm({status:e}){const t={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 s.jsx(pc,{label:e,color:t[e]??"bg-slate-100 text-slate-600"})}function Vc({children:e,className:t,padding:n=!0}){return s.jsx("div",{className:E("bg-surface rounded-xl border border-border shadow-card transition-shadow duration-200",n&&"p-5",t),children:e})}const PS={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 no({label:e,value:t,sub:n,color:r,icon:a}){const i=r?PS[r]:null;return s.jsxs("div",{className:E("rounded-xl border px-4 py-3.5 flex items-center gap-3.5 transition-all duration-200",i?`${i.bg} ${i.border}`:"bg-surface border-border"),children:[a&&s.jsx("div",{className:E("flex items-center justify-center w-9 h-9 rounded-lg flex-shrink-0",i?`${i.bg} ${i.icon}`:"bg-surface-inset text-content-tertiary"),children:a}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-content-tertiary leading-none",children:e}),s.jsx("p",{className:E("font-bold mt-1.5 leading-none",typeof t=="string"&&t.length>3?"text-sm":"text-lg",i?i.value:"text-content"),children:t}),n&&s.jsx("p",{className:"text-[11px] text-content-tertiary mt-1",children:n})]})]})}function RS(e){switch(e){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 MS({steps:e,onSelect:t}){const n=e.filter(r=>r.screenshotPath);return n.length<2?null:s.jsx("div",{className:"flex gap-2 overflow-x-auto pb-1",style:{scrollbarWidth:"thin"},children:n.map((r,a)=>{const i=ri("screenshots",r.screenshotPath),l=r.healed?"healed":r.status;return s.jsxs("button",{type:"button",onClick:()=>t(i),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:r.instruction,children:[s.jsx("img",{src:i,alt:`Step ${a+1}`,className:"w-full h-full object-cover"}),s.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:a+1}),s.jsx("span",{className:E("absolute bottom-1 right-1 w-2 h-2 rounded-full ring-1 ring-white/50",RS(l))})]},r.stepId)})})}function TS(e){if(e.healed)return"bg-amber-500";switch(e.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 zS({steps:e}){const[t,n]=m.useState(null),r=e.reduce((i,l)=>i+(l.duration??0),0);if(r===0||e.length===0)return null;let a=0;return s.jsxs("div",{className:"px-3 py-2 border-t border-border bg-surface-inset/20",children:[s.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-wider mb-2",children:"Execution Timeline"}),s.jsx("div",{className:"relative h-5 bg-surface-inset rounded overflow-hidden",children:e.map((i,l)=>{const o=i.duration/r*100,c=a/r*100;return a+=i.duration,s.jsx("div",{className:E("absolute top-0 h-full transition-opacity hover:opacity-80 cursor-default",TS(i)),style:{left:`${c}%`,width:`${Math.max(o,.5)}%`},onMouseEnter:()=>n(`${i.instruction} — ${i.duration}ms`),onMouseLeave:()=>n(null)},i.stepId??l)})}),t&&s.jsx("p",{className:"text-[9px] text-content-secondary mt-1 truncate",children:t}),s.jsx("div",{className:"flex mt-1 relative",style:{height:14},children:(()=>{let i=0;return e.map((l,o)=>{const c=l.duration/r*100,d=i/r*100;i+=l.duration;const x=(l.instruction??"").slice(0,8);return s.jsx("div",{className:"absolute text-[8px] text-content-tertiary truncate overflow-hidden",style:{left:`${d}%`,width:`${Math.max(c,2)}%`,top:0},title:l.instruction,children:x},l.stepId??o)})})()})]})}function AS({stepId:e,currentScreenshotPath:t}){const{data:n,refetch:r}=me({queryKey:["baseline",e],queryFn:()=>_p.get(e),enabled:!!e}),a=W({mutationFn:()=>{if(!t)throw new Error("No screenshot available");return _p.capture(e,t)},onSuccess:()=>{A.success("Baseline saved"),r()},onError:o=>A.error(o.message)}),i=t?ri("screenshots",t):null,l=n!=null&&n.hasBaseline?`${Dw(e)}?t=${n.capturedAt??Date.now()}`:null;return s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Visual Regression"}),s.jsxs("div",{className:"flex items-center gap-2",children:[(n==null?void 0:n.hasBaseline)&&s.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"}),t&&s.jsxs("button",{type:"button",onClick:()=>a.mutate(),disabled:a.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:[s.jsx(Hn,{size:9})," Set as Baseline"]})]})]}),s.jsxs("div",{className:"flex gap-3",children:[i&&s.jsxs("div",{className:"flex-1",children:[s.jsx("p",{className:"text-[8px] text-content-tertiary mb-1",children:"Current"}),s.jsx("img",{src:i,alt:"Current screenshot",className:"rounded border border-border max-h-32 object-contain"})]}),l&&s.jsxs("div",{className:"flex-1",children:[s.jsx("p",{className:"text-[8px] text-content-tertiary mb-1",children:"Baseline"}),s.jsx("img",{src:l,alt:"Baseline screenshot",className:"rounded border border-border max-h-32 object-contain"})]}),!l&&i&&s.jsx("div",{className:"flex-1 flex items-center justify-center border border-dashed border-border rounded-lg min-h-[80px]",children:s.jsx("p",{className:"text-[10px] text-content-tertiary",children:"No baseline set"})})]})]})}function Vm(e,t){if(t==null)return"na";switch(e){case"fcp":return t<1800?"good":t<3e3?"needs-improvement":"poor";case"lcp":return t<2500?"good":t<4e3?"needs-improvement":"poor";case"cls":return t<.1?"good":t<.25?"needs-improvement":"poor";case"ttfb":return t<800?"good":t<1800?"needs-improvement":"poor";case"tbt":return t<200?"good":t<600?"needs-improvement":"poor";case"si":return t<3400?"good":t<5800?"needs-improvement":"poor";case"tti":return t<3800?"good":t<7300?"needs-improvement":"poor";case"inp":return t<200?"good":t<500?"needs-improvement":"poor"}}const OS={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 DS(e,t){return t==null?"—":e==="cls"?t.toFixed(3):t<1e3?`${Math.round(t)}ms`:`${(t/1e3).toFixed(2)}s`}function Gm(e){return e==null?{ring:"ring-border",text:"text-content-tertiary",bg:"bg-surface-inset",label:"—"}:e>=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"}:e>=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 Qm=[{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 af({metricKey:e,value:t}){const n=Vm(e,t),r=Qm.find(a=>a.key===e);return s.jsxs("div",{className:E("rounded-lg px-2 py-2 ring-1 text-center flex-1 min-w-[70px]",OS[n]),children:[s.jsx("p",{className:"text-[8px] font-bold uppercase tracking-widest opacity-60 mb-0.5",children:r.label}),s.jsx("p",{className:"text-xs font-bold tabular-nums leading-tight",children:DS(e,t)})]})}function Yd({score:e,label:t}){const n=Gm(e),r=24,a=2*Math.PI*r,i=e!=null?e/100*a:0;return s.jsxs("div",{className:E("flex flex-col items-center justify-center rounded-xl px-3 py-2.5 ring-2 flex-1",n.bg,n.ring),children:[s.jsxs("div",{className:"relative w-14 h-14",children:[s.jsxs("svg",{className:"w-14 h-14 -rotate-90",viewBox:"0 0 60 60",children:[s.jsx("circle",{cx:"30",cy:"30",r,fill:"none",stroke:"currentColor",strokeWidth:"5",className:"opacity-10"}),s.jsx("circle",{cx:"30",cy:"30",r,fill:"none",stroke:"currentColor",strokeWidth:"5",strokeDasharray:a,strokeDashoffset:a-i,strokeLinecap:"round",className:n.text})]}),s.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:s.jsx("span",{className:E("text-base font-black tabular-nums",n.text),children:e??"—"})})]}),s.jsx("p",{className:E("text-[8px] font-bold mt-1 leading-tight",n.text),children:n.label}),s.jsx("p",{className:"text-[8px] text-content-tertiary mt-px text-center leading-tight",children:t})]})}function lf({audits:e,label:t,score:n}){if(!e||e.length===0)return null;const r=e.filter(c=>!c.passed&&!c.partial&&!c.na),a=e.filter(c=>!!c.partial),i=e.filter(c=>c.passed),l=e.filter(c=>!!c.na),o=Gm(n);return s.jsxs("div",{className:"mt-2 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[s.jsxs("p",{className:"text-[8px] font-bold text-content-tertiary uppercase tracking-widest flex-1",children:[t," Audits"]}),n!=null&&s.jsx("span",{className:E("text-[9px] font-black px-1.5 py-0.5 rounded-md ring-1",o.bg,o.text,o.ring),children:n})]}),s.jsxs("div",{className:"space-y-0.5 max-h-48 overflow-y-auto pr-1",children:[r.map(c=>s.jsxs("div",{className:"flex items-start gap-1.5 text-[9px] text-red-600 dark:text-red-400 font-medium",children:[s.jsx(st,{size:9,className:"text-red-500 flex-shrink-0 mt-px"}),s.jsx("span",{className:"leading-tight",children:c.title})]},c.id)),a.map(c=>s.jsxs("div",{className:"flex items-start gap-1.5 text-[9px] text-amber-600 dark:text-amber-400 font-medium",children:[s.jsx(ts,{size:9,className:"text-amber-500 flex-shrink-0 mt-px"}),s.jsx("span",{className:"leading-tight",children:c.title})]},c.id)),l.map(c=>s.jsxs("div",{className:"flex items-start gap-1.5 text-[9px] text-content-tertiary",children:[s.jsx(V2,{size:9,className:"text-content-tertiary flex-shrink-0 mt-px"}),s.jsx("span",{className:"leading-tight",children:c.title})]},c.id)),i.map(c=>s.jsxs("div",{className:"flex items-start gap-1.5 text-[9px] text-emerald-600 dark:text-emerald-400",children:[s.jsx(we,{size:9,className:"text-emerald-500 flex-shrink-0 mt-px"}),s.jsx("span",{className:"leading-tight",children:c.title})]},c.id))]})]})}function IS(e,t){let n=0,r=0,a=0;if(t==="performance")for(const i of e)for(const{key:l}of Qm){const o=Vm(l,i[l]);o==="good"?n++:o==="needs-improvement"?r++:o==="poor"&&a++}else{const i=t==="accessibility"?"a11yAudits":"seoAudits",l=t==="accessibility"?"a11yScore":"seoScore";for(const o of e){const c=o[i]??[];n+=c.filter(x=>x.passed).length,r+=c.filter(x=>!!x.partial).length,a+=c.filter(x=>!x.passed&&!x.partial&&!x.na).length;const d=Gm(o[l]);d.label==="Good"?n++:d.label==="Needs Work"?r++:d.label==="Poor"&&a++}}return{good:n,warn:r,poor:a}}function FS({caseName:e,pageLoads:t,focus:n="performance",onClose:r}){const[a,i]=m.useState(n),l=IS(t,a),o=a==="performance"?"metrics":a==="accessibility"?"a11y checks":"seo checks",c=[{key:"performance",label:"Performance",icon:s.jsx(qe,{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:s.jsx(xx,{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:s.jsx(Wn,{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 s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 bg-black/30 z-40",onClick:r}),s.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:[s.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:[s.jsxs("div",{className:"flex items-center gap-3 px-5 py-3",children:[s.jsx("div",{className:E("w-7 h-7 rounded-lg flex items-center justify-center flex-shrink-0",a==="performance"?"bg-violet-500":a==="accessibility"?"bg-blue-500":"bg-emerald-500"),children:a==="performance"?s.jsx(qe,{size:13,className:"text-white"}):a==="accessibility"?s.jsx(xx,{size:13,className:"text-white"}):s.jsx(Wn,{size:13,className:"text-white"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs font-bold text-content",children:"Lighthouse Audit"}),s.jsx("p",{className:"text-[10px] text-content-tertiary truncate",children:e})]}),s.jsx("button",{type:"button",onClick:r,className:"p-1.5 rounded-lg text-content-tertiary hover:text-content hover:bg-surface-inset transition-colors",children:s.jsx(ye,{size:14})})]}),s.jsx("div",{className:"flex gap-1 px-5 pb-0",children:c.map(d=>s.jsxs("button",{type:"button",onClick:()=>i(d.key),className:E("flex items-center gap-1.5 px-3 py-1.5 text-[10px] font-semibold rounded-t-lg border-b-2 transition-colors",a===d.key?"border-current "+d.color+" bg-surface/80":"border-transparent text-content-tertiary hover:text-content-secondary"),children:[d.icon," ",d.label]},d.key))})]}),l.good+l.warn+l.poor>0&&s.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:[s.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest flex-shrink-0",children:["Overall ",s.jsxs("span",{className:"normal-case font-normal opacity-60",children:["(",o,")"]})]}),s.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[l.good>0&&s.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-emerald-700 dark:text-emerald-400 font-semibold",children:[s.jsx("span",{className:"text-emerald-500 text-[11px] leading-none",children:"●"}),l.good," ",a==="performance"?"Good":"Passed"]}),l.warn>0&&s.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-amber-700 dark:text-amber-400 font-semibold",children:[s.jsx("span",{className:"text-amber-400 text-[11px] leading-none",children:"●"}),l.warn," Needs Work"]}),l.poor>0&&s.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-red-700 dark:text-red-400 font-semibold",children:[s.jsx("span",{className:"text-red-500 text-[11px] leading-none",children:"●"}),l.poor," ",a==="performance"?"Poor":"Failed"]})]}),s.jsxs("p",{className:"text-[9px] text-content-tertiary",children:[t.length," page",t.length!==1?"s":""]})]}),s.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-5",children:t.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-center",children:[s.jsx(qe,{size:24,className:"text-content-tertiary mb-2 opacity-40"}),s.jsx("p",{className:"text-xs text-content-tertiary",children:"No page navigations recorded"}),s.jsx("p",{className:"text-[10px] text-content-tertiary mt-1 opacity-60",children:"Only available for Chromium browser runs"})]}):t.map((d,x)=>{var p,y;return s.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-sm overflow-hidden",children:[s.jsxs("div",{className:"px-4 py-2.5 bg-surface-inset/50 border-b border-border",children:[s.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-0.5",children:["Step ",d.stepIndex+1]}),s.jsx("p",{className:"text-[10px] text-content-secondary truncate mb-1",title:d.stepInstruction,children:d.stepInstruction}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(nn,{size:9,className:"text-indigo-400 dark:text-indigo-500 flex-shrink-0"}),s.jsx("p",{className:"text-[10px] font-mono text-indigo-600 dark:text-indigo-400 truncate font-medium",title:d.url,children:d.url})]})]}),d.lighthouseError?s.jsxs("div",{className:"px-4 py-3 flex items-start gap-2",children:[s.jsx(ts,{size:12,className:"text-amber-500 flex-shrink-0 mt-0.5"}),s.jsx("p",{className:"text-[10px] text-amber-700 dark:text-amber-400",children:d.lighthouseError})]}):s.jsxs("div",{className:"px-4 py-3 space-y-3",children:[a==="performance"&&s.jsxs(s.Fragment,{children:[s.jsx(Yd,{score:d.score,label:"Performance"}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("p",{className:"text-[8px] font-bold text-content-tertiary uppercase tracking-widest",children:"Core Web Vitals"}),s.jsx("div",{className:"flex gap-1.5 flex-wrap",children:["fcp","lcp","cls","ttfb"].map(b=>s.jsx(af,{metricKey:b,value:d[b]},b))}),s.jsx("div",{className:"flex gap-1.5 flex-wrap",children:["tbt","si","tti","inp"].map(b=>s.jsx(af,{metricKey:b,value:d[b]},b))})]}),s.jsx("div",{className:"pt-1 border-t border-border/50 grid grid-cols-2 gap-x-4 gap-y-0.5",children:Qm.map(({key:b,label:f,desc:v})=>{const w=Vm(b,d[b]);return s.jsxs("div",{className:"flex items-center gap-1.5 text-[8px] text-content-tertiary",children:[s.jsx("span",{className:E("text-[10px] leading-none flex-shrink-0",w==="good"?"text-emerald-500":w==="needs-improvement"?"text-amber-400":w==="poor"?"text-red-500":"text-slate-300"),children:"●"}),s.jsx("span",{className:"font-medium",children:f}),s.jsx("span",{className:"opacity-60 truncate",children:v})]},b)})})]}),a==="accessibility"&&s.jsxs(s.Fragment,{children:[s.jsx(Yd,{score:d.a11yScore,label:"Accessibility"}),(((p=d.a11yAudits)==null?void 0:p.length)??0)>0?s.jsx(lf,{audits:d.a11yAudits,label:"Accessibility",score:d.a11yScore}):s.jsx("p",{className:"text-[10px] text-content-tertiary",children:"No accessibility audit data available."})]}),a==="seo"&&s.jsxs(s.Fragment,{children:[s.jsx(Yd,{score:d.seoScore,label:"SEO"}),(((y=d.seoAudits)==null?void 0:y.length)??0)>0?s.jsx(lf,{audits:d.seoAudits,label:"SEO",score:d.seoScore}):s.jsx("p",{className:"text-[10px] text-content-tertiary",children:"No SEO audit data available."})]})]})]},x)})}),s.jsx("div",{className:"px-5 py-2.5 border-t border-border bg-surface-inset/30 flex-shrink-0",children:s.jsx("p",{className:"text-[9px] text-content-tertiary text-center",children:"Powered by Google Lighthouse · Desktop preset · Chromium only"})})]})]})}function LS({src:e,onClose:t}){return s.jsxs("div",{className:"fixed inset-0 bg-black/80 z-50 flex flex-col items-center justify-center p-4",onClick:t,children:[s.jsxs("div",{className:"absolute top-4 right-4 flex items-center gap-2",children:[s.jsx("a",{href:e,download:!0,onClick:n=>n.stopPropagation(),title:"Download",className:"text-white/70 hover:text-white p-2 rounded-lg bg-surface/10 hover:bg-surface/20",children:s.jsx(Ga,{size:14})}),s.jsx("button",{type:"button",onClick:t,className:"text-white/70 hover:text-white p-2 rounded-lg bg-surface/10 hover:bg-surface/20",children:s.jsx(ye,{size:14})})]}),s.jsx("img",{src:e,alt:"Screenshot",className:"max-w-full max-h-full rounded-lg shadow-2xl object-contain",onClick:n=>n.stopPropagation()}),s.jsx("p",{className:"text-white/40 text-[10px] mt-2",children:"Click outside to close"})]})}function _S({step:e,onScreenshot:t}){const[n,r]=m.useState(e.status==="failed"),a=e.screenshotPath?ri("screenshots",e.screenshotPath):null,i=e.status==="passed"?s.jsx(we,{size:11,className:"text-emerald-500 flex-shrink-0"}):e.status==="failed"?s.jsx(st,{size:11,className:"text-red-500 flex-shrink-0"}):s.jsx(_c,{size:11,className:"text-content-tertiary flex-shrink-0"});return s.jsxs("div",{className:"border-t border-border/50 first:border-0",children:[s.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:()=>r(l=>!l),children:[i,s.jsx("span",{className:E("text-[8px] px-1 py-px rounded font-bold uppercase ring-1 flex-shrink-0",e.stepType==="api"?"bg-violet-50 text-violet-600 ring-violet-200":"bg-blue-50 text-blue-600 ring-blue-200"),children:e.stepType==="api"?"API":"UI"}),s.jsx("span",{className:E("flex-1 truncate text-[10px]",e.status==="failed"?"text-red-700 font-medium":"text-content-secondary"),children:e.instruction}),e.healed&&s.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"}),a&&s.jsx("button",{type:"button",title:"View screenshot",className:"text-content-tertiary hover:text-accent flex-shrink-0 p-0.5",onClick:l=>{l.stopPropagation(),t(a)},children:s.jsx(Hn,{size:10})}),s.jsxs("span",{className:"text-content-tertiary w-10 text-right flex-shrink-0 tabular-nums text-[9px]",children:[e.duration,"ms"]}),n?s.jsx(W2,{size:10,className:"text-content-tertiary flex-shrink-0"}):s.jsx(ht,{size:10,className:"text-content-tertiary flex-shrink-0"})]}),n&&s.jsxs("div",{className:"px-3 pb-2.5 pt-1 space-y-2 bg-surface-inset/30",children:[e.code&&s.jsxs("div",{children:[s.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:"Code"}),s.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:e.code})]}),e.error&&s.jsxs("div",{children:[s.jsx("p",{className:"text-[9px] font-bold text-red-500 uppercase tracking-widest mb-1",children:"Error"}),s.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:e.error})]}),e.healed&&e.healedCode&&s.jsxs("div",{children:[s.jsx("p",{className:"text-[9px] font-bold text-amber-600 uppercase tracking-widest mb-1",children:"Healed Code"}),s.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:e.healedCode})]}),e.apiRequest&&s.jsxs("div",{children:[s.jsx("p",{className:"text-[9px] font-bold text-violet-500 uppercase tracking-widest mb-1",children:"API Request"}),s.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:`${e.apiRequest.method} ${e.apiRequest.url}${e.apiRequest.headers?`
918
+ Headers: `+JSON.stringify(e.apiRequest.headers,null,2):""}${e.apiRequest.body?`
919
+ Body: `+e.apiRequest.body:""}`})]}),e.apiResponse&&s.jsxs("div",{children:[s.jsxs("p",{className:"text-[9px] font-bold text-indigo-500 uppercase tracking-widest mb-1",children:["API Response — ",e.apiResponse.status," ",e.apiResponse.statusText," (",e.apiResponse.duration,"ms)"]}),s.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:e.apiResponse.body?e.apiResponse.body.slice(0,2e3):"(empty body)"})]}),a&&s.jsxs("div",{children:[s.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:"Screenshot"}),s.jsxs("div",{className:"relative group inline-block",children:[s.jsx("img",{src:a,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:()=>t(a)}),s.jsx("button",{type:"button",onClick:()=>t(a),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:s.jsx(Dm,{size:10})})]}),s.jsx("div",{className:"mt-2",children:s.jsx(AS,{stepId:e.stepId,currentScreenshotPath:e.screenshotPath})})]})]})]})}function $S({videoPath:e}){const t=ri("videos",e);return s.jsxs("div",{className:"border-t border-border bg-black",children:[s.jsxs("div",{className:"px-3 pt-2 pb-1 flex items-center justify-between",children:[s.jsxs("p",{className:"text-[10px] font-medium text-content-tertiary flex items-center gap-1.5",children:[s.jsx(Bc,{size:10})," Recording"]}),s.jsxs("a",{href:t,download:!0,title:"Download video",className:"text-[10px] text-content-tertiary hover:text-accent flex items-center gap-1",children:[s.jsx(Ga,{size:10})," Download"]})]}),s.jsx("video",{src:t,controls:!0,playsInline:!0,className:"w-full max-h-64 bg-black"})]})}function US({tracePath:e}){const t=e.replace(/\\/g,"/").split("/").pop()??"",n=ri("traces",e),r=`/trace/index.html?trace=${encodeURIComponent(`${window.location.origin}${n}`)}`;return s.jsxs("div",{className:"border-t border-border px-3 py-2 flex items-center justify-between bg-violet-50/30",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(fy,{size:12,className:"text-violet-500 flex-shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold text-content-secondary",children:"Playwright Trace"}),s.jsx("p",{className:"text-[9px] text-content-tertiary font-mono truncate max-w-[200px]",children:t})]})]}),s.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[s.jsxs("a",{href:r,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:[s.jsx(Dt,{size:9})," Open Viewer"]}),s.jsxs("a",{href:n,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:[s.jsx(Ga,{size:9})," .zip"]})]})]})}function BS({tc:e,suiteType:t,onScreenshot:n}){var b;const[r,a]=m.useState(e.status==="failed"),[i,l]=m.useState(!1),[o,c]=m.useState(null),d=e.steps.filter(f=>f.screenshotPath).length,x=e.steps.filter(f=>f.screenshotPath),y=(t==="audit"||t==="performance")&&(e.pageLoads??[]).some(f=>!f.lighthouseError&&(f.score!=null&&f.score<50||f.a11yScore!=null&&f.a11yScore<50||f.seoScore!=null&&f.seoScore<50));return s.jsxs("div",{className:E("border-t",y?"border-red-300 bg-red-50/30":"border-border/50"),children:[s.jsxs("div",{className:E("flex items-center gap-2 px-3 py-2 cursor-pointer select-none transition-colors",y?"hover:bg-red-50/50":"hover:bg-surface-inset/50"),onClick:()=>a(f=>!f),children:[r?s.jsx(ht,{size:11,className:"text-content-tertiary flex-shrink-0"}):s.jsx(Kt,{size:11,className:"text-content-tertiary flex-shrink-0"}),s.jsx(Wm,{status:e.status}),s.jsx("span",{className:"text-xs text-content font-medium flex-1 truncate",children:e.caseName}),s.jsxs("div",{className:"flex items-center gap-1.5",onClick:f=>f.stopPropagation(),children:[s.jsxs("button",{type:"button",title:"Toggle execution timeline",onClick:()=>l(f=>!f),className:E("flex items-center gap-0.5 text-[8px] px-1.5 py-0.5 rounded ring-1 transition-colors",i?"bg-indigo-100 text-indigo-600 ring-indigo-200":"bg-surface-inset text-content-tertiary ring-border hover:text-content-secondary"),children:[s.jsx(ps,{size:8})," timeline"]}),(((b=e.pageLoads)==null?void 0:b.length)??0)>0&&(()=>{const f=e.pageLoads,v=f.some(u=>u.score!=null||u.fcp!=null),w=f.some(u=>{var g;return u.a11yScore!=null||(((g=u.a11yAudits)==null?void 0:g.length)??0)>0}),h=f.some(u=>{var g;return u.seoScore!=null||(((g=u.seoAudits)==null?void 0:g.length)??0)>0});return s.jsxs(s.Fragment,{children:[v&&s.jsxs("button",{type:"button",onClick:u=>{u.stopPropagation(),c("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:[s.jsx(qe,{size:9})," Speed"]}),w&&s.jsxs("button",{type:"button",onClick:u=>{u.stopPropagation(),c("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:[s.jsx(xx,{size:9})," A11y"]}),h&&s.jsxs("button",{type:"button",onClick:u=>{u.stopPropagation(),c("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:[s.jsx(Wn,{size:9})," SEO"]})]})})(),e.device&&(()=>{const f=mb(e.device),v=(f==null?void 0:f.category)==="mobile"?Mi:(f==null?void 0:f.category)==="tablet"?Co:br,w=(f==null?void 0:f.name)??e.device;return s.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:w,children:[s.jsx(v,{size:8})," ",w]})})(),d>0&&s.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:[s.jsx(Hn,{size:8})," ",d]}),e.videoPath&&s.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:[s.jsx(Bc,{size:8})," video"]}),e.tracePath&&s.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:[s.jsx(fy,{size:8})," trace"]}),s.jsxs("span",{className:"text-[10px] text-content-tertiary tabular-nums",children:[(e.duration/1e3).toFixed(1),"s"]})]})]}),r&&s.jsxs("div",{className:"bg-surface",children:[x.length>=2&&s.jsxs("div",{className:"px-4 py-3 border-b border-border",children:[s.jsx("p",{className:"text-[10px] text-content-tertiary uppercase tracking-wider mb-2",children:"Screenshot Filmstrip"}),s.jsx(MS,{steps:e.steps,onSelect:n})]}),i&&s.jsx(zS,{steps:e.steps}),e.steps.map(f=>s.jsx(_S,{step:f,onScreenshot:n},f.stepId)),e.videoPath&&s.jsx($S,{videoPath:e.videoPath}),e.tracePath&&s.jsx(US,{tracePath:e.tracePath})]}),o&&s.jsx(FS,{caseName:e.caseName,pageLoads:e.pageLoads??[],focus:o,onClose:()=>c(null)})]})}function qS({runId:e}){const{data:t=[]}=me({queryKey:["report",e,"downloads"],queryFn:()=>qi.downloads(e)});return t.length===0?null:s.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-surface-inset/50 border-b border-border",children:[s.jsx(Ga,{size:12,className:"text-accent"}),s.jsx("span",{className:"text-xs font-semibold text-content",children:"Downloads"}),s.jsxs("span",{className:"text-[10px] text-content-tertiary",children:["· ",t.length," file",t.length!==1?"s":""]})]}),s.jsx("div",{className:"divide-y divide-border",children:t.map(n=>s.jsxs("a",{href:qi.downloadUrl(e,n.name),download:!0,className:"flex items-center justify-between px-3 py-2 hover:bg-surface-inset/50 transition-colors",children:[s.jsx("span",{className:"text-[11px] text-content font-mono truncate",children:n.name}),s.jsxs("span",{className:"flex items-center gap-2 flex-shrink-0",children:[s.jsxs("span",{className:"text-[10px] text-content-tertiary tabular-nums",children:[(n.size/1024).toFixed(1)," KB"]}),s.jsx(Ga,{size:12,className:"text-content-tertiary"})]})]},n.name))})]})}function HS({runId:e}){const[t,n]=m.useState(null),{data:r,isLoading:a}=me({queryKey:["report",e],queryFn:()=>lc.get(e)});return a?s.jsx("div",{className:"flex items-center justify-center py-6",children:s.jsx(ae,{size:14,className:"animate-spin text-accent"})}):r?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"px-3.5 pb-3 space-y-2",children:[s.jsx(qS,{runId:e}),r.suites.map(i=>s.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-surface-inset/50 border-b border-border",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Wm,{status:i.status}),s.jsx("span",{className:"text-xs font-semibold text-content",children:i.suiteName}),s.jsxs("span",{className:"text-[10px] text-content-tertiary",children:["· ",i.browser]})]}),s.jsxs("span",{className:"text-[10px] text-content-tertiary tabular-nums",children:[(i.duration/1e3).toFixed(1),"s"]})]}),i.cases.map(l=>s.jsx(BS,{tc:l,suiteType:i.suiteType,onScreenshot:n},l.caseId))]},i.suiteId))]}),t&&s.jsx(LS,{src:t,onClose:()=>n(null)})]}):null}const Ys={listBaselines:()=>fetch("/api/visual-regression/baselines").then(e=>e.json()),deleteBaseline:e=>fetch("/api/visual-regression/baselines",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}).then(t=>t.json()),updateBaseline:e=>fetch("/api/visual-regression/baselines/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(t=>t.json()),listDiffRuns:()=>fetch("/api/visual-regression/diffs").then(e=>e.json()),getDiffRun:e=>fetch(`/api/visual-regression/diffs/${e}`).then(t=>t.json()),updateDiffStatus:(e,t,n)=>fetch(`/api/visual-regression/diffs/${e}/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:n})}).then(r=>r.json()),approveAll:e=>fetch(`/api/visual-regression/diffs/${e}/approve-all`,{method:"POST"}).then(t=>t.json())},KS={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 mr(e){const t=e.replace(/\\/g,"/"),n=t.indexOf("baselines/"),r=t.indexOf("results/"),a=Math.min(n>=0?n:1/0,r>=0?r:1/0);return`/api/visual-regression/image/${a<1/0?t.slice(a):t}`}function WS({diff:e,onClose:t}){const[n,r]=m.useState("side-by-side"),[a,i]=m.useState(50);return s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:t,children:s.jsxs("div",{className:"bg-surface rounded-xl border border-border shadow-2xl max-w-[90vw] max-h-[90vh] overflow-auto p-6",onClick:l=>l.stopPropagation(),children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{children:[s.jsxs("h3",{className:"text-sm font-semibold text-content",children:[e.caseName," — ",e.stepId]}),s.jsxs("p",{className:"text-xs text-content-tertiary",children:[e.browser," | ",e.viewport," | Diff: ",e.diffPercentage,"%"]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[["side-by-side","slider"].map(l=>s.jsx("button",{onClick:()=>r(l),className:`px-2 py-1 text-xs rounded ${n===l?"bg-accent text-white":"bg-surface-inset text-content-secondary"}`,children:l==="side-by-side"?"Side by Side":"Slider"},l)),s.jsx("button",{onClick:t,className:"p-1 text-content-tertiary hover:text-content ml-2",children:s.jsx(ye,{size:18})})]})]}),n==="side-by-side"?s.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-medium text-content-tertiary mb-1 text-center",children:"Baseline"}),s.jsx("img",{src:mr(e.baselinePath),alt:"Baseline",className:"rounded border border-border w-full"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-medium text-content-tertiary mb-1 text-center",children:"Actual"}),s.jsx("img",{src:mr(e.actualPath),alt:"Actual",className:"rounded border border-border w-full"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-medium text-content-tertiary mb-1 text-center",children:"Diff"}),e.status==="new"||e.diffPercentage===0?s.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:s.jsxs("div",{className:"text-center",children:[s.jsx(we,{size:24,className:"mx-auto mb-1"}),s.jsx("p",{className:"text-xs font-medium",children:e.status==="new"?"New Baseline":"No Difference"})]})}):s.jsx("img",{src:mr(e.diffPath),alt:"Diff",className:"rounded border border-border w-full",onError:l=>{l.target.style.display="none"}})]})]}):s.jsxs("div",{children:[s.jsxs("div",{className:"relative overflow-hidden rounded border border-border",style:{maxWidth:800},children:[s.jsx("img",{src:mr(e.actualPath),alt:"Actual",className:"w-full block"}),s.jsx("div",{className:"absolute inset-0 overflow-hidden",style:{width:`${a}%`},children:s.jsx("img",{src:mr(e.baselinePath),alt:"Baseline",className:"block",style:{width:"800px",maxWidth:"none"}})}),s.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-accent cursor-col-resize",style:{left:`${a}%`}})]}),s.jsx("input",{type:"range",min:0,max:100,value:a,onChange:l=>i(Number(l.target.value)),className:"w-full mt-2 accent-accent"}),s.jsxs("div",{className:"flex justify-between text-[10px] text-content-tertiary",children:[s.jsx("span",{children:"Baseline"}),s.jsx("span",{children:"Actual"})]})]})]})})}function VS({diff:e,runId:t,onImageClick:n}){const r=ie(),a=W({mutationFn:()=>Ys.updateDiffStatus(t,e.stepId,"approved"),onSuccess:()=>{r.invalidateQueries({queryKey:["visual-diffs"]}),A.success("Approved")}}),i=W({mutationFn:()=>Ys.updateDiffStatus(t,e.stepId,"rejected"),onSuccess:()=>{r.invalidateQueries({queryKey:["visual-diffs"]}),A("Rejected")}}),l=W({mutationFn:()=>Ys.updateBaseline({actualPath:e.actualPath,baselinePath:e.baselinePath}),onSuccess:()=>{r.invalidateQueries({queryKey:["visual-baselines","visual-diffs"]}),A.success("Baseline updated")}});return s.jsxs(Vc,{padding:!1,className:"overflow-hidden",children:[s.jsxs("div",{className:"px-4 py-3 border-b border-border bg-surface-inset flex items-center gap-3",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("p",{className:"text-sm font-medium text-content truncate",children:[e.suiteName," / ",e.caseName]}),s.jsxs("p",{className:"text-xs text-content-tertiary mt-0.5",children:["Step: ",e.stepId," | ",e.browser," | ",e.viewport]})]}),s.jsx(pc,{label:e.status,color:KS[e.status]}),s.jsx(pc,{label:`${e.diffPercentage}%`,color:e.diffPercentage<=e.threshold?"bg-emerald-50 text-emerald-700":"bg-red-50 text-red-700"})]}),s.jsx("div",{className:"grid grid-cols-3 gap-2 p-3 cursor-pointer",onClick:()=>n(e),children:["Baseline","Actual","Diff"].map(o=>{const c=o==="Baseline"?e.baselinePath:o==="Actual"?e.actualPath:e.diffPath,d=o==="Diff"&&(e.status==="new"||e.diffPercentage===0);return s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-medium text-content-tertiary mb-1 text-center",children:o}),d?s.jsx("div",{className:"rounded border border-border w-full h-24 flex items-center justify-center bg-emerald-50 text-emerald-400",children:s.jsxs("div",{className:"text-center",children:[s.jsx(we,{size:14,className:"mx-auto mb-0.5"}),s.jsx("p",{className:"text-[9px] font-medium",children:e.status==="new"?"New Baseline":"No Diff"})]})}):s.jsx("img",{src:mr(c),alt:o,className:"rounded border border-border w-full h-24 object-cover object-top",onError:x=>{x.target.style.display="none"}})]},o)})}),s.jsxs("div",{className:"px-4 py-2 border-t border-border flex items-center gap-2 justify-end",children:[(e.status==="failed"||e.status==="new")&&s.jsxs(s.Fragment,{children:[s.jsxs(se,{size:"sm",variant:"ghost",loading:l.isPending,onClick:()=>l.mutate(),children:[s.jsx(Om,{size:14})," Update Baseline"]}),s.jsxs(se,{size:"sm",variant:"ghost",loading:a.isPending,onClick:()=>a.mutate(),children:[s.jsx(ze,{size:14})," Approve"]}),s.jsxs(se,{size:"sm",variant:"ghost",loading:i.isPending,onClick:()=>i.mutate(),children:[s.jsx(ye,{size:14})," Reject"]})]}),e.status==="approved"&&s.jsxs("span",{className:"text-xs text-green-600 flex items-center gap-1",children:[s.jsx(we,{size:14})," Approved"]}),e.status==="rejected"&&s.jsxs("span",{className:"text-xs text-red-600 flex items-center gap-1",children:[s.jsx(st,{size:14})," Rejected"]}),e.status==="passed"&&s.jsxs("span",{className:"text-xs text-emerald-600 flex items-center gap-1",children:[s.jsx(we,{size:14})," Passed"]})]})]})}function GS(){const e=ie(),[t,n]=m.useState(""),[r,a]=m.useState(null),{data:i=[],isLoading:l}=me({queryKey:["visual-diff-runs"],queryFn:Ys.listDiffRuns}),o=t||(i.length>0?i[0].runId:""),{data:c,isLoading:d}=me({queryKey:["visual-diffs",o],queryFn:()=>Ys.getDiffRun(o),enabled:!!o}),x=W({mutationFn:()=>Ys.approveAll(o),onSuccess:()=>{e.invalidateQueries({queryKey:["visual-diffs","visual-diff-runs"]}),A.success("All diffs approved")}});if(l)return s.jsxs("div",{className:"flex items-center justify-center py-16 text-content-tertiary",children:[s.jsx(ae,{className:"animate-spin mr-2",size:18})," Loading diff runs..."]});if(i.length===0)return s.jsxs("div",{className:"text-center py-12",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-purple-50 text-purple-400 mb-4",children:s.jsx(ky,{size:28})}),s.jsx("h3",{className:"text-sm font-semibold text-content mb-1",children:"No Visual Diffs Yet"}),s.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 ",s.jsx("strong",{children:"Settings"}),", toggle the ",s.jsx("strong",{children:"Eye icon"})," on steps you want to compare, then run your tests."]}),s.jsxs("div",{className:"inline-flex flex-col gap-2 text-left bg-surface-inset rounded-xl p-4 border border-border",children:[s.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((h,u)=>s.jsxs("div",{className:"flex items-start gap-2",children:[s.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:u+1}),s.jsx("p",{className:"text-[11px] text-content-secondary",children:h})]},u))]})]});const p=(c==null?void 0:c.diffs)??[],y=p.filter(h=>h.status==="passed").length,b=p.filter(h=>h.status==="failed").length,f=p.filter(h=>h.status==="new").length,v=p.filter(h=>h.status==="approved").length,w=p.filter(h=>h.status==="rejected").length;return s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4 flex-wrap",children:[s.jsx("select",{value:o,onChange:h=>n(h.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:i.map(h=>s.jsxs("option",{value:h.runId,children:[h.runId," (",new Date(h.timestamp).toLocaleString(),")"]},h.runId))}),s.jsxs("div",{className:"flex items-center gap-2 text-xs flex-wrap",children:[s.jsxs("span",{className:"text-emerald-600 font-semibold",children:[y," passed"]}),s.jsx("span",{className:"text-content-tertiary",children:"/"}),s.jsxs("span",{className:"text-red-600 font-semibold",children:[b," failed"]}),s.jsx("span",{className:"text-content-tertiary",children:"/"}),s.jsxs("span",{className:"text-blue-600 font-semibold",children:[f," new"]}),v>0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-content-tertiary",children:"/"}),s.jsxs("span",{className:"text-green-600 font-semibold",children:[v," approved"]})]}),w>0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-content-tertiary",children:"/"}),s.jsxs("span",{className:"text-orange-600 font-semibold",children:[w," rejected"]})]})]}),s.jsx("div",{className:"flex-1"}),(b>0||f>0)&&s.jsxs(se,{size:"sm",variant:"secondary",loading:x.isPending,onClick:()=>x.mutate(),children:[s.jsx(we,{size:14})," Approve All"]})]}),d?s.jsxs("div",{className:"flex items-center justify-center py-12 text-content-tertiary",children:[s.jsx(ae,{className:"animate-spin mr-2",size:18})," Loading diffs..."]}):p.length===0?s.jsx("div",{className:"text-center py-12 text-content-tertiary text-sm",children:"No diffs in this run."}):s.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:p.map(h=>s.jsx(VS,{diff:h,runId:o,onImageClick:a},`${h.stepId}-${h.browser}-${h.viewport}`))}),r&&s.jsx(WS,{diff:r,onClose:()=>a(null)})]})}function QS(){const e=ie(),[t,n]=m.useState(new Set),{data:r=[],isLoading:a}=me({queryKey:["visual-baselines"],queryFn:Ys.listBaselines}),i=W({mutationFn:d=>Ys.deleteBaseline(d),onSuccess:()=>{e.invalidateQueries({queryKey:["visual-baselines"]}),A.success("Baseline deleted")}}),l=W({mutationFn:async()=>{for(const d of t)await Ys.deleteBaseline(d)},onSuccess:()=>{n(new Set),e.invalidateQueries({queryKey:["visual-baselines"]}),A.success(`${t.size} baselines deleted`)}}),o=d=>n(x=>{const p=new Set(x);return p.has(d)?p.delete(d):p.add(d),p}),c=()=>n(t.size===r.length?new Set:new Set(r.map(d=>d.path)));return a?s.jsxs("div",{className:"flex items-center justify-center py-16 text-content-tertiary",children:[s.jsx(ae,{className:"animate-spin mr-2",size:18})," Loading baselines..."]}):r.length===0?s.jsxs("div",{className:"text-center py-12",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-purple-50 text-purple-400 mb-4",children:s.jsx(br,{size:28})}),s.jsx("h3",{className:"text-sm font-semibold text-content mb-1",children:"No Baselines Yet"}),s.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."}),s.jsxs("div",{className:"inline-flex flex-col gap-2 text-left bg-surface-inset rounded-xl p-4 border border-border",children:[s.jsx("p",{className:"text-[11px] font-semibold text-content mb-1",children:"How baselines work:"}),[{icon:Hn,text:"First run — screenshots become baselines automatically"},{icon:ky,text:"Next runs — new screenshots are compared against baselines"},{icon:we,text:"Update — approve changes to replace old baselines"}].map(({icon:d,text:x})=>s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(d,{size:12,className:"text-purple-500 mt-0.5 flex-shrink-0"}),s.jsx("p",{className:"text-[11px] text-content-secondary",children:x})]},x))]})]}):s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsxs("label",{className:"flex items-center gap-2 text-xs text-content-secondary cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:t.size===r.length&&r.length>0,onChange:c,className:"rounded border-border accent-accent"}),"Select all (",r.length,")"]}),t.size>0&&s.jsxs(se,{size:"sm",variant:"danger",loading:l.isPending,onClick:()=>l.mutate(),children:[s.jsx(It,{size:14})," Delete ",t.size," selected"]})]}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:r.map(d=>s.jsxs(Vc,{padding:!1,className:"overflow-hidden group",children:[s.jsxs("div",{className:"relative",children:[s.jsx("img",{src:mr(d.path),alt:d.fileName,className:"w-full h-32 object-cover object-top",onError:x=>{x.target.className="w-full h-32 bg-surface-inset"}}),s.jsx("input",{type:"checkbox",checked:t.has(d.path),onChange:()=>o(d.path),className:"absolute top-2 left-2 rounded border-border accent-accent"})]}),s.jsxs("div",{className:"px-3 py-2",children:[s.jsxs("p",{className:"text-xs font-medium text-content truncate",children:[d.suite," / ",d.caseName]}),s.jsx("p",{className:"text-[10px] text-content-tertiary truncate mt-0.5",children:d.fileName}),s.jsxs("p",{className:"text-[10px] text-content-tertiary",children:[(d.sizeBytes/1024).toFixed(1)," KB"]})]}),s.jsx("div",{className:"px-3 py-2 border-t border-border flex justify-end opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx("button",{onClick:()=>i.mutate(d.path),disabled:i.isPending,className:"p-1 text-content-tertiary hover:text-red-500 transition-colors",title:"Delete baseline",children:s.jsx(It,{size:14})})})]},d.path))})]})}function YS(){const[e,t]=m.useState(""),[n,r]=m.useState("runs"),{modalProps:a,confirmDelete:i}=zs(),l=ie(),{data:o=[],isLoading:c}=me({queryKey:["reports"],queryFn:()=>lc.list(30)}),d=W({mutationFn:lc.delete,onSuccess:()=>{l.invalidateQueries({queryKey:["reports"]}),A.success("Report deleted")},onError:f=>A.error(f.message)}),x=o.reduce((f,v)=>f+v.passed,0),p=o.reduce((f,v)=>f+v.failed,0),y=o.reduce((f,v)=>f+v.skipped,0),b=[{key:"runs",label:"Run Reports",icon:ps},{key:"visual-diffs",label:"Visual Diffs",icon:Ml},{key:"baselines",label:"Baselines",icon:Om}];return s.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:[s.jsx("div",{className:"flex-1 overflow-y-auto",children:s.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[s.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[s.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.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:s.jsx(ps,{size:17,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-sm font-bold text-content",children:"Reports"}),s.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Run results · Visual regression · Baselines"})]})]}),s.jsx("div",{className:"flex items-center gap-2",children:n==="runs"&&o.length>0&&s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.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:[o.length," ",s.jsx("span",{className:"opacity-60 font-normal",children:"runs"})]}),s.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:[x," ",s.jsx("span",{className:"opacity-60 font-normal",children:"passed"})]}),s.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:[p," ",s.jsx("span",{className:"opacity-60 font-normal",children:"failed"})]}),y>0&&s.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:[y," ",s.jsx("span",{className:"opacity-60 font-normal",children:"skip"})]})]})})]}),s.jsx("div",{className:"flex items-center gap-0 border-t border-border px-4",children:b.map(({key:f,label:v,icon:w})=>s.jsxs("button",{onClick:()=>r(f),className:E("flex items-center gap-1.5 px-4 py-2 text-xs font-medium border-b-2 transition-colors",n===f?"border-accent text-accent":"border-transparent text-content-tertiary hover:text-content-secondary"),children:[s.jsx(w,{size:13})," ",v]},f))})]}),n==="visual-diffs"&&s.jsx(GS,{}),n==="baselines"&&s.jsx(QS,{}),n==="runs"&&s.jsxs(s.Fragment,{children:[c&&s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsx(ae,{size:18,className:"animate-spin text-accent"})}),!c&&o.length===0&&s.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:[s.jsx("div",{className:"w-11 h-11 rounded-xl bg-surface-inset flex items-center justify-center",children:s.jsx(ps,{size:20,className:"text-content-tertiary"})}),s.jsx("p",{className:"text-xs font-medium text-content-secondary",children:"No runs yet"}),s.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Configure and start a run first. Enable screenshot, video, and trace in Settings."})]}),s.jsx("div",{className:"space-y-2",children:o.map(f=>{const v=e===f.runId;return s.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden hover:border-accent/20 transition-colors",children:[s.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:()=>t(w=>w===f.runId?"":f.runId),children:[v?s.jsx(ht,{size:12,className:"text-content-tertiary flex-shrink-0"}):s.jsx(Kt,{size:12,className:"text-content-tertiary flex-shrink-0"}),s.jsx(Wm,{status:f.status}),f.environment&&s.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:f.environment}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("p",{className:"text-[10px] font-mono text-content-secondary",children:[f.runId.slice(0,12),"…"]}),s.jsxs("p",{className:"text-[9px] text-content-tertiary flex items-center gap-1 mt-0.5",children:[s.jsx(Kr,{size:8}),s5(new Date(f.startedAt),"MMM d, HH:mm")," · ",dc(new Date(f.startedAt),{addSuffix:!0})]})]}),s.jsxs("div",{className:"flex items-center gap-2 text-[10px] flex-shrink-0",children:[s.jsxs("span",{className:"text-emerald-600 font-semibold tabular-nums",children:[f.passed,"✓"]}),s.jsxs("span",{className:"text-red-500 font-semibold tabular-nums",children:[f.failed,"✗"]}),f.skipped>0&&s.jsxs("span",{className:"text-content-tertiary tabular-nums",children:[f.skipped,"skip"]}),s.jsx("div",{className:"w-px h-3 bg-border"}),s.jsx("span",{className:"text-content-tertiary tabular-nums",children:f.duration!=null?(f.duration/1e3).toFixed(1)+"s":"—"})]}),s.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",onClick:w=>w.stopPropagation(),children:[f.logFilePath&&s.jsx("a",{href:ri("logs",f.logFilePath),target:"_blank",rel:"noopener noreferrer",title:"Run Log",className:"p-1 rounded-md text-emerald-500 hover:bg-emerald-50 transition-colors",children:s.jsx(Ps,{size:13})}),s.jsx("a",{href:`/allure/${f.runId}`,target:"_blank",rel:"noopener noreferrer",title:"Allure Report",className:"p-1 rounded-md text-blue-500 hover:bg-blue-50 transition-colors",children:s.jsx(ps,{size:13})}),s.jsx("button",{type:"button",title:"Delete",onClick:()=>i("Delete this report? This cannot be undone.",()=>d.mutate(f.runId)),className:"p-1 rounded-md text-content-tertiary hover:text-red-500 hover:bg-red-50 transition-colors",children:s.jsx(It,{size:12})})]})]}),v&&s.jsx(HS,{runId:f.runId})]},f.runId)})},"runs")]})]})}),s.jsx(Ts,{...a})]})}function JS(){const[e,t]=m.useState(""),[n,r]=m.useState(""),[a,i]=m.useState(!1),[l,o]=m.useState(new Set),[c,d]=m.useState(null),[x,p]=m.useState(""),[y,b]=m.useState(!1),{modalProps:f,confirmDelete:v}=zs(),w=ie(),{data:h={},isLoading:u}=me({queryKey:["variables"],queryFn:()=>Ed.getAll()}),g=W({mutationFn:({key:O,value:Y,secret:ne})=>Ed.set(O,ne?{value:Y,secret:!0}:Y),onSuccess:()=>{w.invalidateQueries({queryKey:["variables"]}),t(""),r(""),i(!1),d(null),A.success("Variable saved")},onError:O=>A.error(O.message)}),j=W({mutationFn:Ed.delete,onSuccess:()=>{w.invalidateQueries({queryKey:["variables"]}),A.success("Variable deleted")},onError:O=>A.error(O.message)}),k=h._system,N=Object.entries(h).filter(([O])=>O!=="_system").map(([O,Y])=>typeof Y=="string"?{key:O,value:Y,secret:!1}:{key:O,value:Y.value,secret:!0}),S=N.filter(O=>O.secret).length,P=N.filter(O=>{var Y;return(Y=k==null?void 0:k[O.key])==null?void 0:Y.readOnly}).length,$=O=>{o(Y=>{const ne=new Set(Y);return ne.has(O)?ne.delete(O):ne.add(O),ne})},M=()=>{if(e.trim()){if(e.trim()==="BASE_URL"){A.error("BASE_URL is managed in Settings → Environment");return}g.mutate({key:e.trim(),value:n,secret:a})}},V=O=>{d(O.key),p(O.value),b(O.secret)},G=()=>{c&&g.mutate({key:c,value:x,secret:y})},re=()=>{d(null),p(""),b(!1)};return s.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:[s.jsx("div",{className:"flex-1 overflow-y-auto",children:s.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[s.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[s.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.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:s.jsx(py,{size:17,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-sm font-bold text-content",children:"Variables"}),s.jsxs("p",{className:"text-[10px] text-content-tertiary",children:["Global variables available in all tests as ","{{VARIABLE_NAME}}"]})]})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.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:[N.length," ",s.jsx("span",{className:"opacity-60 font-normal",children:"total"})]}),S>0&&s.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:[s.jsx(Sd,{size:7})," ",S," ",s.jsx("span",{className:"opacity-60 font-normal",children:"secret"})]}),P>0&&s.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:[s.jsx(ic,{size:7})," ",P," ",s.jsx("span",{className:"opacity-60 font-normal",children:"system"})]})]})]}),s.jsxs("div",{className:"px-4 py-2.5 bg-surface-inset/40 border-t border-border flex items-center gap-2",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsxs("div",{className:"relative",children:[s.jsx(Ap,{size:10,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-content-tertiary pointer-events-none"}),s.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:e,onChange:O=>t(O.target.value.toUpperCase().replace(/[^A-Z0-9_]/g,"_")),onKeyDown:O=>O.key==="Enter"&&M()})]})}),s.jsx("div",{className:"flex-[2] min-w-0",children:s.jsx("input",{type:a?"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:n,onChange:O=>r(O.target.value),onKeyDown:O=>O.key==="Enter"&&M()})}),s.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[s.jsxs("label",{className:"flex items-center gap-1.5 text-[9px] text-content-tertiary cursor-pointer select-none",children:[s.jsx(xc,{checked:a,onChange:i}),s.jsx(Sd,{size:9})]}),s.jsxs(se,{size:"sm",onClick:M,loading:g.isPending&&!c,disabled:!e.trim(),children:[s.jsx(Rs,{size:10})," Add"]})]})]})]}),s.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:u?s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsx(ae,{size:18,className:"animate-spin text-accent"})}):N.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-14 gap-2.5",children:[s.jsx("div",{className:"w-11 h-11 rounded-xl bg-surface-inset flex items-center justify-center",children:s.jsx(Ap,{size:20,className:"text-content-tertiary"})}),s.jsx("p",{className:"text-xs font-medium text-content-secondary",children:"No variables yet"}),s.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Add your first variable using the toolbar above"})]}):s.jsxs(s.Fragment,{children:[s.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:[s.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Key"}),s.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Value"}),s.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest text-center",children:"Type"}),s.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest text-center",children:"Actions"})]}),s.jsx("div",{className:"max-h-[500px] overflow-y-auto divide-y divide-border/50",children:N.map(O=>{var T,_,z;const Y=((T=k==null?void 0:k[O.key])==null?void 0:T.readOnly)===!0,ne=(z=(_=k==null?void 0:k[O.key])==null?void 0:_.environment)==null?void 0:z.toUpperCase(),le=c===O.key;return s.jsxs("div",{className:E("grid grid-cols-[1fr_2fr_80px_80px] gap-2 px-3.5 py-2 items-center transition-colors",le?"bg-accent/[0.02]":"hover:bg-surface-inset/40"),children:[s.jsx("span",{className:"text-[10px] font-mono text-accent font-medium truncate",children:`{{${O.key}}}`}),s.jsx("div",{className:"min-w-0",children:le?s.jsx("input",{type:y?"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:x,onChange:R=>p(R.target.value),onKeyDown:R=>{R.key==="Enter"&&G(),R.key==="Escape"&&re()},autoFocus:!0}):s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"text-[10px] font-mono text-content-secondary truncate",children:O.secret&&!l.has(O.key)?"••••••••":O.value}),O.secret&&s.jsx("button",{type:"button",onClick:()=>$(O.key),className:"text-content-tertiary hover:text-content-secondary flex-shrink-0 p-0.5",children:l.has(O.key)?s.jsx(J2,{size:9}):s.jsx(Ml,{size:9})})]})}),s.jsx("div",{className:"text-center",children:Y?s.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:[s.jsx(ic,{size:7})," ",ne??"sys"]}):O.secret?s.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:[s.jsx(Sd,{size:7})," secret"]}):s.jsx("span",{className:"text-[8px] text-content-tertiary",children:"plain"})}),s.jsx("div",{className:"flex items-center gap-0.5 justify-center",children:Y?s.jsx("span",{className:"text-[8px] text-content-tertiary italic",children:"read-only"}):le?s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",onClick:G,title:"Save",className:"p-1 rounded-md text-emerald-500 hover:bg-emerald-50 transition-colors",children:s.jsx(ze,{size:11})}),s.jsx("button",{type:"button",onClick:re,title:"Cancel",className:"p-1 rounded-md text-content-tertiary hover:bg-surface-inset transition-colors",children:s.jsx(ye,{size:11})})]}):s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",onClick:()=>V(O),title:"Edit",className:"p-1 rounded-md text-content-tertiary hover:text-accent hover:bg-accent/5 transition-colors",children:s.jsx(tr,{size:10})}),s.jsx("button",{type:"button",title:"Delete",onClick:()=>v(`Delete "${O.key}"?`,()=>j.mutate(O.key)),className:"p-1 rounded-md text-content-tertiary hover:text-red-500 hover:bg-red-50 transition-colors",children:s.jsx(It,{size:10})})]})})]},O.key)})})]})})]})}),s.jsx(Ts,{...f})]})}const XS={1:"Smart Retry",2:"AI Regeneration",3:"Multi-Selector",4:"Visual/SoM",5:"Decompose",6:"Manual"};function ZS({event:e}){const t=ie(),{modalProps:n,confirmDelete:r}=zs(),a=W({mutationFn:()=>Ws.accept(e.id),onSuccess:()=>{t.invalidateQueries({queryKey:["healing"]}),A.success("Healing accepted — test file updated")},onError:o=>A.error(o.message)}),i=W({mutationFn:()=>Ws.reject(e.id),onSuccess:()=>{t.invalidateQueries({queryKey:["healing"]}),A("Healing rejected")},onError:o=>A.error(o.message)}),l=W({mutationFn:()=>Ws.delete(e.id),onSuccess:()=>{t.invalidateQueries({queryKey:["healing"]}),A.success("Event deleted")},onError:o=>A.error(o.message)});return s.jsxs(s.Fragment,{children:[s.jsxs(Vc,{className:"overflow-hidden",padding:!1,children:[s.jsxs("div",{className:"px-4 py-3 border-b border-border bg-surface-inset flex items-center gap-3",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium text-content-secondary truncate",children:e.instruction}),s.jsxs("p",{className:"text-xs text-content-tertiary mt-0.5",children:["Case: ",e.caseId," · Level ",e.level,": ",XS[e.level]??"Unknown"]})]}),s.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[s.jsx(pc,{label:e.status,color:e.status==="pending"?"bg-yellow-100 text-yellow-700":e.status==="accepted"?"bg-green-100 text-green-700":"bg-slate-100 text-content-secondary"}),s.jsx("button",{type:"button",onClick:()=>r("Delete this healing event? This cannot be undone.",()=>l.mutate()),disabled:l.isPending,className:"p-1 text-content-tertiary hover:text-red-500 transition-colors",title:"Delete event",children:s.jsx(It,{size:13})})]})]}),s.jsxs("div",{className:"grid grid-cols-2 divide-x divide-border-muted",children:[s.jsxs("div",{className:"p-3",children:[s.jsx("p",{className:"text-xs font-semibold text-red-500 mb-1",children:"Before (failed)"}),s.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:e.failedCode||"// (no code)"})]}),s.jsxs("div",{className:"p-3",children:[s.jsx("p",{className:"text-xs font-semibold text-green-600 mb-1",children:"After (healed)"}),s.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:e.healedCode})]})]}),e.status==="pending"&&s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-t border-border bg-surface-inset",children:[s.jsxs(se,{size:"sm",onClick:()=>a.mutate(),loading:a.isPending,children:[s.jsx(ze,{size:13})," Accept & Update File"]}),s.jsxs(se,{variant:"secondary",size:"sm",onClick:()=>i.mutate(),loading:i.isPending,children:[s.jsx(ye,{size:13})," Reject"]})]})]}),s.jsx(Ts,{...n})]})}function Jd({title:e,events:t}){return s.jsxs("div",{className:"mb-8",children:[s.jsxs("h2",{className:"text-sm font-semibold text-content-secondary mb-3",children:[e," (",t.length,")"]}),s.jsx("div",{className:"space-y-3 max-h-[680px] overflow-y-auto pr-1",children:t.map(n=>s.jsx(ZS,{event:n},n.id))})]})}function eC(){const e=ie(),{modalProps:t,confirmDelete:n}=zs(),{data:r=[],isLoading:a}=me({queryKey:["healing","pending"],queryFn:()=>Ws.pending()}),{data:i}=me({queryKey:["healing","stats"],queryFn:()=>Ws.stats()}),{data:l=[]}=me({queryKey:["healing"],queryFn:()=>Ws.list()}),o=W({mutationFn:Ws.acceptAll,onSuccess:f=>{e.invalidateQueries({queryKey:["healing"]}),A.success(`Accepted ${f.accepted} heal(s)`)},onError:f=>A.error(f.message)}),c=W({mutationFn:Ws.deleteAll,onSuccess:f=>{e.invalidateQueries({queryKey:["healing"]}),A.success(`Cleared ${f.deleted} event(s)`)},onError:f=>A.error(f.message)}),d=(f,v)=>f.createdAt<v.createdAt?1:-1,x=[...r].sort(d),p=[...l.filter(f=>f.status==="accepted")].sort(d),y=[...l.filter(f=>f.status==="rejected")].sort(d),b=()=>{n("Delete all healing events? This cannot be undone.",()=>c.mutate())};return s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[s.jsxs("div",{className:"flex-shrink-0 px-6 py-4 border-b border-border flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-xl font-bold text-content flex items-center gap-2",children:[s.jsx(rc,{size:20,className:"text-accent"})," Self-Healing"]}),s.jsx("p",{className:"text-sm text-content-tertiary mt-0.5",children:"Review AI-generated fixes for broken test steps"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[l.length>0&&s.jsxs(se,{variant:"secondary",onClick:b,loading:c.isPending,children:[s.jsx(ww,{size:14})," Delete All"]}),r.length>0&&s.jsxs(se,{onClick:()=>o.mutate(),loading:o.isPending,children:[s.jsx(my,{size:15})," Accept All (",r.length,")"]})]})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[i&&s.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[s.jsx(no,{label:"Total Events",value:i.total,color:"blue"}),s.jsx(no,{label:"Pending Review",value:i.pending,color:"orange"}),s.jsx(no,{label:"Accepted",value:i.accepted,color:"green"}),s.jsx(no,{label:"Rejected",value:i.rejected,color:"purple"})]}),a&&s.jsx("p",{className:"text-sm text-content-tertiary text-center py-12",children:"Loading…"}),x.length>0&&s.jsx(Jd,{title:"Pending Review",events:x}),!a&&r.length===0&&s.jsxs(Vc,{className:"text-center py-12 mb-6",children:[s.jsx(rc,{size:32,className:"text-slate-200 mx-auto mb-3"}),s.jsx("p",{className:"text-content-secondary font-medium",children:"No pending heals"}),s.jsx("p",{className:"text-content-tertiary text-sm mt-1",children:"Self-healing events appear here when tests fail and AI generates a fix"})]}),p.length>0&&s.jsx(Jd,{title:"Accepted",events:p}),y.length>0&&s.jsx(Jd,{title:"Rejected",events:y})]}),s.jsx(Ts,{...t})]})}function _t({label:e,hint:t,children:n}){return s.jsxs("div",{className:"flex items-start gap-4 py-2.5 border-b border-border/50 last:border-0",children:[s.jsxs("div",{className:"w-40 flex-shrink-0 pt-0.5",children:[s.jsx("p",{className:"text-[11px] font-semibold text-content-secondary",children:e}),t&&s.jsx("p",{className:"text-[10px] text-content-tertiary mt-0.5 leading-relaxed",children:t})]}),s.jsx("div",{className:"flex-1 min-w-0",children:n})]})}function Xe({label:e,hint:t,checked:n,onChange:r}){return s.jsxs("div",{className:"flex items-start gap-3 py-2.5 border-b border-border/50 last:border-0",children:[s.jsx("div",{className:"pt-0.5 flex-shrink-0",children:s.jsx(xc,{checked:n,onChange:r})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[11px] font-semibold text-content-secondary",children:e}),t&&s.jsx("p",{className:"text-[10px] text-content-tertiary mt-0.5",children:t})]})]})}function os({icon:e,iconBg:t,title:n,desc:r,children:a}){return s.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[s.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center gap-2.5",children:[s.jsx("div",{className:E("w-7 h-7 rounded-lg flex items-center justify-center flex-shrink-0 shadow-sm",t),children:s.jsx(e,{size:13,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-xs font-bold text-content",children:n}),r&&s.jsx("p",{className:"text-[9px] text-content-tertiary",children:r})]})]}),s.jsx("div",{className:"px-4 py-1",children:a})]})}function $s(e){return s.jsx("input",{...e,className:E("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",e.className)})}function zi({value:e,onChange:t,options:n,className:r}){return s.jsx("select",{value:e,onChange:a=>t(a.target.value),className:E("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",r),children:n.map(a=>s.jsx("option",{value:a.value,children:a.label},a.value))})}const Xd=[{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 tC({viewport:e,onChange:t}){const n=Xd.find(i=>i.width===e.width&&i.height===e.height),r=(n==null?void 0:n.label)??"Custom",a=i=>{const l=Xd.find(o=>o.label===i);l&&l.width!==0&&t({width:l.width,height:l.height})};return s.jsx(_t,{label:"Viewport",hint:"Browser window size",children:s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx(zi,{className:"w-44",value:r,onChange:a,options:Xd.map(i=>({value:i.label,label:i.label}))}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx($s,{type:"number",className:"w-16",value:e.width,min:320,onChange:i=>t({...e,width:Number(i.target.value)})}),s.jsx("span",{className:"text-content-tertiary text-[10px]",children:"×"}),s.jsx($s,{type:"number",className:"w-16",value:e.height,min:240,onChange:i=>t({...e,height:Number(i.target.value)})}),s.jsx("span",{className:"text-[9px] text-content-tertiary",children:"px"})]})]})})}const of={getConfig:()=>fetch("/api/visual-regression/config").then(e=>e.json()),saveConfig:e=>fetch("/api/visual-regression/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(t=>t.json())};function sC(){var u,g,j,k,N,S,P,$,M,V,G,re,O,Y,ne,le,T,_,z;const e=ie(),{data:t,isLoading:n}=me({queryKey:["config"],queryFn:()=>Br.get()}),[r,a]=m.useState({}),{data:i}=me({queryKey:["visual-config"],queryFn:of.getConfig}),[l,o]=m.useState(null),c=l??i??{enabled:!1,defaultThreshold:.5,fullPage:!1,maskSelectors:[]};m.useEffect(()=>{i&&!l&&o(null)},[i]);const d=R=>o({...c,...R}),x=W({mutationFn:R=>of.saveConfig(R),onSuccess:()=>{e.invalidateQueries({queryKey:["visual-config"]}),o(null),A.success("Visual regression settings saved")},onError:R=>A.error(R.message)}),[p,y]=m.useState(!1),[b,f]=m.useState({name:"",environment:"stage",baseUrl:"",browsers:["chromium"]});m.useEffect(()=>{t&&a(t)},[t]);const v=W({mutationFn:()=>Br.update(r),onSuccess:()=>{e.invalidateQueries({queryKey:["config"]}),A.success("Settings saved")},onError:R=>A.error(R.message)}),w=(R,I)=>a(X=>({...X,[R]:I})),h=R=>{const I=r.browsers??[];w("browsers",I.includes(R)?I.length>1?I.filter(X=>X!==R):I:[...I,R])};return n||!r.healing||!r.reporting?s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(ae,{size:20,className:"animate-spin text-accent"})}):s.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:s.jsx("div",{className:"flex-1 overflow-y-auto",children:s.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[s.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:s.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.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:s.jsx(Qa,{size:17,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-sm font-bold text-content",children:"Settings"}),s.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Configure AssureMind Studio"})]})]}),s.jsxs(se,{size:"sm",onClick:()=>v.mutate(),loading:v.isPending,children:[s.jsx(mx,{size:11})," Save Settings"]})]})}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3 items-start",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsxs(os,{icon:pw,iconBg:"bg-gradient-to-br from-indigo-500 to-violet-600 shadow-indigo-500/20",title:"Environment",desc:"Target environment & URLs",children:[s.jsx(_t,{label:"Active Environment",hint:"Where tests run against",children:s.jsx("div",{className:"flex gap-1 flex-wrap",children:["dev","stage","test","prod"].map(R=>s.jsx("button",{type:"button",onClick:()=>{var X;w("environment",R);const I=(X=r.environmentUrls)==null?void 0:X[R];I&&w("baseUrl",I)},className:E("px-2.5 py-1 rounded-lg text-[10px] font-semibold uppercase tracking-wide transition-all",r.environment===R?"bg-accent text-white shadow-sm shadow-accent/20":"text-content-tertiary hover:text-content-secondary bg-surface-inset ring-1 ring-border"),children:R},R))})}),s.jsx(_t,{label:"Environment URLs",hint:"Base URL per environment",children:s.jsx("div",{className:"space-y-1.5",children:["dev","stage","test","prod"].map(R=>{var I;return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:E("w-11 text-[9px] font-bold uppercase text-center py-0.5 rounded",r.environment===R?"bg-accent/10 text-accent ring-1 ring-accent/20":"bg-surface-inset text-content-tertiary ring-1 ring-border"),children:R}),s.jsx($s,{className:"flex-1",placeholder:`https://${R}.example.com`,value:((I=r.environmentUrls)==null?void 0:I[R])??"",onChange:X=>{const B={...r.environmentUrls??{dev:"",stage:"",test:"",prod:""},[R]:X.target.value};w("environmentUrls",B),r.environment===R&&w("baseUrl",X.target.value)}})]},R)})})}),s.jsx(_t,{label:"Base URL",hint:"Auto-resolved from active env",children:s.jsx($s,{className:"w-full bg-surface-inset/50 text-content-tertiary cursor-not-allowed",placeholder:"http://localhost:3000",value:r.baseUrl??"",readOnly:!0,disabled:!0})})]}),s.jsxs(os,{icon:nn,iconBg:"bg-gradient-to-br from-blue-500 to-cyan-600 shadow-blue-500/20",title:"General",desc:"Browser & display settings",children:[s.jsx(_t,{label:"Browsers",hint:"One or more browsers",children:s.jsx("div",{className:"flex gap-1.5 flex-wrap",children:Ty.map(R=>{const I=(r.browsers??[]).includes(R);return s.jsxs("button",{type:"button",onClick:()=>h(R),className:E("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[10px] font-semibold capitalize transition-all",I?"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:[s.jsx(Ja,{browser:R,size:14}),R]},R)})})}),s.jsx(Xe,{label:"Headless mode",hint:"Run browsers without visible window",checked:r.headless??!0,onChange:R=>w("headless",R)}),s.jsx(tC,{viewport:r.viewport??{width:1280,height:720},onChange:R=>w("viewport",R)})]}),s.jsxs(os,{icon:Qa,iconBg:"bg-gradient-to-br from-slate-500 to-slate-700 shadow-slate-500/20",title:"Execution",desc:"Timeouts, retries & parallelism",children:[s.jsx(_t,{label:"Timeouts & Workers",hint:"Per-test limits",children:s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[9px] text-content-tertiary mb-0.5",children:"Timeout (ms)"}),s.jsx($s,{type:"number",className:"w-24",value:r.timeout??3e4,onChange:R=>w("timeout",Number(R.target.value))})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[9px] text-content-tertiary mb-0.5",children:"Retries"}),s.jsx($s,{type:"number",min:0,max:5,className:"w-16",value:r.retries??1,onChange:R=>w("retries",Number(R.target.value))})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-[9px] text-content-tertiary mb-0.5",children:"Workers"}),s.jsx($s,{type:"number",min:1,max:10,className:"w-16",value:r.parallel??2,onChange:R=>w("parallel",Number(R.target.value))})]})]})}),s.jsx(_t,{label:"Page load strategy",hint:"Playwright wait after each step",children:s.jsx(zi,{className:"w-full",value:r.pageLoad??"domcontentloaded",onChange:R=>w("pageLoad",R),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"}]})})]}),s.jsxs(os,{icon:Hn,iconBg:"bg-gradient-to-br from-pink-500 to-rose-600 shadow-pink-500/20",title:"Capture",desc:"Screenshots, video & traces",children:[s.jsx(_t,{label:"Screenshot",hint:"When to capture screenshots",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(Hn,{size:11,className:"text-pink-400 flex-shrink-0"}),s.jsx(zi,{className:"w-40",value:r.screenshot??"only-on-failure",onChange:R=>w("screenshot",R),options:[{value:"off",label:"Off"},{value:"on",label:"Every test"},{value:"only-on-failure",label:"On failure only"}]})]})}),s.jsx(_t,{label:"Video",hint:"When to record video",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(Bc,{size:11,className:"text-violet-400 flex-shrink-0"}),s.jsx(zi,{className:"w-40",value:r.video??"off",onChange:R=>w("video",R),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"}]})]})}),s.jsx(_t,{label:"Trace",hint:"Playwright trace for debugging",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(Cy,{size:11,className:"text-emerald-400 flex-shrink-0"}),s.jsx(zi,{className:"w-40",value:r.trace??"on-first-retry",onChange:R=>w("trace",R),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"}]})]})})]}),s.jsxs(os,{icon:ps,iconBg:"bg-gradient-to-br from-indigo-500 to-blue-600 shadow-indigo-500/20",title:"Reporting",desc:"Output format & destinations",children:[s.jsx(Xe,{label:"Allure report",hint:"Interactive HTML report with history & trends",checked:((u=r.reporting)==null?void 0:u.allure)??!0,onChange:R=>w("reporting",{...r.reporting,allure:R})}),s.jsx(Xe,{label:"HTML report",hint:"Standalone summary saved to results/",checked:((g=r.reporting)==null?void 0:g.html)??!0,onChange:R=>w("reporting",{...r.reporting,html:R})}),s.jsx(Xe,{label:"JSON report",hint:"Machine-readable run data",checked:((j=r.reporting)==null?void 0:j.json)??!0,onChange:R=>w("reporting",{...r.reporting,json:R})})]}),s.jsx(os,{icon:Kn,iconBg:"bg-gradient-to-br from-slate-500 to-gray-700 shadow-slate-500/20",title:"CI/CD Integration",desc:"Pipeline file generation",children:s.jsx(Xe,{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:((k=r.ci)==null?void 0:k.writeToRepo)??!1,onChange:R=>w("ci",{...r.ci,writeToRepo:R})})})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs(os,{icon:Fm,iconBg:"bg-gradient-to-br from-amber-500 to-orange-600 shadow-amber-500/20",title:"Self-Healing",desc:"AI-powered selector recovery",children:[s.jsx(Xe,{label:"Enable self-healing",hint:"Auto-fix broken selectors during runs",checked:((N=r.healing)==null?void 0:N.enabled)??!0,onChange:R=>w("healing",{...r.healing,enabled:R})}),s.jsx(_t,{label:"Max healing level",hint:"1 = retry only · 2 = AI regen · 3 = multi-selector · 4 = visual · 5 = decompose",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx($s,{type:"number",min:1,max:5,className:"w-16",value:Math.min(((S=r.healing)==null?void 0:S.maxLevel)??5,5),onChange:R=>w("healing",{...r.healing,maxLevel:Number(R.target.value)})}),s.jsx("div",{className:"flex gap-0.5",children:[1,2,3,4,5].map(R=>{var I;return s.jsx("div",{className:E("w-4 h-1.5 rounded-full transition-colors",R<=Math.min(((I=r.healing)==null?void 0:I.maxLevel)??5,5)?"bg-amber-400":"bg-surface-inset")},R)})})]})}),s.jsx(Xe,{label:"Auto-PR on CI heal",hint:"GitHub PR when selector healed in CI",checked:((P=r.healing)==null?void 0:P.autoPR)??!1,onChange:R=>w("healing",{...r.healing,autoPR:R})}),s.jsx(Xe,{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:(($=r.healing)==null?void 0:$.healAssertionLocators)??!1,onChange:R=>w("healing",{...r.healing,healAssertionLocators:R})})]}),s.jsxs(os,{icon:wt,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:[s.jsx(Xe,{label:"Enable MCP",hint:"ON by default — AI sees real page elements during generation. Test execution is unaffected.",checked:((M=r.mcp)==null?void 0:M.enabled)??!0,onChange:R=>w("mcp",{...r.mcp,enabled:R})}),s.jsx(Xe,{label:"Headless mode",hint:"Run MCP browser without visible window",checked:((V=r.mcp)==null?void 0:V.headless)??!0,onChange:R=>w("mcp",{...r.mcp,headless:R})}),s.jsx(Xe,{label:"Act-then-script",hint:"Execute action via MCP first, then convert to script",checked:((G=r.mcp)==null?void 0:G.actThenScript)??!1,onChange:R=>w("mcp",{...r.mcp,actThenScript:R})}),s.jsx(Xe,{label:"Proactive healing",hint:"Validate selectors against live page before test run",checked:((re=r.mcp)==null?void 0:re.proactiveHealing)??!1,onChange:R=>w("mcp",{...r.mcp,proactiveHealing:R})})]}),s.jsxs(os,{icon:$2,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:[s.jsx(Xe,{label:"Enable RAG",hint:"AI retrieves similar past steps & fixes to improve accuracy",checked:((O=r.rag)==null?void 0:O.enabled)??!0,onChange:R=>w("rag",{...r.rag,enabled:R})}),s.jsx(Xe,{label:"Code Corpus",hint:"Remember instruction-to-code mappings from successful runs",checked:((ne=(Y=r.rag)==null?void 0:Y.codeCorpus)==null?void 0:ne.enabled)??!0,onChange:R=>w("rag",{...r.rag,codeCorpus:{...r.rag.codeCorpus,enabled:R}})}),s.jsx(Xe,{label:"Healing Corpus",hint:"Remember past healing fixes for smarter self-repair",checked:((T=(le=r.rag)==null?void 0:le.healingCorpus)==null?void 0:T.enabled)??!0,onChange:R=>w("rag",{...r.rag,healingCorpus:{...r.rag.healingCorpus,enabled:R}})}),s.jsx(Xe,{label:"Error Catalog",hint:"Track recurring error patterns to avoid known-bad selectors",checked:((z=(_=r.rag)==null?void 0:_.errorCatalog)==null?void 0:z.enabled)??!0,onChange:R=>w("rag",{...r.rag,errorCatalog:{...r.rag.errorCatalog,enabled:R}})})]}),s.jsxs(os,{icon:Ml,iconBg:"bg-gradient-to-br from-purple-500 to-indigo-600 shadow-purple-500/20",title:"Visual Regression",desc:"Pixel-diff screenshot comparison",children:[s.jsx(Xe,{label:"Enable visual regression",hint:"Compare step screenshots against approved baselines",checked:c.enabled,onChange:R=>d({enabled:R})}),s.jsx(Xe,{label:"Full page screenshots",hint:"Capture the entire scrollable page, not just the viewport",checked:c.fullPage,onChange:R=>d({fullPage:R})}),s.jsx(_t,{label:"Threshold (%)",hint:"Max pixel diff before flagging. Default 0.5%",children:s.jsx($s,{type:"number",min:.1,max:10,step:.1,className:"w-24",value:c.defaultThreshold,onChange:R=>d({defaultThreshold:parseFloat(R.target.value)||.5})})}),s.jsx(_t,{label:"Mask selectors",hint:"CSS selectors for dynamic content to ignore (one per line)",children:s.jsx("textarea",{rows:3,value:c.maskSelectors.join(`
920
+ `),onChange:R=>d({maskSelectors:R.target.value.split(`
921
+ `).filter(I=>I.trim())}),placeholder:`.dynamic-content
922
+ [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"})}),l&&s.jsx("div",{className:"flex justify-end pt-2 pb-1",children:s.jsxs(se,{size:"sm",loading:x.isPending,onClick:()=>x.mutate(c),children:[s.jsx(mx,{size:11})," Save VR Settings"]})})]}),s.jsx(os,{icon:nn,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:s.jsxs("div",{id:"profiles",className:"space-y-2",children:[(r.profiles??[]).length===0&&s.jsx("p",{className:"text-[10px] text-content-tertiary py-2",children:"No profiles defined. Add one below."}),(r.profiles??[]).map((R,I)=>s.jsxs("div",{className:"flex items-center gap-2 py-1.5 border-b border-border/40 last:border-0",children:[s.jsx("span",{className:"text-xs font-medium text-content w-24 truncate",children:R.name}),s.jsx("span",{className:"text-[10px] text-content-tertiary w-14",children:R.environment}),s.jsx("span",{className:"text-[10px] text-content-tertiary flex-1 truncate",children:R.baseUrl}),s.jsx("button",{type:"button",onClick:()=>{const X=(r.profiles??[]).filter((B,xe)=>xe!==I);w("profiles",X)},className:"p-1 rounded text-content-tertiary hover:text-red-500 hover:bg-red-50 transition-colors flex-shrink-0",children:s.jsx(It,{size:11})})]},I)),p?s.jsxs("div",{className:"mt-2 p-3 rounded-lg border border-border bg-surface-alt space-y-2",children:[s.jsx("p",{className:"text-[10px] font-semibold text-content-secondary",children:"New Profile"}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-[9px] text-content-tertiary uppercase tracking-wide",children:"Name"}),s.jsx("input",{type:"text",value:b.name,onChange:R=>f(I=>({...I,name:R.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"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-[9px] text-content-tertiary uppercase tracking-wide",children:"Environment"}),s.jsxs("select",{value:b.environment,onChange:R=>f(I=>({...I,environment:R.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:[s.jsx("option",{value:"dev",children:"dev"}),s.jsx("option",{value:"stage",children:"stage"}),s.jsx("option",{value:"test",children:"test"}),s.jsx("option",{value:"prod",children:"prod"})]})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-[9px] text-content-tertiary uppercase tracking-wide",children:"Base URL"}),s.jsx("input",{type:"url",value:b.baseUrl,onChange:R=>f(I=>({...I,baseUrl:R.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"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-[9px] text-content-tertiary uppercase tracking-wide",children:"Browsers"}),s.jsx("div",{className:"flex gap-3 mt-1",children:["chromium","firefox","webkit"].map(R=>s.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] text-content-secondary cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:b.browsers.includes(R),onChange:I=>f(X=>({...X,browsers:I.target.checked?[...X.browsers,R]:X.browsers.filter(B=>B!==R)})),className:"rounded"}),s.jsx(Ja,{browser:R,size:12}),R]},R))})]}),s.jsxs("div",{className:"flex gap-2 pt-1",children:[s.jsx("button",{type:"button",onClick:()=>{if(!b.name.trim()){A.error("Profile name is required");return}if(!b.baseUrl.startsWith("http")){A.error("Base URL must start with http:// or https://");return}if(b.browsers.length===0){A.error("Select at least one browser");return}w("profiles",[...r.profiles??[],{name:b.name.trim(),environment:b.environment,baseUrl:b.baseUrl,browsers:b.browsers}]),f({name:"",environment:"stage",baseUrl:"",browsers:["chromium"]}),y(!1)},className:"px-2.5 py-1 text-[10px] font-medium rounded bg-accent text-white hover:bg-accent-dark transition-colors",children:"Add"}),s.jsx("button",{type:"button",onClick:()=>{y(!1),f({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"})]})]}):s.jsxs("button",{type:"button",onClick:()=>y(!0),className:"inline-flex items-center gap-1 text-[10px] text-accent hover:text-accent-dark py-1 transition-colors",children:[s.jsx(Rs,{size:11})," Add Profile"]})]})})]})]})]})})})}function nC(){const e=ie(),{modalProps:t,confirmDelete:n}=zs(),[r,a]=m.useState(!1),[i,l]=m.useState(""),[o,c]=m.useState(""),[d,x]=m.useState(""),[p,y]=m.useState(null),[b,f]=m.useState({}),[v,w]=m.useState(null),[h,u]=m.useState(new Set),g=M=>{u(V=>{const G=new Set(V);return G.has(M)?G.delete(M):G.add(M),G})},{data:j=[],isLoading:k}=me({queryKey:["step-library"],queryFn:()=>xr.list()}),N=W({mutationFn:()=>xr.create({name:i.trim(),instruction:o.trim(),tags:d.split(",").map(M=>M.trim()).filter(Boolean)}),onSuccess:()=>{e.invalidateQueries({queryKey:["step-library"]}),A.success("Step created"),a(!1),l(""),c(""),x("")},onError:M=>A.error(M.message)}),S=W({mutationFn:({id:M,data:V})=>xr.update(M,V),onSuccess:()=>{e.invalidateQueries({queryKey:["step-library"]}),A.success("Step updated"),y(null)},onError:M=>A.error(M.message)}),P=W({mutationFn:M=>xr.delete(M),onSuccess:()=>{e.invalidateQueries({queryKey:["step-library"]}),A.success("Step deleted")},onError:M=>A.error(M.message)}),$=W({mutationFn:M=>xr.generate(M),onSuccess:()=>{e.invalidateQueries({queryKey:["step-library"]}),A.success("Code generated"),w(null)},onError:M=>{A.error(M.message),w(null)}});return s.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:[s.jsx("div",{className:"flex-1 overflow-y-auto",children:s.jsxs("div",{className:"max-w-4xl mx-auto px-5 py-4 space-y-3",children:[s.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:s.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.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:s.jsx(ul,{size:17,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-sm font-bold text-content",children:"Step Library"}),s.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Reusable step templates for your test cases"})]})]}),s.jsxs("button",{type:"button",onClick:()=>a(M=>!M),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:[s.jsx(Rs,{size:13})," Add Step"]})]})}),r&&s.jsxs("div",{className:"rounded-xl border border-accent/30 bg-surface p-4 space-y-2.5",children:[s.jsx("p",{className:"text-xs font-semibold text-content",children:"New Library Step"}),s.jsx("input",{type:"text",placeholder:"Name (e.g. Login as admin)",value:i,onChange:M=>l(M.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"}),s.jsx("textarea",{placeholder:"Instruction (e.g. Click the login button and fill in admin credentials)",value:o,onChange:M=>c(M.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"}),s.jsx("input",{type:"text",placeholder:"Tags (comma-separated, optional)",value:d,onChange:M=>x(M.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"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{type:"button",onClick:()=>N.mutate(),disabled:!i.trim()||!o.trim()||N.isPending,className:"text-xs px-4 py-1.5 rounded-lg bg-accent text-white hover:brightness-110 transition-colors disabled:opacity-50",children:N.isPending?"Saving…":"Save"}),s.jsx("button",{type:"button",onClick:()=>a(!1),className:"text-xs px-3 py-1.5 rounded-lg border border-border text-content-secondary hover:bg-surface-inset",children:"Cancel"})]})]}),k&&s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(ae,{size:18,className:"animate-spin text-accent"})}),!k&&j.length===0&&!r&&s.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:[s.jsx(ul,{size:24,className:"text-content-tertiary"}),s.jsx("p",{className:"text-xs font-medium text-content-secondary",children:"No steps in library"}),s.jsx("p",{className:"text-[10px] text-content-tertiary",children:'Click "Add Step" to create your first reusable step template.'})]}),j.length>0&&s.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{className:"bg-surface-inset/50 border-b border-border",children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left px-4 py-2.5 text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Name"}),s.jsx("th",{className:"text-left px-4 py-2.5 text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Instruction"}),s.jsx("th",{className:"text-left px-4 py-2.5 text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Code"}),s.jsx("th",{className:"text-left px-4 py-2.5 text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Tags"}),s.jsx("th",{className:"px-4 py-2.5 w-24"})]})}),s.jsx("tbody",{className:"divide-y divide-border",children:j.map(M=>s.jsxs(m.Fragment,{children:[s.jsxs("tr",{className:"hover:bg-surface-inset/30 transition-colors",children:[s.jsx("td",{className:"px-4 py-2.5 font-medium text-content",children:p===M.id?s.jsx("input",{type:"text",value:b.name??M.name,onChange:V=>f(G=>({...G,name:V.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"}):M.name}),s.jsx("td",{className:"px-4 py-2.5 text-content-secondary max-w-xs",children:p===M.id?s.jsx("textarea",{value:b.instruction??M.instruction,onChange:V=>f(G=>({...G,instruction:V.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"}):s.jsx("span",{className:"line-clamp-2",children:M.instruction})}),s.jsx("td",{className:"px-4 py-2.5",children:M.generatedCode?s.jsxs("button",{type:"button",onClick:()=>g(M.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:[h.has(M.id)?s.jsx(ht,{size:10}):s.jsx(Kt,{size:10}),s.jsx(Tm,{size:10}),"View"]}):s.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"})}),s.jsx("td",{className:"px-4 py-2.5",children:s.jsx("div",{className:"flex flex-wrap gap-0.5",children:M.tags.map(V=>s.jsx("span",{className:"text-[8px] px-1 py-px rounded bg-accent/8 text-accent ring-1 ring-accent/15",children:V},V))})}),s.jsx("td",{className:"px-4 py-2.5",children:s.jsx("div",{className:"flex items-center gap-1",children:p===M.id?s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",onClick:()=>S.mutate({id:M.id,data:b}),className:"p-1 rounded text-emerald-600 hover:bg-emerald-50",children:s.jsx(ze,{size:12})}),s.jsx("button",{type:"button",onClick:()=>y(null),className:"p-1 rounded text-content-tertiary hover:bg-surface-inset",children:s.jsx(ye,{size:12})})]}):s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",title:M.generatedCode?"Regenerate code":"Generate code",onClick:()=>{w(M.id),$.mutate(M.id)},disabled:v===M.id,className:"p-1 rounded text-content-tertiary hover:text-accent hover:bg-accent/5 transition-colors disabled:opacity-40",children:v===M.id?s.jsx(ae,{size:12,className:"animate-spin"}):s.jsx(Ur,{size:12})}),s.jsx("button",{type:"button",onClick:()=>{y(M.id),f({name:M.name,instruction:M.instruction,tags:M.tags})},className:"p-1 rounded text-content-tertiary hover:text-content hover:bg-surface-inset",children:s.jsx(tr,{size:12})}),s.jsx("button",{type:"button",onClick:()=>n(`Delete "${M.name}"?`,()=>P.mutate(M.id)),className:"p-1 rounded text-content-tertiary hover:text-red-500 hover:bg-red-50",children:s.jsx(It,{size:12})})]})})})]}),h.has(M.id)&&M.generatedCode&&s.jsx("tr",{children:s.jsx("td",{colSpan:5,className:"p-0",children:s.jsx(Um,{code:M.generatedCode,maxLines:12,className:"rounded-none"})})})]},M.id))})]})})]})}),s.jsx(Ts,{...t})]})}const Ai=[{id:"getting-started",title:"Getting Started",category:"Getting Started",content:s.jsxs("div",{className:"space-y-3",children:[s.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."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Prerequisites"}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsx("li",{children:"Node.js 18+ (20 LTS recommended)"}),s.jsx("li",{children:"An AI provider API key (Anthropic, OpenAI, Google, Azure…) — or run a local model via Ollama (free)"}),s.jsx("li",{children:"A test target application URL"}),s.jsx("li",{children:"Optional: JDK 17+ for Allure HTML reports"})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Quick Setup"}),s.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
923
+ npx assuremind init # folders, config, Playwright browsers
924
+ npx playwright install # if browser install was skipped or failed
925
+ npx assuremind studio # opens http://localhost:4400`}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["Open ",s.jsx("code",{className:"text-accent",children:"http://localhost:4400"})," to access the Studio UI. The first run triggers the onboarding wizard and opens in ",s.jsx("strong",{children:"light mode"})," by default (toggle dark/light any time from the top bar)."]}),s.jsxs("p",{className:"text-sm text-content-secondary",children:[s.jsx("code",{className:"text-accent",children:"npx assuremind init"})," installs the Playwright browsers automatically. If that step is skipped (",s.jsx("code",{className:"text-accent",children:"--skip-playwright"}),") or fails, run ",s.jsx("code",{className:"text-accent",children:"npx playwright install"})," manually (add ",s.jsx("code",{className:"text-accent",children:"--with-deps"})," on Linux). Verify with ",s.jsx("code",{className:"text-accent",children:"npx assuremind doctor"}),"."]})]})},{id:"configuration",title:"Configuration",category:"Getting Started",content:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{children:["Configuration is stored in ",s.jsx("code",{className:"text-accent",children:"tests/autotest.config.json"})," and editable from the Settings page."]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Key Settings"}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-xs border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border",children:[s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Field"}),s.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Description"})]})}),s.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(([e,t])=>s.jsxs("tr",{className:"border-b border-border/50",children:[s.jsx("td",{className:"py-1.5 pr-4 font-mono text-accent",children:e}),s.jsx("td",{className:"py-1.5",children:t})]},e))})]})})]})},{id:"test-suites",title:"Test Suites",category:"Core Features",content:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{children:["Test Suites group related test cases. Each suite has a type (",s.jsx("strong",{children:"UI"}),", ",s.jsx("strong",{children:"API"}),", or ",s.jsx("strong",{children:"Audit"}),"), tags, and an optional timeout override."]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Suite Types"}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-xs border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border",children:[s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Type"}),s.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Description"})]})}),s.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(([e,t])=>s.jsxs("tr",{className:"border-b border-border/50",children:[s.jsx("td",{className:"py-1.5 pr-4 font-mono text-accent",children:e}),s.jsx("td",{className:"py-1.5",children:t})]},e))})]})}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Creating a Suite"}),s.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:["Go to ",s.jsx("strong",{children:"Test Suites"})," in the sidebar."]}),s.jsxs("li",{children:["Click ",s.jsx("strong",{children:"+ New Suite"})," and enter a name."]}),s.jsxs("li",{children:["Select the suite type: ",s.jsx("strong",{children:"UI"}),", ",s.jsx("strong",{children:"API"}),", or ",s.jsx("strong",{children:"Audit"}),"."]}),s.jsx("li",{children:"Optionally set tags and timeout."})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Suite Actions"}),s.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:s.jsxs("div",{className:"space-y-3",children:[s.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."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"⚡ Audit Flag on Steps"}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["In Audit suites, each step has a ",s.jsx("strong",{children:"⚡ Audit"})," button. Clicking it marks that step as a Lighthouse checkpoint — when the step runs, Lighthouse audits ",s.jsx("code",{className:"text-accent",children:"page.url()"})," at that point. Confirm with ",s.jsx("strong",{children:"✓"})," to save or ",s.jsx("strong",{children:"✗"})," to cancel. If no steps are marked, Lighthouse is skipped entirely."]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Non-Functional Checks"}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["Each test case in an Audit suite has a ",s.jsx("strong",{children:"Non-Functional Checks"})," section with three checkboxes:"]}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"⚡ Performance"})," — Lighthouse Performance score"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"♿ Accessibility"})," — Lighthouse Accessibility score"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"🔍 SEO"})," — Lighthouse SEO score"]})]}),s.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."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Score Thresholds"}),s.jsxs("div",{className:"flex gap-4 text-sm",children:[s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"w-3 h-3 rounded-full bg-emerald-500 inline-block"})," Good (90–100)"]}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"w-3 h-3 rounded-full bg-amber-400 inline-block"})," Needs Work (50–89)"]}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.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:s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{children:"Test cases contain steps written in plain English. Each case has priority, tags, timeout, and optional data-driven configuration."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Writing Steps"}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["Open a case, type a step instruction in the input bar (e.g. ",s.jsx("em",{children:'"Click the Login button"'}),"), and press Enter. The step is saved immediately. Click ",s.jsx("strong",{children:"Generate All"})," to generate Playwright code for all steps at once."]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Step Types"}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"UI"})," — Playwright browser actions"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"API"})," — HTTP request/assertion steps"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Mock"})," — Intercept and stub network requests"]})]})]})},{id:"writing-steps",title:"Writing Steps — Examples",category:"Core Features",content:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{children:["Describe steps in plain English. Put the target name in quotes for reliability, use the"," ",s.jsx("strong",{children:"Fake Data"})," (",s.jsx("code",{className:"text-accent",children:"{{FAKE_*}}"}),") and"," ",s.jsx("strong",{children:"Files"})," (",s.jsx("code",{className:"text-accent",children:"{{FILE:name}}"}),") pickers for dynamic values, and prefix any assertion with ",s.jsx("strong",{children:'"Soft"'})," to keep running on failure."]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"UI steps"}),s.jsx("pre",{className:"text-[11px] bg-surface-inset rounded-lg px-4 py-3 overflow-x-auto border border-border font-mono",children:`# Navigation
926
+ Go to https://example.com
927
+ Navigate to /dashboard
928
+ Go back | Refresh the page
929
+
930
+ # Click (name the real role: button / link / tab)
931
+ Click the "Login" button
932
+ Click the "Dashboard" link
933
+ Double click the "Row 1" element
934
+
935
+ # Input
936
+ Enter "deepak" in the Username field
937
+ Type {{FAKE_INTERNET_EMAIL}} in the Email field
938
+ Fill "secret123" in the Password field # password -> getByLabel
939
+ Clear the Search field
940
+
941
+ # Dropdown / checkbox / radio
942
+ Select "India" from the Country dropdown
943
+ Check the "Remember me" checkbox
944
+ Select the "Male" radio button
945
+
946
+ # Keyboard / wait / scroll / hover
947
+ Press Enter | Press "Control+A"
948
+ Wait for 2 seconds | Wait for the page to load
949
+ Scroll down | Hover over the "Profile" menu
950
+
951
+ # File upload / download
952
+ Upload {{FILE:resume.pdf}} to the Resume field and wait for 'Upload complete'
953
+ Download the "Export CSV" link
954
+ Click the "Download" button to download
955
+
956
+ # Assertions (prefix "Soft" to continue on failure)
957
+ Verify "Welcome back" is visible
958
+ Verify "Error" is not visible
959
+ Verify the page title is "Dashboard"
960
+ Verify the URL contains "/dashboard"
961
+ Verify the "Email" field has value "user@test.com"`}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"API steps"}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["Mark the suite/case as ",s.jsx("strong",{children:"API"}),". Use ",s.jsx("code",{className:"text-accent",children:"{{BASE_URL}}"})," and saved variables."]}),s.jsx("pre",{className:"text-[11px] bg-surface-inset rounded-lg px-4 py-3 overflow-x-auto border border-border font-mono",children:`# Requests
962
+ Send a GET request to {{BASE_URL}}/api/users and verify status is 200
963
+ Send a POST request to {{BASE_URL}}/api/users with body { "name": "John" } and verify status 201
964
+ Send a DELETE request to {{BASE_URL}}/api/users/1 and verify status 204
965
+
966
+ # Auth — extract then reuse a token
967
+ POST to {{BASE_URL}}/api/login with { "email": "{{ADMIN_EMAIL}}", "password": "{{DEFAULT_PASSWORD}}" }, save token as AUTH_TOKEN
968
+ GET {{BASE_URL}}/api/profile with Authorization Bearer {{AUTH_TOKEN}} and verify status 200
969
+
970
+ # Response assertions
971
+ Verify the response body has property "id"
972
+ Verify the response field "name" equals "Admin"
973
+ Verify the content-type header contains "application/json"
974
+ Verify the response time is under 500 ms`}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["Full reference with every scenario (iframes, shadow DOM, dialogs, headers, query/form bodies): see ",s.jsx("code",{className:"text-accent",children:"docs/WRITING-STEPS.md"}),"."]})]})},{id:"ai-generation",title:"AI Code Generation",category:"Core Features",content:s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{children:"AssureMind uses your configured AI provider to convert natural-language instructions into executable Playwright code."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"How It Works"}),s.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsx("li",{children:"Write a step instruction in plain English."}),s.jsxs("li",{children:["Click the wand icon or ",s.jsx("strong",{children:"Generate All"}),"."]}),s.jsx("li",{children:"The AI generates strategy-specific Playwright code."}),s.jsx("li",{children:"Review the code by expanding the step row."})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Supported Providers"}),s.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:s.jsxs("div",{className:"space-y-3",children:[s.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 ",s.jsx("strong",{children:"code-tuned model with strong instruction-following"})," works best."]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Setup"}),s.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
975
+ ollama serve # server on http://localhost:11434
976
+ ollama pull qwen2.5-coder:7b # recommended model
977
+
978
+ # .env
979
+ AI_PROVIDER=ollama
980
+ OLLAMA_MODEL=qwen2.5-coder:7b
981
+ OLLAMA_BASE_URL=http://localhost:11434
982
+ AI_TIMEOUT=120 # local inference is slower`}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Recommended Models (by hardware)"}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-xs border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border",children:[s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Hardware"}),s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Model"}),s.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Notes"})]})}),s.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(([e,t,n])=>s.jsxs("tr",{className:"border-b border-border/50",children:[s.jsx("td",{className:"py-1.5 pr-4",children:e}),s.jsx("td",{className:"py-1.5 pr-4 font-mono text-accent",children:t}),s.jsx("td",{className:"py-1.5",children:n})]},t))})]})}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"System Requirements"}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:[s.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+."]}),s.jsxs("li",{children:[s.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."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Disk"})," — a few GB per model; keep 10–20 GB free if trying several."]})]}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["Tip: enable ",s.jsx("strong",{children:"MCP"})," (Settings → live page snapshots) for far more accurate locators with local models. Avoid ",s.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:s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{children:"The Run Configuration page lets you select suites, browsers, and settings before executing a test run."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Options"}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsx("li",{children:"Select one or more suites to run"}),s.jsx("li",{children:"Override browsers, headless mode, and parallel count"}),s.jsx("li",{children:"Enable/disable video recording and tracing"}),s.jsx("li",{children:"Set retries and screenshot mode per run"})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Device Emulation"}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["The ",s.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."]}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2 mt-1",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Desktop"})," — Viewport-only presets (1920×1080, 1440×900, 1366×768, 1280×720, 1024×768). No mobile emulation."]}),s.jsxs("li",{children:[s.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."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Tablet"})," — iPad Pro 11″, iPad (gen 7), iPad Mini, Galaxy Tab S4. Use WebKit or Chromium for best results."]})]}),s.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."}),s.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 ",s.jsx("strong",{children:"Chromium"}),". Firefox and WebKit do not fully support Playwright's mobile emulation flags."]}),s.jsx("h4",{className:"text-sm font-semibold text-content mt-2",children:"Live Progress"}),s.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."}),s.jsx("h4",{className:"text-sm font-semibold text-content mt-2",children:"Running from CI/CD (CLI)"}),s.jsx("p",{className:"text-sm text-content-secondary",children:"Every option available in the UI is also available as a CLI flag:"}),s.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)
983
+ npx assuremind run --all --ci
984
+
985
+ # Filter by type, suite, tag, or test name
986
+ npx assuremind run --type ui --tag smoke
987
+ npx assuremind run --suite "Login Tests" --browser chromium firefox
988
+
989
+ # Device emulation in CI
990
+ npx assuremind run --all --device "iPhone 15 Pro" --browser chromium --ci
991
+ npx assuremind run --tag smoke --device "Pixel 7" --browser chromium --ci
992
+ npx assuremind run --all --device "iPad Pro 11" --browser webkit --ci`})]})},{id:"reports",title:"Reports",category:"Core Features",content:s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{children:"Reports show step-level results with screenshots, error messages, Lighthouse scores (Audit suites), and visual regression baselines."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Report Features"}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsx("li",{children:"Per-step pass/fail status and error details"}),s.jsx("li",{children:"Screenshot filmstrip — click any thumbnail to enlarge"}),s.jsx("li",{children:"Execution timeline (Gantt view) per case"}),s.jsx("li",{children:"Visual baseline comparison with diff overlay"}),s.jsx("li",{children:"Allure integration for full HTML reports"})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Lighthouse Results (Audit Suites)"}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["For Audit suite cases with Lighthouse data, three tab buttons appear on the case row: ",s.jsx("strong",{children:"⚡ Speed"})," (Performance), ",s.jsx("strong",{children:"♿ A11y"})," (Accessibility), and ",s.jsx("strong",{children:"🔍 SEO"}),". Case rows are highlighted red when any score is Poor (< 50)."]}),s.jsxs("div",{className:"flex gap-4 text-sm mt-1",children:[s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"w-3 h-3 rounded-full bg-emerald-500 inline-block"})," Good (90+)"]}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"w-3 h-3 rounded-full bg-amber-400 inline-block"})," Needs Work (50–89)"]}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"w-3 h-3 rounded-full bg-red-500 inline-block"})," Poor (< 50) — case FAILS"]})]}),s.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:s.jsxs("div",{className:"space-y-3",children:[s.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."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Configuration"}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Max Level"})," — Healing aggressiveness (1–5)"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Daily Budget"})," — Max AI calls per day for healing"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Auto PR"})," — Automatically open a Git PR for healed steps"]})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Healed Steps"}),s.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:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{children:["Variables let you inject dynamic data into step instructions using ",s.jsx("code",{className:"text-accent",children:"{{variableName}}"})," tokens."]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Types of Variables"}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Static"})," — Fixed string values (e.g. credentials)"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Environment"})," — Per-environment overrides"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Faker"})," — Randomly generated test data (e.g. fake email)"]})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Dynamic Data Picker"}),s.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:s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{children:"The Git Control Center provides a visual interface for all Git operations — commit, push, pull, branch switching, and conflict resolution."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Key Operations"}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Commit"})," — Stage and commit all changes with a message"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"AI Message"})," — Generate a commit message using AI"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Full Sync"})," — Commit + push in one click"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Conflict Resolution"})," — Visual diff and AI-assisted merge"]})]})]})},{id:"bulk-actions",title:"Bulk Actions",category:"New Features",content:s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{children:"Select multiple test cases and perform batch operations including delete and move-to-suite."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"How to Use"}),s.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsx("li",{children:"Click the checkbox to the left of any test case row."}),s.jsxs("li",{children:["Hold ",s.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."]}),s.jsx("li",{children:"The Bulk Action Bar appears at the bottom of the screen."}),s.jsxs("li",{children:["Choose ",s.jsx("strong",{children:"Delete"})," or ",s.jsx("strong",{children:"Move to Suite"}),"."]})]})]})},{id:"flakiness-tracker",title:"Flakiness Tracker",category:"New Features",content:s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{children:"The Flakiness Tracker analyzes the last 20 runs for each test case and flags cases that intermittently pass and fail."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Flaky Badge"}),s.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 ",s.jsx("strong",{children:"~flaky"})," badge in the case list. Hover to see the exact pass rate."]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Thresholds"}),s.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:s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{children:"The Step Library stores reusable step templates that can be inserted into any test case with a single click."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Managing the Library"}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["Go to ",s.jsx("strong",{children:"Step Library"})," in the sidebar. Add steps with a name, instruction, and optional tags. Library steps are stored in ",s.jsx("code",{className:"text-accent",children:"tests/.step-library.json"}),"."]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Inserting Steps"}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["Open a test case, click the ",s.jsx("strong",{children:"Library"})," button in the top-right of the steps area. Search for a step template and click ",s.jsx("strong",{children:"Insert"})," to add it to the current case."]})]})},{id:"environment-profiles",title:"Environment Profiles",category:"New Features",content:s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{children:"Environment Profiles let you save and switch between different test configurations (URL, browsers, environment) without manually editing settings."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Creating Profiles"}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["Go to ",s.jsx("strong",{children:"Settings → Environment Profiles"})," and click ",s.jsx("strong",{children:"Add Profile"}),". Enter a name, then configure the profile in the list."]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Switching Profiles"}),s.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:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{children:["MCP (Model Context Protocol) integration connects the AI code generator to a real Playwright browser via the official ",s.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%."]}),s.jsxs("div",{className:"rounded-lg bg-purple-50 border border-purple-200 px-4 py-3 text-sm text-purple-800",children:[s.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."]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"How It Works"}),s.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:["When you click ",s.jsx("strong",{children:"Generate Code"}),", the SmartRouter launches a headless Playwright browser via MCP."]}),s.jsxs("li",{children:["The browser navigates to your app's URL and takes an ",s.jsx("strong",{children:"accessibility snapshot"})," — a structured tree of all interactive elements (buttons, inputs, links, etc.)."]}),s.jsx("li",{children:"The snapshot is fed to the AI alongside the step instruction, so the AI sees exact element roles, names, and attributes."}),s.jsx("li",{children:"The AI generates Playwright code using real selectors from the live page — no guessing."})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Generation Strategies"}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-xs border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border",children:[s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Strategy"}),s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Toggle"}),s.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Description"})]})}),s.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(([e,t,n])=>s.jsxs("tr",{children:[s.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:e}),s.jsx("td",{className:"py-1.5 pr-4 font-mono text-accent text-[10px]",children:t}),s.jsx("td",{className:"py-1.5",children:n})]},e))})]})}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Settings"}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["Go to ",s.jsx("strong",{children:"Settings → MCP Integration"})," to configure:"]}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Enable MCP"})," — Master switch (ON by default). When off, falls back to blind generation."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Headless mode"})," — Run the MCP browser without a visible window (ON by default)."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Act-then-script"})," — Two-phase generation: execute first, then convert to code (OFF by default)."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Proactive healing"})," — Pre-run selector validation against the live page (OFF by default)."]})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Fallback Behavior"}),s.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 ",s.jsx("strong",{children:"automatically falls back to blind generation"})," — exactly how it worked before MCP. No test run will ever fail because of MCP."]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Performance Impact"}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Template steps (~60%)"})," — Zero MCP overhead (bypassed entirely)"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Cached steps (~20%)"})," — Zero MCP overhead (bypassed entirely)"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"AI-generated steps (~20%)"})," — +2-5s first page load, <500ms for subsequent snapshots on the same page"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Test execution"})," — Zero impact (MCP is never used during runs)"]})]})]})},{id:"rag-memory",title:"RAG Memory",category:"New Features",content:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{children:["RAG (Retrieval-Augmented Generation) gives the AI ",s.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."]}),s.jsxs("div",{className:"rounded-lg bg-emerald-50 border border-emerald-200 px-4 py-3 text-sm text-emerald-800",children:[s.jsx("strong",{children:"Enabled by default"})," — uses local TF-IDF embeddings and file-based JSON storage. Zero cost, zero database, fully offline."]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Three Corpora"}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-xs border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border",children:[s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Corpus"}),s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Stores"}),s.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Used During"})]})}),s.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(([e,t,n])=>s.jsxs("tr",{children:[s.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:e}),s.jsx("td",{className:"py-1.5 pr-4",children:t}),s.jsx("td",{className:"py-1.5",children:n})]},e))})]})}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"How It Works"}),s.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Step passes"})," — instruction + code are ingested into the Code Corpus."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Step fails"})," — error pattern is recorded in the Error Catalog."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Healing succeeds"})," — fix is ingested into the Healing Corpus; Error Catalog updated with the fix."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Next generation"})," — SmartRouter queries Code Corpus. Score ≥ 0.90 = direct use ($0). Score 0.65-0.90 = AI prompt examples."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Next healing"})," — Level 2 queries Healing Corpus for similar past fixes."]})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"SmartRouter Pipeline"}),s.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
993
+
994
+ Score ≥ 0.90 → direct use (free)
995
+ Score 0.65–0.90 → inject as examples`}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Storage"}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["All RAG data stored in ",s.jsx("code",{className:"text-accent",children:"results/.rag/"})," as JSON files — fully Git-friendly. Delete the directory to reset all memory."]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Consumer Experience"}),s.jsxs("p",{className:"text-sm text-content-secondary",children:[s.jsx("strong",{children:"Zero setup required."})," RAG is ON by default and works automatically from the first run:"]}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Run 1"})," — memory is empty, AI generates code normally"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Run 2+"})," — similar instructions retrieved instead of making API calls (free + faster)"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Run 10+"})," — most common steps served from memory at zero cost"]})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"FAQ"}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-xs border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border",children:[s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Question"}),s.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Answer"})]})}),s.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(([e,t])=>s.jsxs("tr",{children:[s.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:e}),s.jsx("td",{className:"py-1.5",children:t})]},e))})]})}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"When to Use the Settings Card"}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["Most users ",s.jsx("strong",{children:"never need to touch RAG settings"}),". The Settings → RAG Memory card exists for power-user scenarios:"]}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-xs border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border",children:[s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Scenario"}),s.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Action"})]})}),s.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(([e,t])=>s.jsxs("tr",{children:[s.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:e}),s.jsx("td",{className:"py-1.5",children:t})]},e))})]})}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Settings Reference"}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["Go to ",s.jsx("strong",{children:"Settings → RAG Memory"})," to configure:"]}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Enable RAG"})," — Master switch (ON by default)"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Code Corpus"})," — Toggle instruction-to-code memory"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Healing Corpus"})," — Toggle healing fix memory"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Error Catalog"})," — Toggle error pattern tracking"]})]})]})},{id:"per-step-retry",title:"Per-Step Retry",category:"New Features",content:s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{children:"Individual steps can be configured to retry on failure, independent of the global retry setting."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Configuration"}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["In the case editor, each step row shows a small ",s.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."]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Retry Behavior"}),s.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:s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{children:"Before and After hooks run additional steps around a test case's main step sequence."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Hooks Tab"}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["Open a test case and click the ",s.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."]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Use Cases"}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsx("li",{children:"Before hook: Login, seed test data, navigate to start URL"}),s.jsx("li",{children:"After hook: Logout, clean up created records, capture diagnostics"})]})]})},{id:"network-mocking",title:"Network Mocking",category:"New Features",content:s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{children:"Mock steps intercept HTTP requests matching a URL pattern and return a custom response — without touching the real backend."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Creating a Mock Step"}),s.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:["In the case editor, change the step type dropdown to ",s.jsx("strong",{children:"Mock"}),"."]}),s.jsx("li",{children:"Expand the step to reveal the Mock Route fields."}),s.jsxs("li",{children:["Enter the URL pattern (e.g. ",s.jsx("code",{className:"text-accent",children:"**/api/users"}),"), status code, and JSON body."]})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Behavior"}),s.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:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("p",{children:[s.jsx("strong",{children:"Audit suites"})," run full Playwright automation and trigger Google Lighthouse at steps explicitly marked with the ",s.jsx("strong",{children:"⚡ Audit"})," flag. Three categories are measured: Performance, Accessibility, and SEO."]}),s.jsxs("div",{className:"rounded-lg bg-violet-50 border border-violet-200 px-4 py-3 text-sm text-violet-800",children:[s.jsx("strong",{children:"Chromium only"}),' — Lighthouse uses Chrome DevTools Protocol (CDP). Firefox and WebKit runs will show a "not available" notice instead.']}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"How It Works"}),s.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:["Create an ",s.jsx("strong",{children:"Audit"})," suite in the Test Editor."]}),s.jsxs("li",{children:["Mark one or more steps with the ",s.jsx("strong",{children:"⚡ Audit"})," button to designate Lighthouse checkpoints."]}),s.jsxs("li",{children:["In the ",s.jsx("strong",{children:"Non-Functional Checks"})," section on each case, tick ⚡ Performance, ♿ Accessibility, and/or 🔍 SEO."]}),s.jsxs("li",{children:["Run the suite — Lighthouse audits ",s.jsx("code",{className:"text-accent",children:"page.url()"})," at each marked step."]}),s.jsx("li",{children:"Results are saved to the run report with color-coded scores."})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Collected Metrics"}),s.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(e=>s.jsxs("div",{className:"rounded-lg border border-border bg-surface-inset/40 px-3 py-2",children:[s.jsx("p",{className:"text-xs font-bold text-content",children:e.label}),s.jsx("p",{className:"text-[10px] text-content-tertiary",children:e.desc}),s.jsxs("p",{className:"text-[10px] text-emerald-600 font-medium mt-0.5",children:["Good: ",e.good]})]},e.label))}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Viewing in Reports"}),s.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsx("li",{children:"Open the Reports page and expand a completed Audit run."}),s.jsxs("li",{children:["Case rows with Lighthouse data show three tab buttons: ",s.jsx("strong",{children:"⚡ Speed"}),", ",s.jsx("strong",{children:"♿ A11y"}),", ",s.jsx("strong",{children:"🔍 SEO"}),"."]}),s.jsx("li",{children:"Click a tab to view the score and metrics for that category."}),s.jsx("li",{children:"Case rows are highlighted red when any score is Poor (< 50)."})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Allure Attachments"}),s.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."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Color Thresholds"}),s.jsxs("div",{className:"flex gap-4 text-sm",children:[s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"w-3 h-3 rounded-full bg-emerald-500 inline-block"})," Good (90–100)"]}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"w-3 h-3 rounded-full bg-amber-400 inline-block"})," Needs Work (50–89)"]}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.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:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{children:["Visual regression testing compares step screenshots against saved baselines to detect unintended UI changes. Configure in ",s.jsx("strong",{children:"Settings"})," → Visual Regression. Review results in ",s.jsx("strong",{children:"Reports"})," → Visual Diffs / Baselines tabs."]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Setup"}),s.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:["Go to ",s.jsx("strong",{children:"Settings"})," → Visual Regression and enable it."]}),s.jsxs("li",{children:["In the ",s.jsx("strong",{children:"Test Editor"}),", click the ",s.jsx("strong",{children:"Eye icon"})," on steps you want to compare visually."]}),s.jsx("li",{children:"Run your tests — first run creates baselines automatically."})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Reviewing Diffs"}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["After runs, go to ",s.jsx("strong",{children:"Reports"})," → ",s.jsx("strong",{children:"Visual Diffs"})," tab to review side-by-side comparisons. Approve intentional changes or reject bugs. Manage all baselines in the ",s.jsx("strong",{children:"Baselines"})," tab."]})]})},{id:"test-impact",title:"Test Impact Analysis",category:"New Features",content:s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{children:"Test Impact Analysis identifies which test cases might be affected by the current set of uncommitted file changes."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Running Analysis"}),s.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:["Open the ",s.jsx("strong",{children:"Git Control Center"}),"."]}),s.jsxs("li",{children:["Expand the ",s.jsx("strong",{children:"Test Impact Analysis"})," section."]}),s.jsxs("li",{children:["Click ",s.jsx("strong",{children:"Analyze Impact"}),"."]})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"How It Works"}),s.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:s.jsxs("div",{className:"space-y-3",children:[s.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 ",s.jsx("code",{className:"text-[10px] bg-surface-inset px-1 py-0.5 rounded",children:"isMobile"})," flag are all applied automatically."]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Using in Studio (Run Config)"}),s.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:["Go to the ",s.jsx("strong",{children:"Run Config"})," page."]}),s.jsxs("li",{children:["Find the ",s.jsx("strong",{children:"Device Emulation"})," card below the Browsers card."]}),s.jsxs("li",{children:["Use the tabs to filter by ",s.jsx("strong",{children:"All / Desktop / Mobile / Tablet"}),"."]}),s.jsx("li",{children:"Click a device card to select it — it highlights in teal."}),s.jsxs("li",{children:["Click ",s.jsx("strong",{children:"Start Run"})," — the device is applied to every case in the run."]}),s.jsxs("li",{children:["To clear, click the ",s.jsx("strong",{children:"×"})," in the card header or select ",s.jsx("strong",{children:"No Emulation"}),"."]})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Using from CLI / CI"}),s.jsx("pre",{className:"bg-[#1e1e2e] text-[#cdd6f4] text-[10px] font-mono p-3 rounded-lg overflow-x-auto leading-relaxed",children:`# Mobile
996
+ npx assuremind run --all --device "iPhone 15 Pro" --browser chromium --ci
997
+ npx assuremind run --tag smoke --device "Pixel 7" --browser chromium --ci
998
+
999
+ # Tablet
1000
+ npx assuremind run --all --device "iPad Pro 11" --browser webkit --ci
1001
+ npx assuremind run --suite "Mobile" --device "Galaxy Tab S4" --browser chromium --ci
1002
+
1003
+ # Permanent default in autotest.config.ts
1004
+ device: 'iPhone 15 Pro'`}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Available Devices"}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-xs border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border",children:[s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Device"}),s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Category"}),s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Viewport"}),s.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Best Browser"})]})}),s.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(([e,t,n,r])=>s.jsxs("tr",{children:[s.jsx("td",{className:"py-1.5 pr-4 font-mono text-[10px]",children:e}),s.jsx("td",{className:"py-1.5 pr-4",children:t}),s.jsx("td",{className:"py-1.5 pr-4",children:n}),s.jsx("td",{className:"py-1.5",children:r})]},e))})]})}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"In Reports"}),s.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."}),s.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 ",s.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:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{children:["The Test Recorder lets you create tests by interacting with your application in a real browser — ",s.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 ",s.jsx("strong",{children:"UI"})," and ",s.jsx("strong",{children:"Audit"})," suites only (not API suites)."]}),s.jsxs("div",{className:"rounded-lg bg-red-50 border border-red-200 px-4 py-3 text-sm text-red-800",children:[s.jsx("strong",{children:"Zero AI, zero cost"})," — the recorder resolves locators against Playwright's live accessibility tree. No API keys or AI calls needed."]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"How to Record"}),s.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:["Open a test case in the ",s.jsx("strong",{children:"Test Editor"}),"."]}),s.jsxs("li",{children:["Click the red ",s.jsx("strong",{children:"Record"}),' button (between "Add Step" and "Generate All").']}),s.jsx("li",{children:"A headed Chromium browser opens your app's base URL."}),s.jsxs("li",{children:["Interact naturally — click buttons, fill forms, navigate pages. ",s.jsx("strong",{children:"Iframes are handled automatically."})]}),s.jsx("li",{children:"Each action appears in the live preview panel in real time."}),s.jsxs("li",{children:["Click ",s.jsx("strong",{children:"Stop Recording"})," when done — all actions become steps with pre-generated code."]})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Assertion Shortcuts"}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-xs border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border",children:[s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Shortcut"}),s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Type"}),s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Behavior"}),s.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Example Output"})]})}),s.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(([e,t,n,r])=>s.jsxs("tr",{children:[s.jsx("td",{className:"py-1.5 pr-4",children:s.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-surface-inset border border-border text-[10px] font-mono",children:e})}),s.jsx("td",{className:"py-1.5 pr-4",children:t}),s.jsx("td",{className:"py-1.5 pr-4",children:n}),s.jsx("td",{className:"py-1.5 font-mono text-[10px] text-accent",children:r})]},e))})]})}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Hard vs Soft Assertions"}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-xs border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border",children:[s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Type"}),s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Keyword"}),s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Behavior"}),s.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"When to use"})]})}),s.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(([e,t,n,r])=>s.jsxs("tr",{children:[s.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:e}),s.jsx("td",{className:"py-1.5 pr-4 font-mono text-[10px]",children:t}),s.jsx("td",{className:"py-1.5 pr-4",children:n}),s.jsx("td",{className:"py-1.5",children:r})]},e))})]})}),s.jsx("p",{className:"text-sm text-content-secondary",children:s.jsx("strong",{children:"Three ways to use soft assertions:"})}),s.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Recorder"})," — Ctrl+Shift+Click instead of Shift+Click"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Plain English"}),' — Start instruction with "Soft verify..." or "Soft check..." or "Soft assert..."']}),s.jsxs("li",{children:[s.jsx("strong",{children:"Step toggle"})," — Click the blue ",s.jsx("strong",{children:"Hard/Soft"})," badge on any assertion step in the editor"]})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Locator Resolution (6 Strategies)"}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["The recorder queries Playwright's ",s.jsx("strong",{children:"accessibility tree"})," and tries 6 strategies in priority order, verifying each with ",s.jsx("code",{className:"text-accent",children:"count() === 1"}),":"]}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-xs border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border",children:[s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"#"}),s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Strategy"}),s.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Example"})]})}),s.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(([e,t,n])=>s.jsxs("tr",{children:[s.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:e}),s.jsx("td",{className:"py-1.5 pr-4 font-medium",children:t}),s.jsx("td",{className:"py-1.5 font-mono text-[10px] text-accent",children:n})]},e))})]})}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"What Makes It Stand Out vs Other Recorders"}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-xs border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border",children:[s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Feature"}),s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Selenium IDE"}),s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Playwright Codegen"}),s.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"AssureMind Recorder"})]})}),s.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(([e,t,n,r])=>s.jsxs("tr",{children:[s.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:e}),s.jsx("td",{className:"py-1.5 pr-4",children:t}),s.jsx("td",{className:"py-1.5 pr-4",children:n}),s.jsx("td",{className:"py-1.5 font-medium text-emerald-600",children:r})]},e))})]})}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Biggest Pain Points in Test Automation — Solved"}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-xs border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border",children:[s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Pain Point"}),s.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"How Recorder Solves It"})]})}),s.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(([e,t])=>s.jsxs("tr",{children:[s.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:e}),s.jsx("td",{className:"py-1.5",children:t})]},e))})]})}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Iframe Support"}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["The recorder automatically handles ",s.jsx("strong",{children:"same-origin iframes"})," — common in enterprise apps like SAP, Salesforce, and embedded widgets:"]}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:["Capture script injected into ",s.jsx("strong",{children:"all frames"})," (main page + every iframe)"]}),s.jsxs("li",{children:["Elements inside iframes produce ",s.jsx("code",{className:"text-accent",children:"frameLocator()"})," chains automatically"]}),s.jsxs("li",{children:["Example: ",s.jsxs("code",{className:"text-accent text-[10px]",children:["page.frameLocator('#content-frame').getByRole('button', ","{"," name: 'Submit' ","}",").click()"]})]}),s.jsxs("li",{children:["Dynamically loaded iframes detected via ",s.jsx("code",{className:"text-accent",children:"frameattached"})," events"]}),s.jsx("li",{children:"Recording banner only appears in the main frame"}),s.jsxs("li",{children:[s.jsx("strong",{children:"Limitation:"})," Cross-origin iframes (different domain) cannot be instrumented due to browser security"]})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Technical Details"}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:["Uses ",s.jsx("code",{className:"text-accent",children:"context.exposeBinding()"})," — communication survives all page navigations and works across all frames"]}),s.jsxs("li",{children:["Input values captured on ",s.jsx("strong",{children:"blur"})," (when user leaves the field), not on keystrokes — no duplicate steps"]}),s.jsxs("li",{children:["Capture script re-injected on every page load via ",s.jsx("code",{className:"text-accent",children:"page.on('load')"})," and into child frames via ",s.jsx("code",{className:"text-accent",children:"frameattached"})," + ",s.jsx("code",{className:"text-accent",children:"framenavigated"})]}),s.jsxs("li",{children:["Recorded steps use the ",s.jsx("strong",{children:"recorder"})," strategy tag, distinguishing them from AI-generated code"]}),s.jsx("li",{children:'All recorded steps are immediately runnable — no "Generate Code" step required'})]})]})},{id:"keyboard-shortcuts",title:"Keyboard Shortcuts",category:"Reference",content:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{children:["Press ",s.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."]}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-xs border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border",children:[s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Shortcut"}),s.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Action"})]})}),s.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(([e,t])=>s.jsxs("tr",{className:"border-b border-border/50",children:[s.jsx("td",{className:"py-1.5 pr-4",children:s.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-surface-inset border border-border text-[10px] font-mono",children:e})}),s.jsx("td",{className:"py-1.5",children:t})]},e))})]})})]})},{id:"data-driven",title:"Data-Driven Testing",category:"Reference",content:s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{children:"Test cases support data-driven execution — running the same case multiple times with different input data."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Data Sources"}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Inline JSON"})," — Enter an array of objects directly in the editor"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"JSON File"})," — Reference a ",s.jsx("code",{className:"text-accent",children:".json"})," file in your project"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"CSV File"})," — Reference a ",s.jsx("code",{className:"text-accent",children:".csv"})," file with headers"]})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Accessing Data"}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["Use ",s.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:s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{children:"Faker tokens generate random, realistic test data at runtime. Use them to avoid hardcoded values in test steps."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Available Tokens"}),s.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(e=>s.jsx("code",{className:"text-[10px] bg-surface-inset rounded px-2 py-0.5 border border-border text-accent font-mono",children:`{{${e}}}`},e))}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Usage"}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["Type the token directly in a step instruction, or use the ",s.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:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{children:["AssureMind exposes a REST API at ",s.jsx("code",{className:"text-accent",children:"http://localhost:4400/api"})," for programmatic access."]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Key Endpoints"}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-xs border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border",children:[s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Endpoint"}),s.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Description"})]})}),s.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(([e,t])=>s.jsxs("tr",{className:"border-b border-border/50",children:[s.jsx("td",{className:"py-1.5 pr-4 text-accent text-[10px]",children:e}),s.jsx("td",{className:"py-1.5 font-sans",children:t})]},e))})]})})]})},{id:"faker-data",title:"Faker Data",category:"Enterprise Features",content:s.jsxs("div",{className:"space-y-3",children:[s.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."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Token Format"}),s.jsxs("p",{children:["Use the pattern ",s.jsx("code",{className:"text-accent",children:"{{FAKE_CATEGORY_METHOD}}"})," anywhere in a step value. The engine replaces it with a random value at runtime."]}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-xs border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border",children:[s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Token"}),s.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Example Output"})]})}),s.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(([e,t])=>s.jsxs("tr",{className:"border-b border-border/50",children:[s.jsx("td",{className:"py-1.5 pr-4",children:s.jsx("code",{className:"text-accent",children:e})}),s.jsx("td",{className:"py-1.5",children:t})]},e))})]})}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"16 Categories"}),s.jsxs("p",{children:[s.jsx("code",{className:"text-accent",children:"person"}),","," ",s.jsx("code",{className:"text-accent",children:"internet"}),","," ",s.jsx("code",{className:"text-accent",children:"phone"}),","," ",s.jsx("code",{className:"text-accent",children:"location"}),","," ",s.jsx("code",{className:"text-accent",children:"company"}),","," ",s.jsx("code",{className:"text-accent",children:"finance"}),","," ",s.jsx("code",{className:"text-accent",children:"date"}),","," ",s.jsx("code",{className:"text-accent",children:"lorem"}),","," ",s.jsx("code",{className:"text-accent",children:"string"}),","," ",s.jsx("code",{className:"text-accent",children:"number"}),","," ",s.jsx("code",{className:"text-accent",children:"datatype"}),","," ",s.jsx("code",{className:"text-accent",children:"image"}),","," ",s.jsx("code",{className:"text-accent",children:"color"}),","," ",s.jsx("code",{className:"text-accent",children:"commerce"}),","," ",s.jsx("code",{className:"text-accent",children:"vehicle"}),","," ",s.jsx("code",{className:"text-accent",children:"system"})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Legacy Tokens (Backward-Compatible)"}),s.jsx("p",{className:"text-sm text-content-secondary",children:"These shorthand tokens from earlier versions still work and map to their modern equivalents:"}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-xs border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border",children:[s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Legacy Token"}),s.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Maps To"})]})}),s.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(([e,t])=>s.jsxs("tr",{className:"border-b border-border/50",children:[s.jsx("td",{className:"py-1.5 pr-4",children:s.jsx("code",{className:"text-accent",children:e})}),s.jsx("td",{className:"py-1.5",children:s.jsx("code",{className:"text-accent",children:t})})]},e))})]})}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Auto-Refresh"}),s.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."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Modal UI — Multi-Select & Insert"}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["Click the ",s.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."]}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["The picker supports ",s.jsx("strong",{children:"multi-select"})," — click any generator to select it (checkmark + violet highlight). Selected tokens appear as ",s.jsx("strong",{children:"removable chips"})," ","in a bar at the bottom of the modal. For Random Number, use the"," ",s.jsx("code",{className:"text-accent",children:"+ Add"})," button to add it to your selection."]}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Insert N tokens"})," — inserts all selected tokens comma-separated into the step instruction."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Clear all"})," — removes every selection from the chip bar."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Cancel"})," — closes the modal without inserting anything."]})]}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["Example: selecting ",s.jsx("code",{className:"text-accent",children:"firstName"}),","," ",s.jsx("code",{className:"text-accent",children:"lastName"}),", and"," ",s.jsx("code",{className:"text-accent",children:"email"})," inserts:"," ",s.jsx("code",{className:"text-accent",children:"{{FAKE_PERSON_FIRSTNAME}}, {{FAKE_PERSON_LASTNAME}}, {{FAKE_INTERNET_EMAIL}}"})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Use Cases"}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Form filling"})," — Populate any form with realistic names, emails, addresses, and phone numbers in one step."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Registration testing"}),' — Generate unique users every run so you never hit "email already exists" errors.']}),s.jsxs("li",{children:[s.jsx("strong",{children:"Data-driven testing"})," — Combine faker tokens with data loops to generate hundreds of unique test rows automatically."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Finance workflows"})," — Random credit card numbers, IBAN codes, and currency amounts for payment flow tests."]}),s.jsxs("li",{children:[s.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:s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{children:"Handle file inputs and downloads with no boilerplate — upload fixtures from the Studio and let the framework capture downloads automatically."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Uploading files"}),s.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:["In the ",s.jsx("strong",{children:"Test Editor"}),", click the ",s.jsx("strong",{children:"Files"})," button (next to ",s.jsx("em",{children:"Fake Data"}),")."]}),s.jsxs("li",{children:["Choose a file — it's saved in your repo at ",s.jsx("code",{className:"text-accent",children:"fixtures/uploads/"})," (committed, CI-portable)."]}),s.jsxs("li",{children:["Click the file to insert a ",s.jsx("code",{className:"text-accent",children:"{{FILE:name}}"})," token into the step."]})]}),s.jsx("p",{className:"text-sm text-content-secondary",children:"The token resolves to the file's path at runtime:"}),s.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
1005
+ Code: await page.getByLabel('Resume').setInputFiles('{{FILE:resume.pdf}}');
1006
+
1007
+ // File-chooser button (keep listener + click in ONE step):
1008
+ const fileChooserPromise = page.waitForEvent('filechooser');
1009
+ await page.getByRole('button', { name: 'Choose File' }).click();
1010
+ (await fileChooserPromise).setFiles('{{FILE:resume.pdf}}');`}),s.jsxs("p",{className:"text-sm text-content-secondary",children:["Inside an iframe, wrap with ",s.jsx("code",{className:"text-accent",children:"frameLocator(...)"})," as usual."]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Waiting for the upload"}),s.jsxs("p",{className:"text-sm text-content-secondary",children:[s.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.']}),s.jsx("p",{className:"text-sm text-content-secondary",children:"Example upload steps:"}),s.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
1011
+ Upload {{FILE:resume.pdf}} to the Resume field and wait for 'Upload complete' // most reliable
1012
+ Upload {{FILE:photo.png}} // page's file input`}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Downloads (auto-captured)"}),s.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"," ",s.jsx("code",{className:"text-accent",children:"results/downloads/<runId>/"}),". Do ",s.jsx("strong",{children:"not"})," use"," ",s.jsx("code",{className:"text-accent",children:"download.saveAs()"})," or ",s.jsx("code",{className:"text-accent",children:"fs"})," in steps — the sandbox blocks them and it isn't needed."]}),s.jsx("p",{className:"text-sm text-content-secondary",children:"Example download steps:"}),s.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
1013
+ Click the "Export" button to download
1014
+ Download the file by clicking "Report PDF"
1015
+ Click "Download invoice" and wait for download`}),s.jsx("p",{className:"text-sm text-content-secondary",children:"Each generates a wait so the step passes only once the download is complete:"}),s.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');
1016
+ await page.getByRole('link', { name: 'Export CSV' }).click();
1017
+ const download = await downloadPromise;
1018
+ await download.path(); // resolves once the download is complete`}),s.jsx("p",{className:"text-sm text-content-secondary",children:"To view captured files:"}),s.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:["Open ",s.jsx("strong",{children:"Reports → Run Reports"})," and expand the run."]}),s.jsxs("li",{children:["A ",s.jsx("strong",{children:"Downloads"})," panel lists every file captured during that run."]}),s.jsx("li",{children:"Click any file to save it to your local machine."})]}),s.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:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{children:["Visual Regression performs pixel-perfect screenshot comparison using"," ",s.jsx("code",{className:"text-accent",children:"pixelmatch"}),". Enable it on any test step to automatically detect unintended UI changes between runs."]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Workflow"}),s.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:["Enable visual regression in ",s.jsx("strong",{children:"Settings"})," → Visual Regression."]}),s.jsxs("li",{children:["Click the ",s.jsx("strong",{children:"Eye icon"})," on steps in the Test Editor to enable per-step comparison."]}),s.jsxs("li",{children:["First run captures ",s.jsx("strong",{children:"baseline"})," screenshots."]}),s.jsx("li",{children:"Subsequent runs compare against baselines using pixelmatch."}),s.jsx("li",{children:"If the diff exceeds the threshold the step fails with a visual diff image."}),s.jsxs("li",{children:["Review in ",s.jsx("strong",{children:"Reports"})," → Visual Diffs tab → ",s.jsx("strong",{children:"Approve"})," or ",s.jsx("strong",{children:"Reject"}),"."]})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Configuration"}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-xs border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border",children:[s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Setting"}),s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Description"}),s.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Default"})]})}),s.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(([e,t,n])=>s.jsxs("tr",{className:"border-b border-border/50",children:[s.jsx("td",{className:"py-1.5 pr-4",children:e}),s.jsx("td",{className:"py-1.5 pr-4",children:t}),s.jsx("td",{className:"py-1.5",children:n})]},e))})]})}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Use Cases"}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"CSS refactor"})," — Verify no visual regressions across all pages after style changes."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Multi-browser"})," — Separate baselines per browser and viewport combination."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Design review"})," — Catch layout shifts, missing elements, and colour changes automatically."]})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Where Files Live"}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Baselines"})," — ",s.jsx("code",{className:"text-accent",children:"baselines/{suite}/{case}/{step}-{browser}-{viewport}.png"})," (commit to git)"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Diffs"})," — ",s.jsx("code",{className:"text-accent",children:"results/visual-diffs/{runId}/"})," (gitignored)"]})]})]})},{id:"ci-integration",title:"CI/CD Integration",category:"Enterprise Features",content:s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{children:"CI/CD Integration connects AssureMind to your delivery pipeline with quality gates, PR comments, and notifications."}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"CI Config Generator"}),s.jsxs("p",{children:["From ",s.jsx("strong",{children:"Run Config → Generate CI Config"}),", generate a pipeline file for",s.jsx("strong",{children:" GitHub Actions"}),", ",s.jsx("strong",{children:"GitLab CI"}),", or ",s.jsx("strong",{children:"Jenkins"})," based on your current run settings (browsers, parallelism, device)."]}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:["The YAML opens in a ",s.jsx("strong",{children:"preview"}),". Click ",s.jsx("strong",{children:"Edit"})," to customise it (branches, Node version, extra steps); your edits apply to Copy, Download, and Write to repo. ",s.jsx("strong",{children:"Reset"})," regenerates from the run config."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Copy"})," and ",s.jsx("strong",{children:"Download"})," are always available."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Write to repo"})," (opt-in) writes the file into your project at its standard path (",s.jsx("code",{className:"text-accent",children:".github/workflows/assuremind.yml"}),", ",s.jsx("code",{className:"text-accent",children:".gitlab-ci.yml"}),", or ",s.jsx("code",{className:"text-accent",children:"Jenkinsfile"}),"). It only ",s.jsx("strong",{children:"writes the file"})," — it does ",s.jsx("strong",{children:"not"})," commit or push. Review and commit it from the ",s.jsx("strong",{children:"Git Control Center"}),"."]}),s.jsxs("li",{children:["Enable the button in ",s.jsx("strong",{children:'Settings → CI/CD Integration → "Write CI files to repo"'})," (off by default)."]})]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Quality Gates"}),s.jsxs("p",{children:["Define thresholds — minimum pass rate, maximum duration, required tags that must pass. The pipeline exits ",s.jsx("code",{className:"text-accent",children:"1"})," if any gate fails, blocking the merge or deploy."]}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"PR Comments"}),s.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."}),s.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
1019
+ | Metric | Value |
1020
+ |--------------|--------------|
1021
+ | Pass Rate | 95% (47/50) |
1022
+ | Failed | 3 |
1023
+ | Duration | 4m 32s |
1024
+ | Quality Gate | ✅ Passed |`}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Notifications"}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-xs border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-border",children:[s.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Channel"}),s.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"How It Works"})]})}),s.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(([e,t])=>s.jsxs("tr",{className:"border-b border-border/50",children:[s.jsx("td",{className:"py-1.5 pr-4",children:e}),s.jsx("td",{className:"py-1.5",children:t})]},e))})]})}),s.jsx("h4",{className:"text-sm font-semibold text-content",children:"Use Cases"}),s.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[s.jsxs("li",{children:[s.jsx("strong",{children:"PR workflow"})," — Tests run → quality gate evaluates → PR comment posted → Slack alert on failure."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Nightly regression"})," — Full suite runs on schedule, results pushed to Teams channel."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Deploy pipeline"})," — Deploy → wait for healthy → run smoke tests → notify team."]})]})]})}],rC=Array.from(new Set(Ai.map(e=>e.category)));function aC(){const[e,t]=m.useState(Ai[0].id),n=m.useRef({}),r=m.useRef(null);m.useEffect(()=>{const i=[];return Ai.forEach(l=>{const o=n.current[l.id];if(!o)return;const c=new IntersectionObserver(([d])=>{d.isIntersecting&&t(l.id)},{root:r.current,rootMargin:"-20% 0px -60% 0px",threshold:0});c.observe(o),i.push(c)}),()=>i.forEach(l=>l.disconnect())},[]);const a=i=>{const l=n.current[i];if(l&&r.current){const o=r.current,c=l.offsetTop-24;o.scrollTo({top:c,behavior:"smooth"})}};return s.jsxs("div",{className:"flex h-full overflow-hidden bg-background",children:[s.jsx("aside",{className:"w-56 flex-shrink-0 border-r border-border bg-surface overflow-y-auto hidden lg:block",children:s.jsxs("div",{className:"px-4 py-4",children:[s.jsx("h2",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest mb-3",children:"Documentation"}),s.jsx("nav",{className:"space-y-0.5",children:rC.map(i=>s.jsxs("div",{className:"mb-3",children:[s.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest px-2 py-1",children:i}),Ai.filter(l=>l.category===i).map(l=>s.jsx("button",{type:"button",onClick:()=>a(l.id),className:E("w-full text-left px-2 py-1.5 rounded-lg text-xs transition-colors",e===l.id?"bg-accent/8 text-accent font-semibold":"text-content-secondary hover:text-content hover:bg-surface-inset"),children:l.title},l.id))]},i))})]})}),s.jsx("div",{ref:r,className:"flex-1 overflow-y-auto",children:s.jsx("div",{className:"max-w-2xl mx-auto px-6 py-6 space-y-0",children:Ai.map(i=>s.jsxs("section",{id:i.id,ref:l=>{l&&(n.current[i.id]=l)},className:"mb-10 scroll-mt-6",children:[s.jsxs("div",{className:"mb-4",children:[s.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:i.category}),s.jsx("h2",{className:"text-base font-bold text-content mt-0.5",children:i.title})]}),s.jsx("div",{className:"text-sm text-content-secondary leading-relaxed",children:i.content}),s.jsx("div",{className:"mt-8 border-b border-border"})]},i.id))})})]})}const ro={getConfig:()=>fetch("/api/ci-integration/config").then(e=>e.json()),saveConfig:e=>fetch("/api/ci-integration/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(t=>t.json()),getQualityGates:()=>fetch("/api/ci-integration/quality-gates").then(e=>e.json()),testNotification:e=>fetch("/api/ci-integration/test-notification",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channel:e})}).then(t=>t.json())};function ki({checked:e,onChange:t,label:n,description:r}){return s.jsxs("label",{className:"flex items-center justify-between gap-3 cursor-pointer group",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-xs font-medium text-content",children:n}),r&&s.jsx("p",{className:"text-[10px] text-content-tertiary mt-0.5",children:r})]}),s.jsx("button",{type:"button",role:"switch","aria-checked":e,onClick:()=>t(!e),className:`relative w-9 h-5 rounded-full transition-colors ${e?"bg-accent":"bg-gray-300 dark:bg-gray-600"}`,children:s.jsx("span",{className:`absolute top-0.5 left-0.5 w-4 h-4 rounded-full bg-white shadow transition-transform ${e?"translate-x-4":""}`})})]})}function cs({children:e}){return s.jsx("label",{className:"block text-[10px] font-semibold text-content-tertiary uppercase tracking-wider mb-1",children:e})}function iC({value:e,onChange:t}){const n=[{key:"every-run",label:"On every run"},{key:"failure",label:"On failure only"},{key:"healing",label:"On healing events"}];return s.jsx("div",{className:"flex flex-wrap gap-3",children:n.map(r=>s.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:e.includes(r.key),onChange:a=>{a.target.checked?t([...e,r.key]):t(e.filter(i=>i!==r.key))},className:"w-3.5 h-3.5 rounded border-border text-accent focus:ring-accent/30"}),s.jsx("span",{className:"text-xs text-content-secondary",children:r.label})]},r.key))})}function lC(){var j,k;const e=ie(),[t,n]=m.useState("slack"),{data:r,isLoading:a}=me({queryKey:["ci-integration-config"],queryFn:ro.getConfig}),{data:i=[]}=me({queryKey:["ci-integration-quality-gates"],queryFn:ro.getQualityGates}),l=W({mutationFn:ro.saveConfig,onSuccess:()=>{e.invalidateQueries({queryKey:["ci-integration-config"]}),A.success("Configuration saved")},onError:N=>A.error(N.message)}),o=W({mutationFn:N=>ro.testNotification(N),onSuccess:N=>{N.ok?A.success("Test notification sent"):A.error(N.error??"Failed to send test notification")},onError:N=>A.error(N.message)}),[c,d]=m.useState(null),x=c??r;function p(N){const S=structuredClone(x??r);S&&(N(S),d(S))}function y(){x&&(l.mutate(x),d(null))}const b=c!==null;if(a||!x)return s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(ae,{size:20,className:"animate-spin text-accent"})});const f=i.slice(0,5),v=[{key:"slack",label:"Slack",icon:Op},{key:"email",label:"Email",icon:aw},{key:"teams",label:"Teams",icon:nn},{key:"custom",label:"Custom Webhook",icon:Cw}];function w(){switch(t){case"slack":return x.notifications.slack;case"email":return x.notifications.email;case"teams":return x.notifications.teams;case"custom":return x.notifications.customWebhook}}function h(N){p(S=>{const P=t==="custom"?S.notifications.customWebhook:S.notifications[t];N(P)})}const u=w(),g=u.enabled&&(t==="email"?(((j=u.recipients)==null?void 0:j.length)??0)>0:t==="custom"?!!u.url:!!u.webhookUrl);return s.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:s.jsx("div",{className:"flex-1 overflow-y-auto",children:s.jsxs("div",{className:"max-w-4xl mx-auto px-5 py-4 space-y-3",children:[s.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:s.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.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:s.jsx(Lc,{size:17,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-sm font-bold text-content",children:"CI/CD Integration"}),s.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Quality gates, PR comments, and notifications for your pipeline"})]})]}),b&&s.jsxs("button",{type:"button",onClick:y,disabled:l.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:[l.isPending?s.jsx(ae,{size:13,className:"animate-spin"}):s.jsx(we,{size:13}),"Save Changes"]})]})}),s.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[s.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center gap-2",children:[s.jsx(fw,{size:15,className:"text-accent"}),s.jsx("span",{className:"text-xs font-bold text-content",children:"Quality Gate"})]}),s.jsxs("div",{className:"px-4 py-3 space-y-3",children:[s.jsx(ki,{checked:x.qualityGate.enabled,onChange:N=>p(S=>{S.qualityGate.enabled=N}),label:"Enable Quality Gate",description:"Block CI pipeline when thresholds are not met"}),x.qualityGate.enabled&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{children:[s.jsx(cs,{children:"Min Pass Rate (%)"}),s.jsx("input",{type:"number",min:0,max:100,value:x.qualityGate.minPassRate,onChange:N=>p(S=>{S.qualityGate.minPassRate=Number(N.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"})]}),s.jsxs("div",{children:[s.jsx(cs,{children:"Max Duration (seconds, 0 = unlimited)"}),s.jsx("input",{type:"number",min:0,value:x.qualityGate.maxDuration,onChange:N=>p(S=>{S.qualityGate.maxDuration=Number(N.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"})]})]}),s.jsxs("div",{children:[s.jsx(cs,{children:"Required Tags (comma-separated)"}),s.jsx("input",{type:"text",value:x.qualityGate.requireTags.join(", "),onChange:N=>p(S=>{S.qualityGate.requireTags=N.target.value.split(",").map(P=>P.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"})]})]}),f.length>0&&s.jsxs("div",{className:"pt-2 border-t border-border",children:[s.jsx(cs,{children:"Recent Quality Gate Results"}),s.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1",children:f.map(N=>s.jsxs("span",{title:`${N.runId} — ${N.passed?"Passed":"Failed"} — ${new Date(N.timestamp).toLocaleString()}`,className:`inline-flex items-center gap-1 text-[10px] px-2 py-0.5 rounded-full ${N.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:[N.passed?s.jsx(we,{size:10}):s.jsx(st,{size:10}),new Date(N.timestamp).toLocaleDateString()]},N.runId))})]})]})]}),s.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[s.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center gap-2",children:[s.jsx(Op,{size:15,className:"text-accent"}),s.jsx("span",{className:"text-xs font-bold text-content",children:"PR Comments"})]}),s.jsxs("div",{className:"px-4 py-3 space-y-3",children:[s.jsx(ki,{checked:x.prComments.enabled,onChange:N=>p(S=>{S.prComments.enabled=N}),label:"Enable PR Comments",description:"Post test result summaries on pull requests"}),x.prComments.enabled&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx(cs,{children:"Provider"}),s.jsxs("select",{value:x.prComments.provider,onChange:N=>p(S=>{S.prComments.provider=N.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:[s.jsx("option",{value:"github",children:"GitHub"}),s.jsx("option",{value:"gitlab",children:"GitLab"}),s.jsx("option",{value:"azure-devops",children:"Azure DevOps"})]})]}),s.jsx(ki,{checked:x.prComments.includeHealingSummary,onChange:N=>p(S=>{S.prComments.includeHealingSummary=N}),label:"Include Healing Summary"}),s.jsx(ki,{checked:x.prComments.includeVisualDiffs,onChange:N=>p(S=>{S.prComments.includeVisualDiffs=N}),label:"Include Visual Diffs"}),s.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:s.jsxs("p",{className:"text-[10px] text-blue-700 dark:text-blue-300",children:["Requires ",s.jsx("code",{className:"font-mono bg-blue-100 dark:bg-blue-800/40 px-1 rounded",children:"GITHUB_TOKEN"})," /"," ",s.jsx("code",{className:"font-mono bg-blue-100 dark:bg-blue-800/40 px-1 rounded",children:"GITLAB_TOKEN"})," set in your CI environment."]})})]})]})]}),s.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[s.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center gap-2",children:[s.jsx(nc,{size:15,className:"text-accent"}),s.jsx("span",{className:"text-xs font-bold text-content",children:"Notifications"})]}),s.jsx("div",{className:"flex border-b border-border",children:v.map(N=>{const S=N.icon,P=t===N.key;return s.jsxs("button",{type:"button",onClick:()=>n(N.key),className:`flex items-center gap-1.5 px-4 py-2.5 text-xs font-medium transition-colors border-b-2 ${P?"border-accent text-accent":"border-transparent text-content-tertiary hover:text-content-secondary"}`,children:[s.jsx(S,{size:13}),N.label]},N.key)})}),s.jsxs("div",{className:"px-4 py-3 space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(ki,{checked:u.enabled,onChange:N=>h(S=>{S.enabled=N}),label:`Enable ${(k=v.find(N=>N.key===t))==null?void 0:k.label}`}),g?s.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:[s.jsx(we,{size:10})," Connected"]}):s.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"})]}),u.enabled&&s.jsxs(s.Fragment,{children:[t==="slack"&&s.jsxs("div",{children:[s.jsx(cs,{children:"Webhook URL"}),s.jsx("input",{type:"text",value:x.notifications.slack.webhookUrl??"",onChange:N=>p(S=>{S.notifications.slack.webhookUrl=N.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"})]}),t==="email"&&s.jsxs("div",{children:[s.jsx(cs,{children:"Recipients (comma-separated)"}),s.jsx("input",{type:"text",value:(x.notifications.email.recipients??[]).join(", "),onChange:N=>p(S=>{S.notifications.email.recipients=N.target.value.split(",").map(P=>P.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"})]}),t==="teams"&&s.jsxs("div",{children:[s.jsx(cs,{children:"Webhook URL"}),s.jsx("input",{type:"text",value:x.notifications.teams.webhookUrl??"",onChange:N=>p(S=>{S.notifications.teams.webhookUrl=N.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"})]}),t==="custom"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx(cs,{children:"Webhook URL"}),s.jsx("input",{type:"text",value:x.notifications.customWebhook.url??"",onChange:N=>p(S=>{S.notifications.customWebhook.url=N.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"})]}),s.jsxs("div",{children:[s.jsx(cs,{children:"Custom Headers (JSON)"}),s.jsx("textarea",{value:JSON.stringify(x.notifications.customWebhook.headers??{},null,2),onChange:N=>{try{const S=JSON.parse(N.target.value);p(P=>{P.notifications.customWebhook.headers=S})}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"})]})]}),s.jsxs("div",{children:[s.jsx(cs,{children:"Notify On"}),s.jsx(iC,{value:u.on,onChange:N=>h(S=>{S.on=N})})]}),t!=="email"&&s.jsxs("button",{type:"button",onClick:()=>o.mutate(t==="custom"?"custom":t),disabled:o.isPending||!g,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:[o.isPending?s.jsx(ae,{size:12,className:"animate-spin"}):s.jsx(hw,{size:12}),"Send Test Notification"]})]})]})]})]})})})}function oC(e){const t=new Date(e),n=Math.floor((Date.now()-t.getTime())/1e3);if(n<60)return`${n}s ago`;const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const a=Math.floor(r/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}const cC={M:{icon:yy,color:"text-blue-500",bg:"bg-blue-50",ring:"ring-blue-200",label:"Modified"},A:{icon:by,color:"text-emerald-500",bg:"bg-emerald-50",ring:"ring-emerald-200",label:"Added"},D:{icon:gy,color:"text-red-500",bg:"bg-red-50",ring:"ring-red-200",label:"Deleted"},"?":{icon:vy,color:"text-content-tertiary",bg:"bg-surface-inset",ring:"ring-border",label:"Untracked"}};function dC(){const{operationInProgress:e,logSteps:t,hasConflict:n,conflictFiles:r}=Hc(),{data:a,isLoading:i}=_m(),{data:l}=zy(),{data:o,refetch:c}=Ay(20),d=Oy(),x=Dy(),p=Iy(),y=Fy(),b=Ly(),f=_y(),[v,w]=m.useState(""),[h,u]=m.useState(!0),[g,j]=m.useState(!1),[k,N]=m.useState(!0),[S,P]=m.useState(!1),[$,M]=m.useState(!1),{data:V,isFetching:G,refetch:re}=me({queryKey:["git-impact"],queryFn:()=>Ve.impact(),enabled:$,staleTime:0}),O=m.useRef(null),Y=!!e,ne=((a==null?void 0:a.modified.length)??0)+((a==null?void 0:a.added.length)??0)+((a==null?void 0:a.deleted.length)??0)+((a==null?void 0:a.untracked.length)??0);m.useEffect(()=>{var T;(T=O.current)==null||T.scrollIntoView({behavior:"smooth"})},[t.length]);const le=()=>{v.trim()?b.mutate(v):f.mutate(void 0,{onSuccess:T=>{w(T.message),b.mutate(T.message)}})};return s.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:s.jsx("div",{className:"flex-1 overflow-y-auto",children:s.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[s.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[s.jsxs("div",{className:"px-4 py-3 flex items-center gap-3 flex-wrap",children:[s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.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:s.jsx(Kn,{size:17,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-sm font-bold text-content",children:"Git Control Center"}),s.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Commit, push, pull and resolve conflicts"})]})]}),s.jsx("div",{className:"flex-1"}),s.jsxs("div",{className:"relative flex-shrink-0",children:[s.jsxs("button",{onClick:()=>j(!g),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:[s.jsx(Kn,{size:12,className:"text-accent flex-shrink-0"}),s.jsx("span",{className:"max-w-[160px] truncate",children:(a==null?void 0:a.branch)??"..."}),s.jsx(ht,{size:11,className:E("transition-transform text-content-tertiary",g&&"rotate-180")})]}),g&&l&&s.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:[s.jsx("div",{className:"px-3 py-1.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Local"}),l.all.map(T=>s.jsx("button",{onClick:()=>{j(!1),T!==(a==null?void 0:a.branch)&&d.mutate(T)},className:E("w-full text-left px-3 py-1.5 text-xs hover:bg-surface-inset transition-colors",T===(a==null?void 0:a.branch)&&"font-semibold text-accent bg-accent/5"),children:T},T)),l.remote.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-3 py-1.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest border-t border-border",children:"Remote"}),l.remote.map(T=>s.jsx("button",{onClick:()=>{j(!1),d.mutate(T.replace(/^origin\//,""))},className:"w-full text-left px-3 py-1.5 text-xs text-content-secondary hover:bg-surface-inset",children:T},T))]})]})]}),s.jsxs("span",{className:E("inline-flex items-center gap-1.5 text-[10px] px-2.5 py-1 rounded-lg font-semibold ring-1",a!=null&&a.conflicted.length?"bg-red-50 text-red-600 ring-red-200":a!=null&&a.isClean?"bg-emerald-50 text-emerald-600 ring-emerald-200":"bg-amber-50 text-amber-600 ring-amber-200"),children:[s.jsx("span",{className:E("w-1.5 h-1.5 rounded-full",a!=null&&a.conflicted.length?"bg-red-500":a!=null&&a.isClean?"bg-emerald-500":"bg-amber-500")}),i?"Loading…":a!=null&&a.conflicted.length?"Conflict":a!=null&&a.isClean?"Clean":`${ne} pending`]}),a&&(a.ahead>0||a.behind>0)&&s.jsxs("span",{className:"text-[10px] text-content-tertiary font-mono tabular-nums",children:[a.ahead>0&&s.jsxs("span",{className:"text-emerald-600",children:["↑",a.ahead]}),a.ahead>0&&a.behind>0&&" ",a.behind>0&&s.jsxs("span",{className:"text-amber-600",children:["↓",a.behind]})]})]}),s.jsxs("div",{className:"px-4 py-2.5 bg-surface-inset/40 border-t border-border flex items-center gap-2",children:[s.jsxs("div",{className:"relative flex-1 min-w-0",children:[s.jsx(Tr,{size:11,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-content-tertiary pointer-events-none"}),s.jsx("input",{type:"text",value:v,onChange:T=>w(T.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:T=>{T.key==="Enter"&&v.trim()&&x.mutate(v)}})]}),s.jsx("button",{onClick:()=>f.mutate(void 0,{onSuccess:T=>w(T.message)}),disabled:f.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:f.isPending?s.jsx(ae,{size:12,className:"animate-spin"}):s.jsx(wt,{size:12})}),s.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] text-content-tertiary cursor-pointer select-none flex-shrink-0",children:[s.jsx("input",{type:"checkbox",checked:h,onChange:T=>u(T.target.checked),className:"rounded border-border text-accent focus:ring-accent w-3 h-3"}),"Rebase"]}),s.jsx("div",{className:"w-px h-5 bg-border"}),s.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[s.jsx(io,{icon:s.jsx(Tr,{size:11}),label:"Commit",onClick:()=>v.trim()&&x.mutate(v),disabled:Y||!v.trim(),loading:e==="commit"}),s.jsx(io,{icon:s.jsx(xy,{size:11}),label:"Push",onClick:()=>y.mutate(),disabled:Y,loading:e==="push"}),s.jsx(io,{icon:s.jsx(uy,{size:11}),label:"Pull",onClick:()=>p.mutate(h),disabled:Y,loading:e==="pull"}),s.jsx(io,{icon:s.jsx(Lc,{size:11}),label:"Full Sync",onClick:le,disabled:Y,loading:e==="full-sync",primary:!0})]})]})]}),n&&s.jsx(uC,{conflictFiles:r}),!n&&s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-5 gap-3",children:[s.jsxs("div",{className:"lg:col-span-2 rounded-xl border border-border bg-surface overflow-hidden flex flex-col",children:[s.jsxs("div",{className:"px-3.5 py-2 border-b border-border flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h2",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Changes"}),ne>0&&s.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&&s.jsx("div",{className:"flex items-center gap-2",children:[{type:"M",count:(a==null?void 0:a.modified.length)??0,color:"text-blue-500"},{type:"A",count:(a==null?void 0:a.added.length)??0,color:"text-emerald-500"},{type:"D",count:(a==null?void 0:a.deleted.length)??0,color:"text-red-500"},{type:"?",count:(a==null?void 0:a.untracked.length)??0,color:"text-content-tertiary"}].filter(T=>T.count>0).map(T=>s.jsxs("span",{className:E("text-[9px] font-mono font-bold",T.color),children:[T.type,T.count]},T.type))})]}),s.jsx("div",{className:"flex-1 overflow-y-auto max-h-[400px]",children:ne===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-10 gap-1.5",children:[s.jsx(ze,{size:18,className:"text-emerald-400"}),s.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Working tree clean"})]}):s.jsxs("div",{className:"px-1.5 py-1",children:[a==null?void 0:a.modified.map(T=>s.jsx(ao,{file:T,type:"M"},`M-${T}`)),a==null?void 0:a.added.map(T=>s.jsx(ao,{file:T,type:"A"},`A-${T}`)),a==null?void 0:a.deleted.map(T=>s.jsx(ao,{file:T,type:"D"},`D-${T}`)),a==null?void 0:a.untracked.map(T=>s.jsx(ao,{file:T,type:"?"},`?-${T}`))]})})]}),s.jsxs("div",{className:"lg:col-span-3 rounded-xl border border-border bg-surface overflow-hidden flex flex-col",children:[s.jsxs("div",{className:"px-3.5 py-2 border-b border-border flex items-center justify-between",children:[s.jsx("h2",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Commit History"}),s.jsx("button",{onClick:()=>c(),className:"p-1 rounded-md text-content-tertiary hover:text-accent hover:bg-accent/5 transition-colors",title:"Refresh",children:s.jsx(Im,{size:11})})]}),s.jsx("div",{className:"flex-1 overflow-y-auto max-h-[400px]",children:!o||o.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-10 gap-1.5",children:[s.jsx(Tr,{size:18,className:"text-content-tertiary/40"}),s.jsx("p",{className:"text-[10px] text-content-tertiary",children:"No commits yet"})]}):s.jsxs("div",{className:"relative px-3.5 py-2",children:[s.jsx("div",{className:"absolute left-[22px] top-4 bottom-4 w-px bg-border"}),s.jsx("div",{className:"space-y-0.5",children:o.map((T,_)=>s.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:[s.jsx("div",{className:E("mt-1 w-3 h-3 rounded-full border-2 flex-shrink-0 z-[1]",_===0?"border-accent bg-accent/20":"border-border bg-surface")}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-content font-medium leading-snug truncate",title:T.message,children:T.message}),s.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-content-tertiary mt-0.5",children:[s.jsx("code",{className:"font-mono text-accent/70 text-[9px]",children:T.shortHash}),s.jsxs("span",{className:"flex items-center gap-0.5",children:[s.jsx(Lm,{size:8})," ",T.author]}),s.jsxs("span",{className:"flex items-center gap-0.5",children:[s.jsx(Kr,{size:8})," ",oC(T.date)]})]})]})]},T.hash))})]})})]})]}),s.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[s.jsxs("button",{onClick:()=>P(!S),className:"w-full px-3.5 py-2 flex items-center justify-between hover:bg-surface-inset/30 transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(qe,{size:12,className:"text-amber-500"}),s.jsx("h2",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Test Impact Analysis"}),V&&V.impactedCases.length>0&&s.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:[V.impactedCases.length," impacted"]})]}),s.jsx(ht,{size:11,className:E("text-content-tertiary transition-transform",S&&"rotate-180")})]}),S&&s.jsxs("div",{className:"border-t border-border px-3.5 py-3",children:[s.jsx("p",{className:"text-[10px] text-content-tertiary mb-3",children:"Finds test cases that may be affected by uncommitted file changes."}),s.jsxs("button",{onClick:()=>{M(!0),setTimeout(()=>re(),0)},disabled:G,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:[G?s.jsx(ae,{size:12,className:"animate-spin"}):s.jsx(qe,{size:12}),"Analyze Impact"]}),V&&s.jsxs(s.Fragment,{children:[V.changedFiles.length>0&&s.jsxs("div",{className:"mb-3",children:[s.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:["Changed Files (",V.changedFiles.length,")"]}),s.jsx("div",{className:"flex flex-wrap gap-1",children:V.changedFiles.map(T=>s.jsx("span",{className:"text-[9px] font-mono bg-surface-inset px-2 py-0.5 rounded border border-border text-content-secondary",children:T},T))})]}),V.impactedCases.length===0?s.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-emerald-600 bg-emerald-50 rounded-lg px-3 py-2",children:[s.jsx(ze,{size:12})," No test cases appear to be impacted by current changes."]}):s.jsxs("div",{children:[s.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:["Impacted Cases (",V.impactedCases.length,")"]}),s.jsx("div",{className:"space-y-1",children:V.impactedCases.map(T=>s.jsxs("div",{className:"flex items-start gap-2 text-[10px] bg-amber-50 rounded-lg px-3 py-2 border border-amber-200",children:[s.jsx(ts,{size:11,className:"text-amber-500 mt-px flex-shrink-0"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"font-semibold text-content",children:T.caseName}),s.jsxs("p",{className:"text-content-tertiary",children:[T.suiteName," · ",T.reason]})]})]},T.caseId))})]})]})]})]}),t.length>0&&s.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[s.jsxs("button",{onClick:()=>N(!k),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:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx($c,{size:12,className:"text-content-tertiary"}),s.jsx("h2",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Execution Log"}),s.jsxs("span",{className:"text-[9px] font-medium text-content-tertiary bg-surface-inset px-1.5 py-px rounded ring-1 ring-border",children:[t.length," step",t.length!==1?"s":""]}),e&&s.jsxs("span",{className:"flex items-center gap-1 text-[9px] text-blue-500 font-medium",children:[s.jsx(ae,{size:9,className:"animate-spin"})," ",e]})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("button",{onClick:T=>{T.stopPropagation(),Re.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"}),s.jsx(ht,{size:11,className:E("text-content-tertiary transition-transform",k&&"rotate-180")})]})]}),k&&s.jsx("div",{className:"px-3.5 py-2 max-h-[200px] overflow-y-auto bg-surface-inset/20",children:s.jsxs("div",{className:"space-y-1",children:[t.map((T,_)=>s.jsxs("div",{className:"flex items-start gap-2 text-[10px] py-0.5",children:[T.status==="running"&&s.jsx(ae,{size:11,className:"mt-px text-blue-500 animate-spin flex-shrink-0"}),T.status==="done"&&s.jsx(ze,{size:11,className:"mt-px text-emerald-500 flex-shrink-0"}),T.status==="error"&&s.jsx(st,{size:11,className:"mt-px text-red-500 flex-shrink-0"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("span",{className:E("font-medium",T.status==="error"?"text-red-600":"text-content-secondary"),children:T.step}),T.message&&s.jsxs("span",{className:E("ml-1.5 font-normal",T.status==="error"?"text-red-400":"text-content-tertiary"),children:["— ",T.message]})]})]},_)),s.jsx("div",{ref:O})]})})]})]})})})}function uC({conflictFiles:e}){const t=$y(),n=Uy(),r=By(),a=qy(),[i,l]=m.useState({}),o=h=>i[h]??{mode:"none",ours:"",theirs:"",merged:"",resolved:!1,loading:!1},c=(h,u)=>l(g=>({...g,[h]:{...o(h),...u}})),d=async h=>{c(h,{loading:!0});try{const u=await Ve.conflictContent(h);c(h,{ours:u.ours,theirs:u.theirs,merged:u.ours,loading:!1})}catch{c(h,{ours:"(error)",theirs:"(error)",loading:!1})}},x=async h=>{let g=o(h).ours;g||(g=(await Ve.conflictContent(h)).ours),c(h,{loading:!0}),t.mutate({filePath:h,content:g},{onSuccess:()=>c(h,{resolved:!0,loading:!1})})},p=async h=>{let g=o(h).theirs;g||(g=(await Ve.conflictContent(h)).theirs),c(h,{loading:!0}),t.mutate({filePath:h,content:g},{onSuccess:()=>c(h,{resolved:!0,loading:!1})})},y=async h=>{let u=o(h);u.ours||(await d(h),u=o(h)),c(h,{mode:"ai",loading:!0}),n.mutate({filePath:h,ours:u.ours,theirs:u.theirs},{onSuccess:g=>c(h,{merged:g.resolved,loading:!1}),onError:()=>c(h,{loading:!1})})},b=async h=>{o(h).ours||await d(h),c(h,{mode:"manual"})},f=h=>{const u=o(h);c(h,{loading:!0}),t.mutate({filePath:h,content:u.merged},{onSuccess:()=>c(h,{resolved:!0,loading:!1,mode:"none"})})},v=e.every(h=>o(h).resolved),w=e.filter(h=>o(h).resolved).length;return s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"rounded-xl border border-red-200 bg-red-50/80 overflow-hidden",children:[s.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-red-100 flex items-center justify-center flex-shrink-0",children:s.jsx(ts,{size:15,className:"text-red-500"})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-xs font-bold text-red-800",children:"Merge Conflict Detected"}),s.jsxs("p",{className:"text-[10px] text-red-600",children:[w,"/",e.length," file",e.length>1?"s":""," resolved"]})]})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsxs("button",{onClick:()=>a.mutate(),disabled:a.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:[s.jsx(Tl,{size:10}),a.isPending?"Aborting…":"Abort"]}),s.jsxs("button",{onClick:()=>r.mutate(),disabled:!v||r.isPending,className:E("flex items-center gap-1 px-3 py-1.5 text-[10px] font-semibold rounded-lg transition-colors",v?"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:[s.jsx(ze,{size:10}),r.isPending?"Continuing…":"Continue Rebase"]})]})]}),s.jsx("div",{className:"h-0.5 bg-red-100",children:s.jsx("div",{className:"h-full bg-emerald-500 transition-all",style:{width:`${e.length>0?w/e.length*100:0}%`}})})]}),e.map(h=>{const u=o(h);return s.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[s.jsxs("div",{className:"px-3.5 py-2.5 border-b border-border flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(jy,{size:13,className:u.resolved?"text-emerald-500":"text-amber-500"}),s.jsx("code",{className:"text-xs font-mono text-content-secondary",children:h}),u.resolved&&s.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:[s.jsx(ze,{size:9})," Resolved"]})]}),!u.resolved&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(lo,{label:"Keep Local",onClick:()=>x(h),loading:u.loading&&u.mode==="none"}),s.jsx(lo,{label:"Accept Incoming",onClick:()=>p(h),loading:u.loading&&u.mode==="none"}),s.jsx(lo,{label:"Manual",onClick:()=>b(h)}),s.jsx(lo,{label:"AI Resolve",onClick:()=>y(h),loading:u.loading&&u.mode==="ai",icon:s.jsx(wt,{size:9}),accent:!0})]})]}),u.mode!=="none"&&!u.resolved&&s.jsx("div",{className:"p-3.5",children:u.loading&&!u.ours?s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(ae,{size:16,className:"animate-spin text-content-tertiary"})}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-[9px] font-bold text-blue-600 uppercase tracking-widest mb-1 block",children:"Local (Ours)"}),s.jsx("textarea",{value:u.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"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-[9px] font-bold text-orange-600 uppercase tracking-widest mb-1 block",children:"Incoming (Theirs)"}),s.jsx("textarea",{value:u.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"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-[9px] font-bold text-emerald-600 uppercase tracking-widest mb-1 block",children:"Merged Output (editable)"}),s.jsx("textarea",{value:u.merged,onChange:g=>c(h,{merged:g.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"})]}),s.jsx("div",{className:"flex justify-end mt-2.5",children:s.jsxs("button",{onClick:()=>f(h),disabled:u.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:[u.loading?s.jsx(ae,{size:10,className:"animate-spin"}):s.jsx(ze,{size:10}),"Mark as Resolved"]})})]})})]},h)})]})}function ao({file:e,type:t}){const n=cC[t],r=n.icon;return s.jsxs("div",{className:"flex items-center gap-2 py-1 px-2 rounded-lg hover:bg-surface-inset/60 group transition-colors",children:[s.jsx("div",{className:E("w-5 h-5 rounded flex items-center justify-center flex-shrink-0",n.bg),children:s.jsx(r,{size:10,className:n.color})}),s.jsx("span",{className:E("text-[10px] font-mono truncate flex-1",n.color),title:e,children:e}),s.jsx("span",{className:E("text-[8px] px-1.5 py-px rounded font-medium ring-1",n.bg,n.color,n.ring),children:n.label})]})}function io({icon:e,label:t,onClick:n,disabled:r,loading:a,primary:i}){return s.jsxs("button",{onClick:n,disabled:r,className:E("flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[10px] font-semibold transition-all",i?"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",r&&"opacity-50 cursor-not-allowed",a&&"cursor-wait"),children:[a?s.jsx(ae,{size:11,className:"animate-spin"}):e,t]})}function lo({label:e,onClick:t,loading:n,icon:r,accent:a}){return s.jsxs("button",{onClick:t,disabled:n,className:E("flex items-center gap-0.5 px-2 py-1 text-[9px] font-medium rounded-lg transition-colors",a?"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",n&&"opacity-60 cursor-wait"),children:[n?s.jsx(ae,{size:9,className:"animate-spin"}):r,e]})}function xC(e){const t=new Date(e),n=Math.floor((Date.now()-t.getTime())/1e3);if(n<60)return`${n}s ago`;const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const a=Math.floor(r/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}const mC={M:{icon:yy,color:"text-blue-500",bg:"bg-blue-50",label:"M"},A:{icon:by,color:"text-emerald-500",bg:"bg-emerald-50",label:"A"},D:{icon:gy,color:"text-red-500",bg:"bg-red-50",label:"D"},"?":{icon:vy,color:"text-content-tertiary",bg:"bg-surface-inset",label:"?"}};function hC(){var V,G,re;const{panelOpen:e,operationInProgress:t,logSteps:n,hasConflict:r}=Hc(),{data:a,isLoading:i}=_m(),{data:l}=zy(),{data:o,refetch:c}=Ay(15),d=Oy(),x=Dy(),p=Iy(),y=Fy(),b=Ly(),f=_y(),[v,w]=m.useState(""),[h,u]=m.useState(!0),[g,j]=m.useState(!1),[k,N]=m.useState(!0),S=m.useRef(null),P=!!t,$=((a==null?void 0:a.modified.length)??0)+((a==null?void 0:a.added.length)??0)+((a==null?void 0:a.deleted.length)??0)+((a==null?void 0:a.untracked.length)??0);m.useEffect(()=>{var O;(O=S.current)==null||O.scrollIntoView({behavior:"smooth"})},[n.length]);const M=()=>{v.trim()?b.mutate(v):f.mutate(void 0,{onSuccess:O=>{w(O.message),b.mutate(O.message)}})};return s.jsxs(s.Fragment,{children:[e&&s.jsx("div",{className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-[1px] transition-opacity",onClick:()=>Re.closePanel()}),s.jsxs("div",{className:E("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",e?"translate-x-0":"translate-x-full"),children:[s.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2.5 border-b border-border bg-surface flex-shrink-0",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.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:s.jsx(Kn,{size:13,className:"text-white"})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-xs font-bold text-content",children:"Git Control"}),s.jsx("p",{className:"text-[9px] text-content-tertiary",children:"Quick operations"})]})]}),s.jsx("button",{onClick:()=>Re.closePanel(),className:"p-1 rounded-lg hover:bg-surface-inset text-content-tertiary hover:text-content-secondary transition-colors",children:s.jsx(ye,{size:14})})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto",children:[r&&s.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:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-500 flex-shrink-0"}),s.jsx("span",{className:"text-[10px] text-red-700 font-medium",children:"Merge conflict — open full Git page to resolve"})]}),s.jsx("div",{className:"px-3.5 py-2.5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"relative flex-1 min-w-0",children:[s.jsxs("button",{onClick:()=>j(!g),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:[s.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[s.jsx(Kn,{size:11,className:"text-accent flex-shrink-0"}),(a==null?void 0:a.branch)??"..."]}),s.jsx(ht,{size:10,className:E("transition-transform text-content-tertiary",g&&"rotate-180")})]}),g&&l&&s.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:[s.jsx("div",{className:"px-2.5 py-1 text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Local"}),l.all.map(O=>s.jsx("button",{onClick:()=>{j(!1),O!==(a==null?void 0:a.branch)&&d.mutate(O)},className:E("w-full text-left px-2.5 py-1.5 text-[10px] hover:bg-surface-inset transition-colors",O===(a==null?void 0:a.branch)&&"font-semibold text-accent bg-accent/5"),children:O},O)),l.remote.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-2.5 py-1 text-[9px] font-bold text-content-tertiary uppercase tracking-widest border-t border-border",children:"Remote"}),l.remote.map(O=>s.jsx("button",{onClick:()=>{j(!1),d.mutate(O.replace(/^origin\//,""))},className:"w-full text-left px-2.5 py-1.5 text-[10px] text-content-secondary hover:bg-surface-inset",children:O},O))]})]})]}),s.jsxs("span",{className:E("inline-flex items-center gap-1.5 text-[9px] px-2 py-1 rounded-lg font-semibold ring-1 flex-shrink-0",(V=a==null?void 0:a.conflicted)!=null&&V.length?"bg-red-50 text-red-600 ring-red-200":a!=null&&a.isClean?"bg-emerald-50 text-emerald-600 ring-emerald-200":"bg-amber-50 text-amber-600 ring-amber-200"),children:[s.jsx("span",{className:E("w-1.5 h-1.5 rounded-full",(G=a==null?void 0:a.conflicted)!=null&&G.length?"bg-red-500":a!=null&&a.isClean?"bg-emerald-500":"bg-amber-500")}),i?"…":(re=a==null?void 0:a.conflicted)!=null&&re.length?"Conflict":a!=null&&a.isClean?"Clean":`${$} pending`]}),a&&(a.ahead>0||a.behind>0)&&s.jsxs("span",{className:"text-[9px] text-content-tertiary font-mono tabular-nums flex-shrink-0",children:[a.ahead>0&&s.jsxs("span",{className:"text-emerald-600",children:["↑",a.ahead]}),a.behind>0&&s.jsxs("span",{className:"text-amber-600 ml-0.5",children:["↓",a.behind]})]})]})}),s.jsxs("div",{className:"px-3.5 py-2.5 border-b border-border",children:[s.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Changes"}),$>0&&s.jsx("span",{className:"text-[9px] font-bold text-accent bg-accent/8 px-1.5 py-px rounded ring-1 ring-accent/15",children:$})]}),$>0&&s.jsx("div",{className:"flex items-center gap-1.5",children:[{type:"M",count:(a==null?void 0:a.modified.length)??0,color:"text-blue-500"},{type:"A",count:(a==null?void 0:a.added.length)??0,color:"text-emerald-500"},{type:"D",count:(a==null?void 0:a.deleted.length)??0,color:"text-red-500"},{type:"?",count:(a==null?void 0:a.untracked.length)??0,color:"text-content-tertiary"}].filter(O=>O.count>0).map(O=>s.jsxs("span",{className:E("text-[8px] font-mono font-bold",O.color),children:[O.type,O.count]},O.type))})]}),$===0?s.jsxs("div",{className:"flex items-center gap-1.5 py-2",children:[s.jsx(ze,{size:12,className:"text-emerald-400"}),s.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Working tree clean"})]}):s.jsxs("div",{className:"space-y-px max-h-[150px] overflow-y-auto",children:[a==null?void 0:a.modified.map(O=>s.jsx(oo,{file:O,type:"M"},`M-${O}`)),a==null?void 0:a.added.map(O=>s.jsx(oo,{file:O,type:"A"},`A-${O}`)),a==null?void 0:a.deleted.map(O=>s.jsx(oo,{file:O,type:"D"},`D-${O}`)),a==null?void 0:a.untracked.map(O=>s.jsx(oo,{file:O,type:"?"},`?-${O}`))]})]}),s.jsxs("div",{className:"px-3.5 py-2.5 border-b border-border space-y-2.5",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsxs("div",{className:"relative flex-1 min-w-0",children:[s.jsx(Tr,{size:10,className:"absolute left-2 top-1/2 -translate-y-1/2 text-content-tertiary pointer-events-none"}),s.jsx("input",{type:"text",value:v,onChange:O=>w(O.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:O=>{O.key==="Enter"&&v.trim()&&x.mutate(v)}})]}),s.jsx("button",{onClick:()=>f.mutate(void 0,{onSuccess:O=>w(O.message)}),disabled:f.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:f.isPending?s.jsx(ae,{size:10,className:"animate-spin"}):s.jsx(wt,{size:10})})]}),s.jsxs("label",{className:"flex items-center gap-1.5 text-[9px] text-content-tertiary cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",checked:h,onChange:O=>u(O.target.checked),className:"rounded border-border text-accent focus:ring-accent w-3 h-3"}),"Pull latest (rebase) before commit"]}),s.jsxs("div",{className:"grid grid-cols-4 gap-1",children:[s.jsx(co,{icon:s.jsx(Tr,{size:10}),label:"Commit",onClick:()=>v.trim()&&x.mutate(v),disabled:P||!v.trim(),loading:t==="commit"}),s.jsx(co,{icon:s.jsx(xy,{size:10}),label:"Push",onClick:()=>y.mutate(),disabled:P,loading:t==="push"}),s.jsx(co,{icon:s.jsx(uy,{size:10}),label:"Pull",onClick:()=>p.mutate(h),disabled:P,loading:t==="pull"}),s.jsx(co,{icon:s.jsx(Lc,{size:10}),label:"Sync",onClick:M,disabled:P,loading:t==="full-sync",primary:!0})]}),s.jsx("p",{className:"text-[8px] text-content-tertiary text-center",children:"Sync: pull --rebase → stage → commit → push"})]}),n.length>0&&s.jsxs("div",{className:"border-b border-border",children:[s.jsxs("button",{onClick:()=>N(!k),className:"w-full px-3.5 py-2 flex items-center justify-between hover:bg-surface-inset/30 transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx($c,{size:10,className:"text-content-tertiary"}),s.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Log"}),s.jsx("span",{className:"text-[8px] font-medium text-content-tertiary bg-surface-inset px-1.5 py-px rounded ring-1 ring-border",children:n.length}),t&&s.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] text-blue-500 font-medium",children:[s.jsx(ae,{size:8,className:"animate-spin"})," ",t]})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("button",{onClick:O=>{O.stopPropagation(),Re.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"}),s.jsx(ht,{size:10,className:E("text-content-tertiary transition-transform",k&&"rotate-180")})]})]}),k&&s.jsx("div",{className:"px-3.5 pb-2.5 max-h-[150px] overflow-y-auto",children:s.jsxs("div",{className:"space-y-0.5",children:[n.map((O,Y)=>s.jsxs("div",{className:"flex items-start gap-1.5 text-[9px] py-0.5",children:[O.status==="running"&&s.jsx(ae,{size:9,className:"mt-px text-blue-500 animate-spin flex-shrink-0"}),O.status==="done"&&s.jsx(ze,{size:9,className:"mt-px text-emerald-500 flex-shrink-0"}),O.status==="error"&&s.jsx(st,{size:9,className:"mt-px text-red-500 flex-shrink-0"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("span",{className:E("font-medium",O.status==="error"?"text-red-600":"text-content-secondary"),children:O.step}),O.message&&s.jsxs("span",{className:E("ml-1 font-normal",O.status==="error"?"text-red-400":"text-content-tertiary"),children:["— ",O.message]})]})]},Y)),s.jsx("div",{ref:S})]})})]}),s.jsxs("div",{className:"px-3.5 py-2.5",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"History"}),s.jsx("button",{onClick:()=>c(),className:"p-1 rounded-md text-content-tertiary hover:text-accent hover:bg-accent/5 transition-colors",title:"Refresh",children:s.jsx(Im,{size:10})})]}),!o||o.length===0?s.jsxs("div",{className:"flex items-center gap-1.5 py-3",children:[s.jsx(Tr,{size:12,className:"text-content-tertiary/40"}),s.jsx("p",{className:"text-[10px] text-content-tertiary",children:"No commits yet"})]}):s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute left-[5px] top-2 bottom-2 w-px bg-border"}),s.jsx("div",{className:"space-y-0.5",children:o.map((O,Y)=>s.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:[s.jsx("div",{className:E("mt-1.5 w-[9px] h-[9px] rounded-full border-[1.5px] flex-shrink-0 z-[1]",Y===0?"border-accent bg-accent/20":"border-border bg-surface")}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-[10px] text-content font-medium leading-snug truncate",title:O.message,children:O.message}),s.jsxs("div",{className:"flex items-center gap-1.5 text-[8px] text-content-tertiary mt-0.5",children:[s.jsx("code",{className:"font-mono text-accent/70",children:O.shortHash}),s.jsxs("span",{className:"flex items-center gap-0.5",children:[s.jsx(Lm,{size:7})," ",O.author]}),s.jsxs("span",{className:"flex items-center gap-0.5",children:[s.jsx(Kr,{size:7})," ",xC(O.date)]})]})]})]},O.hash))})]})]})]})]})]})}function oo({file:e,type:t}){const n=mC[t],r=n.icon;return s.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:[s.jsx("div",{className:E("w-4 h-4 rounded flex items-center justify-center flex-shrink-0",n.bg),children:s.jsx(r,{size:9,className:n.color})}),s.jsx("span",{className:E("text-[9px] font-mono truncate flex-1",n.color),title:e,children:e})]})}function co({icon:e,label:t,onClick:n,disabled:r,loading:a,primary:i}){return s.jsxs("button",{onClick:n,disabled:r,className:E("flex flex-col items-center justify-center gap-0.5 px-2 py-1.5 rounded-lg text-[9px] font-semibold transition-all",i?"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",r&&"opacity-50 cursor-not-allowed",a&&"cursor-wait"),children:[a?s.jsx(ae,{size:10,className:"animate-spin"}):e,t]})}function pC(){const e=Ms(),t=Zn(),n=$m(),r=lb(),{stepLogs:a}=ob(),i=n.isRunning,l=cb(i),[o,c]=m.useState(!1),[d,x]=m.useState(!1),[p,y]=m.useState(!1),b=t.pathname==="/run";m.useEffect(()=>{i&&!p&&(c(!0),x(!1))},[i,p]),m.useEffect(()=>{i&&y(!1)},[n.runId]);const f=()=>{c(!1),y(!0)},v=()=>{c(!1),y(!0),e("/run")};return!o&&!i&&!n.completed||!o||b?null:d?s.jsx(fC,{runActive:i,elapsed:l,completed:n.completed,onExpand:()=>x(!1),onClose:f}):s.jsx(gC,{progress:n,live:r,elapsed:l,runActive:i,stepLogs:a,onMinimise:()=>x(!0),onClose:f,onGoToRunConfig:v})}function fC({runActive:e,elapsed:t,completed:n,onExpand:r,onClose:a}){return s.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:r,children:[e?s.jsxs(s.Fragment,{children:[s.jsx(ae,{size:12,className:"text-emerald-400 animate-spin"}),s.jsx("span",{className:"text-[10px] font-semibold text-white",children:"Running"}),s.jsx("span",{className:"text-[9px] font-mono text-slate-400",children:t})]}):n?s.jsxs(s.Fragment,{children:[n.failed>0?s.jsx(st,{size:12,className:"text-red-400"}):s.jsx(we,{size:12,className:"text-emerald-400"}),s.jsxs("span",{className:"text-[10px] font-semibold text-white",children:[n.passed,"✓ ",n.failed>0&&`${n.failed}✗`]})]}):null,s.jsx("button",{type:"button",onClick:i=>{i.stopPropagation(),a()},className:"p-0.5 rounded-full hover:bg-slate-700 text-slate-500 hover:text-white transition-colors",children:s.jsx(ye,{size:10})})]})}function gC({progress:e,live:t,elapsed:n,runActive:r,stepLogs:a,onMinimise:i,onClose:l,onGoToRunConfig:o}){var h;const c=m.useRef(null),[d,x]=m.useState(null),p=m.useRef(!1),y=m.useRef({x:0,y:0}),b=m.useRef(null);m.useEffect(()=>{var u;(u=b.current)==null||u.scrollIntoView({behavior:"smooth"})},[a.length]);const f=m.useCallback(u=>{u.preventDefault(),p.current=!0;const g=c.current,j=(d==null?void 0:d.x)??(g?g.getBoundingClientRect().left:window.innerWidth-400),k=(d==null?void 0:d.y)??(g?g.getBoundingClientRect().top:window.innerHeight-400);y.current={x:u.clientX-j,y:u.clientY-k};const N=P=>{p.current&&x({x:Math.max(0,Math.min(window.innerWidth-200,P.clientX-y.current.x)),y:Math.max(0,Math.min(window.innerHeight-60,P.clientY-y.current.y))})},S=()=>{p.current=!1,window.removeEventListener("mousemove",N),window.removeEventListener("mouseup",S)};window.addEventListener("mousemove",N),window.addEventListener("mouseup",S)},[d]),v=!!t.screenshot,w=e.completed;return s.jsxs("div",{ref:c,className:"fixed z-[9999] w-[340px] rounded-xl bg-slate-900 border border-slate-700 shadow-2xl overflow-hidden flex flex-col",style:d?{left:d.x,top:d.y,maxHeight:420}:{bottom:16,right:16,maxHeight:420},children:[s.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:f,children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ew,{size:12,className:"text-slate-500"}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-red-500/80"}),s.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-amber-500/80"}),s.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-emerald-500/80"})]}),e.currentBrowser&&s.jsx(Ja,{browser:e.currentBrowser,size:14,className:"ml-1"}),s.jsx("span",{className:"text-[10px] font-semibold text-slate-400 uppercase tracking-wider ml-1",children:e.currentBrowser?Km(e.currentBrowser):r?"Browser Preview":"Run Complete"}),r&&s.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"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("button",{type:"button",onClick:u=>{u.stopPropagation(),o()},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:u=>u.stopPropagation(),children:s.jsx(Dm,{size:14})}),s.jsx("button",{type:"button",onClick:u=>{u.stopPropagation(),i()},title:"Minimise",className:"p-1.5 rounded text-slate-300 hover:text-white hover:bg-slate-600 transition-colors",onMouseDown:u=>u.stopPropagation(),children:s.jsx(Sy,{size:14})}),s.jsx("button",{type:"button",onClick:u=>{u.stopPropagation(),l()},title:"Close",className:"p-1.5 rounded text-slate-300 hover:text-red-400 hover:bg-slate-600 transition-colors",onMouseDown:u=>u.stopPropagation(),children:s.jsx(ye,{size:14})})]})]}),s.jsxs("div",{className:"relative bg-slate-950 flex items-center justify-center overflow-hidden",style:{minHeight:120,maxHeight:180},children:[v&&s.jsx("img",{src:`data:image/jpeg;base64,${t.screenshot}`,alt:"Browser",className:E("w-full h-auto object-contain",w&&!r&&"opacity-30"),style:{maxHeight:180}}),!v&&r&&s.jsxs("div",{className:"flex flex-col items-center gap-2 py-6",children:[s.jsxs("div",{className:"w-12 h-8 rounded-lg bg-slate-800 border border-slate-700 overflow-hidden relative",children:[s.jsxs("div",{className:"h-2 bg-slate-750 border-b border-slate-700 flex items-center px-1 gap-0.5",children:[s.jsx("div",{className:"w-1 h-1 rounded-full bg-red-500/50"}),s.jsx("div",{className:"w-1 h-1 rounded-full bg-amber-500/50"}),s.jsx("div",{className:"w-1 h-1 rounded-full bg-emerald-500/50"})]}),s.jsxs("div",{className:"p-1 space-y-0.5",children:[s.jsx("div",{className:"h-0.5 bg-slate-700 rounded w-3/4 animate-pulse"}),s.jsx("div",{className:"h-0.5 bg-slate-700 rounded w-1/2 animate-pulse"})]})]}),s.jsx("p",{className:"text-[9px] text-slate-500",children:"Waiting for screenshots..."}),s.jsx("div",{className:"flex gap-1",children:[0,120,240].map(u=>s.jsx("div",{className:"w-1 h-1 rounded-full bg-accent animate-bounce",style:{animationDelay:`${u}ms`}},u))})]}),w&&!r&&s.jsx("div",{className:E("w-full",v?"absolute inset-0 flex items-center justify-center bg-black/50 backdrop-blur-sm":"py-4 px-6"),children:s.jsxs("div",{className:E(v?"px-5 py-4":""),children:[s.jsxs("div",{className:"flex items-center gap-2.5 mb-3",children:[w.failed===0?s.jsx(we,{size:18,className:"text-emerald-400"}):s.jsx(st,{size:18,className:"text-red-400"}),s.jsxs("div",{children:[s.jsx("p",{className:E("text-xs font-bold",w.failed===0?"text-emerald-300":"text-red-300"),children:w.failed===0?"All tests passed!":"Completed with failures"}),s.jsxs("p",{className:"text-[9px] text-slate-400",children:[Math.round(w.duration/1e3),"s elapsed"]})]})]}),s.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:[{label:"Passed",v:w.passed,c:"text-emerald-400 bg-emerald-500/10 ring-emerald-500/20"},{label:"Failed",v:w.failed,c:"text-red-400 bg-red-500/10 ring-red-500/20"},{label:"Skipped",v:w.skipped,c:"text-slate-400 bg-slate-500/10 ring-slate-500/20"}].map(({label:u,v:g,c:j})=>s.jsxs("div",{className:E("rounded-lg p-2 text-center ring-1",j),children:[s.jsx("p",{className:"text-sm font-bold tabular-nums",children:g}),s.jsx("p",{className:"text-[7px] uppercase tracking-wider text-slate-500",children:u})]},u))})]})}),r&&e.currentStep&&s.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/90 to-transparent px-3 py-2",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("div",{className:"w-1 h-1 rounded-full bg-emerald-400 animate-pulse flex-shrink-0"}),s.jsx("p",{className:"text-[8px] text-white/70 truncate font-mono",children:e.currentStep.instruction})]})})]}),s.jsxs("div",{className:"flex-shrink-0 border-t border-slate-700",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-1 bg-slate-800/50",children:[s.jsx("div",{className:"flex items-center gap-2",children:r?s.jsxs(s.Fragment,{children:[s.jsx(ae,{size:9,className:"text-emerald-400 animate-spin"}),s.jsx("span",{className:"text-[9px] text-slate-300 font-medium truncate max-w-[180px]",children:((h=e.currentCase)==null?void 0:h.caseName)??"Starting..."})]}):s.jsxs("span",{className:"text-[9px] text-slate-400",children:[a.length," step",a.length!==1&&"s"," executed"]})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-[9px] font-mono text-slate-500",children:n}),s.jsxs("button",{type:"button",onClick:o,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:[s.jsx(ni,{size:8})," Full View"]})]})]}),a.length>0&&s.jsxs("div",{className:"max-h-[72px] overflow-y-auto px-2 py-1 space-y-px",children:[a.slice(-5).map((u,g)=>s.jsxs("div",{className:"flex items-center gap-1.5 py-px text-[8px]",children:[u.status==="passed"?s.jsx(we,{size:8,className:"text-emerald-400 flex-shrink-0"}):u.status==="failed"?s.jsx(st,{size:8,className:"text-red-400 flex-shrink-0"}):s.jsx(Dt,{size:8,className:"text-slate-600 flex-shrink-0"}),s.jsx("span",{className:E("truncate flex-1 font-mono",u.status==="passed"?"text-slate-400":u.status==="failed"?"text-red-300":"text-slate-600"),children:u.instruction}),s.jsxs("span",{className:"text-slate-600 tabular-nums flex-shrink-0",children:[u.duration,"ms"]})]},`${u.stepId}-${g}`)),s.jsx("div",{ref:b})]})]})]})}function yC(){const{hasConflict:e,conflictFiles:t}=Hc(),n=$y(),r=Uy(),a=By(),i=qy(),[l,o]=m.useState({});if(!e||t.length===0)return null;const c=h=>l[h]??{mode:"none",ours:"",theirs:"",merged:"",resolved:!1,loading:!1},d=(h,u)=>o(g=>({...g,[h]:{...c(h),...u}})),x=async h=>{d(h,{loading:!0});try{const u=await Ve.conflictContent(h);d(h,{ours:u.ours,theirs:u.theirs,merged:u.ours,loading:!1})}catch{d(h,{ours:"(error loading)",theirs:"(error loading)",loading:!1})}},p=async h=>{let g=c(h).ours;g||(g=(await Ve.conflictContent(h)).ours),d(h,{loading:!0}),n.mutate({filePath:h,content:g},{onSuccess:()=>d(h,{resolved:!0,loading:!1})})},y=async h=>{let g=c(h).theirs;g||(g=(await Ve.conflictContent(h)).theirs),d(h,{loading:!0}),n.mutate({filePath:h,content:g},{onSuccess:()=>d(h,{resolved:!0,loading:!1})})},b=async h=>{let u=c(h);u.ours||(await x(h),u=c(h)),d(h,{mode:"ai",loading:!0}),r.mutate({filePath:h,ours:u.ours,theirs:u.theirs},{onSuccess:g=>d(h,{merged:g.resolved,loading:!1}),onError:()=>d(h,{loading:!1})})},f=async h=>{c(h).ours||await x(h),d(h,{mode:"manual"})},v=h=>{const u=c(h);d(h,{loading:!0}),n.mutate({filePath:h,content:u.merged},{onSuccess:()=>d(h,{resolved:!0,loading:!1,mode:"none"})})},w=t.every(h=>c(h).resolved);return s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:s.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:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-slate-100 bg-red-50 flex-shrink-0",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ts,{size:20,className:"text-red-500"}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-base font-bold text-red-800",children:"Merge Conflict Detected"}),s.jsxs("p",{className:"text-xs text-red-600",children:[t.length," file",t.length>1?"s":""," with conflicts"]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("button",{onClick:()=>i.mutate(),disabled:i.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:[s.jsx(Tl,{size:11}),i.isPending?"Aborting...":"Abort Rebase"]}),s.jsxs("button",{onClick:()=>a.mutate(),disabled:!w||a.isPending,className:E("flex items-center gap-1.5 px-4 py-1.5 text-xs font-medium rounded-lg transition-colors",w?"bg-green-600 hover:bg-green-700 text-white":"bg-slate-200 text-content-tertiary cursor-not-allowed"),children:[s.jsx(ze,{size:11}),a.isPending?"Continuing...":"Continue Rebase"]}),s.jsx("button",{onClick:()=>Re.clearConflict(),className:"p-1.5 rounded hover:bg-red-100 text-red-400 transition-colors",children:s.jsx(ye,{size:16})})]})]}),s.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4",children:t.map(h=>{const u=c(h);return s.jsxs("div",{className:"border border-slate-200 rounded-xl overflow-hidden",children:[s.jsxs("div",{className:"px-4 py-2.5 bg-surface-inset border-b border-slate-100 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(jy,{size:14,className:u.resolved?"text-green-500":"text-amber-500"}),s.jsx("code",{className:"text-xs font-mono text-content-secondary",children:h}),u.resolved&&s.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:[s.jsx(ze,{size:9})," Resolved"]})]}),!u.resolved&&s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(uo,{label:"Keep Local",onClick:()=>p(h),loading:u.loading&&u.mode==="none"}),s.jsx(uo,{label:"Accept Incoming",onClick:()=>y(h),loading:u.loading&&u.mode==="none"}),s.jsx(uo,{label:"Manual",onClick:()=>f(h)}),s.jsx(uo,{label:"AI Resolve",onClick:()=>b(h),loading:u.loading&&u.mode==="ai",icon:s.jsx(wt,{size:9}),accent:!0})]})]}),u.mode!=="none"&&!u.resolved&&s.jsx("div",{className:"p-4",children:u.loading&&!u.ours?s.jsx("div",{className:"flex items-center justify-center py-6",children:s.jsx(ae,{size:18,className:"animate-spin text-content-tertiary"})}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-[9px] font-bold text-blue-600 uppercase tracking-wider mb-1 block",children:"Local (Ours)"}),s.jsx("textarea",{value:u.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"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-[9px] font-bold text-orange-600 uppercase tracking-wider mb-1 block",children:"Incoming (Theirs)"}),s.jsx("textarea",{value:u.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"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-[9px] font-bold text-green-600 uppercase tracking-wider mb-1 block",children:"Merged Output (editable)"}),s.jsx("textarea",{value:u.merged,onChange:g=>d(h,{merged:g.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"})]}),s.jsx("div",{className:"flex justify-end mt-2",children:s.jsxs("button",{onClick:()=>v(h),disabled:u.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:[u.loading?s.jsx(ae,{size:12,className:"animate-spin"}):s.jsx(ze,{size:12}),"Mark as Resolved"]})})]})})]},h)})})]})})}function uo({label:e,onClick:t,loading:n,icon:r,accent:a}){return s.jsxs("button",{onClick:t,disabled:n,className:E("flex items-center gap-1 px-2 py-1 text-[10px] font-medium rounded-lg transition-colors",a?"bg-purple-100 text-purple-700 hover:bg-purple-200":"bg-slate-100 text-content-secondary hover:bg-slate-200",n&&"opacity-60 cursor-wait"),children:[n?s.jsx(ae,{size:9,className:"animate-spin"}):r,e]})}function bC(e){m.useEffect(()=>{function t(n){const r=n.target;if(!(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement))for(const a of e){const i=n.key===a.key,l=!!a.ctrl,o=!!a.meta,c=!!a.shift,d=l?n.ctrlKey:!n.ctrlKey,x=o?n.metaKey:!n.metaKey,p=c?n.shiftKey:!n.shiftKey,y=(()=>{if(l||o){const b=l?n.ctrlKey:!0,f=o?n.metaKey:!0,v=c?n.shiftKey:!n.shiftKey;return l&&!o&&n.metaKey||o&&!l&&n.ctrlKey?!1:b&&f&&v}return d&&x&&p})();if(i&&y){n.preventDefault(),a.action();return}}}return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e])}const vC=[{keys:["?"],description:"Show keyboard shortcuts"},{keys:["Ctrl","K"],description:"Search (Cmd+K)"},{keys:["Esc"],description:"Close modal / cancel"}];function jC({open:e,onClose:t}){return m.useEffect(()=>{if(!e)return;function n(r){r.key==="Escape"&&t()}return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e,t]),e?s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:t,children:s.jsxs("div",{className:"bg-surface rounded-2xl border border-border shadow-modal w-full max-w-lg mx-4 overflow-hidden",onClick:n=>n.stopPropagation(),children:[s.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[s.jsx("h2",{className:"text-sm font-bold text-content",children:"Keyboard Shortcuts"}),s.jsx("button",{type:"button",onClick:t,className:"p-1.5 rounded-lg text-content-tertiary hover:bg-surface-inset hover:text-content transition-colors","aria-label":"Close",children:s.jsx(ye,{size:14})})]}),s.jsx("div",{className:"px-5 py-4 grid grid-cols-2 gap-x-6 gap-y-3",children:vC.map(n=>s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx("span",{className:"text-xs text-content-secondary",children:n.description}),s.jsx("div",{className:"flex items-center gap-1 flex-shrink-0",children:n.keys.map(r=>s.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:r},r))})]},n.description))}),s.jsx("div",{className:"px-5 py-3 border-t border-border bg-surface-inset/30",children:s.jsxs("p",{className:"text-[10px] text-content-tertiary",children:["Press ",s.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 NC={suite:"Suites",case:"Cases",step:"Steps"},wC={name:"name",description:"description",tag:"tag",instruction:"instruction"};function kC({type:e}){return e==="suite"?s.jsx(Wr,{size:13,className:"text-indigo-500 flex-shrink-0"}):e==="case"?s.jsx(Ps,{size:13,className:"text-blue-500 flex-shrink-0"}):s.jsx(Am,{size:13,className:"text-teal-500 flex-shrink-0"})}function SC({open:e,onClose:t}){const n=Ms(),[r,a]=m.useState(""),[i,l]=m.useState(""),[o,c]=m.useState(-1),d=m.useRef(null);m.useEffect(()=>{const w=setTimeout(()=>l(r),300);return()=>clearTimeout(w)},[r]),m.useEffect(()=>{e&&(a(""),l(""),c(-1),setTimeout(()=>{var w;return(w=d.current)==null?void 0:w.focus()},50))},[e]);const{data:x=[]}=me({queryKey:["search",i],queryFn:()=>Iw.search(i),enabled:i.trim().length>1,staleTime:0}),p={suite:x.filter(w=>w.type==="suite"),case:x.filter(w=>w.type==="case"),step:x.filter(w=>w.type==="step")},y=x,b=w=>{w.type==="suite"?n(`/tests/${w.suiteId}`):w.type==="case"?n(`/tests/${w.suiteId}/cases/${w.caseId}`):n(`/tests/${w.suiteId}/cases/${w.caseId}`),t()},f=w=>{w.key==="ArrowDown"?(w.preventDefault(),c(h=>Math.min(h+1,y.length-1))):w.key==="ArrowUp"?(w.preventDefault(),c(h=>Math.max(h-1,-1))):w.key==="Enter"&&o>=0&&y[o]?(w.preventDefault(),b(y[o])):w.key==="Escape"&&t()};if(!e)return null;let v=-1;return s.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/60 backdrop-blur-sm pt-[15vh]",onClick:t,children:s.jsxs("div",{className:"bg-surface rounded-2xl border border-border shadow-modal w-full max-w-xl mx-4 overflow-hidden",onClick:w=>w.stopPropagation(),children:[s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border",children:[s.jsx(Wn,{size:15,className:"text-content-tertiary flex-shrink-0"}),s.jsx("input",{ref:d,type:"text",placeholder:"Search suites, cases, steps...",value:r,onChange:w=>{a(w.target.value),c(-1)},onKeyDown:f,className:"flex-1 text-sm bg-transparent text-content placeholder-content-tertiary outline-none"}),r&&s.jsx("button",{type:"button",onClick:()=>{a(""),l("")},className:"p-1 rounded text-content-tertiary hover:text-content transition-colors",children:s.jsx(ye,{size:13})}),s.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"})]}),s.jsx("div",{className:"overflow-y-auto max-h-[50vh]",children:i.trim().length<2?s.jsx("div",{className:"px-5 py-8 text-center",children:s.jsx("p",{className:"text-sm text-content-tertiary",children:"Type at least 2 characters to search"})}):x.length===0?s.jsx("div",{className:"px-5 py-8 text-center",children:s.jsxs("p",{className:"text-sm text-content-tertiary",children:['No results for "',i,'"']})}):s.jsx("div",{className:"py-1",children:["suite","case","step"].map(w=>{const h=p[w];return h.length===0?null:s.jsxs("div",{children:[s.jsx("div",{className:"px-4 py-1.5 text-[10px] font-bold text-content-tertiary uppercase tracking-wider bg-surface-inset/50",children:NC[w]}),h.map(u=>{v++;const j=o===v;return s.jsxs("button",{type:"button",onClick:()=>b(u),className:E("w-full flex items-center gap-3 px-4 py-2.5 text-left transition-colors",j?"bg-accent/10":"hover:bg-surface-inset"),children:[s.jsx(kC,{type:u.type}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm font-medium text-content truncate",children:u.type==="step"?u.instruction:u.type==="case"?u.caseName:u.suiteName}),s.jsx("span",{className:E("text-[9px] px-1.5 py-0.5 rounded font-semibold uppercase flex-shrink-0",u.matchedOn==="name"?"bg-accent/10 text-accent":u.matchedOn==="tag"?"bg-purple-50 text-purple-600":"bg-surface-inset text-content-tertiary"),children:wC[u.matchedOn]})]}),s.jsxs("p",{className:"text-[11px] text-content-tertiary truncate mt-0.5",children:[u.type!=="suite"&&`${u.suiteName}`,u.type==="step"&&u.caseName&&` › ${u.caseName}`]})]}),s.jsx(yr,{size:11,className:E("text-content-tertiary transition-opacity flex-shrink-0",j?"opacity-100":"opacity-0")})]},`${u.suiteId}-${u.caseId??""}-${u.stepId??""}`)})]},w)})})}),x.length>0&&s.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:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("kbd",{className:"px-1 py-px rounded border border-border bg-surface font-mono",children:"↑↓"})," navigate"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("kbd",{className:"px-1 py-px rounded border border-border bg-surface font-mono",children:"↵"})," select"]})]})]})})}const hb="assuremind_onboarding_done";function Zd(){localStorage.setItem(hb,"true")}function CC(){const{data:e=[],isLoading:t}=Xy(),[n,r]=m.useState(0),[a,i]=m.useState(""),[l,o]=m.useState(""),c=Ms(),d=!!localStorage.getItem(hb),x=W({mutationFn:b=>Br.update({baseUrl:b}),onError:b=>A.error(b.message)}),p=W({mutationFn:b=>Vr.create({name:b,type:"ui"}),onSuccess:()=>{Zd(),c("/tests")},onError:b=>A.error(b.message)});if(t||e.length>0||d)return null;const y=[0,1,2].map(b=>s.jsx("span",{className:`w-2 h-2 rounded-full transition-colors ${b===n?"bg-accent":"bg-border"}`},b));return s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:s.jsxs("div",{className:"bg-surface rounded-2xl border border-border shadow-modal w-full max-w-md mx-4 overflow-hidden",children:[n===0&&s.jsxs("div",{className:"flex flex-col items-center px-8 py-8 gap-4",children:[s.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:s.jsx(qe,{size:28,className:"text-white"})}),s.jsxs("div",{className:"text-center",children:[s.jsx("h2",{className:"text-lg font-bold text-content",children:"Welcome to AssureMind Studio"}),s.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."})]}),s.jsx("div",{className:"flex items-center gap-2 mt-2",children:y}),s.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[s.jsx(se,{onClick:()=>r(1),className:"w-full",children:"Get Started"}),s.jsx("button",{type:"button",onClick:()=>{Zd()},className:"text-xs text-content-tertiary hover:text-content-secondary transition-colors py-1",children:"Skip for now"})]})]}),n===1&&s.jsxs("div",{className:"flex flex-col items-center px-8 py-8 gap-4",children:[s.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:s.jsx(nn,{size:28,className:"text-white"})}),s.jsxs("div",{className:"text-center",children:[s.jsx("h2",{className:"text-lg font-bold text-content",children:"Set your Base URL"}),s.jsx("p",{className:"text-sm text-content-secondary mt-2 leading-relaxed",children:"This is the URL of the application you want to test."})]}),s.jsx("input",{type:"url",placeholder:"https://your-app.example.com",value:a,onChange:b=>i(b.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"}),s.jsx("div",{className:"flex items-center gap-2",children:y}),s.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[s.jsx(se,{onClick:async()=>{a&&await x.mutateAsync(a),r(2)},loading:x.isPending,className:"w-full",children:"Next"}),s.jsx("button",{type:"button",onClick:()=>{Zd()},className:"text-xs text-content-tertiary hover:text-content-secondary transition-colors py-1",children:"Skip for now"})]})]}),n===2&&s.jsxs("div",{className:"flex flex-col items-center px-8 py-8 gap-4",children:[s.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:s.jsx(Z2,{size:28,className:"text-white"})}),s.jsxs("div",{className:"text-center",children:[s.jsx("h2",{className:"text-lg font-bold text-content",children:"Create your first test suite"}),s.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."})]}),s.jsx("input",{type:"text",placeholder:"e.g. Login flow",value:l,onChange:b=>o(b.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:b=>{b.key==="Enter"&&l.trim()&&p.mutate(l.trim())}}),s.jsx("div",{className:"flex items-center gap-2",children:y}),s.jsx(se,{onClick:()=>{l.trim()&&p.mutate(l.trim())},loading:p.isPending,disabled:!l.trim(),className:"w-full",children:"Create Suite & Continue"})]})]})})}const EC={AI_NOT_CONFIGURED:{icon:s.jsx(wt,{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:s.jsx(ac,{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:s.jsx(ac,{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 PC(){const{activeModal:e}=Aw(),[t,n]=m.useState(!1);if(m.useEffect(()=>{if(!e)return;n(!1);const a=i=>{i.key==="Escape"&&zr.dismiss()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[e]),!e)return null;const r=EC[e];return s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center animate-fade-in",children:[s.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>zr.dismiss()}),s.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:[s.jsxs("div",{className:"flex items-start gap-3.5 p-6 pb-4",children:[s.jsx("div",{className:`flex-shrink-0 w-11 h-11 rounded-xl border flex items-center justify-center ${r.iconBg}`,children:r.icon}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-semibold text-content",children:r.title}),s.jsx("p",{className:"mt-1.5 text-sm text-content-secondary leading-relaxed",children:r.description})]})]}),s.jsxs("div",{className:"mx-6 mb-4 rounded-xl bg-surface-inset border border-border p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx(ic,{size:14,className:"text-content-tertiary"}),s.jsx("span",{className:"text-xs font-semibold text-content-secondary uppercase tracking-wider",children:"Add to your .env file"})]}),s.jsx("div",{className:"space-y-2",children:r.envVars.map(a=>s.jsxs("div",{className:"font-mono text-xs",children:[s.jsx("span",{className:"text-accent font-semibold",children:a.name}),s.jsx("span",{className:"text-content-tertiary",children:"="}),s.jsx("span",{className:"text-content-secondary",children:a.example})]},a.name))})]}),s.jsxs("div",{className:"mx-6 mb-5 text-xs text-content-tertiary leading-relaxed",children:["After updating your ",s.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."]}),s.jsxs("div",{className:"flex items-center justify-between px-6 pb-6",children:[s.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",checked:t,onChange:a=>n(a.target.checked),className:"w-3.5 h-3.5 rounded border-border accent-accent cursor-pointer"}),s.jsx("span",{className:"text-xs text-content-tertiary",children:"Don't show this again"})]}),s.jsx(se,{variant:"secondary",size:"sm",onClick:()=>zr.dismiss(t),children:"Close"})]})]})]})}function RC(){const{job:e,showPopup:t}=ib(),n=Ms();return!t||!e||e.status!=="done"?null:s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm animate-fade-in",children:s.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:[s.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:[s.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:s.jsx(we,{size:28,className:"text-emerald-500"})}),s.jsx("h2",{className:"text-lg font-bold text-content",children:"Suite Generated!"}),e.suiteName&&s.jsx("span",{className:"mt-2 px-3 py-1 rounded-lg bg-accent-muted text-accent text-xs font-semibold",children:e.suiteName}),s.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."})]}),s.jsxs("div",{className:"flex flex-col gap-2.5 px-6 pb-6",children:[s.jsxs("button",{type:"button",onClick:()=>{hs.dismissPopup(),n("/tests",{state:{openSuiteId:e.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:[s.jsx(Kt,{size:16})," Open Test Cases"]}),s.jsx("button",{type:"button",onClick:()=>hs.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 MC(){const{job:e}=ib(),[t,n]=m.useState(null),r=m.useRef(null),a=m.useRef(null);m.useEffect(()=>{(e==null?void 0:e.status)==="running"&&n(null)},[e==null?void 0:e.id]);const i=m.useCallback(d=>{d.preventDefault();const x=a.current;if(!x)return;x.setPointerCapture(d.pointerId);const p=x.getBoundingClientRect();r.current={startX:d.clientX,startY:d.clientY,origX:p.left,origY:p.top}},[]),l=m.useCallback(d=>{if(!r.current)return;const x=a.current;if(!x)return;const p=d.clientX-r.current.startX,y=d.clientY-r.current.startY,b=r.current.origX+p,f=r.current.origY+y,v=window.innerWidth-x.offsetWidth,w=window.innerHeight-x.offsetHeight;n({x:Math.max(0,Math.min(b,v)),y:Math.max(0,Math.min(f,w))})},[]),o=m.useCallback(()=>{r.current=null},[]);if(!e||e.status!=="running")return null;const c=t?{left:t.x,top:t.y,right:"auto",bottom:"auto"}:{right:24,bottom:80};return s.jsxs("div",{ref:a,onPointerDown:i,onPointerMove:l,onPointerUp:o,style:{...c,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:[s.jsx(ae,{size:14,className:"animate-spin"}),"Generating: ",e.label]})}function TC(){return Jr({"run:start":e=>{jt.onRunStart(e.runId)},"run:case":e=>{const t=e;t.status==="running"&&jt.onCaseRunning(t.runId,t.caseId)},"run:case:done":e=>{const t=e;jt.onCaseDone(t.runId,t.caseId,t.status)},"run:complete":e=>{const t=e;jt.onComplete(t.runId,{passed:t.passed,failed:t.failed,skipped:t.skipped});const n=t.passed+t.failed+t.skipped;t.failed>0?A.error(`Run complete — ${t.passed}/${n} passed, ${t.failed} failed`):A.success(`Run complete — ${t.passed}/${n} passed`),Ar.push({id:crypto.randomUUID(),type:"run-complete",message:`Run complete — ${t.passed} passed, ${t.failed} failed`,timestamp:Date.now(),read:!1,link:"/reports"})},"run:error":e=>{const t=e;jt.clear(),A.error(`Run error: ${t.error??"unknown"}`),Ar.push({id:crypto.randomUUID(),type:"run-error",message:`Run error: ${t.error??"unknown"}`,timestamp:Date.now(),read:!1,link:"/reports"})}}),null}function zC(){return Jr({"git:log":e=>{Re.addLogStep(e)},"git:conflict":e=>{const t=e;Re.setConflict(t.files)},"git:operation-done":()=>{Re.finishOperation()}}),null}const AC={"/":"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 OC(){const e=Zn();return e.pathname.startsWith("/tests")?"Test Suites":AC[e.pathname]??"AssureMind Studio"}function DC(){const{collapsed:e,mobileOpen:t,toggle:n}=Tw(),r=OC(),[a,i]=m.useState(!1),[l,o]=m.useState(!1);return bC([{key:"?",description:"Show shortcuts",action:()=>i(!0)},{key:"Escape",description:"Close modal",action:()=>{i(!1),o(!1)}},{key:"k",ctrl:!0,description:"Search (Cmd+K)",action:()=>o(!0)},{key:"k",meta:!0,description:"Search (Cmd+K)",action:()=>o(!0)}]),s.jsxs("div",{className:"flex h-full overflow-hidden",children:[s.jsx(TC,{}),s.jsx(zC,{}),s.jsx(Mw,{collapsed:e,onToggle:n,mobileOpen:t}),s.jsxs("div",{className:"flex flex-col flex-1 min-w-0 overflow-hidden",children:[s.jsx(d5,{title:r,onMenuClick:n}),s.jsx("main",{className:"flex flex-col flex-1 overflow-hidden bg-background",children:s.jsxs(Hj,{children:[s.jsx(gt,{path:"/",element:s.jsx(h5,{})}),s.jsx(gt,{path:"/tests",element:s.jsx(Kd,{})}),s.jsx(gt,{path:"/tests/:suiteId",element:s.jsx(Kd,{})}),s.jsx(gt,{path:"/tests/:suiteId/cases/:caseId",element:s.jsx(Kd,{})}),s.jsx(gt,{path:"/story",element:s.jsx(mS,{})}),s.jsx(gt,{path:"/run",element:s.jsx(vS,{})}),s.jsx(gt,{path:"/reports",element:s.jsx(YS,{})}),s.jsx(gt,{path:"/variables",element:s.jsx(JS,{})}),s.jsx(gt,{path:"/healing",element:s.jsx(eC,{})}),s.jsx(gt,{path:"/git",element:s.jsx(dC,{})}),s.jsx(gt,{path:"/settings",element:s.jsx(sC,{})}),s.jsx(gt,{path:"/library",element:s.jsx(nC,{})}),s.jsx(gt,{path:"/ci-integration",element:s.jsx(lC,{})}),s.jsx(gt,{path:"/docs",element:s.jsx(aC,{})})]})})]}),s.jsx(jC,{open:a,onClose:()=>i(!1)}),s.jsx(SC,{open:l,onClose:()=>o(!1)})]})}function IC(){return s.jsxs(s.Fragment,{children:[s.jsx(DC,{}),s.jsx(hC,{}),s.jsx(yC,{}),s.jsx(RC,{}),s.jsx(MC,{}),s.jsx(pC,{}),s.jsx(CC,{}),s.jsx(PC,{}),s.jsx(M2,{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 FC=new MN({defaultOptions:{queries:{retry:1,staleTime:1e4,refetchOnWindowFocus:!1}}}),pb=document.getElementById("root");if(!pb)throw new Error("Root element not found");zg(pb).render(s.jsx(m.StrictMode,{children:s.jsx(Xj,{children:s.jsx(TN,{client:FC,children:s.jsx(IC,{})})})}));