assuremind 1.6.0 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -12
- package/dist/cli/index.js +197 -197
- package/dist/index.d.mts +13 -6
- package/dist/index.d.ts +13 -6
- package/dist/index.js +16 -16
- package/dist/index.mjs +17 -17
- package/docs/GETTING-STARTED.md +13 -2
- package/package.json +1 -1
- package/templates/docs/GETTING-STARTED.md +1 -1
- package/ui/dist/assets/index-BsxznSas.css +1 -0
- package/ui/dist/assets/index-DdWg6Y6w.js +1032 -0
- package/ui/dist/index.html +2 -2
- package/ui/dist/assets/index-6jqOR-Hh.js +0 -1029
- package/ui/dist/assets/index-BGDCUDyt.css +0 -1
|
@@ -1,1029 +0,0 @@
|
|
|
1
|
-
function vy(s,r){for(var a=0;a<r.length;a++){const o=r[a];if(typeof o!="string"&&!Array.isArray(o)){for(const c in o)if(c!=="default"&&!(c in s)){const d=Object.getOwnPropertyDescriptor(o,c);d&&Object.defineProperty(s,c,d.get?d:{enumerable:!0,get:()=>o[c]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const x of d.addedNodes)x.tagName==="LINK"&&x.rel==="modulepreload"&&o(x)}).observe(document,{childList:!0,subtree:!0});function a(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function o(c){if(c.ep)return;c.ep=!0;const d=a(c);fetch(c.href,d)}})();function jy(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Pd={exports:{}},ci={},Rd={exports:{}},De={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Lh;function Ny(){if(Lh)return De;Lh=1;var s=Symbol.for("react.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),x=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),j=Symbol.iterator;function P(z){return z===null||typeof z!="object"?null:(z=j&&z[j]||z["@@iterator"],typeof z=="function"?z:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,E={};function R(z,F,ce){this.props=z,this.context=F,this.refs=E,this.updater=ce||S}R.prototype.isReactComponent={},R.prototype.setState=function(z,F){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,F,"setState")},R.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function v(){}v.prototype=R.prototype;function C(z,F,ce){this.props=z,this.context=F,this.refs=E,this.updater=ce||S}var D=C.prototype=new v;D.constructor=C,k(D,R.prototype),D.isPureReactComponent=!0;var M=Array.isArray,w=Object.prototype.hasOwnProperty,N={current:null},K={key:!0,ref:!0,__self:!0,__source:!0};function _(z,F,ce){var Y,ue={},ye=null,Ae=null;if(F!=null)for(Y in F.ref!==void 0&&(Ae=F.ref),F.key!==void 0&&(ye=""+F.key),F)w.call(F,Y)&&!K.hasOwnProperty(Y)&&(ue[Y]=F[Y]);var me=arguments.length-2;if(me===1)ue.children=ce;else if(1<me){for(var Ee=Array(me),Ke=0;Ke<me;Ke++)Ee[Ke]=arguments[Ke+2];ue.children=Ee}if(z&&z.defaultProps)for(Y in me=z.defaultProps,me)ue[Y]===void 0&&(ue[Y]=me[Y]);return{$$typeof:s,type:z,key:ye,ref:Ae,props:ue,_owner:N.current}}function ee(z,F){return{$$typeof:s,type:z.type,key:F,ref:z.ref,props:z.props,_owner:z._owner}}function $(z){return typeof z=="object"&&z!==null&&z.$$typeof===s}function G(z){var F={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(ce){return F[ce]})}var le=/\/+/g;function je(z,F){return typeof z=="object"&&z!==null&&z.key!=null?G(""+z.key):F.toString(36)}function ke(z,F,ce,Y,ue){var ye=typeof z;(ye==="undefined"||ye==="boolean")&&(z=null);var Ae=!1;if(z===null)Ae=!0;else switch(ye){case"string":case"number":Ae=!0;break;case"object":switch(z.$$typeof){case s:case r:Ae=!0}}if(Ae)return Ae=z,ue=ue(Ae),z=Y===""?"."+je(Ae,0):Y,M(ue)?(ce="",z!=null&&(ce=z.replace(le,"$&/")+"/"),ke(ue,F,ce,"",function(Ke){return Ke})):ue!=null&&($(ue)&&(ue=ee(ue,ce+(!ue.key||Ae&&Ae.key===ue.key?"":(""+ue.key).replace(le,"$&/")+"/")+z)),F.push(ue)),1;if(Ae=0,Y=Y===""?".":Y+":",M(z))for(var me=0;me<z.length;me++){ye=z[me];var Ee=Y+je(ye,me);Ae+=ke(ye,F,ce,Ee,ue)}else if(Ee=P(z),typeof Ee=="function")for(z=Ee.call(z),me=0;!(ye=z.next()).done;)ye=ye.value,Ee=Y+je(ye,me++),Ae+=ke(ye,F,ce,Ee,ue);else if(ye==="object")throw F=String(z),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.");return Ae}function Ce(z,F,ce){if(z==null)return z;var Y=[],ue=0;return ke(z,Y,"","",function(ye){return F.call(ce,ye,ue++)}),Y}function Re(z){if(z._status===-1){var F=z._result;F=F(),F.then(function(ce){(z._status===0||z._status===-1)&&(z._status=1,z._result=ce)},function(ce){(z._status===0||z._status===-1)&&(z._status=2,z._result=ce)}),z._status===-1&&(z._status=0,z._result=F)}if(z._status===1)return z._result.default;throw z._result}var be={current:null},B={transition:null},X={ReactCurrentDispatcher:be,ReactCurrentBatchConfig:B,ReactCurrentOwner:N};function L(){throw Error("act(...) is not supported in production builds of React.")}return De.Children={map:Ce,forEach:function(z,F,ce){Ce(z,function(){F.apply(this,arguments)},ce)},count:function(z){var F=0;return Ce(z,function(){F++}),F},toArray:function(z){return Ce(z,function(F){return F})||[]},only:function(z){if(!$(z))throw Error("React.Children.only expected to receive a single React element child.");return z}},De.Component=R,De.Fragment=a,De.Profiler=c,De.PureComponent=C,De.StrictMode=o,De.Suspense=f,De.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=X,De.act=L,De.cloneElement=function(z,F,ce){if(z==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+z+".");var Y=k({},z.props),ue=z.key,ye=z.ref,Ae=z._owner;if(F!=null){if(F.ref!==void 0&&(ye=F.ref,Ae=N.current),F.key!==void 0&&(ue=""+F.key),z.type&&z.type.defaultProps)var me=z.type.defaultProps;for(Ee in F)w.call(F,Ee)&&!K.hasOwnProperty(Ee)&&(Y[Ee]=F[Ee]===void 0&&me!==void 0?me[Ee]:F[Ee])}var Ee=arguments.length-2;if(Ee===1)Y.children=ce;else if(1<Ee){me=Array(Ee);for(var Ke=0;Ke<Ee;Ke++)me[Ke]=arguments[Ke+2];Y.children=me}return{$$typeof:s,type:z.type,key:ue,ref:ye,props:Y,_owner:Ae}},De.createContext=function(z){return z={$$typeof:x,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},z.Provider={$$typeof:d,_context:z},z.Consumer=z},De.createElement=_,De.createFactory=function(z){var F=_.bind(null,z);return F.type=z,F},De.createRef=function(){return{current:null}},De.forwardRef=function(z){return{$$typeof:h,render:z}},De.isValidElement=$,De.lazy=function(z){return{$$typeof:g,_payload:{_status:-1,_result:z},_init:Re}},De.memo=function(z,F){return{$$typeof:y,type:z,compare:F===void 0?null:F}},De.startTransition=function(z){var F=B.transition;B.transition={};try{z()}finally{B.transition=F}},De.unstable_act=L,De.useCallback=function(z,F){return be.current.useCallback(z,F)},De.useContext=function(z){return be.current.useContext(z)},De.useDebugValue=function(){},De.useDeferredValue=function(z){return be.current.useDeferredValue(z)},De.useEffect=function(z,F){return be.current.useEffect(z,F)},De.useId=function(){return be.current.useId()},De.useImperativeHandle=function(z,F,ce){return be.current.useImperativeHandle(z,F,ce)},De.useInsertionEffect=function(z,F){return be.current.useInsertionEffect(z,F)},De.useLayoutEffect=function(z,F){return be.current.useLayoutEffect(z,F)},De.useMemo=function(z,F){return be.current.useMemo(z,F)},De.useReducer=function(z,F,ce){return be.current.useReducer(z,F,ce)},De.useRef=function(z){return be.current.useRef(z)},De.useState=function(z){return be.current.useState(z)},De.useSyncExternalStore=function(z,F,ce){return be.current.useSyncExternalStore(z,F,ce)},De.useTransition=function(){return be.current.useTransition()},De.version="18.3.1",De}var _h;function Lu(){return _h||(_h=1,Rd.exports=Ny()),Rd.exports}/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Uh;function wy(){if(Uh)return ci;Uh=1;var s=Lu(),r=Symbol.for("react.element"),a=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,c=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function x(h,f,y){var g,j={},P=null,S=null;y!==void 0&&(P=""+y),f.key!==void 0&&(P=""+f.key),f.ref!==void 0&&(S=f.ref);for(g in f)o.call(f,g)&&!d.hasOwnProperty(g)&&(j[g]=f[g]);if(h&&h.defaultProps)for(g in f=h.defaultProps,f)j[g]===void 0&&(j[g]=f[g]);return{$$typeof:r,type:h,key:P,ref:S,props:j,_owner:c.current}}return ci.Fragment=a,ci.jsx=x,ci.jsxs=x,ci}var $h;function ky(){return $h||($h=1,Pd.exports=wy()),Pd.exports}var e=ky(),p=Lu();const Sy=jy(p),Cy=vy({__proto__:null,default:Sy},[p]);var Zo={},Md={exports:{}},Yt={},Td={exports:{}},zd={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var Bh;function Ey(){return Bh||(Bh=1,(function(s){function r(B,X){var L=B.length;B.push(X);e:for(;0<L;){var z=L-1>>>1,F=B[z];if(0<c(F,X))B[z]=X,B[L]=F,L=z;else break e}}function a(B){return B.length===0?null:B[0]}function o(B){if(B.length===0)return null;var X=B[0],L=B.pop();if(L!==X){B[0]=L;e:for(var z=0,F=B.length,ce=F>>>1;z<ce;){var Y=2*(z+1)-1,ue=B[Y],ye=Y+1,Ae=B[ye];if(0>c(ue,L))ye<F&&0>c(Ae,ue)?(B[z]=Ae,B[ye]=L,z=ye):(B[z]=ue,B[Y]=L,z=Y);else if(ye<F&&0>c(Ae,L))B[z]=Ae,B[ye]=L,z=ye;else break e}}return X}function c(B,X){var L=B.sortIndex-X.sortIndex;return L!==0?L:B.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var d=performance;s.unstable_now=function(){return d.now()}}else{var x=Date,h=x.now();s.unstable_now=function(){return x.now()-h}}var f=[],y=[],g=1,j=null,P=3,S=!1,k=!1,E=!1,R=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function D(B){for(var X=a(y);X!==null;){if(X.callback===null)o(y);else if(X.startTime<=B)o(y),X.sortIndex=X.expirationTime,r(f,X);else break;X=a(y)}}function M(B){if(E=!1,D(B),!k)if(a(f)!==null)k=!0,Re(w);else{var X=a(y);X!==null&&be(M,X.startTime-B)}}function w(B,X){k=!1,E&&(E=!1,v(_),_=-1),S=!0;var L=P;try{for(D(X),j=a(f);j!==null&&(!(j.expirationTime>X)||B&&!G());){var z=j.callback;if(typeof z=="function"){j.callback=null,P=j.priorityLevel;var F=z(j.expirationTime<=X);X=s.unstable_now(),typeof F=="function"?j.callback=F:j===a(f)&&o(f),D(X)}else o(f);j=a(f)}if(j!==null)var ce=!0;else{var Y=a(y);Y!==null&&be(M,Y.startTime-X),ce=!1}return ce}finally{j=null,P=L,S=!1}}var N=!1,K=null,_=-1,ee=5,$=-1;function G(){return!(s.unstable_now()-$<ee)}function le(){if(K!==null){var B=s.unstable_now();$=B;var X=!0;try{X=K(!0,B)}finally{X?je():(N=!1,K=null)}}else N=!1}var je;if(typeof C=="function")je=function(){C(le)};else if(typeof MessageChannel<"u"){var ke=new MessageChannel,Ce=ke.port2;ke.port1.onmessage=le,je=function(){Ce.postMessage(null)}}else je=function(){R(le,0)};function Re(B){K=B,N||(N=!0,je())}function be(B,X){_=R(function(){B(s.unstable_now())},X)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(B){B.callback=null},s.unstable_continueExecution=function(){k||S||(k=!0,Re(w))},s.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ee=0<B?Math.floor(1e3/B):5},s.unstable_getCurrentPriorityLevel=function(){return P},s.unstable_getFirstCallbackNode=function(){return a(f)},s.unstable_next=function(B){switch(P){case 1:case 2:case 3:var X=3;break;default:X=P}var L=P;P=X;try{return B()}finally{P=L}},s.unstable_pauseExecution=function(){},s.unstable_requestPaint=function(){},s.unstable_runWithPriority=function(B,X){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var L=P;P=B;try{return X()}finally{P=L}},s.unstable_scheduleCallback=function(B,X,L){var z=s.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?z+L:z):L=z,B){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=L+F,B={id:g++,callback:X,priorityLevel:B,startTime:L,expirationTime:F,sortIndex:-1},L>z?(B.sortIndex=L,r(y,B),a(f)===null&&B===a(y)&&(E?(v(_),_=-1):E=!0,be(M,L-z))):(B.sortIndex=F,r(f,B),k||S||(k=!0,Re(w))),B},s.unstable_shouldYield=G,s.unstable_wrapCallback=function(B){var X=P;return function(){var L=P;P=X;try{return B.apply(this,arguments)}finally{P=L}}}})(zd)),zd}var qh;function Py(){return qh||(qh=1,Td.exports=Ey()),Td.exports}/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var Hh;function Ry(){if(Hh)return Yt;Hh=1;var s=Lu(),r=Py();function a(t){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+t,i=1;i<arguments.length;i++)n+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,c={};function d(t,n){x(t,n),x(t+"Capture",n)}function x(t,n){for(c[t]=n,t=0;t<n.length;t++)o.add(n[t])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,y=/^[: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]*$/,g={},j={};function P(t){return f.call(j,t)?!0:f.call(g,t)?!1:y.test(t)?j[t]=!0:(g[t]=!0,!1)}function S(t,n,i,l){if(i!==null&&i.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return l?!1:i!==null?!i.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function k(t,n,i,l){if(n===null||typeof n>"u"||S(t,n,i,l))return!0;if(l)return!1;if(i!==null)switch(i.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function E(t,n,i,l,u,m,b){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=l,this.attributeNamespace=u,this.mustUseProperty=i,this.propertyName=t,this.type=n,this.sanitizeURL=m,this.removeEmptyString=b}var R={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){R[t]=new E(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var n=t[0];R[n]=new E(n,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){R[t]=new E(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){R[t]=new E(t,2,!1,t,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){R[t]=new E(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){R[t]=new E(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){R[t]=new E(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){R[t]=new E(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){R[t]=new E(t,5,!1,t.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function C(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var n=t.replace(v,C);R[n]=new E(n,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var n=t.replace(v,C);R[n]=new E(n,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var n=t.replace(v,C);R[n]=new E(n,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){R[t]=new E(t,1,!1,t.toLowerCase(),null,!1,!1)}),R.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){R[t]=new E(t,1,!1,t.toLowerCase(),null,!0,!0)});function D(t,n,i,l){var u=R.hasOwnProperty(n)?R[n]:null;(u!==null?u.type!==0:l||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(k(n,i,u,l)&&(i=null),l||u===null?P(n)&&(i===null?t.removeAttribute(n):t.setAttribute(n,""+i)):u.mustUseProperty?t[u.propertyName]=i===null?u.type===3?!1:"":i:(n=u.attributeName,l=u.attributeNamespace,i===null?t.removeAttribute(n):(u=u.type,i=u===3||u===4&&i===!0?"":""+i,l?t.setAttributeNS(l,n,i):t.setAttribute(n,i))))}var M=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for("react.element"),N=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),ee=Symbol.for("react.profiler"),$=Symbol.for("react.provider"),G=Symbol.for("react.context"),le=Symbol.for("react.forward_ref"),je=Symbol.for("react.suspense"),ke=Symbol.for("react.suspense_list"),Ce=Symbol.for("react.memo"),Re=Symbol.for("react.lazy"),be=Symbol.for("react.offscreen"),B=Symbol.iterator;function X(t){return t===null||typeof t!="object"?null:(t=B&&t[B]||t["@@iterator"],typeof t=="function"?t:null)}var L=Object.assign,z;function F(t){if(z===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);z=n&&n[1]||""}return`
|
|
34
|
-
`+z+t}var ce=!1;function Y(t,n){if(!t||ce)return"";ce=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(V){var l=V}Reflect.construct(t,[],n)}else{try{n.call()}catch(V){l=V}t.call(n.prototype)}else{try{throw Error()}catch(V){l=V}t()}}catch(V){if(V&&l&&typeof V.stack=="string"){for(var u=V.stack.split(`
|
|
35
|
-
`),m=l.stack.split(`
|
|
36
|
-
`),b=u.length-1,T=m.length-1;1<=b&&0<=T&&u[b]!==m[T];)T--;for(;1<=b&&0<=T;b--,T--)if(u[b]!==m[T]){if(b!==1||T!==1)do if(b--,T--,0>T||u[b]!==m[T]){var A=`
|
|
37
|
-
`+u[b].replace(" at new "," at ");return t.displayName&&A.includes("<anonymous>")&&(A=A.replace("<anonymous>",t.displayName)),A}while(1<=b&&0<=T);break}}}finally{ce=!1,Error.prepareStackTrace=i}return(t=t?t.displayName||t.name:"")?F(t):""}function ue(t){switch(t.tag){case 5:return F(t.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return t=Y(t.type,!1),t;case 11:return t=Y(t.type.render,!1),t;case 1:return t=Y(t.type,!0),t;default:return""}}function ye(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case K:return"Fragment";case N:return"Portal";case ee:return"Profiler";case _:return"StrictMode";case je:return"Suspense";case ke:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case G:return(t.displayName||"Context")+".Consumer";case $:return(t._context.displayName||"Context")+".Provider";case le:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Ce:return n=t.displayName||null,n!==null?n:ye(t.type)||"Memo";case Re:n=t._payload,t=t._init;try{return ye(t(n))}catch{}}return null}function Ae(t){var n=t.type;switch(t.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=n.render,t=t.displayName||t.name||"",n.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ye(n);case 8:return n===_?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function me(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Ee(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ke(t){var n=Ee(t)?"checked":"value",i=Object.getOwnPropertyDescriptor(t.constructor.prototype,n),l=""+t[n];if(!t.hasOwnProperty(n)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var u=i.get,m=i.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return u.call(this)},set:function(b){l=""+b,m.call(this,b)}}),Object.defineProperty(t,n,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(b){l=""+b},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function yt(t){t._valueTracker||(t._valueTracker=Ke(t))}function qt(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var i=n.getValue(),l="";return t&&(l=Ee(t)?t.checked?"true":"false":t.value),t=l,t!==i?(n.setValue(t),!0):!1}function Xe(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function ie(t,n){var i=n.checked;return L({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??t._wrapperState.initialChecked})}function Mt(t,n){var i=n.defaultValue==null?"":n.defaultValue,l=n.checked!=null?n.checked:n.defaultChecked;i=me(n.value!=null?n.value:i),t._wrapperState={initialChecked:l,initialValue:i,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function xt(t,n){n=n.checked,n!=null&&D(t,"checked",n,!1)}function Ft(t,n){xt(t,n);var i=me(n.value),l=n.type;if(i!=null)l==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+i):t.value!==""+i&&(t.value=""+i);else if(l==="submit"||l==="reset"){t.removeAttribute("value");return}n.hasOwnProperty("value")?ys(t,n.type,i):n.hasOwnProperty("defaultValue")&&ys(t,n.type,me(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(t.defaultChecked=!!n.defaultChecked)}function As(t,n,i){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var l=n.type;if(!(l!=="submit"&&l!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+t._wrapperState.initialValue,i||n===t.value||(t.value=n),t.defaultValue=n}i=t.name,i!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,i!==""&&(t.name=i)}function ys(t,n,i){(n!=="number"||Xe(t.ownerDocument)!==t)&&(i==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+i&&(t.defaultValue=""+i))}var W=Array.isArray;function he(t,n,i,l){if(t=t.options,n){n={};for(var u=0;u<i.length;u++)n["$"+i[u]]=!0;for(i=0;i<t.length;i++)u=n.hasOwnProperty("$"+t[i].value),t[i].selected!==u&&(t[i].selected=u),u&&l&&(t[i].defaultSelected=!0)}else{for(i=""+me(i),n=null,u=0;u<t.length;u++){if(t[u].value===i){t[u].selected=!0,l&&(t[u].defaultSelected=!0);return}n!==null||t[u].disabled||(n=t[u])}n!==null&&(n.selected=!0)}}function Le(t,n){if(n.dangerouslySetInnerHTML!=null)throw Error(a(91));return L({},n,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function bs(t,n){var i=n.value;if(i==null){if(i=n.children,n=n.defaultValue,i!=null){if(n!=null)throw Error(a(92));if(W(i)){if(1<i.length)throw Error(a(93));i=i[0]}n=i}n==null&&(n=""),i=n}t._wrapperState={initialValue:me(i)}}function bt(t,n){var i=me(n.value),l=me(n.defaultValue);i!=null&&(i=""+i,i!==t.value&&(t.value=i),n.defaultValue==null&&t.defaultValue!==i&&(t.defaultValue=i)),l!=null&&(t.defaultValue=""+l)}function Os(t){var n=t.textContent;n===t._wrapperState.initialValue&&n!==""&&n!==null&&(t.value=n)}function ts(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function mt(t,n){return t==null||t==="http://www.w3.org/1999/xhtml"?ts(n):t==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var ne,Ue=(function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,i,l,u){MSApp.execUnsafeLocalFunction(function(){return t(n,i,l,u)})}:t})(function(t,n){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=n;else{for(ne=ne||document.createElement("div"),ne.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=ne.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;n.firstChild;)t.appendChild(n.firstChild)}});function $e(t,n){if(n){var i=t.firstChild;if(i&&i===t.lastChild&&i.nodeType===3){i.nodeValue=n;return}}t.textContent=n}var Ge={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ht=["Webkit","ms","Moz","O"];Object.keys(Ge).forEach(function(t){Ht.forEach(function(n){n=n+t.charAt(0).toUpperCase()+t.substring(1),Ge[n]=Ge[t]})});function Qs(t,n,i){return n==null||typeof n=="boolean"||n===""?"":i||typeof n!="number"||n===0||Ge.hasOwnProperty(t)&&Ge[t]?(""+n).trim():n+"px"}function Qn(t,n){t=t.style;for(var i in n)if(n.hasOwnProperty(i)){var l=i.indexOf("--")===0,u=Qs(i,n[i],l);i==="float"&&(i="cssFloat"),l?t.setProperty(i,u):t[i]=u}}var Ds=L({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function os(t,n){if(n){if(Ds[t]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(a(137,t));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(a(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(a(61))}if(n.style!=null&&typeof n.style!="object")throw Error(a(62))}}function _e(t,n){if(t.indexOf("-")===-1)return typeof n.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var vs=null;function ls(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Is=null,Kt=null,cs=null;function qi(t){if(t=Ga(t)){if(typeof Is!="function")throw Error(a(280));var n=t.stateNode;n&&(n=ho(n),Is(t.stateNode,t.type,n))}}function Ca(t){Kt?cs?cs.push(t):cs=[t]:Kt=t}function Hi(){if(Kt){var t=Kt,n=cs;if(cs=Kt=null,qi(t),n)for(t=0;t<n.length;t++)qi(n[t])}}function Ea(t,n){return t(n)}function Or(){}var Pa=!1;function Ki(t,n,i){if(Pa)return t(n,i);Pa=!0;try{return Ea(t,n,i)}finally{Pa=!1,(Kt!==null||cs!==null)&&(Or(),Hi())}}function rt(t,n){var i=t.stateNode;if(i===null)return null;var l=ho(i);if(l===null)return null;i=l[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(t=t.type,l=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!l;break e;default:t=!1}if(t)return null;if(i&&typeof i!="function")throw Error(a(231,n,typeof i));return i}var Ra=!1;if(h)try{var hn={};Object.defineProperty(hn,"passive",{get:function(){Ra=!0}}),window.addEventListener("test",hn,hn),window.removeEventListener("test",hn,hn)}catch{Ra=!1}function Dr(t,n,i,l,u,m,b,T,A){var V=Array.prototype.slice.call(arguments,3);try{n.apply(i,V)}catch(se){this.onError(se)}}var Jn=!1,Yn=null,Ir=!1,Fr=null,Fs={onError:function(t){Jn=!0,Yn=t}};function Vl(t,n,i,l,u,m,b,T,A){Jn=!1,Yn=null,Dr.apply(Fs,arguments)}function Wi(t,n,i,l,u,m,b,T,A){if(Vl.apply(this,arguments),Jn){if(Jn){var V=Yn;Jn=!1,Yn=null}else throw Error(a(198));Ir||(Ir=!0,Fr=V)}}function J(t){var n=t,i=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(i=n.return),t=n.return;while(t)}return n.tag===3?i:null}function Te(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function Se(t){if(J(t)!==t)throw Error(a(188))}function Ie(t){var n=t.alternate;if(!n){if(n=J(t),n===null)throw Error(a(188));return n!==t?null:t}for(var i=t,l=n;;){var u=i.return;if(u===null)break;var m=u.alternate;if(m===null){if(l=u.return,l!==null){i=l;continue}break}if(u.child===m.child){for(m=u.child;m;){if(m===i)return Se(u),t;if(m===l)return Se(u),n;m=m.sibling}throw Error(a(188))}if(i.return!==l.return)i=u,l=m;else{for(var b=!1,T=u.child;T;){if(T===i){b=!0,i=u,l=m;break}if(T===l){b=!0,l=u,i=m;break}T=T.sibling}if(!b){for(T=m.child;T;){if(T===i){b=!0,i=m,l=u;break}if(T===l){b=!0,l=m,i=u;break}T=T.sibling}if(!b)throw Error(a(189))}}if(i.alternate!==l)throw Error(a(190))}if(i.tag!==3)throw Error(a(188));return i.stateNode.current===i?t:n}function Tt(t){return t=Ie(t),t!==null?Lr(t):null}function Lr(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var n=Lr(t);if(n!==null)return n;t=t.sibling}return null}var ux=r.unstable_scheduleCallback,xx=r.unstable_cancelCallback,Tg=r.unstable_shouldYield,zg=r.unstable_requestPaint,ot=r.unstable_now,Ag=r.unstable_getCurrentPriorityLevel,Gl=r.unstable_ImmediatePriority,mx=r.unstable_UserBlockingPriority,Vi=r.unstable_NormalPriority,Og=r.unstable_LowPriority,hx=r.unstable_IdlePriority,Gi=null,Ls=null;function Dg(t){if(Ls&&typeof Ls.onCommitFiberRoot=="function")try{Ls.onCommitFiberRoot(Gi,t,void 0,(t.current.flags&128)===128)}catch{}}var js=Math.clz32?Math.clz32:Lg,Ig=Math.log,Fg=Math.LN2;function Lg(t){return t>>>=0,t===0?32:31-(Ig(t)/Fg|0)|0}var Qi=64,Ji=4194304;function Ma(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Yi(t,n){var i=t.pendingLanes;if(i===0)return 0;var l=0,u=t.suspendedLanes,m=t.pingedLanes,b=i&268435455;if(b!==0){var T=b&~u;T!==0?l=Ma(T):(m&=b,m!==0&&(l=Ma(m)))}else b=i&~u,b!==0?l=Ma(b):m!==0&&(l=Ma(m));if(l===0)return 0;if(n!==0&&n!==l&&(n&u)===0&&(u=l&-l,m=n&-n,u>=m||u===16&&(m&4194240)!==0))return n;if((l&4)!==0&&(l|=i&16),n=t.entangledLanes,n!==0)for(t=t.entanglements,n&=l;0<n;)i=31-js(n),u=1<<i,l|=t[i],n&=~u;return l}function _g(t,n){switch(t){case 1:case 2:case 4:return n+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ug(t,n){for(var i=t.suspendedLanes,l=t.pingedLanes,u=t.expirationTimes,m=t.pendingLanes;0<m;){var b=31-js(m),T=1<<b,A=u[b];A===-1?((T&i)===0||(T&l)!==0)&&(u[b]=_g(T,n)):A<=n&&(t.expiredLanes|=T),m&=~T}}function Ql(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function px(){var t=Qi;return Qi<<=1,(Qi&4194240)===0&&(Qi=64),t}function Jl(t){for(var n=[],i=0;31>i;i++)n.push(t);return n}function Ta(t,n,i){t.pendingLanes|=n,n!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,n=31-js(n),t[n]=i}function $g(t,n){var i=t.pendingLanes&~n;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=n,t.mutableReadLanes&=n,t.entangledLanes&=n,n=t.entanglements;var l=t.eventTimes;for(t=t.expirationTimes;0<i;){var u=31-js(i),m=1<<u;n[u]=0,l[u]=-1,t[u]=-1,i&=~m}}function Yl(t,n){var i=t.entangledLanes|=n;for(t=t.entanglements;i;){var l=31-js(i),u=1<<l;u&n|t[l]&n&&(t[l]|=n),i&=~u}}var We=0;function fx(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var gx,Xl,yx,bx,vx,Zl=!1,Xi=[],pn=null,fn=null,gn=null,za=new Map,Aa=new Map,yn=[],Bg="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function jx(t,n){switch(t){case"focusin":case"focusout":pn=null;break;case"dragenter":case"dragleave":fn=null;break;case"mouseover":case"mouseout":gn=null;break;case"pointerover":case"pointerout":za.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Aa.delete(n.pointerId)}}function Oa(t,n,i,l,u,m){return t===null||t.nativeEvent!==m?(t={blockedOn:n,domEventName:i,eventSystemFlags:l,nativeEvent:m,targetContainers:[u]},n!==null&&(n=Ga(n),n!==null&&Xl(n)),t):(t.eventSystemFlags|=l,n=t.targetContainers,u!==null&&n.indexOf(u)===-1&&n.push(u),t)}function qg(t,n,i,l,u){switch(n){case"focusin":return pn=Oa(pn,t,n,i,l,u),!0;case"dragenter":return fn=Oa(fn,t,n,i,l,u),!0;case"mouseover":return gn=Oa(gn,t,n,i,l,u),!0;case"pointerover":var m=u.pointerId;return za.set(m,Oa(za.get(m)||null,t,n,i,l,u)),!0;case"gotpointercapture":return m=u.pointerId,Aa.set(m,Oa(Aa.get(m)||null,t,n,i,l,u)),!0}return!1}function Nx(t){var n=Xn(t.target);if(n!==null){var i=J(n);if(i!==null){if(n=i.tag,n===13){if(n=Te(i),n!==null){t.blockedOn=n,vx(t.priority,function(){yx(i)});return}}else if(n===3&&i.stateNode.current.memoizedState.isDehydrated){t.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Zi(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var i=tc(t.domEventName,t.eventSystemFlags,n[0],t.nativeEvent);if(i===null){i=t.nativeEvent;var l=new i.constructor(i.type,i);vs=l,i.target.dispatchEvent(l),vs=null}else return n=Ga(i),n!==null&&Xl(n),t.blockedOn=i,!1;n.shift()}return!0}function wx(t,n,i){Zi(t)&&i.delete(n)}function Hg(){Zl=!1,pn!==null&&Zi(pn)&&(pn=null),fn!==null&&Zi(fn)&&(fn=null),gn!==null&&Zi(gn)&&(gn=null),za.forEach(wx),Aa.forEach(wx)}function Da(t,n){t.blockedOn===n&&(t.blockedOn=null,Zl||(Zl=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Hg)))}function Ia(t){function n(u){return Da(u,t)}if(0<Xi.length){Da(Xi[0],t);for(var i=1;i<Xi.length;i++){var l=Xi[i];l.blockedOn===t&&(l.blockedOn=null)}}for(pn!==null&&Da(pn,t),fn!==null&&Da(fn,t),gn!==null&&Da(gn,t),za.forEach(n),Aa.forEach(n),i=0;i<yn.length;i++)l=yn[i],l.blockedOn===t&&(l.blockedOn=null);for(;0<yn.length&&(i=yn[0],i.blockedOn===null);)Nx(i),i.blockedOn===null&&yn.shift()}var _r=M.ReactCurrentBatchConfig,eo=!0;function Kg(t,n,i,l){var u=We,m=_r.transition;_r.transition=null;try{We=1,ec(t,n,i,l)}finally{We=u,_r.transition=m}}function Wg(t,n,i,l){var u=We,m=_r.transition;_r.transition=null;try{We=4,ec(t,n,i,l)}finally{We=u,_r.transition=m}}function ec(t,n,i,l){if(eo){var u=tc(t,n,i,l);if(u===null)yc(t,n,l,to,i),jx(t,l);else if(qg(u,t,n,i,l))l.stopPropagation();else if(jx(t,l),n&4&&-1<Bg.indexOf(t)){for(;u!==null;){var m=Ga(u);if(m!==null&&gx(m),m=tc(t,n,i,l),m===null&&yc(t,n,l,to,i),m===u)break;u=m}u!==null&&l.stopPropagation()}else yc(t,n,l,null,i)}}var to=null;function tc(t,n,i,l){if(to=null,t=ls(l),t=Xn(t),t!==null)if(n=J(t),n===null)t=null;else if(i=n.tag,i===13){if(t=Te(n),t!==null)return t;t=null}else if(i===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null);return to=t,null}function kx(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ag()){case Gl:return 1;case mx:return 4;case Vi:case Og:return 16;case hx:return 536870912;default:return 16}default:return 16}}var bn=null,sc=null,so=null;function Sx(){if(so)return so;var t,n=sc,i=n.length,l,u="value"in bn?bn.value:bn.textContent,m=u.length;for(t=0;t<i&&n[t]===u[t];t++);var b=i-t;for(l=1;l<=b&&n[i-l]===u[m-l];l++);return so=u.slice(t,1<l?1-l:void 0)}function no(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function ro(){return!0}function Cx(){return!1}function ss(t){function n(i,l,u,m,b){this._reactName=i,this._targetInst=u,this.type=l,this.nativeEvent=m,this.target=b,this.currentTarget=null;for(var T in t)t.hasOwnProperty(T)&&(i=t[T],this[T]=i?i(m):m[T]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?ro:Cx,this.isPropagationStopped=Cx,this}return L(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=ro)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=ro)},persist:function(){},isPersistent:ro}),n}var Ur={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},nc=ss(Ur),Fa=L({},Ur,{view:0,detail:0}),Vg=ss(Fa),rc,ac,La,ao=L({},Fa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:oc,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==La&&(La&&t.type==="mousemove"?(rc=t.screenX-La.screenX,ac=t.screenY-La.screenY):ac=rc=0,La=t),rc)},movementY:function(t){return"movementY"in t?t.movementY:ac}}),Ex=ss(ao),Gg=L({},ao,{dataTransfer:0}),Qg=ss(Gg),Jg=L({},Fa,{relatedTarget:0}),ic=ss(Jg),Yg=L({},Ur,{animationName:0,elapsedTime:0,pseudoElement:0}),Xg=ss(Yg),Zg=L({},Ur,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),e0=ss(Zg),t0=L({},Ur,{data:0}),Px=ss(t0),s0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},n0={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"},r0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function a0(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=r0[t])?!!n[t]:!1}function oc(){return a0}var i0=L({},Fa,{key:function(t){if(t.key){var n=s0[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=no(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?n0[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:oc,charCode:function(t){return t.type==="keypress"?no(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?no(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),o0=ss(i0),l0=L({},ao,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rx=ss(l0),c0=L({},Fa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:oc}),d0=ss(c0),u0=L({},Ur,{propertyName:0,elapsedTime:0,pseudoElement:0}),x0=ss(u0),m0=L({},ao,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),h0=ss(m0),p0=[9,13,27,32],lc=h&&"CompositionEvent"in window,_a=null;h&&"documentMode"in document&&(_a=document.documentMode);var f0=h&&"TextEvent"in window&&!_a,Mx=h&&(!lc||_a&&8<_a&&11>=_a),Tx=" ",zx=!1;function Ax(t,n){switch(t){case"keyup":return p0.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ox(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var $r=!1;function g0(t,n){switch(t){case"compositionend":return Ox(n);case"keypress":return n.which!==32?null:(zx=!0,Tx);case"textInput":return t=n.data,t===Tx&&zx?null:t;default:return null}}function y0(t,n){if($r)return t==="compositionend"||!lc&&Ax(t,n)?(t=Sx(),so=sc=bn=null,$r=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Mx&&n.locale!=="ko"?null:n.data;default:return null}}var b0={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 Dx(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!b0[t.type]:n==="textarea"}function Ix(t,n,i,l){Ca(l),n=uo(n,"onChange"),0<n.length&&(i=new nc("onChange","change",null,i,l),t.push({event:i,listeners:n}))}var Ua=null,$a=null;function v0(t){em(t,0)}function io(t){var n=Wr(t);if(qt(n))return t}function j0(t,n){if(t==="change")return n}var Fx=!1;if(h){var cc;if(h){var dc="oninput"in document;if(!dc){var Lx=document.createElement("div");Lx.setAttribute("oninput","return;"),dc=typeof Lx.oninput=="function"}cc=dc}else cc=!1;Fx=cc&&(!document.documentMode||9<document.documentMode)}function _x(){Ua&&(Ua.detachEvent("onpropertychange",Ux),$a=Ua=null)}function Ux(t){if(t.propertyName==="value"&&io($a)){var n=[];Ix(n,$a,t,ls(t)),Ki(v0,n)}}function N0(t,n,i){t==="focusin"?(_x(),Ua=n,$a=i,Ua.attachEvent("onpropertychange",Ux)):t==="focusout"&&_x()}function w0(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return io($a)}function k0(t,n){if(t==="click")return io(n)}function S0(t,n){if(t==="input"||t==="change")return io(n)}function C0(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Ns=typeof Object.is=="function"?Object.is:C0;function Ba(t,n){if(Ns(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var i=Object.keys(t),l=Object.keys(n);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var u=i[l];if(!f.call(n,u)||!Ns(t[u],n[u]))return!1}return!0}function $x(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Bx(t,n){var i=$x(t);t=0;for(var l;i;){if(i.nodeType===3){if(l=t+i.textContent.length,t<=n&&l>=n)return{node:i,offset:n-t};t=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=$x(i)}}function qx(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?qx(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Hx(){for(var t=window,n=Xe();n instanceof t.HTMLIFrameElement;){try{var i=typeof n.contentWindow.location.href=="string"}catch{i=!1}if(i)t=n.contentWindow;else break;n=Xe(t.document)}return n}function uc(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}function E0(t){var n=Hx(),i=t.focusedElem,l=t.selectionRange;if(n!==i&&i&&i.ownerDocument&&qx(i.ownerDocument.documentElement,i)){if(l!==null&&uc(i)){if(n=l.start,t=l.end,t===void 0&&(t=n),"selectionStart"in i)i.selectionStart=n,i.selectionEnd=Math.min(t,i.value.length);else if(t=(n=i.ownerDocument||document)&&n.defaultView||window,t.getSelection){t=t.getSelection();var u=i.textContent.length,m=Math.min(l.start,u);l=l.end===void 0?m:Math.min(l.end,u),!t.extend&&m>l&&(u=l,l=m,m=u),u=Bx(i,m);var b=Bx(i,l);u&&b&&(t.rangeCount!==1||t.anchorNode!==u.node||t.anchorOffset!==u.offset||t.focusNode!==b.node||t.focusOffset!==b.offset)&&(n=n.createRange(),n.setStart(u.node,u.offset),t.removeAllRanges(),m>l?(t.addRange(n),t.extend(b.node,b.offset)):(n.setEnd(b.node,b.offset),t.addRange(n)))}}for(n=[],t=i;t=t.parentNode;)t.nodeType===1&&n.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<n.length;i++)t=n[i],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var P0=h&&"documentMode"in document&&11>=document.documentMode,Br=null,xc=null,qa=null,mc=!1;function Kx(t,n,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;mc||Br==null||Br!==Xe(l)||(l=Br,"selectionStart"in l&&uc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),qa&&Ba(qa,l)||(qa=l,l=uo(xc,"onSelect"),0<l.length&&(n=new nc("onSelect","select",null,n,i),t.push({event:n,listeners:l}),n.target=Br)))}function oo(t,n){var i={};return i[t.toLowerCase()]=n.toLowerCase(),i["Webkit"+t]="webkit"+n,i["Moz"+t]="moz"+n,i}var qr={animationend:oo("Animation","AnimationEnd"),animationiteration:oo("Animation","AnimationIteration"),animationstart:oo("Animation","AnimationStart"),transitionend:oo("Transition","TransitionEnd")},hc={},Wx={};h&&(Wx=document.createElement("div").style,"AnimationEvent"in window||(delete qr.animationend.animation,delete qr.animationiteration.animation,delete qr.animationstart.animation),"TransitionEvent"in window||delete qr.transitionend.transition);function lo(t){if(hc[t])return hc[t];if(!qr[t])return t;var n=qr[t],i;for(i in n)if(n.hasOwnProperty(i)&&i in Wx)return hc[t]=n[i];return t}var Vx=lo("animationend"),Gx=lo("animationiteration"),Qx=lo("animationstart"),Jx=lo("transitionend"),Yx=new Map,Xx="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function vn(t,n){Yx.set(t,n),d(n,[t])}for(var pc=0;pc<Xx.length;pc++){var fc=Xx[pc],R0=fc.toLowerCase(),M0=fc[0].toUpperCase()+fc.slice(1);vn(R0,"on"+M0)}vn(Vx,"onAnimationEnd"),vn(Gx,"onAnimationIteration"),vn(Qx,"onAnimationStart"),vn("dblclick","onDoubleClick"),vn("focusin","onFocus"),vn("focusout","onBlur"),vn(Jx,"onTransitionEnd"),x("onMouseEnter",["mouseout","mouseover"]),x("onMouseLeave",["mouseout","mouseover"]),x("onPointerEnter",["pointerout","pointerover"]),x("onPointerLeave",["pointerout","pointerover"]),d("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),d("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),d("onBeforeInput",["compositionend","keypress","textInput","paste"]),d("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),d("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),d("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ha="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(" "),T0=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ha));function Zx(t,n,i){var l=t.type||"unknown-event";t.currentTarget=i,Wi(l,n,void 0,t),t.currentTarget=null}function em(t,n){n=(n&4)!==0;for(var i=0;i<t.length;i++){var l=t[i],u=l.event;l=l.listeners;e:{var m=void 0;if(n)for(var b=l.length-1;0<=b;b--){var T=l[b],A=T.instance,V=T.currentTarget;if(T=T.listener,A!==m&&u.isPropagationStopped())break e;Zx(u,T,V),m=A}else for(b=0;b<l.length;b++){if(T=l[b],A=T.instance,V=T.currentTarget,T=T.listener,A!==m&&u.isPropagationStopped())break e;Zx(u,T,V),m=A}}}if(Ir)throw t=Fr,Ir=!1,Fr=null,t}function Ze(t,n){var i=n[kc];i===void 0&&(i=n[kc]=new Set);var l=t+"__bubble";i.has(l)||(tm(n,t,2,!1),i.add(l))}function gc(t,n,i){var l=0;n&&(l|=4),tm(i,t,l,n)}var co="_reactListening"+Math.random().toString(36).slice(2);function Ka(t){if(!t[co]){t[co]=!0,o.forEach(function(i){i!=="selectionchange"&&(T0.has(i)||gc(i,!1,t),gc(i,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[co]||(n[co]=!0,gc("selectionchange",!1,n))}}function tm(t,n,i,l){switch(kx(n)){case 1:var u=Kg;break;case 4:u=Wg;break;default:u=ec}i=u.bind(null,n,i,t),u=void 0,!Ra||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(u=!0),l?u!==void 0?t.addEventListener(n,i,{capture:!0,passive:u}):t.addEventListener(n,i,!0):u!==void 0?t.addEventListener(n,i,{passive:u}):t.addEventListener(n,i,!1)}function yc(t,n,i,l,u){var m=l;if((n&1)===0&&(n&2)===0&&l!==null)e:for(;;){if(l===null)return;var b=l.tag;if(b===3||b===4){var T=l.stateNode.containerInfo;if(T===u||T.nodeType===8&&T.parentNode===u)break;if(b===4)for(b=l.return;b!==null;){var A=b.tag;if((A===3||A===4)&&(A=b.stateNode.containerInfo,A===u||A.nodeType===8&&A.parentNode===u))return;b=b.return}for(;T!==null;){if(b=Xn(T),b===null)return;if(A=b.tag,A===5||A===6){l=m=b;continue e}T=T.parentNode}}l=l.return}Ki(function(){var V=m,se=ls(i),re=[];e:{var te=Yx.get(t);if(te!==void 0){var de=nc,pe=t;switch(t){case"keypress":if(no(i)===0)break e;case"keydown":case"keyup":de=o0;break;case"focusin":pe="focus",de=ic;break;case"focusout":pe="blur",de=ic;break;case"beforeblur":case"afterblur":de=ic;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":de=Ex;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=Qg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=d0;break;case Vx:case Gx:case Qx:de=Xg;break;case Jx:de=x0;break;case"scroll":de=Vg;break;case"wheel":de=h0;break;case"copy":case"cut":case"paste":de=e0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=Rx}var fe=(n&4)!==0,lt=!fe&&t==="scroll",U=fe?te!==null?te+"Capture":null:te;fe=[];for(var I=V,q;I!==null;){q=I;var ae=q.stateNode;if(q.tag===5&&ae!==null&&(q=ae,U!==null&&(ae=rt(I,U),ae!=null&&fe.push(Wa(I,ae,q)))),lt)break;I=I.return}0<fe.length&&(te=new de(te,pe,null,i,se),re.push({event:te,listeners:fe}))}}if((n&7)===0){e:{if(te=t==="mouseover"||t==="pointerover",de=t==="mouseout"||t==="pointerout",te&&i!==vs&&(pe=i.relatedTarget||i.fromElement)&&(Xn(pe)||pe[Js]))break e;if((de||te)&&(te=se.window===se?se:(te=se.ownerDocument)?te.defaultView||te.parentWindow:window,de?(pe=i.relatedTarget||i.toElement,de=V,pe=pe?Xn(pe):null,pe!==null&&(lt=J(pe),pe!==lt||pe.tag!==5&&pe.tag!==6)&&(pe=null)):(de=null,pe=V),de!==pe)){if(fe=Ex,ae="onMouseLeave",U="onMouseEnter",I="mouse",(t==="pointerout"||t==="pointerover")&&(fe=Rx,ae="onPointerLeave",U="onPointerEnter",I="pointer"),lt=de==null?te:Wr(de),q=pe==null?te:Wr(pe),te=new fe(ae,I+"leave",de,i,se),te.target=lt,te.relatedTarget=q,ae=null,Xn(se)===V&&(fe=new fe(U,I+"enter",pe,i,se),fe.target=q,fe.relatedTarget=lt,ae=fe),lt=ae,de&&pe)t:{for(fe=de,U=pe,I=0,q=fe;q;q=Hr(q))I++;for(q=0,ae=U;ae;ae=Hr(ae))q++;for(;0<I-q;)fe=Hr(fe),I--;for(;0<q-I;)U=Hr(U),q--;for(;I--;){if(fe===U||U!==null&&fe===U.alternate)break t;fe=Hr(fe),U=Hr(U)}fe=null}else fe=null;de!==null&&sm(re,te,de,fe,!1),pe!==null&<!==null&&sm(re,lt,pe,fe,!0)}}e:{if(te=V?Wr(V):window,de=te.nodeName&&te.nodeName.toLowerCase(),de==="select"||de==="input"&&te.type==="file")var ge=j0;else if(Dx(te))if(Fx)ge=S0;else{ge=w0;var Ne=N0}else(de=te.nodeName)&&de.toLowerCase()==="input"&&(te.type==="checkbox"||te.type==="radio")&&(ge=k0);if(ge&&(ge=ge(t,V))){Ix(re,ge,i,se);break e}Ne&&Ne(t,te,V),t==="focusout"&&(Ne=te._wrapperState)&&Ne.controlled&&te.type==="number"&&ys(te,"number",te.value)}switch(Ne=V?Wr(V):window,t){case"focusin":(Dx(Ne)||Ne.contentEditable==="true")&&(Br=Ne,xc=V,qa=null);break;case"focusout":qa=xc=Br=null;break;case"mousedown":mc=!0;break;case"contextmenu":case"mouseup":case"dragend":mc=!1,Kx(re,i,se);break;case"selectionchange":if(P0)break;case"keydown":case"keyup":Kx(re,i,se)}var we;if(lc)e:{switch(t){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else $r?Ax(t,i)&&(ze="onCompositionEnd"):t==="keydown"&&i.keyCode===229&&(ze="onCompositionStart");ze&&(Mx&&i.locale!=="ko"&&($r||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&$r&&(we=Sx()):(bn=se,sc="value"in bn?bn.value:bn.textContent,$r=!0)),Ne=uo(V,ze),0<Ne.length&&(ze=new Px(ze,t,null,i,se),re.push({event:ze,listeners:Ne}),we?ze.data=we:(we=Ox(i),we!==null&&(ze.data=we)))),(we=f0?g0(t,i):y0(t,i))&&(V=uo(V,"onBeforeInput"),0<V.length&&(se=new Px("onBeforeInput","beforeinput",null,i,se),re.push({event:se,listeners:V}),se.data=we))}em(re,n)})}function Wa(t,n,i){return{instance:t,listener:n,currentTarget:i}}function uo(t,n){for(var i=n+"Capture",l=[];t!==null;){var u=t,m=u.stateNode;u.tag===5&&m!==null&&(u=m,m=rt(t,i),m!=null&&l.unshift(Wa(t,m,u)),m=rt(t,n),m!=null&&l.push(Wa(t,m,u))),t=t.return}return l}function Hr(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function sm(t,n,i,l,u){for(var m=n._reactName,b=[];i!==null&&i!==l;){var T=i,A=T.alternate,V=T.stateNode;if(A!==null&&A===l)break;T.tag===5&&V!==null&&(T=V,u?(A=rt(i,m),A!=null&&b.unshift(Wa(i,A,T))):u||(A=rt(i,m),A!=null&&b.push(Wa(i,A,T)))),i=i.return}b.length!==0&&t.push({event:n,listeners:b})}var z0=/\r\n?/g,A0=/\u0000|\uFFFD/g;function nm(t){return(typeof t=="string"?t:""+t).replace(z0,`
|
|
38
|
-
`).replace(A0,"")}function xo(t,n,i){if(n=nm(n),nm(t)!==n&&i)throw Error(a(425))}function mo(){}var bc=null,vc=null;function jc(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Nc=typeof setTimeout=="function"?setTimeout:void 0,O0=typeof clearTimeout=="function"?clearTimeout:void 0,rm=typeof Promise=="function"?Promise:void 0,D0=typeof queueMicrotask=="function"?queueMicrotask:typeof rm<"u"?function(t){return rm.resolve(null).then(t).catch(I0)}:Nc;function I0(t){setTimeout(function(){throw t})}function wc(t,n){var i=n,l=0;do{var u=i.nextSibling;if(t.removeChild(i),u&&u.nodeType===8)if(i=u.data,i==="/$"){if(l===0){t.removeChild(u),Ia(n);return}l--}else i!=="$"&&i!=="$?"&&i!=="$!"||l++;i=u}while(i);Ia(n)}function jn(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return t}function am(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var i=t.data;if(i==="$"||i==="$!"||i==="$?"){if(n===0)return t;n--}else i==="/$"&&n++}t=t.previousSibling}return null}var Kr=Math.random().toString(36).slice(2),_s="__reactFiber$"+Kr,Va="__reactProps$"+Kr,Js="__reactContainer$"+Kr,kc="__reactEvents$"+Kr,F0="__reactListeners$"+Kr,L0="__reactHandles$"+Kr;function Xn(t){var n=t[_s];if(n)return n;for(var i=t.parentNode;i;){if(n=i[Js]||i[_s]){if(i=n.alternate,n.child!==null||i!==null&&i.child!==null)for(t=am(t);t!==null;){if(i=t[_s])return i;t=am(t)}return n}t=i,i=t.parentNode}return null}function Ga(t){return t=t[_s]||t[Js],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Wr(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(a(33))}function ho(t){return t[Va]||null}var Sc=[],Vr=-1;function Nn(t){return{current:t}}function et(t){0>Vr||(t.current=Sc[Vr],Sc[Vr]=null,Vr--)}function Je(t,n){Vr++,Sc[Vr]=t.current,t.current=n}var wn={},zt=Nn(wn),Wt=Nn(!1),Zn=wn;function Gr(t,n){var i=t.type.contextTypes;if(!i)return wn;var l=t.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===n)return l.__reactInternalMemoizedMaskedChildContext;var u={},m;for(m in i)u[m]=n[m];return l&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=n,t.__reactInternalMemoizedMaskedChildContext=u),u}function Vt(t){return t=t.childContextTypes,t!=null}function po(){et(Wt),et(zt)}function im(t,n,i){if(zt.current!==wn)throw Error(a(168));Je(zt,n),Je(Wt,i)}function om(t,n,i){var l=t.stateNode;if(n=n.childContextTypes,typeof l.getChildContext!="function")return i;l=l.getChildContext();for(var u in l)if(!(u in n))throw Error(a(108,Ae(t)||"Unknown",u));return L({},i,l)}function fo(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||wn,Zn=zt.current,Je(zt,t),Je(Wt,Wt.current),!0}function lm(t,n,i){var l=t.stateNode;if(!l)throw Error(a(169));i?(t=om(t,n,Zn),l.__reactInternalMemoizedMergedChildContext=t,et(Wt),et(zt),Je(zt,t)):et(Wt),Je(Wt,i)}var Ys=null,go=!1,Cc=!1;function cm(t){Ys===null?Ys=[t]:Ys.push(t)}function _0(t){go=!0,cm(t)}function kn(){if(!Cc&&Ys!==null){Cc=!0;var t=0,n=We;try{var i=Ys;for(We=1;t<i.length;t++){var l=i[t];do l=l(!0);while(l!==null)}Ys=null,go=!1}catch(u){throw Ys!==null&&(Ys=Ys.slice(t+1)),ux(Gl,kn),u}finally{We=n,Cc=!1}}return null}var Qr=[],Jr=0,yo=null,bo=0,ds=[],us=0,er=null,Xs=1,Zs="";function tr(t,n){Qr[Jr++]=bo,Qr[Jr++]=yo,yo=t,bo=n}function dm(t,n,i){ds[us++]=Xs,ds[us++]=Zs,ds[us++]=er,er=t;var l=Xs;t=Zs;var u=32-js(l)-1;l&=~(1<<u),i+=1;var m=32-js(n)+u;if(30<m){var b=u-u%5;m=(l&(1<<b)-1).toString(32),l>>=b,u-=b,Xs=1<<32-js(n)+u|i<<u|l,Zs=m+t}else Xs=1<<m|i<<u|l,Zs=t}function Ec(t){t.return!==null&&(tr(t,1),dm(t,1,0))}function Pc(t){for(;t===yo;)yo=Qr[--Jr],Qr[Jr]=null,bo=Qr[--Jr],Qr[Jr]=null;for(;t===er;)er=ds[--us],ds[us]=null,Zs=ds[--us],ds[us]=null,Xs=ds[--us],ds[us]=null}var ns=null,rs=null,tt=!1,ws=null;function um(t,n){var i=ps(5,null,null,0);i.elementType="DELETED",i.stateNode=n,i.return=t,n=t.deletions,n===null?(t.deletions=[i],t.flags|=16):n.push(i)}function xm(t,n){switch(t.tag){case 5:var i=t.type;return n=n.nodeType!==1||i.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(t.stateNode=n,ns=t,rs=jn(n.firstChild),!0):!1;case 6:return n=t.pendingProps===""||n.nodeType!==3?null:n,n!==null?(t.stateNode=n,ns=t,rs=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(i=er!==null?{id:Xs,overflow:Zs}:null,t.memoizedState={dehydrated:n,treeContext:i,retryLane:1073741824},i=ps(18,null,null,0),i.stateNode=n,i.return=t,t.child=i,ns=t,rs=null,!0):!1;default:return!1}}function Rc(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Mc(t){if(tt){var n=rs;if(n){var i=n;if(!xm(t,n)){if(Rc(t))throw Error(a(418));n=jn(i.nextSibling);var l=ns;n&&xm(t,n)?um(l,i):(t.flags=t.flags&-4097|2,tt=!1,ns=t)}}else{if(Rc(t))throw Error(a(418));t.flags=t.flags&-4097|2,tt=!1,ns=t}}}function mm(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;ns=t}function vo(t){if(t!==ns)return!1;if(!tt)return mm(t),tt=!0,!1;var n;if((n=t.tag!==3)&&!(n=t.tag!==5)&&(n=t.type,n=n!=="head"&&n!=="body"&&!jc(t.type,t.memoizedProps)),n&&(n=rs)){if(Rc(t))throw hm(),Error(a(418));for(;n;)um(t,n),n=jn(n.nextSibling)}if(mm(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));e:{for(t=t.nextSibling,n=0;t;){if(t.nodeType===8){var i=t.data;if(i==="/$"){if(n===0){rs=jn(t.nextSibling);break e}n--}else i!=="$"&&i!=="$!"&&i!=="$?"||n++}t=t.nextSibling}rs=null}}else rs=ns?jn(t.stateNode.nextSibling):null;return!0}function hm(){for(var t=rs;t;)t=jn(t.nextSibling)}function Yr(){rs=ns=null,tt=!1}function Tc(t){ws===null?ws=[t]:ws.push(t)}var U0=M.ReactCurrentBatchConfig;function Qa(t,n,i){if(t=i.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(a(309));var l=i.stateNode}if(!l)throw Error(a(147,t));var u=l,m=""+t;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===m?n.ref:(n=function(b){var T=u.refs;b===null?delete T[m]:T[m]=b},n._stringRef=m,n)}if(typeof t!="string")throw Error(a(284));if(!i._owner)throw Error(a(290,t))}return t}function jo(t,n){throw t=Object.prototype.toString.call(n),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t))}function pm(t){var n=t._init;return n(t._payload)}function fm(t){function n(U,I){if(t){var q=U.deletions;q===null?(U.deletions=[I],U.flags|=16):q.push(I)}}function i(U,I){if(!t)return null;for(;I!==null;)n(U,I),I=I.sibling;return null}function l(U,I){for(U=new Map;I!==null;)I.key!==null?U.set(I.key,I):U.set(I.index,I),I=I.sibling;return U}function u(U,I){return U=zn(U,I),U.index=0,U.sibling=null,U}function m(U,I,q){return U.index=q,t?(q=U.alternate,q!==null?(q=q.index,q<I?(U.flags|=2,I):q):(U.flags|=2,I)):(U.flags|=1048576,I)}function b(U){return t&&U.alternate===null&&(U.flags|=2),U}function T(U,I,q,ae){return I===null||I.tag!==6?(I=Nd(q,U.mode,ae),I.return=U,I):(I=u(I,q),I.return=U,I)}function A(U,I,q,ae){var ge=q.type;return ge===K?se(U,I,q.props.children,ae,q.key):I!==null&&(I.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===Re&&pm(ge)===I.type)?(ae=u(I,q.props),ae.ref=Qa(U,I,q),ae.return=U,ae):(ae=Ko(q.type,q.key,q.props,null,U.mode,ae),ae.ref=Qa(U,I,q),ae.return=U,ae)}function V(U,I,q,ae){return I===null||I.tag!==4||I.stateNode.containerInfo!==q.containerInfo||I.stateNode.implementation!==q.implementation?(I=wd(q,U.mode,ae),I.return=U,I):(I=u(I,q.children||[]),I.return=U,I)}function se(U,I,q,ae,ge){return I===null||I.tag!==7?(I=cr(q,U.mode,ae,ge),I.return=U,I):(I=u(I,q),I.return=U,I)}function re(U,I,q){if(typeof I=="string"&&I!==""||typeof I=="number")return I=Nd(""+I,U.mode,q),I.return=U,I;if(typeof I=="object"&&I!==null){switch(I.$$typeof){case w:return q=Ko(I.type,I.key,I.props,null,U.mode,q),q.ref=Qa(U,null,I),q.return=U,q;case N:return I=wd(I,U.mode,q),I.return=U,I;case Re:var ae=I._init;return re(U,ae(I._payload),q)}if(W(I)||X(I))return I=cr(I,U.mode,q,null),I.return=U,I;jo(U,I)}return null}function te(U,I,q,ae){var ge=I!==null?I.key:null;if(typeof q=="string"&&q!==""||typeof q=="number")return ge!==null?null:T(U,I,""+q,ae);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case w:return q.key===ge?A(U,I,q,ae):null;case N:return q.key===ge?V(U,I,q,ae):null;case Re:return ge=q._init,te(U,I,ge(q._payload),ae)}if(W(q)||X(q))return ge!==null?null:se(U,I,q,ae,null);jo(U,q)}return null}function de(U,I,q,ae,ge){if(typeof ae=="string"&&ae!==""||typeof ae=="number")return U=U.get(q)||null,T(I,U,""+ae,ge);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case w:return U=U.get(ae.key===null?q:ae.key)||null,A(I,U,ae,ge);case N:return U=U.get(ae.key===null?q:ae.key)||null,V(I,U,ae,ge);case Re:var Ne=ae._init;return de(U,I,q,Ne(ae._payload),ge)}if(W(ae)||X(ae))return U=U.get(q)||null,se(I,U,ae,ge,null);jo(I,ae)}return null}function pe(U,I,q,ae){for(var ge=null,Ne=null,we=I,ze=I=0,Nt=null;we!==null&&ze<q.length;ze++){we.index>ze?(Nt=we,we=null):Nt=we.sibling;var qe=te(U,we,q[ze],ae);if(qe===null){we===null&&(we=Nt);break}t&&we&&qe.alternate===null&&n(U,we),I=m(qe,I,ze),Ne===null?ge=qe:Ne.sibling=qe,Ne=qe,we=Nt}if(ze===q.length)return i(U,we),tt&&tr(U,ze),ge;if(we===null){for(;ze<q.length;ze++)we=re(U,q[ze],ae),we!==null&&(I=m(we,I,ze),Ne===null?ge=we:Ne.sibling=we,Ne=we);return tt&&tr(U,ze),ge}for(we=l(U,we);ze<q.length;ze++)Nt=de(we,U,ze,q[ze],ae),Nt!==null&&(t&&Nt.alternate!==null&&we.delete(Nt.key===null?ze:Nt.key),I=m(Nt,I,ze),Ne===null?ge=Nt:Ne.sibling=Nt,Ne=Nt);return t&&we.forEach(function(An){return n(U,An)}),tt&&tr(U,ze),ge}function fe(U,I,q,ae){var ge=X(q);if(typeof ge!="function")throw Error(a(150));if(q=ge.call(q),q==null)throw Error(a(151));for(var Ne=ge=null,we=I,ze=I=0,Nt=null,qe=q.next();we!==null&&!qe.done;ze++,qe=q.next()){we.index>ze?(Nt=we,we=null):Nt=we.sibling;var An=te(U,we,qe.value,ae);if(An===null){we===null&&(we=Nt);break}t&&we&&An.alternate===null&&n(U,we),I=m(An,I,ze),Ne===null?ge=An:Ne.sibling=An,Ne=An,we=Nt}if(qe.done)return i(U,we),tt&&tr(U,ze),ge;if(we===null){for(;!qe.done;ze++,qe=q.next())qe=re(U,qe.value,ae),qe!==null&&(I=m(qe,I,ze),Ne===null?ge=qe:Ne.sibling=qe,Ne=qe);return tt&&tr(U,ze),ge}for(we=l(U,we);!qe.done;ze++,qe=q.next())qe=de(we,U,ze,qe.value,ae),qe!==null&&(t&&qe.alternate!==null&&we.delete(qe.key===null?ze:qe.key),I=m(qe,I,ze),Ne===null?ge=qe:Ne.sibling=qe,Ne=qe);return t&&we.forEach(function(by){return n(U,by)}),tt&&tr(U,ze),ge}function lt(U,I,q,ae){if(typeof q=="object"&&q!==null&&q.type===K&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case w:e:{for(var ge=q.key,Ne=I;Ne!==null;){if(Ne.key===ge){if(ge=q.type,ge===K){if(Ne.tag===7){i(U,Ne.sibling),I=u(Ne,q.props.children),I.return=U,U=I;break e}}else if(Ne.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===Re&&pm(ge)===Ne.type){i(U,Ne.sibling),I=u(Ne,q.props),I.ref=Qa(U,Ne,q),I.return=U,U=I;break e}i(U,Ne);break}else n(U,Ne);Ne=Ne.sibling}q.type===K?(I=cr(q.props.children,U.mode,ae,q.key),I.return=U,U=I):(ae=Ko(q.type,q.key,q.props,null,U.mode,ae),ae.ref=Qa(U,I,q),ae.return=U,U=ae)}return b(U);case N:e:{for(Ne=q.key;I!==null;){if(I.key===Ne)if(I.tag===4&&I.stateNode.containerInfo===q.containerInfo&&I.stateNode.implementation===q.implementation){i(U,I.sibling),I=u(I,q.children||[]),I.return=U,U=I;break e}else{i(U,I);break}else n(U,I);I=I.sibling}I=wd(q,U.mode,ae),I.return=U,U=I}return b(U);case Re:return Ne=q._init,lt(U,I,Ne(q._payload),ae)}if(W(q))return pe(U,I,q,ae);if(X(q))return fe(U,I,q,ae);jo(U,q)}return typeof q=="string"&&q!==""||typeof q=="number"?(q=""+q,I!==null&&I.tag===6?(i(U,I.sibling),I=u(I,q),I.return=U,U=I):(i(U,I),I=Nd(q,U.mode,ae),I.return=U,U=I),b(U)):i(U,I)}return lt}var Xr=fm(!0),gm=fm(!1),No=Nn(null),wo=null,Zr=null,zc=null;function Ac(){zc=Zr=wo=null}function Oc(t){var n=No.current;et(No),t._currentValue=n}function Dc(t,n,i){for(;t!==null;){var l=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),t===i)break;t=t.return}}function ea(t,n){wo=t,zc=Zr=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&n)!==0&&(Gt=!0),t.firstContext=null)}function xs(t){var n=t._currentValue;if(zc!==t)if(t={context:t,memoizedValue:n,next:null},Zr===null){if(wo===null)throw Error(a(308));Zr=t,wo.dependencies={lanes:0,firstContext:t}}else Zr=Zr.next=t;return n}var sr=null;function Ic(t){sr===null?sr=[t]:sr.push(t)}function ym(t,n,i,l){var u=n.interleaved;return u===null?(i.next=i,Ic(n)):(i.next=u.next,u.next=i),n.interleaved=i,en(t,l)}function en(t,n){t.lanes|=n;var i=t.alternate;for(i!==null&&(i.lanes|=n),i=t,t=t.return;t!==null;)t.childLanes|=n,i=t.alternate,i!==null&&(i.childLanes|=n),i=t,t=t.return;return i.tag===3?i.stateNode:null}var Sn=!1;function Fc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function bm(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function tn(t,n){return{eventTime:t,lane:n,tag:0,payload:null,callback:null,next:null}}function Cn(t,n,i){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(Be&2)!==0){var u=l.pending;return u===null?n.next=n:(n.next=u.next,u.next=n),l.pending=n,en(t,i)}return u=l.interleaved,u===null?(n.next=n,Ic(l)):(n.next=u.next,u.next=n),l.interleaved=n,en(t,i)}function ko(t,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194240)!==0)){var l=n.lanes;l&=t.pendingLanes,i|=l,n.lanes=i,Yl(t,i)}}function vm(t,n){var i=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var u=null,m=null;if(i=i.firstBaseUpdate,i!==null){do{var b={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};m===null?u=m=b:m=m.next=b,i=i.next}while(i!==null);m===null?u=m=n:m=m.next=n}else u=m=n;i={baseState:l.baseState,firstBaseUpdate:u,lastBaseUpdate:m,shared:l.shared,effects:l.effects},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=n:t.next=n,i.lastBaseUpdate=n}function So(t,n,i,l){var u=t.updateQueue;Sn=!1;var m=u.firstBaseUpdate,b=u.lastBaseUpdate,T=u.shared.pending;if(T!==null){u.shared.pending=null;var A=T,V=A.next;A.next=null,b===null?m=V:b.next=V,b=A;var se=t.alternate;se!==null&&(se=se.updateQueue,T=se.lastBaseUpdate,T!==b&&(T===null?se.firstBaseUpdate=V:T.next=V,se.lastBaseUpdate=A))}if(m!==null){var re=u.baseState;b=0,se=V=A=null,T=m;do{var te=T.lane,de=T.eventTime;if((l&te)===te){se!==null&&(se=se.next={eventTime:de,lane:0,tag:T.tag,payload:T.payload,callback:T.callback,next:null});e:{var pe=t,fe=T;switch(te=n,de=i,fe.tag){case 1:if(pe=fe.payload,typeof pe=="function"){re=pe.call(de,re,te);break e}re=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=fe.payload,te=typeof pe=="function"?pe.call(de,re,te):pe,te==null)break e;re=L({},re,te);break e;case 2:Sn=!0}}T.callback!==null&&T.lane!==0&&(t.flags|=64,te=u.effects,te===null?u.effects=[T]:te.push(T))}else de={eventTime:de,lane:te,tag:T.tag,payload:T.payload,callback:T.callback,next:null},se===null?(V=se=de,A=re):se=se.next=de,b|=te;if(T=T.next,T===null){if(T=u.shared.pending,T===null)break;te=T,T=te.next,te.next=null,u.lastBaseUpdate=te,u.shared.pending=null}}while(!0);if(se===null&&(A=re),u.baseState=A,u.firstBaseUpdate=V,u.lastBaseUpdate=se,n=u.shared.interleaved,n!==null){u=n;do b|=u.lane,u=u.next;while(u!==n)}else m===null&&(u.shared.lanes=0);ar|=b,t.lanes=b,t.memoizedState=re}}function jm(t,n,i){if(t=n.effects,n.effects=null,t!==null)for(n=0;n<t.length;n++){var l=t[n],u=l.callback;if(u!==null){if(l.callback=null,l=i,typeof u!="function")throw Error(a(191,u));u.call(l)}}}var Ja={},Us=Nn(Ja),Ya=Nn(Ja),Xa=Nn(Ja);function nr(t){if(t===Ja)throw Error(a(174));return t}function Lc(t,n){switch(Je(Xa,n),Je(Ya,t),Je(Us,Ja),t=n.nodeType,t){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:mt(null,"");break;default:t=t===8?n.parentNode:n,n=t.namespaceURI||null,t=t.tagName,n=mt(n,t)}et(Us),Je(Us,n)}function ta(){et(Us),et(Ya),et(Xa)}function Nm(t){nr(Xa.current);var n=nr(Us.current),i=mt(n,t.type);n!==i&&(Je(Ya,t),Je(Us,i))}function _c(t){Ya.current===t&&(et(Us),et(Ya))}var st=Nn(0);function Co(t){for(var n=t;n!==null;){if(n.tag===13){var i=n.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Uc=[];function $c(){for(var t=0;t<Uc.length;t++)Uc[t]._workInProgressVersionPrimary=null;Uc.length=0}var Eo=M.ReactCurrentDispatcher,Bc=M.ReactCurrentBatchConfig,rr=0,nt=null,ht=null,vt=null,Po=!1,Za=!1,ei=0,$0=0;function At(){throw Error(a(321))}function qc(t,n){if(n===null)return!1;for(var i=0;i<n.length&&i<t.length;i++)if(!Ns(t[i],n[i]))return!1;return!0}function Hc(t,n,i,l,u,m){if(rr=m,nt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,Eo.current=t===null||t.memoizedState===null?K0:W0,t=i(l,u),Za){m=0;do{if(Za=!1,ei=0,25<=m)throw Error(a(301));m+=1,vt=ht=null,n.updateQueue=null,Eo.current=V0,t=i(l,u)}while(Za)}if(Eo.current=To,n=ht!==null&&ht.next!==null,rr=0,vt=ht=nt=null,Po=!1,n)throw Error(a(300));return t}function Kc(){var t=ei!==0;return ei=0,t}function $s(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vt===null?nt.memoizedState=vt=t:vt=vt.next=t,vt}function ms(){if(ht===null){var t=nt.alternate;t=t!==null?t.memoizedState:null}else t=ht.next;var n=vt===null?nt.memoizedState:vt.next;if(n!==null)vt=n,ht=t;else{if(t===null)throw Error(a(310));ht=t,t={memoizedState:ht.memoizedState,baseState:ht.baseState,baseQueue:ht.baseQueue,queue:ht.queue,next:null},vt===null?nt.memoizedState=vt=t:vt=vt.next=t}return vt}function ti(t,n){return typeof n=="function"?n(t):n}function Wc(t){var n=ms(),i=n.queue;if(i===null)throw Error(a(311));i.lastRenderedReducer=t;var l=ht,u=l.baseQueue,m=i.pending;if(m!==null){if(u!==null){var b=u.next;u.next=m.next,m.next=b}l.baseQueue=u=m,i.pending=null}if(u!==null){m=u.next,l=l.baseState;var T=b=null,A=null,V=m;do{var se=V.lane;if((rr&se)===se)A!==null&&(A=A.next={lane:0,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),l=V.hasEagerState?V.eagerState:t(l,V.action);else{var re={lane:se,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null};A===null?(T=A=re,b=l):A=A.next=re,nt.lanes|=se,ar|=se}V=V.next}while(V!==null&&V!==m);A===null?b=l:A.next=T,Ns(l,n.memoizedState)||(Gt=!0),n.memoizedState=l,n.baseState=b,n.baseQueue=A,i.lastRenderedState=l}if(t=i.interleaved,t!==null){u=t;do m=u.lane,nt.lanes|=m,ar|=m,u=u.next;while(u!==t)}else u===null&&(i.lanes=0);return[n.memoizedState,i.dispatch]}function Vc(t){var n=ms(),i=n.queue;if(i===null)throw Error(a(311));i.lastRenderedReducer=t;var l=i.dispatch,u=i.pending,m=n.memoizedState;if(u!==null){i.pending=null;var b=u=u.next;do m=t(m,b.action),b=b.next;while(b!==u);Ns(m,n.memoizedState)||(Gt=!0),n.memoizedState=m,n.baseQueue===null&&(n.baseState=m),i.lastRenderedState=m}return[m,l]}function wm(){}function km(t,n){var i=nt,l=ms(),u=n(),m=!Ns(l.memoizedState,u);if(m&&(l.memoizedState=u,Gt=!0),l=l.queue,Gc(Em.bind(null,i,l,t),[t]),l.getSnapshot!==n||m||vt!==null&&vt.memoizedState.tag&1){if(i.flags|=2048,si(9,Cm.bind(null,i,l,u,n),void 0,null),jt===null)throw Error(a(349));(rr&30)!==0||Sm(i,n,u)}return u}function Sm(t,n,i){t.flags|=16384,t={getSnapshot:n,value:i},n=nt.updateQueue,n===null?(n={lastEffect:null,stores:null},nt.updateQueue=n,n.stores=[t]):(i=n.stores,i===null?n.stores=[t]:i.push(t))}function Cm(t,n,i,l){n.value=i,n.getSnapshot=l,Pm(n)&&Rm(t)}function Em(t,n,i){return i(function(){Pm(n)&&Rm(t)})}function Pm(t){var n=t.getSnapshot;t=t.value;try{var i=n();return!Ns(t,i)}catch{return!0}}function Rm(t){var n=en(t,1);n!==null&&Es(n,t,1,-1)}function Mm(t){var n=$s();return typeof t=="function"&&(t=t()),n.memoizedState=n.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ti,lastRenderedState:t},n.queue=t,t=t.dispatch=H0.bind(null,nt,t),[n.memoizedState,t]}function si(t,n,i,l){return t={tag:t,create:n,destroy:i,deps:l,next:null},n=nt.updateQueue,n===null?(n={lastEffect:null,stores:null},nt.updateQueue=n,n.lastEffect=t.next=t):(i=n.lastEffect,i===null?n.lastEffect=t.next=t:(l=i.next,i.next=t,t.next=l,n.lastEffect=t)),t}function Tm(){return ms().memoizedState}function Ro(t,n,i,l){var u=$s();nt.flags|=t,u.memoizedState=si(1|n,i,void 0,l===void 0?null:l)}function Mo(t,n,i,l){var u=ms();l=l===void 0?null:l;var m=void 0;if(ht!==null){var b=ht.memoizedState;if(m=b.destroy,l!==null&&qc(l,b.deps)){u.memoizedState=si(n,i,m,l);return}}nt.flags|=t,u.memoizedState=si(1|n,i,m,l)}function zm(t,n){return Ro(8390656,8,t,n)}function Gc(t,n){return Mo(2048,8,t,n)}function Am(t,n){return Mo(4,2,t,n)}function Om(t,n){return Mo(4,4,t,n)}function Dm(t,n){if(typeof n=="function")return t=t(),n(t),function(){n(null)};if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function Im(t,n,i){return i=i!=null?i.concat([t]):null,Mo(4,4,Dm.bind(null,n,t),i)}function Qc(){}function Fm(t,n){var i=ms();n=n===void 0?null:n;var l=i.memoizedState;return l!==null&&n!==null&&qc(n,l[1])?l[0]:(i.memoizedState=[t,n],t)}function Lm(t,n){var i=ms();n=n===void 0?null:n;var l=i.memoizedState;return l!==null&&n!==null&&qc(n,l[1])?l[0]:(t=t(),i.memoizedState=[t,n],t)}function _m(t,n,i){return(rr&21)===0?(t.baseState&&(t.baseState=!1,Gt=!0),t.memoizedState=i):(Ns(i,n)||(i=px(),nt.lanes|=i,ar|=i,t.baseState=!0),n)}function B0(t,n){var i=We;We=i!==0&&4>i?i:4,t(!0);var l=Bc.transition;Bc.transition={};try{t(!1),n()}finally{We=i,Bc.transition=l}}function Um(){return ms().memoizedState}function q0(t,n,i){var l=Mn(t);if(i={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null},$m(t))Bm(n,i);else if(i=ym(t,n,i,l),i!==null){var u=_t();Es(i,t,l,u),qm(i,n,l)}}function H0(t,n,i){var l=Mn(t),u={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null};if($m(t))Bm(n,u);else{var m=t.alternate;if(t.lanes===0&&(m===null||m.lanes===0)&&(m=n.lastRenderedReducer,m!==null))try{var b=n.lastRenderedState,T=m(b,i);if(u.hasEagerState=!0,u.eagerState=T,Ns(T,b)){var A=n.interleaved;A===null?(u.next=u,Ic(n)):(u.next=A.next,A.next=u),n.interleaved=u;return}}catch{}i=ym(t,n,u,l),i!==null&&(u=_t(),Es(i,t,l,u),qm(i,n,l))}}function $m(t){var n=t.alternate;return t===nt||n!==null&&n===nt}function Bm(t,n){Za=Po=!0;var i=t.pending;i===null?n.next=n:(n.next=i.next,i.next=n),t.pending=n}function qm(t,n,i){if((i&4194240)!==0){var l=n.lanes;l&=t.pendingLanes,i|=l,n.lanes=i,Yl(t,i)}}var To={readContext:xs,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useInsertionEffect:At,useLayoutEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useMutableSource:At,useSyncExternalStore:At,useId:At,unstable_isNewReconciler:!1},K0={readContext:xs,useCallback:function(t,n){return $s().memoizedState=[t,n===void 0?null:n],t},useContext:xs,useEffect:zm,useImperativeHandle:function(t,n,i){return i=i!=null?i.concat([t]):null,Ro(4194308,4,Dm.bind(null,n,t),i)},useLayoutEffect:function(t,n){return Ro(4194308,4,t,n)},useInsertionEffect:function(t,n){return Ro(4,2,t,n)},useMemo:function(t,n){var i=$s();return n=n===void 0?null:n,t=t(),i.memoizedState=[t,n],t},useReducer:function(t,n,i){var l=$s();return n=i!==void 0?i(n):n,l.memoizedState=l.baseState=n,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:n},l.queue=t,t=t.dispatch=q0.bind(null,nt,t),[l.memoizedState,t]},useRef:function(t){var n=$s();return t={current:t},n.memoizedState=t},useState:Mm,useDebugValue:Qc,useDeferredValue:function(t){return $s().memoizedState=t},useTransition:function(){var t=Mm(!1),n=t[0];return t=B0.bind(null,t[1]),$s().memoizedState=t,[n,t]},useMutableSource:function(){},useSyncExternalStore:function(t,n,i){var l=nt,u=$s();if(tt){if(i===void 0)throw Error(a(407));i=i()}else{if(i=n(),jt===null)throw Error(a(349));(rr&30)!==0||Sm(l,n,i)}u.memoizedState=i;var m={value:i,getSnapshot:n};return u.queue=m,zm(Em.bind(null,l,m,t),[t]),l.flags|=2048,si(9,Cm.bind(null,l,m,i,n),void 0,null),i},useId:function(){var t=$s(),n=jt.identifierPrefix;if(tt){var i=Zs,l=Xs;i=(l&~(1<<32-js(l)-1)).toString(32)+i,n=":"+n+"R"+i,i=ei++,0<i&&(n+="H"+i.toString(32)),n+=":"}else i=$0++,n=":"+n+"r"+i.toString(32)+":";return t.memoizedState=n},unstable_isNewReconciler:!1},W0={readContext:xs,useCallback:Fm,useContext:xs,useEffect:Gc,useImperativeHandle:Im,useInsertionEffect:Am,useLayoutEffect:Om,useMemo:Lm,useReducer:Wc,useRef:Tm,useState:function(){return Wc(ti)},useDebugValue:Qc,useDeferredValue:function(t){var n=ms();return _m(n,ht.memoizedState,t)},useTransition:function(){var t=Wc(ti)[0],n=ms().memoizedState;return[t,n]},useMutableSource:wm,useSyncExternalStore:km,useId:Um,unstable_isNewReconciler:!1},V0={readContext:xs,useCallback:Fm,useContext:xs,useEffect:Gc,useImperativeHandle:Im,useInsertionEffect:Am,useLayoutEffect:Om,useMemo:Lm,useReducer:Vc,useRef:Tm,useState:function(){return Vc(ti)},useDebugValue:Qc,useDeferredValue:function(t){var n=ms();return ht===null?n.memoizedState=t:_m(n,ht.memoizedState,t)},useTransition:function(){var t=Vc(ti)[0],n=ms().memoizedState;return[t,n]},useMutableSource:wm,useSyncExternalStore:km,useId:Um,unstable_isNewReconciler:!1};function ks(t,n){if(t&&t.defaultProps){n=L({},n),t=t.defaultProps;for(var i in t)n[i]===void 0&&(n[i]=t[i]);return n}return n}function Jc(t,n,i,l){n=t.memoizedState,i=i(l,n),i=i==null?n:L({},n,i),t.memoizedState=i,t.lanes===0&&(t.updateQueue.baseState=i)}var zo={isMounted:function(t){return(t=t._reactInternals)?J(t)===t:!1},enqueueSetState:function(t,n,i){t=t._reactInternals;var l=_t(),u=Mn(t),m=tn(l,u);m.payload=n,i!=null&&(m.callback=i),n=Cn(t,m,u),n!==null&&(Es(n,t,u,l),ko(n,t,u))},enqueueReplaceState:function(t,n,i){t=t._reactInternals;var l=_t(),u=Mn(t),m=tn(l,u);m.tag=1,m.payload=n,i!=null&&(m.callback=i),n=Cn(t,m,u),n!==null&&(Es(n,t,u,l),ko(n,t,u))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var i=_t(),l=Mn(t),u=tn(i,l);u.tag=2,n!=null&&(u.callback=n),n=Cn(t,u,l),n!==null&&(Es(n,t,l,i),ko(n,t,l))}};function Hm(t,n,i,l,u,m,b){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,m,b):n.prototype&&n.prototype.isPureReactComponent?!Ba(i,l)||!Ba(u,m):!0}function Km(t,n,i){var l=!1,u=wn,m=n.contextType;return typeof m=="object"&&m!==null?m=xs(m):(u=Vt(n)?Zn:zt.current,l=n.contextTypes,m=(l=l!=null)?Gr(t,u):wn),n=new n(i,m),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=zo,t.stateNode=n,n._reactInternals=t,l&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=u,t.__reactInternalMemoizedMaskedChildContext=m),n}function Wm(t,n,i,l){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(i,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(i,l),n.state!==t&&zo.enqueueReplaceState(n,n.state,null)}function Yc(t,n,i,l){var u=t.stateNode;u.props=i,u.state=t.memoizedState,u.refs={},Fc(t);var m=n.contextType;typeof m=="object"&&m!==null?u.context=xs(m):(m=Vt(n)?Zn:zt.current,u.context=Gr(t,m)),u.state=t.memoizedState,m=n.getDerivedStateFromProps,typeof m=="function"&&(Jc(t,n,m,i),u.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(n=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),n!==u.state&&zo.enqueueReplaceState(u,u.state,null),So(t,i,u,l),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308)}function sa(t,n){try{var i="",l=n;do i+=ue(l),l=l.return;while(l);var u=i}catch(m){u=`
|
|
39
|
-
Error generating stack: `+m.message+`
|
|
40
|
-
`+m.stack}return{value:t,source:n,stack:u,digest:null}}function Xc(t,n,i){return{value:t,source:null,stack:i??null,digest:n??null}}function Zc(t,n){try{console.error(n.value)}catch(i){setTimeout(function(){throw i})}}var G0=typeof WeakMap=="function"?WeakMap:Map;function Vm(t,n,i){i=tn(-1,i),i.tag=3,i.payload={element:null};var l=n.value;return i.callback=function(){_o||(_o=!0,hd=l),Zc(t,n)},i}function Gm(t,n,i){i=tn(-1,i),i.tag=3;var l=t.type.getDerivedStateFromError;if(typeof l=="function"){var u=n.value;i.payload=function(){return l(u)},i.callback=function(){Zc(t,n)}}var m=t.stateNode;return m!==null&&typeof m.componentDidCatch=="function"&&(i.callback=function(){Zc(t,n),typeof l!="function"&&(Pn===null?Pn=new Set([this]):Pn.add(this));var b=n.stack;this.componentDidCatch(n.value,{componentStack:b!==null?b:""})}),i}function Qm(t,n,i){var l=t.pingCache;if(l===null){l=t.pingCache=new G0;var u=new Set;l.set(n,u)}else u=l.get(n),u===void 0&&(u=new Set,l.set(n,u));u.has(i)||(u.add(i),t=ly.bind(null,t,n,i),n.then(t,t))}function Jm(t){do{var n;if((n=t.tag===13)&&(n=t.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return t;t=t.return}while(t!==null);return null}function Ym(t,n,i,l,u){return(t.mode&1)===0?(t===n?t.flags|=65536:(t.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(n=tn(-1,1),n.tag=2,Cn(i,n,1))),i.lanes|=1),t):(t.flags|=65536,t.lanes=u,t)}var Q0=M.ReactCurrentOwner,Gt=!1;function Lt(t,n,i,l){n.child=t===null?gm(n,null,i,l):Xr(n,t.child,i,l)}function Xm(t,n,i,l,u){i=i.render;var m=n.ref;return ea(n,u),l=Hc(t,n,i,l,m,u),i=Kc(),t!==null&&!Gt?(n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~u,sn(t,n,u)):(tt&&i&&Ec(n),n.flags|=1,Lt(t,n,l,u),n.child)}function Zm(t,n,i,l,u){if(t===null){var m=i.type;return typeof m=="function"&&!jd(m)&&m.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(n.tag=15,n.type=m,eh(t,n,m,l,u)):(t=Ko(i.type,null,l,n,n.mode,u),t.ref=n.ref,t.return=n,n.child=t)}if(m=t.child,(t.lanes&u)===0){var b=m.memoizedProps;if(i=i.compare,i=i!==null?i:Ba,i(b,l)&&t.ref===n.ref)return sn(t,n,u)}return n.flags|=1,t=zn(m,l),t.ref=n.ref,t.return=n,n.child=t}function eh(t,n,i,l,u){if(t!==null){var m=t.memoizedProps;if(Ba(m,l)&&t.ref===n.ref)if(Gt=!1,n.pendingProps=l=m,(t.lanes&u)!==0)(t.flags&131072)!==0&&(Gt=!0);else return n.lanes=t.lanes,sn(t,n,u)}return ed(t,n,i,l,u)}function th(t,n,i){var l=n.pendingProps,u=l.children,m=t!==null?t.memoizedState:null;if(l.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},Je(ra,as),as|=i;else{if((i&1073741824)===0)return t=m!==null?m.baseLanes|i:i,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:t,cachePool:null,transitions:null},n.updateQueue=null,Je(ra,as),as|=t,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=m!==null?m.baseLanes:i,Je(ra,as),as|=l}else m!==null?(l=m.baseLanes|i,n.memoizedState=null):l=i,Je(ra,as),as|=l;return Lt(t,n,u,i),n.child}function sh(t,n){var i=n.ref;(t===null&&i!==null||t!==null&&t.ref!==i)&&(n.flags|=512,n.flags|=2097152)}function ed(t,n,i,l,u){var m=Vt(i)?Zn:zt.current;return m=Gr(n,m),ea(n,u),i=Hc(t,n,i,l,m,u),l=Kc(),t!==null&&!Gt?(n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~u,sn(t,n,u)):(tt&&l&&Ec(n),n.flags|=1,Lt(t,n,i,u),n.child)}function nh(t,n,i,l,u){if(Vt(i)){var m=!0;fo(n)}else m=!1;if(ea(n,u),n.stateNode===null)Oo(t,n),Km(n,i,l),Yc(n,i,l,u),l=!0;else if(t===null){var b=n.stateNode,T=n.memoizedProps;b.props=T;var A=b.context,V=i.contextType;typeof V=="object"&&V!==null?V=xs(V):(V=Vt(i)?Zn:zt.current,V=Gr(n,V));var se=i.getDerivedStateFromProps,re=typeof se=="function"||typeof b.getSnapshotBeforeUpdate=="function";re||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(T!==l||A!==V)&&Wm(n,b,l,V),Sn=!1;var te=n.memoizedState;b.state=te,So(n,l,b,u),A=n.memoizedState,T!==l||te!==A||Wt.current||Sn?(typeof se=="function"&&(Jc(n,i,se,l),A=n.memoizedState),(T=Sn||Hm(n,i,T,l,te,A,V))?(re||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(n.flags|=4194308)):(typeof b.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=l,n.memoizedState=A),b.props=l,b.state=A,b.context=V,l=T):(typeof b.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{b=n.stateNode,bm(t,n),T=n.memoizedProps,V=n.type===n.elementType?T:ks(n.type,T),b.props=V,re=n.pendingProps,te=b.context,A=i.contextType,typeof A=="object"&&A!==null?A=xs(A):(A=Vt(i)?Zn:zt.current,A=Gr(n,A));var de=i.getDerivedStateFromProps;(se=typeof de=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(T!==re||te!==A)&&Wm(n,b,l,A),Sn=!1,te=n.memoizedState,b.state=te,So(n,l,b,u);var pe=n.memoizedState;T!==re||te!==pe||Wt.current||Sn?(typeof de=="function"&&(Jc(n,i,de,l),pe=n.memoizedState),(V=Sn||Hm(n,i,V,l,te,pe,A)||!1)?(se||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(l,pe,A),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(l,pe,A)),typeof b.componentDidUpdate=="function"&&(n.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof b.componentDidUpdate!="function"||T===t.memoizedProps&&te===t.memoizedState||(n.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||T===t.memoizedProps&&te===t.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=pe),b.props=l,b.state=pe,b.context=A,l=V):(typeof b.componentDidUpdate!="function"||T===t.memoizedProps&&te===t.memoizedState||(n.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||T===t.memoizedProps&&te===t.memoizedState||(n.flags|=1024),l=!1)}return td(t,n,i,l,m,u)}function td(t,n,i,l,u,m){sh(t,n);var b=(n.flags&128)!==0;if(!l&&!b)return u&&lm(n,i,!1),sn(t,n,m);l=n.stateNode,Q0.current=n;var T=b&&typeof i.getDerivedStateFromError!="function"?null:l.render();return n.flags|=1,t!==null&&b?(n.child=Xr(n,t.child,null,m),n.child=Xr(n,null,T,m)):Lt(t,n,T,m),n.memoizedState=l.state,u&&lm(n,i,!0),n.child}function rh(t){var n=t.stateNode;n.pendingContext?im(t,n.pendingContext,n.pendingContext!==n.context):n.context&&im(t,n.context,!1),Lc(t,n.containerInfo)}function ah(t,n,i,l,u){return Yr(),Tc(u),n.flags|=256,Lt(t,n,i,l),n.child}var sd={dehydrated:null,treeContext:null,retryLane:0};function nd(t){return{baseLanes:t,cachePool:null,transitions:null}}function ih(t,n,i){var l=n.pendingProps,u=st.current,m=!1,b=(n.flags&128)!==0,T;if((T=b)||(T=t!==null&&t.memoizedState===null?!1:(u&2)!==0),T?(m=!0,n.flags&=-129):(t===null||t.memoizedState!==null)&&(u|=1),Je(st,u&1),t===null)return Mc(n),t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((n.mode&1)===0?n.lanes=1:t.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(b=l.children,t=l.fallback,m?(l=n.mode,m=n.child,b={mode:"hidden",children:b},(l&1)===0&&m!==null?(m.childLanes=0,m.pendingProps=b):m=Wo(b,l,0,null),t=cr(t,l,i,null),m.return=n,t.return=n,m.sibling=t,n.child=m,n.child.memoizedState=nd(i),n.memoizedState=sd,t):rd(n,b));if(u=t.memoizedState,u!==null&&(T=u.dehydrated,T!==null))return J0(t,n,b,l,T,u,i);if(m){m=l.fallback,b=n.mode,u=t.child,T=u.sibling;var A={mode:"hidden",children:l.children};return(b&1)===0&&n.child!==u?(l=n.child,l.childLanes=0,l.pendingProps=A,n.deletions=null):(l=zn(u,A),l.subtreeFlags=u.subtreeFlags&14680064),T!==null?m=zn(T,m):(m=cr(m,b,i,null),m.flags|=2),m.return=n,l.return=n,l.sibling=m,n.child=l,l=m,m=n.child,b=t.child.memoizedState,b=b===null?nd(i):{baseLanes:b.baseLanes|i,cachePool:null,transitions:b.transitions},m.memoizedState=b,m.childLanes=t.childLanes&~i,n.memoizedState=sd,l}return m=t.child,t=m.sibling,l=zn(m,{mode:"visible",children:l.children}),(n.mode&1)===0&&(l.lanes=i),l.return=n,l.sibling=null,t!==null&&(i=n.deletions,i===null?(n.deletions=[t],n.flags|=16):i.push(t)),n.child=l,n.memoizedState=null,l}function rd(t,n){return n=Wo({mode:"visible",children:n},t.mode,0,null),n.return=t,t.child=n}function Ao(t,n,i,l){return l!==null&&Tc(l),Xr(n,t.child,null,i),t=rd(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function J0(t,n,i,l,u,m,b){if(i)return n.flags&256?(n.flags&=-257,l=Xc(Error(a(422))),Ao(t,n,b,l)):n.memoizedState!==null?(n.child=t.child,n.flags|=128,null):(m=l.fallback,u=n.mode,l=Wo({mode:"visible",children:l.children},u,0,null),m=cr(m,u,b,null),m.flags|=2,l.return=n,m.return=n,l.sibling=m,n.child=l,(n.mode&1)!==0&&Xr(n,t.child,null,b),n.child.memoizedState=nd(b),n.memoizedState=sd,m);if((n.mode&1)===0)return Ao(t,n,b,null);if(u.data==="$!"){if(l=u.nextSibling&&u.nextSibling.dataset,l)var T=l.dgst;return l=T,m=Error(a(419)),l=Xc(m,l,void 0),Ao(t,n,b,l)}if(T=(b&t.childLanes)!==0,Gt||T){if(l=jt,l!==null){switch(b&-b){case 4:u=2;break;case 16:u=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:u=32;break;case 536870912:u=268435456;break;default:u=0}u=(u&(l.suspendedLanes|b))!==0?0:u,u!==0&&u!==m.retryLane&&(m.retryLane=u,en(t,u),Es(l,t,u,-1))}return vd(),l=Xc(Error(a(421))),Ao(t,n,b,l)}return u.data==="$?"?(n.flags|=128,n.child=t.child,n=cy.bind(null,t),u._reactRetry=n,null):(t=m.treeContext,rs=jn(u.nextSibling),ns=n,tt=!0,ws=null,t!==null&&(ds[us++]=Xs,ds[us++]=Zs,ds[us++]=er,Xs=t.id,Zs=t.overflow,er=n),n=rd(n,l.children),n.flags|=4096,n)}function oh(t,n,i){t.lanes|=n;var l=t.alternate;l!==null&&(l.lanes|=n),Dc(t.return,n,i)}function ad(t,n,i,l,u){var m=t.memoizedState;m===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:u}:(m.isBackwards=n,m.rendering=null,m.renderingStartTime=0,m.last=l,m.tail=i,m.tailMode=u)}function lh(t,n,i){var l=n.pendingProps,u=l.revealOrder,m=l.tail;if(Lt(t,n,l.children,i),l=st.current,(l&2)!==0)l=l&1|2,n.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&oh(t,i,n);else if(t.tag===19)oh(t,i,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}l&=1}if(Je(st,l),(n.mode&1)===0)n.memoizedState=null;else switch(u){case"forwards":for(i=n.child,u=null;i!==null;)t=i.alternate,t!==null&&Co(t)===null&&(u=i),i=i.sibling;i=u,i===null?(u=n.child,n.child=null):(u=i.sibling,i.sibling=null),ad(n,!1,u,i,m);break;case"backwards":for(i=null,u=n.child,n.child=null;u!==null;){if(t=u.alternate,t!==null&&Co(t)===null){n.child=u;break}t=u.sibling,u.sibling=i,i=u,u=t}ad(n,!0,i,null,m);break;case"together":ad(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function Oo(t,n){(n.mode&1)===0&&t!==null&&(t.alternate=null,n.alternate=null,n.flags|=2)}function sn(t,n,i){if(t!==null&&(n.dependencies=t.dependencies),ar|=n.lanes,(i&n.childLanes)===0)return null;if(t!==null&&n.child!==t.child)throw Error(a(153));if(n.child!==null){for(t=n.child,i=zn(t,t.pendingProps),n.child=i,i.return=n;t.sibling!==null;)t=t.sibling,i=i.sibling=zn(t,t.pendingProps),i.return=n;i.sibling=null}return n.child}function Y0(t,n,i){switch(n.tag){case 3:rh(n),Yr();break;case 5:Nm(n);break;case 1:Vt(n.type)&&fo(n);break;case 4:Lc(n,n.stateNode.containerInfo);break;case 10:var l=n.type._context,u=n.memoizedProps.value;Je(No,l._currentValue),l._currentValue=u;break;case 13:if(l=n.memoizedState,l!==null)return l.dehydrated!==null?(Je(st,st.current&1),n.flags|=128,null):(i&n.child.childLanes)!==0?ih(t,n,i):(Je(st,st.current&1),t=sn(t,n,i),t!==null?t.sibling:null);Je(st,st.current&1);break;case 19:if(l=(i&n.childLanes)!==0,(t.flags&128)!==0){if(l)return lh(t,n,i);n.flags|=128}if(u=n.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),Je(st,st.current),l)break;return null;case 22:case 23:return n.lanes=0,th(t,n,i)}return sn(t,n,i)}var ch,id,dh,uh;ch=function(t,n){for(var i=n.child;i!==null;){if(i.tag===5||i.tag===6)t.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},id=function(){},dh=function(t,n,i,l){var u=t.memoizedProps;if(u!==l){t=n.stateNode,nr(Us.current);var m=null;switch(i){case"input":u=ie(t,u),l=ie(t,l),m=[];break;case"select":u=L({},u,{value:void 0}),l=L({},l,{value:void 0}),m=[];break;case"textarea":u=Le(t,u),l=Le(t,l),m=[];break;default:typeof u.onClick!="function"&&typeof l.onClick=="function"&&(t.onclick=mo)}os(i,l);var b;i=null;for(V in u)if(!l.hasOwnProperty(V)&&u.hasOwnProperty(V)&&u[V]!=null)if(V==="style"){var T=u[V];for(b in T)T.hasOwnProperty(b)&&(i||(i={}),i[b]="")}else V!=="dangerouslySetInnerHTML"&&V!=="children"&&V!=="suppressContentEditableWarning"&&V!=="suppressHydrationWarning"&&V!=="autoFocus"&&(c.hasOwnProperty(V)?m||(m=[]):(m=m||[]).push(V,null));for(V in l){var A=l[V];if(T=u?.[V],l.hasOwnProperty(V)&&A!==T&&(A!=null||T!=null))if(V==="style")if(T){for(b in T)!T.hasOwnProperty(b)||A&&A.hasOwnProperty(b)||(i||(i={}),i[b]="");for(b in A)A.hasOwnProperty(b)&&T[b]!==A[b]&&(i||(i={}),i[b]=A[b])}else i||(m||(m=[]),m.push(V,i)),i=A;else V==="dangerouslySetInnerHTML"?(A=A?A.__html:void 0,T=T?T.__html:void 0,A!=null&&T!==A&&(m=m||[]).push(V,A)):V==="children"?typeof A!="string"&&typeof A!="number"||(m=m||[]).push(V,""+A):V!=="suppressContentEditableWarning"&&V!=="suppressHydrationWarning"&&(c.hasOwnProperty(V)?(A!=null&&V==="onScroll"&&Ze("scroll",t),m||T===A||(m=[])):(m=m||[]).push(V,A))}i&&(m=m||[]).push("style",i);var V=m;(n.updateQueue=V)&&(n.flags|=4)}},uh=function(t,n,i,l){i!==l&&(n.flags|=4)};function ni(t,n){if(!tt)switch(t.tailMode){case"hidden":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t.tail=null:i.sibling=null;break;case"collapsed":i=t.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null}}function Ot(t){var n=t.alternate!==null&&t.alternate.child===t.child,i=0,l=0;if(n)for(var u=t.child;u!==null;)i|=u.lanes|u.childLanes,l|=u.subtreeFlags&14680064,l|=u.flags&14680064,u.return=t,u=u.sibling;else for(u=t.child;u!==null;)i|=u.lanes|u.childLanes,l|=u.subtreeFlags,l|=u.flags,u.return=t,u=u.sibling;return t.subtreeFlags|=l,t.childLanes=i,n}function X0(t,n,i){var l=n.pendingProps;switch(Pc(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ot(n),null;case 1:return Vt(n.type)&&po(),Ot(n),null;case 3:return l=n.stateNode,ta(),et(Wt),et(zt),$c(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(vo(n)?n.flags|=4:t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,ws!==null&&(gd(ws),ws=null))),id(t,n),Ot(n),null;case 5:_c(n);var u=nr(Xa.current);if(i=n.type,t!==null&&n.stateNode!=null)dh(t,n,i,l,u),t.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!l){if(n.stateNode===null)throw Error(a(166));return Ot(n),null}if(t=nr(Us.current),vo(n)){l=n.stateNode,i=n.type;var m=n.memoizedProps;switch(l[_s]=n,l[Va]=m,t=(n.mode&1)!==0,i){case"dialog":Ze("cancel",l),Ze("close",l);break;case"iframe":case"object":case"embed":Ze("load",l);break;case"video":case"audio":for(u=0;u<Ha.length;u++)Ze(Ha[u],l);break;case"source":Ze("error",l);break;case"img":case"image":case"link":Ze("error",l),Ze("load",l);break;case"details":Ze("toggle",l);break;case"input":Mt(l,m),Ze("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!m.multiple},Ze("invalid",l);break;case"textarea":bs(l,m),Ze("invalid",l)}os(i,m),u=null;for(var b in m)if(m.hasOwnProperty(b)){var T=m[b];b==="children"?typeof T=="string"?l.textContent!==T&&(m.suppressHydrationWarning!==!0&&xo(l.textContent,T,t),u=["children",T]):typeof T=="number"&&l.textContent!==""+T&&(m.suppressHydrationWarning!==!0&&xo(l.textContent,T,t),u=["children",""+T]):c.hasOwnProperty(b)&&T!=null&&b==="onScroll"&&Ze("scroll",l)}switch(i){case"input":yt(l),As(l,m,!0);break;case"textarea":yt(l),Os(l);break;case"select":case"option":break;default:typeof m.onClick=="function"&&(l.onclick=mo)}l=u,n.updateQueue=l,l!==null&&(n.flags|=4)}else{b=u.nodeType===9?u:u.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=ts(i)),t==="http://www.w3.org/1999/xhtml"?i==="script"?(t=b.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof l.is=="string"?t=b.createElement(i,{is:l.is}):(t=b.createElement(i),i==="select"&&(b=t,l.multiple?b.multiple=!0:l.size&&(b.size=l.size))):t=b.createElementNS(t,i),t[_s]=n,t[Va]=l,ch(t,n,!1,!1),n.stateNode=t;e:{switch(b=_e(i,l),i){case"dialog":Ze("cancel",t),Ze("close",t),u=l;break;case"iframe":case"object":case"embed":Ze("load",t),u=l;break;case"video":case"audio":for(u=0;u<Ha.length;u++)Ze(Ha[u],t);u=l;break;case"source":Ze("error",t),u=l;break;case"img":case"image":case"link":Ze("error",t),Ze("load",t),u=l;break;case"details":Ze("toggle",t),u=l;break;case"input":Mt(t,l),u=ie(t,l),Ze("invalid",t);break;case"option":u=l;break;case"select":t._wrapperState={wasMultiple:!!l.multiple},u=L({},l,{value:void 0}),Ze("invalid",t);break;case"textarea":bs(t,l),u=Le(t,l),Ze("invalid",t);break;default:u=l}os(i,u),T=u;for(m in T)if(T.hasOwnProperty(m)){var A=T[m];m==="style"?Qn(t,A):m==="dangerouslySetInnerHTML"?(A=A?A.__html:void 0,A!=null&&Ue(t,A)):m==="children"?typeof A=="string"?(i!=="textarea"||A!=="")&&$e(t,A):typeof A=="number"&&$e(t,""+A):m!=="suppressContentEditableWarning"&&m!=="suppressHydrationWarning"&&m!=="autoFocus"&&(c.hasOwnProperty(m)?A!=null&&m==="onScroll"&&Ze("scroll",t):A!=null&&D(t,m,A,b))}switch(i){case"input":yt(t),As(t,l,!1);break;case"textarea":yt(t),Os(t);break;case"option":l.value!=null&&t.setAttribute("value",""+me(l.value));break;case"select":t.multiple=!!l.multiple,m=l.value,m!=null?he(t,!!l.multiple,m,!1):l.defaultValue!=null&&he(t,!!l.multiple,l.defaultValue,!0);break;default:typeof u.onClick=="function"&&(t.onclick=mo)}switch(i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return Ot(n),null;case 6:if(t&&n.stateNode!=null)uh(t,n,t.memoizedProps,l);else{if(typeof l!="string"&&n.stateNode===null)throw Error(a(166));if(i=nr(Xa.current),nr(Us.current),vo(n)){if(l=n.stateNode,i=n.memoizedProps,l[_s]=n,(m=l.nodeValue!==i)&&(t=ns,t!==null))switch(t.tag){case 3:xo(l.nodeValue,i,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&xo(l.nodeValue,i,(t.mode&1)!==0)}m&&(n.flags|=4)}else l=(i.nodeType===9?i:i.ownerDocument).createTextNode(l),l[_s]=n,n.stateNode=l}return Ot(n),null;case 13:if(et(st),l=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(tt&&rs!==null&&(n.mode&1)!==0&&(n.flags&128)===0)hm(),Yr(),n.flags|=98560,m=!1;else if(m=vo(n),l!==null&&l.dehydrated!==null){if(t===null){if(!m)throw Error(a(318));if(m=n.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(a(317));m[_s]=n}else Yr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ot(n),m=!1}else ws!==null&&(gd(ws),ws=null),m=!0;if(!m)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=i,n):(l=l!==null,l!==(t!==null&&t.memoizedState!==null)&&l&&(n.child.flags|=8192,(n.mode&1)!==0&&(t===null||(st.current&1)!==0?pt===0&&(pt=3):vd())),n.updateQueue!==null&&(n.flags|=4),Ot(n),null);case 4:return ta(),id(t,n),t===null&&Ka(n.stateNode.containerInfo),Ot(n),null;case 10:return Oc(n.type._context),Ot(n),null;case 17:return Vt(n.type)&&po(),Ot(n),null;case 19:if(et(st),m=n.memoizedState,m===null)return Ot(n),null;if(l=(n.flags&128)!==0,b=m.rendering,b===null)if(l)ni(m,!1);else{if(pt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(b=Co(t),b!==null){for(n.flags|=128,ni(m,!1),l=b.updateQueue,l!==null&&(n.updateQueue=l,n.flags|=4),n.subtreeFlags=0,l=i,i=n.child;i!==null;)m=i,t=l,m.flags&=14680066,b=m.alternate,b===null?(m.childLanes=0,m.lanes=t,m.child=null,m.subtreeFlags=0,m.memoizedProps=null,m.memoizedState=null,m.updateQueue=null,m.dependencies=null,m.stateNode=null):(m.childLanes=b.childLanes,m.lanes=b.lanes,m.child=b.child,m.subtreeFlags=0,m.deletions=null,m.memoizedProps=b.memoizedProps,m.memoizedState=b.memoizedState,m.updateQueue=b.updateQueue,m.type=b.type,t=b.dependencies,m.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),i=i.sibling;return Je(st,st.current&1|2),n.child}t=t.sibling}m.tail!==null&&ot()>aa&&(n.flags|=128,l=!0,ni(m,!1),n.lanes=4194304)}else{if(!l)if(t=Co(b),t!==null){if(n.flags|=128,l=!0,i=t.updateQueue,i!==null&&(n.updateQueue=i,n.flags|=4),ni(m,!0),m.tail===null&&m.tailMode==="hidden"&&!b.alternate&&!tt)return Ot(n),null}else 2*ot()-m.renderingStartTime>aa&&i!==1073741824&&(n.flags|=128,l=!0,ni(m,!1),n.lanes=4194304);m.isBackwards?(b.sibling=n.child,n.child=b):(i=m.last,i!==null?i.sibling=b:n.child=b,m.last=b)}return m.tail!==null?(n=m.tail,m.rendering=n,m.tail=n.sibling,m.renderingStartTime=ot(),n.sibling=null,i=st.current,Je(st,l?i&1|2:i&1),n):(Ot(n),null);case 22:case 23:return bd(),l=n.memoizedState!==null,t!==null&&t.memoizedState!==null!==l&&(n.flags|=8192),l&&(n.mode&1)!==0?(as&1073741824)!==0&&(Ot(n),n.subtreeFlags&6&&(n.flags|=8192)):Ot(n),null;case 24:return null;case 25:return null}throw Error(a(156,n.tag))}function Z0(t,n){switch(Pc(n),n.tag){case 1:return Vt(n.type)&&po(),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return ta(),et(Wt),et(zt),$c(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 5:return _c(n),null;case 13:if(et(st),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(a(340));Yr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return et(st),null;case 4:return ta(),null;case 10:return Oc(n.type._context),null;case 22:case 23:return bd(),null;case 24:return null;default:return null}}var Do=!1,Dt=!1,ey=typeof WeakSet=="function"?WeakSet:Set,xe=null;function na(t,n){var i=t.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(l){at(t,n,l)}else i.current=null}function od(t,n,i){try{i()}catch(l){at(t,n,l)}}var xh=!1;function ty(t,n){if(bc=eo,t=Hx(),uc(t)){if("selectionStart"in t)var i={start:t.selectionStart,end:t.selectionEnd};else e:{i=(i=t.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var u=l.anchorOffset,m=l.focusNode;l=l.focusOffset;try{i.nodeType,m.nodeType}catch{i=null;break e}var b=0,T=-1,A=-1,V=0,se=0,re=t,te=null;t:for(;;){for(var de;re!==i||u!==0&&re.nodeType!==3||(T=b+u),re!==m||l!==0&&re.nodeType!==3||(A=b+l),re.nodeType===3&&(b+=re.nodeValue.length),(de=re.firstChild)!==null;)te=re,re=de;for(;;){if(re===t)break t;if(te===i&&++V===u&&(T=b),te===m&&++se===l&&(A=b),(de=re.nextSibling)!==null)break;re=te,te=re.parentNode}re=de}i=T===-1||A===-1?null:{start:T,end:A}}else i=null}i=i||{start:0,end:0}}else i=null;for(vc={focusedElem:t,selectionRange:i},eo=!1,xe=n;xe!==null;)if(n=xe,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,xe=t;else for(;xe!==null;){n=xe;try{var pe=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(pe!==null){var fe=pe.memoizedProps,lt=pe.memoizedState,U=n.stateNode,I=U.getSnapshotBeforeUpdate(n.elementType===n.type?fe:ks(n.type,fe),lt);U.__reactInternalSnapshotBeforeUpdate=I}break;case 3:var q=n.stateNode.containerInfo;q.nodeType===1?q.textContent="":q.nodeType===9&&q.documentElement&&q.removeChild(q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(ae){at(n,n.return,ae)}if(t=n.sibling,t!==null){t.return=n.return,xe=t;break}xe=n.return}return pe=xh,xh=!1,pe}function ri(t,n,i){var l=n.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var u=l=l.next;do{if((u.tag&t)===t){var m=u.destroy;u.destroy=void 0,m!==void 0&&od(n,i,m)}u=u.next}while(u!==l)}}function Io(t,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var l=i.create;i.destroy=l()}i=i.next}while(i!==n)}}function ld(t){var n=t.ref;if(n!==null){var i=t.stateNode;t.tag,t=i,typeof n=="function"?n(t):n.current=t}}function mh(t){var n=t.alternate;n!==null&&(t.alternate=null,mh(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&(delete n[_s],delete n[Va],delete n[kc],delete n[F0],delete n[L0])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function hh(t){return t.tag===5||t.tag===3||t.tag===4}function ph(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||hh(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function cd(t,n,i){var l=t.tag;if(l===5||l===6)t=t.stateNode,n?i.nodeType===8?i.parentNode.insertBefore(t,n):i.insertBefore(t,n):(i.nodeType===8?(n=i.parentNode,n.insertBefore(t,i)):(n=i,n.appendChild(t)),i=i._reactRootContainer,i!=null||n.onclick!==null||(n.onclick=mo));else if(l!==4&&(t=t.child,t!==null))for(cd(t,n,i),t=t.sibling;t!==null;)cd(t,n,i),t=t.sibling}function dd(t,n,i){var l=t.tag;if(l===5||l===6)t=t.stateNode,n?i.insertBefore(t,n):i.appendChild(t);else if(l!==4&&(t=t.child,t!==null))for(dd(t,n,i),t=t.sibling;t!==null;)dd(t,n,i),t=t.sibling}var Pt=null,Ss=!1;function En(t,n,i){for(i=i.child;i!==null;)fh(t,n,i),i=i.sibling}function fh(t,n,i){if(Ls&&typeof Ls.onCommitFiberUnmount=="function")try{Ls.onCommitFiberUnmount(Gi,i)}catch{}switch(i.tag){case 5:Dt||na(i,n);case 6:var l=Pt,u=Ss;Pt=null,En(t,n,i),Pt=l,Ss=u,Pt!==null&&(Ss?(t=Pt,i=i.stateNode,t.nodeType===8?t.parentNode.removeChild(i):t.removeChild(i)):Pt.removeChild(i.stateNode));break;case 18:Pt!==null&&(Ss?(t=Pt,i=i.stateNode,t.nodeType===8?wc(t.parentNode,i):t.nodeType===1&&wc(t,i),Ia(t)):wc(Pt,i.stateNode));break;case 4:l=Pt,u=Ss,Pt=i.stateNode.containerInfo,Ss=!0,En(t,n,i),Pt=l,Ss=u;break;case 0:case 11:case 14:case 15:if(!Dt&&(l=i.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){u=l=l.next;do{var m=u,b=m.destroy;m=m.tag,b!==void 0&&((m&2)!==0||(m&4)!==0)&&od(i,n,b),u=u.next}while(u!==l)}En(t,n,i);break;case 1:if(!Dt&&(na(i,n),l=i.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=i.memoizedProps,l.state=i.memoizedState,l.componentWillUnmount()}catch(T){at(i,n,T)}En(t,n,i);break;case 21:En(t,n,i);break;case 22:i.mode&1?(Dt=(l=Dt)||i.memoizedState!==null,En(t,n,i),Dt=l):En(t,n,i);break;default:En(t,n,i)}}function gh(t){var n=t.updateQueue;if(n!==null){t.updateQueue=null;var i=t.stateNode;i===null&&(i=t.stateNode=new ey),n.forEach(function(l){var u=dy.bind(null,t,l);i.has(l)||(i.add(l),l.then(u,u))})}}function Cs(t,n){var i=n.deletions;if(i!==null)for(var l=0;l<i.length;l++){var u=i[l];try{var m=t,b=n,T=b;e:for(;T!==null;){switch(T.tag){case 5:Pt=T.stateNode,Ss=!1;break e;case 3:Pt=T.stateNode.containerInfo,Ss=!0;break e;case 4:Pt=T.stateNode.containerInfo,Ss=!0;break e}T=T.return}if(Pt===null)throw Error(a(160));fh(m,b,u),Pt=null,Ss=!1;var A=u.alternate;A!==null&&(A.return=null),u.return=null}catch(V){at(u,n,V)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)yh(n,t),n=n.sibling}function yh(t,n){var i=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Cs(n,t),Bs(t),l&4){try{ri(3,t,t.return),Io(3,t)}catch(fe){at(t,t.return,fe)}try{ri(5,t,t.return)}catch(fe){at(t,t.return,fe)}}break;case 1:Cs(n,t),Bs(t),l&512&&i!==null&&na(i,i.return);break;case 5:if(Cs(n,t),Bs(t),l&512&&i!==null&&na(i,i.return),t.flags&32){var u=t.stateNode;try{$e(u,"")}catch(fe){at(t,t.return,fe)}}if(l&4&&(u=t.stateNode,u!=null)){var m=t.memoizedProps,b=i!==null?i.memoizedProps:m,T=t.type,A=t.updateQueue;if(t.updateQueue=null,A!==null)try{T==="input"&&m.type==="radio"&&m.name!=null&&xt(u,m),_e(T,b);var V=_e(T,m);for(b=0;b<A.length;b+=2){var se=A[b],re=A[b+1];se==="style"?Qn(u,re):se==="dangerouslySetInnerHTML"?Ue(u,re):se==="children"?$e(u,re):D(u,se,re,V)}switch(T){case"input":Ft(u,m);break;case"textarea":bt(u,m);break;case"select":var te=u._wrapperState.wasMultiple;u._wrapperState.wasMultiple=!!m.multiple;var de=m.value;de!=null?he(u,!!m.multiple,de,!1):te!==!!m.multiple&&(m.defaultValue!=null?he(u,!!m.multiple,m.defaultValue,!0):he(u,!!m.multiple,m.multiple?[]:"",!1))}u[Va]=m}catch(fe){at(t,t.return,fe)}}break;case 6:if(Cs(n,t),Bs(t),l&4){if(t.stateNode===null)throw Error(a(162));u=t.stateNode,m=t.memoizedProps;try{u.nodeValue=m}catch(fe){at(t,t.return,fe)}}break;case 3:if(Cs(n,t),Bs(t),l&4&&i!==null&&i.memoizedState.isDehydrated)try{Ia(n.containerInfo)}catch(fe){at(t,t.return,fe)}break;case 4:Cs(n,t),Bs(t);break;case 13:Cs(n,t),Bs(t),u=t.child,u.flags&8192&&(m=u.memoizedState!==null,u.stateNode.isHidden=m,!m||u.alternate!==null&&u.alternate.memoizedState!==null||(md=ot())),l&4&&gh(t);break;case 22:if(se=i!==null&&i.memoizedState!==null,t.mode&1?(Dt=(V=Dt)||se,Cs(n,t),Dt=V):Cs(n,t),Bs(t),l&8192){if(V=t.memoizedState!==null,(t.stateNode.isHidden=V)&&!se&&(t.mode&1)!==0)for(xe=t,se=t.child;se!==null;){for(re=xe=se;xe!==null;){switch(te=xe,de=te.child,te.tag){case 0:case 11:case 14:case 15:ri(4,te,te.return);break;case 1:na(te,te.return);var pe=te.stateNode;if(typeof pe.componentWillUnmount=="function"){l=te,i=te.return;try{n=l,pe.props=n.memoizedProps,pe.state=n.memoizedState,pe.componentWillUnmount()}catch(fe){at(l,i,fe)}}break;case 5:na(te,te.return);break;case 22:if(te.memoizedState!==null){jh(re);continue}}de!==null?(de.return=te,xe=de):jh(re)}se=se.sibling}e:for(se=null,re=t;;){if(re.tag===5){if(se===null){se=re;try{u=re.stateNode,V?(m=u.style,typeof m.setProperty=="function"?m.setProperty("display","none","important"):m.display="none"):(T=re.stateNode,A=re.memoizedProps.style,b=A!=null&&A.hasOwnProperty("display")?A.display:null,T.style.display=Qs("display",b))}catch(fe){at(t,t.return,fe)}}}else if(re.tag===6){if(se===null)try{re.stateNode.nodeValue=V?"":re.memoizedProps}catch(fe){at(t,t.return,fe)}}else if((re.tag!==22&&re.tag!==23||re.memoizedState===null||re===t)&&re.child!==null){re.child.return=re,re=re.child;continue}if(re===t)break e;for(;re.sibling===null;){if(re.return===null||re.return===t)break e;se===re&&(se=null),re=re.return}se===re&&(se=null),re.sibling.return=re.return,re=re.sibling}}break;case 19:Cs(n,t),Bs(t),l&4&&gh(t);break;case 21:break;default:Cs(n,t),Bs(t)}}function Bs(t){var n=t.flags;if(n&2){try{e:{for(var i=t.return;i!==null;){if(hh(i)){var l=i;break e}i=i.return}throw Error(a(160))}switch(l.tag){case 5:var u=l.stateNode;l.flags&32&&($e(u,""),l.flags&=-33);var m=ph(t);dd(t,m,u);break;case 3:case 4:var b=l.stateNode.containerInfo,T=ph(t);cd(t,T,b);break;default:throw Error(a(161))}}catch(A){at(t,t.return,A)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function sy(t,n,i){xe=t,bh(t)}function bh(t,n,i){for(var l=(t.mode&1)!==0;xe!==null;){var u=xe,m=u.child;if(u.tag===22&&l){var b=u.memoizedState!==null||Do;if(!b){var T=u.alternate,A=T!==null&&T.memoizedState!==null||Dt;T=Do;var V=Dt;if(Do=b,(Dt=A)&&!V)for(xe=u;xe!==null;)b=xe,A=b.child,b.tag===22&&b.memoizedState!==null?Nh(u):A!==null?(A.return=b,xe=A):Nh(u);for(;m!==null;)xe=m,bh(m),m=m.sibling;xe=u,Do=T,Dt=V}vh(t)}else(u.subtreeFlags&8772)!==0&&m!==null?(m.return=u,xe=m):vh(t)}}function vh(t){for(;xe!==null;){var n=xe;if((n.flags&8772)!==0){var i=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:Dt||Io(5,n);break;case 1:var l=n.stateNode;if(n.flags&4&&!Dt)if(i===null)l.componentDidMount();else{var u=n.elementType===n.type?i.memoizedProps:ks(n.type,i.memoizedProps);l.componentDidUpdate(u,i.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var m=n.updateQueue;m!==null&&jm(n,m,l);break;case 3:var b=n.updateQueue;if(b!==null){if(i=null,n.child!==null)switch(n.child.tag){case 5:i=n.child.stateNode;break;case 1:i=n.child.stateNode}jm(n,b,i)}break;case 5:var T=n.stateNode;if(i===null&&n.flags&4){i=T;var A=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":A.autoFocus&&i.focus();break;case"img":A.src&&(i.src=A.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var V=n.alternate;if(V!==null){var se=V.memoizedState;if(se!==null){var re=se.dehydrated;re!==null&&Ia(re)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(a(163))}Dt||n.flags&512&&ld(n)}catch(te){at(n,n.return,te)}}if(n===t){xe=null;break}if(i=n.sibling,i!==null){i.return=n.return,xe=i;break}xe=n.return}}function jh(t){for(;xe!==null;){var n=xe;if(n===t){xe=null;break}var i=n.sibling;if(i!==null){i.return=n.return,xe=i;break}xe=n.return}}function Nh(t){for(;xe!==null;){var n=xe;try{switch(n.tag){case 0:case 11:case 15:var i=n.return;try{Io(4,n)}catch(A){at(n,i,A)}break;case 1:var l=n.stateNode;if(typeof l.componentDidMount=="function"){var u=n.return;try{l.componentDidMount()}catch(A){at(n,u,A)}}var m=n.return;try{ld(n)}catch(A){at(n,m,A)}break;case 5:var b=n.return;try{ld(n)}catch(A){at(n,b,A)}}}catch(A){at(n,n.return,A)}if(n===t){xe=null;break}var T=n.sibling;if(T!==null){T.return=n.return,xe=T;break}xe=n.return}}var ny=Math.ceil,Fo=M.ReactCurrentDispatcher,ud=M.ReactCurrentOwner,hs=M.ReactCurrentBatchConfig,Be=0,jt=null,dt=null,Rt=0,as=0,ra=Nn(0),pt=0,ai=null,ar=0,Lo=0,xd=0,ii=null,Qt=null,md=0,aa=1/0,nn=null,_o=!1,hd=null,Pn=null,Uo=!1,Rn=null,$o=0,oi=0,pd=null,Bo=-1,qo=0;function _t(){return(Be&6)!==0?ot():Bo!==-1?Bo:Bo=ot()}function Mn(t){return(t.mode&1)===0?1:(Be&2)!==0&&Rt!==0?Rt&-Rt:U0.transition!==null?(qo===0&&(qo=px()),qo):(t=We,t!==0||(t=window.event,t=t===void 0?16:kx(t.type)),t)}function Es(t,n,i,l){if(50<oi)throw oi=0,pd=null,Error(a(185));Ta(t,i,l),((Be&2)===0||t!==jt)&&(t===jt&&((Be&2)===0&&(Lo|=i),pt===4&&Tn(t,Rt)),Jt(t,l),i===1&&Be===0&&(n.mode&1)===0&&(aa=ot()+500,go&&kn()))}function Jt(t,n){var i=t.callbackNode;Ug(t,n);var l=Yi(t,t===jt?Rt:0);if(l===0)i!==null&&xx(i),t.callbackNode=null,t.callbackPriority=0;else if(n=l&-l,t.callbackPriority!==n){if(i!=null&&xx(i),n===1)t.tag===0?_0(kh.bind(null,t)):cm(kh.bind(null,t)),D0(function(){(Be&6)===0&&kn()}),i=null;else{switch(fx(l)){case 1:i=Gl;break;case 4:i=mx;break;case 16:i=Vi;break;case 536870912:i=hx;break;default:i=Vi}i=zh(i,wh.bind(null,t))}t.callbackPriority=n,t.callbackNode=i}}function wh(t,n){if(Bo=-1,qo=0,(Be&6)!==0)throw Error(a(327));var i=t.callbackNode;if(ia()&&t.callbackNode!==i)return null;var l=Yi(t,t===jt?Rt:0);if(l===0)return null;if((l&30)!==0||(l&t.expiredLanes)!==0||n)n=Ho(t,l);else{n=l;var u=Be;Be|=2;var m=Ch();(jt!==t||Rt!==n)&&(nn=null,aa=ot()+500,or(t,n));do try{iy();break}catch(T){Sh(t,T)}while(!0);Ac(),Fo.current=m,Be=u,dt!==null?n=0:(jt=null,Rt=0,n=pt)}if(n!==0){if(n===2&&(u=Ql(t),u!==0&&(l=u,n=fd(t,u))),n===1)throw i=ai,or(t,0),Tn(t,l),Jt(t,ot()),i;if(n===6)Tn(t,l);else{if(u=t.current.alternate,(l&30)===0&&!ry(u)&&(n=Ho(t,l),n===2&&(m=Ql(t),m!==0&&(l=m,n=fd(t,m))),n===1))throw i=ai,or(t,0),Tn(t,l),Jt(t,ot()),i;switch(t.finishedWork=u,t.finishedLanes=l,n){case 0:case 1:throw Error(a(345));case 2:lr(t,Qt,nn);break;case 3:if(Tn(t,l),(l&130023424)===l&&(n=md+500-ot(),10<n)){if(Yi(t,0)!==0)break;if(u=t.suspendedLanes,(u&l)!==l){_t(),t.pingedLanes|=t.suspendedLanes&u;break}t.timeoutHandle=Nc(lr.bind(null,t,Qt,nn),n);break}lr(t,Qt,nn);break;case 4:if(Tn(t,l),(l&4194240)===l)break;for(n=t.eventTimes,u=-1;0<l;){var b=31-js(l);m=1<<b,b=n[b],b>u&&(u=b),l&=~m}if(l=u,l=ot()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*ny(l/1960))-l,10<l){t.timeoutHandle=Nc(lr.bind(null,t,Qt,nn),l);break}lr(t,Qt,nn);break;case 5:lr(t,Qt,nn);break;default:throw Error(a(329))}}}return Jt(t,ot()),t.callbackNode===i?wh.bind(null,t):null}function fd(t,n){var i=ii;return t.current.memoizedState.isDehydrated&&(or(t,n).flags|=256),t=Ho(t,n),t!==2&&(n=Qt,Qt=i,n!==null&&gd(n)),t}function gd(t){Qt===null?Qt=t:Qt.push.apply(Qt,t)}function ry(t){for(var n=t;;){if(n.flags&16384){var i=n.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var l=0;l<i.length;l++){var u=i[l],m=u.getSnapshot;u=u.value;try{if(!Ns(m(),u))return!1}catch{return!1}}}if(i=n.child,n.subtreeFlags&16384&&i!==null)i.return=n,n=i;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Tn(t,n){for(n&=~xd,n&=~Lo,t.suspendedLanes|=n,t.pingedLanes&=~n,t=t.expirationTimes;0<n;){var i=31-js(n),l=1<<i;t[i]=-1,n&=~l}}function kh(t){if((Be&6)!==0)throw Error(a(327));ia();var n=Yi(t,0);if((n&1)===0)return Jt(t,ot()),null;var i=Ho(t,n);if(t.tag!==0&&i===2){var l=Ql(t);l!==0&&(n=l,i=fd(t,l))}if(i===1)throw i=ai,or(t,0),Tn(t,n),Jt(t,ot()),i;if(i===6)throw Error(a(345));return t.finishedWork=t.current.alternate,t.finishedLanes=n,lr(t,Qt,nn),Jt(t,ot()),null}function yd(t,n){var i=Be;Be|=1;try{return t(n)}finally{Be=i,Be===0&&(aa=ot()+500,go&&kn())}}function ir(t){Rn!==null&&Rn.tag===0&&(Be&6)===0&&ia();var n=Be;Be|=1;var i=hs.transition,l=We;try{if(hs.transition=null,We=1,t)return t()}finally{We=l,hs.transition=i,Be=n,(Be&6)===0&&kn()}}function bd(){as=ra.current,et(ra)}function or(t,n){t.finishedWork=null,t.finishedLanes=0;var i=t.timeoutHandle;if(i!==-1&&(t.timeoutHandle=-1,O0(i)),dt!==null)for(i=dt.return;i!==null;){var l=i;switch(Pc(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&po();break;case 3:ta(),et(Wt),et(zt),$c();break;case 5:_c(l);break;case 4:ta();break;case 13:et(st);break;case 19:et(st);break;case 10:Oc(l.type._context);break;case 22:case 23:bd()}i=i.return}if(jt=t,dt=t=zn(t.current,null),Rt=as=n,pt=0,ai=null,xd=Lo=ar=0,Qt=ii=null,sr!==null){for(n=0;n<sr.length;n++)if(i=sr[n],l=i.interleaved,l!==null){i.interleaved=null;var u=l.next,m=i.pending;if(m!==null){var b=m.next;m.next=u,l.next=b}i.pending=l}sr=null}return t}function Sh(t,n){do{var i=dt;try{if(Ac(),Eo.current=To,Po){for(var l=nt.memoizedState;l!==null;){var u=l.queue;u!==null&&(u.pending=null),l=l.next}Po=!1}if(rr=0,vt=ht=nt=null,Za=!1,ei=0,ud.current=null,i===null||i.return===null){pt=1,ai=n,dt=null;break}e:{var m=t,b=i.return,T=i,A=n;if(n=Rt,T.flags|=32768,A!==null&&typeof A=="object"&&typeof A.then=="function"){var V=A,se=T,re=se.tag;if((se.mode&1)===0&&(re===0||re===11||re===15)){var te=se.alternate;te?(se.updateQueue=te.updateQueue,se.memoizedState=te.memoizedState,se.lanes=te.lanes):(se.updateQueue=null,se.memoizedState=null)}var de=Jm(b);if(de!==null){de.flags&=-257,Ym(de,b,T,m,n),de.mode&1&&Qm(m,V,n),n=de,A=V;var pe=n.updateQueue;if(pe===null){var fe=new Set;fe.add(A),n.updateQueue=fe}else pe.add(A);break e}else{if((n&1)===0){Qm(m,V,n),vd();break e}A=Error(a(426))}}else if(tt&&T.mode&1){var lt=Jm(b);if(lt!==null){(lt.flags&65536)===0&&(lt.flags|=256),Ym(lt,b,T,m,n),Tc(sa(A,T));break e}}m=A=sa(A,T),pt!==4&&(pt=2),ii===null?ii=[m]:ii.push(m),m=b;do{switch(m.tag){case 3:m.flags|=65536,n&=-n,m.lanes|=n;var U=Vm(m,A,n);vm(m,U);break e;case 1:T=A;var I=m.type,q=m.stateNode;if((m.flags&128)===0&&(typeof I.getDerivedStateFromError=="function"||q!==null&&typeof q.componentDidCatch=="function"&&(Pn===null||!Pn.has(q)))){m.flags|=65536,n&=-n,m.lanes|=n;var ae=Gm(m,T,n);vm(m,ae);break e}}m=m.return}while(m!==null)}Ph(i)}catch(ge){n=ge,dt===i&&i!==null&&(dt=i=i.return);continue}break}while(!0)}function Ch(){var t=Fo.current;return Fo.current=To,t===null?To:t}function vd(){(pt===0||pt===3||pt===2)&&(pt=4),jt===null||(ar&268435455)===0&&(Lo&268435455)===0||Tn(jt,Rt)}function Ho(t,n){var i=Be;Be|=2;var l=Ch();(jt!==t||Rt!==n)&&(nn=null,or(t,n));do try{ay();break}catch(u){Sh(t,u)}while(!0);if(Ac(),Be=i,Fo.current=l,dt!==null)throw Error(a(261));return jt=null,Rt=0,pt}function ay(){for(;dt!==null;)Eh(dt)}function iy(){for(;dt!==null&&!Tg();)Eh(dt)}function Eh(t){var n=Th(t.alternate,t,as);t.memoizedProps=t.pendingProps,n===null?Ph(t):dt=n,ud.current=null}function Ph(t){var n=t;do{var i=n.alternate;if(t=n.return,(n.flags&32768)===0){if(i=X0(i,n,as),i!==null){dt=i;return}}else{if(i=Z0(i,n),i!==null){i.flags&=32767,dt=i;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{pt=6,dt=null;return}}if(n=n.sibling,n!==null){dt=n;return}dt=n=t}while(n!==null);pt===0&&(pt=5)}function lr(t,n,i){var l=We,u=hs.transition;try{hs.transition=null,We=1,oy(t,n,i,l)}finally{hs.transition=u,We=l}return null}function oy(t,n,i,l){do ia();while(Rn!==null);if((Be&6)!==0)throw Error(a(327));i=t.finishedWork;var u=t.finishedLanes;if(i===null)return null;if(t.finishedWork=null,t.finishedLanes=0,i===t.current)throw Error(a(177));t.callbackNode=null,t.callbackPriority=0;var m=i.lanes|i.childLanes;if($g(t,m),t===jt&&(dt=jt=null,Rt=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||Uo||(Uo=!0,zh(Vi,function(){return ia(),null})),m=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||m){m=hs.transition,hs.transition=null;var b=We;We=1;var T=Be;Be|=4,ud.current=null,ty(t,i),yh(i,t),E0(vc),eo=!!bc,vc=bc=null,t.current=i,sy(i),zg(),Be=T,We=b,hs.transition=m}else t.current=i;if(Uo&&(Uo=!1,Rn=t,$o=u),m=t.pendingLanes,m===0&&(Pn=null),Dg(i.stateNode),Jt(t,ot()),n!==null)for(l=t.onRecoverableError,i=0;i<n.length;i++)u=n[i],l(u.value,{componentStack:u.stack,digest:u.digest});if(_o)throw _o=!1,t=hd,hd=null,t;return($o&1)!==0&&t.tag!==0&&ia(),m=t.pendingLanes,(m&1)!==0?t===pd?oi++:(oi=0,pd=t):oi=0,kn(),null}function ia(){if(Rn!==null){var t=fx($o),n=hs.transition,i=We;try{if(hs.transition=null,We=16>t?16:t,Rn===null)var l=!1;else{if(t=Rn,Rn=null,$o=0,(Be&6)!==0)throw Error(a(331));var u=Be;for(Be|=4,xe=t.current;xe!==null;){var m=xe,b=m.child;if((xe.flags&16)!==0){var T=m.deletions;if(T!==null){for(var A=0;A<T.length;A++){var V=T[A];for(xe=V;xe!==null;){var se=xe;switch(se.tag){case 0:case 11:case 15:ri(8,se,m)}var re=se.child;if(re!==null)re.return=se,xe=re;else for(;xe!==null;){se=xe;var te=se.sibling,de=se.return;if(mh(se),se===V){xe=null;break}if(te!==null){te.return=de,xe=te;break}xe=de}}}var pe=m.alternate;if(pe!==null){var fe=pe.child;if(fe!==null){pe.child=null;do{var lt=fe.sibling;fe.sibling=null,fe=lt}while(fe!==null)}}xe=m}}if((m.subtreeFlags&2064)!==0&&b!==null)b.return=m,xe=b;else e:for(;xe!==null;){if(m=xe,(m.flags&2048)!==0)switch(m.tag){case 0:case 11:case 15:ri(9,m,m.return)}var U=m.sibling;if(U!==null){U.return=m.return,xe=U;break e}xe=m.return}}var I=t.current;for(xe=I;xe!==null;){b=xe;var q=b.child;if((b.subtreeFlags&2064)!==0&&q!==null)q.return=b,xe=q;else e:for(b=I;xe!==null;){if(T=xe,(T.flags&2048)!==0)try{switch(T.tag){case 0:case 11:case 15:Io(9,T)}}catch(ge){at(T,T.return,ge)}if(T===b){xe=null;break e}var ae=T.sibling;if(ae!==null){ae.return=T.return,xe=ae;break e}xe=T.return}}if(Be=u,kn(),Ls&&typeof Ls.onPostCommitFiberRoot=="function")try{Ls.onPostCommitFiberRoot(Gi,t)}catch{}l=!0}return l}finally{We=i,hs.transition=n}}return!1}function Rh(t,n,i){n=sa(i,n),n=Vm(t,n,1),t=Cn(t,n,1),n=_t(),t!==null&&(Ta(t,1,n),Jt(t,n))}function at(t,n,i){if(t.tag===3)Rh(t,t,i);else for(;n!==null;){if(n.tag===3){Rh(n,t,i);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Pn===null||!Pn.has(l))){t=sa(i,t),t=Gm(n,t,1),n=Cn(n,t,1),t=_t(),n!==null&&(Ta(n,1,t),Jt(n,t));break}}n=n.return}}function ly(t,n,i){var l=t.pingCache;l!==null&&l.delete(n),n=_t(),t.pingedLanes|=t.suspendedLanes&i,jt===t&&(Rt&i)===i&&(pt===4||pt===3&&(Rt&130023424)===Rt&&500>ot()-md?or(t,0):xd|=i),Jt(t,n)}function Mh(t,n){n===0&&((t.mode&1)===0?n=1:(n=Ji,Ji<<=1,(Ji&130023424)===0&&(Ji=4194304)));var i=_t();t=en(t,n),t!==null&&(Ta(t,n,i),Jt(t,i))}function cy(t){var n=t.memoizedState,i=0;n!==null&&(i=n.retryLane),Mh(t,i)}function dy(t,n){var i=0;switch(t.tag){case 13:var l=t.stateNode,u=t.memoizedState;u!==null&&(i=u.retryLane);break;case 19:l=t.stateNode;break;default:throw Error(a(314))}l!==null&&l.delete(n),Mh(t,i)}var Th;Th=function(t,n,i){if(t!==null)if(t.memoizedProps!==n.pendingProps||Wt.current)Gt=!0;else{if((t.lanes&i)===0&&(n.flags&128)===0)return Gt=!1,Y0(t,n,i);Gt=(t.flags&131072)!==0}else Gt=!1,tt&&(n.flags&1048576)!==0&&dm(n,bo,n.index);switch(n.lanes=0,n.tag){case 2:var l=n.type;Oo(t,n),t=n.pendingProps;var u=Gr(n,zt.current);ea(n,i),u=Hc(null,n,l,t,u,i);var m=Kc();return n.flags|=1,typeof u=="object"&&u!==null&&typeof u.render=="function"&&u.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Vt(l)?(m=!0,fo(n)):m=!1,n.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,Fc(n),u.updater=zo,n.stateNode=u,u._reactInternals=n,Yc(n,l,t,i),n=td(null,n,l,!0,m,i)):(n.tag=0,tt&&m&&Ec(n),Lt(null,n,u,i),n=n.child),n;case 16:l=n.elementType;e:{switch(Oo(t,n),t=n.pendingProps,u=l._init,l=u(l._payload),n.type=l,u=n.tag=xy(l),t=ks(l,t),u){case 0:n=ed(null,n,l,t,i);break e;case 1:n=nh(null,n,l,t,i);break e;case 11:n=Xm(null,n,l,t,i);break e;case 14:n=Zm(null,n,l,ks(l.type,t),i);break e}throw Error(a(306,l,""))}return n;case 0:return l=n.type,u=n.pendingProps,u=n.elementType===l?u:ks(l,u),ed(t,n,l,u,i);case 1:return l=n.type,u=n.pendingProps,u=n.elementType===l?u:ks(l,u),nh(t,n,l,u,i);case 3:e:{if(rh(n),t===null)throw Error(a(387));l=n.pendingProps,m=n.memoizedState,u=m.element,bm(t,n),So(n,l,null,i);var b=n.memoizedState;if(l=b.element,m.isDehydrated)if(m={element:l,isDehydrated:!1,cache:b.cache,pendingSuspenseBoundaries:b.pendingSuspenseBoundaries,transitions:b.transitions},n.updateQueue.baseState=m,n.memoizedState=m,n.flags&256){u=sa(Error(a(423)),n),n=ah(t,n,l,i,u);break e}else if(l!==u){u=sa(Error(a(424)),n),n=ah(t,n,l,i,u);break e}else for(rs=jn(n.stateNode.containerInfo.firstChild),ns=n,tt=!0,ws=null,i=gm(n,null,l,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Yr(),l===u){n=sn(t,n,i);break e}Lt(t,n,l,i)}n=n.child}return n;case 5:return Nm(n),t===null&&Mc(n),l=n.type,u=n.pendingProps,m=t!==null?t.memoizedProps:null,b=u.children,jc(l,u)?b=null:m!==null&&jc(l,m)&&(n.flags|=32),sh(t,n),Lt(t,n,b,i),n.child;case 6:return t===null&&Mc(n),null;case 13:return ih(t,n,i);case 4:return Lc(n,n.stateNode.containerInfo),l=n.pendingProps,t===null?n.child=Xr(n,null,l,i):Lt(t,n,l,i),n.child;case 11:return l=n.type,u=n.pendingProps,u=n.elementType===l?u:ks(l,u),Xm(t,n,l,u,i);case 7:return Lt(t,n,n.pendingProps,i),n.child;case 8:return Lt(t,n,n.pendingProps.children,i),n.child;case 12:return Lt(t,n,n.pendingProps.children,i),n.child;case 10:e:{if(l=n.type._context,u=n.pendingProps,m=n.memoizedProps,b=u.value,Je(No,l._currentValue),l._currentValue=b,m!==null)if(Ns(m.value,b)){if(m.children===u.children&&!Wt.current){n=sn(t,n,i);break e}}else for(m=n.child,m!==null&&(m.return=n);m!==null;){var T=m.dependencies;if(T!==null){b=m.child;for(var A=T.firstContext;A!==null;){if(A.context===l){if(m.tag===1){A=tn(-1,i&-i),A.tag=2;var V=m.updateQueue;if(V!==null){V=V.shared;var se=V.pending;se===null?A.next=A:(A.next=se.next,se.next=A),V.pending=A}}m.lanes|=i,A=m.alternate,A!==null&&(A.lanes|=i),Dc(m.return,i,n),T.lanes|=i;break}A=A.next}}else if(m.tag===10)b=m.type===n.type?null:m.child;else if(m.tag===18){if(b=m.return,b===null)throw Error(a(341));b.lanes|=i,T=b.alternate,T!==null&&(T.lanes|=i),Dc(b,i,n),b=m.sibling}else b=m.child;if(b!==null)b.return=m;else for(b=m;b!==null;){if(b===n){b=null;break}if(m=b.sibling,m!==null){m.return=b.return,b=m;break}b=b.return}m=b}Lt(t,n,u.children,i),n=n.child}return n;case 9:return u=n.type,l=n.pendingProps.children,ea(n,i),u=xs(u),l=l(u),n.flags|=1,Lt(t,n,l,i),n.child;case 14:return l=n.type,u=ks(l,n.pendingProps),u=ks(l.type,u),Zm(t,n,l,u,i);case 15:return eh(t,n,n.type,n.pendingProps,i);case 17:return l=n.type,u=n.pendingProps,u=n.elementType===l?u:ks(l,u),Oo(t,n),n.tag=1,Vt(l)?(t=!0,fo(n)):t=!1,ea(n,i),Km(n,l,u),Yc(n,l,u,i),td(null,n,l,!0,t,i);case 19:return lh(t,n,i);case 22:return th(t,n,i)}throw Error(a(156,n.tag))};function zh(t,n){return ux(t,n)}function uy(t,n,i,l){this.tag=t,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ps(t,n,i,l){return new uy(t,n,i,l)}function jd(t){return t=t.prototype,!(!t||!t.isReactComponent)}function xy(t){if(typeof t=="function")return jd(t)?1:0;if(t!=null){if(t=t.$$typeof,t===le)return 11;if(t===Ce)return 14}return 2}function zn(t,n){var i=t.alternate;return i===null?(i=ps(t.tag,n,t.key,t.mode),i.elementType=t.elementType,i.type=t.type,i.stateNode=t.stateNode,i.alternate=t,t.alternate=i):(i.pendingProps=n,i.type=t.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=t.flags&14680064,i.childLanes=t.childLanes,i.lanes=t.lanes,i.child=t.child,i.memoizedProps=t.memoizedProps,i.memoizedState=t.memoizedState,i.updateQueue=t.updateQueue,n=t.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=t.sibling,i.index=t.index,i.ref=t.ref,i}function Ko(t,n,i,l,u,m){var b=2;if(l=t,typeof t=="function")jd(t)&&(b=1);else if(typeof t=="string")b=5;else e:switch(t){case K:return cr(i.children,u,m,n);case _:b=8,u|=8;break;case ee:return t=ps(12,i,n,u|2),t.elementType=ee,t.lanes=m,t;case je:return t=ps(13,i,n,u),t.elementType=je,t.lanes=m,t;case ke:return t=ps(19,i,n,u),t.elementType=ke,t.lanes=m,t;case be:return Wo(i,u,m,n);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case $:b=10;break e;case G:b=9;break e;case le:b=11;break e;case Ce:b=14;break e;case Re:b=16,l=null;break e}throw Error(a(130,t==null?t:typeof t,""))}return n=ps(b,i,n,u),n.elementType=t,n.type=l,n.lanes=m,n}function cr(t,n,i,l){return t=ps(7,t,l,n),t.lanes=i,t}function Wo(t,n,i,l){return t=ps(22,t,l,n),t.elementType=be,t.lanes=i,t.stateNode={isHidden:!1},t}function Nd(t,n,i){return t=ps(6,t,null,n),t.lanes=i,t}function wd(t,n,i){return n=ps(4,t.children!==null?t.children:[],t.key,n),n.lanes=i,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}function my(t,n,i,l,u){this.tag=n,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Jl(0),this.expirationTimes=Jl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jl(0),this.identifierPrefix=l,this.onRecoverableError=u,this.mutableSourceEagerHydrationData=null}function kd(t,n,i,l,u,m,b,T,A){return t=new my(t,n,i,T,A),n===1?(n=1,m===!0&&(n|=8)):n=0,m=ps(3,null,null,n),t.current=m,m.stateNode=t,m.memoizedState={element:l,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fc(m),t}function hy(t,n,i){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:N,key:l==null?null:""+l,children:t,containerInfo:n,implementation:i}}function Ah(t){if(!t)return wn;t=t._reactInternals;e:{if(J(t)!==t||t.tag!==1)throw Error(a(170));var n=t;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(Vt(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(a(171))}if(t.tag===1){var i=t.type;if(Vt(i))return om(t,i,n)}return n}function Oh(t,n,i,l,u,m,b,T,A){return t=kd(i,l,!0,t,u,m,b,T,A),t.context=Ah(null),i=t.current,l=_t(),u=Mn(i),m=tn(l,u),m.callback=n??null,Cn(i,m,u),t.current.lanes=u,Ta(t,u,l),Jt(t,l),t}function Vo(t,n,i,l){var u=n.current,m=_t(),b=Mn(u);return i=Ah(i),n.context===null?n.context=i:n.pendingContext=i,n=tn(m,b),n.payload={element:t},l=l===void 0?null:l,l!==null&&(n.callback=l),t=Cn(u,n,b),t!==null&&(Es(t,u,b,m),ko(t,u,b)),b}function Go(t){return t=t.current,t.child?(t.child.tag===5,t.child.stateNode):null}function Dh(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var i=t.retryLane;t.retryLane=i!==0&&i<n?i:n}}function Sd(t,n){Dh(t,n),(t=t.alternate)&&Dh(t,n)}function py(){return null}var Ih=typeof reportError=="function"?reportError:function(t){console.error(t)};function Cd(t){this._internalRoot=t}Qo.prototype.render=Cd.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(a(409));Vo(t,n,null,null)},Qo.prototype.unmount=Cd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;ir(function(){Vo(null,t,null,null)}),n[Js]=null}};function Qo(t){this._internalRoot=t}Qo.prototype.unstable_scheduleHydration=function(t){if(t){var n=bx();t={blockedOn:null,target:t,priority:n};for(var i=0;i<yn.length&&n!==0&&n<yn[i].priority;i++);yn.splice(i,0,t),i===0&&Nx(t)}};function Ed(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Jo(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Fh(){}function fy(t,n,i,l,u){if(u){if(typeof l=="function"){var m=l;l=function(){var V=Go(b);m.call(V)}}var b=Oh(n,l,t,0,null,!1,!1,"",Fh);return t._reactRootContainer=b,t[Js]=b.current,Ka(t.nodeType===8?t.parentNode:t),ir(),b}for(;u=t.lastChild;)t.removeChild(u);if(typeof l=="function"){var T=l;l=function(){var V=Go(A);T.call(V)}}var A=kd(t,0,!1,null,null,!1,!1,"",Fh);return t._reactRootContainer=A,t[Js]=A.current,Ka(t.nodeType===8?t.parentNode:t),ir(function(){Vo(n,A,i,l)}),A}function Yo(t,n,i,l,u){var m=i._reactRootContainer;if(m){var b=m;if(typeof u=="function"){var T=u;u=function(){var A=Go(b);T.call(A)}}Vo(n,b,t,u)}else b=fy(i,n,t,u,l);return Go(b)}gx=function(t){switch(t.tag){case 3:var n=t.stateNode;if(n.current.memoizedState.isDehydrated){var i=Ma(n.pendingLanes);i!==0&&(Yl(n,i|1),Jt(n,ot()),(Be&6)===0&&(aa=ot()+500,kn()))}break;case 13:ir(function(){var l=en(t,1);if(l!==null){var u=_t();Es(l,t,1,u)}}),Sd(t,1)}},Xl=function(t){if(t.tag===13){var n=en(t,134217728);if(n!==null){var i=_t();Es(n,t,134217728,i)}Sd(t,134217728)}},yx=function(t){if(t.tag===13){var n=Mn(t),i=en(t,n);if(i!==null){var l=_t();Es(i,t,n,l)}Sd(t,n)}},bx=function(){return We},vx=function(t,n){var i=We;try{return We=t,n()}finally{We=i}},Is=function(t,n,i){switch(n){case"input":if(Ft(t,i),n=i.name,i.type==="radio"&&n!=null){for(i=t;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<i.length;n++){var l=i[n];if(l!==t&&l.form===t.form){var u=ho(l);if(!u)throw Error(a(90));qt(l),Ft(l,u)}}}break;case"textarea":bt(t,i);break;case"select":n=i.value,n!=null&&he(t,!!i.multiple,n,!1)}},Ea=yd,Or=ir;var gy={usingClientEntryPoint:!1,Events:[Ga,Wr,ho,Ca,Hi,yd]},li={findFiberByHostInstance:Xn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},yy={bundleType:li.bundleType,version:li.version,rendererPackageName:li.rendererPackageName,rendererConfig:li.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:M.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Tt(t),t===null?null:t.stateNode},findFiberByHostInstance:li.findFiberByHostInstance||py,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 Xo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xo.isDisabled&&Xo.supportsFiber)try{Gi=Xo.inject(yy),Ls=Xo}catch{}}return Yt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=gy,Yt.createPortal=function(t,n){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ed(n))throw Error(a(200));return hy(t,n,null,i)},Yt.createRoot=function(t,n){if(!Ed(t))throw Error(a(299));var i=!1,l="",u=Ih;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(u=n.onRecoverableError)),n=kd(t,1,!1,null,null,i,!1,l,u),t[Js]=n.current,Ka(t.nodeType===8?t.parentNode:t),new Cd(n)},Yt.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=Tt(n),t=t===null?null:t.stateNode,t},Yt.flushSync=function(t){return ir(t)},Yt.hydrate=function(t,n,i){if(!Jo(n))throw Error(a(200));return Yo(null,t,n,!0,i)},Yt.hydrateRoot=function(t,n,i){if(!Ed(t))throw Error(a(405));var l=i!=null&&i.hydratedSources||null,u=!1,m="",b=Ih;if(i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(m=i.identifierPrefix),i.onRecoverableError!==void 0&&(b=i.onRecoverableError)),n=Oh(n,null,t,1,i??null,u,!1,m,b),t[Js]=n.current,Ka(t),l)for(t=0;t<l.length;t++)i=l[t],u=i._getVersion,u=u(i._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[i,u]:n.mutableSourceEagerHydrationData.push(i,u);return new Qo(n)},Yt.render=function(t,n,i){if(!Jo(n))throw Error(a(200));return Yo(null,t,n,!1,i)},Yt.unmountComponentAtNode=function(t){if(!Jo(t))throw Error(a(40));return t._reactRootContainer?(ir(function(){Yo(null,null,t,!1,function(){t._reactRootContainer=null,t[Js]=null})}),!0):!1},Yt.unstable_batchedUpdates=yd,Yt.unstable_renderSubtreeIntoContainer=function(t,n,i,l){if(!Jo(i))throw Error(a(200));if(t==null||t._reactInternals===void 0)throw Error(a(38));return Yo(t,n,i,!1,l)},Yt.version="18.3.1-next-f1338f8080-20240426",Yt}var Kh;function qp(){if(Kh)return Md.exports;Kh=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(r){console.error(r)}}return s(),Md.exports=Ry(),Md.exports}var Wh;function My(){if(Wh)return Zo;Wh=1;var s=qp();return Zo.createRoot=s.createRoot,Zo.hydrateRoot=s.hydrateRoot,Zo}var Ty=My();qp();/**
|
|
41
|
-
* @remix-run/router v1.23.3
|
|
42
|
-
*
|
|
43
|
-
* Copyright (c) Remix Software Inc.
|
|
44
|
-
*
|
|
45
|
-
* This source code is licensed under the MIT license found in the
|
|
46
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
-
*
|
|
48
|
-
* @license MIT
|
|
49
|
-
*/function Ci(){return Ci=Object.assign?Object.assign.bind():function(s){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var o in a)({}).hasOwnProperty.call(a,o)&&(s[o]=a[o])}return s},Ci.apply(null,arguments)}var Fn;(function(s){s.Pop="POP",s.Push="PUSH",s.Replace="REPLACE"})(Fn||(Fn={}));const Vh="popstate";function zy(s){s===void 0&&(s={});function r(o,c){let{pathname:d,search:x,hash:h}=o.location;return du("",{pathname:d,search:x,hash:h},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function a(o,c){return typeof c=="string"?c:hl(c)}return Oy(r,a,null,s)}function it(s,r){if(s===!1||s===null||typeof s>"u")throw new Error(r)}function _u(s,r){if(!s){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function Ay(){return Math.random().toString(36).substr(2,8)}function Gh(s,r){return{usr:s.state,key:s.key,idx:r}}function du(s,r,a,o){return a===void 0&&(a=null),Ci({pathname:typeof s=="string"?s:s.pathname,search:"",hash:""},typeof r=="string"?ja(r):r,{state:a,key:r&&r.key||o||Ay()})}function hl(s){let{pathname:r="/",search:a="",hash:o=""}=s;return a&&a!=="?"&&(r+=a.charAt(0)==="?"?a:"?"+a),o&&o!=="#"&&(r+=o.charAt(0)==="#"?o:"#"+o),r}function ja(s){let r={};if(s){let a=s.indexOf("#");a>=0&&(r.hash=s.substr(a),s=s.substr(0,a));let o=s.indexOf("?");o>=0&&(r.search=s.substr(o),s=s.substr(0,o)),s&&(r.pathname=s)}return r}function Oy(s,r,a,o){o===void 0&&(o={});let{window:c=document.defaultView,v5Compat:d=!1}=o,x=c.history,h=Fn.Pop,f=null,y=g();y==null&&(y=0,x.replaceState(Ci({},x.state,{idx:y}),""));function g(){return(x.state||{idx:null}).idx}function j(){h=Fn.Pop;let R=g(),v=R==null?null:R-y;y=R,f&&f({action:h,location:E.location,delta:v})}function P(R,v){h=Fn.Push;let C=du(E.location,R,v);y=g()+1;let D=Gh(C,y),M=E.createHref(C);try{x.pushState(D,"",M)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;c.location.assign(M)}d&&f&&f({action:h,location:E.location,delta:1})}function S(R,v){h=Fn.Replace;let C=du(E.location,R,v);y=g();let D=Gh(C,y),M=E.createHref(C);x.replaceState(D,"",M),d&&f&&f({action:h,location:E.location,delta:0})}function k(R){let v=c.location.origin!=="null"?c.location.origin:c.location.href,C=typeof R=="string"?R:hl(R);return C=C.replace(/ $/,"%20"),it(v,"No window.location.(origin|href) available to create URL for href: "+C),new URL(C,v)}let E={get action(){return h},get location(){return s(c,x)},listen(R){if(f)throw new Error("A history only accepts one active listener");return c.addEventListener(Vh,j),f=R,()=>{c.removeEventListener(Vh,j),f=null}},createHref(R){return r(c,R)},createURL:k,encodeLocation(R){let v=k(R);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:P,replace:S,go(R){return x.go(R)}};return E}var Qh;(function(s){s.data="data",s.deferred="deferred",s.redirect="redirect",s.error="error"})(Qh||(Qh={}));function Dy(s,r,a){return a===void 0&&(a="/"),Iy(s,r,a)}function Iy(s,r,a,o){let c=typeof r=="string"?ja(r):r,d=fa(c.pathname||"/",a);if(d==null)return null;let x=Hp(s);Fy(x);let h=null,f=Gy(d);for(let y=0;h==null&&y<x.length;++y)h=Wy(x[y],f);return h}function Hp(s,r,a,o){r===void 0&&(r=[]),a===void 0&&(a=[]),o===void 0&&(o="");let c=(d,x,h)=>{let f={relativePath:h===void 0?d.path||"":h,caseSensitive:d.caseSensitive===!0,childrenIndex:x,route:d};f.relativePath.startsWith("/")&&(it(f.relativePath.startsWith(o),'Absolute route path "'+f.relativePath+'" nested under path '+('"'+o+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),f.relativePath=f.relativePath.slice(o.length));let y=Ln([o,f.relativePath]),g=a.concat(f);d.children&&d.children.length>0&&(it(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+y+'".')),Hp(d.children,r,g,y)),!(d.path==null&&!d.index)&&r.push({path:y,score:Hy(y,d.index),routesMeta:g})};return s.forEach((d,x)=>{var h;if(d.path===""||!((h=d.path)!=null&&h.includes("?")))c(d,x);else for(let f of Kp(d.path))c(d,x,f)}),r}function Kp(s){let r=s.split("/");if(r.length===0)return[];let[a,...o]=r,c=a.endsWith("?"),d=a.replace(/\?$/,"");if(o.length===0)return c?[d,""]:[d];let x=Kp(o.join("/")),h=[];return h.push(...x.map(f=>f===""?d:[d,f].join("/"))),c&&h.push(...x),h.map(f=>s.startsWith("/")&&f===""?"/":f)}function Fy(s){s.sort((r,a)=>r.score!==a.score?a.score-r.score:Ky(r.routesMeta.map(o=>o.childrenIndex),a.routesMeta.map(o=>o.childrenIndex)))}const Ly=/^:[\w-]+$/,_y=3,Uy=2,$y=1,By=10,qy=-2,Jh=s=>s==="*";function Hy(s,r){let a=s.split("/"),o=a.length;return a.some(Jh)&&(o+=qy),r&&(o+=Uy),a.filter(c=>!Jh(c)).reduce((c,d)=>c+(Ly.test(d)?_y:d===""?$y:By),o)}function Ky(s,r){return s.length===r.length&&s.slice(0,-1).every((o,c)=>o===r[c])?s[s.length-1]-r[r.length-1]:0}function Wy(s,r,a){let{routesMeta:o}=s,c={},d="/",x=[];for(let h=0;h<o.length;++h){let f=o[h],y=h===o.length-1,g=d==="/"?r:r.slice(d.length)||"/",j=uu({path:f.relativePath,caseSensitive:f.caseSensitive,end:y},g),P=f.route;if(!j)return null;Object.assign(c,j.params),x.push({params:c,pathname:Ln([d,j.pathname]),pathnameBase:Zy(Ln([d,j.pathnameBase])),route:P}),j.pathnameBase!=="/"&&(d=Ln([d,j.pathnameBase]))}return x}function uu(s,r){typeof s=="string"&&(s={path:s,caseSensitive:!1,end:!0});let[a,o]=Vy(s.path,s.caseSensitive,s.end),c=r.match(a);if(!c)return null;let d=c[0],x=d.replace(/(.)\/+$/,"$1"),h=c.slice(1);return{params:o.reduce((y,g,j)=>{let{paramName:P,isOptional:S}=g;if(P==="*"){let E=h[j]||"";x=d.slice(0,d.length-E.length).replace(/(.)\/+$/,"$1")}const k=h[j];return S&&!k?y[P]=void 0:y[P]=(k||"").replace(/%2F/g,"/"),y},{}),pathname:d,pathnameBase:x,pattern:s}}function Vy(s,r,a){r===void 0&&(r=!1),a===void 0&&(a=!0),_u(s==="*"||!s.endsWith("*")||s.endsWith("/*"),'Route path "'+s+'" will be treated as if it were '+('"'+s.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+s.replace(/\*$/,"/*")+'".'));let o=[],c="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(x,h,f)=>(o.push({paramName:h,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)"));return s.endsWith("*")?(o.push({paramName:"*"}),c+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?c+="\\/*$":s!==""&&s!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,r?void 0:"i"),o]}function Gy(s){try{return s.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return _u(!1,'The URL path "'+s+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+r+").")),s}}function fa(s,r){if(r==="/")return s;if(!s.toLowerCase().startsWith(r.toLowerCase()))return null;let a=r.endsWith("/")?r.length-1:r.length,o=s.charAt(a);return o&&o!=="/"?null:s.slice(a)||"/"}const Qy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jy=s=>Qy.test(s);function Yy(s,r){r===void 0&&(r="/");let{pathname:a,search:o="",hash:c=""}=typeof s=="string"?ja(s):s,d;if(a)if(Jy(a))d=a;else{if(a.includes("//")){let x=a;a=Gp(a),_u(!1,"Pathnames cannot have embedded double slashes - normalizing "+(x+" -> "+a))}a.startsWith("/")?d=Yh(a.substring(1),"/"):d=Yh(a,r)}else d=r;return{pathname:d,search:eb(o),hash:tb(c)}}function Yh(s,r){let a=r.replace(/\/+$/,"").split("/");return s.split("/").forEach(c=>{c===".."?a.length>1&&a.pop():c!=="."&&a.push(c)}),a.length>1?a.join("/"):"/"}function Ad(s,r,a,o){return"Cannot include a '"+s+"' character in a manually specified "+("`to."+r+"` field ["+JSON.stringify(o)+"]. Please separate it out to the ")+("`to."+a+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Xy(s){return s.filter((r,a)=>a===0||r.route.path&&r.route.path.length>0)}function Wp(s,r){let a=Xy(s);return r?a.map((o,c)=>c===a.length-1?o.pathname:o.pathnameBase):a.map(o=>o.pathnameBase)}function Vp(s,r,a,o){o===void 0&&(o=!1);let c;typeof s=="string"?c=ja(s):(c=Ci({},s),it(!c.pathname||!c.pathname.includes("?"),Ad("?","pathname","search",c)),it(!c.pathname||!c.pathname.includes("#"),Ad("#","pathname","hash",c)),it(!c.search||!c.search.includes("#"),Ad("#","search","hash",c)));let d=s===""||c.pathname==="",x=d?"/":c.pathname,h;if(x==null)h=a;else{let j=r.length-1;if(!o&&x.startsWith("..")){let P=x.split("/");for(;P[0]==="..";)P.shift(),j-=1;c.pathname=P.join("/")}h=j>=0?r[j]:"/"}let f=Yy(c,h),y=x&&x!=="/"&&x.endsWith("/"),g=(d||x===".")&&a.endsWith("/");return!f.pathname.endsWith("/")&&(y||g)&&(f.pathname+="/"),f}const Gp=s=>s.replace(/\/\/+/g,"/"),Ln=s=>Gp(s.join("/")),Zy=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),eb=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,tb=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s;function sb(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}const Qp=["post","put","patch","delete"];new Set(Qp);const nb=["get",...Qp];new Set(nb);/**
|
|
50
|
-
* React Router v6.30.4
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Remix Software Inc.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
-
*
|
|
57
|
-
* @license MIT
|
|
58
|
-
*/function Ei(){return Ei=Object.assign?Object.assign.bind():function(s){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var o in a)({}).hasOwnProperty.call(a,o)&&(s[o]=a[o])}return s},Ei.apply(null,arguments)}const Tl=p.createContext(null),Jp=p.createContext(null),Hn=p.createContext(null),zl=p.createContext(null),Kn=p.createContext({outlet:null,matches:[],isDataRoute:!1}),Yp=p.createContext(null);function rb(s,r){let{relative:a}=r===void 0?{}:r;Fi()||it(!1);let{basename:o,navigator:c}=p.useContext(Hn),{hash:d,pathname:x,search:h}=Al(s,{relative:a}),f=x;return o!=="/"&&(f=x==="/"?o:Ln([o,x])),c.createHref({pathname:f,search:h,hash:d})}function Fi(){return p.useContext(zl)!=null}function Wn(){return Fi()||it(!1),p.useContext(zl).location}function Xp(s){p.useContext(Hn).static||p.useLayoutEffect(s)}function Gs(){let{isDataRoute:s}=p.useContext(Kn);return s?yb():ab()}function ab(){Fi()||it(!1);let s=p.useContext(Tl),{basename:r,future:a,navigator:o}=p.useContext(Hn),{matches:c}=p.useContext(Kn),{pathname:d}=Wn(),x=JSON.stringify(Wp(c,a.v7_relativeSplatPath)),h=p.useRef(!1);return Xp(()=>{h.current=!0}),p.useCallback(function(y,g){if(g===void 0&&(g={}),!h.current)return;if(typeof y=="number"){o.go(y);return}let j=Vp(y,JSON.parse(x),d,g.relative==="path");s==null&&r!=="/"&&(j.pathname=j.pathname==="/"?r:Ln([r,j.pathname])),(g.replace?o.replace:o.push)(j,g.state,g)},[r,o,x,d,s])}function ib(){let{matches:s}=p.useContext(Kn),r=s[s.length-1];return r?r.params:{}}function Al(s,r){let{relative:a}=r===void 0?{}:r,{future:o}=p.useContext(Hn),{matches:c}=p.useContext(Kn),{pathname:d}=Wn(),x=JSON.stringify(Wp(c,o.v7_relativeSplatPath));return p.useMemo(()=>Vp(s,JSON.parse(x),d,a==="path"),[s,x,d,a])}function ob(s,r){return lb(s,r)}function lb(s,r,a,o){Fi()||it(!1);let{navigator:c}=p.useContext(Hn),{matches:d}=p.useContext(Kn),x=d[d.length-1],h=x?x.params:{};x&&x.pathname;let f=x?x.pathnameBase:"/";x&&x.route;let y=Wn(),g;if(r){var j;let R=typeof r=="string"?ja(r):r;f==="/"||(j=R.pathname)!=null&&j.startsWith(f)||it(!1),g=R}else g=y;let P=g.pathname||"/",S=P;if(f!=="/"){let R=f.replace(/^\//,"").split("/");S="/"+P.replace(/^\//,"").split("/").slice(R.length).join("/")}let k=Dy(s,{pathname:S}),E=mb(k&&k.map(R=>Object.assign({},R,{params:Object.assign({},h,R.params),pathname:Ln([f,c.encodeLocation?c.encodeLocation(R.pathname).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?f:Ln([f,c.encodeLocation?c.encodeLocation(R.pathnameBase).pathname:R.pathnameBase])})),d,a,o);return r&&E?p.createElement(zl.Provider,{value:{location:Ei({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:Fn.Pop}},E):E}function cb(){let s=gb(),r=sb(s)?s.status+" "+s.statusText:s instanceof Error?s.message:JSON.stringify(s),a=s instanceof Error?s.stack:null,c={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},r),a?p.createElement("pre",{style:c},a):null,null)}const db=p.createElement(cb,null);class ub extends p.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,a){return a.location!==r.location||a.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:a.error,location:a.location,revalidation:r.revalidation||a.revalidation}}componentDidCatch(r,a){console.error("React Router caught the following error during render",r,a)}render(){return this.state.error!==void 0?p.createElement(Kn.Provider,{value:this.props.routeContext},p.createElement(Yp.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function xb(s){let{routeContext:r,match:a,children:o}=s,c=p.useContext(Tl);return c&&c.static&&c.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=a.route.id),p.createElement(Kn.Provider,{value:r},o)}function mb(s,r,a,o){var c;if(r===void 0&&(r=[]),a===void 0&&(a=null),o===void 0&&(o=null),s==null){var d;if(!a)return null;if(a.errors)s=a.matches;else if((d=o)!=null&&d.v7_partialHydration&&r.length===0&&!a.initialized&&a.matches.length>0)s=a.matches;else return null}let x=s,h=(c=a)==null?void 0:c.errors;if(h!=null){let g=x.findIndex(j=>j.route.id&&h?.[j.route.id]!==void 0);g>=0||it(!1),x=x.slice(0,Math.min(x.length,g+1))}let f=!1,y=-1;if(a&&o&&o.v7_partialHydration)for(let g=0;g<x.length;g++){let j=x[g];if((j.route.HydrateFallback||j.route.hydrateFallbackElement)&&(y=g),j.route.id){let{loaderData:P,errors:S}=a,k=j.route.loader&&P[j.route.id]===void 0&&(!S||S[j.route.id]===void 0);if(j.route.lazy||k){f=!0,y>=0?x=x.slice(0,y+1):x=[x[0]];break}}}return x.reduceRight((g,j,P)=>{let S,k=!1,E=null,R=null;a&&(S=h&&j.route.id?h[j.route.id]:void 0,E=j.route.errorElement||db,f&&(y<0&&P===0?(bb("route-fallback"),k=!0,R=null):y===P&&(k=!0,R=j.route.hydrateFallbackElement||null)));let v=r.concat(x.slice(0,P+1)),C=()=>{let D;return S?D=E:k?D=R:j.route.Component?D=p.createElement(j.route.Component,null):j.route.element?D=j.route.element:D=g,p.createElement(xb,{match:j,routeContext:{outlet:g,matches:v,isDataRoute:a!=null},children:D})};return a&&(j.route.ErrorBoundary||j.route.errorElement||P===0)?p.createElement(ub,{location:a.location,revalidation:a.revalidation,component:E,error:S,children:C(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):C()},null)}var Zp=(function(s){return s.UseBlocker="useBlocker",s.UseRevalidator="useRevalidator",s.UseNavigateStable="useNavigate",s})(Zp||{}),ef=(function(s){return s.UseBlocker="useBlocker",s.UseLoaderData="useLoaderData",s.UseActionData="useActionData",s.UseRouteError="useRouteError",s.UseNavigation="useNavigation",s.UseRouteLoaderData="useRouteLoaderData",s.UseMatches="useMatches",s.UseRevalidator="useRevalidator",s.UseNavigateStable="useNavigate",s.UseRouteId="useRouteId",s})(ef||{});function hb(s){let r=p.useContext(Tl);return r||it(!1),r}function pb(s){let r=p.useContext(Jp);return r||it(!1),r}function fb(s){let r=p.useContext(Kn);return r||it(!1),r}function tf(s){let r=fb(),a=r.matches[r.matches.length-1];return a.route.id||it(!1),a.route.id}function gb(){var s;let r=p.useContext(Yp),a=pb(),o=tf();return r!==void 0?r:(s=a.errors)==null?void 0:s[o]}function yb(){let{router:s}=hb(Zp.UseNavigateStable),r=tf(ef.UseNavigateStable),a=p.useRef(!1);return Xp(()=>{a.current=!0}),p.useCallback(function(c,d){d===void 0&&(d={}),a.current&&(typeof c=="number"?s.navigate(c):s.navigate(c,Ei({fromRouteId:r},d)))},[s,r])}const Xh={};function bb(s,r,a){Xh[s]||(Xh[s]=!0)}function vb(s,r){s?.v7_startTransition,s?.v7_relativeSplatPath}function It(s){it(!1)}function jb(s){let{basename:r="/",children:a=null,location:o,navigationType:c=Fn.Pop,navigator:d,static:x=!1,future:h}=s;Fi()&&it(!1);let f=r.replace(/^\/*/,"/"),y=p.useMemo(()=>({basename:f,navigator:d,static:x,future:Ei({v7_relativeSplatPath:!1},h)}),[f,h,d,x]);typeof o=="string"&&(o=ja(o));let{pathname:g="/",search:j="",hash:P="",state:S=null,key:k="default"}=o,E=p.useMemo(()=>{let R=fa(g,f);return R==null?null:{location:{pathname:R,search:j,hash:P,state:S,key:k},navigationType:c}},[f,g,j,P,S,k,c]);return E==null?null:p.createElement(Hn.Provider,{value:y},p.createElement(zl.Provider,{children:a,value:E}))}function Nb(s){let{children:r,location:a}=s;return ob(xu(r),a)}new Promise(()=>{});function xu(s,r){r===void 0&&(r=[]);let a=[];return p.Children.forEach(s,(o,c)=>{if(!p.isValidElement(o))return;let d=[...r,c];if(o.type===p.Fragment){a.push.apply(a,xu(o.props.children,d));return}o.type!==It&&it(!1),!o.props.index||!o.props.children||it(!1);let x={id:o.props.id||d.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,loader:o.props.loader,action:o.props.action,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(x.children=xu(o.props.children,d)),a.push(x)}),a}/**
|
|
59
|
-
* React Router DOM v6.30.4
|
|
60
|
-
*
|
|
61
|
-
* Copyright (c) Remix Software Inc.
|
|
62
|
-
*
|
|
63
|
-
* This source code is licensed under the MIT license found in the
|
|
64
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
65
|
-
*
|
|
66
|
-
* @license MIT
|
|
67
|
-
*/function pl(){return pl=Object.assign?Object.assign.bind():function(s){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var o in a)({}).hasOwnProperty.call(a,o)&&(s[o]=a[o])}return s},pl.apply(null,arguments)}function sf(s,r){if(s==null)return{};var a={};for(var o in s)if({}.hasOwnProperty.call(s,o)){if(r.indexOf(o)!==-1)continue;a[o]=s[o]}return a}function wb(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function kb(s,r){return s.button===0&&(!r||r==="_self")&&!wb(s)}const Sb=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Cb=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Eb="6";try{window.__reactRouterVersion=Eb}catch{}const Pb=p.createContext({isTransitioning:!1}),Rb="startTransition",Zh=Cy[Rb];function Mb(s){let{basename:r,children:a,future:o,window:c}=s,d=p.useRef();d.current==null&&(d.current=zy({window:c,v5Compat:!0}));let x=d.current,[h,f]=p.useState({action:x.action,location:x.location}),{v7_startTransition:y}=o||{},g=p.useCallback(j=>{y&&Zh?Zh(()=>f(j)):f(j)},[f,y]);return p.useLayoutEffect(()=>x.listen(g),[x,g]),p.useEffect(()=>vb(o),[o]),p.createElement(jb,{basename:r,children:a,location:h.location,navigationType:h.action,navigator:x,future:o})}const Tb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",zb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,nf=p.forwardRef(function(r,a){let{onClick:o,relative:c,reloadDocument:d,replace:x,state:h,target:f,to:y,preventScrollReset:g,viewTransition:j}=r,P=sf(r,Sb),{basename:S}=p.useContext(Hn),k,E=!1;if(typeof y=="string"&&zb.test(y)&&(k=y,Tb))try{let D=new URL(window.location.href),M=y.startsWith("//")?new URL(D.protocol+y):new URL(y),w=fa(M.pathname,S);M.origin===D.origin&&w!=null?y=w+M.search+M.hash:E=!0}catch{}let R=rb(y,{relative:c}),v=Db(y,{replace:x,state:h,target:f,preventScrollReset:g,relative:c,viewTransition:j});function C(D){o&&o(D),D.defaultPrevented||v(D)}return p.createElement("a",pl({},P,{href:k||R,onClick:E||d?o:C,ref:a,target:f}))}),Ab=p.forwardRef(function(r,a){let{"aria-current":o="page",caseSensitive:c=!1,className:d="",end:x=!1,style:h,to:f,viewTransition:y,children:g}=r,j=sf(r,Cb),P=Al(f,{relative:j.relative}),S=Wn(),k=p.useContext(Jp),{navigator:E,basename:R}=p.useContext(Hn),v=k!=null&&Ib(P)&&y===!0,C=E.encodeLocation?E.encodeLocation(P).pathname:P.pathname,D=S.pathname,M=k&&k.navigation&&k.navigation.location?k.navigation.location.pathname:null;c||(D=D.toLowerCase(),M=M?M.toLowerCase():null,C=C.toLowerCase()),M&&R&&(M=fa(M,R)||M);const w=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let N=D===C||!x&&D.startsWith(C)&&D.charAt(w)==="/",K=M!=null&&(M===C||!x&&M.startsWith(C)&&M.charAt(C.length)==="/"),_={isActive:N,isPending:K,isTransitioning:v},ee=N?o:void 0,$;typeof d=="function"?$=d(_):$=[d,N?"active":null,K?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let G=typeof h=="function"?h(_):h;return p.createElement(nf,pl({},j,{"aria-current":ee,className:$,ref:a,style:G,to:f,viewTransition:y}),typeof g=="function"?g(_):g)});var mu;(function(s){s.UseScrollRestoration="useScrollRestoration",s.UseSubmit="useSubmit",s.UseSubmitFetcher="useSubmitFetcher",s.UseFetcher="useFetcher",s.useViewTransitionState="useViewTransitionState"})(mu||(mu={}));var ep;(function(s){s.UseFetcher="useFetcher",s.UseFetchers="useFetchers",s.UseScrollRestoration="useScrollRestoration"})(ep||(ep={}));function Ob(s){let r=p.useContext(Tl);return r||it(!1),r}function Db(s,r){let{target:a,replace:o,state:c,preventScrollReset:d,relative:x,viewTransition:h}=r===void 0?{}:r,f=Gs(),y=Wn(),g=Al(s,{relative:x});return p.useCallback(j=>{if(kb(j,a)){j.preventDefault();let P=o!==void 0?o:hl(y)===hl(g);f(s,{replace:P,state:c,preventScrollReset:d,relative:x,viewTransition:h})}},[y,f,g,o,c,a,s,d,x,h])}function Ib(s,r){r===void 0&&(r={});let a=p.useContext(Pb);a==null&&it(!1);let{basename:o}=Ob(mu.useViewTransitionState),c=Al(s,{relative:r.relative});if(!a.isTransitioning)return!1;let d=fa(a.currentLocation.pathname,o)||a.currentLocation.pathname,x=fa(a.nextLocation.pathname,o)||a.nextLocation.pathname;return uu(c.pathname,x)!=null||uu(c.pathname,d)!=null}var Na=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(s){return this.listeners.add(s),this.onSubscribe(),()=>{this.listeners.delete(s),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Fb=class extends Na{#e;#t;#s;constructor(){super(),this.#s=s=>{if(typeof window<"u"&&window.addEventListener){const r=()=>s();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(s){this.#s=s,this.#t?.(),this.#t=s(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(s){this.#e!==s&&(this.#e=s,this.onFocus())}onFocus(){const s=this.isFocused();this.listeners.forEach(r=>{r(s)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Uu=new Fb,Lb={setTimeout:(s,r)=>setTimeout(s,r),clearTimeout:s=>clearTimeout(s),setInterval:(s,r)=>setInterval(s,r),clearInterval:s=>clearInterval(s)},_b=class{#e=Lb;#t=!1;setTimeoutProvider(s){this.#e=s}setTimeout(s,r){return this.#e.setTimeout(s,r)}clearTimeout(s){this.#e.clearTimeout(s)}setInterval(s,r){return this.#e.setInterval(s,r)}clearInterval(s){this.#e.clearInterval(s)}},fr=new _b;function Ub(s){setTimeout(s,0)}var $b=typeof window>"u"||"Deno"in globalThis;function Ut(){}function Bb(s,r){return typeof s=="function"?s(r):s}function hu(s){return typeof s=="number"&&s>=0&&s!==1/0}function rf(s,r){return Math.max(s+(r||0)-Date.now(),0)}function _n(s,r){return typeof s=="function"?s(r):s}function fs(s,r){return typeof s=="function"?s(r):s}function tp(s,r){const{type:a="all",exact:o,fetchStatus:c,predicate:d,queryKey:x,stale:h}=s;if(x){if(o){if(r.queryHash!==$u(x,r.options))return!1}else if(!Pi(r.queryKey,x))return!1}if(a!=="all"){const f=r.isActive();if(a==="active"&&!f||a==="inactive"&&f)return!1}return!(typeof h=="boolean"&&r.isStale()!==h||c&&c!==r.state.fetchStatus||d&&!d(r))}function sp(s,r){const{exact:a,status:o,predicate:c,mutationKey:d}=s;if(d){if(!r.options.mutationKey)return!1;if(a){if(wr(r.options.mutationKey)!==wr(d))return!1}else if(!Pi(r.options.mutationKey,d))return!1}return!(o&&r.state.status!==o||c&&!c(r))}function $u(s,r){return(r?.queryKeyHashFn||wr)(s)}function wr(s){return JSON.stringify(s,(r,a)=>pu(a)?Object.keys(a).sort().reduce((o,c)=>(o[c]=a[c],o),{}):a)}function Pi(s,r){return s===r?!0:typeof s!=typeof r?!1:s&&r&&typeof s=="object"&&typeof r=="object"?Object.keys(r).every(a=>Pi(s[a],r[a])):!1}var qb=Object.prototype.hasOwnProperty;function af(s,r,a=0){if(s===r)return s;if(a>500)return r;const o=np(s)&&np(r);if(!o&&!(pu(s)&&pu(r)))return r;const d=(o?s:Object.keys(s)).length,x=o?r:Object.keys(r),h=x.length,f=o?new Array(h):{};let y=0;for(let g=0;g<h;g++){const j=o?g:x[g],P=s[j],S=r[j];if(P===S){f[j]=P,(o?g<d:qb.call(s,j))&&y++;continue}if(P===null||S===null||typeof P!="object"||typeof S!="object"){f[j]=S;continue}const k=af(P,S,a+1);f[j]=k,k===P&&y++}return d===h&&y===d?s:f}function fl(s,r){if(!r||Object.keys(s).length!==Object.keys(r).length)return!1;for(const a in s)if(s[a]!==r[a])return!1;return!0}function np(s){return Array.isArray(s)&&s.length===Object.keys(s).length}function pu(s){if(!rp(s))return!1;const r=s.constructor;if(r===void 0)return!0;const a=r.prototype;return!(!rp(a)||!a.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(s)!==Object.prototype)}function rp(s){return Object.prototype.toString.call(s)==="[object Object]"}function Hb(s){return new Promise(r=>{fr.setTimeout(r,s)})}function fu(s,r,a){return typeof a.structuralSharing=="function"?a.structuralSharing(s,r):a.structuralSharing!==!1?af(s,r):r}function Kb(s,r,a=0){const o=[...s,r];return a&&o.length>a?o.slice(1):o}function Wb(s,r,a=0){const o=[r,...s];return a&&o.length>a?o.slice(0,-1):o}var Bu=Symbol();function of(s,r){return!s.queryFn&&r?.initialPromise?()=>r.initialPromise:!s.queryFn||s.queryFn===Bu?()=>Promise.reject(new Error(`Missing queryFn: '${s.queryHash}'`)):s.queryFn}function qu(s,r){return typeof s=="function"?s(...r):!!s}function Vb(s,r,a){let o=!1,c;return Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(c??=r(),o||(o=!0,c.aborted?a():c.addEventListener("abort",a,{once:!0})),c)}),s}var Ri=(()=>{let s=()=>$b;return{isServer(){return s()},setIsServer(r){s=r}}})();function gu(){let s,r;const a=new Promise((c,d)=>{s=c,r=d});a.status="pending",a.catch(()=>{});function o(c){Object.assign(a,c),delete a.resolve,delete a.reject}return a.resolve=c=>{o({status:"fulfilled",value:c}),s(c)},a.reject=c=>{o({status:"rejected",reason:c}),r(c)},a}var Gb=Ub;function Qb(){let s=[],r=0,a=h=>{h()},o=h=>{h()},c=Gb;const d=h=>{r?s.push(h):c(()=>{a(h)})},x=()=>{const h=s;s=[],h.length&&c(()=>{o(()=>{h.forEach(f=>{a(f)})})})};return{batch:h=>{let f;r++;try{f=h()}finally{r--,r||x()}return f},batchCalls:h=>(...f)=>{d(()=>{h(...f)})},schedule:d,setNotifyFunction:h=>{a=h},setBatchNotifyFunction:h=>{o=h},setScheduler:h=>{c=h}}}var ft=Qb(),Jb=class extends Na{#e=!0;#t;#s;constructor(){super(),this.#s=s=>{if(typeof window<"u"&&window.addEventListener){const r=()=>s(!0),a=()=>s(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",a)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(s){this.#s=s,this.#t?.(),this.#t=s(this.setOnline.bind(this))}setOnline(s){this.#e!==s&&(this.#e=s,this.listeners.forEach(a=>{a(s)}))}isOnline(){return this.#e}},gl=new Jb;function Yb(s){return Math.min(1e3*2**s,3e4)}function lf(s){return(s??"online")==="online"?gl.isOnline():!0}var yu=class extends Error{constructor(s){super("CancelledError"),this.revert=s?.revert,this.silent=s?.silent}};function cf(s){let r=!1,a=0,o;const c=gu(),d=()=>c.status!=="pending",x=E=>{if(!d()){const R=new yu(E);P(R),s.onCancel?.(R)}},h=()=>{r=!0},f=()=>{r=!1},y=()=>Uu.isFocused()&&(s.networkMode==="always"||gl.isOnline())&&s.canRun(),g=()=>lf(s.networkMode)&&s.canRun(),j=E=>{d()||(o?.(),c.resolve(E))},P=E=>{d()||(o?.(),c.reject(E))},S=()=>new Promise(E=>{o=R=>{(d()||y())&&E(R)},s.onPause?.()}).then(()=>{o=void 0,d()||s.onContinue?.()}),k=()=>{if(d())return;let E;const R=a===0?s.initialPromise:void 0;try{E=R??s.fn()}catch(v){E=Promise.reject(v)}Promise.resolve(E).then(j).catch(v=>{if(d())return;const C=s.retry??(Ri.isServer()?0:3),D=s.retryDelay??Yb,M=typeof D=="function"?D(a,v):D,w=C===!0||typeof C=="number"&&a<C||typeof C=="function"&&C(a,v);if(r||!w){P(v);return}a++,s.onFail?.(a,v),Hb(M).then(()=>y()?void 0:S()).then(()=>{r?P(v):k()})})};return{promise:c,status:()=>c.status,cancel:x,continue:()=>(o?.(),c),cancelRetry:h,continueRetry:f,canStart:g,start:()=>(g()?k():S().then(k),c)}}var df=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),hu(this.gcTime)&&(this.#e=fr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(s){this.gcTime=Math.max(this.gcTime||0,s??(Ri.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e&&(fr.clearTimeout(this.#e),this.#e=void 0)}},Xb=class extends df{#e;#t;#s;#r;#n;#a;#i;constructor(s){super(),this.#i=!1,this.#a=s.defaultOptions,this.setOptions(s.options),this.observers=[],this.#r=s.client,this.#s=this.#r.getQueryCache(),this.queryKey=s.queryKey,this.queryHash=s.queryHash,this.#e=ip(this.options),this.state=s.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(s){if(this.options={...this.#a,...s},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=ip(this.options);r.data!==void 0&&(this.setState(ap(r.data,r.dataUpdatedAt)),this.#e=r)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#s.remove(this)}setData(s,r){const a=fu(this.state.data,s,this.options);return this.#l({data:a,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),a}setState(s,r){this.#l({type:"setState",state:s,setStateOptions:r})}cancel(s){const r=this.#n?.promise;return this.#n?.cancel(s),r?r.then(Ut).catch(Ut):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(s=>fs(s.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Bu||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(s=>_n(s.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(s=>s.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(s=0){return this.state.data===void 0?!0:s==="static"?!1:this.state.isInvalidated?!0:!rf(this.state.dataUpdatedAt,s)}onFocus(){this.observers.find(r=>r.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(r=>r.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(s){this.observers.includes(s)||(this.observers.push(s),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",query:this,observer:s}))}removeObserver(s){this.observers.includes(s)&&(this.observers=this.observers.filter(r=>r!==s),this.observers.length||(this.#n&&(this.#i||this.#o()?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:s}))}getObserversCount(){return this.observers.length}#o(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(s,r){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&r?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(s&&this.setOptions(s),!this.options.queryFn){const h=this.observers.find(f=>f.options.queryFn);h&&this.setOptions(h.options)}const a=new AbortController,o=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#i=!0,a.signal)})},c=()=>{const h=of(this.options,r),y=(()=>{const g={client:this.#r,queryKey:this.queryKey,meta:this.meta};return o(g),g})();return this.#i=!1,this.options.persister?this.options.persister(h,y,this):h(y)},x=(()=>{const h={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:c};return o(h),h})();this.options.behavior?.onFetch(x,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==x.fetchOptions?.meta)&&this.#l({type:"fetch",meta:x.fetchOptions?.meta}),this.#n=cf({initialPromise:r?.initialPromise,fn:x.fetchFn,onCancel:h=>{h instanceof yu&&h.revert&&this.setState({...this.#t,fetchStatus:"idle"}),a.abort()},onFail:(h,f)=>{this.#l({type:"failed",failureCount:h,error:f})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:x.options.retry,retryDelay:x.options.retryDelay,networkMode:x.options.networkMode,canRun:()=>!0});try{const h=await this.#n.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#s.config.onSuccess?.(h,this),this.#s.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof yu){if(h.silent)return this.#n.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#l({type:"error",error:h}),this.#s.config.onError?.(h,this),this.#s.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#l(s){const r=a=>{switch(s.type){case"failed":return{...a,fetchFailureCount:s.failureCount,fetchFailureReason:s.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...uf(a.data,this.options),fetchMeta:s.meta??null};case"success":const o={...a,...ap(s.data,s.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!s.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=s.manual?o:void 0,o;case"error":const c=s.error;return{...a,error:c,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...s.state}}};this.state=r(this.state),ft.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:s})})}};function uf(s,r){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:lf(r.networkMode)?"fetching":"paused",...s===void 0&&{error:null,status:"pending"}}}function ap(s,r){return{data:s,dataUpdatedAt:r??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ip(s){const r=typeof s.initialData=="function"?s.initialData():s.initialData,a=r!==void 0,o=a?typeof s.initialDataUpdatedAt=="function"?s.initialDataUpdatedAt():s.initialDataUpdatedAt:0;return{data:r,dataUpdateCount:0,dataUpdatedAt:a?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:a?"success":"pending",fetchStatus:"idle"}}var Zb=class extends Na{constructor(s,r){super(),this.options=r,this.#e=s,this.#o=null,this.#i=gu(),this.bindMethods(),this.setOptions(r)}#e;#t=void 0;#s=void 0;#r=void 0;#n;#a;#i;#o;#l;#m;#h;#d;#u;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),op(this.#t,this.options)?this.#x():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return bu(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bu(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#v(),this.#j(),this.#t.removeObserver(this)}setOptions(s){const r=this.options,a=this.#t;if(this.options=this.#e.defaultQueryOptions(s),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof fs(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#N(),this.#t.setOptions(this.options),r._defaulted&&!fl(this.options,r)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const o=this.hasListeners();o&&lp(this.#t,a,this.options,r)&&this.#x(),this.updateResult(),o&&(this.#t!==a||fs(this.options.enabled,this.#t)!==fs(r.enabled,this.#t)||_n(this.options.staleTime,this.#t)!==_n(r.staleTime,this.#t))&&this.#f();const c=this.#g();o&&(this.#t!==a||fs(this.options.enabled,this.#t)!==fs(r.enabled,this.#t)||c!==this.#c)&&this.#y(c)}getOptimisticResult(s){const r=this.#e.getQueryCache().build(this.#e,s),a=this.createResult(r,s);return t1(this,a)&&(this.#r=a,this.#a=this.options,this.#n=this.#t.state),a}getCurrentResult(){return this.#r}trackResult(s,r){return new Proxy(s,{get:(a,o)=>(this.trackProp(o),r?.(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,o))})}trackProp(s){this.#p.add(s)}getCurrentQuery(){return this.#t}refetch({...s}={}){return this.fetch({...s})}fetchOptimistic(s){const r=this.#e.defaultQueryOptions(s),a=this.#e.getQueryCache().build(this.#e,r);return a.fetch().then(()=>this.createResult(a,r))}fetch(s){return this.#x({...s,cancelRefetch:s.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#x(s){this.#N();let r=this.#t.fetch(this.options,s);return s?.throwOnError||(r=r.catch(Ut)),r}#f(){this.#v();const s=_n(this.options.staleTime,this.#t);if(Ri.isServer()||this.#r.isStale||!hu(s))return;const a=rf(this.#r.dataUpdatedAt,s)+1;this.#d=fr.setTimeout(()=>{this.#r.isStale||this.updateResult()},a)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(s){this.#j(),this.#c=s,!(Ri.isServer()||fs(this.options.enabled,this.#t)===!1||!hu(this.#c)||this.#c===0)&&(this.#u=fr.setInterval(()=>{(this.options.refetchIntervalInBackground||Uu.isFocused())&&this.#x()},this.#c))}#b(){this.#f(),this.#y(this.#g())}#v(){this.#d&&(fr.clearTimeout(this.#d),this.#d=void 0)}#j(){this.#u&&(fr.clearInterval(this.#u),this.#u=void 0)}createResult(s,r){const a=this.#t,o=this.options,c=this.#r,d=this.#n,x=this.#a,f=s!==a?s.state:this.#s,{state:y}=s;let g={...y},j=!1,P;if(r._optimisticResults){const _=this.hasListeners(),ee=!_&&op(s,r),$=_&&lp(s,a,r,o);(ee||$)&&(g={...g,...uf(y.data,s.options)}),r._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:S,errorUpdatedAt:k,status:E}=g;P=g.data;let R=!1;if(r.placeholderData!==void 0&&P===void 0&&E==="pending"){let _;c?.isPlaceholderData&&r.placeholderData===x?.placeholderData?(_=c.data,R=!0):_=typeof r.placeholderData=="function"?r.placeholderData(this.#h?.state.data,this.#h):r.placeholderData,_!==void 0&&(E="success",P=fu(c?.data,_,r),j=!0)}if(r.select&&P!==void 0&&!R)if(c&&P===d?.data&&r.select===this.#l)P=this.#m;else try{this.#l=r.select,P=r.select(P),P=fu(c?.data,P,r),this.#m=P,this.#o=null}catch(_){this.#o=_}this.#o&&(S=this.#o,P=this.#m,k=Date.now(),E="error");const v=g.fetchStatus==="fetching",C=E==="pending",D=E==="error",M=C&&v,w=P!==void 0,K={status:E,fetchStatus:g.fetchStatus,isPending:C,isSuccess:E==="success",isError:D,isInitialLoading:M,isLoading:M,data:P,dataUpdatedAt:g.dataUpdatedAt,error:S,errorUpdatedAt:k,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:s.isFetched(),isFetchedAfterMount:g.dataUpdateCount>f.dataUpdateCount||g.errorUpdateCount>f.errorUpdateCount,isFetching:v,isRefetching:v&&!C,isLoadingError:D&&!w,isPaused:g.fetchStatus==="paused",isPlaceholderData:j,isRefetchError:D&&w,isStale:Hu(s,r),refetch:this.refetch,promise:this.#i,isEnabled:fs(r.enabled,s)!==!1};if(this.options.experimental_prefetchInRender){const _=K.data!==void 0,ee=K.status==="error"&&!_,$=je=>{ee?je.reject(K.error):_&&je.resolve(K.data)},G=()=>{const je=this.#i=K.promise=gu();$(je)},le=this.#i;switch(le.status){case"pending":s.queryHash===a.queryHash&&$(le);break;case"fulfilled":(ee||K.data!==le.value)&&G();break;case"rejected":(!ee||K.error!==le.reason)&&G();break}}return K}updateResult(){const s=this.#r,r=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#a=this.options,this.#n.data!==void 0&&(this.#h=this.#t),fl(r,s))return;this.#r=r;const a=()=>{if(!s)return!0;const{notifyOnChangeProps:o}=this.options,c=typeof o=="function"?o():o;if(c==="all"||!c&&!this.#p.size)return!0;const d=new Set(c??this.#p);return this.options.throwOnError&&d.add("error"),Object.keys(this.#r).some(x=>{const h=x;return this.#r[h]!==s[h]&&d.has(h)})};this.#w({listeners:a()})}#N(){const s=this.#e.getQueryCache().build(this.#e,this.options);if(s===this.#t)return;const r=this.#t;this.#t=s,this.#s=s.state,this.hasListeners()&&(r?.removeObserver(this),s.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#w(s){ft.batch(()=>{s.listeners&&this.listeners.forEach(r=>{r(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function e1(s,r){return fs(r.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&r.retryOnMount===!1)}function op(s,r){return e1(s,r)||s.state.data!==void 0&&bu(s,r,r.refetchOnMount)}function bu(s,r,a){if(fs(r.enabled,s)!==!1&&_n(r.staleTime,s)!=="static"){const o=typeof a=="function"?a(s):a;return o==="always"||o!==!1&&Hu(s,r)}return!1}function lp(s,r,a,o){return(s!==r||fs(o.enabled,s)===!1)&&(!a.suspense||s.state.status!=="error")&&Hu(s,a)}function Hu(s,r){return fs(r.enabled,s)!==!1&&s.isStaleByTime(_n(r.staleTime,s))}function t1(s,r){return!fl(s.getCurrentResult(),r)}function cp(s){return{onFetch:(r,a)=>{const o=r.options,c=r.fetchOptions?.meta?.fetchMore?.direction,d=r.state.data?.pages||[],x=r.state.data?.pageParams||[];let h={pages:[],pageParams:[]},f=0;const y=async()=>{let g=!1;const j=k=>{Vb(k,()=>r.signal,()=>g=!0)},P=of(r.options,r.fetchOptions),S=async(k,E,R)=>{if(g)return Promise.reject();if(E==null&&k.pages.length)return Promise.resolve(k);const C=(()=>{const N={client:r.client,queryKey:r.queryKey,pageParam:E,direction:R?"backward":"forward",meta:r.options.meta};return j(N),N})(),D=await P(C),{maxPages:M}=r.options,w=R?Wb:Kb;return{pages:w(k.pages,D,M),pageParams:w(k.pageParams,E,M)}};if(c&&d.length){const k=c==="backward",E=k?s1:dp,R={pages:d,pageParams:x},v=E(o,R);h=await S(R,v,k)}else{const k=s??d.length;do{const E=f===0?x[0]??o.initialPageParam:dp(o,h);if(f>0&&E==null)break;h=await S(h,E),f++}while(f<k)}return h};r.options.persister?r.fetchFn=()=>r.options.persister?.(y,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},a):r.fetchFn=y}}}function dp(s,{pages:r,pageParams:a}){const o=r.length-1;return r.length>0?s.getNextPageParam(r[o],r,a[o],a):void 0}function s1(s,{pages:r,pageParams:a}){return r.length>0?s.getPreviousPageParam?.(r[0],r,a[0],a):void 0}var n1=class extends df{#e;#t;#s;#r;constructor(s){super(),this.#e=s.client,this.mutationId=s.mutationId,this.#s=s.mutationCache,this.#t=[],this.state=s.state||xf(),this.setOptions(s.options),this.scheduleGc()}setOptions(s){this.options=s,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(s){this.#t.includes(s)||(this.#t.push(s),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:s}))}removeObserver(s){this.#t=this.#t.filter(r=>r!==s),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:s})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#s.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(s){const r=()=>{this.#n({type:"continue"})},a={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=cf({fn:()=>this.options.mutationFn?this.options.mutationFn(s,a):Promise.reject(new Error("No mutationFn found")),onFail:(d,x)=>{this.#n({type:"failed",failureCount:d,error:x})},onPause:()=>{this.#n({type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const o=this.state.status==="pending",c=!this.#r.canStart();try{if(o)r();else{this.#n({type:"pending",variables:s,isPaused:c}),this.#s.config.onMutate&&await this.#s.config.onMutate(s,this,a);const x=await this.options.onMutate?.(s,a);x!==this.state.context&&this.#n({type:"pending",context:x,variables:s,isPaused:c})}const d=await this.#r.start();return await this.#s.config.onSuccess?.(d,s,this.state.context,this,a),await this.options.onSuccess?.(d,s,this.state.context,a),await this.#s.config.onSettled?.(d,null,this.state.variables,this.state.context,this,a),await this.options.onSettled?.(d,null,s,this.state.context,a),this.#n({type:"success",data:d}),d}catch(d){try{await this.#s.config.onError?.(d,s,this.state.context,this,a)}catch(x){Promise.reject(x)}try{await this.options.onError?.(d,s,this.state.context,a)}catch(x){Promise.reject(x)}try{await this.#s.config.onSettled?.(void 0,d,this.state.variables,this.state.context,this,a)}catch(x){Promise.reject(x)}try{await this.options.onSettled?.(void 0,d,s,this.state.context,a)}catch(x){Promise.reject(x)}throw this.#n({type:"error",error:d}),d}finally{this.#s.runNext(this)}}#n(s){const r=a=>{switch(s.type){case"failed":return{...a,failureCount:s.failureCount,failureReason:s.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:s.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:s.isPaused,status:"pending",variables:s.variables,submittedAt:Date.now()};case"success":return{...a,data:s.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:s.error,failureCount:a.failureCount+1,failureReason:s.error,isPaused:!1,status:"error"}}};this.state=r(this.state),ft.batch(()=>{this.#t.forEach(a=>{a.onMutationUpdate(s)}),this.#s.notify({mutation:this,type:"updated",action:s})})}};function xf(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var r1=class extends Na{constructor(s={}){super(),this.config=s,this.#e=new Set,this.#t=new Map,this.#s=0}#e;#t;#s;build(s,r,a){const o=new n1({client:s,mutationCache:this,mutationId:++this.#s,options:s.defaultMutationOptions(r),state:a});return this.add(o),o}add(s){this.#e.add(s);const r=el(s);if(typeof r=="string"){const a=this.#t.get(r);a?a.push(s):this.#t.set(r,[s])}this.notify({type:"added",mutation:s})}remove(s){if(this.#e.delete(s)){const r=el(s);if(typeof r=="string"){const a=this.#t.get(r);if(a)if(a.length>1){const o=a.indexOf(s);o!==-1&&a.splice(o,1)}else a[0]===s&&this.#t.delete(r)}}this.notify({type:"removed",mutation:s})}canRun(s){const r=el(s);if(typeof r=="string"){const o=this.#t.get(r)?.find(c=>c.state.status==="pending");return!o||o===s}else return!0}runNext(s){const r=el(s);return typeof r=="string"?this.#t.get(r)?.find(o=>o!==s&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ft.batch(()=>{this.#e.forEach(s=>{this.notify({type:"removed",mutation:s})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(s){const r={exact:!0,...s};return this.getAll().find(a=>sp(r,a))}findAll(s={}){return this.getAll().filter(r=>sp(s,r))}notify(s){ft.batch(()=>{this.listeners.forEach(r=>{r(s)})})}resumePausedMutations(){const s=this.getAll().filter(r=>r.state.isPaused);return ft.batch(()=>Promise.all(s.map(r=>r.continue().catch(Ut))))}};function el(s){return s.options.scope?.id}var a1=class extends Na{#e;#t=void 0;#s;#r;constructor(r,a){super(),this.#e=r,this.setOptions(a),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){const a=this.options;this.options=this.#e.defaultMutationOptions(r),fl(this.options,a)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),a?.mutationKey&&this.options.mutationKey&&wr(a.mutationKey)!==wr(this.options.mutationKey)?this.reset():this.#s?.state.status==="pending"&&this.#s.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#s?.removeObserver(this)}onMutationUpdate(r){this.#n(),this.#a(r)}getCurrentResult(){return this.#t}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#n(),this.#a()}mutate(r,a){return this.#r=a,this.#s?.removeObserver(this),this.#s=this.#e.getMutationCache().build(this.#e,this.options),this.#s.addObserver(this),this.#s.execute(r)}#n(){const r=this.#s?.state??xf();this.#t={...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset}}#a(r){ft.batch(()=>{if(this.#r&&this.hasListeners()){const a=this.#t.variables,o=this.#t.context,c={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(r?.type==="success"){try{this.#r.onSuccess?.(r.data,a,o,c)}catch(d){Promise.reject(d)}try{this.#r.onSettled?.(r.data,null,a,o,c)}catch(d){Promise.reject(d)}}else if(r?.type==="error"){try{this.#r.onError?.(r.error,a,o,c)}catch(d){Promise.reject(d)}try{this.#r.onSettled?.(void 0,r.error,a,o,c)}catch(d){Promise.reject(d)}}}this.listeners.forEach(a=>{a(this.#t)})})}},i1=class extends Na{constructor(s={}){super(),this.config=s,this.#e=new Map}#e;build(s,r,a){const o=r.queryKey,c=r.queryHash??$u(o,r);let d=this.get(c);return d||(d=new Xb({client:s,queryKey:o,queryHash:c,options:s.defaultQueryOptions(r),state:a,defaultOptions:s.getQueryDefaults(o)}),this.add(d)),d}add(s){this.#e.has(s.queryHash)||(this.#e.set(s.queryHash,s),this.notify({type:"added",query:s}))}remove(s){const r=this.#e.get(s.queryHash);r&&(s.destroy(),r===s&&this.#e.delete(s.queryHash),this.notify({type:"removed",query:s}))}clear(){ft.batch(()=>{this.getAll().forEach(s=>{this.remove(s)})})}get(s){return this.#e.get(s)}getAll(){return[...this.#e.values()]}find(s){const r={exact:!0,...s};return this.getAll().find(a=>tp(r,a))}findAll(s={}){const r=this.getAll();return Object.keys(s).length>0?r.filter(a=>tp(s,a)):r}notify(s){ft.batch(()=>{this.listeners.forEach(r=>{r(s)})})}onFocus(){ft.batch(()=>{this.getAll().forEach(s=>{s.onFocus()})})}onOnline(){ft.batch(()=>{this.getAll().forEach(s=>{s.onOnline()})})}},o1=class{#e;#t;#s;#r;#n;#a;#i;#o;constructor(s={}){this.#e=s.queryCache||new i1,this.#t=s.mutationCache||new r1,this.#s=s.defaultOptions||{},this.#r=new Map,this.#n=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#i=Uu.subscribe(async s=>{s&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=gl.subscribe(async s=>{s&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#i?.(),this.#i=void 0,this.#o?.(),this.#o=void 0)}isFetching(s){return this.#e.findAll({...s,fetchStatus:"fetching"}).length}isMutating(s){return this.#t.findAll({...s,status:"pending"}).length}getQueryData(s){const r=this.defaultQueryOptions({queryKey:s});return this.#e.get(r.queryHash)?.state.data}ensureQueryData(s){const r=this.defaultQueryOptions(s),a=this.#e.build(this,r),o=a.state.data;return o===void 0?this.fetchQuery(s):(s.revalidateIfStale&&a.isStaleByTime(_n(r.staleTime,a))&&this.prefetchQuery(r),Promise.resolve(o))}getQueriesData(s){return this.#e.findAll(s).map(({queryKey:r,state:a})=>{const o=a.data;return[r,o]})}setQueryData(s,r,a){const o=this.defaultQueryOptions({queryKey:s}),d=this.#e.get(o.queryHash)?.state.data,x=Bb(r,d);if(x!==void 0)return this.#e.build(this,o).setData(x,{...a,manual:!0})}setQueriesData(s,r,a){return ft.batch(()=>this.#e.findAll(s).map(({queryKey:o})=>[o,this.setQueryData(o,r,a)]))}getQueryState(s){const r=this.defaultQueryOptions({queryKey:s});return this.#e.get(r.queryHash)?.state}removeQueries(s){const r=this.#e;ft.batch(()=>{r.findAll(s).forEach(a=>{r.remove(a)})})}resetQueries(s,r){const a=this.#e;return ft.batch(()=>(a.findAll(s).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...s},r)))}cancelQueries(s,r={}){const a={revert:!0,...r},o=ft.batch(()=>this.#e.findAll(s).map(c=>c.cancel(a)));return Promise.all(o).then(Ut).catch(Ut)}invalidateQueries(s,r={}){return ft.batch(()=>(this.#e.findAll(s).forEach(a=>{a.invalidate()}),s?.refetchType==="none"?Promise.resolve():this.refetchQueries({...s,type:s?.refetchType??s?.type??"active"},r)))}refetchQueries(s,r={}){const a={...r,cancelRefetch:r.cancelRefetch??!0},o=ft.batch(()=>this.#e.findAll(s).filter(c=>!c.isDisabled()&&!c.isStatic()).map(c=>{let d=c.fetch(void 0,a);return a.throwOnError||(d=d.catch(Ut)),c.state.fetchStatus==="paused"?Promise.resolve():d}));return Promise.all(o).then(Ut)}fetchQuery(s){const r=this.defaultQueryOptions(s);r.retry===void 0&&(r.retry=!1);const a=this.#e.build(this,r);return a.isStaleByTime(_n(r.staleTime,a))?a.fetch(r):Promise.resolve(a.state.data)}prefetchQuery(s){return this.fetchQuery(s).then(Ut).catch(Ut)}fetchInfiniteQuery(s){return s.behavior=cp(s.pages),this.fetchQuery(s)}prefetchInfiniteQuery(s){return this.fetchInfiniteQuery(s).then(Ut).catch(Ut)}ensureInfiniteQueryData(s){return s.behavior=cp(s.pages),this.ensureQueryData(s)}resumePausedMutations(){return gl.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#s}setDefaultOptions(s){this.#s=s}setQueryDefaults(s,r){this.#r.set(wr(s),{queryKey:s,defaultOptions:r})}getQueryDefaults(s){const r=[...this.#r.values()],a={};return r.forEach(o=>{Pi(s,o.queryKey)&&Object.assign(a,o.defaultOptions)}),a}setMutationDefaults(s,r){this.#n.set(wr(s),{mutationKey:s,defaultOptions:r})}getMutationDefaults(s){const r=[...this.#n.values()],a={};return r.forEach(o=>{Pi(s,o.mutationKey)&&Object.assign(a,o.defaultOptions)}),a}defaultQueryOptions(s){if(s._defaulted)return s;const r={...this.#s.queries,...this.getQueryDefaults(s.queryKey),...s,_defaulted:!0};return r.queryHash||(r.queryHash=$u(r.queryKey,r)),r.refetchOnReconnect===void 0&&(r.refetchOnReconnect=r.networkMode!=="always"),r.throwOnError===void 0&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.queryFn===Bu&&(r.enabled=!1),r}defaultMutationOptions(s){return s?._defaulted?s:{...this.#s.mutations,...s?.mutationKey&&this.getMutationDefaults(s.mutationKey),...s,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},mf=p.createContext(void 0),Pe=s=>{const r=p.useContext(mf);if(!r)throw new Error("No QueryClient set, use QueryClientProvider to set one");return r},l1=({client:s,children:r})=>(p.useEffect(()=>(s.mount(),()=>{s.unmount()}),[s]),e.jsx(mf.Provider,{value:s,children:r})),hf=p.createContext(!1),c1=()=>p.useContext(hf);hf.Provider;function d1(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var u1=p.createContext(d1()),x1=()=>p.useContext(u1),m1=(s,r,a)=>{const o=a?.state.error&&typeof s.throwOnError=="function"?qu(s.throwOnError,[a.state.error,a]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||o)&&(r.isReset()||(s.retryOnMount=!1))},h1=s=>{p.useEffect(()=>{s.clearReset()},[s])},p1=({result:s,errorResetBoundary:r,throwOnError:a,query:o,suspense:c})=>s.isError&&!r.isReset()&&!s.isFetching&&o&&(c&&s.data===void 0||qu(a,[s.error,o])),f1=s=>{if(s.suspense){const a=c=>c==="static"?c:Math.max(c??1e3,1e3),o=s.staleTime;s.staleTime=typeof o=="function"?(...c)=>a(o(...c)):a(o),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},g1=(s,r)=>s.isLoading&&s.isFetching&&!r,y1=(s,r)=>s?.suspense&&r.isPending,up=(s,r,a)=>r.fetchOptimistic(s).catch(()=>{a.clearReset()});function b1(s,r,a){const o=c1(),c=x1(),d=Pe(),x=d.defaultQueryOptions(s);d.getDefaultOptions().queries?._experimental_beforeQuery?.(x);const h=d.getQueryCache().get(x.queryHash);x._optimisticResults=o?"isRestoring":"optimistic",f1(x),m1(x,c,h),h1(c);const f=!d.getQueryCache().get(x.queryHash),[y]=p.useState(()=>new r(d,x)),g=y.getOptimisticResult(x),j=!o&&s.subscribed!==!1;if(p.useSyncExternalStore(p.useCallback(P=>{const S=j?y.subscribe(ft.batchCalls(P)):Ut;return y.updateResult(),S},[y,j]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),p.useEffect(()=>{y.setOptions(x)},[x,y]),y1(x,g))throw up(x,y,c);if(p1({result:g,errorResetBoundary:c,throwOnError:x.throwOnError,query:h,suspense:x.suspense}))throw g.error;return d.getDefaultOptions().queries?._experimental_afterQuery?.(x,g),x.experimental_prefetchInRender&&!Ri.isServer()&&g1(g,o)&&(f?up(x,y,c):h?.promise)?.catch(Ut).finally(()=>{y.updateResult()}),x.notifyOnChangeProps?g:y.trackResult(g)}function Oe(s,r){return b1(s,Zb)}function oe(s,r){const a=Pe(),[o]=p.useState(()=>new a1(a,s));p.useEffect(()=>{o.setOptions(s)},[o,s]);const c=p.useSyncExternalStore(p.useCallback(x=>o.subscribe(ft.batchCalls(x)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),d=p.useCallback((x,h)=>{o.mutate(x,h).catch(Ut)},[o]);if(c.error&&qu(o.options.throwOnError,[c.error]))throw c.error;return{...c,mutate:d,mutateAsync:c.mutate}}let v1={data:""},j1=s=>{if(typeof window=="object"){let r=(s?s.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return r.nonce=window.__nonce__,r.parentNode||(s||document.head).appendChild(r),r.firstChild}return s||v1},N1=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,w1=/\/\*[^]*?\*\/| +/g,xp=/\n+/g,In=(s,r)=>{let a="",o="",c="";for(let d in s){let x=s[d];d[0]=="@"?d[1]=="i"?a=d+" "+x+";":o+=d[1]=="f"?In(x,d):d+"{"+In(x,d[1]=="k"?"":r)+"}":typeof x=="object"?o+=In(x,r?r.replace(/([^,])+/g,h=>d.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,f=>/&/.test(f)?f.replace(/&/g,h):h?h+" "+f:f)):d):x!=null&&(d=/^--/.test(d)?d:d.replace(/[A-Z]/g,"-$&").toLowerCase(),c+=In.p?In.p(d,x):d+":"+x+";")}return a+(r&&c?r+"{"+c+"}":c)+o},rn={},pf=s=>{if(typeof s=="object"){let r="";for(let a in s)r+=a+pf(s[a]);return r}return s},k1=(s,r,a,o,c)=>{let d=pf(s),x=rn[d]||(rn[d]=(f=>{let y=0,g=11;for(;y<f.length;)g=101*g+f.charCodeAt(y++)>>>0;return"go"+g})(d));if(!rn[x]){let f=d!==s?s:(y=>{let g,j,P=[{}];for(;g=N1.exec(y.replace(w1,""));)g[4]?P.shift():g[3]?(j=g[3].replace(xp," ").trim(),P.unshift(P[0][j]=P[0][j]||{})):P[0][g[1]]=g[2].replace(xp," ").trim();return P[0]})(s);rn[x]=In(c?{["@keyframes "+x]:f}:f,a?"":"."+x)}let h=a&&rn.g?rn.g:null;return a&&(rn.g=rn[x]),((f,y,g,j)=>{j?y.data=y.data.replace(j,f):y.data.indexOf(f)===-1&&(y.data=g?f+y.data:y.data+f)})(rn[x],r,o,h),x},S1=(s,r,a)=>s.reduce((o,c,d)=>{let x=r[d];if(x&&x.call){let h=x(a),f=h&&h.props&&h.props.className||/^go/.test(h)&&h;x=f?"."+f:h&&typeof h=="object"?h.props?"":In(h,""):h===!1?"":h}return o+c+(x??"")},"");function Ol(s){let r=this||{},a=s.call?s(r.p):s;return k1(a.unshift?a.raw?S1(a,[].slice.call(arguments,1),r.p):a.reduce((o,c)=>Object.assign(o,c&&c.call?c(r.p):c),{}):a,j1(r.target),r.g,r.o,r.k)}let ff,vu,ju;Ol.bind({g:1});let un=Ol.bind({k:1});function C1(s,r,a,o){In.p=r,ff=s,vu=a,ju=o}function Vn(s,r){let a=this||{};return function(){let o=arguments;function c(d,x){let h=Object.assign({},d),f=h.className||c.className;a.p=Object.assign({theme:vu&&vu()},h),a.o=/ *go\d+/.test(f),h.className=Ol.apply(a,o)+(f?" "+f:"");let y=s;return s[0]&&(y=h.as||s,delete h.as),ju&&y[0]&&ju(h),ff(y,h)}return c}}var E1=s=>typeof s=="function",yl=(s,r)=>E1(s)?s(r):s,P1=(()=>{let s=0;return()=>(++s).toString()})(),gf=(()=>{let s;return()=>{if(s===void 0&&typeof window<"u"){let r=matchMedia("(prefers-reduced-motion: reduce)");s=!r||r.matches}return s}})(),R1=20,Ku="default",yf=(s,r)=>{let{toastLimit:a}=s.settings;switch(r.type){case 0:return{...s,toasts:[r.toast,...s.toasts].slice(0,a)};case 1:return{...s,toasts:s.toasts.map(x=>x.id===r.toast.id?{...x,...r.toast}:x)};case 2:let{toast:o}=r;return yf(s,{type:s.toasts.find(x=>x.id===o.id)?1:0,toast:o});case 3:let{toastId:c}=r;return{...s,toasts:s.toasts.map(x=>x.id===c||c===void 0?{...x,dismissed:!0,visible:!1}:x)};case 4:return r.toastId===void 0?{...s,toasts:[]}:{...s,toasts:s.toasts.filter(x=>x.id!==r.toastId)};case 5:return{...s,pausedAt:r.time};case 6:let d=r.time-(s.pausedAt||0);return{...s,pausedAt:void 0,toasts:s.toasts.map(x=>({...x,pauseDuration:x.pauseDuration+d}))}}},ul=[],bf={toasts:[],pausedAt:void 0,settings:{toastLimit:R1}},Ks={},vf=(s,r=Ku)=>{Ks[r]=yf(Ks[r]||bf,s),ul.forEach(([a,o])=>{a===r&&o(Ks[r])})},jf=s=>Object.keys(Ks).forEach(r=>vf(s,r)),M1=s=>Object.keys(Ks).find(r=>Ks[r].toasts.some(a=>a.id===s)),Dl=(s=Ku)=>r=>{vf(r,s)},T1={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},z1=(s={},r=Ku)=>{let[a,o]=p.useState(Ks[r]||bf),c=p.useRef(Ks[r]);p.useEffect(()=>(c.current!==Ks[r]&&o(Ks[r]),ul.push([r,o]),()=>{let x=ul.findIndex(([h])=>h===r);x>-1&&ul.splice(x,1)}),[r]);let d=a.toasts.map(x=>{var h,f,y;return{...s,...s[x.type],...x,removeDelay:x.removeDelay||((h=s[x.type])==null?void 0:h.removeDelay)||s?.removeDelay,duration:x.duration||((f=s[x.type])==null?void 0:f.duration)||s?.duration||T1[x.type],style:{...s.style,...(y=s[x.type])==null?void 0:y.style,...x.style}}});return{...a,toasts:d}},A1=(s,r="blank",a)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:r,ariaProps:{role:"status","aria-live":"polite"},message:s,pauseDuration:0,...a,id:a?.id||P1()}),Li=s=>(r,a)=>{let o=A1(r,s,a);return Dl(o.toasterId||M1(o.id))({type:2,toast:o}),o.id},gt=(s,r)=>Li("blank")(s,r);gt.error=Li("error");gt.success=Li("success");gt.loading=Li("loading");gt.custom=Li("custom");gt.dismiss=(s,r)=>{let a={type:3,toastId:s};r?Dl(r)(a):jf(a)};gt.dismissAll=s=>gt.dismiss(void 0,s);gt.remove=(s,r)=>{let a={type:4,toastId:s};r?Dl(r)(a):jf(a)};gt.removeAll=s=>gt.remove(void 0,s);gt.promise=(s,r,a)=>{let o=gt.loading(r.loading,{...a,...a?.loading});return typeof s=="function"&&(s=s()),s.then(c=>{let d=r.success?yl(r.success,c):void 0;return d?gt.success(d,{id:o,...a,...a?.success}):gt.dismiss(o),c}).catch(c=>{let d=r.error?yl(r.error,c):void 0;d?gt.error(d,{id:o,...a,...a?.error}):gt.dismiss(o)}),s};var O1=1e3,D1=(s,r="default")=>{let{toasts:a,pausedAt:o}=z1(s,r),c=p.useRef(new Map).current,d=p.useCallback((j,P=O1)=>{if(c.has(j))return;let S=setTimeout(()=>{c.delete(j),x({type:4,toastId:j})},P);c.set(j,S)},[]);p.useEffect(()=>{if(o)return;let j=Date.now(),P=a.map(S=>{if(S.duration===1/0)return;let k=(S.duration||0)+S.pauseDuration-(j-S.createdAt);if(k<0){S.visible&>.dismiss(S.id);return}return setTimeout(()=>gt.dismiss(S.id,r),k)});return()=>{P.forEach(S=>S&&clearTimeout(S))}},[a,o,r]);let x=p.useCallback(Dl(r),[r]),h=p.useCallback(()=>{x({type:5,time:Date.now()})},[x]),f=p.useCallback((j,P)=>{x({type:1,toast:{id:j,height:P}})},[x]),y=p.useCallback(()=>{o&&x({type:6,time:Date.now()})},[o,x]),g=p.useCallback((j,P)=>{let{reverseOrder:S=!1,gutter:k=8,defaultPosition:E}=P||{},R=a.filter(D=>(D.position||E)===(j.position||E)&&D.height),v=R.findIndex(D=>D.id===j.id),C=R.filter((D,M)=>M<v&&D.visible).length;return R.filter(D=>D.visible).slice(...S?[C+1]:[0,C]).reduce((D,M)=>D+(M.height||0)+k,0)},[a]);return p.useEffect(()=>{a.forEach(j=>{if(j.dismissed)d(j.id,j.removeDelay);else{let P=c.get(j.id);P&&(clearTimeout(P),c.delete(j.id))}})},[a,d]),{toasts:a,handlers:{updateHeight:f,startPause:h,endPause:y,calculateOffset:g}}},I1=un`
|
|
68
|
-
from {
|
|
69
|
-
transform: scale(0) rotate(45deg);
|
|
70
|
-
opacity: 0;
|
|
71
|
-
}
|
|
72
|
-
to {
|
|
73
|
-
transform: scale(1) rotate(45deg);
|
|
74
|
-
opacity: 1;
|
|
75
|
-
}`,F1=un`
|
|
76
|
-
from {
|
|
77
|
-
transform: scale(0);
|
|
78
|
-
opacity: 0;
|
|
79
|
-
}
|
|
80
|
-
to {
|
|
81
|
-
transform: scale(1);
|
|
82
|
-
opacity: 1;
|
|
83
|
-
}`,L1=un`
|
|
84
|
-
from {
|
|
85
|
-
transform: scale(0) rotate(90deg);
|
|
86
|
-
opacity: 0;
|
|
87
|
-
}
|
|
88
|
-
to {
|
|
89
|
-
transform: scale(1) rotate(90deg);
|
|
90
|
-
opacity: 1;
|
|
91
|
-
}`,_1=Vn("div")`
|
|
92
|
-
width: 20px;
|
|
93
|
-
opacity: 0;
|
|
94
|
-
height: 20px;
|
|
95
|
-
border-radius: 10px;
|
|
96
|
-
background: ${s=>s.primary||"#ff4b4b"};
|
|
97
|
-
position: relative;
|
|
98
|
-
transform: rotate(45deg);
|
|
99
|
-
|
|
100
|
-
animation: ${I1} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
101
|
-
forwards;
|
|
102
|
-
animation-delay: 100ms;
|
|
103
|
-
|
|
104
|
-
&:after,
|
|
105
|
-
&:before {
|
|
106
|
-
content: '';
|
|
107
|
-
animation: ${F1} 0.15s ease-out forwards;
|
|
108
|
-
animation-delay: 150ms;
|
|
109
|
-
position: absolute;
|
|
110
|
-
border-radius: 3px;
|
|
111
|
-
opacity: 0;
|
|
112
|
-
background: ${s=>s.secondary||"#fff"};
|
|
113
|
-
bottom: 9px;
|
|
114
|
-
left: 4px;
|
|
115
|
-
height: 2px;
|
|
116
|
-
width: 12px;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
&:before {
|
|
120
|
-
animation: ${L1} 0.15s ease-out forwards;
|
|
121
|
-
animation-delay: 180ms;
|
|
122
|
-
transform: rotate(90deg);
|
|
123
|
-
}
|
|
124
|
-
`,U1=un`
|
|
125
|
-
from {
|
|
126
|
-
transform: rotate(0deg);
|
|
127
|
-
}
|
|
128
|
-
to {
|
|
129
|
-
transform: rotate(360deg);
|
|
130
|
-
}
|
|
131
|
-
`,$1=Vn("div")`
|
|
132
|
-
width: 12px;
|
|
133
|
-
height: 12px;
|
|
134
|
-
box-sizing: border-box;
|
|
135
|
-
border: 2px solid;
|
|
136
|
-
border-radius: 100%;
|
|
137
|
-
border-color: ${s=>s.secondary||"#e0e0e0"};
|
|
138
|
-
border-right-color: ${s=>s.primary||"#616161"};
|
|
139
|
-
animation: ${U1} 1s linear infinite;
|
|
140
|
-
`,B1=un`
|
|
141
|
-
from {
|
|
142
|
-
transform: scale(0) rotate(45deg);
|
|
143
|
-
opacity: 0;
|
|
144
|
-
}
|
|
145
|
-
to {
|
|
146
|
-
transform: scale(1) rotate(45deg);
|
|
147
|
-
opacity: 1;
|
|
148
|
-
}`,q1=un`
|
|
149
|
-
0% {
|
|
150
|
-
height: 0;
|
|
151
|
-
width: 0;
|
|
152
|
-
opacity: 0;
|
|
153
|
-
}
|
|
154
|
-
40% {
|
|
155
|
-
height: 0;
|
|
156
|
-
width: 6px;
|
|
157
|
-
opacity: 1;
|
|
158
|
-
}
|
|
159
|
-
100% {
|
|
160
|
-
opacity: 1;
|
|
161
|
-
height: 10px;
|
|
162
|
-
}`,H1=Vn("div")`
|
|
163
|
-
width: 20px;
|
|
164
|
-
opacity: 0;
|
|
165
|
-
height: 20px;
|
|
166
|
-
border-radius: 10px;
|
|
167
|
-
background: ${s=>s.primary||"#61d345"};
|
|
168
|
-
position: relative;
|
|
169
|
-
transform: rotate(45deg);
|
|
170
|
-
|
|
171
|
-
animation: ${B1} 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: ${q1} 0.2s ease-out forwards;
|
|
178
|
-
opacity: 0;
|
|
179
|
-
animation-delay: 200ms;
|
|
180
|
-
position: absolute;
|
|
181
|
-
border-right: 2px solid;
|
|
182
|
-
border-bottom: 2px solid;
|
|
183
|
-
border-color: ${s=>s.secondary||"#fff"};
|
|
184
|
-
bottom: 6px;
|
|
185
|
-
left: 6px;
|
|
186
|
-
height: 10px;
|
|
187
|
-
width: 6px;
|
|
188
|
-
}
|
|
189
|
-
`,K1=Vn("div")`
|
|
190
|
-
position: absolute;
|
|
191
|
-
`,W1=Vn("div")`
|
|
192
|
-
position: relative;
|
|
193
|
-
display: flex;
|
|
194
|
-
justify-content: center;
|
|
195
|
-
align-items: center;
|
|
196
|
-
min-width: 20px;
|
|
197
|
-
min-height: 20px;
|
|
198
|
-
`,V1=un`
|
|
199
|
-
from {
|
|
200
|
-
transform: scale(0.6);
|
|
201
|
-
opacity: 0.4;
|
|
202
|
-
}
|
|
203
|
-
to {
|
|
204
|
-
transform: scale(1);
|
|
205
|
-
opacity: 1;
|
|
206
|
-
}`,G1=Vn("div")`
|
|
207
|
-
position: relative;
|
|
208
|
-
transform: scale(0.6);
|
|
209
|
-
opacity: 0.4;
|
|
210
|
-
min-width: 20px;
|
|
211
|
-
animation: ${V1} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
212
|
-
forwards;
|
|
213
|
-
`,Q1=({toast:s})=>{let{icon:r,type:a,iconTheme:o}=s;return r!==void 0?typeof r=="string"?p.createElement(G1,null,r):r:a==="blank"?null:p.createElement(W1,null,p.createElement($1,{...o}),a!=="loading"&&p.createElement(K1,null,a==="error"?p.createElement(_1,{...o}):p.createElement(H1,{...o})))},J1=s=>`
|
|
214
|
-
0% {transform: translate3d(0,${s*-200}%,0) scale(.6); opacity:.5;}
|
|
215
|
-
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
|
|
216
|
-
`,Y1=s=>`
|
|
217
|
-
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
|
|
218
|
-
100% {transform: translate3d(0,${s*-150}%,-1px) scale(.6); opacity:0;}
|
|
219
|
-
`,X1="0%{opacity:0;} 100%{opacity:1;}",Z1="0%{opacity:1;} 100%{opacity:0;}",ev=Vn("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
|
-
`,tv=Vn("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
|
-
`,sv=(s,r)=>{let a=s.includes("top")?1:-1,[o,c]=gf()?[X1,Z1]:[J1(a),Y1(a)];return{animation:r?`${un(o)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${un(c)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},nv=p.memo(({toast:s,position:r,style:a,children:o})=>{let c=s.height?sv(s.position||r||"top-center",s.visible):{opacity:0},d=p.createElement(Q1,{toast:s}),x=p.createElement(tv,{...s.ariaProps},yl(s.message,s));return p.createElement(ev,{className:s.className,style:{...c,...a,...s.style}},typeof o=="function"?o({icon:d,message:x}):p.createElement(p.Fragment,null,d,x))});C1(p.createElement);var rv=({id:s,className:r,style:a,onHeightUpdate:o,children:c})=>{let d=p.useCallback(x=>{if(x){let h=()=>{let f=x.getBoundingClientRect().height;o(s,f)};h(),new MutationObserver(h).observe(x,{subtree:!0,childList:!0,characterData:!0})}},[s,o]);return p.createElement("div",{ref:d,className:r,style:a},c)},av=(s,r)=>{let a=s.includes("top"),o=a?{top:0}:{bottom:0},c=s.includes("center")?{justifyContent:"center"}:s.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:gf()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${r*(a?1:-1)}px)`,...o,...c}},iv=Ol`
|
|
239
|
-
z-index: 9999;
|
|
240
|
-
> * {
|
|
241
|
-
pointer-events: auto;
|
|
242
|
-
}
|
|
243
|
-
`,tl=16,ov=({reverseOrder:s,position:r="top-center",toastOptions:a,gutter:o,children:c,toasterId:d,containerStyle:x,containerClassName:h})=>{let{toasts:f,handlers:y}=D1(a,d);return p.createElement("div",{"data-rht-toaster":d||"",style:{position:"fixed",zIndex:9999,top:tl,left:tl,right:tl,bottom:tl,pointerEvents:"none",...x},className:h,onMouseEnter:y.startPause,onMouseLeave:y.endPause},f.map(g=>{let j=g.position||r,P=y.calculateOffset(g,{reverseOrder:s,gutter:o,defaultPosition:r}),S=av(j,P);return p.createElement(rv,{id:g.id,key:g.id,onHeightUpdate:y.updateHeight,className:g.visible?iv:"",style:S},g.type==="custom"?yl(g.message,g):c?c(g):p.createElement(nv,{toast:g,position:j}))}))},H=gt;/**
|
|
244
|
-
* @license lucide-react v0.451.0 - ISC
|
|
245
|
-
*
|
|
246
|
-
* This source code is licensed under the ISC license.
|
|
247
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
248
|
-
*/const lv=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Nf=(...s)=>s.filter((r,a,o)=>!!r&&o.indexOf(r)===a).join(" ");/**
|
|
249
|
-
* @license lucide-react v0.451.0 - ISC
|
|
250
|
-
*
|
|
251
|
-
* This source code is licensed under the ISC license.
|
|
252
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
253
|
-
*/var cv={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 dv=p.forwardRef(({color:s="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:c="",children:d,iconNode:x,...h},f)=>p.createElement("svg",{ref:f,...cv,width:r,height:r,stroke:s,strokeWidth:o?Number(a)*24/Number(r):a,className:Nf("lucide",c),...h},[...x.map(([y,g])=>p.createElement(y,g)),...Array.isArray(d)?d:[d]]));/**
|
|
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 Q=(s,r)=>{const a=p.forwardRef(({className:o,...c},d)=>p.createElement(dv,{ref:d,iconNode:r,className:Nf(`lucide-${lv(s)}`,o),...c}));return a.displayName=`${s}`,a};/**
|
|
264
|
-
* @license lucide-react v0.451.0 - ISC
|
|
265
|
-
*
|
|
266
|
-
* This source code is licensed under the ISC license.
|
|
267
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
268
|
-
*/const Nu=Q("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 uv=Q("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
274
|
-
* @license lucide-react v0.451.0 - ISC
|
|
275
|
-
*
|
|
276
|
-
* This source code is licensed under the ISC license.
|
|
277
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
278
|
-
*/const wf=Q("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 gr=Q("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
284
|
-
* @license lucide-react v0.451.0 - ISC
|
|
285
|
-
*
|
|
286
|
-
* This source code is licensed under the ISC license.
|
|
287
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
288
|
-
*/const kf=Q("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 xv=Q("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 mv=Q("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 bl=Q("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 hv=Q("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 Mi=Q("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 pv=Q("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 fv=Q("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 gv=Q("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 yv=Q("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 bv=Q("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
|
339
|
-
* @license lucide-react v0.451.0 - ISC
|
|
340
|
-
*
|
|
341
|
-
* This source code is licensed under the ISC license.
|
|
342
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
343
|
-
*/const Un=Q("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 vv=Q("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 jv=Q("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 Ms=Q("ChartNoAxesColumn",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]]);/**
|
|
359
|
-
* @license lucide-react v0.451.0 - ISC
|
|
360
|
-
*
|
|
361
|
-
* This source code is licensed under the ISC license.
|
|
362
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
363
|
-
*/const Sf=Q("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 Qe=Q("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
369
|
-
* @license lucide-react v0.451.0 - ISC
|
|
370
|
-
*
|
|
371
|
-
* This source code is licensed under the ISC license.
|
|
372
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
373
|
-
*/const kt=Q("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 Nv=Q("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
379
|
-
* @license lucide-react v0.451.0 - ISC
|
|
380
|
-
*
|
|
381
|
-
* This source code is licensed under the ISC license.
|
|
382
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
383
|
-
*/const Zt=Q("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 wv=Q("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
389
|
-
* @license lucide-react v0.451.0 - ISC
|
|
390
|
-
*
|
|
391
|
-
* This source code is licensed under the ISC license.
|
|
392
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
393
|
-
*/const He=Q("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 kv=Q("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 Sv=Q("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 Cv=Q("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=Q("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
414
|
-
* @license lucide-react v0.451.0 - ISC
|
|
415
|
-
*
|
|
416
|
-
* This source code is licensed under the ISC license.
|
|
417
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
418
|
-
*/const Cf=Q("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 Er=Q("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
424
|
-
* @license lucide-react v0.451.0 - ISC
|
|
425
|
-
*
|
|
426
|
-
* This source code is licensed under the ISC license.
|
|
427
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
428
|
-
*/const Od=Q("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 Wu=Q("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 Vu=Q("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 Ev=Q("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
|
|
444
|
-
* @license lucide-react v0.451.0 - ISC
|
|
445
|
-
*
|
|
446
|
-
* This source code is licensed under the ISC license.
|
|
447
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
448
|
-
*/const Ef=Q("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=Q("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 wa=Q("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
459
|
-
* @license lucide-react v0.451.0 - ISC
|
|
460
|
-
*
|
|
461
|
-
* This source code is licensed under the ISC license.
|
|
462
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
463
|
-
*/const Pf=Q("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 ka=Q("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
469
|
-
* @license lucide-react v0.451.0 - ISC
|
|
470
|
-
*
|
|
471
|
-
* This source code is licensed under the ISC license.
|
|
472
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
473
|
-
*/const Rf=Q("FileArchive",[["path",{d:"M10 12v-1",key:"v7bkov"}],["path",{d:"M10 18v-2",key:"1cjy8d"}],["path",{d:"M10 7V6",key:"dljcrl"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01",key:"gkbcor"}],["circle",{cx:"10",cy:"20",r:"2",key:"1xzdoj"}]]);/**
|
|
474
|
-
* @license lucide-react v0.451.0 - ISC
|
|
475
|
-
*
|
|
476
|
-
* This source code is licensed under the ISC license.
|
|
477
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
478
|
-
*/const Mf=Q("FileMinus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}]]);/**
|
|
479
|
-
* @license lucide-react v0.451.0 - ISC
|
|
480
|
-
*
|
|
481
|
-
* This source code is licensed under the ISC license.
|
|
482
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
483
|
-
*/const Tf=Q("FilePen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]]);/**
|
|
484
|
-
* @license lucide-react v0.451.0 - ISC
|
|
485
|
-
*
|
|
486
|
-
* This source code is licensed under the ISC license.
|
|
487
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
488
|
-
*/const zf=Q("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/**
|
|
489
|
-
* @license lucide-react v0.451.0 - ISC
|
|
490
|
-
*
|
|
491
|
-
* This source code is licensed under the ISC license.
|
|
492
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
493
|
-
*/const Af=Q("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 Ws=Q("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
499
|
-
* @license lucide-react v0.451.0 - ISC
|
|
500
|
-
*
|
|
501
|
-
* This source code is licensed under the ISC license.
|
|
502
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
503
|
-
*/const Of=Q("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 Pv=Q("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 Df=Q("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 Ti=Q("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 If=Q("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 Rv=Q("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
529
|
-
* @license lucide-react v0.451.0 - ISC
|
|
530
|
-
*
|
|
531
|
-
* This source code is licensed under the ISC license.
|
|
532
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
533
|
-
*/const $n=Q("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 br=Q("GitCommitHorizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);/**
|
|
539
|
-
* @license lucide-react v0.451.0 - ISC
|
|
540
|
-
*
|
|
541
|
-
* This source code is licensed under the ISC license.
|
|
542
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
543
|
-
*/const Ff=Q("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 Gn=Q("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 Mv=Q("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 Il=Q("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 Tv=Q("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
|
|
564
|
-
* @license lucide-react v0.451.0 - ISC
|
|
565
|
-
*
|
|
566
|
-
* This source code is licensed under the ISC license.
|
|
567
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
568
|
-
*/const Gu=Q("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 vl=Q("HeartPulse",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"1uw2ng"}]]);/**
|
|
574
|
-
* @license lucide-react v0.451.0 - ISC
|
|
575
|
-
*
|
|
576
|
-
* This source code is licensed under the ISC license.
|
|
577
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
578
|
-
*/const Qu=Q("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
|
|
579
|
-
* @license lucide-react v0.451.0 - ISC
|
|
580
|
-
*
|
|
581
|
-
* This source code is licensed under the ISC license.
|
|
582
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
583
|
-
*/const mp=Q("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
584
|
-
* @license lucide-react v0.451.0 - ISC
|
|
585
|
-
*
|
|
586
|
-
* This source code is licensed under the ISC license.
|
|
587
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
588
|
-
*/const Lf=Q("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
|
589
|
-
* @license lucide-react v0.451.0 - ISC
|
|
590
|
-
*
|
|
591
|
-
* This source code is licensed under the ISC license.
|
|
592
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
593
|
-
*/const hp=Q("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
|
|
594
|
-
* @license lucide-react v0.451.0 - ISC
|
|
595
|
-
*
|
|
596
|
-
* This source code is licensed under the ISC license.
|
|
597
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
598
|
-
*/const Pr=Q("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
|
|
599
|
-
* @license lucide-react v0.451.0 - ISC
|
|
600
|
-
*
|
|
601
|
-
* This source code is licensed under the ISC license.
|
|
602
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
603
|
-
*/const zv=Q("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
|
|
604
|
-
* @license lucide-react v0.451.0 - ISC
|
|
605
|
-
*
|
|
606
|
-
* This source code is licensed under the ISC license.
|
|
607
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
608
|
-
*/const Av=Q("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
|
|
609
|
-
* @license lucide-react v0.451.0 - ISC
|
|
610
|
-
*
|
|
611
|
-
* This source code is licensed under the ISC license.
|
|
612
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
613
|
-
*/const jl=Q("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
|
|
614
|
-
* @license lucide-react v0.451.0 - ISC
|
|
615
|
-
*
|
|
616
|
-
* This source code is licensed under the ISC license.
|
|
617
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
618
|
-
*/const Ov=Q("ListOrdered",[["line",{x1:"10",x2:"21",y1:"6",y2:"6",key:"76qw6h"}],["line",{x1:"10",x2:"21",y1:"12",y2:"12",key:"16nom4"}],["line",{x1:"10",x2:"21",y1:"18",y2:"18",key:"u3jurt"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
|
|
619
|
-
* @license lucide-react v0.451.0 - ISC
|
|
620
|
-
*
|
|
621
|
-
* This source code is licensed under the ISC license.
|
|
622
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
623
|
-
*/const Me=Q("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
624
|
-
* @license lucide-react v0.451.0 - ISC
|
|
625
|
-
*
|
|
626
|
-
* This source code is licensed under the ISC license.
|
|
627
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
628
|
-
*/const Dd=Q("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
629
|
-
* @license lucide-react v0.451.0 - ISC
|
|
630
|
-
*
|
|
631
|
-
* This source code is licensed under the ISC license.
|
|
632
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
633
|
-
*/const Dv=Q("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
|
|
634
|
-
* @license lucide-react v0.451.0 - ISC
|
|
635
|
-
*
|
|
636
|
-
* This source code is licensed under the ISC license.
|
|
637
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
638
|
-
*/const Iv=Q("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
|
|
639
|
-
* @license lucide-react v0.451.0 - ISC
|
|
640
|
-
*
|
|
641
|
-
* This source code is licensed under the ISC license.
|
|
642
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
643
|
-
*/const Ju=Q("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
644
|
-
* @license lucide-react v0.451.0 - ISC
|
|
645
|
-
*
|
|
646
|
-
* This source code is licensed under the ISC license.
|
|
647
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
648
|
-
*/const Fv=Q("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
649
|
-
* @license lucide-react v0.451.0 - ISC
|
|
650
|
-
*
|
|
651
|
-
* This source code is licensed under the ISC license.
|
|
652
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
653
|
-
*/const pp=Q("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
|
|
654
|
-
* @license lucide-react v0.451.0 - ISC
|
|
655
|
-
*
|
|
656
|
-
* This source code is licensed under the ISC license.
|
|
657
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
658
|
-
*/const Lv=Q("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
659
|
-
* @license lucide-react v0.451.0 - ISC
|
|
660
|
-
*
|
|
661
|
-
* This source code is licensed under the ISC license.
|
|
662
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
663
|
-
*/const _f=Q("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
664
|
-
* @license lucide-react v0.451.0 - ISC
|
|
665
|
-
*
|
|
666
|
-
* This source code is licensed under the ISC license.
|
|
667
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
668
|
-
*/const yr=Q("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
669
|
-
* @license lucide-react v0.451.0 - ISC
|
|
670
|
-
*
|
|
671
|
-
* This source code is licensed under the ISC license.
|
|
672
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
673
|
-
*/const _v=Q("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
674
|
-
* @license lucide-react v0.451.0 - ISC
|
|
675
|
-
*
|
|
676
|
-
* This source code is licensed under the ISC license.
|
|
677
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
678
|
-
*/const Uv=Q("MoveRight",[["path",{d:"M18 8L22 12L18 16",key:"1r0oui"}],["path",{d:"M2 12H22",key:"1m8cig"}]]);/**
|
|
679
|
-
* @license lucide-react v0.451.0 - ISC
|
|
680
|
-
*
|
|
681
|
-
* This source code is licensed under the ISC license.
|
|
682
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
683
|
-
*/const $v=Q("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/**
|
|
684
|
-
* @license lucide-react v0.451.0 - ISC
|
|
685
|
-
*
|
|
686
|
-
* This source code is licensed under the ISC license.
|
|
687
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
688
|
-
*/const fp=Q("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
|
|
689
|
-
* @license lucide-react v0.451.0 - ISC
|
|
690
|
-
*
|
|
691
|
-
* This source code is licensed under the ISC license.
|
|
692
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
693
|
-
*/const mn=Q("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
694
|
-
* @license lucide-react v0.451.0 - ISC
|
|
695
|
-
*
|
|
696
|
-
* This source code is licensed under the ISC license.
|
|
697
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
698
|
-
*/const Bv=Q("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
|
|
699
|
-
* @license lucide-react v0.451.0 - ISC
|
|
700
|
-
*
|
|
701
|
-
* This source code is licensed under the ISC license.
|
|
702
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
703
|
-
*/const Xt=Q("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
704
|
-
* @license lucide-react v0.451.0 - ISC
|
|
705
|
-
*
|
|
706
|
-
* This source code is licensed under the ISC license.
|
|
707
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
708
|
-
*/const qv=Q("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
|
|
709
|
-
* @license lucide-react v0.451.0 - ISC
|
|
710
|
-
*
|
|
711
|
-
* This source code is licensed under the ISC license.
|
|
712
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
713
|
-
*/const Vs=Q("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
714
|
-
* @license lucide-react v0.451.0 - ISC
|
|
715
|
-
*
|
|
716
|
-
* This source code is licensed under the ISC license.
|
|
717
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
718
|
-
*/const Yu=Q("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
719
|
-
* @license lucide-react v0.451.0 - ISC
|
|
720
|
-
*
|
|
721
|
-
* This source code is licensed under the ISC license.
|
|
722
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
723
|
-
*/const Fl=Q("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/**
|
|
724
|
-
* @license lucide-react v0.451.0 - ISC
|
|
725
|
-
*
|
|
726
|
-
* This source code is licensed under the ISC license.
|
|
727
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
728
|
-
*/const _i=Q("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
729
|
-
* @license lucide-react v0.451.0 - ISC
|
|
730
|
-
*
|
|
731
|
-
* This source code is licensed under the ISC license.
|
|
732
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
733
|
-
*/const ya=Q("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
734
|
-
* @license lucide-react v0.451.0 - ISC
|
|
735
|
-
*
|
|
736
|
-
* This source code is licensed under the ISC license.
|
|
737
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
738
|
-
*/const Uf=Q("ScanSearch",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);/**
|
|
739
|
-
* @license lucide-react v0.451.0 - ISC
|
|
740
|
-
*
|
|
741
|
-
* This source code is licensed under the ISC license.
|
|
742
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
743
|
-
*/const Bn=Q("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
744
|
-
* @license lucide-react v0.451.0 - ISC
|
|
745
|
-
*
|
|
746
|
-
* This source code is licensed under the ISC license.
|
|
747
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
748
|
-
*/const Hv=Q("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
|
|
749
|
-
* @license lucide-react v0.451.0 - ISC
|
|
750
|
-
*
|
|
751
|
-
* This source code is licensed under the ISC license.
|
|
752
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
753
|
-
*/const Kv=Q("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
|
|
754
|
-
* @license lucide-react v0.451.0 - ISC
|
|
755
|
-
*
|
|
756
|
-
* This source code is licensed under the ISC license.
|
|
757
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
758
|
-
*/const kr=Q("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
|
|
759
|
-
* @license lucide-react v0.451.0 - ISC
|
|
760
|
-
*
|
|
761
|
-
* This source code is licensed under the ISC license.
|
|
762
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
763
|
-
*/const $f=Q("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
764
|
-
* @license lucide-react v0.451.0 - ISC
|
|
765
|
-
*
|
|
766
|
-
* This source code is licensed under the ISC license.
|
|
767
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
768
|
-
*/const Wv=Q("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
769
|
-
* @license lucide-react v0.451.0 - ISC
|
|
770
|
-
*
|
|
771
|
-
* This source code is licensed under the ISC license.
|
|
772
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
773
|
-
*/const Xu=Q("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
774
|
-
* @license lucide-react v0.451.0 - ISC
|
|
775
|
-
*
|
|
776
|
-
* This source code is licensed under the ISC license.
|
|
777
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
778
|
-
*/const Vv=Q("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);/**
|
|
779
|
-
* @license lucide-react v0.451.0 - ISC
|
|
780
|
-
*
|
|
781
|
-
* This source code is licensed under the ISC license.
|
|
782
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
783
|
-
*/const Gv=Q("SkipBack",[["polygon",{points:"19 20 9 12 19 4 19 20",key:"o2sva"}],["line",{x1:"5",x2:"5",y1:"19",y2:"5",key:"1ocqjk"}]]);/**
|
|
784
|
-
* @license lucide-react v0.451.0 - ISC
|
|
785
|
-
*
|
|
786
|
-
* This source code is licensed under the ISC license.
|
|
787
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
788
|
-
*/const Ll=Q("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/**
|
|
789
|
-
* @license lucide-react v0.451.0 - ISC
|
|
790
|
-
*
|
|
791
|
-
* This source code is licensed under the ISC license.
|
|
792
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
793
|
-
*/const Qv=Q("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
|
|
794
|
-
* @license lucide-react v0.451.0 - ISC
|
|
795
|
-
*
|
|
796
|
-
* This source code is licensed under the ISC license.
|
|
797
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
798
|
-
*/const ji=Q("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
|
|
799
|
-
* @license lucide-react v0.451.0 - ISC
|
|
800
|
-
*
|
|
801
|
-
* This source code is licensed under the ISC license.
|
|
802
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
803
|
-
*/const Bt=Q("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
|
804
|
-
* @license lucide-react v0.451.0 - ISC
|
|
805
|
-
*
|
|
806
|
-
* This source code is licensed under the ISC license.
|
|
807
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
808
|
-
*/const Jv=Q("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
809
|
-
* @license lucide-react v0.451.0 - ISC
|
|
810
|
-
*
|
|
811
|
-
* This source code is licensed under the ISC license.
|
|
812
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
813
|
-
*/const Bf=Q("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
814
|
-
* @license lucide-react v0.451.0 - ISC
|
|
815
|
-
*
|
|
816
|
-
* This source code is licensed under the ISC license.
|
|
817
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
818
|
-
*/const Yv=Q("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
819
|
-
* @license lucide-react v0.451.0 - ISC
|
|
820
|
-
*
|
|
821
|
-
* This source code is licensed under the ISC license.
|
|
822
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
823
|
-
*/const xl=Q("Tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);/**
|
|
824
|
-
* @license lucide-react v0.451.0 - ISC
|
|
825
|
-
*
|
|
826
|
-
* This source code is licensed under the ISC license.
|
|
827
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
828
|
-
*/const qf=Q("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
|
|
829
|
-
* @license lucide-react v0.451.0 - ISC
|
|
830
|
-
*
|
|
831
|
-
* This source code is licensed under the ISC license.
|
|
832
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
833
|
-
*/const _l=Q("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
834
|
-
* @license lucide-react v0.451.0 - ISC
|
|
835
|
-
*
|
|
836
|
-
* This source code is licensed under the ISC license.
|
|
837
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
838
|
-
*/const gp=Q("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
|
|
839
|
-
* @license lucide-react v0.451.0 - ISC
|
|
840
|
-
*
|
|
841
|
-
* This source code is licensed under the ISC license.
|
|
842
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
843
|
-
*/const Xv=Q("ToggleLeft",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"8",cy:"12",r:"2",key:"1nvbw3"}]]);/**
|
|
844
|
-
* @license lucide-react v0.451.0 - ISC
|
|
845
|
-
*
|
|
846
|
-
* This source code is licensed under the ISC license.
|
|
847
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
848
|
-
*/const es=Q("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
849
|
-
* @license lucide-react v0.451.0 - ISC
|
|
850
|
-
*
|
|
851
|
-
* This source code is licensed under the ISC license.
|
|
852
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
853
|
-
*/const Zv=Q("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/**
|
|
854
|
-
* @license lucide-react v0.451.0 - ISC
|
|
855
|
-
*
|
|
856
|
-
* This source code is licensed under the ISC license.
|
|
857
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
858
|
-
*/const ej=Q("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
|
|
859
|
-
* @license lucide-react v0.451.0 - ISC
|
|
860
|
-
*
|
|
861
|
-
* This source code is licensed under the ISC license.
|
|
862
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
863
|
-
*/const gs=Q("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
864
|
-
* @license lucide-react v0.451.0 - ISC
|
|
865
|
-
*
|
|
866
|
-
* This source code is licensed under the ISC license.
|
|
867
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
868
|
-
*/const tj=Q("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
|
|
869
|
-
* @license lucide-react v0.451.0 - ISC
|
|
870
|
-
*
|
|
871
|
-
* This source code is licensed under the ISC license.
|
|
872
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
873
|
-
*/const Ul=Q("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
874
|
-
* @license lucide-react v0.451.0 - ISC
|
|
875
|
-
*
|
|
876
|
-
* This source code is licensed under the ISC license.
|
|
877
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
878
|
-
*/const Zu=Q("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
|
|
879
|
-
* @license lucide-react v0.451.0 - ISC
|
|
880
|
-
*
|
|
881
|
-
* This source code is licensed under the ISC license.
|
|
882
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
883
|
-
*/const $l=Q("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
|
|
884
|
-
* @license lucide-react v0.451.0 - ISC
|
|
885
|
-
*
|
|
886
|
-
* This source code is licensed under the ISC license.
|
|
887
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
888
|
-
*/const Sr=Q("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
|
|
889
|
-
* @license lucide-react v0.451.0 - ISC
|
|
890
|
-
*
|
|
891
|
-
* This source code is licensed under the ISC license.
|
|
892
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
893
|
-
*/const sj=Q("Webhook",[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]);/**
|
|
894
|
-
* @license lucide-react v0.451.0 - ISC
|
|
895
|
-
*
|
|
896
|
-
* This source code is licensed under the ISC license.
|
|
897
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
898
|
-
*/const Fe=Q("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
899
|
-
* @license lucide-react v0.451.0 - ISC
|
|
900
|
-
*
|
|
901
|
-
* This source code is licensed under the ISC license.
|
|
902
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
903
|
-
*/const ct=Q("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 Hf(s){var r,a,o="";if(typeof s=="string"||typeof s=="number")o+=s;else if(typeof s=="object")if(Array.isArray(s)){var c=s.length;for(r=0;r<c;r++)s[r]&&(a=Hf(s[r]))&&(o&&(o+=" "),o+=a)}else for(a in s)s[a]&&(o&&(o+=" "),o+=a);return o}function O(){for(var s,r,a=0,o="",c=arguments.length;a<c;a++)(s=arguments[a])&&(r=Hf(s))&&(o&&(o+=" "),o+=r);return o}function Kf({size:s=40}){return e.jsx("img",{src:"/favicon.svg",alt:"AssureMind",width:s,height:s,style:{flexShrink:0,borderRadius:s*.22},draggable:!1})}function nj(){return e.jsxs("div",{className:"flex items-center gap-3 select-none min-w-0 px-1",children:[e.jsx(Kf,{size:46}),e.jsxs("div",{className:"flex flex-col justify-center leading-none min-w-0",children:[e.jsx("span",{className:"text-[20px] font-bold text-white truncate",style:{letterSpacing:"-0.02em"},children:"AssureMind"}),e.jsx("span",{className:"text-[9px] font-semibold text-slate-400 uppercase mt-1.5",style:{letterSpacing:"0.18em"},children:"Studio"})]})]})}function rj(){return e.jsxs("div",{className:"flex flex-col items-center gap-1 select-none",children:[e.jsx(Kf,{size:36}),e.jsx("span",{className:"text-[8px] font-bold text-white/70 whitespace-nowrap",style:{letterSpacing:"-0.01em"},children:"AssureMind"})]})}const aj=[{to:"/",icon:zv,label:"Dashboard"},{to:"/story",icon:Bt,label:"Smart Tests"},{to:"/tests",icon:Ti,label:"Test Editor"},{to:"/run",icon:Xt,label:"Run Config"},{to:"/reports",icon:jv,label:"Reports"},{to:"/variables",icon:Qv,label:"Variables"},{to:"/healing",icon:vl,label:"Self-Healing"},{to:"/git",icon:$n,label:"Git Control Center"},{to:"/library",icon:Av,label:"Step Library"},{to:"/ci-integration",icon:Fl,label:"CI/CD"},{to:"/env-config",icon:Lf,label:"Environment"},{to:"/docs",icon:Mi,label:"Docs"},{to:"/settings",icon:$f,label:"Settings"}];function ij({collapsed:s=!1,onToggle:r,mobileOpen:a=!1}){return e.jsxs(e.Fragment,{children:[a&&e.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-20 lg:hidden",onClick:r}),e.jsxs("aside",{className:O("fixed lg:relative z-30 flex flex-col h-full bg-sidebar text-white transition-all duration-300 ease-in-out flex-shrink-0",s?"w-[84px]":"w-[248px]",a?"translate-x-0":"-translate-x-full lg:translate-x-0"),children:[e.jsx("div",{className:O("flex items-center border-b border-white/[0.06] flex-shrink-0",s?"justify-center px-2 py-3":"px-3 py-4"),children:s?e.jsx(rj,{}):e.jsx(nj,{})}),e.jsx("nav",{className:O("flex-1 overflow-y-auto py-2 space-y-0.5 sidebar-nav-scroll",s?"px-2":"px-3"),style:{paddingTop:s?void 0:"0.75rem"},children:aj.map(({to:o,icon:c,label:d})=>e.jsxs(Ab,{to:o,end:o==="/",className:({isActive:x})=>O("sidebar-item",x&&"active",s&&"justify-center !px-0"),title:s?d:void 0,children:[e.jsx(c,{size:18,className:"flex-shrink-0",strokeWidth:1.8}),!s&&e.jsx("span",{className:"truncate",children:d})]},o))}),e.jsx("button",{type:"button",onClick:r,className:O("hidden lg:flex items-center justify-center py-3.5","border-t border-white/[0.06] text-white/30 hover:text-white/70 transition-colors duration-200"),title:s?"Expand sidebar":"Collapse sidebar",children:s?e.jsx(Zt,{size:16}):e.jsx(Nv,{size:16})})]})]})}function oj(){const[s,r]=p.useState(!1),[a,o]=p.useState(!1);return{collapsed:s,mobileOpen:a,toggle:()=>{r(d=>!d),o(d=>!d)}}}let di=!1,Id=null;const oa=[];let Fd=!1,Ld=[];const wu=new Set;function an(){for(const s of wu)s()}const Ye={subscribe(s){return wu.add(s),()=>{wu.delete(s)}},getSnapshot(){return{panelOpen:di,operationInProgress:Id,logSteps:[...oa],hasConflict:Fd,conflictFiles:[...Ld]}},togglePanel(){di=!di,an()},openPanel(){di=!0,an()},closePanel(){di=!1,an()},startOperation(s){Id=s,oa.length=0,an()},finishOperation(){Id=null,an()},addLogStep(s){const r=oa.findIndex(a=>a.step===s.step&&a.status==="running");r>=0&&s.status!=="running"?oa[r]=s:r<0&&oa.push(s),an()},clearLogs(){oa.length=0,an()},setConflict(s){Fd=s.length>0,Ld=s,an()},clearConflict(){Fd=!1,Ld=[],an()}};function Bl(){const[s,r]=p.useState(()=>Ye.getSnapshot());return p.useEffect(()=>Ye.subscribe(()=>r(Ye.getSnapshot())),[]),s}const ql="/api",lj=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}/ws`,Wf=["chromium","firefox","webkit"],_d=s=>`assuremind:suppress:${s}`;let ui=null;const ku=new Set;function yp(){ku.forEach(s=>s())}const vr={subscribe(s){return ku.add(s),()=>{ku.delete(s)}},getSnapshot(){return{activeModal:ui}},showModal(s){localStorage.getItem(_d(s))!=="1"&&(ui=s,yp())},dismiss(s){s&&ui&&localStorage.setItem(_d(ui),"1"),ui=null,yp()},isSuppressed(s){return localStorage.getItem(_d(s))==="1"}};function cj(){const[s,r]=p.useState(vr.getSnapshot);return p.useEffect(()=>vr.subscribe(()=>r(vr.getSnapshot())),[]),s}const dj=new Set(["AI_NOT_CONFIGURED","JIRA_NOT_CONFIGURED","XRAY_NOT_CONFIGURED"]);async function Z(s,r){const a=r?.body!==void 0,o=await fetch(`${ql}${s}`,{headers:{...a?{"Content-Type":"application/json"}:{},...r?.headers},...r});if(!o.ok){const c=await o.text();if(o.status===422)try{const d=JSON.parse(c);if(d.featureHint&&dj.has(d.featureHint))throw vr.showModal(d.featureHint),new Error("Configuration required — check the setup instructions in the dialog.")}catch(d){if(d instanceof Error&&d.message.startsWith("Configuration required"))throw d}throw new Error(`API ${r?.method??"GET"} ${s} → ${o.status}: ${c}`)}if(o.status!==204)return o.json()}const Cr={get:()=>Z("/config"),update:s=>Z("/config",{method:"PUT",body:JSON.stringify(s)}),getAiProvider:()=>Z("/ai-provider"),getMcpStatus:()=>Z("/mcp/status")},Rr={list:s=>Z(`/suites${s?`?type=${s}`:""}`),get:s=>Z(`/suites/${s}`),create:s=>Z("/suites",{method:"POST",body:JSON.stringify(s)}),update:(s,r)=>Z(`/suites/${s}`,{method:"PATCH",body:JSON.stringify(r)}),delete:s=>Z(`/suites/${s}`,{method:"DELETE"})},qn={list:s=>Z(`/suites/${s}/cases`),get:(s,r)=>Z(`/suites/${s}/cases/${r}`),create:(s,r)=>Z(`/suites/${s}/cases`,{method:"POST",body:JSON.stringify(r)}),update:(s,r,a)=>Z(`/suites/${s}/cases/${r}`,{method:"PATCH",body:JSON.stringify(a)}),delete:(s,r)=>Z(`/suites/${s}/cases/${r}`,{method:"DELETE"}),bulkDelete:(s,r)=>Z(`/suites/${s}/cases/bulk-delete`,{method:"POST",body:JSON.stringify({ids:r})}),bulkMove:(s,r,a)=>Z(`/suites/${s}/cases/bulk-move`,{method:"POST",body:JSON.stringify({ids:r,targetSuiteId:a})})},Mr={add:(s,r,a)=>Z(`/suites/${s}/cases/${r}/steps`,{method:"POST",body:JSON.stringify(a)}),update:(s,r,a,o)=>Z(`/suites/${s}/cases/${r}/steps/${a}`,{method:"PATCH",body:JSON.stringify(o)}),delete:(s,r,a)=>Z(`/suites/${s}/cases/${r}/steps/${a}`,{method:"DELETE"}),generate:(s,r,a)=>Z(`/suites/${s}/cases/${r}/steps/${a}/generate`,{method:"POST"}),generateAll:(s,r)=>Z(`/suites/${s}/cases/${r}/steps/generate-all`,{method:"POST"}),reorder:(s,r,a)=>Z(`/suites/${s}/cases/${r}/steps/reorder`,{method:"PATCH",body:JSON.stringify({stepIds:a})})},Tr={get:s=>Z(`/suites/${s}/hooks`),addStep:(s,r,a)=>Z(`/suites/${s}/hooks/${r}/steps`,{method:"POST",body:JSON.stringify(a)}),updateStep:(s,r,a,o)=>Z(`/suites/${s}/hooks/${r}/steps/${a}`,{method:"PATCH",body:JSON.stringify(o)}),deleteStep:(s,r,a)=>Z(`/suites/${s}/hooks/${r}/steps/${a}`,{method:"DELETE"}),reorderSteps:(s,r,a)=>Z(`/suites/${s}/hooks/${r}/steps/reorder`,{method:"PATCH",body:JSON.stringify({stepIds:a})}),generateStep:(s,r,a)=>Z(`/suites/${s}/hooks/${r}/steps/${a}/generate`,{method:"POST"}),generateAll:(s,r)=>Z(`/suites/${s}/hooks/${r}/steps/generate-all`,{method:"POST"})},Ud={getAll:()=>Z("/variables"),getEnv:s=>Z(`/variables/env/${s}`),set:(s,r)=>Z(`/variables/${s}`,{method:"PUT",body:JSON.stringify({value:r})}),delete:s=>Z(`/variables/${s}`,{method:"DELETE"}),matrix:()=>Z("/variables/matrix"),setScope:(s,r,a)=>Z(`/variables/${encodeURIComponent(s)}/scope/${encodeURIComponent(r)}`,{method:"PUT",body:JSON.stringify({value:a})}),deleteScope:(s,r)=>Z(`/variables/${encodeURIComponent(s)}/scope/${encodeURIComponent(r)}`,{method:"DELETE"}),deleteEverywhere:s=>Z(`/variables/${encodeURIComponent(s)}/everywhere`,{method:"DELETE"})},cn={list:()=>Z("/healing"),pending:()=>Z("/healing/pending"),stats:()=>Z("/healing/stats"),accept:s=>Z(`/healing/${s}/accept`,{method:"PATCH"}),reject:s=>Z(`/healing/${s}/reject`,{method:"PATCH"}),acceptAll:()=>Z("/healing/accept-all",{method:"POST"}),delete:s=>Z(`/healing/${s}`,{method:"DELETE"}),deleteBulk:s=>Z("/healing/delete-bulk",{method:"POST",body:JSON.stringify({ids:s})}),deleteAll:()=>Z("/healing/clear-all",{method:"POST"})},ba={start:s=>Z("/run",{method:"POST",body:JSON.stringify(s)}),stop:()=>Z("/run/stop",{method:"POST"}),list:s=>Z(`/run${s!==void 0?`?limit=${s}`:""}`),get:s=>Z(`/run/${s}`)},Nl={list:s=>Z(`/report${s!==void 0?`?limit=${s}`:""}`),get:s=>Z(`/report/${s}`),delete:s=>Z(`/report/${s}`,{method:"DELETE"})},la={generate:(s,r,a)=>Z("/story/generate",{method:"POST",body:JSON.stringify({story:s,suiteName:r,jiraUrl:a})}),generateBulk:(s,r=3)=>Z("/story/generate-bulk",{method:"POST",body:JSON.stringify({stories:s,concurrency:r})}),fetchJira:s=>Z("/story/fetch-jira",{method:"POST",body:JSON.stringify({jiraUrl:s})}),swaggerPreview:s=>Z("/story/swagger-preview",{method:"POST",body:JSON.stringify({specUrl:s})}),generateFromSwagger:(s,r,a,o)=>Z("/story/generate-from-swagger",{method:"POST",body:JSON.stringify({specUrl:s,suiteName:r,tags:a,requirements:o||void 0})})},zr={enabled:()=>Z("/xray/enabled"),status:()=>Z("/xray/status"),suiteStatus:s=>Z(`/xray/status/${s}`),createAll:()=>Z("/xray/create-all",{method:"POST"}),createSuite:s=>Z(`/xray/create/suite/${s}`,{method:"POST"}),createCase:(s,r)=>Z(`/xray/create/case/${s}/${r}`,{method:"POST"}),syncAll:()=>Z("/xray/sync-all",{method:"POST"}),syncSuite:s=>Z(`/xray/sync/suite/${s}`,{method:"POST"}),syncCase:(s,r)=>Z(`/xray/sync/case/${s}/${r}`,{method:"POST"}),validate:()=>Z("/xray/validate")},ca={list:()=>Z("/data-files"),get:s=>Z(`/data-files/${encodeURIComponent(s)}`),upload:(s,r)=>Z("/data-files/upload",{method:"POST",body:JSON.stringify({filename:s,content:r})}),update:(s,r)=>Z(`/data-files/${encodeURIComponent(s)}`,{method:"PUT",body:JSON.stringify({content:r})}),delete:s=>Z(`/data-files/${encodeURIComponent(s)}`,{method:"DELETE"})},ut={status:()=>Z("/git/status"),branches:()=>Z("/git/branches"),checkout:s=>Z("/git/checkout",{method:"POST",body:JSON.stringify({branch:s})}),commit:s=>Z("/git/commit",{method:"POST",body:JSON.stringify({message:s})}),pull:s=>Z("/git/pull",{method:"POST",body:JSON.stringify({rebase:s})}),push:()=>Z("/git/push",{method:"POST"}),fullSync:s=>Z("/git/full-sync",{method:"POST",body:JSON.stringify({message:s})}),log:s=>Z(`/git/log${s?`?count=${s}`:""}`),diff:s=>Z(`/git/diff${s?"?staged=true":""}`),conflictContent:s=>Z(`/git/conflict-content/${encodeURIComponent(s)}`),resolveConflict:(s,r)=>Z("/git/resolve-conflict",{method:"POST",body:JSON.stringify({filePath:s,content:r})}),continueRebase:()=>Z("/git/continue-rebase",{method:"POST"}),abortRebase:()=>Z("/git/abort-rebase",{method:"POST"}),generateCommitMessage:()=>Z("/git/generate-commit-message",{method:"POST"}),resolveConflictAI:(s,r,a)=>Z("/git/resolve-conflict-ai",{method:"POST",body:JSON.stringify({filePath:s,ours:r,theirs:a})}),impact:()=>Z("/git/impact")};function Sa(s,r){const a=r.replace(/\\/g,"/").split("/").pop()??r;return`${ql}/results/${s}/${encodeURIComponent(a)}`}function uj(s){return`${ql}/results/baselines/${encodeURIComponent(s)}.png`}const xj={search:s=>Z(`/search?q=${encodeURIComponent(s)}`)},Si={list:()=>Z("/files"),upload:(s,r)=>Z("/files/upload",{method:"POST",body:JSON.stringify({name:s,dataBase64:r})}),remove:s=>Z(`/files/${encodeURIComponent(s)}`,{method:"DELETE"}),downloads:s=>Z(`/report/${encodeURIComponent(s)}/downloads`),downloadUrl:(s,r)=>`${ql}/report/${encodeURIComponent(s)}/downloads/${encodeURIComponent(r)}`},wl={get:()=>Z("/env"),update:s=>Z("/env",{method:"PUT",body:JSON.stringify({values:s})})},bp={generate:s=>Z("/ci-config",{method:"POST",body:JSON.stringify(s)}),writeToRepo:s=>Z("/ci-config/write",{method:"POST",body:JSON.stringify(s)})},mj={list:()=>Z("/templates")},hj={get:(s,r)=>{const a=new URLSearchParams;return s&&a.set("suiteId",s),r&&a.set("caseId",r),Z(`/flakiness?${a}`)}},hr={list:()=>Z("/step-library"),create:s=>Z("/step-library",{method:"POST",body:JSON.stringify(s)}),update:(s,r)=>Z(`/step-library/${s}`,{method:"PATCH",body:JSON.stringify(r)}),delete:s=>Z(`/step-library/${s}`,{method:"DELETE"}),generate:s=>Z(`/step-library/${s}/generate`,{method:"POST"})},vp={capture:(s,r)=>Z(`/baselines/${s}/capture`,{method:"POST",body:JSON.stringify({screenshotPath:r})}),get:s=>Z(`/baselines/${s}`)},$d={start:(s,r)=>Z("/recorder/start",{method:"POST",body:JSON.stringify({url:s,viewport:r})}),stop:()=>Z("/recorder/stop",{method:"POST"}),status:()=>Z("/recorder/status")};function pj(s){const r=s.locator,a=s.dialogHandler?`page.once('dialog', dialog => dialog.${s.dialogHandler.type}());
|
|
904
|
-
`:"";switch(s.action){case"navigate":return`await page.goto('${dr(s.url||"")}');`;case"click":return`${a}await page.${r}.click();`;case"fill":return`${a}await page.${r}.fill('${dr(s.value||"")}');`;case"select":return`await page.${r}.selectOption('${dr(s.value||"")}');`;case"check":return`await page.${r}.check();`;case"uncheck":return`await page.${r}.uncheck();`;case"press":return r?`await page.${r}.press('${dr(s.value||"")}');`:`await page.keyboard.press('${dr(s.value||"")}');`;case"hover":return`await page.${r}.click();`;case"assert":{const o=s.instruction,c=s.soft?"expect.soft":"expect";if(o.includes("current URL contains")){const d=o.match(/contains "(.+)"/),x=d?d[1]:"/";return`await ${c}(page).toHaveURL(/${fj(x)}/);`}if(o.includes("page title is")){const d=o.match(/title is "(.+)"/),x=d?d[1]:"";return`await ${c}(page).toHaveTitle('${dr(x)}');`}if(o.includes("has value")){const d=o.match(/has value "(.+)"/),x=d?d[1]:"";return`await ${c}(page.${r}).toHaveValue('${dr(x)}');`}return o.includes("is checked")?`await ${c}(page.${r}).toBeChecked();`:o.includes("is unchecked")?`await ${c}(page.${r}).not.toBeChecked();`:r?`await ${c}(page.${r}).toBeVisible();`:`// TODO: ${o}`}default:return`// Unhandled action: ${s.action}`}}function dr(s){return s.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}function fj(s){return s.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&")}function ex(){return Oe({queryKey:["git","status"],queryFn:ut.status,refetchInterval:5e3,retry:1})}function Vf(){return Oe({queryKey:["git","branches"],queryFn:ut.branches,staleTime:3e4,retry:1})}function Gf(s){return Oe({queryKey:["git","log",s],queryFn:()=>ut.log(s),staleTime:1e4,retry:1})}function Qf(){const s=Pe();return oe({mutationFn:r=>ut.checkout(r),onSuccess:(r,a)=>{s.invalidateQueries({queryKey:["git"]}),H.success(`Switched to ${a}`)},onError:r=>H.error(`Checkout failed: ${r.message}`)})}function Jf(){const s=Pe();return oe({mutationFn:r=>(Ye.startOperation("commit"),ut.commit(r)),onSuccess:r=>{Ye.finishOperation(),s.invalidateQueries({queryKey:["git"]}),H.success(`Committed: ${r.hash}`)},onError:r=>{Ye.finishOperation(),H.error(`Commit failed: ${r.message}`)}})}function Yf(){const s=Pe();return oe({mutationFn:r=>(Ye.startOperation("pull"),ut.pull(r)),onSuccess:()=>{Ye.finishOperation(),s.invalidateQueries({queryKey:["git"]}),H.success("Pull successful")},onError:r=>{Ye.finishOperation(),H.error(`Pull failed: ${r.message}`)}})}function Xf(){const s=Pe();return oe({mutationFn:()=>(Ye.startOperation("push"),ut.push()),onSuccess:()=>{Ye.finishOperation(),s.invalidateQueries({queryKey:["git"]}),H.success("Pushed to remote")},onError:r=>{Ye.finishOperation(),H.error(`Push failed: ${r.message}`)}})}function Zf(){const s=Pe();return oe({mutationFn:r=>(Ye.startOperation("full-sync"),ut.fullSync(r)),onSuccess:()=>{Ye.finishOperation(),s.invalidateQueries({queryKey:["git"]}),H.success("Full sync complete")},onError:r=>{Ye.finishOperation(),H.error(`Sync failed: ${r.message}`)}})}function eg(){return oe({mutationFn:()=>ut.generateCommitMessage(),onError:s=>H.error(`AI generation failed: ${s.message}`)})}function tg(){const s=Pe();return oe({mutationFn:({filePath:r,content:a})=>ut.resolveConflict(r,a),onSuccess:()=>{s.invalidateQueries({queryKey:["git"]}),H.success("Conflict resolved")},onError:r=>H.error(`Resolve failed: ${r.message}`)})}function sg(){return oe({mutationFn:({filePath:s,ours:r,theirs:a})=>ut.resolveConflictAI(s,r,a),onError:s=>H.error(`AI resolve failed: ${s.message}`)})}function ng(){const s=Pe();return oe({mutationFn:()=>ut.continueRebase(),onSuccess:()=>{Ye.clearConflict(),s.invalidateQueries({queryKey:["git"]}),H.success("Rebase continued")},onError:r=>H.error(`Continue rebase failed: ${r.message}`)})}function rg(){const s=Pe();return oe({mutationFn:()=>ut.abortRebase(),onSuccess:()=>{Ye.clearConflict(),s.invalidateQueries({queryKey:["git"]}),H.success("Rebase aborted")},onError:r=>H.error(`Abort rebase failed: ${r.message}`)})}const ag="assuremind-theme";function gj(){const s=localStorage.getItem(ag);return s==="dark"||s==="light"?s:"light"}let pa=gj();const Su=new Set;function ig(s){const r=document.documentElement;s==="dark"?r.classList.add("dark"):r.classList.remove("dark")}ig(pa);function yj(){for(const s of Su)s()}const Bd={subscribe(s){return Su.add(s),()=>{Su.delete(s)}},getSnapshot(){return pa},toggle(){pa=pa==="light"?"dark":"light",localStorage.setItem(ag,pa),ig(pa),yj()}};function bj(){return{theme:p.useSyncExternalStore(Bd.subscribe,Bd.getSnapshot),toggle:Bd.toggle}}const og=6048e5,vj=864e5,sl=43200,jp=1440,Np=Symbol.for("constructDateFrom");function xn(s,r){return typeof s=="function"?s(r):s&&typeof s=="object"&&Np in s?s[Np](r):s instanceof Date?new s.constructor(r):new Date(r)}function Et(s,r){return xn(r||s,s)}let jj={};function Ui(){return jj}function zi(s,r){const a=Ui(),o=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,c=Et(s,r?.in),d=c.getDay(),x=(d<o?7:0)+d-o;return c.setDate(c.getDate()-x),c.setHours(0,0,0,0),c}function kl(s,r){return zi(s,{...r,weekStartsOn:1})}function lg(s,r){const a=Et(s,r?.in),o=a.getFullYear(),c=xn(a,0);c.setFullYear(o+1,0,4),c.setHours(0,0,0,0);const d=kl(c),x=xn(a,0);x.setFullYear(o,0,4),x.setHours(0,0,0,0);const h=kl(x);return a.getTime()>=d.getTime()?o+1:a.getTime()>=h.getTime()?o:o-1}function Sl(s){const r=Et(s),a=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return a.setUTCFullYear(r.getFullYear()),+s-+a}function Hl(s,...r){const a=xn.bind(null,s||r.find(o=>typeof o=="object"));return r.map(a)}function wp(s,r){const a=Et(s,r?.in);return a.setHours(0,0,0,0),a}function Nj(s,r,a){const[o,c]=Hl(a?.in,s,r),d=wp(o),x=wp(c),h=+d-Sl(d),f=+x-Sl(x);return Math.round((h-f)/vj)}function wj(s,r){const a=lg(s,r),o=xn(s,0);return o.setFullYear(a,0,4),o.setHours(0,0,0,0),kl(o)}function ml(s,r){const a=+Et(s)-+Et(r);return a<0?-1:a>0?1:a}function kj(s){return xn(s,Date.now())}function Sj(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function Cj(s){return!(!Sj(s)&&typeof s!="number"||isNaN(+Et(s)))}function Ej(s,r,a){const[o,c]=Hl(a?.in,s,r),d=o.getFullYear()-c.getFullYear(),x=o.getMonth()-c.getMonth();return d*12+x}function Pj(s){return r=>{const o=(s?Math[s]:Math.trunc)(r);return o===0?0:o}}function Rj(s,r){return+Et(s)-+Et(r)}function Mj(s,r){const a=Et(s,r?.in);return a.setHours(23,59,59,999),a}function Tj(s,r){const a=Et(s,r?.in),o=a.getMonth();return a.setFullYear(a.getFullYear(),o+1,0),a.setHours(23,59,59,999),a}function zj(s,r){const a=Et(s,r?.in);return+Mj(a,r)==+Tj(a,r)}function Aj(s,r,a){const[o,c,d]=Hl(a?.in,s,s,r),x=ml(c,d),h=Math.abs(Ej(c,d));if(h<1)return 0;c.getMonth()===1&&c.getDate()>27&&c.setDate(30),c.setMonth(c.getMonth()-x*h);let f=ml(c,d)===-x;zj(o)&&h===1&&ml(o,d)===1&&(f=!1);const y=x*(h-+f);return y===0?0:y}function Oj(s,r,a){const o=Rj(s,r)/1e3;return Pj(a?.roundingMethod)(o)}function Dj(s,r){const a=Et(s,r?.in);return a.setFullYear(a.getFullYear(),0,1),a.setHours(0,0,0,0),a}const Ij={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Fj=(s,r,a)=>{let o;const c=Ij[s];return typeof c=="string"?o=c:r===1?o=c.one:o=c.other.replace("{{count}}",r.toString()),a?.addSuffix?a.comparison&&a.comparison>0?"in "+o:o+" ago":o};function qd(s){return(r={})=>{const a=r.width?String(r.width):s.defaultWidth;return s.formats[a]||s.formats[s.defaultWidth]}}const Lj={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},_j={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Uj={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},$j={date:qd({formats:Lj,defaultWidth:"full"}),time:qd({formats:_j,defaultWidth:"full"}),dateTime:qd({formats:Uj,defaultWidth:"full"})},Bj={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},qj=(s,r,a,o)=>Bj[s];function xi(s){return(r,a)=>{const o=a?.context?String(a.context):"standalone";let c;if(o==="formatting"&&s.formattingValues){const x=s.defaultFormattingWidth||s.defaultWidth,h=a?.width?String(a.width):x;c=s.formattingValues[h]||s.formattingValues[x]}else{const x=s.defaultWidth,h=a?.width?String(a.width):s.defaultWidth;c=s.values[h]||s.values[x]}const d=s.argumentCallback?s.argumentCallback(r):r;return c[d]}}const Hj={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Kj={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Wj={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Vj={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Gj={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"}},Qj={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"}},Jj=(s,r)=>{const a=Number(s),o=a%100;if(o>20||o<10)switch(o%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},Yj={ordinalNumber:Jj,era:xi({values:Hj,defaultWidth:"wide"}),quarter:xi({values:Kj,defaultWidth:"wide",argumentCallback:s=>s-1}),month:xi({values:Wj,defaultWidth:"wide"}),day:xi({values:Vj,defaultWidth:"wide"}),dayPeriod:xi({values:Gj,defaultWidth:"wide",formattingValues:Qj,defaultFormattingWidth:"wide"})};function mi(s){return(r,a={})=>{const o=a.width,c=o&&s.matchPatterns[o]||s.matchPatterns[s.defaultMatchWidth],d=r.match(c);if(!d)return null;const x=d[0],h=o&&s.parsePatterns[o]||s.parsePatterns[s.defaultParseWidth],f=Array.isArray(h)?Zj(h,j=>j.test(x)):Xj(h,j=>j.test(x));let y;y=s.valueCallback?s.valueCallback(f):f,y=a.valueCallback?a.valueCallback(y):y;const g=r.slice(x.length);return{value:y,rest:g}}}function Xj(s,r){for(const a in s)if(Object.prototype.hasOwnProperty.call(s,a)&&r(s[a]))return a}function Zj(s,r){for(let a=0;a<s.length;a++)if(r(s[a]))return a}function eN(s){return(r,a={})=>{const o=r.match(s.matchPattern);if(!o)return null;const c=o[0],d=r.match(s.parsePattern);if(!d)return null;let x=s.valueCallback?s.valueCallback(d[0]):d[0];x=a.valueCallback?a.valueCallback(x):x;const h=r.slice(c.length);return{value:x,rest:h}}}const tN=/^(\d+)(th|st|nd|rd)?/i,sN=/\d+/i,nN={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},rN={any:[/^b/i,/^(a|c)/i]},aN={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},iN={any:[/1/i,/2/i,/3/i,/4/i]},oN={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},lN={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]},cN={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},dN={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]},uN={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},xN={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}},mN={ordinalNumber:eN({matchPattern:tN,parsePattern:sN,valueCallback:s=>parseInt(s,10)}),era:mi({matchPatterns:nN,defaultMatchWidth:"wide",parsePatterns:rN,defaultParseWidth:"any"}),quarter:mi({matchPatterns:aN,defaultMatchWidth:"wide",parsePatterns:iN,defaultParseWidth:"any",valueCallback:s=>s+1}),month:mi({matchPatterns:oN,defaultMatchWidth:"wide",parsePatterns:lN,defaultParseWidth:"any"}),day:mi({matchPatterns:cN,defaultMatchWidth:"wide",parsePatterns:dN,defaultParseWidth:"any"}),dayPeriod:mi({matchPatterns:uN,defaultMatchWidth:"any",parsePatterns:xN,defaultParseWidth:"any"})},cg={code:"en-US",formatDistance:Fj,formatLong:$j,formatRelative:qj,localize:Yj,match:mN,options:{weekStartsOn:0,firstWeekContainsDate:1}};function hN(s,r){const a=Et(s,r?.in);return Nj(a,Dj(a))+1}function pN(s,r){const a=Et(s,r?.in),o=+kl(a)-+wj(a);return Math.round(o/og)+1}function dg(s,r){const a=Et(s,r?.in),o=a.getFullYear(),c=Ui(),d=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??c.firstWeekContainsDate??c.locale?.options?.firstWeekContainsDate??1,x=xn(r?.in||s,0);x.setFullYear(o+1,0,d),x.setHours(0,0,0,0);const h=zi(x,r),f=xn(r?.in||s,0);f.setFullYear(o,0,d),f.setHours(0,0,0,0);const y=zi(f,r);return+a>=+h?o+1:+a>=+y?o:o-1}function fN(s,r){const a=Ui(),o=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,c=dg(s,r),d=xn(r?.in||s,0);return d.setFullYear(c,0,o),d.setHours(0,0,0,0),zi(d,r)}function gN(s,r){const a=Et(s,r?.in),o=+zi(a,r)-+fN(a,r);return Math.round(o/og)+1}function Ve(s,r){const a=s<0?"-":"",o=Math.abs(s).toString().padStart(r,"0");return a+o}const On={y(s,r){const a=s.getFullYear(),o=a>0?a:1-a;return Ve(r==="yy"?o%100:o,r.length)},M(s,r){const a=s.getMonth();return r==="M"?String(a+1):Ve(a+1,2)},d(s,r){return Ve(s.getDate(),r.length)},a(s,r){const a=s.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return a.toUpperCase();case"aaa":return a;case"aaaaa":return a[0];default:return a==="am"?"a.m.":"p.m."}},h(s,r){return Ve(s.getHours()%12||12,r.length)},H(s,r){return Ve(s.getHours(),r.length)},m(s,r){return Ve(s.getMinutes(),r.length)},s(s,r){return Ve(s.getSeconds(),r.length)},S(s,r){const a=r.length,o=s.getMilliseconds(),c=Math.trunc(o*Math.pow(10,a-3));return Ve(c,r.length)}},da={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},kp={G:function(s,r,a){const o=s.getFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return a.era(o,{width:"abbreviated"});case"GGGGG":return a.era(o,{width:"narrow"});default:return a.era(o,{width:"wide"})}},y:function(s,r,a){if(r==="yo"){const o=s.getFullYear(),c=o>0?o:1-o;return a.ordinalNumber(c,{unit:"year"})}return On.y(s,r)},Y:function(s,r,a,o){const c=dg(s,o),d=c>0?c:1-c;if(r==="YY"){const x=d%100;return Ve(x,2)}return r==="Yo"?a.ordinalNumber(d,{unit:"year"}):Ve(d,r.length)},R:function(s,r){const a=lg(s);return Ve(a,r.length)},u:function(s,r){const a=s.getFullYear();return Ve(a,r.length)},Q:function(s,r,a){const o=Math.ceil((s.getMonth()+1)/3);switch(r){case"Q":return String(o);case"QQ":return Ve(o,2);case"Qo":return a.ordinalNumber(o,{unit:"quarter"});case"QQQ":return a.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return a.quarter(o,{width:"narrow",context:"formatting"});default:return a.quarter(o,{width:"wide",context:"formatting"})}},q:function(s,r,a){const o=Math.ceil((s.getMonth()+1)/3);switch(r){case"q":return String(o);case"qq":return Ve(o,2);case"qo":return a.ordinalNumber(o,{unit:"quarter"});case"qqq":return a.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return a.quarter(o,{width:"narrow",context:"standalone"});default:return a.quarter(o,{width:"wide",context:"standalone"})}},M:function(s,r,a){const o=s.getMonth();switch(r){case"M":case"MM":return On.M(s,r);case"Mo":return a.ordinalNumber(o+1,{unit:"month"});case"MMM":return a.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return a.month(o,{width:"narrow",context:"formatting"});default:return a.month(o,{width:"wide",context:"formatting"})}},L:function(s,r,a){const o=s.getMonth();switch(r){case"L":return String(o+1);case"LL":return Ve(o+1,2);case"Lo":return a.ordinalNumber(o+1,{unit:"month"});case"LLL":return a.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return a.month(o,{width:"narrow",context:"standalone"});default:return a.month(o,{width:"wide",context:"standalone"})}},w:function(s,r,a,o){const c=gN(s,o);return r==="wo"?a.ordinalNumber(c,{unit:"week"}):Ve(c,r.length)},I:function(s,r,a){const o=pN(s);return r==="Io"?a.ordinalNumber(o,{unit:"week"}):Ve(o,r.length)},d:function(s,r,a){return r==="do"?a.ordinalNumber(s.getDate(),{unit:"date"}):On.d(s,r)},D:function(s,r,a){const o=hN(s);return r==="Do"?a.ordinalNumber(o,{unit:"dayOfYear"}):Ve(o,r.length)},E:function(s,r,a){const o=s.getDay();switch(r){case"E":case"EE":case"EEE":return a.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return a.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(o,{width:"short",context:"formatting"});default:return a.day(o,{width:"wide",context:"formatting"})}},e:function(s,r,a,o){const c=s.getDay(),d=(c-o.weekStartsOn+8)%7||7;switch(r){case"e":return String(d);case"ee":return Ve(d,2);case"eo":return a.ordinalNumber(d,{unit:"day"});case"eee":return a.day(c,{width:"abbreviated",context:"formatting"});case"eeeee":return a.day(c,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(c,{width:"short",context:"formatting"});default:return a.day(c,{width:"wide",context:"formatting"})}},c:function(s,r,a,o){const c=s.getDay(),d=(c-o.weekStartsOn+8)%7||7;switch(r){case"c":return String(d);case"cc":return Ve(d,r.length);case"co":return a.ordinalNumber(d,{unit:"day"});case"ccc":return a.day(c,{width:"abbreviated",context:"standalone"});case"ccccc":return a.day(c,{width:"narrow",context:"standalone"});case"cccccc":return a.day(c,{width:"short",context:"standalone"});default:return a.day(c,{width:"wide",context:"standalone"})}},i:function(s,r,a){const o=s.getDay(),c=o===0?7:o;switch(r){case"i":return String(c);case"ii":return Ve(c,r.length);case"io":return a.ordinalNumber(c,{unit:"day"});case"iii":return a.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return a.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return a.day(o,{width:"short",context:"formatting"});default:return a.day(o,{width:"wide",context:"formatting"})}},a:function(s,r,a){const c=s.getHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return a.dayPeriod(c,{width:"abbreviated",context:"formatting"});case"aaa":return a.dayPeriod(c,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return a.dayPeriod(c,{width:"narrow",context:"formatting"});default:return a.dayPeriod(c,{width:"wide",context:"formatting"})}},b:function(s,r,a){const o=s.getHours();let c;switch(o===12?c=da.noon:o===0?c=da.midnight:c=o/12>=1?"pm":"am",r){case"b":case"bb":return a.dayPeriod(c,{width:"abbreviated",context:"formatting"});case"bbb":return a.dayPeriod(c,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return a.dayPeriod(c,{width:"narrow",context:"formatting"});default:return a.dayPeriod(c,{width:"wide",context:"formatting"})}},B:function(s,r,a){const o=s.getHours();let c;switch(o>=17?c=da.evening:o>=12?c=da.afternoon:o>=4?c=da.morning:c=da.night,r){case"B":case"BB":case"BBB":return a.dayPeriod(c,{width:"abbreviated",context:"formatting"});case"BBBBB":return a.dayPeriod(c,{width:"narrow",context:"formatting"});default:return a.dayPeriod(c,{width:"wide",context:"formatting"})}},h:function(s,r,a){if(r==="ho"){let o=s.getHours()%12;return o===0&&(o=12),a.ordinalNumber(o,{unit:"hour"})}return On.h(s,r)},H:function(s,r,a){return r==="Ho"?a.ordinalNumber(s.getHours(),{unit:"hour"}):On.H(s,r)},K:function(s,r,a){const o=s.getHours()%12;return r==="Ko"?a.ordinalNumber(o,{unit:"hour"}):Ve(o,r.length)},k:function(s,r,a){let o=s.getHours();return o===0&&(o=24),r==="ko"?a.ordinalNumber(o,{unit:"hour"}):Ve(o,r.length)},m:function(s,r,a){return r==="mo"?a.ordinalNumber(s.getMinutes(),{unit:"minute"}):On.m(s,r)},s:function(s,r,a){return r==="so"?a.ordinalNumber(s.getSeconds(),{unit:"second"}):On.s(s,r)},S:function(s,r){return On.S(s,r)},X:function(s,r,a){const o=s.getTimezoneOffset();if(o===0)return"Z";switch(r){case"X":return Cp(o);case"XXXX":case"XX":return mr(o);default:return mr(o,":")}},x:function(s,r,a){const o=s.getTimezoneOffset();switch(r){case"x":return Cp(o);case"xxxx":case"xx":return mr(o);default:return mr(o,":")}},O:function(s,r,a){const o=s.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+Sp(o,":");default:return"GMT"+mr(o,":")}},z:function(s,r,a){const o=s.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+Sp(o,":");default:return"GMT"+mr(o,":")}},t:function(s,r,a){const o=Math.trunc(+s/1e3);return Ve(o,r.length)},T:function(s,r,a){return Ve(+s,r.length)}};function Sp(s,r=""){const a=s>0?"-":"+",o=Math.abs(s),c=Math.trunc(o/60),d=o%60;return d===0?a+String(c):a+String(c)+r+Ve(d,2)}function Cp(s,r){return s%60===0?(s>0?"-":"+")+Ve(Math.abs(s)/60,2):mr(s,r)}function mr(s,r=""){const a=s>0?"-":"+",o=Math.abs(s),c=Ve(Math.trunc(o/60),2),d=Ve(o%60,2);return a+c+r+d}const Ep=(s,r)=>{switch(s){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});default:return r.date({width:"full"})}},ug=(s,r)=>{switch(s){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});default:return r.time({width:"full"})}},yN=(s,r)=>{const a=s.match(/(P+)(p+)?/)||[],o=a[1],c=a[2];if(!c)return Ep(s,r);let d;switch(o){case"P":d=r.dateTime({width:"short"});break;case"PP":d=r.dateTime({width:"medium"});break;case"PPP":d=r.dateTime({width:"long"});break;default:d=r.dateTime({width:"full"});break}return d.replace("{{date}}",Ep(o,r)).replace("{{time}}",ug(c,r))},bN={p:ug,P:yN},vN=/^D+$/,jN=/^Y+$/,NN=["D","DD","YY","YYYY"];function wN(s){return vN.test(s)}function kN(s){return jN.test(s)}function SN(s,r,a){const o=CN(s,r,a);if(console.warn(o),NN.includes(s))throw new RangeError(o)}function CN(s,r,a){const o=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${r}\`) for formatting ${o} to the input \`${a}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const EN=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,PN=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,RN=/^'([^]*?)'?$/,MN=/''/g,TN=/[a-zA-Z]/;function zN(s,r,a){const o=Ui(),c=o.locale??cg,d=o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,x=o.weekStartsOn??o.locale?.options?.weekStartsOn??0,h=Et(s,a?.in);if(!Cj(h))throw new RangeError("Invalid time value");let f=r.match(PN).map(g=>{const j=g[0];if(j==="p"||j==="P"){const P=bN[j];return P(g,c.formatLong)}return g}).join("").match(EN).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const j=g[0];if(j==="'")return{isToken:!1,value:AN(g)};if(kp[j])return{isToken:!0,value:g};if(j.match(TN))throw new RangeError("Format string contains an unescaped latin alphabet character `"+j+"`");return{isToken:!1,value:g}});c.localize.preprocessor&&(f=c.localize.preprocessor(h,f));const y={firstWeekContainsDate:d,weekStartsOn:x,locale:c};return f.map(g=>{if(!g.isToken)return g.value;const j=g.value;(kN(j)||wN(j))&&SN(j,r,String(s));const P=kp[j[0]];return P(h,j,c.localize,y)}).join("")}function AN(s){const r=s.match(RN);return r?r[1].replace(MN,"'"):s}function ON(s,r,a){const o=Ui(),c=a?.locale??o.locale??cg,d=2520,x=ml(s,r);if(isNaN(x))throw new RangeError("Invalid time value");const h=Object.assign({},a,{addSuffix:a?.addSuffix,comparison:x}),[f,y]=Hl(a?.in,...x>0?[r,s]:[s,r]),g=Oj(y,f),j=(Sl(y)-Sl(f))/1e3,P=Math.round((g-j)/60);let S;if(P<2)return a?.includeSeconds?g<5?c.formatDistance("lessThanXSeconds",5,h):g<10?c.formatDistance("lessThanXSeconds",10,h):g<20?c.formatDistance("lessThanXSeconds",20,h):g<40?c.formatDistance("halfAMinute",0,h):g<60?c.formatDistance("lessThanXMinutes",1,h):c.formatDistance("xMinutes",1,h):P===0?c.formatDistance("lessThanXMinutes",1,h):c.formatDistance("xMinutes",P,h);if(P<45)return c.formatDistance("xMinutes",P,h);if(P<90)return c.formatDistance("aboutXHours",1,h);if(P<jp){const k=Math.round(P/60);return c.formatDistance("aboutXHours",k,h)}else{if(P<d)return c.formatDistance("xDays",1,h);if(P<sl){const k=Math.round(P/jp);return c.formatDistance("xDays",k,h)}else if(P<sl*2)return S=Math.round(P/sl),c.formatDistance("aboutXMonths",S,h)}if(S=Aj(y,f),S<12){const k=Math.round(P/sl);return c.formatDistance("xMonths",k,h)}else{const k=S%12,E=Math.trunc(S/12);return k<3?c.formatDistance("aboutXYears",E,h):k<9?c.formatDistance("overXYears",E,h):c.formatDistance("almostXYears",E+1,h)}}function Cl(s,r){return ON(s,kj(s),r)}let ur=[];const Cu=new Set;function Hd(){Cu.forEach(s=>s())}const jr={subscribe(s){return Cu.add(s),()=>{Cu.delete(s)}},getSnapshot(){return{notifications:ur,unreadCount:ur.filter(s=>!s.read).length}},push(s){ur=[s,...ur].slice(0,20),Hd()},markAllRead(){ur=ur.map(s=>({...s,read:!0})),Hd()},clear(){ur=[],Hd()}};function DN(){const[s,r]=p.useState(()=>jr.getSnapshot());return p.useEffect(()=>jr.subscribe(()=>r(jr.getSnapshot())),[]),s}function IN({type:s}){switch(s){case"run-complete":return e.jsx(He,{size:13,className:"text-emerald-500 flex-shrink-0"});case"run-error":return e.jsx(St,{size:13,className:"text-red-500 flex-shrink-0"});case"healing":return e.jsx(ct,{size:13,className:"text-amber-500 flex-shrink-0"});case"git":return e.jsx($n,{size:13,className:"text-blue-500 flex-shrink-0"});default:return e.jsx(bl,{size:13,className:"text-content-tertiary flex-shrink-0"})}}function FN(){const[s,r]=p.useState(!1),{notifications:a,unreadCount:o}=DN(),c=p.useRef(null),d=Gs();return p.useEffect(()=>{if(!s)return;function x(h){c.current&&!c.current.contains(h.target)&&r(!1)}return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[s]),e.jsxs("div",{className:"relative",ref:c,children:[e.jsxs("button",{type:"button",onClick:()=>r(x=>!x),className:O("relative p-2 rounded-lg transition-all duration-200",s?"bg-accent-muted text-accent":"text-content-tertiary hover:bg-surface-inset hover:text-content-secondary"),"aria-label":"Notifications",title:"Notifications",children:[e.jsx(bl,{size:16}),o>0&&e.jsx("span",{className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-red-500 text-white text-[9px] font-bold flex items-center justify-center ring-2 ring-surface",children:o>9?"9+":o})]}),s&&e.jsxs("div",{className:"absolute right-0 top-full mt-2 w-80 bg-surface border border-border rounded-xl shadow-modal z-50 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border bg-surface-inset/50",children:[e.jsx("span",{className:"text-xs font-semibold text-content",children:"Notifications"}),e.jsxs("div",{className:"flex items-center gap-1",children:[o>0&&e.jsx("button",{type:"button",onClick:()=>jr.markAllRead(),className:"p-1 rounded text-content-tertiary hover:text-content hover:bg-surface-inset transition-colors",title:"Mark all read",children:e.jsx(Sf,{size:12})}),e.jsx("button",{type:"button",onClick:()=>jr.clear(),className:"p-1 rounded text-content-tertiary hover:text-red-500 hover:bg-red-50 transition-colors",title:"Clear all",children:e.jsx(es,{size:12})})]})]}),e.jsx("div",{className:"max-h-80 overflow-y-auto divide-y divide-border/50",children:a.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-2",children:[e.jsx(bl,{size:20,className:"text-content-tertiary/40"}),e.jsx("p",{className:"text-xs text-content-tertiary",children:"No notifications"})]}):a.map(x=>e.jsxs("div",{className:O("flex items-start gap-2.5 px-3 py-2.5 transition-colors",!x.read&&"bg-accent-muted/20",x.link&&"cursor-pointer hover:bg-surface-inset/50"),onClick:()=>{x.link&&(r(!1),d(x.link))},children:[e.jsx("div",{className:"mt-0.5",children:e.jsx(IN,{type:x.type})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:O("text-xs leading-relaxed",x.read?"text-content-secondary":"text-content font-medium"),children:x.message}),e.jsx("p",{className:"text-[9px] text-content-tertiary mt-0.5",children:Cl(new Date(x.timestamp),{addSuffix:!0})})]}),x.link&&e.jsx(wa,{size:10,className:"text-content-tertiary/60 flex-shrink-0 mt-0.5"}),!x.read&&e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-accent flex-shrink-0 mt-1.5"})]},x.id))})]})]})}function LN(){const s=Pe(),r=Gs(),[a,o]=p.useState(!1),c=p.useRef(null),{data:d}=Oe({queryKey:["config"],queryFn:()=>Cr.get(),staleTime:3e4}),x=oe({mutationFn:y=>{const g=d?.environmentUrls?.[y];return Cr.update({environment:y,...g?{baseUrl:g}:{}})},onSuccess:()=>{s.invalidateQueries({queryKey:["config"]}),o(!1)}});p.useEffect(()=>{const y=g=>{c.current&&!c.current.contains(g.target)&&o(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[]);const h=d?.environments??[];if(h.length===0)return null;const f=d?.environment??"";return e.jsxs("div",{ref:c,className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>o(y=>!y),className:"flex items-center gap-1.5 text-xs border border-border rounded-lg px-2.5 py-1.5 text-content-secondary hover:bg-surface-inset transition-colors",children:[e.jsx(Gn,{size:12,className:"text-accent flex-shrink-0"}),e.jsx("span",{className:"hidden sm:inline max-w-[100px] truncate uppercase font-semibold",children:f||"env"}),e.jsx(kt,{size:11,className:"text-content-tertiary"})]}),a&&e.jsxs("div",{className:"absolute right-0 top-full mt-1 w-52 bg-surface border border-border rounded-xl shadow-elevated z-50 overflow-hidden",children:[e.jsx("div",{className:"px-3 py-2 border-b border-border",children:e.jsx("p",{className:"text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Environment"})}),e.jsx("div",{className:"py-1",children:h.map(y=>{const g=d?.environmentUrls?.[y],j=f===y;return e.jsxs("button",{type:"button",onClick:()=>x.mutate(y),className:O("w-full text-left px-3 py-2 text-xs hover:bg-surface-inset transition-colors flex items-center justify-between gap-2",j&&"text-accent font-semibold"),children:[e.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx(Qe,{size:11,className:O("flex-shrink-0",j?"opacity-100":"opacity-0")}),e.jsx("span",{className:"truncate uppercase",children:y})]}),g&&e.jsx("span",{className:"text-[9px] text-content-tertiary flex-shrink-0 max-w-[90px] truncate",children:g.replace(/^https?:\/\//,"")})]},y)})}),e.jsx("div",{className:"border-t border-border px-3 py-2",children:e.jsxs("button",{type:"button",onClick:()=>{o(!1),r("/settings")},className:"flex items-center gap-1 text-[10px] text-content-tertiary hover:text-accent transition-colors",children:[e.jsx(kr,{size:10})," Manage environments"]})})]})]})}const _N={anthropic:"Anthropic",openai:"OpenAI",google:"Google","azure-openai":"Azure OpenAI",bedrock:"Bedrock",deepseek:"DeepSeek",groq:"Groq",together:"Together",qwen:"Qwen",perplexity:"Perplexity",ollama:"Ollama",custom:"Custom",unknown:"AI"};function UN(){const s=Pe(),[r,a]=p.useState(!1),[o,c]=p.useState(""),[d,x]=p.useState(""),{data:h}=Oe({queryKey:["ai-provider"],queryFn:()=>Cr.getAiProvider(),staleTime:6e4,retry:!1}),{data:f}=Oe({queryKey:["env"],queryFn:wl.get,enabled:r});p.useEffect(()=>{r&&h&&(c(h.provider==="unknown"?"":h.provider),x(h.model==="unknown"?"":h.model))},[r,h]);const y=f?.providerLabels??_N,g=y[h?.provider??""]??h?.provider??"...",j=h?.model??"...",P=p.useMemo(()=>f?.groups.find(v=>v.id==="ai-core")?.fields.find(v=>v.key==="AI_PROVIDER")?.options??[],[f]),S=p.useMemo(()=>f?.groups.find(v=>v.provider===o)?.fields.find(v=>v.key.endsWith("_MODEL")),[f,o]),k=p.useMemo(()=>{const R=S?.recommended??[];return d&&!R.includes(d)?[d,...R]:R},[S,d]),E=oe({mutationFn:()=>{const R={AI_PROVIDER:o};return S&&d&&(R[S.key]=d),wl.update(R)},onSuccess:()=>{H.success("AI provider updated in .env"),s.invalidateQueries({queryKey:["ai-provider"]}),s.invalidateQueries({queryKey:["env"]}),s.invalidateQueries({queryKey:["config-status"]}),a(!1)},onError:R=>H.error(R.message)});return h?e.jsxs("div",{className:"relative hidden sm:block",children:[e.jsxs("button",{type:"button",onClick:()=>a(R=>!R),title:"Change AI provider & model",className:"flex items-center gap-1.5 text-xs bg-surface-inset border border-border rounded-lg px-3 py-1.5 hover:border-accent/40 transition-colors",children:[e.jsx(pv,{size:13,className:"text-accent flex-shrink-0"}),e.jsx("span",{className:"font-medium text-content-secondary",children:g}),e.jsx("span",{className:"text-content-tertiary/50",children:"/"}),e.jsx("span",{className:"text-content-tertiary truncate max-w-[140px]",children:j}),e.jsx(kt,{size:12,className:"text-content-tertiary"})]}),r&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>a(!1)}),e.jsxs("div",{className:"absolute right-0 mt-2 w-72 z-50 bg-surface border border-border rounded-xl shadow-modal p-3 space-y-3",children:[e.jsx("p",{className:"text-[11px] font-bold text-content",children:"AI Provider"}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-semibold text-content-tertiary block mb-1",children:"Provider"}),e.jsxs("select",{value:o,onChange:R=>{c(R.target.value),x("")},className:"w-full border border-border rounded-lg px-2.5 py-1.5 text-xs bg-surface text-content-secondary focus:outline-none focus:ring-2 focus:ring-accent/30",children:[e.jsx("option",{value:"",children:"— select —"}),P.filter(Boolean).map(R=>e.jsx("option",{value:R,children:y[R]??R},R))]})]}),S&&e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-semibold text-content-tertiary block mb-1",children:"Model"}),k.length>0?e.jsxs("select",{value:d,onChange:R=>x(R.target.value),className:"w-full border border-border rounded-lg px-2.5 py-1.5 text-xs bg-surface text-content-secondary focus:outline-none focus:ring-2 focus:ring-accent/30",children:[e.jsx("option",{value:"",children:"— select —"}),k.map(R=>e.jsx("option",{value:R,children:R},R))]}):e.jsx("input",{type:"text",value:d,placeholder:S.placeholder??"model name",onChange:R=>x(R.target.value),className:"w-full border border-border rounded-lg px-2.5 py-1.5 text-xs bg-surface text-content-secondary focus:outline-none focus:ring-2 focus:ring-accent/30"})]}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Cloud providers also need an API key — set it in the full editor."}),e.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[e.jsxs(nf,{to:"/env-config",onClick:()=>a(!1),className:"text-[11px] text-accent hover:underline flex items-center gap-1",children:[e.jsx(kr,{size:11})," More settings"]}),e.jsxs("button",{type:"button",onClick:()=>E.mutate(),disabled:!o||E.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold bg-accent text-white hover:brightness-110 disabled:opacity-40",children:[e.jsx(ya,{size:12})," ",E.isPending?"Saving…":"Save"]})]})]})]})]}):null}function $N({title:s,onMenuClick:r}){const{panelOpen:a}=Bl(),{data:o}=ex(),{theme:c,toggle:d}=bj(),x=(o?.modified.length??0)+(o?.added.length??0)+(o?.deleted.length??0)+(o?.untracked.length??0);return e.jsxs("header",{className:"h-14 bg-surface border-b border-border flex items-center px-5 gap-3 flex-shrink-0",children:[e.jsx("button",{type:"button",onClick:r,className:"p-1.5 rounded-lg hover:bg-surface-inset text-content-tertiary lg:hidden transition-colors","aria-label":"Toggle sidebar",children:e.jsx(Fv,{size:18})}),e.jsx("h1",{className:"text-sm font-semibold text-content tracking-tight flex-1",children:s}),e.jsx(UN,{}),e.jsx(LN,{}),e.jsx(FN,{}),e.jsx("button",{type:"button",onClick:d,className:O("p-2 rounded-lg transition-all duration-200",c==="dark"?"bg-surface-inset text-amber-400 hover:bg-surface-overlay":"text-content-tertiary hover:bg-surface-inset hover:text-content-secondary"),"aria-label":c==="dark"?"Switch to light mode":"Switch to dark mode",title:c==="dark"?"Light mode":"Dark mode",children:c==="dark"?e.jsx(Yv,{size:16}):e.jsx(_v,{size:16})}),e.jsxs("button",{type:"button",onClick:()=>Ye.togglePanel(),className:O("relative flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-all duration-200",a?"bg-accent-muted text-accent border border-accent/20":"text-content-tertiary hover:bg-surface-inset hover:text-content-secondary border border-transparent"),"aria-label":"Toggle Git panel",title:"Git Control Center",children:[e.jsx($n,{size:14}),e.jsx("span",{className:"hidden sm:inline",children:"Git"}),x>0&&e.jsx("span",{className:"absolute -top-1.5 -right-1.5 w-4 h-4 rounded-full bg-amber-500 text-white text-[9px] font-bold flex items-center justify-center ring-2 ring-surface",children:x>9?"9+":x})]})]})}function ve({variant:s="primary",size:r="md",loading:a=!1,children:o,className:c,disabled:d,...x}){return e.jsxs("button",{...x,disabled:d||a,className:O("inline-flex items-center justify-center gap-2 font-medium rounded-lg transition-all duration-150","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1",{"bg-gradient-to-b from-accent to-accent-dark text-white shadow-sm hover:shadow-md hover:brightness-110 focus-visible:ring-accent":s==="primary","bg-surface border border-border text-content-secondary hover:bg-surface-inset hover:text-content hover:border-border-strong focus-visible:ring-accent":s==="secondary","text-content-secondary hover:bg-surface-inset hover:text-content focus-visible:ring-accent/40":s==="ghost","bg-gradient-to-b from-red-500 to-red-600 text-white shadow-sm hover:shadow-md hover:brightness-110 focus-visible:ring-red-500":s==="danger","px-2.5 py-1.5 text-xs gap-1.5":r==="sm","px-4 py-2 text-sm":r==="md","px-5 py-2.5 text-sm":r==="lg","opacity-40 cursor-not-allowed pointer-events-none":d||a},c),children:[a&&e.jsxs("svg",{className:"animate-spin h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-20",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),e.jsx("path",{className:"opacity-80",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),o]})}function Ar(s){const r=p.useRef(null),a=p.useRef(s);a.current=s;const o=p.useCallback(()=>{if(r.current?.readyState===WebSocket.OPEN)return;const c=new WebSocket(lj);r.current=c,c.onmessage=d=>{try{const x=JSON.parse(d.data),h=a.current[x.event];h&&h(x.data)}catch{}},c.onclose=()=>{setTimeout(o,3e3)},c.onerror=()=>{c.close()}},[]);p.useEffect(()=>(o(),()=>{r.current?.close()}),[o])}let El={isRunning:!1,runId:null,currentBrowser:null,currentCase:null,currentStep:null,completed:null,error:null,activeCases:new Map};const Eu=new Set;function xg(){Eu.forEach(s=>s())}function ua(s){El=s(El),xg()}const Kd={subscribe(s){return Eu.add(s),()=>{Eu.delete(s)}},getSnapshot(){return El},reset(){El={isRunning:!1,runId:null,currentBrowser:null,currentCase:null,currentStep:null,completed:null,error:null,activeCases:new Map},xg()}};function tx(){const s=p.useSyncExternalStore(Kd.subscribe,Kd.getSnapshot),r=p.useCallback(f=>{const y=f;ua(()=>({isRunning:!0,runId:y.runId,currentBrowser:null,currentCase:null,currentStep:null,completed:null,error:null,activeCases:new Map}))},[]),a=p.useCallback(f=>{const y=f;ua(g=>{const j=new Map(g.activeCases);return j.set(y.caseId,y.caseName),{...g,isRunning:!0,currentBrowser:y.browser??g.currentBrowser,currentCase:y,currentStep:null,activeCases:j}})},[]),o=p.useCallback(f=>{ua(y=>({...y,isRunning:!0,currentStep:f}))},[]),c=p.useCallback(f=>{ua(y=>({...y,isRunning:!1,completed:f,currentCase:null,currentStep:null}))},[]),d=p.useCallback(f=>{const y=f;ua(g=>({...g,isRunning:!1,error:y.error}))},[]),x=p.useCallback(()=>{ua(f=>({...f,isRunning:!1,completed:f.completed??{runId:f.runId??"",passed:0,failed:0,skipped:0,duration:0},currentCase:null,currentStep:null}))},[]);Ar({"run:start":r,"run:case":a,"run:step":o,"run:complete":c,"run:error":d,"run:stopped":x});const h=p.useCallback(()=>{Kd.reset()},[]);return{...s,reset:h}}function Wd(s,r){Ar({[s]:r})}function Pp({data:s,maxHeight:r=32}){const a=Math.max(...s.map(o=>o.value),1);return e.jsx("div",{className:"flex items-end gap-[3px]",style:{height:r},children:s.map((o,c)=>e.jsx("div",{className:O("w-[6px] rounded-full transition-all duration-500",o.color),style:{height:`${Math.max(o.value/a*100,6)}%`}},c))})}function BN({rate:s,hasData:r=!1,size:a=80}){const c=(a-6)/2,d=2*Math.PI*c,x=d-s/100*d,h=r?"#ef4444":"var(--color-border)";return e.jsxs("div",{className:"relative",style:{width:a,height:a},children:[e.jsxs("svg",{width:a,height:a,className:"-rotate-90",children:[e.jsx("circle",{cx:a/2,cy:a/2,r:c,fill:"none",stroke:h,strokeWidth:6}),e.jsx("circle",{cx:a/2,cy:a/2,r:c,fill:"none",stroke:"#10b981",strokeWidth:6,strokeLinecap:"round",strokeDasharray:d,strokeDashoffset:x,className:"transition-all duration-1000 ease-out"})]}),e.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:e.jsxs("span",{className:"text-lg font-bold text-content tabular-nums",children:[s,"%"]})})]})}function qN({status:s}){const r={passed:"bg-emerald-500",failed:"bg-red-500",partial:"bg-amber-500",running:"bg-blue-500 animate-pulse",skipped:"bg-slate-400"};return e.jsx("span",{className:O("w-2 h-2 rounded-full flex-shrink-0",r[s]??"bg-slate-400")})}function HN(s,r){return s.filter(a=>a.suiteIds?.includes(r)).slice(-7).map(a=>({value:a.totalTests>0?Math.round(a.passed/a.totalTests*100):0,color:a.failed>0?"bg-red-400":"bg-emerald-400"}))}function KN(){const s=Gs(),{data:r=[],isLoading:a}=Oe({queryKey:["reports"],queryFn:()=>Nl.list(20)}),{data:o=[],isLoading:c}=Oe({queryKey:["suites"],queryFn:()=>Rr.list()}),{data:d}=Oe({queryKey:["healing-stats"],queryFn:()=>cn.stats(),staleTime:3e4,retry:!1}),x=tx(),h=a||c,f=r[0],y=o.reduce((w,N)=>w+(N.caseCount??0),0),g=o.filter(w=>(w.type??"ui")==="ui"),j=o.filter(w=>(w.type??"ui")==="api"),P=g.reduce((w,N)=>w+(N.caseCount??0),0),S=j.reduce((w,N)=>w+(N.caseCount??0),0),k=r.reduce((w,N)=>w+N.passed,0),E=r.reduce((w,N)=>w+N.failed,0),R=r.reduce((w,N)=>w+N.skipped,0),v=k+E>0?Math.round(k/(k+E)*100):0,C=k+E+R,D=r.filter(w=>w.duration).length>0?Math.round(r.filter(w=>w.duration).reduce((w,N)=>w+(N.duration??0),0)/r.filter(w=>w.duration).length/1e3):0,M=[...r].reverse().map(w=>({value:w.passed+w.failed+w.skipped,color:w.status==="passed"?"bg-emerald-400":w.status==="failed"?"bg-red-400":"bg-amber-400"}));return h?e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex-shrink-0 px-8 pt-6 pb-4",children:[e.jsx("div",{className:"h-7 w-48 rounded-lg skeleton-shimmer"}),e.jsx("div",{className:"h-4 w-72 rounded-lg skeleton-shimmer mt-2"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-8 pb-8",children:[e.jsx("div",{className:"grid grid-cols-4 gap-4 mb-6",children:[1,2,3,4].map(w=>e.jsx("div",{className:"h-28 rounded-2xl skeleton-shimmer"},w))}),e.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(w=>e.jsx("div",{className:"h-64 rounded-2xl skeleton-shimmer"},w))})]})]}):e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex-shrink-0 px-8 pt-6 pb-4 flex items-end justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-content tracking-tight",children:"Dashboard"}),e.jsx("p",{className:"text-sm text-content-tertiary mt-0.5",children:"Test automation health at a glance"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(ve,{size:"sm",variant:"secondary",onClick:()=>s("/run"),children:[e.jsx(Xt,{size:13})," Run Tests"]}),e.jsxs(ve,{size:"sm",onClick:()=>s("/story"),children:[e.jsx(Bt,{size:13})," Generate"]})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-8 pb-8 space-y-5",children:[x.isRunning&&e.jsx("div",{className:"rounded-2xl border border-accent/25 bg-gradient-to-r from-accent/[0.06] via-accent/[0.03] to-transparent p-4 animate-fade-in",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative w-8 h-8 flex-shrink-0",children:[e.jsx("div",{className:"absolute inset-0 rounded-full border-2 border-accent/20"}),e.jsx("div",{className:"absolute inset-0 rounded-full border-2 border-transparent border-t-accent animate-spin"})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-semibold text-content",children:"Run in progress..."}),x.currentCase&&e.jsxs("p",{className:"text-xs text-content-secondary truncate mt-0.5",children:[x.currentCase.caseName,x.currentStep&&` › ${x.currentStep.instruction}`]})]}),e.jsxs(ve,{size:"sm",variant:"ghost",onClick:()=>s("/run"),children:["View ",e.jsx(gr,{size:12})]})]})}),x.completed&&!x.isRunning&&(()=>{const w=x.completed,N=w.failed===0&&w.passed>0,K=w.failed>0,_=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"}:K?{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"},ee=N?He:K?St:gs;return e.jsx("div",{className:O("rounded-2xl border p-4 animate-fade-in",_.border,_.bg),children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ee,{size:20,className:O(_.icon,"flex-shrink-0")}),e.jsxs("div",{children:[e.jsx("p",{className:O("text-sm font-semibold",_.title),children:_.label}),e.jsxs("p",{className:O("text-xs mt-0.5",_.subtitle),children:[w.passed," passed / ",w.failed," failed / ",w.skipped," skipped"]})]})]}),e.jsx(ve,{variant:"secondary",size:"sm",onClick:()=>s("/reports"),children:"View Report"})]})})})(),e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"rounded-2xl border border-border bg-surface p-5 flex flex-col justify-between",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-indigo-50 border border-indigo-100 flex items-center justify-center",children:e.jsx(Pr,{size:18,className:"text-indigo-500"})}),e.jsx("span",{className:"text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Coverage"})]}),e.jsxs("div",{className:"mt-4",children:[e.jsx("p",{className:"text-3xl font-extrabold text-content tabular-nums tracking-tight",children:o.length}),e.jsx("p",{className:"text-xs text-content-tertiary mt-0.5",children:"test suites"})]}),e.jsxs("div",{className:"mt-3 pt-3 border-t border-border-muted flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(yr,{size:11,className:"text-blue-500"}),e.jsxs("span",{className:"text-[11px] text-content-secondary font-medium",children:[g.length," UI"]}),e.jsxs("span",{className:"text-[10px] text-content-tertiary",children:["(",P,")"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(qv,{size:11,className:"text-purple-500"}),e.jsxs("span",{className:"text-[11px] text-content-secondary font-medium",children:[j.length," API"]}),e.jsxs("span",{className:"text-[10px] text-content-tertiary",children:["(",S,")"]})]})]})]}),e.jsxs("div",{className:"rounded-2xl border border-border bg-surface p-5 flex flex-col items-center justify-center",children:[e.jsx("span",{className:"text-[10px] font-semibold text-content-tertiary uppercase tracking-wider mb-3",children:"Pass Rate"}),e.jsx(BN,{rate:r.length>0?v:0,hasData:k+E>0}),e.jsx("p",{className:"text-[11px] text-content-tertiary mt-2",children:k+E>0?`${k} of ${k+E} cases passed`:"no runs yet"})]}),e.jsxs("div",{className:"rounded-2xl border border-border bg-surface p-5 flex flex-col justify-between",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-teal-50 border border-teal-100 flex items-center justify-center",children:e.jsx(uv,{size:18,className:"text-teal-500"})}),e.jsx("span",{className:"text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Execution"})]}),e.jsxs("div",{className:"mt-4",children:[e.jsx("p",{className:"text-3xl font-extrabold text-content tabular-nums tracking-tight",children:C}),e.jsx("p",{className:"text-xs text-content-tertiary mt-0.5",children:"tests executed"})]}),e.jsxs("div",{className:"mt-3 pt-3 border-t border-border-muted grid grid-cols-3 gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(He,{size:10,className:"text-emerald-500"}),e.jsx("span",{className:"text-[11px] font-semibold text-emerald-600 tabular-nums",children:k})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(St,{size:10,className:"text-red-500"}),e.jsx("span",{className:"text-[11px] font-semibold text-red-500 tabular-nums",children:E})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Ll,{size:10,className:"text-content-tertiary"}),e.jsx("span",{className:"text-[11px] font-semibold text-content-tertiary tabular-nums",children:R})]})]})]}),e.jsxs("div",{className:"rounded-2xl border border-border bg-surface p-5 flex flex-col justify-between",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-amber-50 border border-amber-100 flex items-center justify-center",children:e.jsx(ct,{size:18,className:"text-amber-500"})}),e.jsx("span",{className:"text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Insights"})]}),e.jsxs("div",{className:"mt-4 space-y-2.5",children:[e.jsx("div",{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[11px] text-content-tertiary",children:"Avg Duration"}),e.jsx("span",{className:"text-sm font-bold text-content tabular-nums",children:D>0?`${D}s`:"—"})]})}),e.jsx("div",{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[11px] text-content-tertiary",children:"Self-Healed"}),e.jsx("span",{className:"text-sm font-bold text-emerald-600 tabular-nums",children:d?.accepted??0})]})}),e.jsx("div",{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[11px] text-content-tertiary",children:"Pending Review"}),e.jsx("span",{className:O("text-sm font-bold tabular-nums",(d?.pending??0)>0?"text-amber-500":"text-content-tertiary"),children:d?.pending??0})]})})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"lg:col-span-2 rounded-2xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-accent-muted flex items-center justify-center",children:e.jsx(ej,{size:14,className:"text-accent"})}),e.jsx("h2",{className:"text-sm font-semibold text-content",children:"Recent Runs"})]}),r.length>0&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Pp,{data:M,maxHeight:24}),e.jsxs("button",{onClick:()=>s("/reports"),className:"text-xs text-accent font-medium hover:underline flex items-center gap-0.5",children:["View all ",e.jsx(gr,{size:11})]})]})]}),r.length===0?e.jsxs("div",{className:"px-5 py-12 text-center",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl bg-surface-inset flex items-center justify-center mx-auto mb-3",children:e.jsx(Ms,{size:20,className:"text-content-tertiary"})}),e.jsx("p",{className:"text-sm font-medium text-content-secondary",children:"No runs yet"}),e.jsx("p",{className:"text-xs text-content-tertiary mt-1 mb-4",children:"Execute your first test run to see results here"}),e.jsxs(ve,{size:"sm",onClick:()=>s("/run"),children:[e.jsx(Xt,{size:12})," Start a Run"]})]}):e.jsxs("div",{className:"divide-y divide-border-muted",children:[e.jsxs("div",{className:"grid grid-cols-[1fr_100px_140px_80px_60px] px-5 py-2 text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:[e.jsx("span",{children:"Run ID"}),e.jsx("span",{children:"Status"}),e.jsx("span",{children:"Results"}),e.jsx("span",{children:"Duration"}),e.jsx("span",{className:"text-right",children:"Time"})]}),r.slice(0,6).map(w=>{const N=w.passed+w.failed+w.skipped,K=N>0?Math.round(w.passed/N*100):0;return e.jsxs("div",{onClick:()=>s("/reports"),className:"grid grid-cols-[1fr_100px_140px_80px_60px] items-center px-5 py-3 hover:bg-surface-inset cursor-pointer transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(qN,{status:w.status}),e.jsx("span",{className:"text-xs font-mono text-content-secondary truncate",children:w.runId.slice(0,10)})]}),e.jsx("div",{children:e.jsx("span",{className:O("text-[10px] font-semibold px-2 py-0.5 rounded-md uppercase tracking-wide",w.status==="passed"?"bg-emerald-50 text-emerald-700":w.status==="failed"?"bg-red-50 text-red-700":"bg-amber-50 text-amber-700"),children:w.status})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1 h-1.5 bg-surface-inset rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-emerald-400 rounded-full transition-all duration-500",style:{width:`${K}%`}})}),e.jsxs("span",{className:"text-[11px] text-content-secondary tabular-nums w-12 text-right",children:[w.passed,"/",N]})]}),e.jsx("span",{className:"text-[11px] text-content-tertiary tabular-nums",children:w.duration?`${(w.duration/1e3).toFixed(1)}s`:"—"}),e.jsx("span",{className:"text-[10px] text-content-tertiary text-right",children:Cl(new Date(w.startedAt),{addSuffix:!1})})]},w.runId)})]})]}),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"rounded-2xl border border-border bg-surface overflow-hidden flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-indigo-50 border border-indigo-100 flex items-center justify-center",children:e.jsx(Ti,{size:14,className:"text-indigo-500"})}),e.jsx("h2",{className:"text-sm font-semibold text-content",children:"Test Suites"})]}),e.jsxs("span",{className:"text-[10px] font-semibold text-content-tertiary bg-surface-inset px-2 py-0.5 rounded-md",children:[y," cases"]})]}),o.length===0?e.jsxs("div",{className:"px-5 py-8 text-center",children:[e.jsx("p",{className:"text-sm text-content-tertiary mb-3",children:"No suites yet"}),e.jsx(ve,{size:"sm",onClick:()=>s("/tests"),children:"Create Suite"})]}):e.jsx("ul",{className:"divide-y divide-border-muted max-h-[200px] overflow-y-auto",children:o.map(w=>e.jsxs("li",{onClick:()=>s("/tests"),className:"flex items-center justify-between px-5 py-2.5 hover:bg-surface-inset cursor-pointer transition-colors group",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-sm text-content font-medium truncate",children:w.name}),e.jsx("span",{className:O("text-[9px] px-1.5 py-0.5 rounded font-bold uppercase flex-shrink-0",(w.type??"ui")==="api"?"bg-purple-50 text-purple-600":"bg-blue-50 text-blue-600"),children:(w.type??"ui").toUpperCase()})]}),e.jsxs("p",{className:"text-[11px] text-content-tertiary mt-0.5",children:[w.caseCount??0," cases"]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(Pp,{data:HN(r,w.id),maxHeight:24}),e.jsx(gr,{size:13,className:"text-content-tertiary opacity-0 group-hover:opacity-100 transition-opacity"})]})]},w.id))})]}),e.jsx("div",{className:"grid grid-cols-2 gap-2.5",children:[{label:"Smart Tests",icon:Bt,to:"/story",gradient:"from-violet-500 to-indigo-600"},{label:"Self-Healing",icon:vl,to:"/healing",gradient:"from-rose-500 to-pink-600"},{label:"Variables",icon:Xu,to:"/variables",gradient:"from-teal-500 to-cyan-600"},{label:"Reports",icon:Ms,to:"/reports",gradient:"from-amber-500 to-orange-600"}].map(({label:w,icon:N,to:K,gradient:_})=>e.jsxs("button",{type:"button",onClick:()=>s(K),className:"group relative overflow-hidden rounded-xl border border-border bg-surface px-3.5 py-3 hover:border-border-strong hover:shadow-card transition-all duration-200 flex items-center gap-3",children:[e.jsx("div",{className:O("w-8 h-8 rounded-lg bg-gradient-to-br flex items-center justify-center flex-shrink-0",_),children:e.jsx(N,{size:14,className:"text-white"})}),e.jsx("p",{className:"text-xs font-semibold text-content group-hover:text-accent transition-colors",children:w})]},K))})]})]}),f&&e.jsx("div",{className:"rounded-2xl border border-border bg-surface px-6 py-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:O("w-10 h-10 rounded-xl flex items-center justify-center",f.status==="passed"?"bg-emerald-50 border border-emerald-100":f.status==="failed"?"bg-red-50 border border-red-100":"bg-amber-50 border border-amber-100"),children:f.status==="passed"?e.jsx(He,{size:18,className:"text-emerald-500"}):f.status==="failed"?e.jsx(gs,{size:18,className:"text-red-500"}):e.jsx(gp,{size:18,className:"text-amber-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold text-content-secondary uppercase tracking-wider",children:"Last Run"}),e.jsxs("p",{className:"text-sm font-bold text-content mt-0.5",children:[f.passed," passed, ",f.failed," failed",f.skipped>0&&`, ${f.skipped} skipped`]})]})]}),e.jsxs("div",{className:"flex items-center gap-6 text-xs text-content-tertiary",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Er,{size:12}),e.jsx("span",{children:Cl(new Date(f.startedAt),{addSuffix:!0})})]}),f.duration&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(gp,{size:12}),e.jsxs("span",{children:[(f.duration/1e3).toFixed(1),"s"]})]}),e.jsx("div",{className:"flex items-center gap-1.5 font-mono",children:e.jsxs("span",{children:["#",f.runId.slice(0,8)]})}),e.jsxs(ve,{size:"sm",variant:"ghost",onClick:()=>s("/reports"),children:["Details ",e.jsx(gr,{size:11})]})]})]})})]})]})}function Ts({open:s,title:r="Confirm Delete",message:a,confirmLabel:o="Delete",onConfirm:c,onCancel:d}){return p.useEffect(()=>{if(!s)return;const x=h=>{h.key==="Escape"&&d(),h.key==="Enter"&&(h.preventDefault(),c())};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[s,d]),s?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center animate-fade-in",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:d}),e.jsxs("div",{className:"relative bg-surface rounded-2xl shadow-modal w-full max-w-sm mx-4 p-6 animate-scale-in border border-border",children:[e.jsxs("div",{className:"flex items-start gap-3.5",children:[e.jsx("div",{className:"flex-shrink-0 w-10 h-10 rounded-xl bg-red-50 border border-red-200/50 flex items-center justify-center",children:e.jsx(gs,{size:18,className:"text-red-500"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-sm font-semibold text-content",children:r}),e.jsx("p",{className:"mt-1 text-sm text-content-secondary leading-relaxed",children:a})]})]}),e.jsxs("div",{className:"mt-6 flex items-center justify-end gap-2.5",children:[e.jsx(ve,{variant:"secondary",size:"sm",onClick:d,children:"Cancel"}),e.jsx(ve,{variant:"danger",size:"sm",onClick:c,children:o})]})]})]}):null}function zs(){const[s,r]=p.useState({open:!1,message:"",onConfirm:()=>{}}),a=p.useCallback((d,x)=>{r({open:!0,message:d,onConfirm:x})},[]),o=p.useCallback(()=>{r(d=>({...d,open:!1}))},[]),c=p.useCallback(()=>{s.onConfirm(),r(d=>({...d,open:!1}))},[s.onConfirm]);return{modalProps:{open:s.open,message:s.message,onConfirm:c,onCancel:o},confirmDelete:a}}const WN=[{id:"all",label:"All"},{id:"auth",label:"Auth"},{id:"crud",label:"CRUD"},{id:"navigation",label:"Navigation"},{id:"form",label:"Form"},{id:"api",label:"API"}],VN={auth:"bg-violet-50 text-violet-600",crud:"bg-blue-50 text-blue-600",navigation:"bg-teal-50 text-teal-600",form:"bg-orange-50 text-orange-600",api:"bg-purple-50 text-purple-600"};function GN({open:s,onClose:r,suiteId:a,onCreated:o}){const[c,d]=p.useState("all"),[x,h]=p.useState(null),{data:f=[],isLoading:y}=Oe({queryKey:["templates"],queryFn:()=>mj.list(),enabled:s}),g=oe({mutationFn:S=>qn.create(a,{name:S.name,description:S.description,steps:S.steps.map((k,E)=>({...k,id:crypto.randomUUID(),order:E+1}))}),onSuccess:()=>{H.success("Test case created from template"),o(),r()},onError:S=>{H.error(S.message),h(null)}}),j=S=>{h(S.id),g.mutate(S)},P=c==="all"?f:f.filter(S=>S.category===c);return s?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:r,children:e.jsxs("div",{className:"bg-surface rounded-2xl border border-border shadow-modal w-full max-w-2xl mx-4 overflow-hidden flex flex-col max-h-[85vh]",onClick:S=>S.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border flex-shrink-0",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-bold text-content",children:"Test Case Templates"}),e.jsx("p",{className:"text-[11px] text-content-tertiary mt-0.5",children:"Start from a pre-built template"})]}),e.jsx("button",{type:"button",onClick:r,className:"p-1.5 rounded-lg text-content-tertiary hover:bg-surface-inset hover:text-content transition-colors",children:e.jsx(Fe,{size:14})})]}),e.jsx("div",{className:"flex gap-1 px-5 py-2.5 border-b border-border flex-shrink-0 overflow-x-auto",children:WN.map(S=>e.jsx("button",{type:"button",onClick:()=>d(S.id),className:O("px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors flex-shrink-0",c===S.id?"bg-accent text-white":"text-content-secondary hover:bg-surface-inset"),children:S.label},S.id))}),e.jsx("div",{className:"flex-1 overflow-y-auto p-5 min-h-0",children:y?e.jsx("div",{className:"grid grid-cols-2 gap-3",children:[1,2,3,4].map(S=>e.jsx("div",{className:"h-28 rounded-xl skeleton-shimmer"},S))}):P.length===0?e.jsx("div",{className:"py-12 text-center",children:e.jsx("p",{className:"text-sm text-content-tertiary",children:"No templates in this category"})}):e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:P.map(S=>e.jsxs("div",{className:"rounded-xl border border-border bg-surface p-4 flex flex-col gap-3 hover:border-border-strong hover:shadow-card transition-all",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-surface-inset flex items-center justify-center flex-shrink-0",children:e.jsx(Ws,{size:13,className:"text-content-secondary"})}),e.jsx("div",{className:"min-w-0",children:e.jsx("p",{className:"text-sm font-bold text-content truncate",children:S.name})})]}),e.jsx("span",{className:O("text-[9px] px-1.5 py-0.5 rounded font-bold uppercase flex-shrink-0",VN[S.category]??"bg-surface-inset text-content-tertiary"),children:S.category})]}),e.jsx("p",{className:"text-xs text-content-secondary leading-relaxed",children:S.description}),e.jsxs("div",{className:"flex items-center justify-between mt-auto",children:[e.jsxs("span",{className:"text-[10px] text-content-tertiary",children:[S.steps.length," step",S.steps.length!==1?"s":""]}),e.jsx("button",{type:"button",onClick:()=>j(S),disabled:g.isPending,className:O("flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",x===S.id?"bg-emerald-50 text-emerald-600 border border-emerald-200":"bg-accent/10 text-accent hover:bg-accent/20",g.isPending&&"opacity-50 cursor-not-allowed"),children:x===S.id?e.jsxs(e.Fragment,{children:[e.jsx(He,{size:11})," Creating..."]}):"Use Template"})]})]},S.id))})})]})}):null}function mg(){return Oe({queryKey:["suites"],queryFn:()=>Rr.list()})}function QN(){const s=Pe();return oe({mutationFn:Rr.create,onSuccess:()=>{s.invalidateQueries({queryKey:["suites"]}),H.success("Suite created")},onError:r=>H.error(r.message)})}function hg(){const s=Pe();return oe({mutationFn:({id:r,data:a})=>Rr.update(r,a),onSuccess:()=>{s.invalidateQueries({queryKey:["suites"]}),H.success("Suite updated")},onError:r=>H.error(r.message)})}function JN(){const s=Pe();return oe({mutationFn:Rr.delete,onSuccess:()=>{s.invalidateQueries({queryKey:["suites"]}),H.success("Suite deleted")},onError:r=>H.error(r.message)})}function YN(s){return Oe({queryKey:["cases",s],queryFn:()=>qn.list(s),enabled:!!s})}function XN(s,r){return Oe({queryKey:["cases",s,r],queryFn:()=>qn.get(s,r),enabled:!!s&&!!r})}function Rp(s){const r=Pe();return oe({mutationFn:a=>qn.create(s,a),onSuccess:()=>{r.invalidateQueries({queryKey:["cases",s]}),H.success("Test case created")},onError:a=>H.error(a.message)})}function ZN(s){const r=Pe();return oe({mutationFn:({caseId:a,data:o})=>qn.update(s,a,o),onSuccess:(a,{caseId:o})=>{r.invalidateQueries({queryKey:["cases",s]}),r.invalidateQueries({queryKey:["cases",s,o]}),H.success("Test case updated")},onError:a=>H.error(a.message)})}function e2(s){const r=Pe();return oe({mutationFn:a=>qn.delete(s,a),onSuccess:()=>{r.invalidateQueries({queryKey:["cases",s]}),H.success("Test case deleted")},onError:a=>H.error(a.message)})}function t2(s,r){const a=Pe();return oe({mutationFn:o=>Mr.add(s,r,o),onSuccess:()=>{a.invalidateQueries({queryKey:["cases",s,r]})},onError:o=>H.error(o.message)})}function s2(s,r){const a=Pe();return oe({mutationFn:({stepId:o,instruction:c,timeout:d,stepType:x,retries:h,mockUrl:f,mockResponse:y,mockStatus:g,runAudit:j,soft:P,visualCheck:S})=>Mr.update(s,r,o,{instruction:c,timeout:d,stepType:x,retries:h,mockUrl:f,mockResponse:y,mockStatus:g,runAudit:j,soft:P,visualCheck:S}),onSuccess:()=>{a.invalidateQueries({queryKey:["cases",s,r]})},onError:o=>H.error(o.message)})}function n2(s,r){const a=Pe();return oe({mutationFn:o=>Mr.reorder(s,r,o),onSuccess:()=>{a.invalidateQueries({queryKey:["cases",s,r]})},onError:o=>H.error(o.message)})}function r2(s,r){const a=Pe();return oe({mutationFn:o=>Mr.delete(s,r,o),onSuccess:()=>{a.invalidateQueries({queryKey:["cases",s,r]})},onError:o=>H.error(o.message)})}function a2(s,r){const a=Pe();return oe({mutationFn:o=>Mr.generate(s,r,o),onSuccess:()=>{a.invalidateQueries({queryKey:["cases",s,r]}),H.success("Code generated")},onError:o=>H.error(o.message)})}function i2(s,r){const a=Pe();return oe({mutationFn:()=>Mr.generateAll(s,r),onSuccess:o=>{a.invalidateQueries({queryKey:["cases",s,r]}),H.success(`Generated code for ${o.generated} step(s)`)},onError:o=>H.error(o.message)})}const Ai=new Map,Pu=new Set;function pg(){for(const s of Pu)s()}function Vd(){return"all"}function Gd(s){return`suite:${s}`}function Qd(s,r){return`case:${s}:${r}`}function Jd(s,r){Ai.set(s,{op:r,startedAt:Date.now()}),pg()}function Yd(s){Ai.delete(s),pg()}function Xd(s){return Ai.get(s)?.op??null}function o2(){const s=new Map,r=new Map;let a=null;for(const[o,c]of Ai)o==="all"?a=c.op:o.startsWith("suite:")?s.set(o.slice(6),c.op):o.startsWith("case:")&&r.set(o.slice(5),c.op);return{allOp:a,busySuites:s,busyCases:r,activeCount:Ai.size}}function l2(s){return Pu.add(s),()=>{Pu.delete(s)}}const Ct={startAll:s=>Jd(Vd(),s),finishAll:()=>Yd(Vd()),startSuite:(s,r)=>Jd(Gd(s),r),finishSuite:s=>Yd(Gd(s)),startCase:(s,r,a)=>Jd(Qd(s,r),a),finishCase:(s,r)=>Yd(Qd(s,r)),isAllBusy:()=>Xd(Vd()),isSuiteBusy:s=>Xd(Gd(s)),isCaseBusy:(s,r)=>Xd(Qd(s,r)),getSnapshot:o2,subscribe:l2};function $i(s,r){if(s.failed>0){const a=s.results.filter(o=>o.action==="failed");H.error(`${r}: ${s.failed} failed — ${a[0]?.error??"Unknown error"}`)}else if(s.created>0||s.synced>0){const a=[];s.created>0&&a.push(`${s.created} created`),s.synced>0&&a.push(`${s.synced} synced`),s.skipped>0&&a.push(`${s.skipped} skipped`),H.success(`Xray: ${a.join(", ")}`)}else s.skipped>0&&H.success(`Xray: ${s.skipped} already up to date`)}function c2(){return Oe({queryKey:["xray","status"],queryFn:()=>zr.status(),retry:1,staleTime:1e4})}function fg(s){return Oe({queryKey:["xray","status",s],queryFn:()=>zr.suiteStatus(s),enabled:!!s,retry:1,staleTime:1e4})}function d2(){const s=Pe();return oe({mutationFn:()=>(Ct.startAll("create"),zr.createAll()),onSuccess:r=>{Ct.finishAll(),s.invalidateQueries({queryKey:["xray"]}),$i(r,"Create in Xray")},onError:r=>{Ct.finishAll(),H.error(`Xray create failed: ${r.message}`)}})}function gg(){const s=Pe();return oe({mutationFn:r=>(Ct.startSuite(r,"create"),zr.createSuite(r)),onSuccess:(r,a)=>{Ct.finishSuite(a),s.invalidateQueries({queryKey:["xray"]}),$i(r,"Create Suite")},onError:(r,a)=>{Ct.finishSuite(a),H.error(`Xray create failed: ${r.message}`)}})}function yg(){const s=Pe();return oe({mutationFn:({suiteId:r,caseId:a})=>(Ct.startCase(r,a,"create"),zr.createCase(r,a)),onSuccess:(r,{suiteId:a,caseId:o})=>{Ct.finishCase(a,o),s.invalidateQueries({queryKey:["xray"]}),$i(r,"Create Case")},onError:(r,{suiteId:a,caseId:o})=>{Ct.finishCase(a,o),H.error(`Xray create failed: ${r.message}`)}})}function u2(){const s=Pe();return oe({mutationFn:r=>(Ct.startSuite(r,"sync"),zr.syncSuite(r)),onSuccess:(r,a)=>{Ct.finishSuite(a),s.invalidateQueries({queryKey:["xray"]}),$i(r,"Sync Suite")},onError:(r,a)=>{Ct.finishSuite(a),H.error(`Xray sync failed: ${r.message}`)}})}function bg(){const s=Pe();return oe({mutationFn:({suiteId:r,caseId:a})=>(Ct.startCase(r,a,"sync"),zr.syncCase(r,a)),onSuccess:(r,{suiteId:a,caseId:o})=>{Ct.finishCase(a,o),s.invalidateQueries({queryKey:["xray"]}),$i(r,"Sync Case")},onError:(r,{suiteId:a,caseId:o})=>{Ct.finishCase(a,o),H.error(`Xray sync failed: ${r.message}`)}})}function sx({code:s,maxLines:r,className:a}){const[o,c]=p.useState(!1),d=async()=>{await navigator.clipboard.writeText(s),c(!0),setTimeout(()=>c(!1),1500)},x=!s.trim();return e.jsxs("div",{className:O("relative rounded-xl bg-[#0d1117] text-slate-300 ring-1 ring-white/5 overflow-hidden",a),children:[!x&&e.jsx("button",{type:"button",onClick:()=>{d()},className:O("absolute top-2.5 right-2.5 p-1.5 rounded-md transition-all duration-150",o?"bg-emerald-500/20 text-emerald-400":"text-slate-500 hover:text-slate-300 hover:bg-white/10"),title:"Copy code",children:o?e.jsx(Qe,{size:13}):e.jsx(Vu,{size:13})}),e.jsx("pre",{className:O("p-4 text-xs font-mono leading-relaxed overflow-x-auto",r&&`line-clamp-${r}`),style:r?{maxHeight:`${r*1.5}rem`,overflow:"auto"}:void 0,children:e.jsx("code",{children:x?"// No code generated yet":s})})]})}const x2={"not-created":{bg:"bg-surface-inset",text:"text-content-tertiary",dot:"bg-content-tertiary",border:"border-border",label:"Not Created"},created:{bg:"bg-emerald-50",text:"text-emerald-700",dot:"bg-emerald-500",border:"border-emerald-200/60",label:"Created"},synced:{bg:"bg-emerald-50/60",text:"text-emerald-600",dot:"bg-emerald-400",border:"border-emerald-200/60",label:"Synced"},"update-pending":{bg:"bg-amber-50",text:"text-amber-700",dot:"bg-amber-500",border:"border-amber-200/60",label:"Update Pending"}};function nx({status:s,xrayKey:r}){const a=x2[s];return e.jsxs("span",{className:O("inline-flex items-center gap-1.5 px-2 py-0.5 rounded-md text-[10px] font-semibold whitespace-nowrap border tracking-wide",a.bg,a.text,a.border),children:[e.jsx("span",{className:O("w-1.5 h-1.5 rounded-full flex-shrink-0",a.dot)}),a.label,r&&e.jsxs("span",{className:"text-[9px] opacity-60 truncate max-w-[80px]",title:r,children:["(",r,")"]})]})}const m2={"not-created":{icon:Ul,label:"Push to Xray",title:"Create in Xray",btnClass:"bg-gradient-to-b from-emerald-500 to-emerald-600 hover:brightness-110 text-white shadow-sm",iconClass:"text-emerald-600",iconHover:"hover:bg-emerald-50"},"update-pending":{icon:Yu,label:"Sync Xray",title:"Sync changes to Xray",btnClass:"bg-gradient-to-b from-amber-500 to-amber-600 hover:brightness-110 text-white shadow-sm",iconClass:"text-amber-500",iconHover:"hover:bg-amber-50"},created:{icon:He,label:"Synced with Xray",title:"Up to date -- click to re-sync",btnClass:"bg-gradient-to-b from-emerald-500 to-emerald-600 hover:brightness-110 text-white shadow-sm",iconClass:"text-emerald-500",iconHover:"hover:bg-emerald-50"},synced:{icon:He,label:"Synced with Xray",title:"Up to date -- click to re-sync",btnClass:"bg-gradient-to-b from-emerald-500 to-emerald-600 hover:brightness-110 text-white shadow-sm",iconClass:"text-emerald-500",iconHover:"hover:bg-emerald-50"}};function Oi({status:s,onClick:r,busy:a=!1,variant:o="full",label:c}){const d=m2[s],x=d.icon,h=c??d.label;return o==="icon"?e.jsx("button",{type:"button",onClick:f=>{f.stopPropagation(),r()},title:a?"Processing...":d.title,className:O("p-1.5 rounded-lg transition-all duration-150",a?"cursor-wait opacity-50":O(d.iconClass,d.iconHover)),children:a?e.jsx(Me,{size:14,className:"animate-spin text-accent"}):e.jsx(x,{size:14})}):e.jsxs("button",{type:"button",onClick:()=>r(),title:a?"Processing...":d.title,className:O("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-all duration-150",a?"bg-surface-inset text-content-tertiary cursor-wait":d.btnClass),children:[a?e.jsx(Me,{size:13,className:"animate-spin"}):e.jsx(x,{size:13}),a?"Processing...":h]})}function h2(s){return Oe({queryKey:["hooks",s],queryFn:()=>Tr.get(s),enabled:!!s})}function p2(s){const r=Pe();return oe({mutationFn:({hookType:a,instruction:o,order:c})=>Tr.addStep(s,a,{instruction:o,order:c}),onSuccess:()=>{r.invalidateQueries({queryKey:["hooks",s]})},onError:a=>H.error(a.message)})}function f2(s){const r=Pe();return oe({mutationFn:({hookType:a,stepId:o,instruction:c,timeout:d})=>Tr.updateStep(s,a,o,{instruction:c,timeout:d}),onSuccess:()=>{r.invalidateQueries({queryKey:["hooks",s]})},onError:a=>H.error(a.message)})}function g2(s){const r=Pe();return oe({mutationFn:({hookType:a,stepId:o})=>Tr.deleteStep(s,a,o),onSuccess:()=>{r.invalidateQueries({queryKey:["hooks",s]})},onError:a=>H.error(a.message)})}function y2(s){const r=Pe();return oe({mutationFn:({hookType:a,stepIds:o})=>Tr.reorderSteps(s,a,o),onSuccess:()=>{r.invalidateQueries({queryKey:["hooks",s]})},onError:a=>H.error(a.message)})}function b2(s){const r=Pe();return oe({mutationFn:({hookType:a,stepId:o})=>Tr.generateStep(s,a,o),onSuccess:()=>{r.invalidateQueries({queryKey:["hooks",s]}),H.success("Hook step code generated")},onError:a=>H.error(a.message)})}function v2(s){const r=Pe();return oe({mutationFn:a=>Tr.generateAll(s,a),onSuccess:a=>{r.invalidateQueries({queryKey:["hooks",s]}),H.success(`Generated code for ${a.generated} hook step(s)`)},onError:a=>H.error(a.message)})}const j2=[{type:"before_all",label:"Before All",desc:"Runs once before all test cases in the suite",icon:e.jsx(Sv,{size:16}),color:"text-emerald-600"},{type:"before_each",label:"Before Each",desc:"Runs before every test case",icon:e.jsx(Ll,{size:16}),color:"text-blue-600"},{type:"after_each",label:"After Each",desc:"Runs after every test case",icon:e.jsx(Gv,{size:16}),color:"text-amber-600"},{type:"after_all",label:"After All",desc:"Runs once after all test cases in the suite",icon:e.jsx(Cv,{size:16}),color:"text-red-500"}];function N2({suiteId:s,open:r,onClose:a}){const{data:o,isLoading:c}=h2(s);return r?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:a}),e.jsxs("div",{className:"relative w-full max-w-3xl max-h-[85vh] bg-surface rounded-xl shadow-2xl flex flex-col overflow-hidden mx-4",children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border bg-gradient-to-r from-slate-50 to-white",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-content",children:"Suite Hooks"}),e.jsx("p",{className:"text-xs text-content-tertiary mt-0.5",children:"Lifecycle hooks run setup/teardown around your test cases (Playwright hooks)"})]}),e.jsx("button",{onClick:a,className:"p-1.5 rounded-lg hover:bg-surface-inset transition-colors text-content-tertiary hover:text-content-secondary",children:e.jsx(Fe,{size:18})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:c?e.jsx("div",{className:"flex items-center justify-center py-16",children:e.jsx(Me,{size:24,className:"animate-spin text-accent"})}):j2.map(d=>e.jsx(w2,{suiteId:s,hookType:d.type,label:d.label,description:d.desc,icon:d.icon,color:d.color,steps:o?.[d.type]??[]},d.type))})]})]}):null}function w2({suiteId:s,hookType:r,label:a,description:o,icon:c,color:d,steps:x}){const[h,f]=p.useState(x.length>0),[y,g]=p.useState(""),[j,P]=p.useState(""),[S,k]=p.useState(null),[E,R]=p.useState(""),[v,C]=p.useState(new Set),[D,M]=p.useState(null),[w,N]=p.useState(null),K=p2(s),_=g2(s),{modalProps:ee,confirmDelete:$}=zs(),G=y2(s),le=f2(s),je=b2(s),ke=v2(s),Ce=()=>{y.trim()&&(K.mutate({hookType:r,instruction:y.trim()}),g(""))},Re=F=>{P(F),je.mutate({hookType:r,stepId:F},{onSettled:()=>P("")})},be=()=>{ke.mutate(r)},B=F=>{if(!D||D===F){M(null),N(null);return}const ce=x.map(ye=>ye.id),Y=ce.indexOf(D),ue=ce.indexOf(F);Y<0||ue<0||(ce.splice(Y,1),ce.splice(ue,0,D),G.mutate({hookType:r,stepIds:ce}),M(null),N(null))},X=F=>{k(F.id),R(F.instruction)},L=F=>{E.trim()&&E!==x.find(ce=>ce.id===F)?.instruction&&le.mutate({hookType:r,stepId:F,instruction:E.trim()}),k(null)},z=x.filter(F=>!F.generatedCode?.trim()).length;return e.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[e.jsxs("button",{type:"button",onClick:()=>f(!h),className:"w-full flex items-center gap-3 px-4 py-3 bg-surface-inset hover:bg-surface-inset transition-colors text-left",children:[h?e.jsx(kt,{size:14,className:"text-content-tertiary"}):e.jsx(Zt,{size:14,className:"text-content-tertiary"}),e.jsx("span",{className:O("flex-shrink-0",d),children:c}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-sm font-semibold text-content-secondary",children:a}),e.jsx("span",{className:"text-[10px] text-content-tertiary ml-2",children:o})]}),e.jsxs("span",{className:O("text-[10px] font-semibold px-2 py-0.5 rounded-full",x.length>0?"bg-accent/10 text-accent":"bg-slate-200 text-content-tertiary"),children:[x.length," step",x.length!==1?"s":""]})]}),h&&e.jsxs("div",{className:"border-t border-border bg-surface",children:[x.length===0?e.jsx("div",{className:"px-4 py-6 text-center",children:e.jsx("p",{className:"text-xs text-content-tertiary",children:"No steps yet — add one below"})}):e.jsx("div",{className:"divide-y divide-slate-100",children:x.map((F,ce)=>e.jsxs("div",{draggable:!0,onDragStart:()=>M(F.id),onDragOver:Y=>{Y.preventDefault(),N(F.id)},onDragLeave:()=>N(null),onDrop:()=>B(F.id),onDragEnd:()=>{M(null),N(null)},className:O("flex items-start gap-2 px-4 py-2.5 group transition-colors",w===F.id&&"bg-accent/5 border-l-2 border-accent",D===F.id&&"opacity-40"),children:[e.jsx("div",{className:"pt-0.5 cursor-grab text-content-tertiary opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx(Il,{size:12})}),e.jsx("span",{className:"text-[10px] font-bold text-content-tertiary pt-0.5 w-4 flex-shrink-0",children:ce+1}),e.jsxs("div",{className:"flex-1 min-w-0",children:[S===F.id?e.jsx("input",{autoFocus:!0,className:"w-full text-xs border border-accent rounded px-2 py-1 focus:outline-none focus:ring-1 focus:ring-accent",value:E,onChange:Y=>R(Y.target.value),onBlur:()=>L(F.id),onKeyDown:Y=>{Y.key==="Enter"&&L(F.id),Y.key==="Escape"&&k(null)}}):e.jsxs("p",{className:"text-xs text-content-secondary cursor-pointer hover:text-accent transition-colors flex items-center gap-1.5",onClick:()=>X(F),title:"Click to edit",children:[F.instruction,F.generatedCode&&!v.has(F.id)&&e.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-green-400 flex-shrink-0",title:"Code generated"})]}),F.generatedCode&&v.has(F.id)&&e.jsx("div",{className:"mt-1",children:e.jsx(sx,{code:F.generatedCode,maxLines:6})})]}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[F.generatedCode&&e.jsx("button",{title:v.has(F.id)?"Hide code":"Show code",onClick:()=>C(Y=>{const ue=new Set(Y);return ue.has(F.id)?ue.delete(F.id):ue.add(F.id),ue}),className:O("p-1 rounded transition-colors",v.has(F.id)?"text-content-secondary bg-slate-100":"text-content-tertiary hover:bg-surface-inset"),children:e.jsx(Wu,{size:12})}),e.jsx("button",{title:"Generate code",onClick:()=>Re(F.id),disabled:j===F.id,className:"p-1 rounded hover:bg-purple-50 text-purple-500 transition-colors",children:j===F.id?e.jsx(Me,{size:12,className:"animate-spin"}):e.jsx(Sr,{size:12})}),e.jsx("button",{title:"Delete step",onClick:()=>$("Delete this hook step? This cannot be undone.",()=>_.mutate({hookType:r,stepId:F.id})),className:"p-1 rounded hover:bg-red-50 text-red-400 transition-colors",children:e.jsx(es,{size:12})})]})]},F.id))}),e.jsxs("div",{className:"px-4 py-3 border-t border-slate-100 bg-surface-inset/50 flex items-center gap-2",children:[e.jsx("input",{className:"flex-1 text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-1 focus:ring-accent placeholder:text-content-tertiary",value:y,onChange:F=>g(F.target.value),onKeyDown:F=>{F.key==="Enter"&&Ce()},placeholder:"Add a step (e.g. Navigate to login page)"}),e.jsxs("button",{type:"button",onClick:Ce,disabled:!y.trim()||K.isPending,className:O("inline-flex items-center gap-1 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-colors",y.trim()?"bg-accent text-white hover:bg-accent/90":"bg-slate-200 text-content-tertiary cursor-not-allowed"),children:[K.isPending?e.jsx(Me,{size:11,className:"animate-spin"}):e.jsx(Vs,{size:11}),"Add"]}),x.length>0&&z>0&&e.jsxs("button",{type:"button",onClick:be,disabled:ke.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:[ke.isPending?e.jsx(Me,{size:11,className:"animate-spin"}):e.jsx(Sr,{size:11}),"Generate All (",z,")"]})]})]}),e.jsx(Ts,{...ee})]})}const Mp={person:{icon:Zu,label:"Person"},internet:{icon:Gn,label:"Internet"},phone:{icon:Bv,label:"Phone"},location:{icon:Iv,label:"Location"},company:{icon:yv,label:"Company"},finance:{icon:mv,label:"Finance"},date:{icon:bv,label:"Date"},lorem:{icon:tj,label:"Lorem"},string:{icon:hv,label:"String"},number:{icon:Gu,label:"Number"},datatype:{icon:Xv,label:"Datatype"},image:{icon:Qu,label:"Image"},color:{icon:$v,label:"Color"},commerce:{icon:Vv,label:"Commerce"},vehicle:{icon:vv,label:"Vehicle"},system:{icon:Tv,label:"System"}},Zd=[{name:"FIRST_NAME",example:"Alice"},{name:"LAST_NAME",example:"Smith"},{name:"AGE",example:"34"},{name:"EMAIL",example:"alice.smith123@example.com"},{name:"PHONE",example:"415-782-3901"},{name:"PASSWORD",example:"Xk9#mP2$qL"}];function Ni(s,r){return s==="classic"?`{{FAKE_${r}}}`:`{{FAKE_${s}_${r}}}`.toUpperCase()}async function k2(){const s=await fetch("/api/faker/generators");if(!s.ok)throw new Error("Failed to load generators");return s.json()}function S2({onInsert:s}){const[r,a]=p.useState(!1),[o,c]=p.useState("person"),[d,x]=p.useState(""),[h,f]=p.useState("6"),[y,g]=p.useState([]),{data:j=[],isLoading:P}=Oe({queryKey:["faker-generators"],queryFn:k2,enabled:r,staleTime:1/0}),S=p.useMemo(()=>{if(!d.trim())return null;const w=d.toLowerCase(),N=[];for(const K of j)for(const _ of K.methods){const ee=`${K.category}_${_.name}`.toLowerCase();(_.name.toLowerCase().includes(w)||K.category.toLowerCase().includes(w)||ee.includes(w)||_.example.toLowerCase().includes(w))&&N.push({category:K.category,method:_})}for(const K of Zd)(K.name.toLowerCase().includes(w)||K.example.toLowerCase().includes(w))&&N.push({category:"classic",method:K});return N},[d,j]),k=p.useMemo(()=>o==="classic"?null:j.find(w=>w.category===o)?.methods??[],[o,j]),E=p.useCallback((w,N)=>{const K=Ni(w,N);g(_=>_.includes(K)?_.filter(ee=>ee!==K):[..._,K])},[]),R=p.useCallback(()=>{y.length>0&&s(y.join(", ")),g([]),a(!1),x("")},[y,s]),v=p.useCallback(()=>{y.length>0&&s(y.join(", ")),g([]),a(!1),x("")},[y,s]),C=p.useCallback(w=>{g(N=>N.filter(K=>K!==w))},[]),D=()=>{const N=`{{FAKE_NUMBER_${Math.max(1,Math.min(20,parseInt(h,10)||6))}}}`;g(K=>K.includes(N)?K:[...K,N])},M=p.useMemo(()=>[...j.map(N=>N.category),"classic"],[j]);return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:()=>a(!0),title:"Insert dynamic data token",className:O("inline-flex items-center justify-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs font-medium border transition-all duration-150 focus:outline-none","bg-gradient-to-b from-violet-500 to-violet-600 text-white border-violet-700 shadow-sm hover:brightness-110 hover:shadow-md"),children:[e.jsx(Bt,{size:12}),e.jsx("span",{className:"hidden sm:inline",children:"Fake Data"}),e.jsx(kt,{size:10})]}),r&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm animate-fade-in",onClick:w=>{w.target===w.currentTarget&&v()},children:e.jsxs("div",{className:"bg-surface rounded-2xl shadow-modal w-full max-w-2xl mx-4 overflow-hidden border border-border animate-scale-in flex flex-col",style:{maxHeight:"min(640px, 85vh)"},children:[e.jsxs("div",{className:"flex items-center gap-3 px-5 py-3.5 border-b border-border bg-gradient-to-r from-violet-50 to-indigo-50 dark:from-violet-500/10 dark:to-indigo-500/10 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[e.jsx(Bt,{size:16,className:"text-violet-500 dark:text-violet-400"}),e.jsx("h2",{className:"text-sm font-bold text-violet-800 dark:text-violet-200",children:"Faker Data"}),e.jsxs("span",{className:"text-[10px] text-violet-500 dark:text-violet-300 bg-violet-100 dark:bg-violet-500/20 px-2 py-0.5 rounded-full font-medium",children:[j.reduce((w,N)=>w+N.methods.length,0)+Zd.length,"+ generators"]})]}),e.jsx("button",{type:"button",onClick:v,className:"p-1 rounded-lg hover:bg-violet-100 dark:hover:bg-violet-500/20 text-violet-400 hover:text-violet-600 dark:hover:text-violet-300 transition-colors",children:e.jsx(Fe,{size:16})})]}),e.jsx("div",{className:"px-5 py-3 border-b border-border flex-shrink-0",children:e.jsxs("div",{className:"flex items-center gap-2 bg-surface-inset rounded-xl px-3 py-2 border border-border focus-within:border-violet-300 focus-within:ring-2 focus-within:ring-violet-100 transition-all",children:[e.jsx(Bn,{size:14,className:"text-content-tertiary flex-shrink-0"}),e.jsx("input",{type:"text",value:d,onChange:w=>x(w.target.value),placeholder:"Search generators... (e.g. email, address, uuid)",className:"flex-1 bg-transparent outline-none text-sm text-content placeholder:text-content-tertiary",autoFocus:!0}),d&&e.jsx("button",{type:"button",onClick:()=>x(""),className:"text-content-tertiary hover:text-content transition-colors",children:e.jsx(Fe,{size:12})})]})}),e.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[e.jsx("div",{className:"w-40 flex-shrink-0 border-r border-border overflow-y-auto bg-surface-inset/40 py-2 px-2 space-y-0.5",children:P?e.jsx("div",{className:"space-y-2 px-1",children:Array.from({length:8}).map((w,N)=>e.jsx("div",{className:"h-7 rounded-lg bg-surface-inset animate-pulse"},N))}):M.map(w=>{const N=Mp[w]??{icon:Pr,label:w.charAt(0).toUpperCase()+w.slice(1)},K=w==="classic"?Bt:N.icon,_=w==="classic"?"Classic":N.label;return e.jsxs("button",{type:"button",onClick:()=>{c(w),x("")},className:O("w-full flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-[11px] font-medium transition-all text-left",o===w&&!d?"bg-violet-100 text-violet-700 dark:bg-violet-500/20 dark:text-violet-200 shadow-sm":"text-content-secondary hover:bg-surface-inset hover:text-content"),children:[e.jsx(K,{size:13,className:"flex-shrink-0"}),e.jsx("span",{className:"truncate",children:_})]},w)})}),e.jsx("div",{className:"flex-1 overflow-y-auto py-2 px-3",children:P?e.jsx("div",{className:"space-y-2",children:Array.from({length:6}).map((w,N)=>e.jsx("div",{className:"h-12 rounded-xl bg-surface-inset animate-pulse"},N))}):S?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest px-1 mb-2",children:[S.length," result",S.length!==1?"s":"",' for "',d,'"']}),S.length===0?e.jsx("p",{className:"text-sm text-content-tertiary text-center py-8",children:"No generators found. Try a different search term."}):e.jsx("div",{className:"space-y-1",children:S.map(({category:w,method:N})=>e.jsx(eu,{category:w,method:N,selected:y.includes(Ni(w,N.name)),onToggle:E},`${w}-${N.name}`))})]}):o==="classic"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest px-1 mb-2",children:"Classic Tokens (backward-compatible)"}),e.jsx("div",{className:"space-y-1",children:Zd.map(w=>e.jsx(eu,{category:"classic",method:w,selected:y.includes(Ni("classic",w.name)),onToggle:E},w.name))}),e.jsxs("div",{className:"mt-4 pt-3 border-t border-border",children:[e.jsxs("p",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest px-1 mb-2 flex items-center gap-1",children:[e.jsx(Gu,{size:10})," Random Number"]}),e.jsxs("div",{className:"flex items-center gap-2 px-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-1 bg-surface-inset rounded-lg px-3 py-2 border border-border",children:[e.jsx("span",{className:"text-[11px] text-content-tertiary",children:"Digits:"}),e.jsx("input",{type:"number",min:1,max:20,value:h,onChange:w=>f(w.target.value),onKeyDown:w=>w.key==="Enter"&&D(),className:"w-12 text-sm bg-transparent outline-none text-content font-mono tabular-nums"})]}),e.jsx("button",{type:"button",onClick:D,className:"flex-shrink-0 px-3 py-2 rounded-lg bg-violet-600 hover:bg-violet-700 text-white text-[11px] font-semibold transition-colors",children:"+ Add"})]}),e.jsx("p",{className:"text-[10px] text-content-tertiary px-1 mt-2 font-mono",children:`→ {{FAKE_NUMBER_${Math.max(1,parseInt(h,10)||6)}}}`})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest px-1 mb-2",children:[Mp[o]?.label??o," — ",k?.length??0," generators"]}),e.jsx("div",{className:"space-y-1",children:(k??[]).map(w=>e.jsx(eu,{category:o,method:w,selected:y.includes(Ni(o,w.name)),onToggle:E},w.name))})]})})]}),y.length>0&&e.jsxs("div",{className:"px-5 py-2.5 border-t border-border bg-violet-50/50 dark:bg-violet-500/10 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsxs("span",{className:"text-[10px] font-bold text-violet-600 dark:text-violet-300 uppercase tracking-wider",children:["Selected (",y.length,")"]}),e.jsx("button",{type:"button",onClick:()=>g([]),className:"text-[10px] text-violet-400 hover:text-violet-600 dark:hover:text-violet-300 transition-colors underline",children:"Clear all"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 max-h-16 overflow-y-auto",children:y.map(w=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-lg bg-violet-100 text-violet-700 border border-violet-200 dark:bg-violet-500/20 dark:text-violet-200 dark:border-violet-500/30 text-[10px] font-mono",children:[w,e.jsx("button",{type:"button",onClick:()=>C(w),className:"text-violet-400 hover:text-violet-700 dark:hover:text-violet-200 transition-colors",children:e.jsx(Fe,{size:10})})]},w))})]}),e.jsxs("div",{className:"px-5 py-2.5 bg-surface-inset/60 border-t border-border flex items-center justify-between flex-shrink-0",children:[e.jsxs("p",{className:"text-[10px] text-content-tertiary",children:["Click to select multiple tokens. They will be inserted ",e.jsx("strong",{children:"comma-separated"}),"."]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>{g([]),a(!1),x("")},className:"px-3 py-1.5 rounded-lg border border-border text-xs font-medium text-content-secondary hover:bg-surface-inset transition-colors",children:"Cancel"}),e.jsxs("button",{type:"button",onClick:R,disabled:y.length===0,className:O("px-4 py-1.5 rounded-lg text-xs font-semibold transition-all",y.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 ",y.length>0?`${y.length} token${y.length>1?"s":""}`:""]})]})]})]})})]})}function eu({category:s,method:r,selected:a,onToggle:o}){const c=Ni(s,r.name);return e.jsxs("button",{type:"button",onClick:()=>o(s,r.name),className:O("w-full flex items-center justify-between gap-3 px-3 py-2 rounded-xl transition-colors group text-left",a?"bg-violet-100 border border-violet-200 dark:bg-violet-500/20 dark:border-violet-500/30 shadow-sm":"hover:bg-violet-50 dark:hover:bg-violet-500/10 border border-transparent"),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx("div",{className:O("flex-shrink-0 w-4 h-4 rounded flex items-center justify-center border transition-all",a?"bg-violet-600 border-violet-600":"border-gray-300 dark:border-gray-600 group-hover:border-violet-400"),children:a&&e.jsx(Qe,{size:10,className:"text-white",strokeWidth:3})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[s!=="classic"&&e.jsx("span",{className:O("text-[9px] px-1.5 py-0.5 rounded font-medium uppercase flex-shrink-0",a?"text-violet-600 bg-violet-200 dark:text-violet-200 dark:bg-violet-500/30":"text-violet-400 bg-violet-50 group-hover:bg-violet-100 dark:bg-violet-500/15 dark:group-hover:bg-violet-500/25"),children:s}),e.jsx("p",{className:O("text-[12px] font-medium truncate",a?"text-violet-700 dark:text-violet-200":"text-content group-hover:text-violet-700 dark:group-hover:text-violet-300"),children:r.name})]}),e.jsx("p",{className:"text-[9px] text-content-tertiary font-mono truncate mt-0.5",children:c})]})]}),e.jsx("span",{className:"text-[10px] text-content-tertiary bg-surface-inset px-2 py-1 rounded-lg font-mono flex-shrink-0 max-w-[180px] truncate",children:r.example})]})}function C2(s){return s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`}function E2(s){return new Promise((r,a)=>{const o=new FileReader;o.onload=()=>{const c=String(o.result);r(c.slice(c.indexOf(",")+1))},o.onerror=()=>a(o.error),o.readAsDataURL(s)})}function P2({onInsert:s}){const[r,a]=p.useState(!1),o=p.useRef(null),c=Pe(),{data:d=[],isLoading:x}=Oe({queryKey:["files"],queryFn:Si.list,enabled:r}),h=oe({mutationFn:async g=>{const j=await E2(g);return Si.upload(g.name,j)},onSuccess:g=>{H.success(`Uploaded ${g.name}`),c.invalidateQueries({queryKey:["files"]})},onError:g=>H.error(g.message)}),f=oe({mutationFn:g=>Si.remove(g),onSuccess:()=>c.invalidateQueries({queryKey:["files"]}),onError:g=>H.error(g.message)}),y=g=>{s(g.token),H.success(`Inserted ${g.token}`),a(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:()=>a(!0),title:"Insert an uploaded file token",className:O("inline-flex items-center justify-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs font-medium border transition-all duration-150 focus:outline-none","bg-gradient-to-b from-sky-500 to-sky-600 text-white border-sky-700 shadow-sm hover:brightness-110 hover:shadow-md"),children:[e.jsx(fp,{size:12}),e.jsx("span",{className:"hidden sm:inline",children:"Files"}),e.jsx(kt,{size:10})]}),r&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm animate-fade-in",onClick:g=>{g.target===g.currentTarget&&a(!1)},children:e.jsxs("div",{className:"bg-surface rounded-2xl shadow-modal w-full max-w-lg mx-4 overflow-hidden border border-border animate-scale-in flex flex-col",style:{maxHeight:"min(560px, 85vh)"},children:[e.jsxs("div",{className:"flex items-center gap-3 px-5 py-3.5 border-b border-border bg-gradient-to-r from-sky-50 to-cyan-50 dark:from-sky-500/10 dark:to-cyan-500/10 flex-shrink-0",children:[e.jsx(fp,{size:16,className:"text-sky-500 dark:text-sky-400"}),e.jsx("h2",{className:"text-sm font-bold text-sky-800 dark:text-sky-200 flex-1",children:"Upload Files"}),e.jsx("button",{type:"button",onClick:()=>a(!1),className:"p-1 rounded-lg hover:bg-sky-100 dark:hover:bg-sky-500/20 text-sky-400 hover:text-sky-600 dark:hover:text-sky-300 transition-colors",children:e.jsx(Fe,{size:16})})]}),e.jsxs("div",{className:"px-5 py-3 border-b border-border flex-shrink-0",children:[e.jsx("input",{ref:o,type:"file",className:"hidden",onChange:g=>{const j=g.target.files?.[0];j&&h.mutate(j),g.target.value=""}}),e.jsxs("button",{type:"button",onClick:()=>o.current?.click(),disabled:h.isPending,className:"w-full flex items-center justify-center gap-2 px-3 py-2 rounded-xl text-xs font-semibold border border-dashed border-sky-300 text-sky-600 hover:bg-sky-50 dark:border-sky-500/40 dark:text-sky-300 dark:hover:bg-sky-500/10 transition-colors disabled:opacity-50",children:[e.jsx(Ul,{size:13}),h.isPending?"Uploading…":"Choose a file to upload"]}),e.jsxs("p",{className:"text-[10px] text-content-tertiary mt-1.5",children:["Saved to ",e.jsx("code",{className:"text-accent",children:"fixtures/uploads/"})," and inserted as a ",e.jsx("code",{className:"text-accent",children:"{{FILE:…}}"})," token."]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-3 min-h-0",children:x?e.jsx("p",{className:"text-sm text-content-tertiary text-center py-6",children:"Loading…"}):d.length===0?e.jsx("p",{className:"text-sm text-content-tertiary text-center py-6",children:"No files uploaded yet."}):e.jsx("div",{className:"space-y-1",children:d.map(g=>e.jsxs("div",{className:"group flex items-center gap-2 px-3 py-2 rounded-xl border border-transparent hover:bg-sky-50 dark:hover:bg-sky-500/10 transition-colors",children:[e.jsx(Pv,{size:14,className:"text-sky-500 dark:text-sky-400 flex-shrink-0"}),e.jsxs("button",{type:"button",onClick:()=>y(g),className:"flex-1 text-left min-w-0",children:[e.jsx("div",{className:"text-[12px] font-medium text-content truncate",children:g.name}),e.jsxs("div",{className:"text-[10px] text-content-tertiary font-mono truncate",children:[g.token," · ",C2(g.size)]})]}),e.jsx("button",{type:"button",onClick:()=>f.mutate(g.name),title:"Delete file",className:"p-1 rounded-md text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-500/10 opacity-0 group-hover:opacity-100 transition-all flex-shrink-0",children:e.jsx(es,{size:12})})]},g.name))})}),e.jsx("div",{className:"px-5 py-2.5 border-t border-border bg-surface-inset/30 flex-shrink-0",children:e.jsx("p",{className:"text-[11px] text-content-tertiary",children:"Click a file to insert its token into the step."})})]})})]})}function R2({selectedIds:s,suiteId:r,suites:a,onClear:o,onDeleted:c,onMoved:d}){const x=Pe(),{modalProps:h,confirmDelete:f}=zs(),[y,g]=p.useState(""),j=oe({mutationFn:()=>qn.bulkDelete(r,Array.from(s)),onSuccess:E=>{H.success(`Deleted ${E.deleted} case${E.deleted!==1?"s":""}`),x.invalidateQueries({queryKey:["cases",r]}),c(),o()},onError:E=>H.error(E.message)}),P=oe({mutationFn:E=>qn.bulkMove(r,Array.from(s),E),onSuccess:E=>{H.success(`Moved ${E.moved} case${E.moved!==1?"s":""}`),x.invalidateQueries({queryKey:["cases",r]}),d(),o(),g("")},onError:E=>H.error(E.message)}),S=a.filter(E=>E.id!==r),k=s.size;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"fixed bottom-0 left-[248px] right-0 z-30 bg-surface border-t border-border shadow-elevated px-5 py-3 flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm font-semibold text-content flex-shrink-0",children:[k," case",k!==1?"s":""," selected"]}),e.jsx("button",{type:"button",onClick:()=>H("Coming soon",{icon:"🔜"}),className:"inline-flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-lg border border-border text-content-secondary hover:bg-surface-inset transition-colors",children:"Run Selected"}),e.jsxs("button",{type:"button",onClick:()=>f(`Delete ${k} selected case${k!==1?"s":""}? This cannot be undone.`,()=>j.mutate()),disabled:j.isPending,className:"inline-flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-lg border border-red-200 text-red-600 bg-red-50 hover:bg-red-100 transition-colors disabled:opacity-50",children:[e.jsx(es,{size:12})," Delete Selected"]}),S.length>0&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Uv,{size:13,className:"text-content-tertiary flex-shrink-0"}),e.jsxs("select",{className:"text-xs border border-border rounded-lg px-2 py-1.5 bg-surface text-content-secondary focus:outline-none focus:ring-1 focus:ring-accent/30",value:y,onChange:E=>g(E.target.value),children:[e.jsx("option",{value:"",children:"Move to suite…"}),S.map(E=>e.jsx("option",{value:E.id,children:E.name},E.id))]}),y&&e.jsx("button",{type:"button",onClick:()=>P.mutate(y),disabled:P.isPending,className:"text-xs px-3 py-1.5 rounded-lg bg-accent text-white hover:brightness-110 transition-colors disabled:opacity-50",children:"Move"})]}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{type:"button",onClick:o,className:"p-1.5 rounded-lg text-content-tertiary hover:bg-surface-inset transition-colors",children:e.jsx(Fe,{size:14})})]}),e.jsx(Ts,{...h})]})}function M2({passRate:s,runs:r,flaky:a}){if(!a||r<3||s===1)return null;const o=Math.round(s*100);return e.jsx("span",{title:`Flaky: ${o}% pass rate over ${r} runs`,className:"inline-flex items-center gap-0.5 text-[8px] font-semibold px-1.5 py-0.5 rounded bg-amber-50 text-amber-600 ring-1 ring-amber-200 flex-shrink-0",children:"~flaky"})}function T2({open:s,onClose:r,suiteId:a,caseId:o,onInserted:c}){const d=Pe(),[x,h]=p.useState(""),[f,y]=p.useState(!1),[g,j]=p.useState(""),[P,S]=p.useState(""),{data:k=[]}=Oe({queryKey:["step-library"],queryFn:()=>hr.list()}),E=oe({mutationFn:C=>Mr.add(a,o,{instruction:C.instruction,...C.generatedCode?{generatedCode:C.generatedCode,strategy:"cache"}:{}}),onSuccess:()=>{d.invalidateQueries({queryKey:["cases",a,o]}),H.success("Step inserted"),c()},onError:C=>H.error(C.message)}),R=oe({mutationFn:()=>hr.create({name:g,instruction:P}),onSuccess:()=>{d.invalidateQueries({queryKey:["step-library"]}),H.success("Step saved to library"),y(!1),j(""),S("")},onError:C=>H.error(C.message)}),v=k.filter(C=>!x||C.name.toLowerCase().includes(x.toLowerCase())||C.instruction.toLowerCase().includes(x.toLowerCase())||C.tags.some(D=>D.toLowerCase().includes(x.toLowerCase())));return s?e.jsxs("div",{className:"fixed right-0 top-0 bottom-0 w-80 bg-surface border-l border-border shadow-xl z-40 flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Mi,{size:14,className:"text-accent"}),e.jsx("span",{className:"text-sm font-semibold text-content",children:"Step Library"})]}),e.jsx("button",{type:"button",onClick:r,className:"p-1 rounded text-content-tertiary hover:text-content hover:bg-surface-inset",children:e.jsx(Fe,{size:14})})]}),e.jsx("div",{className:"px-3 py-2 border-b border-border flex-shrink-0",children:e.jsxs("div",{className:"relative",children:[e.jsx(Bn,{size:12,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-content-tertiary"}),e.jsx("input",{type:"text",placeholder:"Search steps…",value:x,onChange:C=>h(C.target.value),className:"w-full pl-7 pr-3 py-1.5 text-xs border border-border rounded-lg bg-surface-inset focus:outline-none focus:ring-1 focus:ring-accent/30"})]})}),e.jsxs("div",{className:"flex-1 overflow-y-auto py-2 px-2 space-y-1",children:[v.length===0&&e.jsx("p",{className:"text-[11px] text-content-tertiary text-center py-6",children:k.length===0?"No steps in library yet":"No results"}),v.map(C=>e.jsx("div",{className:"border border-border rounded-lg p-2.5 hover:border-accent/30 hover:bg-surface-inset/50 transition-colors",children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("p",{className:"text-xs font-semibold text-content truncate",children:C.name}),C.generatedCode?e.jsx("span",{className:"flex-shrink-0 text-[8px] px-1 py-px rounded bg-emerald-50 dark:bg-emerald-900/20 text-emerald-600 dark:text-emerald-400 ring-1 ring-emerald-200 dark:ring-emerald-800",children:"Ready"}):e.jsx("span",{className:"flex-shrink-0 text-[8px] px-1 py-px rounded bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-1 ring-amber-200 dark:ring-amber-800",children:"No code"})]}),e.jsx("p",{className:"text-[10px] text-content-tertiary mt-0.5 line-clamp-2",children:C.instruction}),C.tags.length>0&&e.jsx("div",{className:"flex flex-wrap gap-0.5 mt-1",children:C.tags.map(D=>e.jsx("span",{className:"text-[8px] px-1 py-px rounded bg-accent/8 text-accent ring-1 ring-accent/15",children:D},D))})]}),e.jsx("button",{type:"button",onClick:()=>E.mutate({instruction:C.instruction,generatedCode:C.generatedCode}),disabled:E.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"})]})},C.id))]}),e.jsx("div",{className:"border-t border-border p-3 flex-shrink-0",children:f?e.jsxs("div",{className:"space-y-2",children:[e.jsx("input",{type:"text",placeholder:"Step name",value:g,onChange:C=>j(C.target.value),className:"w-full px-2 py-1.5 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30"}),e.jsx("textarea",{placeholder:"Step instruction",value:P,onChange:C=>S(C.target.value),rows:2,className:"w-full px-2 py-1.5 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30 resize-none"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"button",onClick:()=>R.mutate(),disabled:!g.trim()||!P.trim()||R.isPending,className:"flex-1 text-xs py-1.5 rounded-lg bg-accent text-white hover:brightness-110 transition-colors disabled:opacity-50",children:"Save"}),e.jsx("button",{type:"button",onClick:()=>y(!1),className:"text-xs px-3 py-1.5 rounded-lg border border-border text-content-secondary hover:bg-surface-inset",children:"Cancel"})]})]}):e.jsxs("button",{type:"button",onClick:()=>y(!0),className:"w-full flex items-center justify-center gap-1.5 text-xs py-2 rounded-lg border border-dashed border-border text-content-tertiary hover:text-content hover:border-accent/40 transition-colors",children:[e.jsx(Vs,{size:12})," Save current step to library"]})})]}):null}const hi=new Set,xa=new Map;let Dn=null,pi=null,fi=null;const ma=new Map,gi=new Map,Ru=new Set;function ha(){Ru.forEach(s=>s())}const $t={subscribe(s){return Ru.add(s),()=>Ru.delete(s)},getSnapshot(){return{runningCaseIds:hi,runningSuiteId:Dn,caseLastRun:ma,suiteLastRun:gi}},startCase(s){hi.add(s),ha()},startSuite(s){fi=s,Dn=s,ha()},onRunStart(s){fi&&(pi=s,fi=null)},onCaseRunning(s,r){xa.has(s)||xa.set(s,r)},onCaseDone(s,r,a){const o=s===pi,c=ma.get(r),d=o?c?.allureRunId??s:s;ma.set(r,{status:a,runId:s,allureRunId:d}),ha()},onComplete(s,r){const a=xa.get(s);a&&(hi.delete(a),xa.delete(s)),hi.clear(),xa.clear(),s===pi&&Dn?gi.set(Dn,{...r,runId:s}):Dn&&gi.set(Dn,{...r,runId:s}),Dn=null,pi=null,fi=null,ha()},seedFromHistory(s){for(const r of s)for(const a of r.suites){gi.has(a.suiteId)||gi.set(a.suiteId,{passed:r.passed,failed:r.failed,skipped:r.skipped,runId:r.runId});const c=r.suites.reduce((d,x)=>d+x.cases.length,0)===1;for(const d of a.cases){const x=ma.get(d.caseId);x?c&&!x.allureRunId&&ma.set(d.caseId,{...x,allureRunId:r.runId}):ma.set(d.caseId,{status:d.status,runId:r.runId,allureRunId:r.runId})}}ha()},clear(){hi.clear(),xa.clear(),Dn=null,pi=null,fi=null,ha()}};function Kl(){const[s,r]=p.useState(()=>$t.getSnapshot());return p.useEffect(()=>$t.subscribe(()=>r($t.getSnapshot())),[]),s}function rx(){const[s,r]=p.useState(()=>Ct.getSnapshot());return p.useEffect(()=>Ct.subscribe(()=>r(Ct.getSnapshot())),[]),s}const vg=["critical","high","medium","low"],Mu={critical:"bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 ring-red-500/20 dark:ring-red-500/30",high:"bg-orange-50 dark:bg-orange-900/20 text-orange-600 dark:text-orange-400 ring-orange-500/20 dark:ring-orange-500/30",medium:"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 ring-blue-500/20 dark:ring-blue-500/30",low:"bg-surface-inset text-content-secondary ring-border"};function Di({tags:s,editable:r=!1,onAdd:a,onRemove:o}){const[c,d]=p.useState(""),x=()=>{const h=c.trim().toLowerCase().replace(/\s+/g,"-");if(!h||s.includes(h)){d("");return}a?.(h),d("")};return e.jsxs("div",{className:"flex flex-wrap gap-0.5 items-center",children:[s.map(h=>e.jsxs("span",{className:"inline-flex items-center gap-px px-1.5 py-px rounded bg-accent/8 text-accent text-[9px] font-medium ring-1 ring-accent/15 leading-tight",children:[h,r&&e.jsx("button",{type:"button",onClick:()=>o?.(h),children:e.jsx(Fe,{size:8,className:"hover:text-red-500"})})]},h)),r&&e.jsx("input",{className:"text-[9px] border border-dashed border-border rounded bg-transparent outline-none w-14 px-1.5 py-px placeholder-content-tertiary focus:border-accent focus:ring-1 focus:ring-accent/20 transition-colors",placeholder:"+ tag",value:c,onChange:h=>d(h.target.value),onKeyDown:h=>{h.key==="Enter"&&(h.preventDefault(),x())},onBlur:x}),!r&&s.length===0&&e.jsx("span",{className:"text-[10px] text-content-tertiary",children:"—"})]})}function tu(){const s=Wn(),r=Gs(),{suiteId:a="",caseId:o=""}=ib(),c=o?"case-editor":a?"suite-detail":"suites",[d,x]=p.useState(""),[h,f]=p.useState("ui"),[y,g]=p.useState(""),{modalProps:j,confirmDelete:P}=zs(),[S,k]=p.useState(""),[E,R]=p.useState(""),[v,C]=p.useState(""),{data:D=[],isLoading:M}=mg();p.useEffect(()=>{const L=s.state?.openSuiteId;L&&D.length>0&&D.find(F=>F.id===L)&&r(`/tests/${L}`,{replace:!0})},[s.state,D]);const w=p.useMemo(()=>{const L=new Set;return D.forEach(z=>(z.tags??[]).forEach(F=>L.add(F))),Array.from(L).sort()},[D]),N=p.useMemo(()=>D.filter(L=>{const z=!S||L.name.toLowerCase().includes(S.toLowerCase())||(L.description??"").toLowerCase().includes(S.toLowerCase()),F=!E||(L.tags??[]).includes(E),ce=L.type==="performance"?"audit":L.type??"ui";return z&&F&&(!v||ce===v)}),[D,S,E,v]),K=D.find(L=>L.id===a),_=QN(),ee=JN(),{data:$=[]}=c2(),G=d2(),le=gg(),je=rx(),ke=oe({mutationFn:L=>ba.start({test:L}),onError:L=>{$t.clear(),H.error(L.message)}}),Ce=oe({mutationFn:L=>ba.start({suite:L}),onError:L=>{$t.clear(),H.error(L.message)}}),Re=L=>{$t.startCase(L),ke.mutate(L),r("/run")},be=L=>{$t.startSuite(L),Ce.mutate(L),r("/run")},B=()=>{d.trim()&&(_.mutate({name:d,type:h}),x(""))};if(M)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(Me,{size:20,className:"animate-spin text-accent"})});let X=null;if(c==="suites"){const L=D.filter(Y=>(Y.type??"ui")==="ui").length,z=D.filter(Y=>(Y.type??"ui")==="api").length,F=D.filter(Y=>Y.type==="audit"||Y.type==="performance").length,ce=D.reduce((Y,ue)=>Y+(ue.caseCount??0),0);X=e.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[e.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:e.jsxs("div",{className:"px-5 py-3.5 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-indigo-500 to-violet-600 flex items-center justify-center shadow-sm shadow-indigo-500/20",children:e.jsx(Ti,{size:18,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-base font-bold text-content tracking-tight",children:"Test Suites"}),e.jsx("p",{className:"text-[11px] text-content-tertiary mt-0.5",children:"Manage and organize your test automation"})]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"flex items-center gap-3",children:[{label:"Suites",val:D.length,cls:"text-indigo-600 dark:text-indigo-400"},{label:"UI",val:L,cls:"text-blue-600 dark:text-blue-400"},{label:"API",val:z,cls:"text-violet-600 dark:text-violet-400"},...F>0?[{label:"Audit",val:F,cls:"text-amber-600 dark:text-amber-400"}]:[],{label:"Cases",val:ce,cls:"text-emerald-600 dark:text-emerald-400"}].map(Y=>e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:O("text-sm font-bold tabular-nums",Y.cls),children:Y.val}),e.jsx("p",{className:"text-[9px] text-content-tertiary font-medium",children:Y.label})]},Y.label))}),e.jsx("div",{className:"w-px h-8 bg-border"}),e.jsx(Oi,{status:"not-created",variant:"full",label:"Sync All",onClick:()=>G.mutate(),busy:je.allOp==="create"||je.allOp==="sync"})]})]})}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface px-4 py-2.5 flex items-center gap-3",children:[e.jsx("div",{className:"flex gap-0.5 flex-shrink-0 bg-surface-inset rounded-lg p-0.5",children:[["","All",D.length],["ui","UI",L],["api","API",z],...F>0?[["audit","Audit",F]]:[]].map(([Y,ue,ye])=>e.jsxs("button",{type:"button",onClick:()=>C(Y),className:O("px-2.5 py-1 rounded-md text-[10px] font-semibold transition-all",v===Y?"bg-surface text-accent shadow-sm ring-1 ring-accent/20":"text-content-tertiary hover:text-content-secondary"),children:[ue," ",e.jsx("span",{className:"opacity-50 ml-0.5",children:ye})]},Y))}),e.jsxs("div",{className:"relative flex-1 min-w-0",children:[e.jsx(Bn,{size:12,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-content-tertiary pointer-events-none"}),e.jsx("input",{className:"w-full text-xs border border-border rounded-lg pl-8 pr-3 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/40 bg-surface placeholder-content-tertiary",placeholder:"Search suites…",value:S,onChange:Y=>k(Y.target.value)})]}),w.length>0&&e.jsxs("select",{value:E,onChange:Y=>R(Y.target.value),className:"text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-1 focus:ring-accent bg-surface min-w-[100px]",children:[e.jsx("option",{value:"",children:"All Tags"}),w.map(Y=>e.jsx("option",{value:Y,children:Y},Y))]}),(S||E||v)&&e.jsx("button",{type:"button",onClick:()=>{k(""),R(""),C("")},className:"p-1.5 rounded-lg text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:e.jsx(Fe,{size:12})}),e.jsx("div",{className:"w-px h-5 bg-border"}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[e.jsx("div",{className:"flex gap-0 bg-surface-inset rounded-lg p-0.5 ring-1 ring-border",children:["ui","api","audit"].map(Y=>e.jsx("button",{type:"button",onClick:()=>f(Y),className:O("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all",h===Y?Y==="api"?"bg-violet-500 text-white shadow-sm":Y==="audit"?"bg-amber-500 text-white shadow-sm":"bg-blue-500 text-white shadow-sm":"text-content-tertiary hover:text-content-secondary"),children:Y==="audit"?"Audit":Y},Y))}),e.jsx("input",{className:"w-40 text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"New suite name…",value:d,onChange:Y=>x(Y.target.value),onKeyDown:Y=>Y.key==="Enter"&&B()}),e.jsxs(ve,{size:"sm",onClick:B,disabled:_.isPending,children:[e.jsx(Vs,{size:11})," Add"]})]})]}),D.length===0?e.jsxs("div",{className:"rounded-xl border-2 border-dashed border-border bg-surface flex flex-col items-center justify-center py-16 gap-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-2xl bg-gradient-to-br from-indigo-50 to-violet-50 dark:from-indigo-900/20 dark:to-violet-900/20 flex items-center justify-center ring-1 ring-border",children:e.jsx(Pr,{size:22,className:"text-accent"})}),e.jsx("p",{className:"text-sm font-semibold text-content",children:"No suites yet"}),e.jsx("p",{className:"text-[11px] text-content-tertiary max-w-xs text-center",children:"Create your first test suite using the toolbar above — pick a type (UI, API, or Audit) and give it a name."})]}):N.length===0?e.jsxs("div",{className:"rounded-xl border-2 border-dashed border-border bg-surface flex flex-col items-center justify-center py-12 gap-2.5",children:[e.jsx(Df,{size:18,className:"text-content-tertiary"}),e.jsx("p",{className:"text-xs font-medium text-content-secondary",children:"No suites match your filters"}),e.jsx("button",{onClick:()=>{k(""),R(""),C("")},className:"text-[10px] font-medium text-accent hover:underline",children:"Clear all filters"})]}):e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:N.map(Y=>e.jsx(z2,{suite:Y,xrayStatus:$.find(ue=>ue.suiteId===Y.id)?.status??"not-created",xrayKey:$.find(ue=>ue.suiteId===Y.id)?.xrayTestSetId??null,onOpen:()=>r(`/tests/${Y.id}`),onRun:()=>be(Y.id),onDelete:()=>P(`Delete suite "${Y.name}"? All cases and steps will be lost.`,()=>ee.mutate(Y.id)),onXrayAction:()=>le.mutate(Y.id),isXrayBusy:je.busySuites.get(Y.id)==="create"||je.busySuites.get(Y.id)==="sync"||je.allOp==="create"||je.allOp==="sync"},Y.id))})]})})})}return c==="suite-detail"&&a&&(X=e.jsx(A2,{suiteId:a,suite:K,suites:D,newCaseName:y,onNewCaseNameChange:g,onOpenCase:L=>r(`/tests/${a}/cases/${L}`),onRunCase:L=>Re(L),onRunSuite:()=>be(a),onBack:()=>r("/tests")})),c==="case-editor"&&a&&o&&(X=e.jsx(O2,{suiteId:a,caseId:o,suiteName:K?.name??"",suiteType:K?.type??"ui",onBack:()=>r(`/tests/${a}`),onRunCase:()=>Re(o)})),e.jsxs("div",{className:"flex-1 overflow-hidden relative flex flex-col",children:[X,e.jsx(Ts,{...j})]})}function z2({suite:s,onOpen:r,onRun:a,onDelete:o,xrayStatus:c="not-created",xrayKey:d=null,onXrayAction:x,isXrayBusy:h=!1}){const{runningCaseIds:f,runningSuiteId:y,suiteLastRun:g}=Kl(),j=y===s.id,P=g.get(s.id),[S,k]=p.useState(!1),[E,R]=p.useState(s.name),[v,C]=p.useState(s.description??""),[D,M]=p.useState(s.tags??[]),[w,N]=p.useState(s.timeout?String(s.timeout):""),K=hg(),_=p.useRef(null),ee=(s.type??"ui")==="api",$=s.type==="audit"||s.type==="performance";p.useEffect(()=>{S&&_.current?.focus()},[S]);const G=X=>{X.stopPropagation(),k(!0)},le=X=>{X?.stopPropagation(),R(s.name),C(s.description??""),M(s.tags??[]),N(s.timeout?String(s.timeout):""),k(!1)},je=X=>{X?.stopPropagation();const L=w?parseInt(w,10):void 0;K.mutate({id:s.id,data:{name:E.trim()||s.name,description:v,tags:D,timeout:L}},{onSuccess:()=>k(!1)})},ke=X=>{X.key==="Enter"&&(X.preventDefault(),je()),X.key==="Escape"&&le()};if(S)return e.jsxs("div",{className:"rounded-xl border-2 border-accent/30 bg-accent/[0.02] p-3.5 space-y-2.5",onClick:X=>X.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:O("w-6 h-6 rounded-lg flex items-center justify-center flex-shrink-0",ee?"bg-violet-100":"bg-blue-100"),children:e.jsx(Ws,{size:11,className:ee?"text-violet-600":"text-blue-600"})}),e.jsx("input",{ref:_,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:E,onChange:X=>R(X.target.value),onKeyDown:ke,placeholder:"Suite name"})]}),e.jsx("input",{className:"w-full text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-1 focus:ring-accent/30 bg-surface",value:v,onChange:X=>C(X.target.value),onKeyDown:ke,placeholder:"Description (optional)"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"number",min:1e3,step:1e3,className:"w-32 text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-1 focus:ring-accent/30 bg-surface",value:w,onChange:X=>N(X.target.value),onKeyDown:ke,placeholder:"Timeout (ms)"}),e.jsx("span",{className:"text-[10px] text-content-tertiary",children:"ms timeout"}),e.jsx("div",{className:"ml-auto",children:e.jsx(Di,{tags:D,editable:!0,onAdd:X=>M(L=>[...L,X]),onRemove:X=>M(L=>L.filter(z=>z!==X))})})]}),e.jsxs("div",{className:"flex gap-1.5 justify-end pt-0.5",children:[e.jsxs(ve,{size:"sm",variant:"secondary",onClick:le,children:[e.jsx(Fe,{size:10})," Cancel"]}),e.jsxs(ve,{size:"sm",onClick:je,loading:K.isPending,children:[e.jsx(Qe,{size:10})," Save"]})]})]});const Ce=ee?"bg-gradient-to-b from-violet-500 to-purple-600":$?"bg-gradient-to-b from-amber-500 to-orange-600":"bg-gradient-to-b from-blue-500 to-indigo-600",Re=ee?"bg-violet-50 dark:bg-violet-900/20 text-violet-600 dark:text-violet-400 ring-violet-200 dark:ring-violet-800":$?"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",be=$?"Audit":ee?"API":"UI",B=s.caseCount??0;return e.jsxs("div",{className:"group rounded-xl border border-border bg-surface hover:border-accent/30 hover:shadow-md hover:shadow-accent/5 cursor-pointer transition-all flex overflow-hidden",onClick:r,children:[e.jsx("div",{className:O("w-1 flex-shrink-0 rounded-l-xl",Ce)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"px-3.5 pt-3 pb-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-[13px] font-bold text-content truncate flex-1",children:s.name}),e.jsxs("span",{className:O("text-[8px] px-1.5 py-0.5 rounded-md font-bold uppercase flex-shrink-0 ring-1 flex items-center gap-0.5",Re),children:[$&&e.jsx(ct,{size:7})," ",be]}),e.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",onClick:X=>X.stopPropagation(),children:[e.jsx("button",{type:"button",onClick:G,title:"Edit",className:"p-1.5 rounded-lg text-content-tertiary hover:text-accent hover:bg-accent/8 transition-colors",children:e.jsx(mn,{size:12})}),e.jsx("button",{type:"button",onClick:X=>{X.stopPropagation(),o()},title:"Delete",className:"p-1.5 rounded-lg text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:e.jsx(es,{size:12})})]})]}),s.description&&e.jsx("p",{className:"text-[10px] text-content-tertiary truncate mt-1 leading-relaxed",children:s.description})]}),e.jsx("div",{className:"px-3.5 pb-2",children:e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-semibold text-content-secondary bg-surface-inset px-2 py-0.5 rounded-md ring-1 ring-border",children:[e.jsx(Pr,{size:9,className:"opacity-50"}),B," case",B!==1?"s":""]}),P&&e.jsxs("span",{className:O("inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1",P.failed>0?"bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 ring-red-200 dark:ring-red-800":"bg-emerald-50 dark:bg-emerald-900/20 text-emerald-600 dark:text-emerald-400 ring-emerald-200 dark:ring-emerald-800"),children:[e.jsx(Cf,{size:5,className:"fill-current"}),P.passed,"p / ",P.failed,"f"]}),e.jsxs("div",{className:"flex items-center gap-1",onClick:X=>X.stopPropagation(),children:[e.jsx(nx,{status:c,xrayKey:d}),e.jsx(Oi,{variant:"icon",status:c,onClick:()=>x?.(),busy:h})]}),(s.tags??[]).length>0&&e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(Di,{tags:s.tags??[]})})]})}),e.jsxs("div",{className:"px-3.5 py-2 border-t border-border/40 bg-surface-inset/20 flex items-center gap-1.5",onClick:X=>X.stopPropagation(),children:[j?e.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] text-teal-600 dark:text-teal-400 font-semibold",children:[e.jsx(Me,{size:11,className:"animate-spin"})," Running..."]}):e.jsxs("button",{type:"button",onClick:X=>{X.stopPropagation(),a()},className:"flex items-center gap-1 px-2.5 py-1 rounded-lg text-[10px] font-semibold text-teal-700 dark:text-teal-400 bg-teal-50 dark:bg-teal-900/20 hover:bg-teal-100 dark:hover:bg-teal-900/30 ring-1 ring-teal-200 dark:ring-teal-800 transition-colors",title:"Run suite",children:[e.jsx(Xt,{size:10,strokeWidth:2.5})," Run Suite"]}),e.jsxs("button",{type:"button",disabled:!P,onClick:X=>{X.stopPropagation(),P&&window.open(`/allure/${P.runId}`,"_blank")},title:P?`Report: ${P.passed}p / ${P.failed}f`:"No report",className:O("flex items-center gap-1 px-2.5 py-1 rounded-lg text-[10px] font-semibold transition-colors ring-1",P?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20 hover:bg-blue-100 dark:hover:bg-blue-900/30 ring-blue-200 dark:ring-blue-800":"text-content-tertiary/40 bg-surface-inset ring-border cursor-not-allowed"),children:[e.jsx(Ms,{size:10})," Report"]}),e.jsx("div",{className:"flex-1"}),e.jsx("span",{className:"text-[9px] text-content-tertiary",children:new Date(s.updatedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})}),e.jsx(Zt,{size:12,className:"text-content-tertiary/40 group-hover:text-accent transition-colors"})]})]})]})}function A2({suiteId:s,suite:r,suites:a,newCaseName:o,onNewCaseNameChange:c,onOpenCase:d,onRunCase:x,onRunSuite:h,onBack:f}){const{runningCaseIds:y,runningSuiteId:g,caseLastRun:j}=Kl(),P=g===s,{data:S=[],isLoading:k}=YN(s),E=Rp(s),R=e2(s),v=Rp(s),[C,D]=p.useState(!1),[M,w]=p.useState(!1),{modalProps:N,confirmDelete:K}=zs(),[_,ee]=p.useState(new Set),$=p.useRef(-1),{data:G}=Oe({queryKey:["flakiness",s],queryFn:()=>hj.get(s),staleTime:6e4});p.useEffect(()=>{ee(new Set),$.current=-1},[s]);const{data:le}=fg(s),je=gg(),ke=yg(),Ce=u2(),Re=bg(),be=rx(),B=()=>{(le?.status??"not-created")==="not-created"?je.mutate(s):Ce.mutate(s)},X=ne=>{(le?.cases.find($e=>$e.caseId===ne)?.status??"not-created")==="not-created"?ke.mutate({suiteId:s,caseId:ne}):Re.mutate({suiteId:s,caseId:ne})};p.useEffect(()=>{ba.list(20).then(async ne=>{const Ue=await Promise.all(ne.slice(0,10).map($e=>ba.get($e.runId).catch(()=>null)));$t.seedFromHistory(Ue.filter($e=>$e!==null).map($e=>({runId:$e.runId,passed:$e.passed,failed:$e.failed,skipped:$e.skipped,suites:$e.suites.map(Ge=>({suiteId:Ge.suiteId,cases:Ge.cases.map(Ht=>({caseId:Ht.caseId,status:Ht.status}))}))})))}).catch(()=>{})},[s]);const[L,z]=p.useState(""),[F,ce]=p.useState(new Set),[Y,ue]=p.useState(""),ye=F.size===0,Ae=p.useMemo(()=>{const ne=new Set;return S.forEach(Ue=>(Ue.tags??[]).forEach($e=>ne.add($e))),Array.from(ne).sort()},[S]),me=p.useMemo(()=>S.filter(ne=>{const Ue=!L||ne.name.toLowerCase().includes(L.toLowerCase()),$e=F.size===0||(ne.tags??[]).some(Ht=>F.has(Ht)),Ge=!Y||ne.priority===Y;return Ue&&$e&&Ge}),[S,L,F,Y]),Ee=!!(L||F.size>0||Y),[Ke,yt]=p.useState(!1),[qt,Xe]=p.useState(r?.name??""),[ie,Mt]=p.useState(r?.description??""),[xt,Ft]=p.useState(r?.tags??[]),[As,ys]=p.useState(r?.timeout?String(r.timeout):""),W=hg();p.useEffect(()=>{Xe(r?.name??""),Mt(r?.description??""),Ft(r?.tags??[]),ys(r?.timeout?String(r.timeout):"")},[r?.id]);const he=()=>{const ne=As?parseInt(As,10):void 0;W.mutate({id:s,data:{name:qt.trim()||r?.name,description:ie,tags:xt,timeout:ne}},{onSuccess:()=>yt(!1)})},Le=ne=>{ne.key==="Enter"&&(ne.preventDefault(),he()),ne.key==="Escape"&&yt(!1)},bs=()=>{o.trim()&&(E.mutate({name:o}),c(""))},bt=ne=>{v.mutate({name:`${ne.name} (copy)`,description:ne.description,priority:ne.priority,tags:ne.tags,steps:(ne.steps??[]).map(Ue=>({instruction:Ue.instruction}))})},Os=ne=>`TC-${(r?.name??"TC").replace(/[^a-zA-Z]/g,"").slice(0,3).toUpperCase()||"TC"}-${String(ne+1).padStart(3,"0")}`,ts=(r?.type??"ui")==="api",mt=r?.type==="audit"||r?.type==="performance";return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:[e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsx("div",{className:"px-4 py-1.5 bg-surface-inset/30 border-b border-border/50",children:e.jsxs("nav",{className:"flex items-center gap-1.5 text-[10px] text-content-tertiary",children:[e.jsxs("button",{onClick:f,className:"hover:text-accent transition-colors flex items-center gap-1",children:[e.jsx(If,{size:10})," Suites"]}),e.jsx(Zt,{size:9}),e.jsx("span",{className:"text-content-secondary font-semibold",children:r?.name})]})}),Ke?e.jsxs("div",{className:"px-4 py-3.5 space-y-2.5",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:O("w-7 h-7 rounded-lg flex items-center justify-center flex-shrink-0",ts?"bg-gradient-to-br from-violet-500 to-purple-600":"bg-gradient-to-br from-blue-500 to-indigo-600"),children:e.jsx(Ti,{size:13,className:"text-white"})}),e.jsx("input",{className:"flex-1 text-sm font-bold border border-border rounded-lg px-3 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface",value:qt,onChange:ne=>Xe(ne.target.value),onKeyDown:Le,placeholder:"Suite name",autoFocus:!0})]}),e.jsx("input",{className:"w-full text-xs border border-border rounded-lg px-3 py-1.5 focus:outline-none focus:ring-1 focus:ring-accent/30 bg-surface",value:ie,onChange:ne=>Mt(ne.target.value),onKeyDown:Le,placeholder:"Description"}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Er,{size:10,className:"text-content-tertiary"}),e.jsx("input",{type:"number",min:1e3,step:1e3,className:"w-28 text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-1 focus:ring-accent/30 bg-surface",value:As,onChange:ne=>ys(ne.target.value),onKeyDown:Le,placeholder:"Timeout ms"})]}),e.jsx("div",{className:"flex-1",children:e.jsx(Di,{tags:xt,editable:!0,onAdd:ne=>Ft(Ue=>[...Ue,ne]),onRemove:ne=>Ft(Ue=>Ue.filter($e=>$e!==ne))})}),e.jsxs("div",{className:"flex gap-1.5",children:[e.jsxs(ve,{size:"sm",variant:"secondary",onClick:()=>yt(!1),children:[e.jsx(Fe,{size:10})," Cancel"]}),e.jsxs(ve,{size:"sm",onClick:he,loading:W.isPending,children:[e.jsx(Qe,{size:10})," Save"]})]})]})]}):e.jsxs("div",{className:"px-4 py-3 flex items-center gap-3 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-2.5 min-w-0 flex-1",children:[e.jsx("div",{className:O("w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0 shadow-sm",ts?"bg-gradient-to-br from-violet-500 to-purple-600 shadow-violet-500/20":mt?"bg-gradient-to-br from-amber-500 to-orange-600 shadow-amber-500/20":"bg-gradient-to-br from-blue-500 to-indigo-600 shadow-blue-500/20"),children:e.jsx(Ti,{size:16,className:"text-white"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("h1",{className:"text-sm font-bold text-content truncate",children:r?.name}),mt?e.jsxs("span",{className:"text-[7px] px-1.5 py-px rounded font-bold flex items-center gap-0.5 ring-1 bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-amber-200 dark:ring-amber-800",children:[e.jsx(ct,{size:7})," Audit"]}):e.jsx("button",{type:"button",onClick:ne=>{ne.stopPropagation();const Ue=ts?"ui":"api";W.mutate({id:s,data:{type:Ue}})},title:"Toggle type",className:O("text-[7px] px-1.5 py-px rounded font-bold uppercase ring-1 cursor-pointer transition-colors",ts?"bg-violet-50 dark:bg-violet-900/20 text-violet-600 dark:text-violet-400 ring-violet-200 dark:ring-violet-800 hover:bg-violet-100 dark:hover:bg-violet-900/30":"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 ring-blue-200 dark:ring-blue-800 hover:bg-blue-100 dark:hover:bg-blue-900/30"),children:ts?"API":"UI"}),e.jsx("button",{type:"button",onClick:()=>yt(!0),className:"p-0.5 rounded text-content-tertiary hover:text-accent transition-colors",children:e.jsx(mn,{size:10})})]}),ie&&e.jsx("p",{className:"text-[10px] text-content-tertiary truncate mt-0.5 leading-tight max-w-md",children:ie})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[P?e.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] text-teal-600 dark:text-teal-400 font-medium px-2 py-1 rounded-lg bg-teal-50 dark:bg-teal-900/20 ring-1 ring-teal-200 dark:ring-teal-800",children:[e.jsx(Me,{size:11,className:"animate-spin"})," Running…"]}):e.jsxs(ve,{size:"sm",onClick:h,className:"bg-teal-600 hover:bg-teal-700 text-white border-teal-600",children:[e.jsx(Xt,{size:10})," Run Suite"]}),e.jsxs(ve,{size:"sm",onClick:()=>D(!0),className:"bg-indigo-600 hover:bg-indigo-700 text-white border-indigo-600",children:[e.jsx(kr,{size:10})," Hooks"]}),e.jsx(Oi,{variant:"full",status:le?.status??"not-created",label:"Sync",onClick:B,busy:be.busySuites.get(s)==="create"||be.busySuites.get(s)==="sync"||be.allOp==="create"||be.allOp==="sync"})]})]}),Ae.length>0&&e.jsxs("div",{className:"px-4 py-1.5 border-t border-border/50 flex items-center gap-1.5 flex-wrap",children:[e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mr-0.5",children:"Tags"}),e.jsx("button",{type:"button",onClick:()=>ce(new Set),className:O("text-[9px] px-2 py-0.5 rounded-md font-medium transition-all",ye?"bg-accent text-white shadow-sm shadow-accent/20":"text-content-tertiary hover:text-content-secondary bg-surface-inset hover:bg-surface-inset/80 ring-1 ring-border"),children:"All"}),Ae.map(ne=>{const Ue=F.has(ne);return e.jsx("button",{type:"button",onClick:()=>{ce($e=>{const Ge=new Set($e);return Ue?Ge.delete(ne):Ge.add(ne),Ge})},className:O("text-[9px] px-2 py-0.5 rounded-md font-medium transition-all",Ue||ye?"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:ne},ne)})]}),e.jsxs("div",{className:"px-4 py-2 bg-surface-inset/40 border-t border-border flex items-center gap-2",children:[e.jsxs("div",{className:"relative flex-1 min-w-[120px]",children:[e.jsx(Bn,{size:11,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-content-tertiary pointer-events-none"}),e.jsx("input",{className:"w-full text-xs border border-border rounded-lg pl-7 pr-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"Search tests…",value:L,onChange:ne=>z(ne.target.value)})]}),e.jsxs("select",{value:Y,onChange:ne=>ue(ne.target.value),className:"text-xs border border-border rounded-lg px-2 py-1.5 focus:outline-none focus:ring-1 focus:ring-accent bg-surface min-w-[90px]",children:[e.jsx("option",{value:"",children:"All Priority"}),vg.map(ne=>e.jsx("option",{value:ne,className:"capitalize",children:ne.charAt(0).toUpperCase()+ne.slice(1)},ne))]}),Ee&&e.jsx("button",{type:"button",onClick:()=>{z(""),ce(new Set),ue("")},className:"p-1 rounded-lg text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:e.jsx(Fe,{size:11})}),e.jsx("div",{className:"w-px h-4 bg-border"}),e.jsx("input",{className:"w-36 text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"New test case…",value:o,onChange:ne=>c(ne.target.value),onKeyDown:ne=>ne.key==="Enter"&&bs()}),e.jsxs(ve,{size:"sm",onClick:bs,disabled:E.isPending,children:[e.jsx(Vs,{size:10})," Add"]}),e.jsx(ve,{size:"sm",variant:"secondary",onClick:()=>w(!0),children:"From Template"}),e.jsx("span",{className:"text-[9px] text-content-tertiary ml-1 tabular-nums flex-shrink-0",children:Ee?`${me.length}/${S.length}`:`${S.length} test${S.length!==1?"s":""}`})]})]}),k?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(Me,{size:18,className:"animate-spin text-accent"})}):S.length===0?e.jsxs("div",{className:"rounded-xl border border-dashed border-border bg-surface flex flex-col items-center justify-center py-14 gap-2.5",children:[e.jsx("div",{className:"w-11 h-11 rounded-xl bg-surface-inset flex items-center justify-center",children:e.jsx(Pr,{size:20,className:"text-content-tertiary"})}),e.jsx("p",{className:"text-xs font-medium text-content-secondary",children:"No test cases yet"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Add your first test case using the toolbar above"})]}):me.length===0?e.jsxs("div",{className:"rounded-xl border border-dashed border-border bg-surface flex flex-col items-center justify-center py-10 gap-2",children:[e.jsx(Df,{size:16,className:"text-content-tertiary"}),e.jsx("p",{className:"text-xs text-content-tertiary",children:"No tests match filters"}),e.jsx("button",{onClick:()=>{z(""),ce(new Set),ue("")},className:"text-[10px] text-accent hover:underline",children:"Clear filters"})]}):e.jsxs("div",{className:"space-y-1.5",children:[me.length>0&&e.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-1",children:[e.jsx("input",{type:"checkbox",className:"rounded border-border text-accent cursor-pointer",checked:_.size===me.length&&me.length>0,onChange:ne=>{ne.target.checked?ee(new Set(me.map(Ue=>Ue.id))):ee(new Set)}}),e.jsx("span",{className:"text-[9px] text-content-tertiary",children:"Select all"})]}),me.map((ne,Ue)=>{const $e=ne.steps.some(_e=>_e.stepType==="api"),Ge=j.get(ne.id),Ht=le?.cases.find(_e=>_e.caseId===ne.id),Qs=Ht?.status??"not-created",Qn=be.busyCases.get(`${s}:${ne.id}`)==="create"||be.busyCases.get(`${s}:${ne.id}`)==="sync"||be.busySuites.get(s)==="create"||be.busySuites.get(s)==="sync"||be.allOp==="create"||be.allOp==="sync",Ds=_.has(ne.id),os=G?.cases.find(_e=>_e.caseId===ne.id);return e.jsx("div",{className:O("group rounded-xl border bg-surface hover:border-accent/30 hover:shadow-sm hover:shadow-accent/5 cursor-pointer transition-all",Ds?"border-accent/40 bg-accent/[0.02]":"border-border"),onClick:()=>d(ne.id),children:e.jsxs("div",{className:"px-3.5 py-2.5 flex items-center gap-3",children:[e.jsx("input",{type:"checkbox",className:"rounded border-border text-accent cursor-pointer flex-shrink-0",checked:Ds,onClick:_e=>_e.stopPropagation(),onChange:_e=>{_e.stopPropagation(),ee(vs=>{const ls=new Set(vs);return _e.target.checked?ls.add(ne.id):ls.delete(ne.id),$.current=Ue,ls})},onClickCapture:_e=>{if(_e.shiftKey&&$.current>=0){_e.preventDefault();const vs=Math.min($.current,Ue),ls=Math.max($.current,Ue);ee(Is=>{const Kt=new Set(Is);return me.slice(vs,ls+1).forEach(cs=>Kt.add(cs.id)),Kt})}$.current=Ue}}),e.jsx(Il,{size:11,className:"text-content-tertiary/40 group-hover:text-content-tertiary cursor-grab flex-shrink-0 transition-colors"}),e.jsx("span",{className:"text-[9px] font-mono text-accent font-semibold bg-accent/5 px-1.5 py-0.5 rounded ring-1 ring-accent/10 flex-shrink-0 tabular-nums",children:Os(Ue)}),e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 flex-1",children:[e.jsx("span",{className:"text-xs font-medium text-content truncate",children:ne.name}),e.jsx("span",{className:O("text-[7px] px-1 py-px rounded font-bold uppercase flex-shrink-0 ring-1",$e?"bg-violet-50 dark:bg-violet-900/20 text-violet-600 dark:text-violet-400 ring-violet-200 dark:ring-violet-800":mt?"bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-amber-200 dark:ring-amber-800":"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 ring-blue-200 dark:ring-blue-800"),children:$e?"API":mt?"Audit":"UI"}),os&&e.jsx(M2,{passRate:os.passRate,runs:os.runs,flaky:os.flaky})]}),e.jsxs("span",{className:"text-[9px] text-content-tertiary tabular-nums flex-shrink-0",children:[ne.steps.length," step",ne.steps.length!==1?"s":""]}),e.jsx("span",{className:O("text-[8px] px-1.5 py-0.5 rounded capitalize ring-1 flex-shrink-0 font-medium",Mu[ne.priority]??Mu.low),children:ne.priority}),(ne.tags??[]).length>0&&e.jsx("div",{className:"flex-shrink-0",onClick:_e=>_e.stopPropagation(),children:e.jsx(Di,{tags:ne.tags})}),(()=>{if(!Ge)return e.jsx("span",{className:"text-[8px] px-1.5 py-0.5 rounded ring-1 ring-border text-content-tertiary/60 flex-shrink-0",children:"Never"});const _e={passed:"bg-emerald-50 dark:bg-emerald-900/20 text-emerald-600 dark:text-emerald-400 ring-emerald-200 dark:ring-emerald-800",failed:"bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 ring-red-200 dark:ring-red-800",skipped:"bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-amber-200 dark:ring-amber-800"};return e.jsx("span",{className:O("text-[8px] px-1.5 py-0.5 rounded capitalize ring-1 flex-shrink-0 font-medium",_e[Ge.status]??"ring-border text-content-tertiary"),children:Ge.status})})(),e.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",onClick:_e=>_e.stopPropagation(),children:[e.jsx(nx,{status:Qs,xrayKey:Ht?.xrayTestId}),e.jsx(Oi,{variant:"icon",status:Qs,onClick:()=>X(ne.id),busy:Qn})]}),e.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",onClick:_e=>_e.stopPropagation(),children:[y.has(ne.id)?e.jsx(Me,{size:11,className:"animate-spin text-teal-600 dark:text-teal-400"}):e.jsx("button",{type:"button",onClick:()=>x(ne.id),title:"Run",className:"p-1 rounded-md text-teal-600 dark:text-teal-400 hover:bg-teal-50 dark:hover:bg-teal-900/20 transition-colors",children:e.jsx(Xt,{size:11})}),e.jsx("button",{type:"button",disabled:!Ge,onClick:()=>{Ge&&window.open(`/allure/${Ge.allureRunId}`,"_blank")},title:"Report",className:O("p-1 rounded-md transition-colors",Ge?"text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900/20":"text-content-tertiary/40 cursor-not-allowed"),children:e.jsx(Ms,{size:11})}),e.jsx("button",{type:"button",onClick:_e=>{_e.stopPropagation(),bt(ne)},title:"Duplicate",className:"p-1 rounded-md text-content-tertiary hover:text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900/20 transition-colors",children:e.jsx(Vu,{size:11})}),e.jsx("button",{type:"button",onClick:_e=>{_e.stopPropagation(),K(`Delete "${ne.name}"?`,()=>R.mutate(ne.id))},title:"Delete",className:"p-1 rounded-md text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:e.jsx(es,{size:10})})]}),e.jsx(Zt,{size:11,className:"text-content-tertiary/40 flex-shrink-0"})]})},ne.id)})]})]})}),e.jsx(N2,{suiteId:s,open:C,onClose:()=>D(!1)}),e.jsx(GN,{open:M,onClose:()=>w(!1),suiteId:s,onCreated:()=>{}}),e.jsx(Ts,{...N}),_.size>0&&e.jsx(R2,{selectedIds:_,suiteId:s,suites:a,onClear:()=>ee(new Set),onDeleted:()=>ee(new Set),onMoved:()=>ee(new Set)})]})}function O2({suiteId:s,caseId:r,suiteName:a,suiteType:o,onBack:c,onRunCase:d}){const{runningCaseIds:x,caseLastRun:h}=Kl(),f=x.has(r),y=h.get(r),{data:g,isLoading:j}=XN(s,r),P=ZN(s),S=t2(s,r),k=s2(s,r),E=r2(s,r),{modalProps:R,confirmDelete:v}=zs(),C=n2(s,r),D=a2(s,r),M=i2(s,r),{data:w}=fg(s),N=yg(),K=bg(),_=w?.cases.find(J=>J.caseId===r),ee=rx(),$=()=>{(_?.status??"not-created")==="not-created"?N.mutate({suiteId:s,caseId:r}):K.mutate({suiteId:s,caseId:r})},[G,le]=p.useState(""),[je,ke]=p.useState(!1),[Ce,Re]=p.useState(""),[be,B]=p.useState("medium"),[X,L]=p.useState([]),[z,F]=p.useState(""),[ce,Y]=p.useState("none"),[ue,ye]=p.useState(""),[Ae,me]=p.useState(""),[Ee,Ke]=p.useState(!1),[yt,qt]=p.useState(!1),Xe=p.useRef(null),[ie,Mt]=p.useState(!1),[xt,Ft]=p.useState(""),[As,ys]=p.useState(""),W=p.useRef(null),[he,Le]=p.useState(null),[bs,bt]=p.useState(null),[Os,ts]=p.useState("steps"),[mt,ne]=p.useState(!1),[Ue,$e]=p.useState([]),[Ge,Ht]=p.useState([]),[Qs,Qn]=p.useState(["performance","accessibility","seo"]),[Ds,os]=p.useState(""),[_e,vs]=p.useState(""),[ls,Is]=p.useState(!1),[Kt,cs]=p.useState([]),[qi,Ca]=p.useState(!1),[Hi,Ea]=p.useState(!1),Or=p.useRef(null);Ar({"recorder:action":J=>{const Te=J;cs(Se=>[...Se,Te]),setTimeout(()=>{Or.current?.scrollTo({top:Or.current.scrollHeight,behavior:"smooth"})},50)},"recorder:stopped":()=>{Is(!1)}});const Pa=async()=>{try{Ca(!0),cs([]),await $d.start(),Is(!0),H.success("Recording started — Shift+Click = assert element, Ctrl+Shift+U = assert URL",{duration:5e3})}catch(J){H.error(J?.message||"Failed to start recorder")}finally{Ca(!1)}},Ki=async()=>{try{Ea(!0);const J=await $d.stop();if(Is(!1),J.actions.length>0){for(const Te of J.actions){const Se=pj(Te);await S.mutateAsync({instruction:Te.instruction,generatedCode:Se,strategy:"recorder",...Te.soft?{soft:!0}:{}})}H.success(`Added ${J.actions.length} recorded steps with code`)}else H("No actions were recorded")}catch(J){H.error(J?.message||"Failed to stop recorder")}finally{Ea(!1)}};p.useEffect(()=>{$d.status().then(J=>{J.recording&&(Is(!0),cs(J.actions))}).catch(()=>{})},[]),p.useEffect(()=>{if(!g)return;le(g.name),Re(g.description??""),B(g.priority??"medium"),L([...g.tags]),F(g.timeout?String(g.timeout):"");const J=g.dataSource;J?(Y(J.type??"none"),ye(J.path??""),me(J.data?JSON.stringify(J.data,null,2):"")):(Y("none"),ye(""),me("")),$e(g.caseHooks?.before.map(Te=>({id:Te.id,instruction:Te.instruction}))??[]),Ht(g.caseHooks?.after.map(Te=>({id:Te.id,instruction:Te.instruction}))??[]),Qn(g.lighthouseCategories??["performance","accessibility","seo"]),qt(!1),Mt(!1)},[g?.id]);const rt=()=>{qt(!0),Mt(!1)},Ra=J=>{J.key==="Enter"&&(J.preventDefault(),Dr())},hn=J=>{const Te=W.current;if(!Te){Ft(Lr=>Lr+J);return}const Se=Te.selectionStart??xt.length,Ie=Te.selectionEnd??xt.length,Tt=xt.slice(0,Se)+J+xt.slice(Ie);Ft(Tt),setTimeout(()=>{Te.focus(),Te.setSelectionRange(Se+J.length,Se+J.length)},0)},Dr=async()=>{const J=z?parseInt(z,10):void 0;let Te;if(ce!=="none")if(Te={type:ce},ce==="inline")try{Te.data=JSON.parse(Ae)}catch{}else Te.path=ue;const Se={before:Ue.map((Ie,Tt)=>({...Ie,order:Tt})),after:Ge.map((Ie,Tt)=>({...Ie,order:Tt}))};await P.mutateAsync({caseId:r,data:{name:G,description:Ce,priority:be,tags:X,timeout:J,dataSource:Te,caseHooks:Se,lighthouseCategories:Qs}}),qt(!1),Mt(!0)},Jn=async()=>{yt&&await Dr(),d()},Yn=()=>{xt.trim()&&(S.mutate({instruction:xt}),Ft(""))},Ir=async J=>{ys(J),await D.mutateAsync(J).finally(()=>ys(""))},Fr=g?`TC-${(g.name||"").replace(/[^a-zA-Z]/g,"").slice(0,3).toUpperCase()||"TST"}-001`:"…";if(j||!g)return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(Me,{size:18,className:"animate-spin text-accent"})});const Fs=[...g.steps].sort((J,Te)=>J.order-Te.order),Vl=Fs.some(J=>J.stepType==="api"),Wi=o==="audit"||o==="performance";return e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex-shrink-0 bg-surface border-b border-border z-10",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-5 pt-2 pb-1 text-[10px] text-content-tertiary",children:[e.jsxs("button",{onClick:()=>window.location.assign("/tests"),className:"hover:text-accent flex items-center gap-1",children:[e.jsx(If,{size:10})," Suites"]}),e.jsx(Zt,{size:9}),e.jsx("button",{onClick:c,className:"hover:text-accent",children:a}),e.jsx(Zt,{size:9}),e.jsx("span",{className:"text-content-secondary font-semibold font-mono",children:Fr})]}),e.jsxs("div",{className:"px-5 pb-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:je?e.jsx("input",{ref:Xe,className:"flex-1 text-sm font-bold text-content bg-transparent border-b-2 border-accent outline-none p-0 pb-px",value:G,onChange:J=>{le(J.target.value),rt()},onBlur:()=>ke(!1),onKeyDown:J=>{J.key==="Enter"&&ke(!1),J.key==="Escape"&&(le(g?.name??""),ke(!1))},autoFocus:!0}):e.jsxs("div",{className:"flex items-center gap-1.5 group min-w-0",children:[e.jsx("h1",{className:"text-sm font-bold text-content truncate",children:G||"Untitled Test Case"}),e.jsx("button",{type:"button",onClick:()=>{ke(!0),setTimeout(()=>Xe.current?.focus(),0)},className:"p-0.5 rounded text-content-tertiary opacity-0 group-hover:opacity-100 hover:bg-surface-inset transition-all",children:e.jsx(mn,{size:10})})]})}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[e.jsx(Oi,{variant:"full",status:_?.status??"not-created",onClick:$,busy:ee.busyCases.get(`${s}:${r}`)==="create"||ee.busyCases.get(`${s}:${r}`)==="sync"||ee.busySuites.get(s)==="create"||ee.busySuites.get(s)==="sync"||ee.allOp==="create"||ee.allOp==="sync"}),e.jsxs(ve,{variant:"secondary",size:"sm",onClick:Dr,loading:P.isPending,disabled:!yt,children:[e.jsx(ya,{size:10})," Save"]}),e.jsxs(ve,{size:"sm",onClick:Jn,loading:f,disabled:f,children:[!f&&e.jsx(Xt,{size:10})," ",f?"Running…":"Save & Run"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-1.5 flex-wrap",children:[e.jsx("span",{className:"px-1.5 py-px rounded text-[9px] font-mono font-bold bg-teal-50 dark:bg-teal-900/20 text-teal-700 dark:text-teal-400 ring-1 ring-teal-200 dark:ring-teal-800",children:Fr}),f?e.jsxs("span",{className:"flex items-center gap-1 text-[9px] text-teal-600 dark:text-teal-400 font-medium",children:[e.jsx(Me,{size:9,className:"animate-spin"})," Running"]}):(()=>{if(!y)return e.jsx("span",{className:"text-[8px] px-1.5 py-px rounded ring-1 ring-border text-content-tertiary",children:"Never run"});const J={passed:"bg-emerald-50 dark:bg-emerald-900/20 text-emerald-600 dark:text-emerald-400 ring-emerald-200 dark:ring-emerald-800",failed:"bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 ring-red-200 dark:ring-red-800",skipped:"bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-amber-200 dark:ring-amber-800"};return e.jsx("span",{className:O("text-[8px] px-1.5 py-px rounded capitalize ring-1",J[y.status]??"ring-border text-content-tertiary"),children:y.status})})(),e.jsx("button",{type:"button",disabled:!y,onClick:()=>{y&&window.open(`/allure/${y.allureRunId}`,"_blank")},className:O("p-0.5 rounded transition-colors",y?"text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900/20":"text-content-tertiary cursor-not-allowed"),children:e.jsx(Ms,{size:11})}),e.jsx(nx,{status:_?.status??"not-created",xrayKey:_?.xrayTestId}),e.jsx("div",{className:"w-px h-3.5 bg-border"}),e.jsx("div",{className:"flex items-center gap-1",children:vg.map(J=>e.jsx("button",{type:"button",onClick:()=>{B(J),rt()},className:O("px-1.5 py-px rounded text-[8px] capitalize font-bold transition-all ring-1",be===J?Mu[J]:"ring-transparent text-content-tertiary hover:ring-border"),children:J},J))}),e.jsx("div",{className:"w-px h-3.5 bg-border"}),e.jsx(Di,{tags:X,editable:!0,onAdd:J=>{L(Te=>[...Te,J]),rt()},onRemove:J=>{L(Te=>Te.filter(Se=>Se!==J)),rt()}}),e.jsx("div",{className:"w-px h-3.5 bg-border"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Er,{size:9,className:"text-content-tertiary"}),e.jsx("input",{type:"number",min:1e3,step:1e3,className:"w-16 text-[9px] bg-transparent border-b border-dashed border-border px-1 py-px text-content-secondary placeholder:text-content-tertiary focus:outline-none focus:border-accent tabular-nums",placeholder:"30000",value:z,onChange:J=>{F(J.target.value),rt()},onKeyDown:Ra}),e.jsx("span",{className:"text-[8px] text-content-tertiary",children:"ms"})]}),e.jsx("div",{className:"w-px h-3.5 bg-border"}),e.jsxs("button",{type:"button",onClick:()=>Ke(J=>!J),className:O("flex items-center gap-1 text-[9px] font-medium px-1.5 py-0.5 rounded transition-colors",Ee?"text-accent bg-accent/5":"text-content-tertiary hover:text-content-secondary hover:bg-surface-inset"),children:[e.jsx(kr,{size:9})," ",Ee?"Less":"More",e.jsx(kt,{size:8,className:O("transition-transform",Ee&&"rotate-180")})]}),yt&&e.jsx("span",{className:"text-[8px] text-amber-500 dark:text-amber-400 font-bold ml-auto",children:"● Unsaved"}),ie&&!yt&&e.jsx("span",{className:"text-[8px] text-emerald-500 dark:text-emerald-400 font-bold ml-auto",children:"✓ Saved"})]})]}),Ee&&e.jsxs("div",{className:"px-5 pb-3 pt-1 border-t border-border bg-surface-inset/30 animate-fade-in",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:"Description"}),e.jsx("textarea",{rows:2,className:"w-full text-xs text-content-secondary bg-surface rounded-lg border border-border outline-none resize-none focus:ring-2 focus:ring-accent/30 px-2.5 py-1.5",placeholder:"Add a description…",value:Ce,onChange:J=>{Re(J.target.value),rt()},onKeyDown:J=>{J.key==="Enter"&&!J.shiftKey&&(J.preventDefault(),Dr())}})]}),e.jsx("div",{children:e.jsx(D2,{type:ce,filePath:ue,inlineData:Ae,onTypeChange:J=>{Y(J),rt()},onFilePathChange:J=>{ye(J),rt()},onInlineChange:J=>{me(J),rt()}})})]}),Wi&&e.jsxs("div",{className:"mt-3 pt-3 border-t border-border/50",children:[e.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-2 flex items-center gap-1.5",children:[e.jsx(ct,{size:9,className:"text-amber-500 dark:text-amber-400"})," Non-Functional Checks (Lighthouse)"]}),e.jsxs("div",{className:"flex items-center gap-4",children:[["performance","accessibility","seo"].map(J=>{const Te={performance:"⚡ Performance",accessibility:"♿ Accessibility",seo:"🔍 SEO"},Se=Qs.includes(J);return e.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[e.jsx("input",{type:"checkbox",checked:Se,onChange:()=>{Qn(Ie=>Se?Ie.filter(Tt=>Tt!==J):[...Ie,J]),rt()},className:"w-3 h-3 rounded accent-amber-600 cursor-pointer"}),e.jsx("span",{className:"text-[10px] text-content-secondary",children:Te[J]})]},J)}),Qs.length===0&&e.jsx("span",{className:"text-[9px] text-amber-600",children:"⚠ No checks selected — Lighthouse will be skipped"})]})]})]})]}),e.jsxs("div",{className:"flex-shrink-0 flex items-center gap-1 px-5 pt-2 pb-0 border-b border-border bg-surface",children:[e.jsx("button",{type:"button",onClick:()=>ts("steps"),className:O("px-3 py-1.5 text-xs font-semibold rounded-t-lg transition-colors border-b-2",Os==="steps"?"border-accent text-accent":"border-transparent text-content-tertiary hover:text-content-secondary"),children:"Steps"}),e.jsxs("button",{type:"button",onClick:()=>ts("hooks"),className:O("px-3 py-1.5 text-xs font-semibold rounded-t-lg transition-colors border-b-2",Os==="hooks"?"border-accent text-accent":"border-transparent text-content-tertiary hover:text-content-secondary"),children:["Hooks",Ue.length+Ge.length>0&&e.jsx("span",{className:"ml-1 text-[9px] bg-accent/10 text-accent rounded px-1",children:Ue.length+Ge.length})]}),e.jsx("div",{className:"flex-1"}),e.jsxs("button",{type:"button",onClick:()=>ne(!0),title:"Step Library",className:"flex items-center gap-1.5 text-[10px] text-content-tertiary hover:text-accent hover:bg-accent/5 px-2 py-1 rounded-lg transition-colors mb-1",children:[e.jsx(Mi,{size:11})," Library"]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto bg-surface-inset/20",children:e.jsxs("div",{className:"max-w-4xl mx-auto px-5 py-3",children:[Os==="hooks"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-2 border-b border-border bg-surface-inset/30",children:[e.jsx("h3",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest",children:"Before Hooks"}),e.jsx("p",{className:"text-[9px] text-content-tertiary mt-0.5",children:"Run before all steps"})]}),e.jsxs("div",{className:"p-3 space-y-1.5",children:[Ue.map((J,Te)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs bg-surface-inset/50 rounded-lg px-3 py-2 border border-border",children:[e.jsx("span",{className:"text-content-tertiary font-mono text-[9px] w-4",children:Te+1}),e.jsx("span",{className:"flex-1 text-content-secondary",children:J.instruction}),e.jsx("button",{type:"button",onClick:()=>{$e(Se=>Se.filter((Ie,Tt)=>Tt!==Te)),rt()},className:"p-0.5 rounded text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:e.jsx(Fe,{size:11})})]},J.id)),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx("input",{className:"flex-1 text-xs border border-border rounded-lg px-3 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"Add before-hook instruction…",value:Ds,onChange:J=>os(J.target.value),onKeyDown:J=>{J.key==="Enter"&&Ds.trim()&&($e(Te=>[...Te,{id:crypto.randomUUID(),instruction:Ds.trim()}]),os(""),rt())}}),e.jsxs(ve,{size:"sm",onClick:()=>{Ds.trim()&&($e(J=>[...J,{id:crypto.randomUUID(),instruction:Ds.trim()}]),os(""),rt())},children:[e.jsx(Vs,{size:11})," Add"]})]})]})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-2 border-b border-border bg-surface-inset/30",children:[e.jsx("h3",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest",children:"After Hooks"}),e.jsx("p",{className:"text-[9px] text-content-tertiary mt-0.5",children:"Run after all steps (always)"})]}),e.jsxs("div",{className:"p-3 space-y-1.5",children:[Ge.map((J,Te)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs bg-surface-inset/50 rounded-lg px-3 py-2 border border-border",children:[e.jsx("span",{className:"text-content-tertiary font-mono text-[9px] w-4",children:Te+1}),e.jsx("span",{className:"flex-1 text-content-secondary",children:J.instruction}),e.jsx("button",{type:"button",onClick:()=>{Ht(Se=>Se.filter((Ie,Tt)=>Tt!==Te)),rt()},className:"p-0.5 rounded text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:e.jsx(Fe,{size:11})})]},J.id)),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx("input",{className:"flex-1 text-xs border border-border rounded-lg px-3 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"Add after-hook instruction…",value:_e,onChange:J=>vs(J.target.value),onKeyDown:J=>{J.key==="Enter"&&_e.trim()&&(Ht(Te=>[...Te,{id:crypto.randomUUID(),instruction:_e.trim()}]),vs(""),rt())}}),e.jsxs(ve,{size:"sm",onClick:()=>{_e.trim()&&(Ht(J=>[...J,{id:crypto.randomUUID(),instruction:_e.trim()}]),vs(""),rt())},children:[e.jsx(Vs,{size:11})," Add"]})]})]})]})]}),Os==="steps"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-2 mb-3",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(ct,{size:12,className:"absolute left-3 top-1/2 -translate-y-1/2 text-accent/50 pointer-events-none"}),e.jsx("input",{ref:W,className:"w-full text-xs border border-border rounded-lg pl-8 pr-3 py-2 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary shadow-xs",placeholder:"Describe a step in plain English and press Enter…",value:xt,onChange:J=>Ft(J.target.value),onKeyDown:J=>J.key==="Enter"&&Yn()})]}),e.jsx(S2,{onInsert:hn}),o!=="api"&&e.jsx(P2,{onInsert:hn}),e.jsxs(ve,{size:"sm",onClick:Yn,disabled:S.isPending,className:"border border-transparent",children:[e.jsx(Vs,{size:11})," Add Step"]}),o!=="api"&&(ls?e.jsxs(ve,{size:"sm",loading:Hi,onClick:Ki,className:"border border-transparent bg-gradient-to-b from-red-500 to-red-600 text-white hover:brightness-110 shadow-sm hover:shadow-md focus-visible:ring-red-500 animate-pulse",children:[e.jsx(Bf,{size:10,className:"fill-current"})," Stop Recording"]}):e.jsxs(ve,{size:"sm",loading:qi,onClick:Pa,className:"border border-transparent bg-gradient-to-b from-red-400 to-red-500 text-white hover:brightness-110 shadow-sm hover:shadow-md focus-visible:ring-red-500",children:[e.jsx(Cf,{size:10,className:"fill-current"})," Record"]})),e.jsxs(ve,{size:"sm",loading:M.isPending,onClick:()=>M.mutate(),className:"border border-transparent bg-gradient-to-b from-emerald-500 to-emerald-600 text-white hover:brightness-110 shadow-sm hover:shadow-md focus-visible:ring-emerald-500",children:[e.jsx(Sr,{size:11})," Generate All"]})]}),o!=="api"&&ls&&Kt.length>0&&e.jsxs("div",{className:"mb-3 border border-red-300 dark:border-red-700 rounded-xl overflow-hidden bg-red-50 dark:bg-red-950/30",children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 bg-red-100 dark:bg-red-900/40 border-b border-red-200 dark:border-red-800",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-red-400 opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-red-500"})]}),e.jsxs("span",{className:"text-[11px] font-semibold text-red-700 dark:text-red-300",children:["Recording — ",Kt.length," action",Kt.length!==1?"s":""," captured"]})]}),e.jsx("span",{className:"text-[10px] text-red-500 dark:text-red-400",children:"Interact with the browser to record steps"})]}),e.jsx("div",{ref:Or,className:"max-h-40 overflow-y-auto px-3 py-2 space-y-1",children:Kt.map((J,Te)=>e.jsxs("div",{className:"flex items-start gap-2 text-[11px]",children:[e.jsx("span",{className:O("flex-shrink-0 w-5 h-5 rounded-full flex items-center justify-center font-mono font-bold text-[9px]",J.action==="assert"?"bg-emerald-200 dark:bg-emerald-800 text-emerald-700 dark:text-emerald-300":"bg-red-200 dark:bg-red-800 text-red-700 dark:text-red-300"),children:Te+1}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[J.action==="assert"&&e.jsx(Qe,{size:10,className:"text-emerald-500 flex-shrink-0"}),e.jsx("span",{className:O("text-content-secondary",J.action==="assert"&&"text-emerald-700 dark:text-emerald-300 font-medium"),children:J.instruction})]})]},J.id))})]}),e.jsx("div",{className:"space-y-1.5",children:Fs.length===0?e.jsxs("div",{className:"border border-dashed border-border rounded-xl py-10 text-center bg-surface",children:[e.jsx(ct,{size:20,className:"mx-auto text-content-tertiary/40 mb-2"}),e.jsx("p",{className:"text-xs text-content-tertiary",children:"No steps yet — type an instruction above and press Enter"}),e.jsxs("p",{className:"text-[10px] text-content-tertiary mt-1",children:["Or click ",e.jsx("span",{className:"font-semibold",children:"Generate All"})," to let AI write all steps"]})]}):Fs.map((J,Te)=>e.jsx(I2,{step:J,index:Te,suiteId:s,caseId:r,caseIsApi:Vl,suiteIsAudit:Wi,generating:As===J.id,isDragging:he===J.id,isDragOver:bs===J.id,onDragStart:()=>Le(J.id),onDragOver:()=>bt(J.id),onDrop:()=>{if(!he||he===J.id){Le(null),bt(null);return}const Se=Fs.map(Lr=>Lr.id),Ie=Se.indexOf(he),Tt=Se.indexOf(J.id);Se.splice(Ie,1),Se.splice(Tt,0,he),C.mutate(Se),Le(null),bt(null)},onDragEnd:()=>{Le(null),bt(null)},onDelete:Se=>v("Delete this step?",()=>E.mutate(Se)),onGenerate:Se=>{Ir(Se)},onSaveInstruction:(Se,Ie)=>k.mutate({stepId:Se,instruction:Ie}),onSaveTimeout:(Se,Ie)=>k.mutate({stepId:Se,timeout:Ie}),onSaveRetries:(Se,Ie)=>k.mutate({stepId:Se,retries:Ie??void 0}),onSaveStepType:(Se,Ie)=>k.mutate({stepId:Se,stepType:Ie}),onSaveMockUrl:(Se,Ie)=>k.mutate({stepId:Se,mockUrl:Ie}),onSaveMockResponse:(Se,Ie)=>k.mutate({stepId:Se,mockResponse:Ie}),onSaveMockStatus:(Se,Ie)=>k.mutate({stepId:Se,mockStatus:Ie}),onSaveRunAudit:(Se,Ie)=>k.mutate({stepId:Se,runAudit:Ie},{onSuccess:()=>H.success(Ie?"⚡ Audit checkpoint set":"Audit checkpoint removed")}),onSaveSoft:(Se,Ie)=>k.mutate({stepId:Se,soft:Ie},{onSuccess:()=>H.success(Ie?"Soft assertion — test continues on failure":"Hard assertion — test stops on failure")}),onSaveVisualCheck:(Se,Ie)=>k.mutate({stepId:Se,visualCheck:Ie},{onSuccess:()=>H.success(Ie?"👁 Visual regression enabled for this step":"Visual regression disabled for this step")})},J.id))}),Fs.length>0&&e.jsxs("p",{className:"text-[9px] text-content-tertiary text-center mt-3",children:[Fs.length," step",Fs.length!==1?"s":""," · ",Fs.filter(J=>!!J.generatedCode?.trim()).length," with code"]})]})]})}),e.jsx(Ts,{...R}),e.jsx(T2,{open:mt,onClose:()=>ne(!1),suiteId:s,caseId:r,onInserted:()=>ne(!1)})]})}function D2({type:s,filePath:r,inlineData:a,onTypeChange:o,onFilePathChange:c,onInlineChange:d}){const[x,h]=p.useState([]),[f,y]=p.useState([]),[g,j]=p.useState(!1),[P,S]=p.useState(""),[k,E]=p.useState(!1),R=p.useRef(null);p.useEffect(()=>{ca.list().then(h).catch(()=>{})},[]),p.useEffect(()=>{if((s==="json-file"||s==="csv-file")&&r){const M=r.replace(/^data\//,"");ca.get(M).then(w=>{y(w.rows),S(w.raw)}).catch(()=>y([]))}else if(s==="inline"&&a)try{y(JSON.parse(a))}catch{y([])}else y([])},[s,r,a]);const v=async M=>{const w=M.target.files?.[0];if(w){E(!0);try{const N=await w.text(),K=await ca.upload(w.name,N);c(K.path),o(w.name.endsWith(".csv")?"csv-file":"json-file");const _=await ca.list();h(_),H.success(`Uploaded ${w.name} (${K.rowCount} rows)`)}catch(N){H.error(N instanceof Error?N.message:"Upload failed")}finally{E(!1),M.target.value=""}}},C=async()=>{if((s==="json-file"||s==="csv-file")&&r){const M=r.replace(/^data\//,"");try{await ca.update(M,P);const w=await ca.get(M);y(w.rows),j(!1),H.success("Data file saved")}catch(w){H.error(w instanceof Error?w.message:"Save failed")}}else if(s==="inline"){d(P);try{y(JSON.parse(P))}catch{y([])}j(!1)}},D=f.length>0?Object.keys(f[0]):[];return e.jsxs("div",{children:[e.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1.5 flex items-center gap-1",children:[e.jsx(Ef,{size:9})," Data-Driven"]}),e.jsxs("div",{className:"flex items-center gap-1.5 mb-2 flex-wrap",children:[["none","inline","json-file","csv-file"].map(M=>e.jsx("button",{type:"button",onClick:()=>o(M),className:O("px-2 py-0.5 rounded-md text-[9px] font-semibold transition-all ring-1",s===M?"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:M==="none"?"Off":M==="inline"?"Inline":M==="json-file"?"JSON":"CSV"},M)),(s==="json-file"||s==="csv-file")&&e.jsxs("select",{className:"max-w-[160px] text-[10px] border border-border rounded-md px-1.5 py-0.5 focus:outline-none focus:ring-1 focus:ring-accent bg-surface-inset/50",value:r,onChange:M=>c(M.target.value),children:[e.jsx("option",{value:"",children:"Select file…"}),x.filter(M=>s==="csv-file"?M.type==="csv":M.type==="json").map(M=>e.jsx("option",{value:M.path,children:M.name},M.name))]}),s!=="none"&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:()=>R.current?.click(),className:"flex items-center gap-0.5 px-1.5 py-0.5 rounded-md ring-1 ring-dashed ring-violet-300 dark:ring-violet-700 text-[9px] font-semibold text-violet-600 dark:text-violet-400 hover:bg-violet-50 dark:hover:bg-violet-900/20 transition-colors",children:[k?e.jsx(Me,{size:9,className:"animate-spin"}):e.jsx(Ul,{size:9})," Upload"]}),e.jsx("input",{ref:R,type:"file",accept:".json,.csv",onChange:v,className:"hidden"})]})]}),s==="inline"&&!g&&e.jsx("textarea",{className:"w-full h-14 text-[10px] font-mono border border-border rounded-lg px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 mb-2 bg-surface-inset/50",placeholder:'[{"email":"user1@test.com","password":"pass1"}]',value:a,onChange:M=>d(M.target.value)}),s!=="none"&&f.length>0&&!g&&e.jsxs("div",{className:"mb-2",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsxs("span",{className:"text-[9px] text-content-tertiary",children:[f.length," row",f.length!==1?"s":""]}),e.jsxs("button",{type:"button",onClick:()=>{s==="inline"&&S(a),j(!0)},className:"text-[9px] text-violet-600 dark:text-violet-400 hover:text-violet-800 dark:hover:text-violet-300 font-semibold flex items-center gap-0.5",children:[e.jsx(mn,{size:8})," Edit"]})]}),e.jsx("div",{className:"overflow-x-auto border border-border rounded-lg",children:e.jsxs("table",{className:"w-full text-[10px]",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-surface-inset border-b border-border",children:[e.jsx("th",{className:"px-2 py-1 text-left font-bold text-content-tertiary w-6",children:"#"}),D.map(M=>e.jsx("th",{className:"px-2 py-1 text-left font-bold text-violet-600 dark:text-violet-400",children:`{{${M}}}`},M))]})}),e.jsxs("tbody",{children:[f.slice(0,8).map((M,w)=>e.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-surface-inset/50",children:[e.jsx("td",{className:"px-2 py-0.5 text-content-tertiary tabular-nums",children:w+1}),D.map(N=>e.jsx("td",{className:"px-2 py-0.5 text-content-secondary font-mono",children:M[N]},N))]},w)),f.length>8&&e.jsx("tr",{children:e.jsxs("td",{colSpan:D.length+1,className:"px-2 py-1 text-center text-content-tertiary text-[9px] italic",children:["+",f.length-8," more"]})})]})]})})]}),g&&e.jsxs("div",{className:"mb-2",children:[e.jsx("textarea",{className:"w-full h-32 text-[10px] font-mono border border-violet-300 dark:border-violet-700 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-violet-300 dark:focus:ring-violet-700 bg-violet-50/20 dark:bg-violet-900/10 text-content",value:P,onChange:M=>S(M.target.value)}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-1.5",children:[e.jsxs("button",{type:"button",onClick:C,className:"flex items-center gap-0.5 px-2.5 py-1 rounded-lg bg-violet-600 text-white text-[10px] font-semibold hover:bg-violet-700",children:[e.jsx(Qe,{size:10})," Save"]}),e.jsxs("button",{type:"button",onClick:()=>j(!1),className:"flex items-center gap-0.5 px-2.5 py-1 rounded-lg border border-border text-[10px] text-content-secondary hover:bg-surface-inset",children:[e.jsx(Fe,{size:10})," Cancel"]})]})]})]})}function I2({step:s,index:r,caseIsApi:a,suiteIsAudit:o,generating:c,isDragging:d,isDragOver:x,onDragStart:h,onDragOver:f,onDrop:y,onDragEnd:g,onDelete:j,onGenerate:P,onSaveInstruction:S,onSaveTimeout:k,onSaveRetries:E,onSaveStepType:R,onSaveMockUrl:v,onSaveMockResponse:C,onSaveMockStatus:D,onSaveRunAudit:M,onSaveSoft:w,onSaveVisualCheck:N}){const[K,_]=p.useState(!1),[ee,$]=p.useState(!1),[G,le]=p.useState(s.instruction),[je,ke]=p.useState(s.timeout?String(s.timeout):""),[Ce,Re]=p.useState(s.retries!=null?String(s.retries):""),[be,B]=p.useState(s.mockUrl??""),[X,L]=p.useState(s.mockResponse??""),[z,F]=p.useState(s.mockStatus?String(s.mockStatus):"200"),ce=p.useRef(null),[Y,ue]=p.useState(void 0),ye=!!s.generatedCode?.trim(),Ae=s.stepType==="mock",me=!!s.runAudit,Ee=Y!==void 0?Y:me,Ke=Y!==void 0&&Y!==me,yt=()=>{Y!==void 0&&(M?.(s.id,Y),ue(void 0))},qt=()=>ue(void 0);p.useEffect(()=>{Ae&&_(!0)},[Ae]),p.useEffect(()=>{ke(s.timeout?String(s.timeout):"")},[s.timeout]),p.useEffect(()=>{le(s.instruction)},[s.instruction]),p.useEffect(()=>{ee&&ce.current?.focus()},[ee]);const Xe=()=>{const ie=G.trim();ie&&ie!==s.instruction&&S(s.id,ie),$(!1)};return e.jsxs("div",{draggable:!0,onDragStart:ie=>{ie.dataTransfer.effectAllowed="move",h()},onDragOver:ie=>{ie.preventDefault(),f()},onDrop:ie=>{ie.preventDefault(),y()},onDragEnd:g,className:O("rounded-lg overflow-hidden transition-all",d?"opacity-40 ring-2 ring-accent":"ring-1 ring-border",x?"ring-2 ring-accent shadow-sm":""),children:[e.jsxs("div",{className:"flex items-start gap-2 px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 pt-0.5",children:[e.jsx(Il,{size:11,className:"text-content-tertiary hover:text-content-secondary cursor-grab active:cursor-grabbing"}),e.jsx("span",{className:"w-5 h-5 rounded-md bg-gradient-to-br from-accent to-accent-dark text-white text-[9px] font-bold flex items-center justify-center",children:r+1})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start gap-1.5 flex-wrap",children:[ee?e.jsx("input",{ref:ce,className:"flex-1 text-xs text-content border border-accent/40 rounded-md px-2 py-0.5 focus:outline-none focus:ring-1 focus:ring-accent/30 min-w-0 bg-surface-inset/50",value:G,onChange:ie=>le(ie.target.value),onKeyDown:ie=>{ie.key==="Enter"&&(ie.preventDefault(),Xe()),ie.key==="Escape"&&(le(s.instruction),$(!1))},onBlur:Xe}):e.jsx("span",{className:"text-xs text-content font-medium flex-1",children:s.instruction}),e.jsx("span",{className:O("text-[8px] px-1 py-px rounded font-bold uppercase flex-shrink-0 ring-1",Ae?"bg-purple-50 dark:bg-purple-900/20 text-purple-600 dark:text-purple-400 ring-purple-200 dark:ring-purple-800":s.stepType==="api"||a?"bg-violet-50 dark:bg-violet-900/20 text-violet-600 dark:text-violet-400 ring-violet-200 dark:ring-violet-800":o?"bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-amber-200 dark:ring-amber-800":"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 ring-blue-200 dark:ring-blue-800"),children:Ae?"Mock":s.stepType==="api"||a?"API":o?"Audit":"UI"}),Ee&&e.jsxs("span",{className:O("text-[8px] px-1 py-px rounded font-bold flex items-center gap-0.5 ring-1",Ke?"bg-amber-50 dark:bg-amber-900/20 text-amber-500 dark:text-amber-400 ring-amber-200 dark:ring-amber-800 opacity-60":"bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-amber-200 dark:ring-amber-800"),children:[e.jsx(ct,{size:7}),Ke?"Audit*":"Audit"]}),s.lastHealed&&e.jsx("span",{className:"text-[8px] px-1 py-px rounded bg-amber-50 text-amber-600 ring-1 ring-amber-200 font-bold",children:"healed"})]}),ye&&!ee&&e.jsx("p",{className:"text-[10px] text-content-tertiary mt-px",children:"Code generated ✓"})]}),e.jsxs("select",{value:s.stepType??"ui",onChange:ie=>{ie.target.value==="mock"&&_(!0),R?.(s.id,ie.target.value)},className:"text-[10px] border border-border rounded-md px-1 py-0.5 bg-surface-inset/50 text-content-secondary focus:outline-none focus:border-accent flex-shrink-0",children:[e.jsx("option",{value:"ui",children:"UI"}),e.jsx("option",{value:"api",children:"API"}),e.jsx("option",{value:"mock",children:"Mock"})]}),e.jsx("input",{type:"number",min:0,max:5,step:1,className:"w-10 text-[10px] border border-border rounded-md px-1.5 py-0.5 text-content-secondary placeholder:text-content-tertiary focus:outline-none focus:border-accent flex-shrink-0 bg-surface-inset/50",placeholder:"×",title:"Retries",value:Ce,onChange:ie=>Re(ie.target.value),onBlur:()=>{const ie=Ce.trim()?parseInt(Ce,10):null,Mt=s.retries??null;ie!==Mt&&E?.(s.id,ie!=null&&ie>=0?ie:null)},onKeyDown:ie=>{ie.key==="Enter"&&ie.target.blur()}}),e.jsx("input",{type:"number",min:100,step:100,className:"w-16 text-[10px] border border-border rounded-md px-1.5 py-0.5 text-content-secondary placeholder:text-content-tertiary focus:outline-none focus:border-accent flex-shrink-0 bg-surface-inset/50",placeholder:"ms",value:je,onChange:ie=>ke(ie.target.value),onBlur:()=>{const ie=je.trim()?parseInt(je,10):null,Mt=s.timeout??null;ie!==Mt&&k(s.id,ie&&ie>0?ie:null)},onKeyDown:ie=>{ie.key==="Enter"&&ie.target.blur()}}),e.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",children:[ee?e.jsx("button",{type:"button",onClick:Xe,className:"p-1 rounded-md text-emerald-500 hover:bg-emerald-50 dark:hover:bg-emerald-900/20 transition-colors",children:e.jsx(Qe,{size:12})}):e.jsx("button",{type:"button",onClick:()=>$(!0),className:"p-1 rounded-md text-content-tertiary hover:text-accent hover:bg-accent/5 transition-colors",children:e.jsx(mn,{size:11})}),o&&!a&&s.stepType!=="api"&&s.stepType!=="mock"&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",title:Ee?"Remove Lighthouse audit checkpoint":"Mark as Lighthouse audit checkpoint",onClick:ie=>{ie.stopPropagation(),ue(!Ee)},onMouseDown:ie=>ie.stopPropagation(),className:O("flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[9px] font-bold transition-all cursor-pointer select-none",Ee?"text-amber-700 dark:text-amber-400 bg-amber-100 dark:bg-amber-900/30 hover:bg-amber-200 dark:hover:bg-amber-900/40 ring-1 ring-amber-300 dark:ring-amber-700":"text-content-tertiary hover:text-amber-600 dark:hover:text-amber-400 hover:bg-amber-50 dark:hover:bg-amber-900/20 ring-1 ring-transparent hover:ring-amber-200 dark:hover:ring-amber-800"),children:[e.jsx(ct,{size:9}),e.jsx("span",{children:"Audit"})]}),Ke&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",title:"Save audit change",onClick:ie=>{ie.stopPropagation(),yt()},onMouseDown:ie=>ie.stopPropagation(),className:"p-1 rounded-md text-emerald-600 hover:bg-emerald-50 dark:hover:bg-emerald-900/20 transition-colors",children:e.jsx(Qe,{size:11})}),e.jsx("button",{type:"button",title:"Cancel",onClick:ie=>{ie.stopPropagation(),qt()},onMouseDown:ie=>ie.stopPropagation(),className:"p-1 rounded-md text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:e.jsx(Fe,{size:11})})]})]}),/^(?:soft\s+)?(?:verify|check|assert|ensure|confirm)\b/i.test(s.instruction)&&e.jsx("button",{type:"button",title:s.soft?"Soft assertion (test continues on failure) — click to make hard":"Hard assertion (test stops on failure) — click to make soft",onClick:ie=>{ie.stopPropagation(),w?.(s.id,!s.soft)},onMouseDown:ie=>ie.stopPropagation(),className:O("flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[9px] font-bold transition-all cursor-pointer select-none",s.soft?"text-blue-700 dark:text-blue-400 bg-blue-100 dark:bg-blue-900/30 hover:bg-blue-200 dark:hover:bg-blue-900/40 ring-1 ring-blue-300 dark:ring-blue-700":"text-content-tertiary hover:text-blue-600 dark:hover:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20 ring-1 ring-transparent hover:ring-blue-200 dark:hover:ring-blue-800"),children:e.jsx("span",{children:s.soft?"Soft":"Hard"})}),s.stepType!=="api"&&e.jsx("button",{type:"button",title:s.visualCheck?"Visual regression enabled — click to disable":"Enable visual regression for this step",onClick:ie=>{ie.stopPropagation(),N?.(s.id,!s.visualCheck)},onMouseDown:ie=>ie.stopPropagation(),className:O("flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[9px] font-bold transition-all cursor-pointer select-none",s.visualCheck?"text-emerald-700 dark:text-emerald-400 bg-emerald-100 dark:bg-emerald-900/30 hover:bg-emerald-200 dark:hover:bg-emerald-900/40 ring-1 ring-emerald-300 dark:ring-emerald-700":"text-content-tertiary hover:text-emerald-600 dark:hover:text-emerald-400 hover:bg-emerald-50 dark:hover:bg-emerald-900/20 ring-1 ring-transparent hover:ring-emerald-200 dark:hover:ring-emerald-800"),children:e.jsx(ka,{size:12})}),e.jsx("button",{type:"button",onClick:()=>P(s.id),disabled:c,className:"p-1 rounded-md text-content-tertiary hover:text-accent hover:bg-accent/5 transition-colors disabled:opacity-40",children:c?e.jsx(Me,{size:12,className:"animate-spin"}):e.jsx(Sr,{size:12})}),e.jsx("button",{type:"button",onClick:()=>j(s.id),className:"p-1 rounded-md text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:e.jsx(es,{size:11})}),e.jsx("button",{type:"button",onClick:()=>_(ie=>!ie),className:"p-1 rounded-md text-content-tertiary hover:text-content-secondary hover:bg-surface-inset transition-colors",children:K?e.jsx(kt,{size:12}):e.jsx(Zt,{size:12})})]})]}),K&&e.jsxs("div",{className:"border-t border-border",children:[Ae&&e.jsxs("div",{className:"px-3 py-2.5 bg-violet-50/50 dark:bg-violet-900/10 space-y-1.5 border-b border-border",children:[e.jsx("p",{className:"text-[9px] font-bold text-violet-600 dark:text-violet-400 uppercase tracking-widest",children:"Mock Route"}),e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx("input",{className:"flex-1 text-[10px] border border-border rounded px-2 py-1 bg-surface focus:outline-none focus:border-violet-400",placeholder:"URL pattern, e.g. **/api/users",value:be,onChange:ie=>B(ie.target.value),onBlur:()=>{be!==(s.mockUrl??"")&&v?.(s.id,be)}}),e.jsx("input",{type:"number",className:"w-16 text-[10px] border border-border rounded px-2 py-1 bg-surface focus:outline-none focus:border-violet-400",placeholder:"Status",value:z,onChange:ie=>F(ie.target.value),onBlur:()=>{const ie=parseInt(z,10);!isNaN(ie)&&ie!==(s.mockStatus??200)&&D?.(s.id,ie)}})]}),e.jsx("textarea",{rows:3,className:"w-full text-[10px] border border-border rounded px-2 py-1 bg-surface focus:outline-none focus:border-violet-400 font-mono resize-none",placeholder:'{"key":"value"}',value:X,onChange:ie=>L(ie.target.value),onBlur:()=>{X!==(s.mockResponse??"")&&C?.(s.id,X)}})]}),ye?e.jsx(sx,{code:s.generatedCode,maxLines:12,className:"rounded-none"}):e.jsxs("div",{className:"px-3 py-2.5 text-[10px] text-content-tertiary italic bg-surface-inset/30",children:["No code yet — click ",e.jsx(Sr,{size:9,className:"inline mb-0.5"})," to generate"]})]})]})}let qs=null,yi=!1;const Tu=new Set;function bi(){Tu.forEach(s=>s())}const Rs={subscribe(s){return Tu.add(s),()=>{Tu.delete(s)}},getSnapshot(){return{job:qs,showPopup:yi}},start(s,r){const a=`gen-${Date.now()}`;return qs={id:a,tab:s,label:r,status:"running",startedAt:Date.now()},yi=!1,bi(),a},done(s,r){qs&&(qs={...qs,status:"done",suiteId:s,suiteName:r},yi=!0,bi())},error(s){qs&&(qs={...qs,status:"error",error:s},bi())},dismissPopup(){yi=!1,bi()},clear(){qs=null,yi=!1,bi()},isRunning(){return qs?.status==="running"}};function jg(){const[s,r]=p.useState(()=>Rs.getSnapshot());return p.useEffect(()=>Rs.subscribe(()=>r(Rs.getSnapshot())),[]),s}const F2=[{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."}],L2=/^(https?:\/\/.+\/(browse|issue)\/[A-Z][A-Z0-9_]+-\d+|https?:\/\/.+selectedIssue=[A-Z][A-Z0-9_]+-\d+|[A-Z][A-Z0-9_]+-\d+)$/i;function Tp(s){return s.trim()?L2.test(s.trim()):!0}function zp(s){const r=s.trim();if(!r)return null;const a=r.match(/([A-Z][A-Z0-9_]+-\d+)/i);return a?a[1].toUpperCase():null}function _2(s){const r=s.trim();if(!r)return[];if(r.startsWith("["))try{const d=JSON.parse(r).map(x=>{if(typeof x=="string")return{story:x.trim()};if(typeof x=="object"&&x!==null&&"story"in x){const h=x;return{story:String(h.story).trim(),suiteName:h.suiteName,jiraUrl:h.jiraUrl}}return null}).filter(x=>x!==null&&x.story.length>=10);if(d.length>0)return d}catch{}const a=r.split(/\n\s*---+\s*\n/).map(c=>c.trim()).filter(Boolean);if(a.length>1)return a.map(c=>c.replace(/^\d+\.\s*/,"").trim()).filter(c=>c.length>=10).map(c=>({story:c}));const o=r.split(`
|
|
905
|
-
`).filter(c=>/^\d+[\.\)]\s/.test(c.trim()));return o.length>1?o.map(c=>c.replace(/^\d+[\.\)]\s*/,"").trim()).filter(c=>c.length>=10).map(c=>({story:c})):r.length>=10?[{story:r}]:[]}function su({icon:s,title:r,desc:a,tag:o,active:c,gradient:d,onClick:x}){return e.jsxs("button",{type:"button",onClick:x,className:O("relative flex items-start gap-2.5 p-3 rounded-xl border-2 text-left transition-all duration-200 group flex-1 min-w-0",c?"border-accent bg-accent/[0.04] shadow-sm":"border-transparent bg-surface hover:bg-surface-inset/50 hover:border-border"),children:[c&&e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 -translate-y-px w-8 h-[3px] rounded-full bg-gradient-to-r from-accent to-accent-light"}),e.jsx("div",{className:O("w-5 h-5 rounded flex items-center justify-center transition-all flex-shrink-0",c?d:"bg-surface-inset"),children:e.jsx(s,{size:14,className:c?"text-white":"text-content-tertiary",strokeWidth:1.8})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:O("text-xs font-semibold transition-colors",c?"text-content":"text-content-secondary"),children:r}),o&&e.jsx("span",{className:O("text-[8px] font-bold uppercase tracking-wider px-1 py-px rounded",c?"bg-accent/10 text-accent":"bg-surface-inset text-content-tertiary"),children:o})]}),e.jsx("p",{className:"text-[10px] text-content-tertiary mt-px leading-snug truncate",children:a})]})]})}function Ap({title:s,icon:r,children:a,defaultOpen:o=!1}){const[c,d]=p.useState(o);return e.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[e.jsxs("button",{type:"button",onClick:()=>d(x=>!x),className:"w-full flex items-center justify-between px-4 py-3 bg-surface-inset/50 hover:bg-surface-inset transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(r,{size:13,className:"text-content-tertiary"}),e.jsx("span",{className:"text-xs font-semibold text-content-secondary",children:s})]}),e.jsx(kt,{size:13,className:O("text-content-tertiary transition-transform duration-200",c&&"rotate-180")})]}),c&&e.jsx("div",{className:"px-4 py-3 border-t border-border bg-surface",children:a})]})}function U2({content:s,onClose:r}){const[a,o]=p.useState(!1);return e.jsxs("div",{className:O("rounded-xl border overflow-hidden transition-all animate-fade-in","border-indigo-200/50 bg-gradient-to-br from-indigo-50/40 via-surface to-violet-50/20"),children:[e.jsxs("div",{className:"px-3 pt-3 pb-1.5 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-indigo-100/80 text-indigo-700 text-xs font-bold",children:[e.jsx(wa,{size:11})," ",s.issueKey]}),e.jsx("span",{className:"px-2 py-0.5 rounded-md bg-surface-inset text-content-secondary text-[10px] font-semibold border border-border",children:s.issueType}),e.jsx("span",{className:"px-2 py-0.5 rounded-md bg-surface-inset text-content-secondary text-[10px] font-semibold border border-border",children:s.status}),e.jsx("span",{className:"px-2 py-0.5 rounded-md bg-amber-50 text-amber-700 text-[10px] font-semibold border border-amber-200/50",children:s.priority})]}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[e.jsx("button",{type:"button",onClick:()=>o(c=>!c),className:"text-indigo-500 hover:text-indigo-700 text-[10px] font-semibold px-2 py-1 rounded-md hover:bg-indigo-50 transition-colors",children:a?"Less":"More"}),e.jsx("button",{type:"button",onClick:r,className:"p-1 rounded-md text-content-tertiary hover:text-content-secondary hover:bg-surface-inset transition-colors",children:e.jsx(Fe,{size:13})})]})]}),e.jsx("p",{className:"font-semibold text-content text-xs leading-relaxed",children:s.summary})]}),e.jsxs("div",{className:O("px-3 pb-3 space-y-1.5",a?"overflow-y-auto max-h-[200px]":""),children:[s.description&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:"Description"}),e.jsx("p",{className:O("text-xs text-content-secondary leading-relaxed whitespace-pre-wrap",!a&&"line-clamp-3"),children:s.description})]}),s.acceptanceCriteria&&a&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:"Acceptance Criteria"}),e.jsx("p",{className:"text-xs text-content-secondary leading-relaxed whitespace-pre-wrap",children:s.acceptanceCriteria})]}),s.comments.length>0&&a&&e.jsxs("div",{children:[e.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:["Comments (",s.comments.length,")"]}),s.comments.map((c,d)=>e.jsx("p",{className:"text-xs text-content-secondary italic mt-1 whitespace-pre-wrap",children:c},d))]}),s.labels.length>0&&e.jsx("div",{className:"flex items-center gap-1 flex-wrap pt-1",children:s.labels.map(c=>e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-surface-inset text-content-tertiary text-[9px] font-medium border border-border",children:c},c))})]})]})}function $2({pct:s,size:r=64,stroke:a=5}){const o=(r-a)/2,c=2*Math.PI*o,d=c-s/100*c;return e.jsxs("svg",{width:r,height:r,className:"-rotate-90",children:[e.jsx("circle",{cx:r/2,cy:r/2,r:o,fill:"none",stroke:"currentColor",strokeWidth:a,className:"text-surface-inset"}),e.jsx("circle",{cx:r/2,cy:r/2,r:o,fill:"none",stroke:"url(#prog-grad)",strokeWidth:a,strokeLinecap:"round",strokeDasharray:c,strokeDashoffset:d,className:"transition-all duration-700 ease-out"}),e.jsx("defs",{children:e.jsxs("linearGradient",{id:"prog-grad",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--color-accent)"}),e.jsx("stop",{offset:"100%",stopColor:"var(--color-accent-light, #818cf8)"})]})})]})}const B2={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"},q2=[{icon:_f,label:"--- separator",example:`Story one
|
|
906
|
-
---
|
|
907
|
-
Story two`},{icon:Ov,label:"Numbered",example:`1. Story one
|
|
908
|
-
2. Story two`},{icon:fv,label:"JSON",example:'[{"story":"…","suiteName":"Auth"}]'},{icon:Ws,label:"CSV Upload",example:`story,suiteName
|
|
909
|
-
"Story","Auth"`}];function H2(){const[s,r]=p.useState("single"),a=Gs(),[o,c]=p.useState(""),[d,x]=p.useState(""),[,h]=p.useState(!1),[f,y]=p.useState(""),[g,j]=p.useState(null),[P,S]=p.useState(!0),[k,E]=p.useState(""),[R,v]=p.useState(3),[C,D]=p.useState([]),[M,w]=p.useState(null),[N,K]=p.useState(null),[_,ee]=p.useState(null),[$,G]=p.useState(""),[le,je]=p.useState([]),ke=p.useRef(null);p.useEffect(()=>{const W=_2(k),he=le.map(Le=>({story:[Le.summary,Le.description,Le.acceptanceCriteria].filter(Boolean).join(`
|
|
910
|
-
`),suiteName:Le.summary,jiraUrl:Le.issueKey}));D([...he,...W])},[k,le]);const[Ce,Re]=p.useState(""),[be,B]=p.useState(""),[X,L]=p.useState(""),[z,F]=p.useState(null),[ce,Y]=p.useState(""),ue=oe({mutationFn:W=>la.fetchJira(W),onSuccess:W=>{j(W),S(!0),H.success(`Fetched ${W.issueKey}: ${W.summary}`)},onError:W=>{j(null),H.error(W.message)}}),ye=oe({mutationFn:W=>la.fetchJira(W),onSuccess:W=>{if(le.some(he=>he.issueKey===W.issueKey)){H.error(`${W.issueKey} already added`);return}je(he=>[...he,W]),G(""),H.success(`Added ${W.issueKey}`)},onError:W=>{H.error(W.message)}}),Ae=oe({mutationFn:()=>(Rs.start("single",d||"Test Suite"),la.generate(o,d||void 0,f||void 0)),onSuccess:W=>{h(!0),Rs.done(W.suiteId,W.suiteName)},onError:W=>{Rs.error(W.message),H.error(W.message)}}),me=oe({mutationFn:()=>la.generateBulk(C,R),onSuccess:W=>H.success(`Processing ${W.total} stories…`),onError:W=>H.error(W.message)}),Ee=oe({mutationFn:()=>la.swaggerPreview(Ce),onSuccess:W=>{F(W),B(W.title?`${W.title} API Tests`:""),H.success(`Found ${W.totalEndpoints} endpoints`)},onError:W=>{F(null),H.error(W.message)}}),Ke=oe({mutationFn:()=>{Rs.start("swagger",be||"API Tests");const W=X.trim()?X.split(",").map(he=>he.trim()).filter(Boolean):void 0;return la.generateFromSwagger(Ce,be||void 0,W,ce)},onSuccess:W=>{Rs.done(W.suiteId,W.suiteName),H.success(`Generated ${W.endpointsFound} endpoint tests`)},onError:W=>{Rs.error(W.message),H.error(W.message)}});Wd("story:bulk-start",W=>{const he=W;ee(he.jobId),w({jobId:he.jobId,total:he.total,completed:0,failed:0,currentIndex:0,currentStory:""}),K(null)}),Wd("story:bulk-progress",W=>{const he=W;he.jobId===_&&w(he)}),Wd("story:bulk-done",W=>{const he=W;he.jobId===_&&(K(he),w(null),he.failed===0?H.success(`All ${he.completed} suites generated!`):H.success(`${he.completed} done, ${he.failed} failed`))});const yt=W=>{const he=W.target.files?.[0];if(!he)return;const Le=new FileReader;Le.onload=bs=>{const bt=bs.target?.result;if(he.name.endsWith(".csv")){const ts=bt.split(`
|
|
911
|
-
`).slice(1).map(mt=>mt.split(",").map(ne=>ne.replace(/^"|"$/g,"").trim())).filter(mt=>mt[0]?.length>=10).map(mt=>({story:mt[0],suiteName:mt[1]||void 0}));E(ts.map((mt,ne)=>`${ne+1}. ${mt.story}`).join(`
|
|
912
|
-
`))}else E(bt)},Le.readAsText(he),W.target.value=""},qt=M?Math.round((M.completed+M.failed)/M.total*100):0,Xe=me.isPending||M!==null&&N===null,ie=Tp(f),Mt=zp(f),xt=Tp($),Ft=zp($),As=W=>je(he=>he.filter(Le=>Le.issueKey!==W)),ys=o.trim().length>=10||!!g&&!!f.trim();return e.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-8 h-8 rounded-xl bg-gradient-to-br from-violet-500 via-indigo-500 to-blue-600 flex items-center justify-center shadow-sm shadow-indigo-500/20",children:e.jsx(Bt,{size:16,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-base font-bold text-content tracking-tight",children:"Smart Tests"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"AI-powered test generation from stories, Jira, or API specs"})]})]})}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 p-1 rounded-xl bg-surface border border-border shadow-xs",children:[e.jsx(su,{icon:Sr,title:"Single Story",desc:"Describe one user journey — AI creates the full test suite",active:s==="single",gradient:"bg-gradient-to-br from-violet-500 to-indigo-600",onClick:()=>r("single")}),e.jsx(su,{icon:Pr,title:"Bulk Import",desc:"Generate multiple suites at once from text, JSON, CSV, or Jira",tag:"batch",active:s==="bulk",gradient:"bg-gradient-to-br from-amber-500 to-orange-600",onClick:()=>r("bulk")}),e.jsx(su,{icon:Wu,title:"API Import",desc:"Import OpenAPI / Swagger specs to auto-generate API tests",tag:"api",active:s==="swagger",gradient:"bg-gradient-to-br from-emerald-500 to-teal-600",onClick:()=>r("swagger")})]}),s==="single"&&e.jsxs("div",{className:"grid grid-cols-5 gap-3 animate-fade-in",children:[e.jsxs("div",{className:"col-span-3 space-y-3",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 rounded bg-indigo-100 flex items-center justify-center",children:e.jsx(jl,{size:14,className:"text-indigo-600"})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[11px] font-bold text-content",children:"Jira Integration"}),e.jsx("span",{className:"ml-2 text-[10px] text-content-tertiary font-medium",children:"Optional"})]})]}),g&&!P&&e.jsxs("button",{type:"button",onClick:()=>S(!0),className:"flex items-center gap-1 text-[10px] text-indigo-600 hover:text-indigo-700 font-semibold",children:[e.jsx(ka,{size:10})," Show ",g.issueKey]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx("input",{className:O("w-full rounded-xl px-3 py-2 text-xs transition-all border focus:outline-none focus:ring-2 placeholder-content-tertiary",f.trim()?ie?"border-indigo-300 focus:ring-indigo-300 bg-indigo-50/20":"border-red-300 focus:ring-red-300 bg-red-50/20":"border-border bg-surface-inset/50 focus:ring-accent/30 focus:border-accent/50"),placeholder:"PROJ-123 or paste full Jira URL",value:f,onChange:W=>{y(W.target.value),W.target.value.trim()||j(null)}}),Mt&&ie&&e.jsx("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-[10px] font-mono font-bold text-indigo-600 bg-indigo-100 px-2 py-0.5 rounded-md",children:Mt})]}),e.jsxs(ve,{variant:"secondary",size:"sm",onClick:()=>ue.mutate(f),loading:ue.isPending,disabled:!f.trim()||!ie||ue.isPending,children:[e.jsx(Od,{size:14})," Fetch"]})]}),f.trim()&&!ie&&e.jsxs("p",{className:"text-[10px] text-red-500 flex items-center gap-1",children:[e.jsx(gs,{size:10})," Invalid format — use PROJ-123 or full Jira URL"]}),g&&P&&e.jsx(U2,{content:g,onClose:()=>S(!1)})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 rounded bg-violet-100 flex items-center justify-center",children:e.jsx(Ws,{size:14,className:"text-violet-600"})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[11px] font-bold text-content",children:"User Story"}),g?e.jsx("span",{className:"ml-2 text-[10px] text-content-tertiary font-medium",children:"Optional — Jira content used"}):e.jsx("span",{className:"ml-1 text-red-400 text-xs",children:"*"})]})]}),e.jsx("textarea",{className:"w-full rounded-xl border border-border bg-surface-inset/50 p-4 text-sm text-content leading-relaxed focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/50 resize-vertical min-h-[80px] placeholder-content-tertiary transition-all",rows:g?3:5,placeholder:g?"Add extra context or leave blank — Jira content is enough":`Describe the user journey you want to automate…
|
|
913
|
-
|
|
914
|
-
Example: User logs in with valid credentials, navigates to the dashboard, and verifies that the welcome message is displayed.`,value:o,onChange:W=>{c(W.target.value),h(!1)}})]}),e.jsx("div",{className:"rounded-xl border border-border bg-surface p-3.5",children:e.jsxs("div",{className:"flex items-end gap-3",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("label",{className:"text-[11px] font-bold text-content mb-2 block",children:["Suite Name ",e.jsx("span",{className:"text-content-tertiary font-normal text-[10px]",children:"(AI auto-suggests if blank)"})]}),e.jsx("input",{className:"w-full rounded-xl border border-border bg-surface-inset/50 px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/50 placeholder-content-tertiary transition-all",placeholder:g?`e.g. ${g.summary}`:"e.g. Authentication Tests",value:d,onChange:W=>x(W.target.value)})]}),e.jsxs(ve,{onClick:()=>Ae.mutate(),loading:Ae.isPending,disabled:!ys,children:[e.jsx(Bt,{size:14})," Generate Suite"]})]})})]}),e.jsxs("div",{className:"col-span-2 space-y-3",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ct,{size:13,className:"text-amber-500"}),e.jsx("span",{className:"text-[11px] font-bold text-content",children:"Quick Start"})]}),e.jsx("div",{className:"space-y-2",children:F2.map((W,he)=>e.jsxs("button",{type:"button",onClick:()=>{c(W.story),h(!1)},className:"w-full text-left px-3 py-2 rounded-lg border border-border bg-surface-inset/30 hover:bg-accent/[0.04] hover:border-accent/30 transition-all group",children:[e.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[e.jsx("span",{className:"text-[10px] font-bold text-content group-hover:text-accent transition-colors",children:W.title}),e.jsx(xv,{size:11,className:"text-content-tertiary group-hover:text-accent transition-colors"})]}),e.jsx("p",{className:"text-[10px] text-content-tertiary leading-snug line-clamp-2",children:W.story})]},he))})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(mp,{size:13,className:"text-accent"}),e.jsx("span",{className:"text-[11px] font-bold text-content",children:"Pro Tips"})]}),e.jsx("div",{className:"space-y-2",children:["Paste a Jira link to auto-fetch story details","Write in plain English — describe the full journey","Include expected outcomes for better assertions","Combine Jira + extra context for best results"].map((W,he)=>e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(gr,{size:9,className:"text-accent flex-shrink-0 mt-1"}),e.jsx("span",{className:"text-[11px] text-content-tertiary leading-relaxed",children:W})]},he))})]})]})]}),s==="bulk"&&e.jsxs("div",{className:"space-y-3 animate-fade-in",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 rounded bg-indigo-100 flex items-center justify-center",children:e.jsx(jl,{size:14,className:"text-indigo-600"})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[11px] font-bold text-content",children:"Fetch from Jira"}),e.jsx("span",{className:"ml-2 text-[10px] text-content-tertiary",children:"Paste URL → Fetch → repeat"})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx("input",{className:O("w-full rounded-xl px-3.5 py-2 text-sm border transition-all focus:outline-none focus:ring-2 placeholder-content-tertiary",$.trim()?xt?"border-indigo-300 focus:ring-indigo-300 bg-indigo-50/20":"border-red-300 focus:ring-red-300 bg-red-50/20":"border-border bg-surface-inset/50 focus:ring-accent/30"),placeholder:"PROJ-123 or Jira URL",value:$,onChange:W=>G(W.target.value),onKeyDown:W=>{W.key==="Enter"&&$.trim()&&xt&&!ye.isPending&&!Xe&&ye.mutate($)},disabled:Xe}),Ft&&xt&&e.jsx("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-[10px] font-mono font-bold text-indigo-600 bg-indigo-100 px-2 py-0.5 rounded-md",children:Ft})]}),e.jsxs(ve,{variant:"secondary",size:"sm",onClick:()=>ye.mutate($),loading:ye.isPending,disabled:!$.trim()||!xt||ye.isPending||Xe,children:[e.jsx(Od,{size:14})," Fetch"]})]}),$.trim()&&!xt&&e.jsxs("p",{className:"text-[10px] text-red-500 flex items-center gap-1",children:[e.jsx(gs,{size:10})," Invalid Jira URL format"]}),le.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5 pt-1",children:le.map(W=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-indigo-50 border border-indigo-200/60 text-xs text-indigo-700 transition-all hover:shadow-sm",title:W.summary,children:[e.jsx(wa,{size:9,className:"text-indigo-400"}),e.jsx("span",{className:"font-mono font-bold text-[10px]",children:W.issueKey}),e.jsx("span",{className:"max-w-[120px] truncate text-[10px]",children:W.summary}),!Xe&&e.jsx("button",{type:"button",onClick:()=>As(W.issueKey),className:"text-indigo-300 hover:text-red-500 transition-colors",children:e.jsx(Fe,{size:10})})]},W.issueKey))})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 rounded bg-amber-100 flex items-center justify-center",children:e.jsx(Ws,{size:14,className:"text-amber-600"})}),e.jsx("span",{className:"text-[11px] font-bold text-content",children:"Supported Formats"})]}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:q2.map(({icon:W,label:he,example:Le})=>e.jsxs("div",{className:"p-2.5 rounded-xl bg-surface-inset/50 border border-border",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[e.jsx(W,{size:10,className:"text-content-tertiary"}),e.jsx("span",{className:"text-[10px] font-bold text-content-secondary",children:he})]}),e.jsx("pre",{className:"text-[9px] text-content-tertiary font-mono leading-relaxed whitespace-pre-wrap line-clamp-2",children:Le})]},he))})]})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-3 bg-surface-inset/30 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-xs text-content-secondary",children:C.length>0?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-bold text-accent tabular-nums",children:C.length})," stories",le.length>0&&e.jsxs("span",{className:"text-content-tertiary ml-1",children:["(",le.length," Jira",C.length-le.length>0?` + ${C.length-le.length} manual`:"",")"]})]}):e.jsx("span",{className:"text-content-tertiary",children:"No stories yet"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Parallel"}),e.jsx("select",{className:"text-xs border border-border rounded-lg px-2 py-1 bg-surface focus:outline-none focus:ring-2 focus:ring-accent/30",value:R,onChange:W=>v(Number(W.target.value)),disabled:Xe,children:[1,2,3,4,5].map(W=>e.jsxs("option",{value:W,children:[W,"×"]},W))})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{ref:ke,type:"file",accept:".txt,.csv,.json",className:"hidden",onChange:yt}),e.jsxs(ve,{variant:"secondary",size:"sm",onClick:()=>ke.current?.click(),disabled:Xe,children:[e.jsx(Ul,{size:12})," Upload"]}),e.jsxs(ve,{size:"sm",onClick:()=>{K(null),me.mutate()},loading:me.isPending,disabled:C.length===0||Xe,children:[e.jsx(ct,{size:13})," Generate ",C.length>0?C.length:""," Suites"]})]})]}),e.jsxs("div",{className:"min-h-[220px]",children:[!Xe&&!N&&e.jsx("textarea",{className:"w-full h-[220px] p-4 text-xs text-content leading-relaxed focus:outline-none resize-none font-mono placeholder-content-tertiary bg-transparent",placeholder:`Paste your stories here…
|
|
915
|
-
|
|
916
|
-
Use --- separators, numbered lists, or JSON array format.
|
|
917
|
-
Or fetch from Jira above.`,value:k,onChange:W=>E(W.target.value),disabled:Xe}),Xe&&M&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx($2,{pct:qt,size:72,stroke:5}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsxs("span",{className:"text-sm font-bold text-content tabular-nums",children:[qt,"%"]})})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-sm font-semibold text-content",children:"Generating suites…"}),e.jsxs("p",{className:"text-xs text-content-tertiary mt-1",children:[M.completed+M.failed," of ",M.total," complete"]})]}),e.jsx("div",{className:"flex gap-5",children:[["Total",M.total,"text-content"],["Done",M.completed,"text-emerald-600"],["Failed",M.failed,"text-red-500"]].map(([W,he,Le])=>e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:`text-lg font-bold tabular-nums ${Le}`,children:he}),e.jsx("p",{className:"text-[9px] text-content-tertiary font-semibold uppercase tracking-wider",children:W})]},String(W)))}),M.currentStory&&e.jsxs("div",{className:"max-w-md mx-auto flex items-start gap-2 p-3 bg-accent/5 rounded-xl border border-accent/10",children:[e.jsx(ct,{size:12,className:"text-accent flex-shrink-0 mt-0.5"}),e.jsxs("p",{className:"text-[11px] text-content-secondary line-clamp-2",children:[e.jsxs("span",{className:"font-semibold",children:["#",M.currentIndex+1,":"]})," ",M.currentStory]})]})]}),N&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-4",children:[e.jsx("div",{className:O("w-10 h-10 rounded-xl flex items-center justify-center",N.failed===0?"bg-emerald-100":"bg-amber-100"),children:N.failed===0?e.jsx(He,{size:20,className:"text-emerald-600"}):e.jsx(gs,{size:20,className:"text-amber-600"})}),e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-sm font-bold text-content",children:[N.completed," suites generated",N.failed>0?`, ${N.failed} failed`:" successfully"]}),e.jsx("p",{className:"text-xs text-content-tertiary mt-1",children:"Ready in Test Editor"})]}),e.jsx("div",{className:"flex gap-5",children:[["Total",N.total,"text-content"],["Generated",N.completed,"text-emerald-600"],["Failed",N.failed,"text-red-500"]].map(([W,he,Le])=>e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:`text-lg font-bold tabular-nums ${Le}`,children:he}),e.jsx("p",{className:"text-[9px] text-content-tertiary font-semibold uppercase tracking-wider",children:W})]},String(W)))}),N.failedItems.length>0&&e.jsx("div",{className:"w-full max-w-lg space-y-1.5 max-h-[140px] overflow-y-auto px-4",children:N.failedItems.map(W=>e.jsxs("div",{className:"flex items-start gap-2 p-2.5 bg-red-50/60 rounded-xl border border-red-200/40",children:[e.jsx(St,{size:12,className:"text-red-500 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] text-red-700 font-medium line-clamp-1",children:W.story}),e.jsx("p",{className:"text-[10px] text-red-400 mt-0.5",children:W.error})]})]},W.index))}),e.jsxs("div",{className:"flex gap-2 pt-2",children:[e.jsxs(ve,{size:"sm",onClick:()=>a("/tests"),children:["Open Test Editor ",e.jsx(Zt,{size:13})]}),e.jsxs(ve,{variant:"secondary",size:"sm",onClick:()=>{K(null),E(""),je([])},children:[e.jsx(Fe,{size:13})," Start Over"]})]})]})]})]})]}),s==="swagger"&&e.jsxs("div",{className:"space-y-3 animate-fade-in",children:[e.jsx("div",{className:"flex items-center gap-2.5 px-1",children:[{n:1,label:"Fetch Spec",done:!!z},{n:2,label:"Configure",done:!1},{n:3,label:"Generate",done:!1}].map((W,he,Le)=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:O("w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-bold transition-all",W.done?"bg-emerald-500 text-white":"bg-surface-inset text-content-tertiary border border-border"),children:W.done?e.jsx(He,{size:12}):W.n}),e.jsx("span",{className:O("text-xs font-semibold",W.done?"text-emerald-600":"text-content-tertiary"),children:W.label})]}),he<Le.length-1&&e.jsx("div",{className:O("w-12 h-px",W.done?"bg-emerald-300":"bg-border")})]},W.n))}),e.jsxs("div",{className:"grid grid-cols-5 gap-3",children:[e.jsxs("div",{className:"col-span-3 rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("div",{className:"w-5 h-5 rounded bg-emerald-100 flex items-center justify-center",children:e.jsx(Gn,{size:14,className:"text-emerald-600"})}),e.jsx("span",{className:"text-[11px] font-bold text-content",children:"API Specification URL"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{className:"flex-1 rounded-xl border border-border bg-surface-inset/50 px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/50 placeholder-content-tertiary transition-all",placeholder:"https://api.example.com/v2/api-docs",value:Ce,onChange:W=>{Re(W.target.value),F(null)}}),e.jsxs(ve,{variant:"secondary",size:"sm",onClick:()=>Ee.mutate(),loading:Ee.isPending,disabled:!Ce.trim()||Ee.isPending,children:[e.jsx(Od,{size:14})," Fetch & Parse"]})]}),Ee.isError&&e.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-xl bg-red-50/60 border border-red-200/40 text-xs text-red-600",children:[e.jsx(St,{size:13,className:"flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:Ee.error.message}),e.jsx("p",{className:"text-[10px] text-red-400 mt-0.5",children:"Tip: Use the direct spec URL, not a portal page. Check DevTools → Network."})]})]})]}),e.jsxs("div",{className:"col-span-2 rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("div",{className:"w-5 h-5 rounded bg-violet-100 flex items-center justify-center",children:e.jsx(Ws,{size:14,className:"text-violet-600"})}),e.jsx("span",{className:"text-[11px] font-bold text-content",children:"Extra Requirements"}),e.jsx("span",{className:"text-[10px] text-content-tertiary",children:"Optional"})]}),e.jsx("textarea",{className:"w-full rounded-xl border border-border bg-surface-inset/50 px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-accent/30 resize-none placeholder-content-tertiary leading-relaxed",rows:3,placeholder:"e.g. Include Bearer auth, test 400/401/404 errors, validate response schemas…",value:ce,onChange:W=>Y(W.target.value)})]})]}),z&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"rounded-xl border border-emerald-200/50 bg-gradient-to-r from-emerald-50/40 via-surface to-teal-50/20 p-3.5 space-y-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-6 h-6 rounded-lg bg-emerald-500 flex items-center justify-center",children:e.jsx(He,{size:13,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold text-content",children:z.title}),e.jsx("p",{className:"text-[10px] text-content-tertiary mt-0.5",children:z.baseUrl})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"text-center px-3",children:[e.jsx("p",{className:"text-base font-bold text-emerald-600 tabular-nums",children:z.totalEndpoints}),e.jsx("p",{className:"text-[8px] font-bold text-content-tertiary uppercase tracking-widest",children:"Endpoints"})]}),e.jsx("div",{className:"w-px h-6 bg-border"}),e.jsxs("div",{className:"text-center px-2",children:[e.jsx("p",{className:"text-base font-bold text-teal-600 tabular-nums",children:z.tags.length}),e.jsx("p",{className:"text-[8px] font-bold text-content-tertiary uppercase tracking-widest",children:"Tags"})]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(qf,{size:11,className:"text-content-tertiary"}),e.jsx("span",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest",children:"Filter by tag"}),X.trim()&&e.jsx("button",{type:"button",onClick:()=>L(""),className:"text-[9px] text-accent hover:text-accent-dark font-semibold ml-1",children:"Clear all"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:z.tags.map(W=>{const he=X.split(",").map(bt=>bt.trim()).filter(Boolean),Le=he.includes(W),bs=z.endpoints.filter(bt=>bt.tag===W).length;return e.jsxs("button",{type:"button",onClick:()=>{L(Le?he.filter(bt=>bt!==W).join(", "):[...he,W].join(", "))},className:O("inline-flex items-center gap-1.5 text-[10px] px-2.5 py-1.5 rounded-lg border font-semibold transition-all",Le?"bg-accent text-white border-accent shadow-sm shadow-accent/20":"bg-surface text-content-secondary border-border hover:border-accent/40"),children:[W,e.jsx("span",{className:O("text-[9px] px-1 py-px rounded font-bold",Le?"bg-white/20 text-white":"bg-surface-inset text-content-tertiary"),children:bs})]},W)})})]})]}),e.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:e.jsx("div",{className:"max-h-[220px] overflow-y-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{className:"bg-surface-inset/50 sticky top-0 border-b border-border",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left px-4 py-2.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest w-20",children:"Method"}),e.jsx("th",{className:"text-left px-4 py-2.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Path"}),e.jsx("th",{className:"text-left px-4 py-2.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Summary"}),e.jsx("th",{className:"text-left px-4 py-2.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest w-16",children:"Tag"})]})}),e.jsx("tbody",{children:z.endpoints.filter(W=>X.trim()?X.split(",").map(he=>he.trim()).filter(Boolean).includes(W.tag):!0).map((W,he)=>e.jsxs("tr",{className:"border-t border-border-muted hover:bg-surface-inset/30 transition-colors",children:[e.jsx("td",{className:"px-4 py-2.5",children:e.jsx("span",{className:O("font-mono font-bold text-[10px] px-2 py-0.5 rounded-md ring-1",B2[W.method]||"bg-surface-inset text-content-secondary ring-border"),children:W.method})}),e.jsx("td",{className:"px-4 py-2.5 font-mono text-content-secondary text-[11px]",children:W.path}),e.jsx("td",{className:"px-4 py-2.5 text-content-tertiary truncate max-w-[240px]",children:W.summary}),e.jsx("td",{className:"px-4 py-2.5",children:e.jsx("span",{className:"text-[9px] text-content-tertiary bg-surface-inset px-1.5 py-0.5 rounded",children:W.tag})})]},he))})]})})}),e.jsx("div",{className:"rounded-xl border border-border bg-surface p-3.5",children:e.jsxs("div",{className:"flex items-end gap-3",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"text-[11px] font-bold text-content mb-2 block",children:"Suite Name"}),e.jsx("input",{className:"w-full rounded-xl border border-border bg-surface-inset/50 px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-accent/30 placeholder-content-tertiary",placeholder:"e.g. Payment API Tests",value:be,onChange:W=>B(W.target.value)})]}),e.jsxs(ve,{onClick:()=>Ke.mutate(),loading:Ke.isPending,disabled:Ke.isPending,children:[e.jsx(Bt,{size:14})," Generate Suite"]})]})})]}),Ke.isError&&e.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-red-50/60 border border-red-200/40 text-xs text-red-600",children:[e.jsx(St,{size:14,className:"flex-shrink-0 mt-0.5"}),e.jsx("span",{className:"font-medium",children:Ke.error.message})]}),!z&&e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(Ap,{title:"Supported Formats",icon:mp,defaultOpen:!0,children:e.jsx("div",{className:"space-y-1.5",children:["OpenAPI 3.x (JSON / YAML)","Swagger 2.0 (JSON / YAML)","Direct URL, Swagger UI, or /api-docs"].map(W=>e.jsxs("div",{className:"flex items-center gap-2 text-xs text-content-secondary",children:[e.jsx(He,{size:10,className:"text-emerald-500 flex-shrink-0"}),W]},W))})}),e.jsx(Ap,{title:"Pro Tips",icon:ct,defaultOpen:!0,children:e.jsx("div",{className:"space-y-1.5",children:["Use the raw spec URL, not a portal page","Filter by tags to import only relevant endpoints","Generated steps use page.request API","Chained tests use context.setVariable"].map(W=>e.jsxs("div",{className:"flex items-start gap-2 text-xs text-content-secondary",children:[e.jsx(gr,{size:9,className:"text-accent flex-shrink-0 mt-0.5"}),W]},W))})})]})]})]})})})}function va({checked:s,onChange:r,label:a,disabled:o}){return e.jsxs("label",{className:O("inline-flex items-center gap-2.5 cursor-pointer select-none",o&&"opacity-40 cursor-not-allowed"),children:[e.jsx("button",{type:"button",role:"switch","aria-checked":s,disabled:o,onClick:()=>r(!s),className:O("relative inline-flex h-[22px] w-10 items-center rounded-full transition-all duration-200","focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus:outline-none",s?"bg-gradient-to-r from-accent to-accent-dark":"bg-slate-200"),children:e.jsx("span",{className:O("inline-block h-4 w-4 rounded-full bg-white shadow-sm transition-transform duration-200",s?"translate-x-[21px]":"translate-x-[3px]")})}),a&&e.jsx("span",{className:"text-sm text-content-secondary",children:a})]})}const K2=[{id:"github",label:"GitHub Actions"},{id:"gitlab",label:"GitLab CI"},{id:"jenkins",label:"Jenkins"}];function W2({open:s,onClose:r,runConfig:a}){const[o,c]=p.useState("github"),[d,x]=p.useState(!1),[h,f]=p.useState(""),[y,g]=p.useState(!1),[j,P]=p.useState(!1),{data:S}=Oe({queryKey:["config"],queryFn:Cr.get}),k=S?.ci?.writeToRepo??!1,E=w=>({platform:w,browsers:a?.browsers??["chromium"],parallel:a?.parallel??2,device:a?.device||void 0}),R=oe({mutationFn:w=>bp.generate(E(w)),onSuccess:w=>{f(w.yaml),g(!1),P(!1)},onError:w=>H.error(w.message)}),v=oe({mutationFn:w=>bp.writeToRepo({...E(w),yaml:h}),onSuccess:w=>H.success(`Written to ${w.path} — review & commit in Git Control`),onError:w=>H.error(w.message)});p.useEffect(()=>{s&&R.mutate(o)},[s,o]);const C=()=>R.mutate(o),D=()=>{h&&navigator.clipboard.writeText(h).then(()=>{x(!0),H.success("Copied to clipboard"),setTimeout(()=>x(!1),2e3)})},M=()=>{if(!h)return;const w=new Blob([h],{type:"text/plain"}),N=URL.createObjectURL(w),K=document.createElement("a");K.href=N,K.download=R.data?.filename??`${o}-ci.yml`,document.body.appendChild(K),K.click(),document.body.removeChild(K),URL.revokeObjectURL(N)};return s?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:r,children:e.jsxs("div",{className:"bg-surface rounded-2xl border border-border shadow-modal w-full max-w-2xl mx-4 overflow-hidden flex flex-col max-h-[85vh]",onClick:w=>w.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border flex-shrink-0",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-bold text-content",children:"CI Config Generator"}),e.jsx("p",{className:"text-[11px] text-content-tertiary mt-0.5",children:"Generate configuration for your CI/CD pipeline"})]}),e.jsx("button",{type:"button",onClick:r,className:"p-1.5 rounded-lg text-content-tertiary hover:bg-surface-inset hover:text-content transition-colors",children:e.jsx(Fe,{size:14})})]}),e.jsx("div",{className:"flex border-b border-border px-5 flex-shrink-0",children:K2.map(w=>e.jsx("button",{type:"button",onClick:()=>c(w.id),className:O("px-4 py-2.5 text-xs font-semibold border-b-2 transition-colors -mb-px",o===w.id?"border-accent text-accent":"border-transparent text-content-secondary hover:text-content"),children:w.label},w.id))}),e.jsx("div",{className:"flex-1 overflow-y-auto p-5 min-h-0",children:R.isPending?e.jsx("div",{className:"h-48 flex items-center justify-center",children:e.jsx("p",{className:"text-sm text-content-tertiary",children:"Generating..."})}):e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("p",{className:"text-[11px] text-content-tertiary",children:[j?"Editing — your changes apply to Copy, Download & Write to repo.":"Preview. Click Edit to customise the YAML.",y&&!j&&e.jsx("span",{className:"ml-1 text-amber-500",children:"(edited)"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[y&&e.jsxs("button",{type:"button",onClick:C,className:"flex items-center gap-1 text-[11px] text-content-tertiary hover:text-content transition-colors",title:"Discard edits and regenerate from current run config",children:[e.jsx(_i,{size:11})," Reset"]}),e.jsx("button",{type:"button",onClick:()=>P(w=>!w),className:O("flex items-center gap-1 text-[11px] transition-colors",j?"text-accent":"text-content-tertiary hover:text-content"),title:j?"Finish editing":"Edit the YAML",children:j?e.jsxs(e.Fragment,{children:[e.jsx(Qe,{size:11})," Done"]}):e.jsxs(e.Fragment,{children:[e.jsx(mn,{size:11})," Edit"]})})]})]}),e.jsx("textarea",{value:h,onChange:w=>{f(w.target.value),g(!0)},readOnly:!j,spellCheck:!1,className:O("w-full h-72 bg-[#1e1e2e] text-[#cdd6f4] text-xs font-mono p-4 rounded-xl overflow-auto whitespace-pre leading-relaxed resize-y border focus:outline-none",j?"border-accent focus:ring-1 focus:ring-accent cursor-text":"border-border cursor-default")})]})}),e.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-t border-border bg-surface-inset/30 flex-shrink-0",children:[R.data?.filename&&e.jsx("span",{className:"text-[11px] text-content-tertiary font-mono",children:R.data.filename}),e.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[e.jsxs("button",{type:"button",onClick:D,disabled:!h,className:O("flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors","border-border text-content-secondary hover:bg-surface-inset disabled:opacity-40"),children:[d?e.jsx(Qe,{size:12,className:"text-emerald-500"}):e.jsx(Vu,{size:12}),d?"Copied!":"Copy"]}),e.jsxs("button",{type:"button",onClick:M,disabled:!h,className:O("flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-colors disabled:opacity-40",k?"border border-border text-content-secondary hover:bg-surface-inset":"bg-accent text-white hover:brightness-110"),children:[e.jsx(ga,{size:12}),"Download"]}),k&&e.jsxs("button",{type:"button",onClick:()=>v.mutate(o),disabled:!h||v.isPending,title:"Write this file into the repo at its standard path",className:O("flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-colors","bg-accent text-white hover:brightness-110 disabled:opacity-40"),children:[e.jsx(br,{size:12}),v.isPending?"Writing…":"Write to repo"]})]})]})]})}):null}const Op=500;let Pl=new Map,Ii=new Map,Nr=[],ax=0;const zu=new Set;function Au(){ax++,zu.forEach(s=>s())}let Rl={screenshot:null,screenshots:new Map,consoleLogs:[],consoleLogsByCase:new Map,activeCaseIds:[],_v:-1};function V2(){const s=Nr[Nr.length-1],r=s?Pl.get(s)??null:null,a=Array.from(Ii.values()).flat().sort((o,c)=>o.timestamp-c.timestamp);return Rl={screenshot:r,screenshots:new Map(Pl),consoleLogs:a,consoleLogsByCase:new Map(Ii),activeCaseIds:[...Nr],_v:ax},Rl}const nu={subscribe(s){return zu.add(s),()=>{zu.delete(s)}},getSnapshot(){return Rl._v!==ax?V2():Rl},reset(){Pl=new Map,Ii=new Map,Nr=[],Au()}};function Ng(){const s=p.useSyncExternalStore(nu.subscribe,nu.getSnapshot),r=p.useCallback(c=>{const d=c;Pl.set(d.caseId,d.image),Nr.includes(d.caseId)||(Nr=[...Nr,d.caseId]),Au()},[]),a=p.useCallback(c=>{const d=c,h=[...Ii.get(d.caseId)??[],...d.logs];h.length>Op&&h.splice(0,h.length-Op),Ii.set(d.caseId,h),Au()},[]);Ar({"run:screenshot":r,"run:console":a});const o=p.useCallback(()=>{nu.reset()},[]);return{screenshot:s.screenshot,screenshots:s.screenshots,consoleLogs:s.consoleLogs,consoleLogsByCase:s.consoleLogsByCase,activeCaseIds:s.activeCaseIds,reset:o}}let on=[],Ou=0;const Du=new Set;function Iu(){Ou++,Du.forEach(s=>s())}let ru={steps:[],_v:-1};const au={subscribe(s){return Du.add(s),()=>{Du.delete(s)}},getSnapshot(){return ru._v!==Ou&&(ru={steps:on,_v:Ou}),ru},reset(){on=[],Iu()}};function wg(){const s=p.useSyncExternalStore(au.subscribe,au.getSnapshot),r=p.useCallback(c=>{const d=c;if(d.status!=="running"){if(on.some(x=>x.stepId===d.stepId&&x.status===d.status))return;on=[...on,{...d,timestamp:Date.now()}],on.length>200&&(on=on.slice(-200)),Iu()}},[]),a=p.useCallback(()=>{on=[],Iu()},[]);Ar({"run:step":r,"run:start":a});const o=p.useCallback(()=>{au.reset()},[]);return{stepLogs:s.steps,reset:o}}function kg(s){const[r,a]=p.useState(0),o=p.useRef(null);p.useEffect(()=>(s?(a(0),o.current=setInterval(()=>a(x=>x+1),1e3)):o.current&&(clearInterval(o.current),o.current=null),()=>{o.current&&clearInterval(o.current)}),[s]);const c=Math.floor(r/60).toString().padStart(2,"0"),d=(r%60).toString().padStart(2,"0");return`${c}:${d}`}function Bi({browser:s,size:r=16,className:a=""}){const o=(s??"").toLowerCase();return o.includes("chromium")||o.includes("chrome")?e.jsxs("svg",{width:r,height:r,viewBox:"0 0 48 48",className:a,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("circle",{cx:"24",cy:"24",r:"22",fill:"#4285F4"}),e.jsx("path",{d:"M24 14.4h16.97A22 22 0 0 0 24 2 22 22 0 0 0 5.56 33.6L14.08 19A11.6 11.6 0 0 1 24 14.4z",fill:"#EA4335"}),e.jsx("path",{d:"M14.08 19L5.56 33.6A22 22 0 0 0 24 46a22 22 0 0 0 8.52-1.7L24 30.4A11.6 11.6 0 0 1 14.08 19z",fill:"#34A853"}),e.jsx("path",{d:"M24 30.4l8.52 13.9A22 22 0 0 0 40.97 14.4H24a11.6 11.6 0 0 1 8.52 16z",fill:"#FBBC05"}),e.jsx("circle",{cx:"24",cy:"24",r:"8",fill:"white"}),e.jsx("circle",{cx:"24",cy:"24",r:"5.5",fill:"#4285F4"})]}):o.includes("firefox")?e.jsxs("svg",{width:r,height:r,viewBox:"0 0 48 48",className:a,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("circle",{cx:"24",cy:"24",r:"22",fill:"#FF9500"}),e.jsx("path",{d:"M38 16c-1-3-3.5-5.5-5-6.5.8 2 1 3.5.5 5-1-3-3-5-5.5-7.5-.5-.5-1-1-1-1.5 0-.2 0-.3-.2-.3-.1 0-.2.1-.2.2-3 5-1 9 .5 12-2-1-4.5-1-6.5 0-1-2-1-4.5 0-6.5-3 2-5 5-6 8-.2-.5-.3-1.5-.3-2-1.5 1.5-2.5 3.5-3 5.5A18 18 0 0 0 8 30c0 9 7.5 16 16 16s16-7 16-16c0-5-1-10-2-14z",fill:"#FF4500"}),e.jsx("path",{d:"M30 34c-1.5 1.5-4 2.5-6 2.5s-5-1-6.5-3A8 8 0 0 1 16 28c0-2.5 1.5-5 4-6 3-1.5 6-.5 8 1 2 1.5 3 4 3 6.5 0 1.5-.5 3-1 4.5z",fill:"#FFDC00"})]}):o.includes("webkit")||o.includes("safari")?e.jsxs("svg",{width:r,height:r,viewBox:"0 0 48 48",className:a,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("circle",{cx:"24",cy:"24",r:"22",fill:"url(#safari-grad)"}),e.jsx("circle",{cx:"24",cy:"24",r:"18",fill:"white",fillOpacity:"0.15"}),e.jsx("circle",{cx:"24",cy:"24",r:"17",stroke:"white",strokeOpacity:"0.3",strokeWidth:"0.5",fill:"none"}),e.jsx("polygon",{points:"24,8 26,24 24,40 22,24",fill:"white",fillOpacity:"0.9"}),e.jsx("polygon",{points:"24,8 26,24 24,24",fill:"#FF3B30"}),e.jsx("polygon",{points:"24,40 22,24 24,24",fill:"#FF3B30"}),e.jsx("circle",{cx:"24",cy:"24",r:"2.5",fill:"white"}),e.jsx("defs",{children:e.jsxs("linearGradient",{id:"safari-grad",x1:"0",y1:"0",x2:"48",y2:"48",children:[e.jsx("stop",{offset:"0%",stopColor:"#00D4FF"}),e.jsx("stop",{offset:"100%",stopColor:"#0066FF"})]})})]}):e.jsxs("svg",{width:r,height:r,viewBox:"0 0 48 48",className:a,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("circle",{cx:"24",cy:"24",r:"22",stroke:"#94a3b8",strokeWidth:"2",fill:"none"}),e.jsx("ellipse",{cx:"24",cy:"24",rx:"10",ry:"22",stroke:"#94a3b8",strokeWidth:"1.5",fill:"none"}),e.jsx("line",{x1:"2",y1:"24",x2:"46",y2:"24",stroke:"#94a3b8",strokeWidth:"1.5"}),e.jsx("line",{x1:"24",y1:"2",x2:"24",y2:"46",stroke:"#94a3b8",strokeWidth:"1.5"})]})}function ix(s){const r=(s??"").toLowerCase();return r.includes("chromium")||r.includes("chrome")?"Chromium":r.includes("firefox")?"Firefox":r.includes("webkit")||r.includes("safari")?"WebKit":s??"Browser"}const Sg=[{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}}],Cg=[{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}],Eg=[{id:"ipad-pro-11",name:'iPad Pro 11"',category:"tablet",viewport:{width:834,height:1194},playwrightDevice:"iPad Pro 11",recommendedBrowser:"webkit",dpr:2},{id:"ipad-gen7",name:"iPad (gen 7)",category:"tablet",viewport:{width:810,height:1080},playwrightDevice:"iPad (gen 7)",recommendedBrowser:"webkit",dpr:2},{id:"ipad-mini",name:"iPad Mini",category:"tablet",viewport:{width:768,height:1024},playwrightDevice:"iPad Mini",recommendedBrowser:"webkit",dpr:2},{id:"galaxy-tab-s4",name:"Galaxy Tab S4",category:"tablet",viewport:{width:712,height:1138},playwrightDevice:"Galaxy Tab S4",recommendedBrowser:"chromium",dpr:2.25}],Fu=[...Sg,...Cg,...Eg];function Pg(s){if(s)return Fu.find(r=>r.playwrightDevice===s)??Fu.find(r=>r.id===s)}const G2=[{mode:"all",label:"All Tests",desc:"Every suite & case",icon:Jv},{mode:"suite",label:"By Suite",desc:"Specific test suite",icon:Ws},{mode:"tag",label:"By Tag",desc:"Match by tag",icon:qf},{mode:"test",label:"Single Test",desc:"One test by name",icon:Ws}];function Q2(s=60){const[r,a]=p.useState(s),o=p.useRef(!1),c=p.useCallback(d=>{d.preventDefault(),o.current=!0;const x=f=>{if(!o.current)return;const g=d.target.parentElement.getBoundingClientRect(),j=(f.clientX-g.left)/g.width*100;a(Math.max(30,Math.min(80,j)))},h=()=>{o.current=!1,window.removeEventListener("mousemove",x),window.removeEventListener("mouseup",h)};window.addEventListener("mousemove",x),window.addEventListener("mouseup",h)},[]);return{leftPct:r,onMouseDown:c}}function J2(s=55){const[r,a]=p.useState(s),o=p.useRef(!1),c=p.useCallback(d=>{d.preventDefault(),o.current=!0;const x=f=>{if(!o.current)return;const g=d.target.parentElement.getBoundingClientRect(),j=(f.clientY-g.top)/g.height*100;a(Math.max(25,Math.min(75,j)))},h=()=>{o.current=!1,window.removeEventListener("mousemove",x),window.removeEventListener("mouseup",h)};window.addEventListener("mousemove",x),window.addEventListener("mouseup",h)},[]);return{topPct:r,onMouseDown:c}}const Dp={log:"text-slate-300",info:"text-blue-400",warn:"text-amber-400",error:"text-red-400",debug:"text-slate-500",default:"text-slate-400"},Ip={log:"text-slate-500",info:"text-blue-500",warn:"text-amber-500",error:"text-red-500",debug:"text-slate-600"};function Y2(){const[s,r]=p.useState("all"),[a,o]=p.useState(""),[c,d]=p.useState(""),[x,h]=p.useState(""),[f,y]=p.useState(["chromium"]),[g,j]=p.useState(!0),[P,S]=p.useState(!1),[k,E]=p.useState(2),[R,v]=p.useState("only-on-failure"),[C,D]=p.useState("off"),[M,w]=p.useState("off"),[N,K]=p.useState(""),[_,ee]=p.useState(!1),[$,G]=p.useState(!0),[le,je]=p.useState(!1),{data:ke=[]}=Oe({queryKey:["suites"],queryFn:()=>Rr.list()}),Ce=tx(),Re=Ng(),be=Kl(),B=be.runningSuiteId!==null||be.runningCaseIds.size>0,X=_||Ce.isRunning||B,L=kg(X),z=X||Ce.completed;p.useEffect(()=>{_&&(Ce.isRunning||Ce.completed)&&ee(!1)},[_,Ce.isRunning,Ce.completed]);const F=oe({mutationFn:me=>ba.start(me),onError:me=>{ee(!1),H.error(me.message)}}),ce=oe({mutationFn:()=>ba.stop(),onSuccess:()=>H.success("Stop signal sent — finishing current step…"),onError:()=>H.error("Failed to send stop signal")}),Y=me=>{y(Ee=>Ee.includes(me)?Ee.length>1?Ee.filter(Ke=>Ke!==me):Ee:[...Ee,me])},ue=()=>{Ce.reset(),Re.reset(),$t.clear(),ee(!0);const me={browsers:f,headed:g,noHealing:P,parallel:k,screenshot:R,video:C,trace:M};s==="all"&&(me.all=!0),s==="suite"&&a&&(me.suite=a),s==="tag"&&c&&(me.tag=c),s==="test"&&x&&(me.test=x),N&&(me.device=N),F.mutate(me)},ye=()=>{Ce.reset(),Re.reset(),$t.clear()},Ae=()=>{H.success("Browser is running in headed mode — check your taskbar")};return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:[z?e.jsx(Z2,{progress:Ce,live:Re,elapsed:L,runActive:X,onRunAgain:ye,onOpenExternal:Ae,onStop:()=>ce.mutate()}):e.jsx(X2,{mode:s,setMode:r,suiteId:a,setSuiteId:o,tag:c,setTag:d,testName:x,setTestName:h,browsers:f,toggleBrowser:Y,headed:g,setHeaded:j,noHealing:P,setNoHealing:S,parallel:k,setParallel:E,screenshot:R,setScreenshot:v,video:C,setVideo:D,trace:M,setTrace:w,device:N,setDevice:K,suites:ke,runActive:X,optionsOpen:$,setOptionsOpen:G,onRun:ue,submitting:_,onCiConfig:()=>je(!0)}),e.jsx(W2,{open:le,onClose:()=>je(!1),runConfig:{browsers:f,parallel:k,device:N||void 0}})]})}function X2(s){const{mode:r,setMode:a,suiteId:o,setSuiteId:c,tag:d,setTag:x,testName:h,setTestName:f,browsers:y,toggleBrowser:g,headed:j,setHeaded:P,noHealing:S,setNoHealing:k,parallel:E,setParallel:R,screenshot:v,setScreenshot:C,video:D,setVideo:M,trace:w,setTrace:N,device:K,setDevice:_,suites:ee,runActive:$,onRun:G,submitting:le,onCiConfig:je}=s,[ke,Ce]=p.useState("all"),Re=Pg(K||void 0),B=(Re?.category==="mobile"||Re?.category==="tablet")&&!y.includes("chromium"),X=ke==="all"?Fu:ke==="desktop"?Sg:ke==="mobile"?Cg:Eg;return e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[e.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-emerald-500 to-cyan-600 flex items-center justify-center shadow-sm shadow-emerald-500/20",children:e.jsx(Xt,{size:17,className:"text-white translate-x-0.5"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-sm font-bold text-content",children:"Run Configuration"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Configure and launch your test run"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ve,{size:"sm",variant:"secondary",onClick:je,children:"CI Config"}),e.jsxs(ve,{size:"sm",onClick:G,loading:le,disabled:$,children:[e.jsx(Xt,{size:10})," Start Run"]})]})]})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-5 gap-3",children:[e.jsxs("div",{className:"lg:col-span-3 space-y-3",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-3.5 py-2 bg-surface-inset/50 border-b border-border flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 rounded-md bg-gradient-to-br from-blue-500 to-indigo-600 flex items-center justify-center",children:e.jsx(ct,{size:10,className:"text-white"})}),e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Run Mode"})]}),e.jsxs("div",{className:"p-3 space-y-2.5",children:[e.jsx("div",{className:"grid grid-cols-2 gap-2",children:G2.map(({mode:L,label:z,desc:F,icon:ce})=>e.jsxs("button",{type:"button",onClick:()=>!$&&a(L),disabled:$,className:O("flex items-start gap-2 p-2.5 rounded-lg border text-left transition-all",$&&"opacity-50 cursor-not-allowed",r===L?"border-accent bg-accent/5 ring-1 ring-accent/20":"border-border hover:border-slate-300 hover:bg-surface-inset/30"),children:[e.jsx(ce,{size:12,className:O("flex-shrink-0 mt-0.5",r===L?"text-accent":"text-content-tertiary")}),e.jsxs("div",{children:[e.jsx("p",{className:O("text-[11px] font-semibold",r===L?"text-accent":"text-content-secondary"),children:z}),e.jsx("p",{className:"text-[9px] text-content-tertiary",children:F})]})]},L))}),r==="suite"&&!$&&e.jsxs("select",{value:o,onChange:L=>c(L.target.value),className:"w-full text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface",children:[e.jsx("option",{value:"",children:"Select a suite..."}),ee.map(L=>e.jsx("option",{value:L.name,children:L.name},L.id))]}),r==="tag"&&!$&&e.jsx("input",{className:"w-full text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"e.g. smoke",value:d,onChange:L=>x(L.target.value)}),r==="test"&&!$&&e.jsx("input",{className:"w-full text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"e.g. Login with valid credentials",value:h,onChange:L=>f(L.target.value)})]})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-3.5 py-2 bg-surface-inset/50 border-b border-border flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 rounded-md bg-gradient-to-br from-violet-500 to-purple-600 flex items-center justify-center",children:e.jsx(Gn,{size:10,className:"text-white"})}),e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Browsers"})]}),e.jsx("div",{className:"p-3",children:e.jsx("div",{className:"flex gap-2 flex-wrap",children:Wf.map(L=>e.jsxs("button",{type:"button",onClick:()=>!$&&g(L),disabled:$,className:O("flex items-center gap-1.5 px-3 py-1.5 rounded-lg border text-[11px] capitalize transition-all font-medium",$&&"opacity-50 cursor-not-allowed",y.includes(L)?"border-accent bg-accent/10 text-accent ring-1 ring-accent/20":"border-border text-content-secondary hover:border-slate-300"),children:[e.jsx(Bi,{browser:L,size:14}),ix(L)]},L))})})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-3.5 py-2 bg-surface-inset/50 border-b border-border flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 rounded-md bg-gradient-to-br from-teal-500 to-cyan-600 flex items-center justify-center",children:e.jsx(ji,{size:10,className:"text-white"})}),e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Device Emulation"}),Re&&e.jsxs("span",{className:"flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-teal-50 text-teal-600 ring-1 ring-teal-200 text-[9px] font-semibold",children:[Re.category==="mobile"?e.jsx(ji,{size:8}):Re.category==="tablet"?e.jsx(xl,{size:8}):e.jsx(yr,{size:8}),Re.name]})]}),Re&&e.jsx("button",{type:"button",onClick:()=>_(""),disabled:$,className:"text-content-tertiary hover:text-content-secondary transition-colors disabled:opacity-50",title:"Clear device",children:e.jsx(Fe,{size:12})})]}),e.jsxs("div",{className:"p-3 space-y-2.5",children:[B&&e.jsxs("div",{className:"flex items-start gap-2 px-2.5 py-2 rounded-lg bg-amber-50 border border-amber-200",children:[e.jsx(gs,{size:12,className:"text-amber-500 flex-shrink-0 mt-0.5"}),e.jsxs("p",{className:"text-[10px] text-amber-700 leading-relaxed",children:["Mobile/tablet emulation works best with ",e.jsx("strong",{children:"Chromium"}),". Touch events and mobile UA may not work correctly in Firefox or WebKit."]})]}),e.jsx("div",{className:"flex gap-1 p-0.5 bg-surface-inset rounded-lg",children:[{id:"all",label:"All",icon:null},{id:"desktop",label:"Desktop",icon:yr},{id:"mobile",label:"Mobile",icon:ji},{id:"tablet",label:"Tablet",icon:xl}].map(({id:L,label:z,icon:F})=>e.jsxs("button",{type:"button",onClick:()=>Ce(L),disabled:$,className:O("flex-1 flex items-center justify-center gap-1 py-1 rounded-md text-[9px] font-semibold transition-all disabled:opacity-50",ke===L?"bg-surface shadow-sm text-content":"text-content-tertiary hover:text-content-secondary"),children:[F&&e.jsx(F,{size:9}),z]},L))}),e.jsxs("div",{className:"grid grid-cols-2 gap-1.5 max-h-44 overflow-y-auto pr-0.5",children:[(ke==="all"||ke==="desktop")&&e.jsxs("button",{type:"button",onClick:()=>!$&&_(""),disabled:$,className:O("flex flex-col items-start gap-0.5 p-2 rounded-lg border text-left transition-all disabled:opacity-50",K?"border-border hover:border-slate-300 hover:bg-surface-inset/30":"border-teal-400 bg-teal-50 ring-1 ring-teal-300"),children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(yr,{size:10,className:K?"text-content-tertiary":"text-teal-500"}),e.jsx("span",{className:O("text-[10px] font-semibold",K?"text-content-secondary":"text-teal-600"),children:"No Emulation"})]}),e.jsx("span",{className:"text-[9px] text-content-tertiary",children:"Use config viewport"})]}),X.map(L=>{const z=K===(L.playwrightDevice??L.id),F=L.category==="mobile"?ji:L.category==="tablet"?xl:yr;return e.jsxs("button",{type:"button",onClick:()=>!$&&_(L.playwrightDevice??L.id),disabled:$,className:O("flex flex-col items-start gap-0.5 p-2 rounded-lg border text-left transition-all disabled:opacity-50",z?"border-teal-400 bg-teal-50 ring-1 ring-teal-300":"border-border hover:border-slate-300 hover:bg-surface-inset/30"),children:[e.jsxs("div",{className:"flex items-center gap-1 w-full",children:[e.jsx(F,{size:10,className:z?"text-teal-500":"text-content-tertiary"}),e.jsx("span",{className:O("text-[10px] font-semibold truncate flex-1",z?"text-teal-600":"text-content-secondary"),children:L.name}),L.recommendedBrowser&&L.category!=="desktop"&&e.jsx("span",{className:O("text-[8px] px-1 py-0.5 rounded font-medium flex-shrink-0",L.recommendedBrowser==="webkit"?"bg-slate-100 text-slate-500":"bg-blue-50 text-blue-500"),children:L.recommendedBrowser==="webkit"?"Safari":"Chrome"})]}),e.jsxs("span",{className:"text-[9px] text-content-tertiary",children:[L.viewport.width,"×",L.viewport.height,L.dpr?` @${L.dpr}x`:""]})]},L.id)})]})]})]})]}),e.jsxs("div",{className:"lg:col-span-2 space-y-3",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-3.5 py-2 bg-surface-inset/50 border-b border-border flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 rounded-md bg-gradient-to-br from-slate-500 to-slate-700 flex items-center justify-center",children:e.jsx(kr,{size:10,className:"text-white"})}),e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Options"})]}),e.jsxs("div",{className:"p-3 space-y-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-medium text-content-secondary",children:"Headed mode"}),e.jsx("p",{className:"text-[9px] text-content-tertiary",children:"Show browser window"})]}),e.jsx(va,{checked:j,onChange:P,disabled:$})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Xu,{size:10,className:"text-amber-500"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-medium text-content-secondary",children:"Disable self-healing"}),e.jsx("p",{className:"text-[9px] text-content-tertiary",children:"Skip AI healing"})]})]}),e.jsx(va,{checked:S,onChange:k,disabled:$})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Ev,{size:10,className:"text-blue-500"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-medium text-content-secondary",children:"Parallel workers"}),e.jsx("p",{className:"text-[9px] text-content-tertiary",children:"Concurrent cases"})]})]}),e.jsx("input",{type:"number",min:1,max:10,value:E,disabled:$,onChange:L=>R(Number(L.target.value)),className:"w-12 text-xs border border-border rounded-lg px-1.5 py-1 text-center focus:outline-none focus:ring-2 focus:ring-accent/30 disabled:opacity-50 bg-surface"})]})]})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-3.5 py-2 bg-surface-inset/50 border-b border-border flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 rounded-md bg-gradient-to-br from-pink-500 to-rose-600 flex items-center justify-center",children:e.jsx(Un,{size:10,className:"text-white"})}),e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Capture"})]}),e.jsx("div",{className:"p-3 space-y-2",children:[{label:"Screenshot",icon:Un,cls:"text-blue-400",val:v,set:C,opts:[["off","Off"],["on","Every test"],["only-on-failure","On failure"]]},{label:"Video",icon:$l,cls:"text-purple-400",val:D,set:M,opts:[["off","Off"],["on","Every test"],["on-first-retry","1st retry"],["retain-on-failure","On failure"]]},{label:"Trace",icon:Uf,cls:"text-emerald-400",val:w,set:N,opts:[["off","Off"],["on","Every test"],["on-first-retry","1st retry"],["retain-on-failure","On failure"]]}].map(({label:L,icon:z,cls:F,val:ce,set:Y,opts:ue})=>e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-content-secondary min-w-0 flex-shrink-0 font-medium",children:[e.jsx(z,{size:11,className:F}),L]}),e.jsx("select",{value:ce,disabled:$,onChange:ye=>Y(ye.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:ue.map(([ye,Ae])=>e.jsx("option",{value:ye,children:Ae},ye))})]},L))})]}),e.jsxs(ve,{size:"lg",onClick:G,loading:le,disabled:$,className:"w-full",children:[e.jsx(Xt,{size:14})," Start Test Run"]})]})]})]})})}function Z2({progress:s,live:r,elapsed:a,runActive:o,onRunAgain:c,onOpenExternal:d,onStop:x}){const{leftPct:h,onMouseDown:f}=Q2(60),{topPct:y,onMouseDown:g}=J2(55),j=p.useRef(null),[P,S]=p.useState("steps"),{stepLogs:k}=wg(),[E,R]=p.useState(null),v=r.activeCaseIds.length>1;p.useEffect(()=>{r.activeCaseIds.length>0&&!E&&R(r.activeCaseIds[0])},[r.activeCaseIds,E]);const C=v&&E?k.filter(M=>M.caseId===E):k,D=v&&E?r.consoleLogsByCase.get(E)??[]:r.consoleLogs;return p.useEffect(()=>{j.current?.scrollIntoView({behavior:"smooth"})},[C.length,D.length]),e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx(ew,{elapsed:a,runActive:o,progress:s,onRunAgain:c,onStop:x}),v?e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden relative",style:{minHeight:0},children:[e.jsxs("div",{className:"overflow-y-auto bg-slate-900 flex flex-col",style:{height:`${y}%`},children:[e.jsxs("div",{className:"flex-shrink-0 h-8 bg-slate-800 border-b border-slate-700 flex items-center justify-between px-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-red-500/80"}),e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-amber-500/80"}),e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-emerald-500/80"}),e.jsxs("span",{className:"text-[10px] font-semibold text-slate-400 uppercase tracking-wider ml-2",children:["Browser Previews — ",r.activeCaseIds.length," running"]})]}),e.jsx("button",{type:"button",onClick:d,title:"Open in external browser",className:"p-1 rounded text-slate-400 hover:text-white hover:bg-slate-700 transition-colors",children:e.jsx(wa,{size:11})})]}),e.jsx("div",{className:"flex flex-col gap-0 flex-1",children:r.activeCaseIds.map((M,w)=>{const N=r.screenshots.get(M),K=s.activeCases.get(M)??M.slice(0,8),_=E===M,ee=w===r.activeCaseIds.length-1;return e.jsxs("div",{className:O("flex flex-col cursor-pointer transition-all",!ee&&"border-b border-slate-700",_&&"ring-inset ring-2 ring-accent"),onClick:()=>R(M),children:[e.jsxs("div",{className:O("flex items-center justify-between px-3 py-1.5 flex-shrink-0",_?"bg-accent/10 border-b border-accent/30":"bg-slate-800/60 border-b border-slate-700"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[s.currentBrowser&&e.jsx(Bi,{browser:s.currentBrowser,size:12}),e.jsx("span",{className:"text-[10px] font-mono text-slate-300 truncate max-w-xs",children:K})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[_&&e.jsx("span",{className:"text-[8px] font-semibold text-accent uppercase tracking-wider",children:"Selected"}),o&&e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"})]})]}),e.jsx("div",{className:"relative bg-slate-950 flex-1",children:N?e.jsx("img",{src:`data:image/jpeg;base64,${N}`,alt:K,className:"w-full h-auto object-contain"}):e.jsxs("div",{className:"h-32 flex items-center justify-center gap-2",children:[e.jsx(Me,{size:14,className:"text-slate-600 animate-spin"}),e.jsx("span",{className:"text-[10px] text-slate-600",children:"Waiting for screenshot..."})]})})]},M)})})]}),e.jsxs("div",{className:"flex-shrink-0 h-1.5 bg-slate-700 hover:bg-accent cursor-row-resize flex items-center justify-center transition-colors group relative",onMouseDown:g,children:[e.jsx("div",{className:"absolute inset-x-0 -top-1.5 -bottom-1.5"}),e.jsx("div",{className:"flex gap-0.5",children:e.jsx("div",{className:"w-4 h-0.5 rounded-full bg-slate-500 group-hover:bg-white transition-colors"})})]}),e.jsxs("div",{className:"flex flex-col bg-[#1a1b26] overflow-hidden",style:{height:`${100-y}%`},children:[e.jsx("div",{className:"flex-shrink-0 flex items-center gap-1 px-2 py-1 bg-[#16172a] border-b border-slate-700 overflow-x-auto",children:r.activeCaseIds.map(M=>{const w=s.activeCases.get(M)??M.slice(0,8),N=E===M;return e.jsx("button",{type:"button",onClick:()=>R(M),className:O("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:w},M)})}),e.jsx(Lp,{tab:P,setTab:S,stepCount:C.length,logCount:D.length}),e.jsx(_p,{tab:P,stepLogs:C,consoleLogs:D,endRef:j}),s.completed&&!o&&e.jsx("div",{className:"flex-shrink-0 border-t border-slate-700 p-3",children:e.jsx(Fp,{completed:s.completed,onRunAgain:c})})]})]}):e.jsxs("div",{className:"flex flex-1 overflow-hidden relative",style:{minHeight:0},children:[e.jsxs("div",{className:"flex flex-col bg-slate-900 overflow-hidden",style:{width:`${h}%`},children:[e.jsx(tw,{onOpenExternal:d,browser:s.currentBrowser}),e.jsxs("div",{className:"flex-1 relative overflow-hidden flex items-center justify-center",children:[r.screenshot?e.jsx("img",{src:`data:image/jpeg;base64,${r.screenshot}`,alt:"Browser",className:O("max-w-full max-h-full object-contain",s.completed&&!o&&"opacity-30")}):o?e.jsx(sw,{progress:s}):null,s.completed&&!o&&e.jsx("div",{className:O("w-full",r.screenshot?"absolute inset-0 flex items-center justify-center bg-black/50 backdrop-blur-sm":"p-6"),children:e.jsx(Fp,{completed:s.completed,onRunAgain:c})}),e.jsx(nw,{step:s.currentStep})]})]}),e.jsx(rw,{onMouseDown:f}),e.jsxs("div",{className:"flex flex-col bg-[#1a1b26] overflow-hidden",style:{width:`${100-h}%`},children:[e.jsx(Lp,{tab:P,setTab:S,stepCount:C.length,logCount:D.length}),e.jsx(_p,{tab:P,stepLogs:C,consoleLogs:D,endRef:j})]})]})]})}function Fp({completed:s,onRunAgain:r}){const a=s.failed===0;return e.jsxs("div",{className:O("w-full max-w-sm rounded-2xl border p-5 shadow-lg",a?"border-emerald-500/30 bg-emerald-950/80":"border-red-500/30 bg-red-950/80"),children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a?e.jsx(He,{size:22,className:"text-emerald-400 flex-shrink-0"}):e.jsx(St,{size:22,className:"text-red-400 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:O("text-sm font-bold",a?"text-emerald-300":"text-red-300"),children:a?"All tests passed!":"Run completed with failures"}),e.jsxs("p",{className:O("text-[10px]",a?"text-emerald-400/70":"text-red-400/70"),children:["Finished in ",Math.round(s.duration/1e3),"s"]})]})]}),e.jsx("div",{className:"grid grid-cols-3 gap-2 mb-4",children:[{label:"Passed",value:s.passed,color:"text-emerald-400",bg:"bg-emerald-500/10 ring-emerald-500/20"},{label:"Failed",value:s.failed,color:"text-red-400",bg:"bg-red-500/10 ring-red-500/20"},{label:"Skipped",value:s.skipped,color:"text-slate-400",bg:"bg-slate-500/10 ring-slate-500/20"}].map(({label:o,value:c,color:d,bg:x})=>e.jsxs("div",{className:O("rounded-xl p-2.5 text-center ring-1",x),children:[e.jsx("p",{className:O("text-lg font-bold tabular-nums",d),children:c}),e.jsx("p",{className:"text-[8px] text-slate-400 uppercase tracking-wider",children:o})]},o))}),e.jsxs("button",{type:"button",onClick:r,className:"w-full flex items-center justify-center gap-2 py-2 rounded-xl ring-1 ring-slate-600 bg-slate-800 hover:bg-slate-700 transition-all text-xs font-medium text-slate-300 hover:text-white",children:[e.jsx(_i,{size:11})," Run Again"]})]})}function ew({elapsed:s,runActive:r,progress:a,onRunAgain:o,onStop:c}){return e.jsxs("div",{className:"flex-shrink-0 px-4 py-2 bg-surface border-b border-border flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:O("w-7 h-7 rounded-lg flex items-center justify-center",r?"bg-gradient-to-br from-emerald-500 to-cyan-600":a.completed?.failed?"bg-gradient-to-br from-red-500 to-rose-600":"bg-gradient-to-br from-emerald-500 to-green-600"),children:r?e.jsx(Me,{size:13,className:"text-white animate-spin"}):e.jsx(He,{size:13,className:"text-white"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-xs font-bold text-content",children:r?"Running Tests":"Run Complete"}),r&&e.jsx("span",{className:"inline-flex items-center gap-1 text-[8px] font-semibold px-1.5 py-0.5 rounded-md ring-1 bg-emerald-50 text-emerald-600 ring-emerald-200 animate-pulse",children:"LIVE"})]}),a.currentCase&&r&&e.jsx("p",{className:"text-[9px] text-content-tertiary truncate max-w-xs",children:a.currentCase.caseName})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[!r&&a.completed&&e.jsxs("div",{className:"flex items-center gap-1.5 mr-2",children:[e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[9px] font-semibold px-1.5 py-0.5 rounded ring-1 bg-emerald-50 text-emerald-600 ring-emerald-200",children:[e.jsx(He,{size:8})," ",a.completed.passed]}),a.completed.failed>0&&e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[9px] font-semibold px-1.5 py-0.5 rounded ring-1 bg-red-50 text-red-600 ring-red-200",children:[e.jsx(St,{size:8})," ",a.completed.failed]})]}),r&&e.jsxs("button",{type:"button",onClick:c,title:"Stop run",className:"flex items-center gap-1 px-2 py-1 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 hover:bg-red-500/20 hover:text-red-300 transition-all text-[10px] font-semibold",children:[e.jsx(Bf,{size:9,className:"fill-current"})," Stop"]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-content-tertiary",children:[e.jsx(Er,{size:10}),e.jsx("p",{className:"text-xs font-mono font-bold text-content-secondary",children:s})]}),!r&&e.jsxs("button",{type:"button",onClick:o,className:"text-[10px] font-medium text-accent hover:text-accent-dark flex items-center gap-1 ml-1",children:[e.jsx(_i,{size:10})," New Run"]})]})]})}function tw({onOpenExternal:s,onToggleFullscreen:r,fullscreen:a,browser:o}){return e.jsxs("div",{className:"flex-shrink-0 h-8 bg-slate-800 border-b border-slate-700 flex items-center justify-between px-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-red-500/80"}),e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-amber-500/80"}),e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-emerald-500/80"})]}),o?e.jsxs("div",{className:"flex items-center gap-1.5 ml-2",children:[e.jsx(Bi,{browser:o,size:14}),e.jsx("span",{className:"text-[10px] font-semibold text-slate-300 uppercase tracking-wider",children:ix(o)})]}):e.jsx("span",{className:"text-[10px] font-semibold text-slate-400 uppercase tracking-wider ml-2",children:"Browser Preview"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[r&&e.jsx("button",{type:"button",onClick:r,title:a?"Exit fullscreen":"Fullscreen",className:"p-1 rounded text-slate-400 hover:text-white hover:bg-slate-700 transition-colors",children:a?e.jsx(Lv,{size:11}):e.jsx(Ju,{size:11})}),e.jsx("button",{type:"button",onClick:s,title:"Open in external browser",className:"p-1 rounded text-slate-400 hover:text-white hover:bg-slate-700 transition-colors",children:e.jsx(wa,{size:11})})]})]})}function sw({progress:s}){return e.jsxs("div",{className:"flex flex-col items-center gap-4 p-8 max-w-xs",children:[e.jsxs("div",{className:"w-48 h-32 rounded-xl bg-slate-800 border border-slate-700 overflow-hidden relative",children:[e.jsxs("div",{className:"h-5 bg-slate-750 border-b border-slate-700 flex items-center px-2 gap-1.5",children:[e.jsxs("div",{className:"flex gap-1",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-red-500/50"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-500/50"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500/50"})]}),e.jsx("div",{className:"flex-1 h-2.5 rounded bg-slate-700 ml-1"})]}),e.jsxs("div",{className:"p-2 space-y-1.5",children:[e.jsx("div",{className:"h-2 bg-slate-700 rounded w-3/4 animate-pulse"}),e.jsx("div",{className:"h-2 bg-slate-700 rounded w-1/2 animate-pulse",style:{animationDelay:"200ms"}}),e.jsx("div",{className:"h-2 bg-slate-700 rounded w-5/6 animate-pulse",style:{animationDelay:"400ms"}}),e.jsx("div",{className:"h-6 bg-accent/10 rounded mt-2 animate-pulse border border-accent/20",style:{animationDelay:"600ms"}})]}),e.jsx("div",{className:"absolute inset-x-0 h-0.5 bg-gradient-to-r from-transparent via-accent to-transparent opacity-60",style:{animation:"scan-line 2s ease-in-out infinite",top:"30%"}})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs font-semibold text-slate-300",children:s.currentCase?"Executing test...":"Launching browser..."}),s.currentCase&&e.jsx("p",{className:"text-[10px] text-slate-500 mt-1 truncate max-w-[200px]",children:s.currentCase.caseName})]}),e.jsx("div",{className:"flex items-center gap-1.5",children:[0,160,320].map(r=>e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-accent animate-bounce",style:{animationDelay:`${r}ms`}},r))}),e.jsx("style",{children:`
|
|
918
|
-
@keyframes scan-line {
|
|
919
|
-
0%, 100% { top: 20%; opacity: 0; }
|
|
920
|
-
50% { top: 80%; opacity: 0.6; }
|
|
921
|
-
}
|
|
922
|
-
`})]})}function nw({step:s}){return s?e.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse flex-shrink-0"}),e.jsx("p",{className:"text-[10px] text-white/80 truncate font-mono",children:s.instruction})]})}):null}function rw({onMouseDown:s}){return e.jsxs("div",{className:"flex-shrink-0 w-1.5 bg-slate-700 hover:bg-accent cursor-col-resize flex items-center justify-center transition-colors group relative",onMouseDown:s,children:[e.jsx("div",{className:"absolute inset-y-0 -left-1.5 -right-1.5"})," ",e.jsx(Il,{size:10,className:"text-slate-500 group-hover:text-white"})]})}function Lp({tab:s,setTab:r,stepCount:a,logCount:o}){return e.jsxs("div",{className:"flex-shrink-0 h-8 bg-[#1e1f2e] border-b border-slate-700 flex items-center px-1",children:[e.jsxs("button",{type:"button",onClick:()=>r("steps"),className:O("flex items-center gap-1.5 px-3 h-full text-[10px] font-semibold uppercase tracking-wider border-b-2 transition-colors",s==="steps"?"text-accent border-accent":"text-slate-500 border-transparent hover:text-slate-300"),children:[e.jsx(Xt,{size:9})," Steps",a>0&&e.jsx("span",{className:"text-[8px] ml-0.5 opacity-60",children:a})]}),e.jsxs("button",{type:"button",onClick:()=>r("console"),className:O("flex items-center gap-1.5 px-3 h-full text-[10px] font-semibold uppercase tracking-wider border-b-2 transition-colors",s==="console"?"text-accent border-accent":"text-slate-500 border-transparent hover:text-slate-300"),children:[e.jsx(_l,{size:9})," Console",o>0&&e.jsx("span",{className:"text-[8px] ml-0.5 opacity-60",children:o})]})]})}function _p({tab:s,stepLogs:r,consoleLogs:a,endRef:o}){return s==="steps"?e.jsxs("div",{className:"flex-1 overflow-y-auto text-[10px] px-3 py-2 space-y-0.5",children:[r.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 text-slate-600",children:[e.jsx(Xt,{size:18}),e.jsx("p",{className:"text-[10px]",children:"Steps will appear as they execute..."})]}):r.map((c,d)=>e.jsxs("div",{className:"flex items-start gap-2 py-1 px-2 rounded hover:bg-white/[0.02] -mx-1",children:[e.jsx("div",{className:"flex-shrink-0 mt-0.5",children:c.status==="passed"?e.jsx(He,{size:11,className:"text-emerald-400"}):c.status==="failed"?e.jsx(St,{size:11,className:"text-red-400"}):e.jsx(Ll,{size:11,className:"text-slate-500"})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("p",{className:O("font-mono truncate",c.status==="passed"?"text-slate-300":c.status==="failed"?"text-red-300":"text-slate-500"),children:c.instruction})}),e.jsxs("span",{className:"text-slate-600 flex-shrink-0 tabular-nums",children:[c.duration,"ms"]})]},`${c.stepId}-${d}`)),e.jsx("div",{ref:o})]}):e.jsxs("div",{className:"flex-1 overflow-y-auto font-mono text-[10px] px-3 py-2 space-y-px",children:[a.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 text-slate-600",children:[e.jsx(_l,{size:18}),e.jsx("p",{className:"text-[10px]",children:"Console logs will appear here..."})]}):a.map((c,d)=>{const x=Dp[c.type]??Dp.default,h=Ip[c.type]??Ip.debug,f=new Date(c.timestamp).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});return e.jsxs("div",{className:"flex items-start gap-2 py-0.5 hover:bg-white/[0.02] rounded px-1 -mx-1",children:[e.jsx("span",{className:"text-slate-600 flex-shrink-0 tabular-nums",children:f}),e.jsx("span",{className:O("flex-shrink-0 uppercase text-[8px] font-bold w-9",h),children:c.type.slice(0,5)}),e.jsx("span",{className:O("break-all",x),children:c.text})]},d)}),e.jsx("div",{ref:o})]})}function Ml({label:s,color:r,className:a}){return e.jsx("span",{className:O("inline-flex items-center px-2 py-0.5 rounded-md text-[11px] font-semibold tracking-wide",r??"bg-surface-inset text-content-secondary",a),children:s})}function ox({status:s}){const r={passed:"bg-emerald-50 text-emerald-700 border border-emerald-200/60",failed:"bg-red-50 text-red-700 border border-red-200/60",running:"bg-blue-50 text-blue-700 border border-blue-200/60",pending:"bg-slate-50 text-slate-600 border border-slate-200/60",skipped:"bg-amber-50 text-amber-700 border border-amber-200/60",partial:"bg-orange-50 text-orange-700 border border-orange-200/60"};return e.jsx(Ml,{label:s,color:r[s]??"bg-slate-100 text-slate-600"})}function Wl({children:s,className:r,padding:a=!0}){return e.jsx("div",{className:O("bg-surface rounded-xl border border-border shadow-card transition-shadow duration-200",a&&"p-5",r),children:s})}const aw={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 nl({label:s,value:r,sub:a,color:o,icon:c}){const d=o?aw[o]:null;return e.jsxs("div",{className:O("rounded-xl border px-4 py-3.5 flex items-center gap-3.5 transition-all duration-200",d?`${d.bg} ${d.border}`:"bg-surface border-border"),children:[c&&e.jsx("div",{className:O("flex items-center justify-center w-9 h-9 rounded-lg flex-shrink-0",d?`${d.bg} ${d.icon}`:"bg-surface-inset text-content-tertiary"),children:c}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-content-tertiary leading-none",children:s}),e.jsx("p",{className:O("font-bold mt-1.5 leading-none",typeof r=="string"&&r.length>3?"text-sm":"text-lg",d?d.value:"text-content"),children:r}),a&&e.jsx("p",{className:"text-[11px] text-content-tertiary mt-1",children:a})]})]})}function iw(s){switch(s){case"passed":return"bg-emerald-500";case"failed":return"bg-red-500";case"skipped":return"bg-slate-500";case"healed":return"bg-amber-500";default:return"bg-slate-400"}}function ow({steps:s,onSelect:r}){const a=s.filter(o=>o.screenshotPath);return a.length<2?null:e.jsx("div",{className:"flex gap-2 overflow-x-auto pb-1",style:{scrollbarWidth:"thin"},children:a.map((o,c)=>{const d=Sa("screenshots",o.screenshotPath),x=o.healed?"healed":o.status;return e.jsxs("button",{type:"button",onClick:()=>r(d),className:"relative flex-shrink-0 rounded overflow-hidden border border-border hover:border-accent/50 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",style:{width:80,height:60},title:o.instruction,children:[e.jsx("img",{src:d,alt:`Step ${c+1}`,className:"w-full h-full object-cover"}),e.jsx("span",{className:"absolute top-0.5 left-0.5 bg-black/60 text-white text-[8px] font-bold px-1 py-px rounded leading-none",children:c+1}),e.jsx("span",{className:O("absolute bottom-1 right-1 w-2 h-2 rounded-full ring-1 ring-white/50",iw(x))})]},o.stepId)})})}function lw(s){if(s.healed)return"bg-amber-500";switch(s.status){case"passed":return"bg-emerald-500";case"failed":return"bg-red-500";case"skipped":return"bg-slate-500";default:return"bg-slate-400"}}function cw({steps:s}){const[r,a]=p.useState(null),o=s.reduce((d,x)=>d+(x.duration??0),0);if(o===0||s.length===0)return null;let c=0;return e.jsxs("div",{className:"px-3 py-2 border-t border-border bg-surface-inset/20",children:[e.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-wider mb-2",children:"Execution Timeline"}),e.jsx("div",{className:"relative h-5 bg-surface-inset rounded overflow-hidden",children:s.map((d,x)=>{const h=d.duration/o*100,f=c/o*100;return c+=d.duration,e.jsx("div",{className:O("absolute top-0 h-full transition-opacity hover:opacity-80 cursor-default",lw(d)),style:{left:`${f}%`,width:`${Math.max(h,.5)}%`},onMouseEnter:()=>a(`${d.instruction} — ${d.duration}ms`),onMouseLeave:()=>a(null)},d.stepId??x)})}),r&&e.jsx("p",{className:"text-[9px] text-content-secondary mt-1 truncate",children:r}),e.jsx("div",{className:"flex mt-1 relative",style:{height:14},children:(()=>{let d=0;return s.map((x,h)=>{const f=x.duration/o*100,y=d/o*100;d+=x.duration;const g=(x.instruction??"").slice(0,8);return e.jsx("div",{className:"absolute text-[8px] text-content-tertiary truncate overflow-hidden",style:{left:`${y}%`,width:`${Math.max(f,2)}%`,top:0},title:x.instruction,children:g},x.stepId??h)})})()})]})}function dw({stepId:s,currentScreenshotPath:r}){const{data:a,refetch:o}=Oe({queryKey:["baseline",s],queryFn:()=>vp.get(s),enabled:!!s}),c=oe({mutationFn:()=>{if(!r)throw new Error("No screenshot available");return vp.capture(s,r)},onSuccess:()=>{H.success("Baseline saved"),o()},onError:h=>H.error(h.message)}),d=r?Sa("screenshots",r):null,x=a?.hasBaseline?`${uj(s)}?t=${a.capturedAt??Date.now()}`:null;return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Visual Regression"}),e.jsxs("div",{className:"flex items-center gap-2",children:[a?.hasBaseline&&e.jsx("span",{className:"text-[8px] px-1.5 py-0.5 rounded bg-emerald-50 text-emerald-600 ring-1 ring-emerald-200 font-semibold",children:"Baseline set"}),r&&e.jsxs("button",{type:"button",onClick:()=>c.mutate(),disabled:c.isPending,className:"inline-flex items-center gap-1 text-[9px] px-2 py-0.5 rounded bg-accent text-white hover:brightness-110 transition-colors disabled:opacity-50",children:[e.jsx(Un,{size:9})," Set as Baseline"]})]})]}),e.jsxs("div",{className:"flex gap-3",children:[d&&e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-[8px] text-content-tertiary mb-1",children:"Current"}),e.jsx("img",{src:d,alt:"Current screenshot",className:"rounded border border-border max-h-32 object-contain"})]}),x&&e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-[8px] text-content-tertiary mb-1",children:"Baseline"}),e.jsx("img",{src:x,alt:"Baseline screenshot",className:"rounded border border-border max-h-32 object-contain"})]}),!x&&d&&e.jsx("div",{className:"flex-1 flex items-center justify-center border border-dashed border-border rounded-lg min-h-[80px]",children:e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"No baseline set"})})]})]})}function lx(s,r){if(r==null)return"na";switch(s){case"fcp":return r<1800?"good":r<3e3?"needs-improvement":"poor";case"lcp":return r<2500?"good":r<4e3?"needs-improvement":"poor";case"cls":return r<.1?"good":r<.25?"needs-improvement":"poor";case"ttfb":return r<800?"good":r<1800?"needs-improvement":"poor";case"tbt":return r<200?"good":r<600?"needs-improvement":"poor";case"si":return r<3400?"good":r<5800?"needs-improvement":"poor";case"tti":return r<3800?"good":r<7300?"needs-improvement":"poor";case"inp":return r<200?"good":r<500?"needs-improvement":"poor"}}const uw={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 xw(s,r){return r==null?"—":s==="cls"?r.toFixed(3):r<1e3?`${Math.round(r)}ms`:`${(r/1e3).toFixed(2)}s`}function cx(s){return s==null?{ring:"ring-border",text:"text-content-tertiary",bg:"bg-surface-inset",label:"—"}:s>=90?{ring:"ring-emerald-300 dark:ring-emerald-700",text:"text-emerald-600 dark:text-emerald-400",bg:"bg-emerald-50 dark:bg-emerald-900/20",label:"Good"}:s>=50?{ring:"ring-amber-300 dark:ring-amber-700",text:"text-amber-600 dark:text-amber-400",bg:"bg-amber-50 dark:bg-amber-900/20",label:"Needs Work"}:{ring:"ring-red-300 dark:ring-red-700",text:"text-red-600 dark:text-red-400",bg:"bg-red-50 dark:bg-red-900/20",label:"Poor"}}const dx=[{key:"fcp",label:"FCP",desc:"First Contentful Paint"},{key:"lcp",label:"LCP",desc:"Largest Contentful Paint"},{key:"cls",label:"CLS",desc:"Cumulative Layout Shift"},{key:"ttfb",label:"TTFB",desc:"Time to First Byte"},{key:"tbt",label:"TBT",desc:"Total Blocking Time"},{key:"si",label:"SI",desc:"Speed Index"},{key:"tti",label:"TTI",desc:"Time to Interactive"},{key:"inp",label:"INP",desc:"Interaction to Next Paint"}];function Up({metricKey:s,value:r}){const a=lx(s,r),o=dx.find(c=>c.key===s);return e.jsxs("div",{className:O("rounded-lg px-2 py-2 ring-1 text-center flex-1 min-w-[70px]",uw[a]),children:[e.jsx("p",{className:"text-[8px] font-bold uppercase tracking-widest opacity-60 mb-0.5",children:o.label}),e.jsx("p",{className:"text-xs font-bold tabular-nums leading-tight",children:xw(s,r)})]})}function iu({score:s,label:r}){const a=cx(s),o=24,c=2*Math.PI*o,d=s!=null?s/100*c:0;return e.jsxs("div",{className:O("flex flex-col items-center justify-center rounded-xl px-3 py-2.5 ring-2 flex-1",a.bg,a.ring),children:[e.jsxs("div",{className:"relative w-14 h-14",children:[e.jsxs("svg",{className:"w-14 h-14 -rotate-90",viewBox:"0 0 60 60",children:[e.jsx("circle",{cx:"30",cy:"30",r:o,fill:"none",stroke:"currentColor",strokeWidth:"5",className:"opacity-10"}),e.jsx("circle",{cx:"30",cy:"30",r:o,fill:"none",stroke:"currentColor",strokeWidth:"5",strokeDasharray:c,strokeDashoffset:c-d,strokeLinecap:"round",className:a.text})]}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("span",{className:O("text-base font-black tabular-nums",a.text),children:s??"—"})})]}),e.jsx("p",{className:O("text-[8px] font-bold mt-1 leading-tight",a.text),children:a.label}),e.jsx("p",{className:"text-[8px] text-content-tertiary mt-px text-center leading-tight",children:r})]})}function $p({audits:s,label:r,score:a}){if(!s||s.length===0)return null;const o=s.filter(f=>!f.passed&&!f.partial&&!f.na),c=s.filter(f=>!!f.partial),d=s.filter(f=>f.passed),x=s.filter(f=>!!f.na),h=cx(a);return e.jsxs("div",{className:"mt-2 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsxs("p",{className:"text-[8px] font-bold text-content-tertiary uppercase tracking-widest flex-1",children:[r," Audits"]}),a!=null&&e.jsx("span",{className:O("text-[9px] font-black px-1.5 py-0.5 rounded-md ring-1",h.bg,h.text,h.ring),children:a})]}),e.jsxs("div",{className:"space-y-0.5 max-h-48 overflow-y-auto pr-1",children:[o.map(f=>e.jsxs("div",{className:"flex items-start gap-1.5 text-[9px] text-red-600 dark:text-red-400 font-medium",children:[e.jsx(St,{size:9,className:"text-red-500 flex-shrink-0 mt-px"}),e.jsx("span",{className:"leading-tight",children:f.title})]},f.id)),c.map(f=>e.jsxs("div",{className:"flex items-start gap-1.5 text-[9px] text-amber-600 dark:text-amber-400 font-medium",children:[e.jsx(gs,{size:9,className:"text-amber-500 flex-shrink-0 mt-px"}),e.jsx("span",{className:"leading-tight",children:f.title})]},f.id)),x.map(f=>e.jsxs("div",{className:"flex items-start gap-1.5 text-[9px] text-content-tertiary",children:[e.jsx(kv,{size:9,className:"text-content-tertiary flex-shrink-0 mt-px"}),e.jsx("span",{className:"leading-tight",children:f.title})]},f.id)),d.map(f=>e.jsxs("div",{className:"flex items-start gap-1.5 text-[9px] text-emerald-600 dark:text-emerald-400",children:[e.jsx(He,{size:9,className:"text-emerald-500 flex-shrink-0 mt-px"}),e.jsx("span",{className:"leading-tight",children:f.title})]},f.id))]})]})}function mw(s,r){let a=0,o=0,c=0;if(r==="performance")for(const d of s)for(const{key:x}of dx){const h=lx(x,d[x]);h==="good"?a++:h==="needs-improvement"?o++:h==="poor"&&c++}else{const d=r==="accessibility"?"a11yAudits":"seoAudits",x=r==="accessibility"?"a11yScore":"seoScore";for(const h of s){const f=h[d]??[];a+=f.filter(g=>g.passed).length,o+=f.filter(g=>!!g.partial).length,c+=f.filter(g=>!g.passed&&!g.partial&&!g.na).length;const y=cx(h[x]);y.label==="Good"?a++:y.label==="Needs Work"?o++:y.label==="Poor"&&c++}}return{good:a,warn:o,poor:c}}function hw({caseName:s,pageLoads:r,focus:a="performance",onClose:o}){const[c,d]=p.useState(a),x=mw(r,c),h=c==="performance"?"metrics":c==="accessibility"?"a11y checks":"seo checks",f=[{key:"performance",label:"Performance",icon:e.jsx(ct,{size:10}),color:"text-violet-600 dark:text-violet-400",activeColor:"bg-violet-50 dark:bg-violet-900/20 text-violet-700 dark:text-violet-300 ring-violet-200 dark:ring-violet-700"},{key:"accessibility",label:"Accessibility",icon:e.jsx(Nu,{size:10}),color:"text-blue-600 dark:text-blue-400",activeColor:"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 ring-blue-200 dark:ring-blue-700"},{key:"seo",label:"SEO",icon:e.jsx(Bn,{size:10}),color:"text-emerald-600 dark:text-emerald-400",activeColor:"bg-emerald-50 dark:bg-emerald-900/20 text-emerald-700 dark:text-emerald-300 ring-emerald-200 dark:ring-emerald-700"}];return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 bg-black/30 z-40",onClick:o}),e.jsxs("div",{className:"fixed right-0 top-0 h-full w-[560px] max-w-full bg-surface shadow-2xl z-50 flex flex-col border-l border-border",children:[e.jsxs("div",{className:"border-b border-border bg-gradient-to-r from-violet-50 to-indigo-50 dark:from-violet-900/20 dark:to-indigo-900/20 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3 px-5 py-3",children:[e.jsx("div",{className:O("w-7 h-7 rounded-lg flex items-center justify-center flex-shrink-0",c==="performance"?"bg-violet-500":c==="accessibility"?"bg-blue-500":"bg-emerald-500"),children:c==="performance"?e.jsx(ct,{size:13,className:"text-white"}):c==="accessibility"?e.jsx(Nu,{size:13,className:"text-white"}):e.jsx(Bn,{size:13,className:"text-white"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs font-bold text-content",children:"Lighthouse Audit"}),e.jsx("p",{className:"text-[10px] text-content-tertiary truncate",children:s})]}),e.jsx("button",{type:"button",onClick:o,className:"p-1.5 rounded-lg text-content-tertiary hover:text-content hover:bg-surface-inset transition-colors",children:e.jsx(Fe,{size:14})})]}),e.jsx("div",{className:"flex gap-1 px-5 pb-0",children:f.map(y=>e.jsxs("button",{type:"button",onClick:()=>d(y.key),className:O("flex items-center gap-1.5 px-3 py-1.5 text-[10px] font-semibold rounded-t-lg border-b-2 transition-colors",c===y.key?"border-current "+y.color+" bg-surface/80":"border-transparent text-content-tertiary hover:text-content-secondary"),children:[y.icon," ",y.label]},y.key))})]}),x.good+x.warn+x.poor>0&&e.jsxs("div",{className:"px-5 py-2.5 border-b border-border bg-surface-inset/40 flex items-center gap-4 flex-shrink-0",children:[e.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest flex-shrink-0",children:["Overall ",e.jsxs("span",{className:"normal-case font-normal opacity-60",children:["(",h,")"]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[x.good>0&&e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-emerald-700 dark:text-emerald-400 font-semibold",children:[e.jsx("span",{className:"text-emerald-500 text-[11px] leading-none",children:"●"}),x.good," ",c==="performance"?"Good":"Passed"]}),x.warn>0&&e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-amber-700 dark:text-amber-400 font-semibold",children:[e.jsx("span",{className:"text-amber-400 text-[11px] leading-none",children:"●"}),x.warn," Needs Work"]}),x.poor>0&&e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-red-700 dark:text-red-400 font-semibold",children:[e.jsx("span",{className:"text-red-500 text-[11px] leading-none",children:"●"}),x.poor," ",c==="performance"?"Poor":"Failed"]})]}),e.jsxs("p",{className:"text-[9px] text-content-tertiary",children:[r.length," page",r.length!==1?"s":""]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-5",children:r.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-center",children:[e.jsx(ct,{size:24,className:"text-content-tertiary mb-2 opacity-40"}),e.jsx("p",{className:"text-xs text-content-tertiary",children:"No page navigations recorded"}),e.jsx("p",{className:"text-[10px] text-content-tertiary mt-1 opacity-60",children:"Only available for Chromium browser runs"})]}):r.map((y,g)=>e.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-sm overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-2.5 bg-surface-inset/50 border-b border-border",children:[e.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-0.5",children:["Step ",y.stepIndex+1]}),e.jsx("p",{className:"text-[10px] text-content-secondary truncate mb-1",title:y.stepInstruction,children:y.stepInstruction}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Gn,{size:9,className:"text-indigo-400 dark:text-indigo-500 flex-shrink-0"}),e.jsx("p",{className:"text-[10px] font-mono text-indigo-600 dark:text-indigo-400 truncate font-medium",title:y.url,children:y.url})]})]}),y.lighthouseError?e.jsxs("div",{className:"px-4 py-3 flex items-start gap-2",children:[e.jsx(gs,{size:12,className:"text-amber-500 flex-shrink-0 mt-0.5"}),e.jsx("p",{className:"text-[10px] text-amber-700 dark:text-amber-400",children:y.lighthouseError})]}):e.jsxs("div",{className:"px-4 py-3 space-y-3",children:[c==="performance"&&e.jsxs(e.Fragment,{children:[e.jsx(iu,{score:y.score,label:"Performance"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-[8px] font-bold text-content-tertiary uppercase tracking-widest",children:"Core Web Vitals"}),e.jsx("div",{className:"flex gap-1.5 flex-wrap",children:["fcp","lcp","cls","ttfb"].map(j=>e.jsx(Up,{metricKey:j,value:y[j]},j))}),e.jsx("div",{className:"flex gap-1.5 flex-wrap",children:["tbt","si","tti","inp"].map(j=>e.jsx(Up,{metricKey:j,value:y[j]},j))})]}),e.jsx("div",{className:"pt-1 border-t border-border/50 grid grid-cols-2 gap-x-4 gap-y-0.5",children:dx.map(({key:j,label:P,desc:S})=>{const k=lx(j,y[j]);return e.jsxs("div",{className:"flex items-center gap-1.5 text-[8px] text-content-tertiary",children:[e.jsx("span",{className:O("text-[10px] leading-none flex-shrink-0",k==="good"?"text-emerald-500":k==="needs-improvement"?"text-amber-400":k==="poor"?"text-red-500":"text-slate-300"),children:"●"}),e.jsx("span",{className:"font-medium",children:P}),e.jsx("span",{className:"opacity-60 truncate",children:S})]},j)})})]}),c==="accessibility"&&e.jsxs(e.Fragment,{children:[e.jsx(iu,{score:y.a11yScore,label:"Accessibility"}),(y.a11yAudits?.length??0)>0?e.jsx($p,{audits:y.a11yAudits,label:"Accessibility",score:y.a11yScore}):e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"No accessibility audit data available."})]}),c==="seo"&&e.jsxs(e.Fragment,{children:[e.jsx(iu,{score:y.seoScore,label:"SEO"}),(y.seoAudits?.length??0)>0?e.jsx($p,{audits:y.seoAudits,label:"SEO",score:y.seoScore}):e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"No SEO audit data available."})]})]})]},g))}),e.jsx("div",{className:"px-5 py-2.5 border-t border-border bg-surface-inset/30 flex-shrink-0",children:e.jsx("p",{className:"text-[9px] text-content-tertiary text-center",children:"Powered by Google Lighthouse · Desktop preset · Chromium only"})})]})]})}function pw({src:s,onClose:r}){return e.jsxs("div",{className:"fixed inset-0 bg-black/80 z-50 flex flex-col items-center justify-center p-4",onClick:r,children:[e.jsxs("div",{className:"absolute top-4 right-4 flex items-center gap-2",children:[e.jsx("a",{href:s,download:!0,onClick:a=>a.stopPropagation(),title:"Download",className:"text-white/70 hover:text-white p-2 rounded-lg bg-surface/10 hover:bg-surface/20",children:e.jsx(ga,{size:14})}),e.jsx("button",{type:"button",onClick:r,className:"text-white/70 hover:text-white p-2 rounded-lg bg-surface/10 hover:bg-surface/20",children:e.jsx(Fe,{size:14})})]}),e.jsx("img",{src:s,alt:"Screenshot",className:"max-w-full max-h-full rounded-lg shadow-2xl object-contain",onClick:a=>a.stopPropagation()}),e.jsx("p",{className:"text-white/40 text-[10px] mt-2",children:"Click outside to close"})]})}function fw({step:s,onScreenshot:r}){const[a,o]=p.useState(s.status==="failed"),c=s.screenshotPath?Sa("screenshots",s.screenshotPath):null,d=s.status==="passed"?e.jsx(He,{size:11,className:"text-emerald-500 flex-shrink-0"}):s.status==="failed"?e.jsx(St,{size:11,className:"text-red-500 flex-shrink-0"}):e.jsx(Ll,{size:11,className:"text-content-tertiary flex-shrink-0"});return e.jsxs("div",{className:"border-t border-border/50 first:border-0",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 cursor-pointer hover:bg-surface-inset/50 text-[10px] select-none transition-colors",onClick:()=>o(x=>!x),children:[d,e.jsx("span",{className:O("text-[8px] px-1 py-px rounded font-bold uppercase ring-1 flex-shrink-0",s.stepType==="api"?"bg-violet-50 text-violet-600 ring-violet-200":"bg-blue-50 text-blue-600 ring-blue-200"),children:s.stepType==="api"?"API":"UI"}),e.jsx("span",{className:O("flex-1 truncate text-[10px]",s.status==="failed"?"text-red-700 font-medium":"text-content-secondary"),children:s.instruction}),s.healed&&e.jsx("span",{className:"text-[8px] bg-amber-50 text-amber-600 px-1.5 py-0.5 rounded font-semibold ring-1 ring-amber-200 flex-shrink-0",children:"✦ healed"}),c&&e.jsx("button",{type:"button",title:"View screenshot",className:"text-content-tertiary hover:text-accent flex-shrink-0 p-0.5",onClick:x=>{x.stopPropagation(),r(c)},children:e.jsx(Un,{size:10})}),e.jsxs("span",{className:"text-content-tertiary w-10 text-right flex-shrink-0 tabular-nums text-[9px]",children:[s.duration,"ms"]}),a?e.jsx(wv,{size:10,className:"text-content-tertiary flex-shrink-0"}):e.jsx(kt,{size:10,className:"text-content-tertiary flex-shrink-0"})]}),a&&e.jsxs("div",{className:"px-3 pb-2.5 pt-1 space-y-2 bg-surface-inset/30",children:[s.code&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:"Code"}),e.jsx("pre",{className:"text-[10px] font-mono bg-slate-900 text-slate-100 rounded-lg p-2.5 overflow-x-auto whitespace-pre-wrap leading-relaxed",children:s.code})]}),s.error&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-bold text-red-500 uppercase tracking-widest mb-1",children:"Error"}),e.jsx("pre",{className:"text-[10px] text-red-700 bg-red-50 border border-red-100 rounded-lg p-2.5 font-mono whitespace-pre-wrap leading-relaxed",children:s.error})]}),s.healed&&s.healedCode&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-bold text-amber-600 uppercase tracking-widest mb-1",children:"Healed Code"}),e.jsx("pre",{className:"text-[10px] font-mono bg-amber-50 border border-amber-200 text-amber-900 rounded-lg p-2.5 overflow-x-auto whitespace-pre-wrap leading-relaxed",children:s.healedCode})]}),s.apiRequest&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-bold text-violet-500 uppercase tracking-widest mb-1",children:"API Request"}),e.jsx("pre",{className:"text-[10px] font-mono bg-violet-50 border border-violet-100 text-violet-900 rounded-lg p-2.5 overflow-x-auto whitespace-pre-wrap leading-relaxed",children:`${s.apiRequest.method} ${s.apiRequest.url}${s.apiRequest.headers?`
|
|
923
|
-
Headers: `+JSON.stringify(s.apiRequest.headers,null,2):""}${s.apiRequest.body?`
|
|
924
|
-
Body: `+s.apiRequest.body:""}`})]}),s.apiResponse&&e.jsxs("div",{children:[e.jsxs("p",{className:"text-[9px] font-bold text-indigo-500 uppercase tracking-widest mb-1",children:["API Response — ",s.apiResponse.status," ",s.apiResponse.statusText," (",s.apiResponse.duration,"ms)"]}),e.jsx("pre",{className:"text-[10px] font-mono bg-indigo-50 border border-indigo-100 text-indigo-900 rounded-lg p-2.5 overflow-x-auto whitespace-pre-wrap leading-relaxed max-h-48 overflow-y-auto",children:s.apiResponse.body?s.apiResponse.body.slice(0,2e3):"(empty body)"})]}),c&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:"Screenshot"}),e.jsxs("div",{className:"relative group inline-block",children:[e.jsx("img",{src:c,alt:"Step screenshot",className:"rounded-lg border border-border max-w-full max-h-40 object-contain cursor-zoom-in hover:opacity-95 transition-opacity",onClick:()=>r(c)}),e.jsx("button",{type:"button",onClick:()=>r(c),title:"Fullscreen",className:"absolute top-1.5 right-1.5 bg-black/50 text-white p-1 rounded opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx(Ju,{size:10})})]}),e.jsx("div",{className:"mt-2",children:e.jsx(dw,{stepId:s.stepId,currentScreenshotPath:s.screenshotPath})})]})]})]})}function gw({videoPath:s}){const r=Sa("videos",s);return e.jsxs("div",{className:"border-t border-border bg-black",children:[e.jsxs("div",{className:"px-3 pt-2 pb-1 flex items-center justify-between",children:[e.jsxs("p",{className:"text-[10px] font-medium text-content-tertiary flex items-center gap-1.5",children:[e.jsx($l,{size:10})," Recording"]}),e.jsxs("a",{href:r,download:!0,title:"Download video",className:"text-[10px] text-content-tertiary hover:text-accent flex items-center gap-1",children:[e.jsx(ga,{size:10})," Download"]})]}),e.jsx("video",{src:r,controls:!0,playsInline:!0,className:"w-full max-h-64 bg-black"})]})}function yw({tracePath:s}){const r=s.replace(/\\/g,"/").split("/").pop()??"",a=Sa("traces",s),o=`/trace/index.html?trace=${encodeURIComponent(`${window.location.origin}${a}`)}`;return e.jsxs("div",{className:"border-t border-border px-3 py-2 flex items-center justify-between bg-violet-50/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Rf,{size:12,className:"text-violet-500 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold text-content-secondary",children:"Playwright Trace"}),e.jsx("p",{className:"text-[9px] text-content-tertiary font-mono truncate max-w-[200px]",children:r})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[e.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-[10px] bg-violet-600 hover:bg-violet-700 text-white px-2 py-1 rounded-lg font-semibold transition-colors",children:[e.jsx(Xt,{size:9})," Open Viewer"]}),e.jsxs("a",{href:a,download:!0,title:"Download .zip",className:"inline-flex items-center gap-0.5 text-[10px] text-content-secondary hover:text-content px-1.5 py-1 border border-border rounded-lg hover:border-border transition-colors",children:[e.jsx(ga,{size:9})," .zip"]})]})]})}function bw({tc:s,suiteType:r,onScreenshot:a}){const[o,c]=p.useState(s.status==="failed"),[d,x]=p.useState(!1),[h,f]=p.useState(null),y=s.steps.filter(S=>S.screenshotPath).length,g=s.steps.filter(S=>S.screenshotPath),P=(r==="audit"||r==="performance")&&(s.pageLoads??[]).some(S=>!S.lighthouseError&&(S.score!=null&&S.score<50||S.a11yScore!=null&&S.a11yScore<50||S.seoScore!=null&&S.seoScore<50));return e.jsxs("div",{className:O("border-t",P?"border-red-300 bg-red-50/30":"border-border/50"),children:[e.jsxs("div",{className:O("flex items-center gap-2 px-3 py-2 cursor-pointer select-none transition-colors",P?"hover:bg-red-50/50":"hover:bg-surface-inset/50"),onClick:()=>c(S=>!S),children:[o?e.jsx(kt,{size:11,className:"text-content-tertiary flex-shrink-0"}):e.jsx(Zt,{size:11,className:"text-content-tertiary flex-shrink-0"}),e.jsx(ox,{status:s.status}),e.jsx("span",{className:"text-xs text-content font-medium flex-1 truncate",children:s.caseName}),e.jsxs("div",{className:"flex items-center gap-1.5",onClick:S=>S.stopPropagation(),children:[e.jsxs("button",{type:"button",title:"Toggle execution timeline",onClick:()=>x(S=>!S),className:O("flex items-center gap-0.5 text-[8px] px-1.5 py-0.5 rounded ring-1 transition-colors",d?"bg-indigo-100 text-indigo-600 ring-indigo-200":"bg-surface-inset text-content-tertiary ring-border hover:text-content-secondary"),children:[e.jsx(Ms,{size:8})," timeline"]}),(s.pageLoads?.length??0)>0&&(()=>{const S=s.pageLoads,k=S.some(v=>v.score!=null||v.fcp!=null),E=S.some(v=>v.a11yScore!=null||(v.a11yAudits?.length??0)>0),R=S.some(v=>v.seoScore!=null||(v.seoAudits?.length??0)>0);return e.jsxs(e.Fragment,{children:[k&&e.jsxs("button",{type:"button",onClick:v=>{v.stopPropagation(),f("performance")},title:"Page Speed (Lighthouse)",className:"inline-flex items-center gap-1 text-[9px] px-2 py-0.5 rounded-lg bg-violet-50 text-violet-600 hover:bg-violet-100 ring-1 ring-violet-200 font-semibold transition-colors flex-shrink-0",children:[e.jsx(ct,{size:9})," Speed"]}),E&&e.jsxs("button",{type:"button",onClick:v=>{v.stopPropagation(),f("accessibility")},title:"Accessibility (Lighthouse)",className:"inline-flex items-center gap-1 text-[9px] px-2 py-0.5 rounded-lg bg-blue-50 text-blue-600 hover:bg-blue-100 ring-1 ring-blue-200 font-semibold transition-colors flex-shrink-0",children:[e.jsx(Nu,{size:9})," A11y"]}),R&&e.jsxs("button",{type:"button",onClick:v=>{v.stopPropagation(),f("seo")},title:"SEO (Lighthouse)",className:"inline-flex items-center gap-1 text-[9px] px-2 py-0.5 rounded-lg bg-emerald-50 text-emerald-600 hover:bg-emerald-100 ring-1 ring-emerald-200 font-semibold transition-colors flex-shrink-0",children:[e.jsx(Bn,{size:9})," SEO"]})]})})(),s.device&&(()=>{const S=Pg(s.device),k=S?.category==="mobile"?ji:S?.category==="tablet"?xl:yr,E=S?.name??s.device;return e.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] text-teal-600 bg-teal-50 px-1.5 py-0.5 rounded ring-1 ring-teal-200 max-w-[90px] truncate",title:E,children:[e.jsx(k,{size:8})," ",E]})})(),y>0&&e.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] text-content-secondary bg-surface-inset px-1.5 py-0.5 rounded ring-1 ring-border",children:[e.jsx(Un,{size:8})," ",y]}),s.videoPath&&e.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] text-blue-600 bg-blue-50 px-1.5 py-0.5 rounded ring-1 ring-blue-200",children:[e.jsx($l,{size:8})," video"]}),s.tracePath&&e.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] text-violet-600 bg-violet-50 px-1.5 py-0.5 rounded ring-1 ring-violet-200",children:[e.jsx(Rf,{size:8})," trace"]}),e.jsxs("span",{className:"text-[10px] text-content-tertiary tabular-nums",children:[(s.duration/1e3).toFixed(1),"s"]})]})]}),o&&e.jsxs("div",{className:"bg-surface",children:[g.length>=2&&e.jsxs("div",{className:"px-4 py-3 border-b border-border",children:[e.jsx("p",{className:"text-[10px] text-content-tertiary uppercase tracking-wider mb-2",children:"Screenshot Filmstrip"}),e.jsx(ow,{steps:s.steps,onSelect:a})]}),d&&e.jsx(cw,{steps:s.steps}),s.steps.map(S=>e.jsx(fw,{step:S,onScreenshot:a},S.stepId)),s.videoPath&&e.jsx(gw,{videoPath:s.videoPath}),s.tracePath&&e.jsx(yw,{tracePath:s.tracePath})]}),h&&e.jsx(hw,{caseName:s.caseName,pageLoads:s.pageLoads??[],focus:h,onClose:()=>f(null)})]})}function vw({runId:s}){const{data:r=[]}=Oe({queryKey:["report",s,"downloads"],queryFn:()=>Si.downloads(s)});return r.length===0?null:e.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-surface-inset/50 border-b border-border",children:[e.jsx(ga,{size:12,className:"text-accent"}),e.jsx("span",{className:"text-xs font-semibold text-content",children:"Downloads"}),e.jsxs("span",{className:"text-[10px] text-content-tertiary",children:["· ",r.length," file",r.length!==1?"s":""]})]}),e.jsx("div",{className:"divide-y divide-border",children:r.map(a=>e.jsxs("a",{href:Si.downloadUrl(s,a.name),download:!0,className:"flex items-center justify-between px-3 py-2 hover:bg-surface-inset/50 transition-colors",children:[e.jsx("span",{className:"text-[11px] text-content font-mono truncate",children:a.name}),e.jsxs("span",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-content-tertiary tabular-nums",children:[(a.size/1024).toFixed(1)," KB"]}),e.jsx(ga,{size:12,className:"text-content-tertiary"})]})]},a.name))})]})}function jw({runId:s}){const[r,a]=p.useState(null),{data:o,isLoading:c}=Oe({queryKey:["report",s],queryFn:()=>Nl.get(s)});return c?e.jsx("div",{className:"flex items-center justify-center py-6",children:e.jsx(Me,{size:14,className:"animate-spin text-accent"})}):o?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"px-3.5 pb-3 space-y-2",children:[e.jsx(vw,{runId:s}),o.suites.map(d=>e.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-surface-inset/50 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ox,{status:d.status}),e.jsx("span",{className:"text-xs font-semibold text-content",children:d.suiteName}),e.jsxs("span",{className:"text-[10px] text-content-tertiary",children:["· ",d.browser]})]}),e.jsxs("span",{className:"text-[10px] text-content-tertiary tabular-nums",children:[(d.duration/1e3).toFixed(1),"s"]})]}),d.cases.map(x=>e.jsx(bw,{tc:x,suiteType:d.suiteType,onScreenshot:a},x.caseId))]},d.suiteId))]}),r&&e.jsx(pw,{src:r,onClose:()=>a(null)})]}):null}const dn={listBaselines:()=>fetch("/api/visual-regression/baselines").then(s=>s.json()),deleteBaseline:s=>fetch("/api/visual-regression/baselines",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:s})}).then(r=>r.json()),updateBaseline:s=>fetch("/api/visual-regression/baselines/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).then(r=>r.json()),listDiffRuns:()=>fetch("/api/visual-regression/diffs").then(s=>s.json()),getDiffRun:s=>fetch(`/api/visual-regression/diffs/${s}`).then(r=>r.json()),updateDiffStatus:(s,r,a)=>fetch(`/api/visual-regression/diffs/${s}/${r}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:a})}).then(o=>o.json()),approveAll:s=>fetch(`/api/visual-regression/diffs/${s}/approve-all`,{method:"POST"}).then(r=>r.json())},Nw={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 pr(s){const r=s.replace(/\\/g,"/"),a=r.indexOf("baselines/"),o=r.indexOf("results/"),c=Math.min(a>=0?a:1/0,o>=0?o:1/0);return`/api/visual-regression/image/${c<1/0?r.slice(c):r}`}function ww({diff:s,onClose:r}){const[a,o]=p.useState("side-by-side"),[c,d]=p.useState(50);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:r,children:e.jsxs("div",{className:"bg-surface rounded-xl border border-border shadow-2xl max-w-[90vw] max-h-[90vh] overflow-auto p-6",onClick:x=>x.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-semibold text-content",children:[s.caseName," — ",s.stepId]}),e.jsxs("p",{className:"text-xs text-content-tertiary",children:[s.browser," | ",s.viewport," | Diff: ",s.diffPercentage,"%"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[["side-by-side","slider"].map(x=>e.jsx("button",{onClick:()=>o(x),className:`px-2 py-1 text-xs rounded ${a===x?"bg-accent text-white":"bg-surface-inset text-content-secondary"}`,children:x==="side-by-side"?"Side by Side":"Slider"},x)),e.jsx("button",{onClick:r,className:"p-1 text-content-tertiary hover:text-content ml-2",children:e.jsx(Fe,{size:18})})]})]}),a==="side-by-side"?e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-content-tertiary mb-1 text-center",children:"Baseline"}),e.jsx("img",{src:pr(s.baselinePath),alt:"Baseline",className:"rounded border border-border w-full"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-content-tertiary mb-1 text-center",children:"Actual"}),e.jsx("img",{src:pr(s.actualPath),alt:"Actual",className:"rounded border border-border w-full"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-content-tertiary mb-1 text-center",children:"Diff"}),s.status==="new"||s.diffPercentage===0?e.jsx("div",{className:"rounded border border-border w-full h-full min-h-[120px] flex items-center justify-center bg-emerald-50 text-emerald-400",children:e.jsxs("div",{className:"text-center",children:[e.jsx(He,{size:24,className:"mx-auto mb-1"}),e.jsx("p",{className:"text-xs font-medium",children:s.status==="new"?"New Baseline":"No Difference"})]})}):e.jsx("img",{src:pr(s.diffPath),alt:"Diff",className:"rounded border border-border w-full",onError:x=>{x.target.style.display="none"}})]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"relative overflow-hidden rounded border border-border",style:{maxWidth:800},children:[e.jsx("img",{src:pr(s.actualPath),alt:"Actual",className:"w-full block"}),e.jsx("div",{className:"absolute inset-0 overflow-hidden",style:{width:`${c}%`},children:e.jsx("img",{src:pr(s.baselinePath),alt:"Baseline",className:"block",style:{width:"800px",maxWidth:"none"}})}),e.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-accent cursor-col-resize",style:{left:`${c}%`}})]}),e.jsx("input",{type:"range",min:0,max:100,value:c,onChange:x=>d(Number(x.target.value)),className:"w-full mt-2 accent-accent"}),e.jsxs("div",{className:"flex justify-between text-[10px] text-content-tertiary",children:[e.jsx("span",{children:"Baseline"}),e.jsx("span",{children:"Actual"})]})]})]})})}function kw({diff:s,runId:r,onImageClick:a}){const o=Pe(),c=oe({mutationFn:()=>dn.updateDiffStatus(r,s.stepId,"approved"),onSuccess:()=>{o.invalidateQueries({queryKey:["visual-diffs"]}),H.success("Approved")}}),d=oe({mutationFn:()=>dn.updateDiffStatus(r,s.stepId,"rejected"),onSuccess:()=>{o.invalidateQueries({queryKey:["visual-diffs"]}),H("Rejected")}}),x=oe({mutationFn:()=>dn.updateBaseline({actualPath:s.actualPath,baselinePath:s.baselinePath}),onSuccess:()=>{o.invalidateQueries({queryKey:["visual-baselines","visual-diffs"]}),H.success("Baseline updated")}});return e.jsxs(Wl,{padding:!1,className:"overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-border bg-surface-inset flex items-center gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-sm font-medium text-content truncate",children:[s.suiteName," / ",s.caseName]}),e.jsxs("p",{className:"text-xs text-content-tertiary mt-0.5",children:["Step: ",s.stepId," | ",s.browser," | ",s.viewport]})]}),e.jsx(Ml,{label:s.status,color:Nw[s.status]}),e.jsx(Ml,{label:`${s.diffPercentage}%`,color:s.diffPercentage<=s.threshold?"bg-emerald-50 text-emerald-700":"bg-red-50 text-red-700"})]}),e.jsx("div",{className:"grid grid-cols-3 gap-2 p-3 cursor-pointer",onClick:()=>a(s),children:["Baseline","Actual","Diff"].map(h=>{const f=h==="Baseline"?s.baselinePath:h==="Actual"?s.actualPath:s.diffPath,y=h==="Diff"&&(s.status==="new"||s.diffPercentage===0);return e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-medium text-content-tertiary mb-1 text-center",children:h}),y?e.jsx("div",{className:"rounded border border-border w-full h-24 flex items-center justify-center bg-emerald-50 text-emerald-400",children:e.jsxs("div",{className:"text-center",children:[e.jsx(He,{size:14,className:"mx-auto mb-0.5"}),e.jsx("p",{className:"text-[9px] font-medium",children:s.status==="new"?"New Baseline":"No Diff"})]})}):e.jsx("img",{src:pr(f),alt:h,className:"rounded border border-border w-full h-24 object-cover object-top",onError:g=>{g.target.style.display="none"}})]},h)})}),e.jsxs("div",{className:"px-4 py-2 border-t border-border flex items-center gap-2 justify-end",children:[(s.status==="failed"||s.status==="new")&&e.jsxs(e.Fragment,{children:[e.jsxs(ve,{size:"sm",variant:"ghost",loading:x.isPending,onClick:()=>x.mutate(),children:[e.jsx(Qu,{size:14})," Update Baseline"]}),e.jsxs(ve,{size:"sm",variant:"ghost",loading:c.isPending,onClick:()=>c.mutate(),children:[e.jsx(Qe,{size:14})," Approve"]}),e.jsxs(ve,{size:"sm",variant:"ghost",loading:d.isPending,onClick:()=>d.mutate(),children:[e.jsx(Fe,{size:14})," Reject"]})]}),s.status==="approved"&&e.jsxs("span",{className:"text-xs text-green-600 flex items-center gap-1",children:[e.jsx(He,{size:14})," Approved"]}),s.status==="rejected"&&e.jsxs("span",{className:"text-xs text-red-600 flex items-center gap-1",children:[e.jsx(St,{size:14})," Rejected"]}),s.status==="passed"&&e.jsxs("span",{className:"text-xs text-emerald-600 flex items-center gap-1",children:[e.jsx(He,{size:14})," Passed"]})]})]})}function Sw(){const s=Pe(),[r,a]=p.useState(""),[o,c]=p.useState(null),{data:d=[],isLoading:x}=Oe({queryKey:["visual-diff-runs"],queryFn:dn.listDiffRuns}),h=r||(d.length>0?d[0].runId:""),{data:f,isLoading:y}=Oe({queryKey:["visual-diffs",h],queryFn:()=>dn.getDiffRun(h),enabled:!!h}),g=oe({mutationFn:()=>dn.approveAll(h),onSuccess:()=>{s.invalidateQueries({queryKey:["visual-diffs","visual-diff-runs"]}),H.success("All diffs approved")}});if(x)return e.jsxs("div",{className:"flex items-center justify-center py-16 text-content-tertiary",children:[e.jsx(Me,{className:"animate-spin mr-2",size:18})," Loading diff runs..."]});if(d.length===0)return e.jsxs("div",{className:"text-center py-12",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-purple-50 text-purple-400 mb-4",children:e.jsx(Ff,{size:28})}),e.jsx("h3",{className:"text-sm font-semibold text-content mb-1",children:"No Visual Diffs Yet"}),e.jsxs("p",{className:"text-xs text-content-tertiary max-w-md mx-auto leading-relaxed mb-4",children:["Visual diffs are generated when tests run with visual regression enabled. Enable it in ",e.jsx("strong",{children:"Settings"}),", toggle the ",e.jsx("strong",{children:"Eye icon"})," on steps you want to compare, then run your tests."]}),e.jsxs("div",{className:"inline-flex flex-col gap-2 text-left bg-surface-inset rounded-xl p-4 border border-border",children:[e.jsx("p",{className:"text-[11px] font-semibold text-content mb-1",children:"To generate diffs:"}),["Enable Visual Regression in Settings → Visual Regression section","Toggle the Eye icon on steps in Test Editor for per-step comparison","Run tests — first run creates baselines, subsequent runs generate diffs","Come back here to review, approve, or reject visual changes"].map((v,C)=>e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-[10px] font-bold bg-purple-100 text-purple-600 w-5 h-5 rounded flex items-center justify-center flex-shrink-0",children:C+1}),e.jsx("p",{className:"text-[11px] text-content-secondary",children:v})]},C))]})]});const j=f?.diffs??[],P=j.filter(v=>v.status==="passed").length,S=j.filter(v=>v.status==="failed").length,k=j.filter(v=>v.status==="new").length,E=j.filter(v=>v.status==="approved").length,R=j.filter(v=>v.status==="rejected").length;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4 flex-wrap",children:[e.jsx("select",{value:h,onChange:v=>a(v.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:d.map(v=>e.jsxs("option",{value:v.runId,children:[v.runId," (",new Date(v.timestamp).toLocaleString(),")"]},v.runId))}),e.jsxs("div",{className:"flex items-center gap-2 text-xs flex-wrap",children:[e.jsxs("span",{className:"text-emerald-600 font-semibold",children:[P," passed"]}),e.jsx("span",{className:"text-content-tertiary",children:"/"}),e.jsxs("span",{className:"text-red-600 font-semibold",children:[S," failed"]}),e.jsx("span",{className:"text-content-tertiary",children:"/"}),e.jsxs("span",{className:"text-blue-600 font-semibold",children:[k," new"]}),E>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-content-tertiary",children:"/"}),e.jsxs("span",{className:"text-green-600 font-semibold",children:[E," approved"]})]}),R>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-content-tertiary",children:"/"}),e.jsxs("span",{className:"text-orange-600 font-semibold",children:[R," rejected"]})]})]}),e.jsx("div",{className:"flex-1"}),(S>0||k>0)&&e.jsxs(ve,{size:"sm",variant:"secondary",loading:g.isPending,onClick:()=>g.mutate(),children:[e.jsx(He,{size:14})," Approve All"]})]}),y?e.jsxs("div",{className:"flex items-center justify-center py-12 text-content-tertiary",children:[e.jsx(Me,{className:"animate-spin mr-2",size:18})," Loading diffs..."]}):j.length===0?e.jsx("div",{className:"text-center py-12 text-content-tertiary text-sm",children:"No diffs in this run."}):e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:j.map(v=>e.jsx(kw,{diff:v,runId:h,onImageClick:c},`${v.stepId}-${v.browser}-${v.viewport}`))}),o&&e.jsx(ww,{diff:o,onClose:()=>c(null)})]})}function Cw(){const s=Pe(),[r,a]=p.useState(new Set),{data:o=[],isLoading:c}=Oe({queryKey:["visual-baselines"],queryFn:dn.listBaselines}),d=oe({mutationFn:y=>dn.deleteBaseline(y),onSuccess:()=>{s.invalidateQueries({queryKey:["visual-baselines"]}),H.success("Baseline deleted")}}),x=oe({mutationFn:async()=>{for(const y of r)await dn.deleteBaseline(y)},onSuccess:()=>{a(new Set),s.invalidateQueries({queryKey:["visual-baselines"]}),H.success(`${r.size} baselines deleted`)}}),h=y=>a(g=>{const j=new Set(g);return j.has(y)?j.delete(y):j.add(y),j}),f=()=>a(r.size===o.length?new Set:new Set(o.map(y=>y.path)));return c?e.jsxs("div",{className:"flex items-center justify-center py-16 text-content-tertiary",children:[e.jsx(Me,{className:"animate-spin mr-2",size:18})," Loading baselines..."]}):o.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-purple-50 text-purple-400 mb-4",children:e.jsx(yr,{size:28})}),e.jsx("h3",{className:"text-sm font-semibold text-content mb-1",children:"No Baselines Yet"}),e.jsx("p",{className:"text-xs text-content-tertiary max-w-md mx-auto leading-relaxed mb-4",children:"Baselines are the “golden” reference screenshots. They are created automatically on the first test run with visual regression enabled."}),e.jsxs("div",{className:"inline-flex flex-col gap-2 text-left bg-surface-inset rounded-xl p-4 border border-border",children:[e.jsx("p",{className:"text-[11px] font-semibold text-content mb-1",children:"How baselines work:"}),[{icon:Un,text:"First run — screenshots become baselines automatically"},{icon:Ff,text:"Next runs — new screenshots are compared against baselines"},{icon:He,text:"Update — approve changes to replace old baselines"}].map(({icon:y,text:g})=>e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(y,{size:12,className:"text-purple-500 mt-0.5 flex-shrink-0"}),e.jsx("p",{className:"text-[11px] text-content-secondary",children:g})]},g))]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsxs("label",{className:"flex items-center gap-2 text-xs text-content-secondary cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:r.size===o.length&&o.length>0,onChange:f,className:"rounded border-border accent-accent"}),"Select all (",o.length,")"]}),r.size>0&&e.jsxs(ve,{size:"sm",variant:"danger",loading:x.isPending,onClick:()=>x.mutate(),children:[e.jsx(es,{size:14})," Delete ",r.size," selected"]})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:o.map(y=>e.jsxs(Wl,{padding:!1,className:"overflow-hidden group",children:[e.jsxs("div",{className:"relative",children:[e.jsx("img",{src:pr(y.path),alt:y.fileName,className:"w-full h-32 object-cover object-top",onError:g=>{g.target.className="w-full h-32 bg-surface-inset"}}),e.jsx("input",{type:"checkbox",checked:r.has(y.path),onChange:()=>h(y.path),className:"absolute top-2 left-2 rounded border-border accent-accent"})]}),e.jsxs("div",{className:"px-3 py-2",children:[e.jsxs("p",{className:"text-xs font-medium text-content truncate",children:[y.suite," / ",y.caseName]}),e.jsx("p",{className:"text-[10px] text-content-tertiary truncate mt-0.5",children:y.fileName}),e.jsxs("p",{className:"text-[10px] text-content-tertiary",children:[(y.sizeBytes/1024).toFixed(1)," KB"]})]}),e.jsx("div",{className:"px-3 py-2 border-t border-border flex justify-end opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx("button",{onClick:()=>d.mutate(y.path),disabled:d.isPending,className:"p-1 text-content-tertiary hover:text-red-500 transition-colors",title:"Delete baseline",children:e.jsx(es,{size:14})})})]},y.path))})]})}function Ew(){const[s,r]=p.useState(""),[a,o]=p.useState("runs"),{modalProps:c,confirmDelete:d}=zs(),x=Pe(),{data:h=[],isLoading:f}=Oe({queryKey:["reports"],queryFn:()=>Nl.list(30)}),y=oe({mutationFn:Nl.delete,onSuccess:()=>{x.invalidateQueries({queryKey:["reports"]}),H.success("Report deleted")},onError:k=>H.error(k.message)}),g=h.reduce((k,E)=>k+E.passed,0),j=h.reduce((k,E)=>k+E.failed,0),P=h.reduce((k,E)=>k+E.skipped,0),S=[{key:"runs",label:"Run Reports",icon:Ms},{key:"visual-diffs",label:"Visual Diffs",icon:ka},{key:"baselines",label:"Baselines",icon:Qu}];return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:[e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-blue-500 to-indigo-600 flex items-center justify-center shadow-sm shadow-blue-500/20",children:e.jsx(Ms,{size:17,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-sm font-bold text-content",children:"Reports"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Run results · Visual regression · Baselines"})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:a==="runs"&&h.length>0&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1 bg-surface-inset text-content-tertiary ring-border",children:[h.length," ",e.jsx("span",{className:"opacity-60 font-normal",children:"runs"})]}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1 bg-emerald-50 text-emerald-600 ring-emerald-200",children:[g," ",e.jsx("span",{className:"opacity-60 font-normal",children:"passed"})]}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1 bg-red-50 text-red-600 ring-red-200",children:[j," ",e.jsx("span",{className:"opacity-60 font-normal",children:"failed"})]}),P>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1 bg-amber-50 text-amber-600 ring-amber-200",children:[P," ",e.jsx("span",{className:"opacity-60 font-normal",children:"skip"})]})]})})]}),e.jsx("div",{className:"flex items-center gap-0 border-t border-border px-4",children:S.map(({key:k,label:E,icon:R})=>e.jsxs("button",{onClick:()=>o(k),className:O("flex items-center gap-1.5 px-4 py-2 text-xs font-medium border-b-2 transition-colors",a===k?"border-accent text-accent":"border-transparent text-content-tertiary hover:text-content-secondary"),children:[e.jsx(R,{size:13})," ",E]},k))})]}),a==="visual-diffs"&&e.jsx(Sw,{}),a==="baselines"&&e.jsx(Cw,{}),a==="runs"&&e.jsxs(e.Fragment,{children:[f&&e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(Me,{size:18,className:"animate-spin text-accent"})}),!f&&h.length===0&&e.jsxs("div",{className:"rounded-xl border border-dashed border-border bg-surface flex flex-col items-center justify-center py-14 gap-2.5",children:[e.jsx("div",{className:"w-11 h-11 rounded-xl bg-surface-inset flex items-center justify-center",children:e.jsx(Ms,{size:20,className:"text-content-tertiary"})}),e.jsx("p",{className:"text-xs font-medium text-content-secondary",children:"No runs yet"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Configure and start a run first. Enable screenshot, video, and trace in Settings."})]}),e.jsx("div",{className:"space-y-2",children:h.map(k=>{const E=s===k.runId;return e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden hover:border-accent/20 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 py-2.5 cursor-pointer hover:bg-surface-inset/30 select-none transition-colors",onClick:()=>r(R=>R===k.runId?"":k.runId),children:[E?e.jsx(kt,{size:12,className:"text-content-tertiary flex-shrink-0"}):e.jsx(Zt,{size:12,className:"text-content-tertiary flex-shrink-0"}),e.jsx(ox,{status:k.status}),k.environment&&e.jsx("span",{className:"text-[8px] px-1.5 py-0.5 rounded font-bold uppercase ring-1 bg-emerald-50 text-emerald-600 ring-emerald-200 flex-shrink-0",children:k.environment}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-[10px] font-mono text-content-secondary",children:[k.runId.slice(0,12),"…"]}),e.jsxs("p",{className:"text-[9px] text-content-tertiary flex items-center gap-1 mt-0.5",children:[e.jsx(Er,{size:8}),zN(new Date(k.startedAt),"MMM d, HH:mm")," · ",Cl(new Date(k.startedAt),{addSuffix:!0})]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-[10px] flex-shrink-0",children:[e.jsxs("span",{className:"text-emerald-600 font-semibold tabular-nums",children:[k.passed,"✓"]}),e.jsxs("span",{className:"text-red-500 font-semibold tabular-nums",children:[k.failed,"✗"]}),k.skipped>0&&e.jsxs("span",{className:"text-content-tertiary tabular-nums",children:[k.skipped,"skip"]}),e.jsx("div",{className:"w-px h-3 bg-border"}),e.jsx("span",{className:"text-content-tertiary tabular-nums",children:k.duration!=null?(k.duration/1e3).toFixed(1)+"s":"—"})]}),e.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",onClick:R=>R.stopPropagation(),children:[k.logFilePath&&e.jsx("a",{href:Sa("logs",k.logFilePath),target:"_blank",rel:"noopener noreferrer",title:"Run Log",className:"p-1 rounded-md text-emerald-500 hover:bg-emerald-50 transition-colors",children:e.jsx(Ws,{size:13})}),e.jsx("a",{href:`/allure/${k.runId}`,target:"_blank",rel:"noopener noreferrer",title:"Allure Report",className:"p-1 rounded-md text-blue-500 hover:bg-blue-50 transition-colors",children:e.jsx(Ms,{size:13})}),e.jsx("button",{type:"button",title:"Delete",onClick:()=>d("Delete this report? This cannot be undone.",()=>y.mutate(k.runId)),className:"p-1 rounded-md text-content-tertiary hover:text-red-500 hover:bg-red-50 transition-colors",children:e.jsx(es,{size:12})})]})]}),E&&e.jsx(jw,{runId:k.runId})]},k.runId)})},"runs")]})]})}),e.jsx(Ts,{...c})]})}function Pw({value:s,onCommit:r,placeholder:a,type:o="text",mono:c=!1,uppercase:d=!1,disabled:x=!1,className:h,inputClassName:f,title:y}){const[g,j]=p.useState(!1),[P,S]=p.useState(s),k=p.useRef(null);p.useEffect(()=>{g||S(s)},[s,g]);const E=()=>{x||(S(s),j(!0))};p.useEffect(()=>{g&&k.current?.focus()},[g]);const R=()=>{j(!1),P!==s&&r(P)},v=()=>{S(s),j(!1)},C=O("flex-1 min-w-0 border rounded-lg px-2.5 py-1.5 text-xs bg-surface",c&&"font-mono",d&&"uppercase",g?"border-accent/40 text-content-secondary focus:outline-none focus:ring-2 focus:ring-accent/30":"border-border text-content-tertiary bg-surface-inset/40 cursor-default select-none",f);return e.jsxs("div",{className:O("flex items-center gap-1.5",h),children:[e.jsx("input",{ref:k,type:o,value:P,placeholder:a,title:y,readOnly:!g,tabIndex:g?0:-1,onChange:D=>S(d?D.target.value.toUpperCase():D.target.value),onBlur:()=>g&&R(),onKeyDown:D=>{D.key==="Enter"?D.target.blur():D.key==="Escape"&&v()},className:C}),g?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",title:"Save",onMouseDown:D=>{D.preventDefault(),R()},className:"p-1.5 rounded-lg text-emerald-600 hover:bg-emerald-50 dark:hover:bg-emerald-500/10 transition-colors flex-shrink-0",children:e.jsx(Qe,{size:13})}),e.jsx("button",{type:"button",title:"Cancel",onMouseDown:D=>{D.preventDefault(),v()},className:"p-1.5 rounded-lg text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-500/10 transition-colors flex-shrink-0",children:e.jsx(Fe,{size:13})})]}):e.jsx("button",{type:"button",title:x?void 0:"Edit",onClick:E,disabled:x,className:"p-1.5 rounded-lg text-content-tertiary hover:text-accent hover:bg-surface-inset disabled:opacity-30 disabled:hover:text-content-tertiary transition-colors flex-shrink-0",children:e.jsx(mn,{size:12})})]})}const xr="GLOBAL";function Rw(){const s=Pe(),{modalProps:r,confirmDelete:a}=zs(),{data:o,isLoading:c}=Oe({queryKey:["variables-matrix"],queryFn:()=>Ud.matrix()}),[d,x]=p.useState(""),[h,f]=p.useState(!1),[y,g]=p.useState([]),[j,P]=p.useState(new Set),[S,k]=p.useState({}),E=o?.environments??[],R=[xr,...E],v=(()=>{const _=[...o?.entries??[]],ee=new Set(_.map($=>$.key));for(const $ of y)ee.has($.key)||_.push({key:$.key,secret:$.secret,global:"",values:{}});return _})(),C=oe({mutationFn:({key:_,scope:ee,value:$,secret:G})=>Ud.setScope(_,ee,G&&$?{value:$,secret:!0}:$),onSuccess:()=>{s.invalidateQueries({queryKey:["variables-matrix"]}),s.invalidateQueries({queryKey:["variables"]})},onError:_=>H.error(_.message)}),D=oe({mutationFn:_=>Ud.deleteEverywhere(_),onSuccess:()=>{s.invalidateQueries({queryKey:["variables-matrix"]}),H.success("Variable deleted")},onError:_=>H.error(_.message)}),M=_=>S[_.key]??_.secret,w=_=>{const ee=!M(_);k($=>({...$,[_.key]:ee})),_.global&&C.mutate({key:_.key,scope:xr,value:_.global,secret:ee});for(const $ of E){const G=_.values[$];G&&C.mutate({key:_.key,scope:$,value:G,secret:ee})}},N=()=>{const _=d.trim().toUpperCase().replace(/[^A-Z0-9_]/g,"_");if(_){if(_==="BASE_URL"){H.error("BASE_URL is managed in Settings → Environment");return}if(v.some(ee=>ee.key===_)){H.error("Variable already exists");return}g(ee=>[...ee,{key:_,secret:h}]),k(ee=>({...ee,[_]:h})),x(""),f(!1)}},K=v.filter(_=>M(_)).length;return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:[e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-teal-500 to-emerald-600 flex items-center justify-center shadow-sm shadow-teal-500/20",children:e.jsx(Ef,{size:17,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-sm font-bold text-content",children:"Variables"}),e.jsxs("p",{className:"text-[10px] text-content-tertiary",children:["Per-environment values for ",e.jsx("code",{className:"text-accent",children:"{{VARIABLE_NAME}}"}),". CI/CD secrets (matching env vars) override these at runtime."]})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1 bg-surface-inset text-content-tertiary ring-border",children:[v.length," ",e.jsx("span",{className:"opacity-60 font-normal",children:"vars"})]}),K>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1 bg-amber-50 text-amber-600 ring-amber-200 dark:bg-amber-500/10 dark:ring-amber-500/30 dark:text-amber-300",children:[e.jsx(Dd,{size:7})," ",K," ",e.jsx("span",{className:"opacity-60 font-normal",children:"secret"})]})]})]}),e.jsxs("div",{className:"px-4 py-2.5 bg-surface-inset/40 border-t border-border flex items-center gap-2",children:[e.jsxs("div",{className:"relative flex-1 min-w-0",children:[e.jsx(hp,{size:10,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-content-tertiary pointer-events-none"}),e.jsx("input",{className:"w-full text-xs font-mono uppercase tracking-wide border border-border rounded-lg pl-7 pr-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"VARIABLE_NAME",value:d,onChange:_=>x(_.target.value.toUpperCase().replace(/[^A-Z0-9_]/g,"_")),onKeyDown:_=>_.key==="Enter"&&N()})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-[9px] text-content-tertiary cursor-pointer select-none",children:[e.jsx(va,{checked:h,onChange:f})," ",e.jsx(Dd,{size:9})," secret"]}),e.jsxs(ve,{size:"sm",onClick:N,disabled:!d.trim(),children:[e.jsx(Vs,{size:10})," Add"]})]})]}),c?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(Me,{size:18,className:"animate-spin text-accent"})}):v.length===0?e.jsxs("div",{className:"rounded-xl border border-border bg-surface flex flex-col items-center justify-center py-14 gap-2.5",children:[e.jsx("div",{className:"w-11 h-11 rounded-xl bg-surface-inset flex items-center justify-center",children:e.jsx(hp,{size:20,className:"text-content-tertiary"})}),e.jsx("p",{className:"text-xs font-medium text-content-secondary",children:"No variables yet"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Add your first variable above, then set a value per environment."})]}):v.map(_=>{const ee=M(_),$=j.has(_.key);return e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-2 flex items-center justify-between bg-surface-inset/40 border-b border-border",children:[e.jsx("code",{className:"text-[11px] font-mono text-accent font-semibold",children:`{{${_.key}}}`}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("label",{className:"flex items-center gap-1 text-[9px] text-content-tertiary cursor-pointer select-none",children:[e.jsx(va,{checked:ee,onChange:()=>w(_)})," ",e.jsx(Dd,{size:8})," secret"]}),ee&&e.jsx("button",{type:"button",onClick:()=>P(G=>{const le=new Set(G);return le.has(_.key)?le.delete(_.key):le.add(_.key),le}),className:"p-1 rounded-md text-content-tertiary hover:text-content-secondary",title:$?"Hide":"Show",children:$?e.jsx(Pf,{size:11}):e.jsx(ka,{size:11})}),e.jsx("button",{type:"button",title:"Delete variable (all environments)",onClick:()=>a(`Delete "${_.key}" from all environments?`,()=>D.mutate(_.key)),className:"p-1 rounded-md text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-500/10 transition-colors",children:e.jsx(es,{size:11})})]})]}),e.jsx("div",{className:"p-3 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2.5",children:R.map(G=>e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-bold uppercase tracking-wide text-content-tertiary block mb-1",children:G===xr?"Global (default)":G}),e.jsx(Pw,{type:ee&&!$?"password":"text",mono:!0,value:G===xr?_.global:_.values[G]??"",placeholder:G===xr?"default value":"inherits global",title:`Edit ${G===xr?"global":G} value`,inputClassName:"text-[11px]",onCommit:le=>{const je=G===xr?_.global:_.values[G]??"";le!==je&&(g(ke=>ke.filter(Ce=>Ce.key!==_.key)),C.mutate({key:_.key,scope:G,value:le,secret:M(_)}))}})]},G))})]},_.key)}),e.jsxs("p",{className:"text-[10px] text-content-tertiary px-1",children:["💡 An environment value overrides the global default. In CI/CD, a repository secret with the same key name (e.g. ",e.jsx("code",{className:"text-accent",children:"ADMIN_PASSWORD"}),") overrides both. Manage environments in ",e.jsx("strong",{children:"Settings → Environment"}),"."]})]})}),e.jsx(Ts,{...r})]})}const Mw={1:"Smart Retry",2:"AI Regeneration",3:"Multi-Selector",4:"Visual/SoM",5:"Decompose",6:"Manual"};function Tw({event:s}){const r=Pe(),{modalProps:a,confirmDelete:o}=zs(),c=oe({mutationFn:()=>cn.accept(s.id),onSuccess:()=>{r.invalidateQueries({queryKey:["healing"]}),H.success("Healing accepted — test file updated")},onError:h=>H.error(h.message)}),d=oe({mutationFn:()=>cn.reject(s.id),onSuccess:()=>{r.invalidateQueries({queryKey:["healing"]}),H("Healing rejected")},onError:h=>H.error(h.message)}),x=oe({mutationFn:()=>cn.delete(s.id),onSuccess:()=>{r.invalidateQueries({queryKey:["healing"]}),H.success("Event deleted")},onError:h=>H.error(h.message)});return e.jsxs(e.Fragment,{children:[e.jsxs(Wl,{className:"overflow-hidden",padding:!1,children:[e.jsxs("div",{className:"px-4 py-3 border-b border-border bg-surface-inset flex items-center gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-content-secondary truncate",children:s.instruction}),e.jsxs("p",{className:"text-xs text-content-tertiary mt-0.5",children:["Case: ",s.caseId," · Level ",s.level,": ",Mw[s.level]??"Unknown"]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(Ml,{label:s.status,color:s.status==="pending"?"bg-yellow-100 text-yellow-700":s.status==="accepted"?"bg-green-100 text-green-700":"bg-slate-100 text-content-secondary"}),e.jsx("button",{type:"button",onClick:()=>o("Delete this healing event? This cannot be undone.",()=>x.mutate()),disabled:x.isPending,className:"p-1 text-content-tertiary hover:text-red-500 transition-colors",title:"Delete event",children:e.jsx(es,{size:13})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 divide-x divide-border-muted",children:[e.jsxs("div",{className:"p-3",children:[e.jsx("p",{className:"text-xs font-semibold text-red-500 mb-1",children:"Before (failed)"}),e.jsx("pre",{className:"text-xs font-mono text-content-secondary bg-red-50 rounded p-2 overflow-x-auto whitespace-pre-wrap break-all max-h-32",children:s.failedCode||"// (no code)"})]}),e.jsxs("div",{className:"p-3",children:[e.jsx("p",{className:"text-xs font-semibold text-green-600 mb-1",children:"After (healed)"}),e.jsx("pre",{className:"text-xs font-mono text-content-secondary bg-green-50 rounded p-2 overflow-x-auto whitespace-pre-wrap break-all max-h-32",children:s.healedCode})]})]}),s.status==="pending"&&e.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-t border-border bg-surface-inset",children:[e.jsxs(ve,{size:"sm",onClick:()=>c.mutate(),loading:c.isPending,children:[e.jsx(Qe,{size:13})," Accept & Update File"]}),e.jsxs(ve,{variant:"secondary",size:"sm",onClick:()=>d.mutate(),loading:d.isPending,children:[e.jsx(Fe,{size:13})," Reject"]})]})]}),e.jsx(Ts,{...a})]})}function ou({title:s,events:r}){return e.jsxs("div",{className:"mb-8",children:[e.jsxs("h2",{className:"text-sm font-semibold text-content-secondary mb-3",children:[s," (",r.length,")"]}),e.jsx("div",{className:"space-y-3 max-h-[680px] overflow-y-auto pr-1",children:r.map(a=>e.jsx(Tw,{event:a},a.id))})]})}function zw(){const s=Pe(),{modalProps:r,confirmDelete:a}=zs(),{data:o=[],isLoading:c}=Oe({queryKey:["healing","pending"],queryFn:()=>cn.pending()}),{data:d}=Oe({queryKey:["healing","stats"],queryFn:()=>cn.stats()}),{data:x=[]}=Oe({queryKey:["healing"],queryFn:()=>cn.list()}),h=oe({mutationFn:cn.acceptAll,onSuccess:k=>{s.invalidateQueries({queryKey:["healing"]}),H.success(`Accepted ${k.accepted} heal(s)`)},onError:k=>H.error(k.message)}),f=oe({mutationFn:cn.deleteAll,onSuccess:k=>{s.invalidateQueries({queryKey:["healing"]}),H.success(`Cleared ${k.deleted} event(s)`)},onError:k=>H.error(k.message)}),y=(k,E)=>k.createdAt<E.createdAt?1:-1,g=[...o].sort(y),j=[...x.filter(k=>k.status==="accepted")].sort(y),P=[...x.filter(k=>k.status==="rejected")].sort(y),S=()=>{a("Delete all healing events? This cannot be undone.",()=>f.mutate())};return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex-shrink-0 px-6 py-4 border-b border-border flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-xl font-bold text-content flex items-center gap-2",children:[e.jsx(vl,{size:20,className:"text-accent"})," Self-Healing"]}),e.jsx("p",{className:"text-sm text-content-tertiary mt-0.5",children:"Review AI-generated fixes for broken test steps"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[x.length>0&&e.jsxs(ve,{variant:"secondary",onClick:S,loading:f.isPending,children:[e.jsx(Zv,{size:14})," Delete All"]}),o.length>0&&e.jsxs(ve,{onClick:()=>h.mutate(),loading:h.isPending,children:[e.jsx(Sf,{size:15})," Accept All (",o.length,")"]})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[d&&e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsx(nl,{label:"Total Events",value:d.total,color:"blue"}),e.jsx(nl,{label:"Pending Review",value:d.pending,color:"orange"}),e.jsx(nl,{label:"Accepted",value:d.accepted,color:"green"}),e.jsx(nl,{label:"Rejected",value:d.rejected,color:"purple"})]}),c&&e.jsx("p",{className:"text-sm text-content-tertiary text-center py-12",children:"Loading…"}),g.length>0&&e.jsx(ou,{title:"Pending Review",events:g}),!c&&o.length===0&&e.jsxs(Wl,{className:"text-center py-12 mb-6",children:[e.jsx(vl,{size:32,className:"text-slate-200 mx-auto mb-3"}),e.jsx("p",{className:"text-content-secondary font-medium",children:"No pending heals"}),e.jsx("p",{className:"text-content-tertiary text-sm mt-1",children:"Self-healing events appear here when tests fail and AI generates a fix"})]}),j.length>0&&e.jsx(ou,{title:"Accepted",events:j}),P.length>0&&e.jsx(ou,{title:"Rejected",events:P})]}),e.jsx(Ts,{...r})]})}function is({label:s,hint:r,children:a}){return e.jsxs("div",{className:"flex items-start gap-4 py-2.5 border-b border-border/50 last:border-0",children:[e.jsxs("div",{className:"w-40 flex-shrink-0 pt-0.5",children:[e.jsx("p",{className:"text-[11px] font-semibold text-content-secondary",children:s}),r&&e.jsx("p",{className:"text-[10px] text-content-tertiary mt-0.5 leading-relaxed",children:r})]}),e.jsx("div",{className:"flex-1 min-w-0",children:a})]})}function wt({label:s,hint:r,checked:a,onChange:o}){return e.jsxs("div",{className:"flex items-start gap-3 py-2.5 border-b border-border/50 last:border-0",children:[e.jsx("div",{className:"pt-0.5 flex-shrink-0",children:e.jsx(va,{checked:a,onChange:o})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-semibold text-content-secondary",children:s}),r&&e.jsx("p",{className:"text-[10px] text-content-tertiary mt-0.5",children:r})]})]})}function Hs({icon:s,iconBg:r,title:a,desc:o,children:c}){return e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center gap-2.5",children:[e.jsx("div",{className:O("w-7 h-7 rounded-lg flex items-center justify-center flex-shrink-0 shadow-sm",r),children:e.jsx(s,{size:13,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-xs font-bold text-content",children:a}),o&&e.jsx("p",{className:"text-[9px] text-content-tertiary",children:o})]})]}),e.jsx("div",{className:"px-4 py-1",children:c})]})}function ln(s){return e.jsx("input",{...s,className:O("border border-border rounded-lg px-2.5 py-1.5 text-xs bg-surface text-content-secondary","focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/40",s.className)})}function Aw({env:s,url:r,isActive:a,canRemove:o,onSave:c,onRemove:d}){const[x,h]=p.useState(!1),[f,y]=p.useState(s),[g,j]=p.useState(r),P=()=>{y(s),j(r),h(!0)},S=()=>{h(!1),c(f.trim()||s,g.trim())},k=()=>{h(!1)};return x?e.jsxs("div",{className:"flex items-center gap-2 p-1.5 rounded-lg border border-accent/40 bg-accent/5",children:[e.jsx("input",{autoFocus:!0,value:f,onChange:E=>y(E.target.value.toUpperCase()),onKeyDown:E=>{E.key==="Enter"?S():E.key==="Escape"&&k()},className:"w-24 text-[10px] font-bold uppercase text-center py-1.5 rounded-lg border border-border bg-surface text-content focus:outline-none focus:ring-2 focus:ring-accent/30"}),e.jsx("input",{value:g,placeholder:`https://${s.toLowerCase()}.example.com`,onChange:E=>j(E.target.value),onKeyDown:E=>{E.key==="Enter"?S():E.key==="Escape"&&k()},className:"flex-1 min-w-0 text-xs py-1.5 px-2.5 rounded-lg border border-border bg-surface text-content-secondary focus:outline-none focus:ring-2 focus:ring-accent/30"}),e.jsx("button",{type:"button",title:"Save",onClick:S,className:"p-1.5 rounded-lg text-emerald-600 hover:bg-emerald-50 dark:hover:bg-emerald-500/10 transition-colors flex-shrink-0",children:e.jsx(Qe,{size:14})}),e.jsx("button",{type:"button",title:"Cancel",onClick:k,className:"p-1.5 rounded-lg text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-500/10 transition-colors flex-shrink-0",children:e.jsx(Fe,{size:14})})]}):e.jsxs("div",{className:"group flex items-center gap-2 p-1.5 rounded-lg border border-border bg-surface-inset/30 hover:bg-surface-inset/60 transition-colors",children:[e.jsx("span",{className:O("w-24 flex-shrink-0 text-center text-[10px] font-bold uppercase py-1.5 rounded-md",a?"bg-accent/15 text-accent":"bg-surface text-content-secondary ring-1 ring-border"),children:s}),e.jsx("span",{className:"flex-1 min-w-0 truncate text-xs px-1 text-content-tertiary",children:r||e.jsx("span",{className:"italic opacity-60",children:"no URL set"})}),e.jsx("button",{type:"button",title:"Edit",onClick:P,className:"p-1.5 rounded-lg text-content-tertiary hover:text-accent hover:bg-surface transition-colors flex-shrink-0",children:e.jsx(mn,{size:13})}),e.jsx("button",{type:"button",title:"Remove environment",onClick:d,disabled:!o,className:"p-1.5 rounded-lg text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-500/10 disabled:opacity-30 transition-colors flex-shrink-0",children:e.jsx(es,{size:13})})]})}function wi({value:s,onChange:r,options:a,className:o}){return e.jsx("select",{value:s,onChange:c=>r(c.target.value),className:O("border border-border rounded-lg px-2.5 py-1.5 text-xs bg-surface text-content-secondary","focus:outline-none focus:ring-2 focus:ring-accent/30",o),children:a.map(c=>e.jsx("option",{value:c.value,children:c.label},c.value))})}const lu=[{label:"Standard (1280×720)",width:1280,height:720},{label:"Laptop (1366×768)",width:1366,height:768},{label:"Full HD (1920×1080)",width:1920,height:1080},{label:"Mobile (390×844)",width:390,height:844},{label:"Tablet (768×1024)",width:768,height:1024},{label:"Custom",width:0,height:0}];function Ow({viewport:s,onChange:r}){const o=lu.find(d=>d.width===s.width&&d.height===s.height)?.label??"Custom",c=d=>{const x=lu.find(h=>h.label===d);x&&x.width!==0&&r({width:x.width,height:x.height})};return e.jsx(is,{label:"Viewport",hint:"Browser window size",children:e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(wi,{className:"w-44",value:o,onChange:c,options:lu.map(d=>({value:d.label,label:d.label}))}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ln,{type:"number",className:"w-16",value:s.width,min:320,onChange:d=>r({...s,width:Number(d.target.value)})}),e.jsx("span",{className:"text-content-tertiary text-[10px]",children:"×"}),e.jsx(ln,{type:"number",className:"w-16",value:s.height,min:240,onChange:d=>r({...s,height:Number(d.target.value)})}),e.jsx("span",{className:"text-[9px] text-content-tertiary",children:"px"})]})]})})}const Bp={getConfig:()=>fetch("/api/visual-regression/config").then(s=>s.json()),saveConfig:s=>fetch("/api/visual-regression/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).then(r=>r.json())};function Dw(){const s=Pe(),{modalProps:r,confirmDelete:a}=zs(),{data:o,isLoading:c}=Oe({queryKey:["config"],queryFn:()=>Cr.get()}),[d,x]=p.useState({}),{data:h}=Oe({queryKey:["visual-config"],queryFn:Bp.getConfig}),[f,y]=p.useState(null),g=f??h??{enabled:!1,defaultThreshold:.5,fullPage:!1,maskSelectors:[]};p.useEffect(()=>{h&&!f&&y(null)},[h]);const j=N=>y({...g,...N}),P=oe({mutationFn:N=>Bp.saveConfig(N),onSuccess:()=>{s.invalidateQueries({queryKey:["visual-config"]}),y(null),H.success("Visual regression settings saved")},onError:N=>H.error(N.message)});p.useEffect(()=>{o&&x(o)},[o]),p.useEffect(()=>{const N=d.environmentUrls?.[d.environment??""];N&&N!==d.baseUrl&&x(K=>({...K,baseUrl:N}))},[d.environment,d.environmentUrls]);const S=oe({mutationFn:()=>Cr.update(d),onSuccess:()=>{s.invalidateQueries({queryKey:["config"]}),H.success("Settings saved")},onError:N=>H.error(N.message)}),k=(N,K)=>x(_=>({..._,[N]:K})),E=N=>{const K=d.browsers??[];k("browsers",K.includes(N)?K.length>1?K.filter(_=>_!==N):K:[...K,N])},R=d.environments??[],[v,C]=p.useState(""),D=()=>{const N=v.trim().toUpperCase();!N||R.includes(N)||(x(K=>({...K,environments:[...K.environments??[],N],environmentUrls:{...K.environmentUrls??{},[N]:""}})),C(""))},M=N=>{const K=R.filter(ee=>ee!==N),_={...d.environmentUrls??{}};delete _[N],x(ee=>{const $={...ee,environments:K,environmentUrls:_};return ee.environment===N&&($.environment=K[0]??"",$.baseUrl=_[K[0]??""]??ee.baseUrl),$})},w=(N,K,_)=>{x(ee=>{const $=K&&K!==N&&!(ee.environments??[]).includes(K),G=$?K:N,le={...ee.environmentUrls??{}};$&&delete le[N],le[G]=_;const je={...ee,environments:(ee.environments??[]).map(ke=>ke===N?G:ke),environmentUrls:le};return ee.environment===N&&(je.environment=G,_&&(je.baseUrl=_)),je})};return c||!d.healing||!d.reporting?e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(Me,{size:20,className:"animate-spin text-accent"})}):e.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:[e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[e.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-indigo-500 to-violet-600 flex items-center justify-center shadow-sm shadow-indigo-500/20",children:e.jsx(kr,{size:17,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-sm font-bold text-content",children:"Settings"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Configure AssureMind Studio"})]})]}),e.jsxs(ve,{size:"sm",onClick:()=>S.mutate(),loading:S.isPending,children:[e.jsx(ya,{size:11})," Save Settings"]})]})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3 items-start",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs(Hs,{icon:Kv,iconBg:"bg-gradient-to-br from-indigo-500 to-violet-600 shadow-indigo-500/20",title:"Environment",desc:"Target environment & URLs",children:[e.jsx(is,{label:"Active Environment",hint:"Where tests run against",children:e.jsx("div",{className:"flex gap-1 flex-wrap",children:R.map(N=>e.jsx("button",{type:"button",onClick:()=>{k("environment",N);const K=d.environmentUrls?.[N];K&&k("baseUrl",K)},className:O("px-2.5 py-1 rounded-lg text-[10px] font-semibold uppercase tracking-wide transition-all",d.environment===N?"bg-accent text-white shadow-sm shadow-accent/20":"text-content-tertiary hover:text-content-secondary bg-surface-inset ring-1 ring-border"),children:N},N))})}),e.jsx(is,{label:"Environments",hint:"Rename (edit & blur), set a URL, or remove. Add new below.",children:e.jsxs("div",{className:"space-y-1.5",children:[R.map(N=>e.jsx(Aw,{env:N,url:d.environmentUrls?.[N]??"",isActive:d.environment===N,canRemove:R.length>1,onRemove:()=>a(`Remove "${N}" environment?`,()=>M(N)),onSave:(K,_)=>w(N,K,_)},N)),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(ln,{className:"w-24 uppercase",placeholder:"NEW",value:v,onChange:N=>C(N.target.value),onKeyDown:N=>{N.key==="Enter"&&(N.preventDefault(),D())}}),e.jsxs(ve,{size:"sm",variant:"secondary",onClick:D,disabled:!v.trim(),children:[e.jsx(Vs,{size:12})," Add environment"]})]})]})}),e.jsx(is,{label:"Base URL",hint:"Auto-resolved from active env",children:e.jsx(ln,{className:"w-full bg-surface-inset/50 text-content-tertiary cursor-not-allowed",placeholder:"http://localhost:3000",value:d.environmentUrls?.[d.environment??""]||d.baseUrl||"",readOnly:!0,disabled:!0})})]}),e.jsxs(Hs,{icon:Gn,iconBg:"bg-gradient-to-br from-blue-500 to-cyan-600 shadow-blue-500/20",title:"General",desc:"Browser & display settings",children:[e.jsx(is,{label:"Browsers",hint:"One or more browsers",children:e.jsx("div",{className:"flex gap-1.5 flex-wrap",children:Wf.map(N=>{const K=(d.browsers??[]).includes(N);return e.jsxs("button",{type:"button",onClick:()=>E(N),className:O("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[10px] font-semibold capitalize transition-all",K?"bg-accent/10 text-accent ring-1 ring-accent/30":"text-content-tertiary bg-surface-inset ring-1 ring-border hover:text-content-secondary"),children:[e.jsx(Bi,{browser:N,size:14}),N]},N)})})}),e.jsx(wt,{label:"Headless mode",hint:"Run browsers without visible window",checked:d.headless??!0,onChange:N=>k("headless",N)}),e.jsx(Ow,{viewport:d.viewport??{width:1280,height:720},onChange:N=>k("viewport",N)})]}),e.jsxs(Hs,{icon:kr,iconBg:"bg-gradient-to-br from-slate-500 to-slate-700 shadow-slate-500/20",title:"Execution",desc:"Timeouts, retries & parallelism",children:[e.jsx(is,{label:"Timeouts & Workers",hint:"Per-test limits",children:e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] text-content-tertiary mb-0.5",children:"Timeout (ms)"}),e.jsx(ln,{type:"number",className:"w-24",value:d.timeout??3e4,onChange:N=>k("timeout",Number(N.target.value))})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] text-content-tertiary mb-0.5",children:"Retries"}),e.jsx(ln,{type:"number",min:0,max:5,className:"w-16",value:d.retries??1,onChange:N=>k("retries",Number(N.target.value))})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] text-content-tertiary mb-0.5",children:"Workers"}),e.jsx(ln,{type:"number",min:1,max:10,className:"w-16",value:d.parallel??2,onChange:N=>k("parallel",Number(N.target.value))})]})]})}),e.jsx(is,{label:"Page load strategy",hint:"Playwright wait after each step",children:e.jsx(wi,{className:"w-full",value:d.pageLoad??"domcontentloaded",onChange:N=>k("pageLoad",N),options:[{value:"commit",label:"commit — first network response"},{value:"domcontentloaded",label:"domcontentloaded — DOM ready"},{value:"load",label:"load — full page load event"},{value:"networkidle",label:"networkidle — no network 500ms"}]})})]}),e.jsxs(Hs,{icon:Un,iconBg:"bg-gradient-to-br from-pink-500 to-rose-600 shadow-pink-500/20",title:"Capture",desc:"Screenshots, video & traces",children:[e.jsx(is,{label:"Screenshot",hint:"When to capture screenshots",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Un,{size:11,className:"text-pink-400 flex-shrink-0"}),e.jsx(wi,{className:"w-40",value:d.screenshot??"only-on-failure",onChange:N=>k("screenshot",N),options:[{value:"off",label:"Off"},{value:"on",label:"Every test"},{value:"only-on-failure",label:"On failure only"}]})]})}),e.jsx(is,{label:"Video",hint:"When to record video",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx($l,{size:11,className:"text-violet-400 flex-shrink-0"}),e.jsx(wi,{className:"w-40",value:d.video??"off",onChange:N=>k("video",N),options:[{value:"off",label:"Off"},{value:"on",label:"Every test"},{value:"on-first-retry",label:"On first retry"},{value:"retain-on-failure",label:"On failure only"}]})]})}),e.jsx(is,{label:"Trace",hint:"Playwright trace for debugging",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Uf,{size:11,className:"text-emerald-400 flex-shrink-0"}),e.jsx(wi,{className:"w-40",value:d.trace??"on-first-retry",onChange:N=>k("trace",N),options:[{value:"off",label:"Off"},{value:"on",label:"Every test"},{value:"on-first-retry",label:"On first retry"},{value:"retain-on-failure",label:"On failure only"}]})]})})]}),e.jsxs(Hs,{icon:Ms,iconBg:"bg-gradient-to-br from-indigo-500 to-blue-600 shadow-indigo-500/20",title:"Reporting",desc:"Output format & destinations",children:[e.jsx(wt,{label:"Allure report",hint:"Interactive HTML report with history & trends",checked:d.reporting?.allure??!0,onChange:N=>k("reporting",{...d.reporting,allure:N})}),e.jsx(wt,{label:"HTML report",hint:"Standalone summary saved to results/",checked:d.reporting?.html??!0,onChange:N=>k("reporting",{...d.reporting,html:N})}),e.jsx(wt,{label:"JSON report",hint:"Machine-readable run data",checked:d.reporting?.json??!0,onChange:N=>k("reporting",{...d.reporting,json:N})})]}),e.jsx(Hs,{icon:$n,iconBg:"bg-gradient-to-br from-slate-500 to-gray-700 shadow-slate-500/20",title:"CI/CD Integration",desc:"Pipeline file generation",children:e.jsx(wt,{label:"Write CI files to repo",hint:"Adds a 'Write to repo' button in the CI Config Generator that writes the workflow file (.github/workflows/, .gitlab-ci.yml, Jenkinsfile) into your project. Review & commit via Git Control. Off = copy/download only.",checked:d.ci?.writeToRepo??!1,onChange:N=>k("ci",{...d.ci,writeToRepo:N})})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs(Hs,{icon:Xu,iconBg:"bg-gradient-to-br from-amber-500 to-orange-600 shadow-amber-500/20",title:"Self-Healing",desc:"AI-powered selector recovery",children:[e.jsx(wt,{label:"Enable self-healing",hint:"Auto-fix broken selectors during runs",checked:d.healing?.enabled??!0,onChange:N=>k("healing",{...d.healing,enabled:N})}),e.jsx(is,{label:"Max healing level",hint:"1 = retry only · 2 = AI regen · 3 = multi-selector · 4 = visual · 5 = decompose",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ln,{type:"number",min:1,max:5,className:"w-16",value:Math.min(d.healing?.maxLevel??5,5),onChange:N=>k("healing",{...d.healing,maxLevel:Number(N.target.value)})}),e.jsx("div",{className:"flex gap-0.5",children:[1,2,3,4,5].map(N=>e.jsx("div",{className:O("w-4 h-1.5 rounded-full transition-colors",N<=Math.min(d.healing?.maxLevel??5,5)?"bg-amber-400":"bg-surface-inset")},N))})]})}),e.jsx(wt,{label:"Auto-PR on CI heal",hint:"GitHub PR when selector healed in CI",checked:d.healing?.autoPR??!1,onChange:N=>k("healing",{...d.healing,autoPR:N})}),e.jsx(wt,{label:"Heal locators inside assertions",hint:"When a locator inside expect(...) can't be found (e.g. wrong iframe), re-resolve just the locator and keep the assertion. A genuine state/value mismatch is never healed. Off by default.",checked:d.healing?.healAssertionLocators??!1,onChange:N=>k("healing",{...d.healing,healAssertionLocators:N})})]}),e.jsxs(Hs,{icon:Bt,iconBg:"bg-gradient-to-br from-purple-500 to-fuchsia-600 shadow-purple-500/20",title:"MCP Integration",desc:"AI-sighted code generation via Playwright MCP",children:[e.jsx(wt,{label:"Enable MCP",hint:"ON by default — AI sees real page elements during generation. Test execution is unaffected.",checked:d.mcp?.enabled??!0,onChange:N=>k("mcp",{...d.mcp,enabled:N})}),e.jsx(wt,{label:"Headless mode",hint:"Run MCP browser without visible window",checked:d.mcp?.headless??!0,onChange:N=>k("mcp",{...d.mcp,headless:N})}),e.jsx(wt,{label:"Act-then-script",hint:"Execute action via MCP first, then convert to script",checked:d.mcp?.actThenScript??!1,onChange:N=>k("mcp",{...d.mcp,actThenScript:N})}),e.jsx(wt,{label:"Proactive healing",hint:"Validate selectors against live page before test run",checked:d.mcp?.proactiveHealing??!1,onChange:N=>k("mcp",{...d.mcp,proactiveHealing:N})})]}),e.jsxs(Hs,{icon:gv,iconBg:"bg-gradient-to-br from-emerald-500 to-teal-600 shadow-emerald-500/20",title:"RAG Memory",desc:"Semantic memory from past runs — AI learns from every generation & healing",children:[e.jsx(wt,{label:"Enable RAG",hint:"AI retrieves similar past steps & fixes to improve accuracy",checked:d.rag?.enabled??!0,onChange:N=>k("rag",{...d.rag,enabled:N})}),e.jsx(wt,{label:"Code Corpus",hint:"Remember instruction-to-code mappings from successful runs",checked:d.rag?.codeCorpus?.enabled??!0,onChange:N=>k("rag",{...d.rag,codeCorpus:{...d.rag.codeCorpus,enabled:N}})}),e.jsx(wt,{label:"Healing Corpus",hint:"Remember past healing fixes for smarter self-repair",checked:d.rag?.healingCorpus?.enabled??!0,onChange:N=>k("rag",{...d.rag,healingCorpus:{...d.rag.healingCorpus,enabled:N}})}),e.jsx(wt,{label:"Error Catalog",hint:"Track recurring error patterns to avoid known-bad selectors",checked:d.rag?.errorCatalog?.enabled??!0,onChange:N=>k("rag",{...d.rag,errorCatalog:{...d.rag.errorCatalog,enabled:N}})})]}),e.jsxs(Hs,{icon:ka,iconBg:"bg-gradient-to-br from-purple-500 to-indigo-600 shadow-purple-500/20",title:"Visual Regression",desc:"Pixel-diff screenshot comparison",children:[e.jsx(wt,{label:"Enable visual regression",hint:"Compare step screenshots against approved baselines",checked:g.enabled,onChange:N=>j({enabled:N})}),e.jsx(wt,{label:"Full page screenshots",hint:"Capture the entire scrollable page, not just the viewport",checked:g.fullPage,onChange:N=>j({fullPage:N})}),e.jsx(is,{label:"Threshold (%)",hint:"Max pixel diff before flagging. Default 0.5%",children:e.jsx(ln,{type:"number",min:.1,max:10,step:.1,className:"w-24",value:g.defaultThreshold,onChange:N=>j({defaultThreshold:parseFloat(N.target.value)||.5})})}),e.jsx(is,{label:"Mask selectors",hint:"CSS selectors for dynamic content to ignore (one per line)",children:e.jsx("textarea",{rows:3,value:g.maskSelectors.join(`
|
|
925
|
-
`),onChange:N=>j({maskSelectors:N.target.value.split(`
|
|
926
|
-
`).filter(K=>K.trim())}),placeholder:`.dynamic-content
|
|
927
|
-
[data-testid='timestamp']`,className:"w-full px-2.5 py-1.5 text-xs bg-surface border border-border rounded-lg focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/40 font-mono resize-none"})}),f&&e.jsx("div",{className:"flex justify-end pt-2 pb-1",children:e.jsxs(ve,{size:"sm",loading:P.isPending,onClick:()=>P.mutate(g),children:[e.jsx(ya,{size:11})," Save VR Settings"]})})]})]})]})]})}),e.jsx(Ts,{...r})]})}function Iw(){const s=Pe(),{data:r,isLoading:a}=Oe({queryKey:["env"],queryFn:wl.get}),[o,c]=p.useState({}),[d,x]=p.useState({}),[h,f]=p.useState({}),[y,g]=p.useState({});p.useEffect(()=>{if(!r)return;const v={...r.values};for(const D of r.groups)for(const M of D.fields)M.default&&!v[M.key]&&!M.provider&&(v[M.key]=M.default);const C=v.AI_PROVIDER??"";for(const D of r.groups)for(const M of D.fields)M.default&&!v[M.key]&&M.provider===C&&(v[M.key]=M.default);c(v)},[r]);const j=oe({mutationFn:()=>{const v={};for(const[C,D]of Object.entries(o))D!==(r?.values[C]??"")&&(v[C]=D);return wl.update(v)},onSuccess:v=>{H.success(v.updated>0?`Saved ${v.updated} setting${v.updated===1?"":"s"} to .env`:"No changes to save"),s.invalidateQueries({queryKey:["env"]}),s.invalidateQueries({queryKey:["config-status"]}),s.invalidateQueries({queryKey:["ai-provider"]})},onError:v=>H.error(v.message)});if(a||!r)return e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(Me,{className:"animate-spin text-accent"})});const P=(v,C)=>c(D=>{const M={...D,[v]:C};if(v==="AI_PROVIDER"){for(const w of r.groups)if(w.provider===C)for(const N of w.fields)N.default&&!M[N.key]&&(M[N.key]=N.default)}return M}),S=o.AI_PROVIDER??"",k=r.groups.filter(v=>!v.provider||v.provider===S),E=v=>{const C=o[v.key]??"",D=v.type==="secret",M=r.secretSet[v.key];if(v.type==="boolean")return e.jsxs("div",{className:"flex items-center justify-between py-2.5 border-b border-border/50 last:border-0",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-semibold text-content-secondary",children:v.label}),v.hint&&e.jsx("p",{className:"text-[10px] text-content-tertiary mt-0.5",children:v.hint})]}),e.jsx(va,{checked:C==="true",onChange:N=>P(v.key,N?"true":"false")})]},v.key);const w=v.recommended;if(w&&w.length>0&&(v.type==="text"||v.type==="number")){const N=h[v.key]??(C!==""&&!w.includes(C));return e.jsxs("div",{className:"py-2.5 border-b border-border/50 last:border-0",children:[e.jsx("label",{className:"text-[11px] font-semibold text-content-secondary block mb-1",children:v.label}),e.jsxs("select",{value:N?"__custom__":C,onChange:K=>{K.target.value==="__custom__"?f(_=>({..._,[v.key]:!0})):(f(_=>({..._,[v.key]:!1})),P(v.key,K.target.value))},className:"w-full border border-border rounded-lg px-2.5 py-1.5 text-xs bg-surface text-content-secondary focus:outline-none focus:ring-2 focus:ring-accent/30",children:[e.jsx("option",{value:"",children:"— select recommended —"}),w.map(K=>e.jsx("option",{value:K,children:K},K)),e.jsx("option",{value:"__custom__",children:"Other (custom)…"})]}),N&&e.jsx("input",{type:"text",value:C,placeholder:v.placeholder??"Enter a custom value",onChange:K=>P(v.key,K.target.value),className:"w-full mt-2 border border-border rounded-lg px-2.5 py-1.5 text-xs bg-surface text-content-secondary focus:outline-none focus:ring-2 focus:ring-accent/30"}),v.hint&&e.jsx("p",{className:"text-[10px] text-content-tertiary mt-1",children:v.hint})]},v.key)}return e.jsxs("div",{className:"py-2.5 border-b border-border/50 last:border-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("label",{className:"text-[11px] font-semibold text-content-secondary",children:v.label}),D&&M&&!C&&e.jsx("span",{className:"text-[9px] text-emerald-500 font-medium",children:"● set — leave blank to keep"})]}),v.type==="select"?e.jsx("select",{value:C,onChange:N=>P(v.key,N.target.value),className:"w-full border border-border rounded-lg px-2.5 py-1.5 text-xs bg-surface text-content-secondary focus:outline-none focus:ring-2 focus:ring-accent/30",children:(v.options??[]).map(N=>e.jsx("option",{value:N,children:N===""?"— none —":r.providerLabels[N]??N},N))}):e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:D&&!d[v.key]?"password":v.type==="number"?"number":"text",value:C,placeholder:D&&M?"•••••••• (saved)":v.placeholder,onChange:N=>P(v.key,N.target.value),className:O("w-full border border-border rounded-lg px-2.5 py-1.5 text-xs bg-surface text-content-secondary","focus:outline-none focus:ring-2 focus:ring-accent/30",D&&"pr-9")}),D&&e.jsx("button",{type:"button",onClick:()=>x(N=>({...N,[v.key]:!N[v.key]})),className:"absolute right-2 top-1/2 -translate-y-1/2 text-content-tertiary hover:text-content",title:d[v.key]?"Hide":"Show",children:d[v.key]?e.jsx(Pf,{size:13}):e.jsx(ka,{size:13})})]}),v.hint&&e.jsx("p",{className:"text-[10px] text-content-tertiary mt-1",children:v.hint})]},v.key)},R=v=>{const C=!(y[v.id]??v.id!=="ai-core");return e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("button",{type:"button",onClick:()=>g(D=>({...D,[v.id]:C})),className:"w-full px-4 py-2.5 border-b border-border flex items-center justify-between text-left hover:bg-surface-inset/40 transition-colors",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xs font-bold text-content",children:v.title}),v.description&&e.jsx("p",{className:"text-[10px] text-content-tertiary mt-0.5",children:v.description})]}),C?e.jsx(kt,{size:15,className:"text-content-tertiary flex-shrink-0"}):e.jsx(Zt,{size:15,className:"text-content-tertiary flex-shrink-0"})]}),C&&e.jsx("div",{className:"px-4 py-1",children:v.fields.map(E)})]},v.id)};return e.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-3xl mx-auto p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between sticky top-0 z-10 bg-surface-inset/80 backdrop-blur rounded-xl border border-border px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-br from-emerald-500 to-teal-600 flex items-center justify-center shadow-sm",children:e.jsx(Lf,{size:15,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-sm font-bold text-content",children:"Environment Configuration"}),e.jsxs("p",{className:"text-[10px] text-content-tertiary",children:["Edit your project's ",e.jsx("code",{className:"text-accent",children:".env"})," — AI providers, Jira, GitHub & more"]})]})]}),e.jsxs(ve,{size:"sm",onClick:()=>j.mutate(),loading:j.isPending,children:[e.jsx(ya,{size:12})," Save to .env"]})]}),e.jsx("p",{className:"text-[10px] text-content-tertiary px-1",children:"🔒 Secrets are masked and never displayed. Leave a secret blank to keep its saved value. Most changes apply immediately; a few may need a Studio restart."}),k.map(R),e.jsx("div",{className:"flex justify-end pt-1 pb-4",children:e.jsxs(ve,{size:"sm",onClick:()=>j.mutate(),loading:j.isPending,children:[e.jsx(ya,{size:12})," Save to .env"]})})]})})})}function Fw(){const s=Pe(),{modalProps:r,confirmDelete:a}=zs(),[o,c]=p.useState(!1),[d,x]=p.useState(""),[h,f]=p.useState(""),[y,g]=p.useState(""),[j,P]=p.useState(null),[S,k]=p.useState({}),[E,R]=p.useState(null),[v,C]=p.useState(new Set),D=$=>{C(G=>{const le=new Set(G);return le.has($)?le.delete($):le.add($),le})},{data:M=[],isLoading:w}=Oe({queryKey:["step-library"],queryFn:()=>hr.list()}),N=oe({mutationFn:()=>hr.create({name:d.trim(),instruction:h.trim(),tags:y.split(",").map($=>$.trim()).filter(Boolean)}),onSuccess:()=>{s.invalidateQueries({queryKey:["step-library"]}),H.success("Step created"),c(!1),x(""),f(""),g("")},onError:$=>H.error($.message)}),K=oe({mutationFn:({id:$,data:G})=>hr.update($,G),onSuccess:()=>{s.invalidateQueries({queryKey:["step-library"]}),H.success("Step updated"),P(null)},onError:$=>H.error($.message)}),_=oe({mutationFn:$=>hr.delete($),onSuccess:()=>{s.invalidateQueries({queryKey:["step-library"]}),H.success("Step deleted")},onError:$=>H.error($.message)}),ee=oe({mutationFn:$=>hr.generate($),onSuccess:()=>{s.invalidateQueries({queryKey:["step-library"]}),H.success("Code generated"),R(null)},onError:$=>{H.error($.message),R(null)}});return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:[e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-4xl mx-auto px-5 py-4 space-y-3",children:[e.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-violet-500 to-purple-600 flex items-center justify-center shadow-sm shadow-violet-500/20",children:e.jsx(Mi,{size:17,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-sm font-bold text-content",children:"Step Library"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Reusable step templates for your test cases"})]})]}),e.jsxs("button",{type:"button",onClick:()=>c($=>!$),className:"inline-flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-lg bg-accent text-white hover:brightness-110 transition-colors",children:[e.jsx(Vs,{size:13})," Add Step"]})]})}),o&&e.jsxs("div",{className:"rounded-xl border border-accent/30 bg-surface p-4 space-y-2.5",children:[e.jsx("p",{className:"text-xs font-semibold text-content",children:"New Library Step"}),e.jsx("input",{type:"text",placeholder:"Name (e.g. Login as admin)",value:d,onChange:$=>x($.target.value),className:"w-full px-3 py-2 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30"}),e.jsx("textarea",{placeholder:"Instruction (e.g. Click the login button and fill in admin credentials)",value:h,onChange:$=>f($.target.value),rows:3,className:"w-full px-3 py-2 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30 resize-none"}),e.jsx("input",{type:"text",placeholder:"Tags (comma-separated, optional)",value:y,onChange:$=>g($.target.value),className:"w-full px-3 py-2 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"button",onClick:()=>N.mutate(),disabled:!d.trim()||!h.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"}),e.jsx("button",{type:"button",onClick:()=>c(!1),className:"text-xs px-3 py-1.5 rounded-lg border border-border text-content-secondary hover:bg-surface-inset",children:"Cancel"})]})]}),w&&e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Me,{size:18,className:"animate-spin text-accent"})}),!w&&M.length===0&&!o&&e.jsxs("div",{className:"rounded-xl border border-dashed border-border bg-surface flex flex-col items-center justify-center py-14 gap-2.5",children:[e.jsx(Mi,{size:24,className:"text-content-tertiary"}),e.jsx("p",{className:"text-xs font-medium text-content-secondary",children:"No steps in library"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:'Click "Add Step" to create your first reusable step template.'})]}),M.length>0&&e.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{className:"bg-surface-inset/50 border-b border-border",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left px-4 py-2.5 text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Name"}),e.jsx("th",{className:"text-left px-4 py-2.5 text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Instruction"}),e.jsx("th",{className:"text-left px-4 py-2.5 text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Code"}),e.jsx("th",{className:"text-left px-4 py-2.5 text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Tags"}),e.jsx("th",{className:"px-4 py-2.5 w-24"})]})}),e.jsx("tbody",{className:"divide-y divide-border",children:M.map($=>e.jsxs(p.Fragment,{children:[e.jsxs("tr",{className:"hover:bg-surface-inset/30 transition-colors",children:[e.jsx("td",{className:"px-4 py-2.5 font-medium text-content",children:j===$.id?e.jsx("input",{type:"text",value:S.name??$.name,onChange:G=>k(le=>({...le,name:G.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"}):$.name}),e.jsx("td",{className:"px-4 py-2.5 text-content-secondary max-w-xs",children:j===$.id?e.jsx("textarea",{value:S.instruction??$.instruction,onChange:G=>k(le=>({...le,instruction:G.target.value})),rows:2,className:"w-full px-2 py-1 border border-border rounded text-xs focus:outline-none focus:ring-1 focus:ring-accent/30 resize-none"}):e.jsx("span",{className:"line-clamp-2",children:$.instruction})}),e.jsx("td",{className:"px-4 py-2.5",children:$.generatedCode?e.jsxs("button",{type:"button",onClick:()=>D($.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:[v.has($.id)?e.jsx(kt,{size:10}):e.jsx(Zt,{size:10}),e.jsx(Wu,{size:10}),"View"]}):e.jsx("span",{className:"inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-1 ring-amber-200 dark:ring-amber-800",children:"No code"})}),e.jsx("td",{className:"px-4 py-2.5",children:e.jsx("div",{className:"flex flex-wrap gap-0.5",children:$.tags.map(G=>e.jsx("span",{className:"text-[8px] px-1 py-px rounded bg-accent/8 text-accent ring-1 ring-accent/15",children:G},G))})}),e.jsx("td",{className:"px-4 py-2.5",children:e.jsx("div",{className:"flex items-center gap-1",children:j===$.id?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>K.mutate({id:$.id,data:S}),className:"p-1 rounded text-emerald-600 hover:bg-emerald-50",children:e.jsx(Qe,{size:12})}),e.jsx("button",{type:"button",onClick:()=>P(null),className:"p-1 rounded text-content-tertiary hover:bg-surface-inset",children:e.jsx(Fe,{size:12})})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",title:$.generatedCode?"Regenerate code":"Generate code",onClick:()=>{R($.id),ee.mutate($.id)},disabled:E===$.id,className:"p-1 rounded text-content-tertiary hover:text-accent hover:bg-accent/5 transition-colors disabled:opacity-40",children:E===$.id?e.jsx(Me,{size:12,className:"animate-spin"}):e.jsx(Sr,{size:12})}),e.jsx("button",{type:"button",onClick:()=>{P($.id),k({name:$.name,instruction:$.instruction,tags:$.tags})},className:"p-1 rounded text-content-tertiary hover:text-content hover:bg-surface-inset",children:e.jsx(mn,{size:12})}),e.jsx("button",{type:"button",onClick:()=>a(`Delete "${$.name}"?`,()=>_.mutate($.id)),className:"p-1 rounded text-content-tertiary hover:text-red-500 hover:bg-red-50",children:e.jsx(es,{size:12})})]})})})]}),v.has($.id)&&$.generatedCode&&e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"p-0",children:e.jsx(sx,{code:$.generatedCode,maxLines:12,className:"rounded-none"})})})]},$.id))})]})})]})}),e.jsx(Ts,{...r})]})}const ki=[{id:"getting-started",title:"Getting Started",category:"Getting Started",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"AssureMind Studio is an AI-powered test automation platform for web applications. It lets you describe tests in plain English, generate Playwright code automatically, and run them in the cloud or locally."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Prerequisites"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsx("li",{children:"Node.js 18+ (20 LTS recommended)"}),e.jsx("li",{children:"An AI provider API key (Anthropic, OpenAI, Google, Azure…) — or run a local model via Ollama (free)"}),e.jsx("li",{children:"A test target application URL"}),e.jsx("li",{children:"Optional: JDK 17+ for Allure HTML reports"})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Quick Setup"}),e.jsx("pre",{className:"text-[11px] bg-surface-inset rounded-lg px-4 py-3 overflow-x-auto border border-border font-mono",children:`npm install assuremind
|
|
928
|
-
npx assuremind init # folders, config, Playwright browsers
|
|
929
|
-
npx playwright install # if browser install was skipped or failed
|
|
930
|
-
npx assuremind studio # opens http://localhost:4400`}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Open ",e.jsx("code",{className:"text-accent",children:"http://localhost:4400"})," to access the Studio UI. The first run triggers the onboarding wizard and opens in ",e.jsx("strong",{children:"light mode"})," by default (toggle dark/light any time from the top bar)."]}),e.jsxs("p",{className:"text-sm text-content-secondary",children:[e.jsx("code",{className:"text-accent",children:"npx assuremind init"})," installs the Playwright browsers automatically. If that step is skipped (",e.jsx("code",{className:"text-accent",children:"--skip-playwright"}),") or fails, run ",e.jsx("code",{className:"text-accent",children:"npx playwright install"})," manually (add ",e.jsx("code",{className:"text-accent",children:"--with-deps"})," on Linux). Verify with ",e.jsx("code",{className:"text-accent",children:"npx assuremind doctor"}),"."]})]})},{id:"configuration",title:"Configuration",category:"Getting Started",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["Configuration is stored in ",e.jsx("code",{className:"text-accent",children:"tests/autotest.config.json"})," and editable from the Settings page."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Key Settings"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Field"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Description"})]})}),e.jsx("tbody",{className:"text-content-secondary",children:[["baseUrl","Default URL for all test cases"],["environment","Active environment (e.g. DEV/TEST/STAGE/INT/PROD — editable in Settings)"],["browsers","List of browsers: chromium, firefox, webkit"],["headless","Run browsers without a visible window"],["timeout","Global step timeout in ms (default 30000)"],["retries","Global retry count per step (default 0)"],["parallel","Number of parallel workers"],["screenshot","Screenshot mode: always | on-failure | never"]].map(([s,r])=>e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("td",{className:"py-1.5 pr-4 font-mono text-accent",children:s}),e.jsx("td",{className:"py-1.5",children:r})]},s))})]})})]})},{id:"test-suites",title:"Test Suites",category:"Core Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["Test Suites group related test cases. Each suite has a type (",e.jsx("strong",{children:"UI"}),", ",e.jsx("strong",{children:"API"}),", or ",e.jsx("strong",{children:"Audit"}),"), tags, and an optional timeout override."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Suite Types"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Type"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Description"})]})}),e.jsx("tbody",{className:"text-content-secondary",children:[["UI",'Standard Playwright browser automation. Steps show a blue "UI" badge. No Lighthouse.'],["API","API-only tests using HTTP request and assertion steps."],["Audit",'Full Playwright automation with Lighthouse non-functional checks (Performance, Accessibility, SEO). Steps show an amber "Audit" badge. Screenshot, video, and trace are disabled by default. Files stored in tests/audit/.']].map(([s,r])=>e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("td",{className:"py-1.5 pr-4 font-mono text-accent",children:s}),e.jsx("td",{className:"py-1.5",children:r})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Creating a Suite"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["Go to ",e.jsx("strong",{children:"Test Suites"})," in the sidebar."]}),e.jsxs("li",{children:["Click ",e.jsx("strong",{children:"+ New Suite"})," and enter a name."]}),e.jsxs("li",{children:["Select the suite type: ",e.jsx("strong",{children:"UI"}),", ",e.jsx("strong",{children:"API"}),", or ",e.jsx("strong",{children:"Audit"}),"."]}),e.jsx("li",{children:"Optionally set tags and timeout."})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Suite Actions"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"Each suite supports inline rename, duplicate, delete, and direct run via the Run Configuration page."})]})},{id:"audit-suites",title:"Audit Suites",category:"Core Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Audit suites run exactly like UI suites (full Playwright automation) but add non-functional quality checks via Google Lighthouse for Performance, Accessibility, and SEO."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"⚡ Audit Flag on Steps"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["In Audit suites, each step has a ",e.jsx("strong",{children:"⚡ Audit"})," button. Clicking it marks that step as a Lighthouse checkpoint — when the step runs, Lighthouse audits ",e.jsx("code",{className:"text-accent",children:"page.url()"})," at that point. Confirm with ",e.jsx("strong",{children:"✓"})," to save or ",e.jsx("strong",{children:"✗"})," to cancel. If no steps are marked, Lighthouse is skipped entirely."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Non-Functional Checks"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Each test case in an Audit suite has a ",e.jsx("strong",{children:"Non-Functional Checks"})," section with three checkboxes:"]}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"⚡ Performance"})," — Lighthouse Performance score"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"♿ Accessibility"})," — Lighthouse Accessibility score"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"🔍 SEO"})," — Lighthouse SEO score"]})]}),e.jsx("p",{className:"text-sm text-content-secondary",children:"If all three are unchecked, Lighthouse is skipped for that case. A warning is shown if none are selected."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Score Thresholds"}),e.jsxs("div",{className:"flex gap-4 text-sm",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-3 h-3 rounded-full bg-emerald-500 inline-block"})," Good (90–100)"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-3 h-3 rounded-full bg-amber-400 inline-block"})," Needs Work (50–89)"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-3 h-3 rounded-full bg-red-500 inline-block"})," Poor (0–49) — test FAILS"]})]})]})},{id:"test-cases",title:"Test Cases",category:"Core Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Test cases contain steps written in plain English. Each case has priority, tags, timeout, and optional data-driven configuration."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Writing Steps"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Open a case, type a step instruction in the input bar (e.g. ",e.jsx("em",{children:'"Click the Login button"'}),"), and press Enter. The step is saved immediately. Click ",e.jsx("strong",{children:"Generate All"})," to generate Playwright code for all steps at once."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Step Types"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"UI"})," — Playwright browser actions"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"API"})," — HTTP request/assertion steps"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Mock"})," — Intercept and stub network requests"]})]})]})},{id:"writing-steps",title:"Writing Steps — Examples",category:"Core Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["Describe steps in plain English. Put the target name in quotes for reliability, use the"," ",e.jsx("strong",{children:"Fake Data"})," (",e.jsx("code",{className:"text-accent",children:"{{FAKE_*}}"}),") and"," ",e.jsx("strong",{children:"Files"})," (",e.jsx("code",{className:"text-accent",children:"{{FILE:name}}"}),") pickers for dynamic values, and prefix any assertion with ",e.jsx("strong",{children:'"Soft"'})," to keep running on failure."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"UI steps"}),e.jsx("pre",{className:"text-[11px] bg-surface-inset rounded-lg px-4 py-3 overflow-x-auto border border-border font-mono",children:`# Navigation
|
|
931
|
-
Go to https://example.com
|
|
932
|
-
Navigate to /dashboard
|
|
933
|
-
Go back | Refresh the page
|
|
934
|
-
|
|
935
|
-
# Click (name the real role: button / link / tab)
|
|
936
|
-
Click the "Login" button
|
|
937
|
-
Click the "Dashboard" link
|
|
938
|
-
Double click the "Row 1" element
|
|
939
|
-
|
|
940
|
-
# Input
|
|
941
|
-
Enter "deepak" in the Username field
|
|
942
|
-
Type {{FAKE_INTERNET_EMAIL}} in the Email field
|
|
943
|
-
Fill "secret123" in the Password field # password -> getByLabel
|
|
944
|
-
Clear the Search field
|
|
945
|
-
|
|
946
|
-
# Dropdown / checkbox / radio
|
|
947
|
-
Select "India" from the Country dropdown
|
|
948
|
-
Check the "Remember me" checkbox
|
|
949
|
-
Select the "Male" radio button
|
|
950
|
-
|
|
951
|
-
# Keyboard / wait / scroll / hover
|
|
952
|
-
Press Enter | Press "Control+A"
|
|
953
|
-
Wait for 2 seconds | Wait for the page to load
|
|
954
|
-
Scroll down | Hover over the "Profile" menu
|
|
955
|
-
|
|
956
|
-
# File upload / download
|
|
957
|
-
Upload {{FILE:resume.pdf}} to the Resume field and wait for 'Upload complete'
|
|
958
|
-
Download the "Export CSV" link
|
|
959
|
-
Click the "Download" button to download
|
|
960
|
-
|
|
961
|
-
# Assertions (prefix "Soft" to continue on failure)
|
|
962
|
-
Verify "Welcome back" is visible
|
|
963
|
-
Verify "Error" is not visible
|
|
964
|
-
Verify the page title is "Dashboard"
|
|
965
|
-
Verify the URL contains "/dashboard"
|
|
966
|
-
Verify the "Email" field has value "user@test.com"`}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"API steps"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Mark the suite/case as ",e.jsx("strong",{children:"API"}),". Use ",e.jsx("code",{className:"text-accent",children:"{{BASE_URL}}"})," and saved variables."]}),e.jsx("pre",{className:"text-[11px] bg-surface-inset rounded-lg px-4 py-3 overflow-x-auto border border-border font-mono",children:`# Requests
|
|
967
|
-
Send a GET request to {{BASE_URL}}/api/users and verify status is 200
|
|
968
|
-
Send a POST request to {{BASE_URL}}/api/users with body { "name": "John" } and verify status 201
|
|
969
|
-
Send a DELETE request to {{BASE_URL}}/api/users/1 and verify status 204
|
|
970
|
-
|
|
971
|
-
# Auth — extract then reuse a token
|
|
972
|
-
POST to {{BASE_URL}}/api/login with { "email": "{{ADMIN_EMAIL}}", "password": "{{DEFAULT_PASSWORD}}" }, save token as AUTH_TOKEN
|
|
973
|
-
GET {{BASE_URL}}/api/profile with Authorization Bearer {{AUTH_TOKEN}} and verify status 200
|
|
974
|
-
|
|
975
|
-
# Response assertions
|
|
976
|
-
Verify the response body has property "id"
|
|
977
|
-
Verify the response field "name" equals "Admin"
|
|
978
|
-
Verify the content-type header contains "application/json"
|
|
979
|
-
Verify the response time is under 500 ms`}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Full reference with every scenario (iframes, shadow DOM, dialogs, headers, query/form bodies): see ",e.jsx("code",{className:"text-accent",children:"docs/WRITING-STEPS.md"}),"."]})]})},{id:"ai-generation",title:"AI Code Generation",category:"Core Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"AssureMind uses your configured AI provider to convert natural-language instructions into executable Playwright code."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"How It Works"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsx("li",{children:"Write a step instruction in plain English."}),e.jsxs("li",{children:["Click the wand icon or ",e.jsx("strong",{children:"Generate All"}),"."]}),e.jsx("li",{children:"The AI generates strategy-specific Playwright code."}),e.jsx("li",{children:"Review the code by expanding the step row."})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Supported Providers"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"Anthropic Claude, OpenAI GPT-4, Google Gemini, AWS Bedrock, Azure OpenAI, and Ollama (local). Configure via Settings → AI Provider."})]})},{id:"local-models",title:"Local Models (Ollama)",category:"Core Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["Run models entirely on your own machine — no API key, no cost. AssureMind turns plain-English steps into Playwright code, so a ",e.jsx("strong",{children:"code-tuned model with strong instruction-following"})," works best."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Setup"}),e.jsx("pre",{className:"text-[11px] bg-surface-inset rounded-lg px-4 py-3 overflow-x-auto border border-border font-mono",children:`# Install Ollama → https://ollama.com/download
|
|
980
|
-
ollama serve # server on http://localhost:11434
|
|
981
|
-
ollama pull qwen2.5-coder:7b # recommended model
|
|
982
|
-
|
|
983
|
-
# .env
|
|
984
|
-
AI_PROVIDER=ollama
|
|
985
|
-
OLLAMA_MODEL=qwen2.5-coder:7b
|
|
986
|
-
OLLAMA_BASE_URL=http://localhost:11434
|
|
987
|
-
AI_TIMEOUT=120 # local inference is slower`}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Recommended Models (by hardware)"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Hardware"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Model"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Notes"})]})}),e.jsx("tbody",{className:"text-content-secondary",children:[["16 GB+ RAM, GPU 8 GB+ VRAM","qwen2.5-coder:14b","Highest accuracy — complex steps / iframes"],["16 GB RAM (GPU optional) ⭐","qwen2.5-coder:7b","Best balance of quality & speed"],["8 GB RAM, no GPU","llama3.2 (3B) / qwen2.5-coder:3b","Usable; good for simpler steps"],["≤4–6 GB RAM","llama3.2:1b / phi3:mini","Lightweight; navigation & clicks only"]].map(([s,r,a])=>e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("td",{className:"py-1.5 pr-4",children:s}),e.jsx("td",{className:"py-1.5 pr-4 font-mono text-accent",children:r}),e.jsx("td",{className:"py-1.5",children:a})]},r))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"System Requirements"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"RAM is the floor"})," — a model needs roughly its file size + ~2 GB free. A 7B model (~4.7 GB) wants 8 GB free RAM minimum, 16 GB comfortable; a 14B model wants ~16 GB+."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"GPU optional but transformative"})," — CPU-only works (hence the 120s timeout); a GPU with 8 GB+ VRAM (NVIDIA / Apple Silicon / modern AMD) makes 7B models fast."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Disk"})," — a few GB per model; keep 10–20 GB free if trying several."]})]}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Tip: enable ",e.jsx("strong",{children:"MCP"})," (Settings → live page snapshots) for far more accurate locators with local models. Avoid ",e.jsx("code",{className:"text-accent",children:"deepseek-r1"})," here — its reasoning output is slow and pollutes generated code."]})]})},{id:"run-configuration",title:"Run Configuration",category:"Core Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"The Run Configuration page lets you select suites, browsers, and settings before executing a test run."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Options"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsx("li",{children:"Select one or more suites to run"}),e.jsx("li",{children:"Override browsers, headless mode, and parallel count"}),e.jsx("li",{children:"Enable/disable video recording and tracing"}),e.jsx("li",{children:"Set retries and screenshot mode per run"})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Device Emulation"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["The ",e.jsx("strong",{children:"Device Emulation"})," section lets you emulate real mobile and tablet devices using Playwright's built-in device descriptors. Selecting a device applies the correct viewport, user-agent, device pixel ratio, and touch/mobile flags automatically."]}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2 mt-1",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Desktop"})," — Viewport-only presets (1920×1080, 1440×900, 1366×768, 1280×720, 1024×768). No mobile emulation."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Mobile"})," — iPhone 15 Pro/15/14/SE, Pixel 7/5, Galaxy S9+/S8. Full Playwright device descriptor including touch events and mobile UA. Chromium is recommended."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Tablet"})," — iPad Pro 11″, iPad (gen 7), iPad Mini, Galaxy Tab S4. Use WebKit or Chromium for best results."]})]}),e.jsx("p",{className:"text-sm text-content-secondary mt-1",children:"A teal device badge appears on each case in the Reports page when the run used device emulation, making it easy to identify mobile vs desktop results at a glance."}),e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg px-3 py-2 text-[11px] text-amber-700 mt-1",children:["⚠ Mobile and tablet device descriptors work best with ",e.jsx("strong",{children:"Chromium"}),". Firefox and WebKit do not fully support Playwright's mobile emulation flags."]}),e.jsx("h4",{className:"text-sm font-semibold text-content mt-2",children:"Live Progress"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"Run progress is streamed via WebSocket. Status updates appear in real time on the case list and via toast notifications."}),e.jsx("h4",{className:"text-sm font-semibold text-content mt-2",children:"Running from CI/CD (CLI)"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"Every option available in the UI is also available as a CLI flag:"}),e.jsx("pre",{className:"bg-[#1e1e2e] text-[#cdd6f4] text-[10px] font-mono p-3 rounded-lg overflow-x-auto leading-relaxed mt-1",children:`# Run all tests in CI (headless, exit 1 on failure)
|
|
988
|
-
npx assuremind run --all --ci
|
|
989
|
-
|
|
990
|
-
# Filter by type, suite, tag, or test name
|
|
991
|
-
npx assuremind run --type ui --tag smoke
|
|
992
|
-
npx assuremind run --suite "Login Tests" --browser chromium firefox
|
|
993
|
-
|
|
994
|
-
# Device emulation in CI
|
|
995
|
-
npx assuremind run --all --device "iPhone 15 Pro" --browser chromium --ci
|
|
996
|
-
npx assuremind run --tag smoke --device "Pixel 7" --browser chromium --ci
|
|
997
|
-
npx assuremind run --all --device "iPad Pro 11" --browser webkit --ci`})]})},{id:"reports",title:"Reports",category:"Core Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Reports show step-level results with screenshots, error messages, Lighthouse scores (Audit suites), and visual regression baselines."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Report Features"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsx("li",{children:"Per-step pass/fail status and error details"}),e.jsx("li",{children:"Screenshot filmstrip — click any thumbnail to enlarge"}),e.jsx("li",{children:"Execution timeline (Gantt view) per case"}),e.jsx("li",{children:"Visual baseline comparison with diff overlay"}),e.jsx("li",{children:"Allure integration for full HTML reports"})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Lighthouse Results (Audit Suites)"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["For Audit suite cases with Lighthouse data, three tab buttons appear on the case row: ",e.jsx("strong",{children:"⚡ Speed"})," (Performance), ",e.jsx("strong",{children:"♿ A11y"})," (Accessibility), and ",e.jsx("strong",{children:"🔍 SEO"}),". Case rows are highlighted red when any score is Poor (< 50)."]}),e.jsxs("div",{className:"flex gap-4 text-sm mt-1",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-3 h-3 rounded-full bg-emerald-500 inline-block"})," Good (90+)"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-3 h-3 rounded-full bg-amber-400 inline-block"})," Needs Work (50–89)"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-3 h-3 rounded-full bg-red-500 inline-block"})," Poor (< 50) — case FAILS"]})]}),e.jsx("p",{className:"text-sm text-content-secondary mt-1",children:"Allure reports for Audit cases include three separate HTML attachments: Performance Report, Accessibility Report, and SEO Report. The Allure test status is set to FAILED if any score is below 50."})]})},{id:"self-healing",title:"Self-Healing",category:"Core Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Self-healing automatically fixes broken selectors when UI changes cause test failures. Failed steps are re-generated using AI with updated selectors."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Configuration"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Max Level"})," — Healing aggressiveness (1–5)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Daily Budget"})," — Max AI calls per day for healing"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Auto PR"})," — Automatically open a Git PR for healed steps"]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Healed Steps"}),e.jsx("p",{className:"text-sm text-content-secondary",children:'Steps that were healed show an amber "healed" badge in the case editor. View the full healing log in the Self-Healing page.'})]})},{id:"variables",title:"Variables",category:"Core Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["Variables inject dynamic data into steps via ",e.jsx("code",{className:"text-accent",children:"{{VARIABLE_NAME}}"})," tokens."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Per-environment values"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["The Variables page shows an ",e.jsx("strong",{children:"environment grid"}),": every variable can hold a different value for each environment (defaults ",e.jsx("strong",{children:"DEV, TEST, STAGE, INT, PROD"}),"), plus a ",e.jsx("strong",{children:"Global (default)"}),"used when an environment has no specific value. Add, rename, or remove environments in ",e.jsx("strong",{children:"Settings → Environment"}),". Toggle ",e.jsx("strong",{children:"secret"})," to mask a value; click the eye to reveal."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"CI/CD secret overrides"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["At runtime the resolution order is ",e.jsx("code",{className:"text-accent",children:"process.env"})," → environment value → global default. If your pipeline injects a repository ",e.jsx("strong",{children:"secret"})," with the same key name (e.g.",e.jsx("code",{className:"text-accent",children:" ADMIN_PASSWORD"}),"), it overrides the stored value automatically — no file changes. Locally, with no such env var, the stored value is used."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Dynamic Data Picker"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"Click the data picker next to a step input to insert variables, faker tokens, or file tokens at the cursor."})]})},{id:"git-control",title:"Git Control Center",category:"Core Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"The Git Control Center provides a visual interface for all Git operations — commit, push, pull, branch switching, and conflict resolution."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Key Operations"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Commit"})," — Stage and commit all changes with a message"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"AI Message"})," — Generate a commit message using AI"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Full Sync"})," — Commit + push in one click"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Conflict Resolution"})," — Visual diff and AI-assisted merge"]})]})]})},{id:"bulk-actions",title:"Bulk Actions",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Select multiple test cases and perform batch operations including delete and move-to-suite."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"How to Use"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsx("li",{children:"Click the checkbox to the left of any test case row."}),e.jsxs("li",{children:["Hold ",e.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-surface-inset border border-border text-[10px]",children:"Shift"})," and click another row to select a range."]}),e.jsx("li",{children:"The Bulk Action Bar appears at the bottom of the screen."}),e.jsxs("li",{children:["Choose ",e.jsx("strong",{children:"Delete"})," or ",e.jsx("strong",{children:"Move to Suite"}),"."]})]})]})},{id:"flakiness-tracker",title:"Flakiness Tracker",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"The Flakiness Tracker analyzes the last 20 runs for each test case and flags cases that intermittently pass and fail."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Flaky Badge"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Cases with a pass rate between 0% and 100% (and at least 3 runs) show an amber ",e.jsx("strong",{children:"~flaky"})," badge in the case list. Hover to see the exact pass rate."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Thresholds"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"A case is considered flaky when it has at least 3 recorded runs and its historical pass rate is between 1% and 99%."})]})},{id:"step-library",title:"Step Library",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"The Step Library stores reusable step templates that can be inserted into any test case with a single click."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Managing the Library"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Go to ",e.jsx("strong",{children:"Step Library"})," in the sidebar. Add steps with a name, instruction, and optional tags. Library steps are stored in ",e.jsx("code",{className:"text-accent",children:"tests/.step-library.json"}),"."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Inserting Steps"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Open a test case, click the ",e.jsx("strong",{children:"Library"})," button in the top-right of the steps area. Search for a step template and click ",e.jsx("strong",{children:"Insert"})," to add it to the current case."]})]})},{id:"environment-profiles",title:"Environment Profiles",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Environment Profiles let you save and switch between different test configurations (URL, browsers, environment) without manually editing settings."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Creating Profiles"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Go to ",e.jsx("strong",{children:"Settings → Environment Profiles"})," and click ",e.jsx("strong",{children:"Add Profile"}),". Enter a name, then configure the profile in the list."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Switching Profiles"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"The profile picker appears in the top bar. Click a profile name to instantly apply it, overriding the active environment and base URL for the next run."})]})},{id:"mcp-integration",title:"MCP Integration",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["MCP (Model Context Protocol) integration connects the AI code generator to a real Playwright browser via the official ",e.jsx("code",{className:"text-accent",children:"@playwright/mcp"})," server. Instead of guessing selectors blindly, the AI sees actual page elements through accessibility snapshots — boosting code generation accuracy from ~50-70% to ~90-95%."]}),e.jsxs("div",{className:"rounded-lg bg-purple-50 border border-purple-200 px-4 py-3 text-sm text-purple-800",children:[e.jsx("strong",{children:"Enabled by default"})," — MCP is ON for code generation and OFF for test execution. Your existing tests and CI/CD pipelines are unaffected."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"How It Works"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["When you click ",e.jsx("strong",{children:"Generate Code"}),", the SmartRouter launches a headless Playwright browser via MCP."]}),e.jsxs("li",{children:["The browser navigates to your app's URL and takes an ",e.jsx("strong",{children:"accessibility snapshot"})," — a structured tree of all interactive elements (buttons, inputs, links, etc.)."]}),e.jsx("li",{children:"The snapshot is fed to the AI alongside the step instruction, so the AI sees exact element roles, names, and attributes."}),e.jsx("li",{children:"The AI generates Playwright code using real selectors from the live page — no guessing."})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Generation Strategies"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Strategy"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Toggle"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Description"})]})}),e.jsx("tbody",{className:"text-content-secondary divide-y divide-border/50",children:[["Snapshot-Driven","Enable MCP","AI sees live accessibility snapshot during generation. Zero overhead for cached/template steps."],["Act-then-Script","Act-then-script","AI plans MCP tool actions → executes them on the real browser → converts successful actions to Playwright code. Near-100% accuracy but higher latency."],["Proactive Healing","Proactive healing","Before a test run, MCP takes a fresh snapshot and validates every selector in generated code against the live page. Missing elements are flagged with suggestions."]].map(([s,r,a])=>e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:s}),e.jsx("td",{className:"py-1.5 pr-4 font-mono text-accent text-[10px]",children:r}),e.jsx("td",{className:"py-1.5",children:a})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Settings"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Go to ",e.jsx("strong",{children:"Settings → MCP Integration"})," to configure:"]}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Enable MCP"})," — Master switch (ON by default). When off, falls back to blind generation."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Headless mode"})," — Run the MCP browser without a visible window (ON by default)."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Act-then-script"})," — Two-phase generation: execute first, then convert to code (OFF by default)."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Proactive healing"})," — Pre-run selector validation against the live page (OFF by default)."]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Fallback Behavior"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Every MCP call is wrapped in a silent try/catch. If the MCP server crashes, the browser fails to launch, or a snapshot times out, the system ",e.jsx("strong",{children:"automatically falls back to blind generation"})," — exactly how it worked before MCP. No test run will ever fail because of MCP."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Performance Impact"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Template steps (~60%)"})," — Zero MCP overhead (bypassed entirely)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Cached steps (~20%)"})," — Zero MCP overhead (bypassed entirely)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"AI-generated steps (~20%)"})," — +2-5s first page load, <500ms for subsequent snapshots on the same page"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Test execution"})," — Zero impact (MCP is never used during runs)"]})]})]})},{id:"rag-memory",title:"RAG Memory",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["RAG (Retrieval-Augmented Generation) gives the AI ",e.jsx("strong",{children:"semantic memory"})," from past test runs. Every successful step, healing fix, and recurring error is indexed so the AI retrieves similar experiences and generates better code over time."]}),e.jsxs("div",{className:"rounded-lg bg-emerald-50 border border-emerald-200 px-4 py-3 text-sm text-emerald-800",children:[e.jsx("strong",{children:"Enabled by default"})," — uses local TF-IDF embeddings and file-based JSON storage. Zero cost, zero database, fully offline."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Three Corpora"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Corpus"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Stores"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Used During"})]})}),e.jsx("tbody",{className:"text-content-secondary divide-y divide-border/50",children:[["Code Corpus","Instruction-to-code mappings from successful runs","Generation — similar past steps as AI examples or direct fuzzy cache hits"],["Healing Corpus","Past healing events (error + fix pairs)","Self-healing — proven past fixes injected into Level 2 repair prompt"],["Error Catalog","Recurring error patterns per URL with fix history","Generation — AI warned about known-bad selectors to avoid"]].map(([s,r,a])=>e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:s}),e.jsx("td",{className:"py-1.5 pr-4",children:r}),e.jsx("td",{className:"py-1.5",children:a})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"How It Works"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Step passes"})," — instruction + code are ingested into the Code Corpus."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Step fails"})," — error pattern is recorded in the Error Catalog."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Healing succeeds"})," — fix is ingested into the Healing Corpus; Error Catalog updated with the fix."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Next generation"})," — SmartRouter queries Code Corpus. Score ≥ 0.90 = direct use ($0). Score 0.65-0.90 = AI prompt examples."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Next healing"})," — Level 2 queries Healing Corpus for similar past fixes."]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"SmartRouter Pipeline"}),e.jsx("pre",{className:"text-[11px] bg-surface-inset rounded-lg px-4 py-3 overflow-x-auto border border-border font-mono leading-relaxed",children:`1. Template ($0) → 2. Cache ($0) → 2.3 RAG ($0) → 2.5 MCP → AI Call
|
|
998
|
-
↑
|
|
999
|
-
Score ≥ 0.90 → direct use (free)
|
|
1000
|
-
Score 0.65–0.90 → inject as examples`}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Storage"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["All RAG data stored in ",e.jsx("code",{className:"text-accent",children:"results/.rag/"})," as JSON files — fully Git-friendly. Delete the directory to reset all memory."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Consumer Experience"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:[e.jsx("strong",{children:"Zero setup required."})," RAG is ON by default and works automatically from the first run:"]}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Run 1"})," — memory is empty, AI generates code normally"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Run 2+"})," — similar instructions retrieved instead of making API calls (free + faster)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Run 10+"})," — most common steps served from memory at zero cost"]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"FAQ"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Question"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Answer"})]})}),e.jsx("tbody",{className:"text-content-secondary divide-y divide-border/50",children:[["Do I need to configure anything?","No. RAG is ON by default with zero setup."],["Does it cost anything?","No. TF-IDF embedder runs locally. RAG hits replace paid AI calls."],["Does it slow down tests?","No. RAG lookup is <1ms. It speeds up generation."],["Works in CI/CD?","Yes. Cache results/.rag/ between runs to persist memory."],["Share memory across team?","Commit results/.rag/ to Git or use a CI cache step."],["How to reset?","Delete the results/.rag/ folder."]].map(([s,r])=>e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:s}),e.jsx("td",{className:"py-1.5",children:r})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"When to Use the Settings Card"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Most users ",e.jsx("strong",{children:"never need to touch RAG settings"}),". The Settings → RAG Memory card exists for power-user scenarios:"]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Scenario"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Action"})]})}),e.jsx("tbody",{className:"text-content-secondary divide-y divide-border/50",children:[["Debugging a flaky test","Turn OFF Code Corpus — forces fresh AI generation"],["Healing keeps suggesting a bad fix","Turn OFF Healing Corpus — clears bad fix influence"],["Major app redesign","Turn OFF RAG entirely — old memory is misleading"],["Want deterministic CI runs","Disable RAG in CI, keep ON locally"],["Error warnings are outdated","Turn OFF Error Catalog — stops AI from avoiding selectors that are fine now"]].map(([s,r])=>e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:s}),e.jsx("td",{className:"py-1.5",children:r})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Settings Reference"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Go to ",e.jsx("strong",{children:"Settings → RAG Memory"})," to configure:"]}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Enable RAG"})," — Master switch (ON by default)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Code Corpus"})," — Toggle instruction-to-code memory"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Healing Corpus"})," — Toggle healing fix memory"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Error Catalog"})," — Toggle error pattern tracking"]})]})]})},{id:"per-step-retry",title:"Per-Step Retry",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Individual steps can be configured to retry on failure, independent of the global retry setting."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Configuration"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["In the case editor, each step row shows a small ",e.jsx("strong",{children:"×"})," number input next to the timeout. Enter a value from 0–5 to set the retry count for that step. The step-level value overrides the global setting."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Retry Behavior"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"On failure, the step is re-executed up to N times. If any attempt passes, the step is marked as passed. All retry attempts are logged in the step result."})]})},{id:"case-hooks",title:"Case-Level Hooks",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Before and After hooks run additional steps around a test case's main step sequence."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Hooks Tab"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Open a test case and click the ",e.jsx("strong",{children:"Hooks"})," tab (next to Steps). Add before-hooks that run before any steps, and after-hooks that always run even if steps fail."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Use Cases"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsx("li",{children:"Before hook: Login, seed test data, navigate to start URL"}),e.jsx("li",{children:"After hook: Logout, clean up created records, capture diagnostics"})]})]})},{id:"network-mocking",title:"Network Mocking",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Mock steps intercept HTTP requests matching a URL pattern and return a custom response — without touching the real backend."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Creating a Mock Step"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["In the case editor, change the step type dropdown to ",e.jsx("strong",{children:"Mock"}),"."]}),e.jsx("li",{children:"Expand the step to reveal the Mock Route fields."}),e.jsxs("li",{children:["Enter the URL pattern (e.g. ",e.jsx("code",{className:"text-accent",children:"**/api/users"}),"), status code, and JSON body."]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Behavior"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"The mock route is active for the duration of that step and is removed immediately after. Subsequent steps run against the real network."})]})},{id:"audit-lighthouse",title:"Audit & Lighthouse",category:"New Features",content:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Audit suites"})," run full Playwright automation and trigger Google Lighthouse at steps explicitly marked with the ",e.jsx("strong",{children:"⚡ Audit"})," flag. Three categories are measured: Performance, Accessibility, and SEO."]}),e.jsxs("div",{className:"rounded-lg bg-violet-50 border border-violet-200 px-4 py-3 text-sm text-violet-800",children:[e.jsx("strong",{children:"Chromium only"}),' — Lighthouse uses Chrome DevTools Protocol (CDP). Firefox and WebKit runs will show a "not available" notice instead.']}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"How It Works"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["Create an ",e.jsx("strong",{children:"Audit"})," suite in the Test Editor."]}),e.jsxs("li",{children:["Mark one or more steps with the ",e.jsx("strong",{children:"⚡ Audit"})," button to designate Lighthouse checkpoints."]}),e.jsxs("li",{children:["In the ",e.jsx("strong",{children:"Non-Functional Checks"})," section on each case, tick ⚡ Performance, ♿ Accessibility, and/or 🔍 SEO."]}),e.jsxs("li",{children:["Run the suite — Lighthouse audits ",e.jsx("code",{className:"text-accent",children:"page.url()"})," at each marked step."]}),e.jsx("li",{children:"Results are saved to the run report with color-coded scores."})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Collected Metrics"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{label:"Performance Score",range:"0–100",good:"≥ 90",desc:"Overall Lighthouse score"},{label:"FCP",range:"ms",good:"< 1.8s",desc:"First Contentful Paint"},{label:"LCP",range:"ms",good:"< 2.5s",desc:"Largest Contentful Paint"},{label:"CLS",range:"score",good:"< 0.1",desc:"Cumulative Layout Shift"},{label:"TTFB",range:"ms",good:"< 800ms",desc:"Time to First Byte"},{label:"TBT",range:"ms",good:"< 200ms",desc:"Total Blocking Time"},{label:"Speed Index",range:"ms",good:"< 3.4s",desc:"Visual load speed"},{label:"TTI",range:"ms",good:"< 3.8s",desc:"Time to Interactive"},{label:"INP",range:"ms",good:"< 200ms",desc:"Interaction to Next Paint"}].map(s=>e.jsxs("div",{className:"rounded-lg border border-border bg-surface-inset/40 px-3 py-2",children:[e.jsx("p",{className:"text-xs font-bold text-content",children:s.label}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:s.desc}),e.jsxs("p",{className:"text-[10px] text-emerald-600 font-medium mt-0.5",children:["Good: ",s.good]})]},s.label))}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Viewing in Reports"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsx("li",{children:"Open the Reports page and expand a completed Audit run."}),e.jsxs("li",{children:["Case rows with Lighthouse data show three tab buttons: ",e.jsx("strong",{children:"⚡ Speed"}),", ",e.jsx("strong",{children:"♿ A11y"}),", ",e.jsx("strong",{children:"🔍 SEO"}),"."]}),e.jsx("li",{children:"Click a tab to view the score and metrics for that category."}),e.jsx("li",{children:"Case rows are highlighted red when any score is Poor (< 50)."})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Allure Attachments"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"Each Audit case produces three separate HTML attachments in the Allure report: Performance Report, Accessibility Report, and SEO Report. The Allure test status is set to FAILED if any score is below 50."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Color Thresholds"}),e.jsxs("div",{className:"flex gap-4 text-sm",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-3 h-3 rounded-full bg-emerald-500 inline-block"})," Good (90–100)"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-3 h-3 rounded-full bg-amber-400 inline-block"})," Needs Work (50–89)"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-3 h-3 rounded-full bg-red-500 inline-block"})," Poor (0–49) — test FAILS"]})]})]})},{id:"visual-regression",title:"Visual Regression",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["Visual regression testing compares step screenshots against saved baselines to detect unintended UI changes. Configure in ",e.jsx("strong",{children:"Settings"})," → Visual Regression. Review results in ",e.jsx("strong",{children:"Reports"})," → Visual Diffs / Baselines tabs."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Setup"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["Go to ",e.jsx("strong",{children:"Settings"})," → Visual Regression and enable it."]}),e.jsxs("li",{children:["In the ",e.jsx("strong",{children:"Test Editor"}),", click the ",e.jsx("strong",{children:"Eye icon"})," on steps you want to compare visually."]}),e.jsx("li",{children:"Run your tests — first run creates baselines automatically."})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Reviewing Diffs"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["After runs, go to ",e.jsx("strong",{children:"Reports"})," → ",e.jsx("strong",{children:"Visual Diffs"})," tab to review side-by-side comparisons. Approve intentional changes or reject bugs. Manage all baselines in the ",e.jsx("strong",{children:"Baselines"})," tab."]})]})},{id:"test-impact",title:"Test Impact Analysis",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Test Impact Analysis identifies which test cases might be affected by the current set of uncommitted file changes."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Running Analysis"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["Open the ",e.jsx("strong",{children:"Git Control Center"}),"."]}),e.jsxs("li",{children:["Expand the ",e.jsx("strong",{children:"Test Impact Analysis"})," section."]}),e.jsxs("li",{children:["Click ",e.jsx("strong",{children:"Analyze Impact"}),"."]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"How It Works"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"Changed file names and paths are compared against test case names, step instructions, and suite names. Matched cases are listed with the matched file as the reason."})]})},{id:"device-emulation",title:"Device Emulation",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["Device Emulation lets you test your application as it appears on real mobile phones and tablets, using Playwright's built-in device descriptor registry. No manual viewport tuning needed — the correct user-agent, device pixel ratio, viewport, touch events, and ",e.jsx("code",{className:"text-[10px] bg-surface-inset px-1 py-0.5 rounded",children:"isMobile"})," flag are all applied automatically."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Using in Studio (Run Config)"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["Go to the ",e.jsx("strong",{children:"Run Config"})," page."]}),e.jsxs("li",{children:["Find the ",e.jsx("strong",{children:"Device Emulation"})," card below the Browsers card."]}),e.jsxs("li",{children:["Use the tabs to filter by ",e.jsx("strong",{children:"All / Desktop / Mobile / Tablet"}),"."]}),e.jsx("li",{children:"Click a device card to select it — it highlights in teal."}),e.jsxs("li",{children:["Click ",e.jsx("strong",{children:"Start Run"})," — the device is applied to every case in the run."]}),e.jsxs("li",{children:["To clear, click the ",e.jsx("strong",{children:"×"})," in the card header or select ",e.jsx("strong",{children:"No Emulation"}),"."]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Using from CLI / CI"}),e.jsx("pre",{className:"bg-[#1e1e2e] text-[#cdd6f4] text-[10px] font-mono p-3 rounded-lg overflow-x-auto leading-relaxed",children:`# Mobile
|
|
1001
|
-
npx assuremind run --all --device "iPhone 15 Pro" --browser chromium --ci
|
|
1002
|
-
npx assuremind run --tag smoke --device "Pixel 7" --browser chromium --ci
|
|
1003
|
-
|
|
1004
|
-
# Tablet
|
|
1005
|
-
npx assuremind run --all --device "iPad Pro 11" --browser webkit --ci
|
|
1006
|
-
npx assuremind run --suite "Mobile" --device "Galaxy Tab S4" --browser chromium --ci
|
|
1007
|
-
|
|
1008
|
-
# Permanent default in autotest.config.ts
|
|
1009
|
-
device: 'iPhone 15 Pro'`}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Available Devices"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Device"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Category"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Viewport"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Best Browser"})]})}),e.jsx("tbody",{className:"text-content-secondary divide-y divide-border/50",children:[["iPhone 15 Pro","Mobile","393×852","Chromium / WebKit"],["iPhone 15","Mobile","390×844","Chromium / WebKit"],["iPhone 14","Mobile","390×844","Chromium / WebKit"],["iPhone SE","Mobile","375×667","Chromium / WebKit"],["Pixel 7","Mobile","412×915","Chromium"],["Pixel 5","Mobile","393×851","Chromium"],["Galaxy S9+","Mobile","320×658","Chromium"],["Galaxy S8","Mobile","360×740","Chromium"],["iPad Pro 11","Tablet","834×1194","WebKit / Chromium"],["iPad (gen 7)","Tablet","810×1080","WebKit / Chromium"],["iPad Mini","Tablet","768×1024","WebKit / Chromium"],["Galaxy Tab S4","Tablet","712×1138","Chromium"]].map(([s,r,a,o])=>e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 pr-4 font-mono text-[10px]",children:s}),e.jsx("td",{className:"py-1.5 pr-4",children:r}),e.jsx("td",{className:"py-1.5 pr-4",children:a}),e.jsx("td",{className:"py-1.5",children:o})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"In Reports"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"When a run uses device emulation, each case row in Reports shows a teal device badge (📱 phone / tablet icon) with the device name, so you can instantly tell mobile runs from desktop runs."}),e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg px-3 py-2 text-[11px] text-amber-700",children:["⚠ Mobile and tablet device descriptors work best with ",e.jsx("strong",{children:"Chromium"}),". Firefox and WebKit do not fully support Playwright's mobile emulation flags (touch events, mobile UA)."]})]})},{id:"test-recorder",title:"Test Recorder",category:"New Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["The Test Recorder lets you create tests by interacting with your application in a real browser — ",e.jsx("strong",{children:"no coding, no AI, no cost"}),". Click, fill forms, navigate pages, and every action becomes a test step with verified Playwright code. Available for ",e.jsx("strong",{children:"UI"})," and ",e.jsx("strong",{children:"Audit"})," suites only (not API suites)."]}),e.jsxs("div",{className:"rounded-lg bg-red-50 border border-red-200 px-4 py-3 text-sm text-red-800",children:[e.jsx("strong",{children:"Zero AI, zero cost"})," — the recorder resolves locators against Playwright's live accessibility tree. No API keys or AI calls needed."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"How to Record"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["Open a test case in the ",e.jsx("strong",{children:"Test Editor"}),"."]}),e.jsxs("li",{children:["Click the red ",e.jsx("strong",{children:"Record"}),' button (between "Add Step" and "Generate All").']}),e.jsx("li",{children:"A headed Chromium browser opens your app's base URL."}),e.jsxs("li",{children:["Interact naturally — click buttons, fill forms, navigate pages. ",e.jsx("strong",{children:"Iframes are handled automatically."})]}),e.jsx("li",{children:"Each action appears in the live preview panel in real time."}),e.jsxs("li",{children:["Click ",e.jsx("strong",{children:"Stop Recording"})," when done — all actions become steps with pre-generated code."]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Assertion Shortcuts"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Shortcut"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Type"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Behavior"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Example Output"})]})}),e.jsx("tbody",{className:"text-content-secondary divide-y divide-border/50",children:[["Shift+Click","Hard assertion","Test stops on failure","expect(page.getByRole('heading', { name: 'Dashboard' })).toBeVisible()"],["Ctrl+Shift+Click","Soft assertion","Test continues, failures collected","expect.soft(page.getByRole('heading', { name: 'Dashboard' })).toBeVisible()"],["Ctrl+Shift+U","URL check","Hard assertion","expect(page).toHaveURL(/dashboard/)"],["Ctrl+Shift+T","Title check","Hard assertion","expect(page).toHaveTitle(/Dashboard/)"]].map(([s,r,a,o])=>e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-surface-inset border border-border text-[10px] font-mono",children:s})}),e.jsx("td",{className:"py-1.5 pr-4",children:r}),e.jsx("td",{className:"py-1.5 pr-4",children:a}),e.jsx("td",{className:"py-1.5 font-mono text-[10px] text-accent",children:o})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Hard vs Soft Assertions"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Type"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Keyword"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Behavior"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"When to use"})]})}),e.jsx("tbody",{className:"text-content-secondary divide-y divide-border/50",children:[["Hard","Verify ...","Test stops immediately on failure","Critical checks — login worked, page loaded"],["Soft","Soft verify ...","Test continues, all failures reported at end","Multiple checks on one page — verify 5 fields are correct"]].map(([s,r,a,o])=>e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:s}),e.jsx("td",{className:"py-1.5 pr-4 font-mono text-[10px]",children:r}),e.jsx("td",{className:"py-1.5 pr-4",children:a}),e.jsx("td",{className:"py-1.5",children:o})]},s))})]})}),e.jsx("p",{className:"text-sm text-content-secondary",children:e.jsx("strong",{children:"Three ways to use soft assertions:"})}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Recorder"})," — Ctrl+Shift+Click instead of Shift+Click"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Plain English"}),' — Start instruction with "Soft verify..." or "Soft check..." or "Soft assert..."']}),e.jsxs("li",{children:[e.jsx("strong",{children:"Step toggle"})," — Click the blue ",e.jsx("strong",{children:"Hard/Soft"})," badge on any assertion step in the editor"]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Locator Resolution (6 Strategies)"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["The recorder queries Playwright's ",e.jsx("strong",{children:"accessibility tree"})," and tries 6 strategies in priority order, verifying each with ",e.jsx("code",{className:"text-accent",children:"count() === 1"}),":"]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"#"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Strategy"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Example"})]})}),e.jsx("tbody",{className:"text-content-secondary divide-y divide-border/50",children:[["1","data-testid","page.getByTestId('login-btn')"],["2","getByRole (exact + level)","page.getByRole('heading', { name: 'Dashboard', level: 1 })"],["3","getByRole (exact)","page.getByRole('button', { name: 'Login' })"],["4","getByLabel","page.getByLabel('Email')"],["5","getByPlaceholder","page.getByPlaceholder('Enter email')"],["6","getByText","page.getByText('Welcome')"],["7","CSS fallback","page.locator('#login-btn')"]].map(([s,r,a])=>e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:s}),e.jsx("td",{className:"py-1.5 pr-4 font-medium",children:r}),e.jsx("td",{className:"py-1.5 font-mono text-[10px] text-accent",children:a})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"What Makes It Stand Out vs Other Recorders"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Feature"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Selenium IDE"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Playwright Codegen"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"AssureMind Recorder"})]})}),e.jsx("tbody",{className:"text-content-secondary divide-y divide-border/50",children:[["Locator quality","CSS/XPath","Good","Best — 6 strategies, verified"],["Accessibility tree","No","Partial","Full — every locator checked"],["Iframe support","Partial","Manual","Auto — frameLocator() code"],["Assertions","Manual","Manual","Shift+Click shortcuts"],["Plain-English steps","No","No","Yes — auto-generated"],["Self-healing after","No","No","Yes — 5-level AI cascade"],["RAG memory","No","No","Yes — feeds learning loop"],["Cost","Free","Free","Free"]].map(([s,r,a,o])=>e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:s}),e.jsx("td",{className:"py-1.5 pr-4",children:r}),e.jsx("td",{className:"py-1.5 pr-4",children:a}),e.jsx("td",{className:"py-1.5 font-medium text-emerald-600",children:o})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Biggest Pain Points in Test Automation — Solved"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Pain Point"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"How Recorder Solves It"})]})}),e.jsx("tbody",{className:"text-content-secondary divide-y divide-border/50",children:[["Writing tests is slow","Record a full test in 30 seconds"],["Selectors break constantly","Locators verified against Playwright's accessibility tree in real time"],["AI costs money","Recording + code generation = $0, zero AI calls"],["Non-technical testers can't write tests","Anyone who can click a browser can create tests"],["Assertions are hard to write","Shift+Click for visibility, Ctrl+Shift+U for URL, Ctrl+Shift+T for title"],["Recorded tests are fragile","6-strategy locator resolution + post-run 5-level self-healing"],["Apps use iframes (SAP, Salesforce)","Auto-detects iframes, generates frameLocator() chains"]].map(([s,r])=>e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:s}),e.jsx("td",{className:"py-1.5",children:r})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Iframe Support"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["The recorder automatically handles ",e.jsx("strong",{children:"same-origin iframes"})," — common in enterprise apps like SAP, Salesforce, and embedded widgets:"]}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["Capture script injected into ",e.jsx("strong",{children:"all frames"})," (main page + every iframe)"]}),e.jsxs("li",{children:["Elements inside iframes produce ",e.jsx("code",{className:"text-accent",children:"frameLocator()"})," chains automatically"]}),e.jsxs("li",{children:["Example: ",e.jsxs("code",{className:"text-accent text-[10px]",children:["page.frameLocator('#content-frame').getByRole('button', ","{"," name: 'Submit' ","}",").click()"]})]}),e.jsxs("li",{children:["Dynamically loaded iframes detected via ",e.jsx("code",{className:"text-accent",children:"frameattached"})," events"]}),e.jsx("li",{children:"Recording banner only appears in the main frame"}),e.jsxs("li",{children:[e.jsx("strong",{children:"Limitation:"})," Cross-origin iframes (different domain) cannot be instrumented due to browser security"]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Technical Details"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["Uses ",e.jsx("code",{className:"text-accent",children:"context.exposeBinding()"})," — communication survives all page navigations and works across all frames"]}),e.jsxs("li",{children:["Input values captured on ",e.jsx("strong",{children:"blur"})," (when user leaves the field), not on keystrokes — no duplicate steps"]}),e.jsxs("li",{children:["Capture script re-injected on every page load via ",e.jsx("code",{className:"text-accent",children:"page.on('load')"})," and into child frames via ",e.jsx("code",{className:"text-accent",children:"frameattached"})," + ",e.jsx("code",{className:"text-accent",children:"framenavigated"})]}),e.jsxs("li",{children:["Recorded steps use the ",e.jsx("strong",{children:"recorder"})," strategy tag, distinguishing them from AI-generated code"]}),e.jsx("li",{children:'All recorded steps are immediately runnable — no "Generate Code" step required'})]})]})},{id:"keyboard-shortcuts",title:"Keyboard Shortcuts",category:"Reference",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["Press ",e.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-surface-inset border border-border text-[10px]",children:"?"})," anywhere in the app to open the shortcuts modal."]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Shortcut"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Action"})]})}),e.jsx("tbody",{className:"text-content-secondary",children:[["?","Show keyboard shortcuts"],["Ctrl+K / Cmd+K","Open search palette"],["Escape","Close modal / dialog"],["Enter (step input)","Add new step"],["Enter (case name)","Save case"],["Shift+Click (case row)","Range-select cases"]].map(([s,r])=>e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-surface-inset border border-border text-[10px] font-mono",children:s})}),e.jsx("td",{className:"py-1.5",children:r})]},s))})]})})]})},{id:"data-driven",title:"Data-Driven Testing",category:"Reference",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Test cases support data-driven execution — running the same case multiple times with different input data."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Data Sources"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Inline JSON"})," — Enter an array of objects directly in the editor"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"JSON File"})," — Reference a ",e.jsx("code",{className:"text-accent",children:".json"})," file in your project"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"CSV File"})," — Reference a ",e.jsx("code",{className:"text-accent",children:".csv"})," file with headers"]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Accessing Data"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Use ",e.jsx("code",{className:"text-accent",children:"{{row.fieldName}}"})," in step instructions to reference data columns. The case runs once per row."]})]})},{id:"faker-data",title:"Faker / Dynamic Data",category:"Reference",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Faker tokens generate random, realistic test data at runtime. Use them to avoid hardcoded values in test steps."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Available Tokens"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:["faker.email","faker.name","faker.phone","faker.company","faker.uuid","faker.date","faker.number","faker.word"].map(s=>e.jsx("code",{className:"text-[10px] bg-surface-inset rounded px-2 py-0.5 border border-border text-accent font-mono",children:`{{${s}}}`},s))}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Usage"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Type the token directly in a step instruction, or use the ",e.jsx("strong",{children:"Dynamic Data Picker"})," button next to the step input to insert tokens at the cursor position."]})]})},{id:"api-reference",title:"API Reference",category:"Reference",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["AssureMind exposes a REST API at ",e.jsx("code",{className:"text-accent",children:"http://localhost:4400/api"})," for programmatic access."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Key Endpoints"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Endpoint"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Description"})]})}),e.jsx("tbody",{className:"text-content-secondary font-mono",children:[["GET /suites","List all test suites"],["POST /suites","Create a suite"],["GET /suites/:id/cases","List cases in a suite"],["POST /suites/:id/cases","Create a test case"],["POST /run","Start a test run"],["GET /results","List run results"],["GET /flakiness","Get flakiness report"],["GET /step-library","List library steps"],["GET /git/impact","Run test impact analysis"]].map(([s,r])=>e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("td",{className:"py-1.5 pr-4 text-accent text-[10px]",children:s}),e.jsx("td",{className:"py-1.5 font-sans",children:r})]},s))})]})})]})},{id:"faker-data",title:"Faker Data",category:"Enterprise Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Faker Data gives you 100+ realistic data generators across 16 categories, powered by faker.js. Every token produces fresh random values on each test run — no hardcoded data, no duplicates, no code required."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Token Format"}),e.jsxs("p",{children:["Use the pattern ",e.jsx("code",{className:"text-accent",children:"{{FAKE_CATEGORY_METHOD}}"})," anywhere in a step value. The engine replaces it with a random value at runtime."]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Token"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Example Output"})]})}),e.jsx("tbody",{className:"text-content-secondary",children:[["{{FAKE_PERSON_FULLNAME}}","Sarah Johnson"],["{{FAKE_INTERNET_EMAIL}}","sarah.johnson42@example.com"],["{{FAKE_PHONE_NUMBER}}","(555) 867-5309"],["{{FAKE_LOCATION_CITY}}","Portland"],["{{FAKE_COMPANY_NAME}}","Acme Corp"],["{{FAKE_FINANCE_CREDITCARDNUMBER}}","4111-XXXX-XXXX-1234"],["{{FAKE_COMMERCE_PRODUCTNAME}}","Ergonomic Steel Chair"],["{{FAKE_VEHICLE_MODEL}}","Mustang"]].map(([s,r])=>e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{className:"text-accent",children:s})}),e.jsx("td",{className:"py-1.5",children:r})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"16 Categories"}),e.jsxs("p",{children:[e.jsx("code",{className:"text-accent",children:"person"}),","," ",e.jsx("code",{className:"text-accent",children:"internet"}),","," ",e.jsx("code",{className:"text-accent",children:"phone"}),","," ",e.jsx("code",{className:"text-accent",children:"location"}),","," ",e.jsx("code",{className:"text-accent",children:"company"}),","," ",e.jsx("code",{className:"text-accent",children:"finance"}),","," ",e.jsx("code",{className:"text-accent",children:"date"}),","," ",e.jsx("code",{className:"text-accent",children:"lorem"}),","," ",e.jsx("code",{className:"text-accent",children:"string"}),","," ",e.jsx("code",{className:"text-accent",children:"number"}),","," ",e.jsx("code",{className:"text-accent",children:"datatype"}),","," ",e.jsx("code",{className:"text-accent",children:"image"}),","," ",e.jsx("code",{className:"text-accent",children:"color"}),","," ",e.jsx("code",{className:"text-accent",children:"commerce"}),","," ",e.jsx("code",{className:"text-accent",children:"vehicle"}),","," ",e.jsx("code",{className:"text-accent",children:"system"})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Legacy Tokens (Backward-Compatible)"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"These shorthand tokens from earlier versions still work and map to their modern equivalents:"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Legacy Token"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Maps To"})]})}),e.jsx("tbody",{className:"text-content-secondary",children:[["FAKE_FIRST_NAME","{{FAKE_PERSON_FIRSTNAME}}"],["FAKE_LAST_NAME","{{FAKE_PERSON_LASTNAME}}"],["FAKE_AGE","{{FAKE_NUMBER_INT}} (18-65)"],["FAKE_EMAIL","{{FAKE_INTERNET_EMAIL}}"],["FAKE_PHONE","{{FAKE_PHONE_NUMBER}}"],["FAKE_PASSWORD","{{FAKE_INTERNET_PASSWORD}}"],["FAKE_NUMBER_N","{{FAKE_NUMBER_INT}} (0-N)"]].map(([s,r])=>e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{className:"text-accent",children:s})}),e.jsx("td",{className:"py-1.5",children:e.jsx("code",{className:"text-accent",children:r})})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Auto-Refresh"}),e.jsx("p",{className:"text-sm text-content-secondary",children:"Every faker token is resolved at the start of each test run, producing completely fresh random values. No caching, no repeats across runs — ideal for tests that require unique data on every execution."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Modal UI — Multi-Select & Insert"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Click the ",e.jsx("code",{className:"text-accent",children:"fx"})," button on any step input to open the Faker Data picker. The modal lets you search across all 100+ generators, browse by category, and preview sample output."]}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["The picker supports ",e.jsx("strong",{children:"multi-select"})," — click any generator to select it (checkmark + violet highlight). Selected tokens appear as ",e.jsx("strong",{children:"removable chips"})," ","in a bar at the bottom of the modal. For Random Number, use the"," ",e.jsx("code",{className:"text-accent",children:"+ Add"})," button to add it to your selection."]}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Insert N tokens"})," — inserts all selected tokens comma-separated into the step instruction."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Clear all"})," — removes every selection from the chip bar."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Cancel"})," — closes the modal without inserting anything."]})]}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Example: selecting ",e.jsx("code",{className:"text-accent",children:"firstName"}),","," ",e.jsx("code",{className:"text-accent",children:"lastName"}),", and"," ",e.jsx("code",{className:"text-accent",children:"email"})," inserts:"," ",e.jsx("code",{className:"text-accent",children:"{{FAKE_PERSON_FIRSTNAME}}, {{FAKE_PERSON_LASTNAME}}, {{FAKE_INTERNET_EMAIL}}"})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Use Cases"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Form filling"})," — Populate any form with realistic names, emails, addresses, and phone numbers in one step."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Registration testing"}),' — Generate unique users every run so you never hit "email already exists" errors.']}),e.jsxs("li",{children:[e.jsx("strong",{children:"Data-driven testing"})," — Combine faker tokens with data loops to generate hundreds of unique test rows automatically."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Finance workflows"})," — Random credit card numbers, IBAN codes, and currency amounts for payment flow tests."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"E-commerce"})," — Product names, prices, and quantities for realistic order flow coverage."]})]})]})},{id:"file-upload-download",title:"File Upload & Download",category:"Enterprise Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Handle file inputs and downloads with no boilerplate — upload fixtures from the Studio and let the framework capture downloads automatically."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Uploading files"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["In the ",e.jsx("strong",{children:"Test Editor"}),", click the ",e.jsx("strong",{children:"Files"})," button (next to ",e.jsx("em",{children:"Fake Data"}),")."]}),e.jsxs("li",{children:["Choose a file — it's saved in your repo at ",e.jsx("code",{className:"text-accent",children:"fixtures/uploads/"})," (committed, CI-portable)."]}),e.jsxs("li",{children:["Click the file to insert a ",e.jsx("code",{className:"text-accent",children:"{{FILE:name}}"})," token into the step."]})]}),e.jsx("p",{className:"text-sm text-content-secondary",children:"The token resolves to the file's path at runtime:"}),e.jsx("pre",{className:"text-[11px] bg-surface-inset rounded-lg px-4 py-3 overflow-x-auto border border-border font-mono",children:`Step: Upload {{FILE:resume.pdf}} to the Resume field
|
|
1010
|
-
Code: await page.getByLabel('Resume').setInputFiles('{{FILE:resume.pdf}}');
|
|
1011
|
-
|
|
1012
|
-
// File-chooser button (keep listener + click in ONE step):
|
|
1013
|
-
const fileChooserPromise = page.waitForEvent('filechooser');
|
|
1014
|
-
await page.getByRole('button', { name: 'Choose File' }).click();
|
|
1015
|
-
(await fileChooserPromise).setFiles('{{FILE:resume.pdf}}');`}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["Inside an iframe, wrap with ",e.jsx("code",{className:"text-accent",children:"frameLocator(...)"})," as usual."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Waiting for the upload"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:[e.jsx("code",{className:"text-accent",children:"setInputFiles"}),' only attaches the file — there is no universal "upload done" event, so the step waits for a completion signal: a success indicator if you name one, otherwise the network settling.']}),e.jsx("p",{className:"text-sm text-content-secondary",children:"Example upload steps:"}),e.jsx("pre",{className:"text-[11px] bg-surface-inset rounded-lg px-4 py-3 overflow-x-auto border border-border font-mono",children:`Upload {{FILE:resume.pdf}} to the Resume field
|
|
1016
|
-
Upload {{FILE:resume.pdf}} to the Resume field and wait for 'Upload complete' // most reliable
|
|
1017
|
-
Upload {{FILE:photo.png}} // page's file input`}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Downloads (auto-captured)"}),e.jsxs("p",{className:"text-sm text-content-secondary",children:["No special code needed — just trigger the download with a click. The step waits until the file finishes downloading, and the runner automatically saves every download to"," ",e.jsx("code",{className:"text-accent",children:"results/downloads/<runId>/"}),". Do ",e.jsx("strong",{children:"not"})," use"," ",e.jsx("code",{className:"text-accent",children:"download.saveAs()"})," or ",e.jsx("code",{className:"text-accent",children:"fs"})," in steps — the sandbox blocks them and it isn't needed."]}),e.jsx("p",{className:"text-sm text-content-secondary",children:"Example download steps:"}),e.jsx("pre",{className:"text-[11px] bg-surface-inset rounded-lg px-4 py-3 overflow-x-auto border border-border font-mono",children:`Download the "Export CSV" link
|
|
1018
|
-
Click the "Export" button to download
|
|
1019
|
-
Download the file by clicking "Report PDF"
|
|
1020
|
-
Click "Download invoice" and wait for download`}),e.jsx("p",{className:"text-sm text-content-secondary",children:"Each generates a wait so the step passes only once the download is complete:"}),e.jsx("pre",{className:"text-[11px] bg-surface-inset rounded-lg px-4 py-3 overflow-x-auto border border-border font-mono",children:`const downloadPromise = page.waitForEvent('download');
|
|
1021
|
-
await page.getByRole('link', { name: 'Export CSV' }).click();
|
|
1022
|
-
const download = await downloadPromise;
|
|
1023
|
-
await download.path(); // resolves once the download is complete`}),e.jsx("p",{className:"text-sm text-content-secondary",children:"To view captured files:"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["Open ",e.jsx("strong",{children:"Reports → Run Reports"})," and expand the run."]}),e.jsxs("li",{children:["A ",e.jsx("strong",{children:"Downloads"})," panel lists every file captured during that run."]}),e.jsx("li",{children:"Click any file to save it to your local machine."})]}),e.jsx("p",{className:"text-sm text-content-secondary",children:"The panel appears only when the run produced downloads."})]})},{id:"visual-regression-docs",title:"Visual Regression",category:"Enterprise Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["Visual Regression performs pixel-perfect screenshot comparison using"," ",e.jsx("code",{className:"text-accent",children:"pixelmatch"}),". Enable it on any test step to automatically detect unintended UI changes between runs."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Workflow"}),e.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["Enable visual regression in ",e.jsx("strong",{children:"Settings"})," → Visual Regression."]}),e.jsxs("li",{children:["Click the ",e.jsx("strong",{children:"Eye icon"})," on steps in the Test Editor to enable per-step comparison."]}),e.jsxs("li",{children:["First run captures ",e.jsx("strong",{children:"baseline"})," screenshots."]}),e.jsx("li",{children:"Subsequent runs compare against baselines using pixelmatch."}),e.jsx("li",{children:"If the diff exceeds the threshold the step fails with a visual diff image."}),e.jsxs("li",{children:["Review in ",e.jsx("strong",{children:"Reports"})," → Visual Diffs tab → ",e.jsx("strong",{children:"Approve"})," or ",e.jsx("strong",{children:"Reject"}),"."]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Configuration"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Setting"}),e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Description"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Default"})]})}),e.jsx("tbody",{className:"text-content-secondary",children:[["Enabled","Master toggle for visual regression","Off"],["Threshold","Pixel diff percentage to fail","0.5%"],["Full Page","Capture entire scrollable page","Off"],["Mask Selectors","CSS selectors for areas to ignore (e.g. ads, clocks)","Empty"]].map(([s,r,a])=>e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("td",{className:"py-1.5 pr-4",children:s}),e.jsx("td",{className:"py-1.5 pr-4",children:r}),e.jsx("td",{className:"py-1.5",children:a})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Use Cases"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"CSS refactor"})," — Verify no visual regressions across all pages after style changes."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Multi-browser"})," — Separate baselines per browser and viewport combination."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Design review"})," — Catch layout shifts, missing elements, and colour changes automatically."]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Where Files Live"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Baselines"})," — ",e.jsx("code",{className:"text-accent",children:"baselines/{suite}/{case}/{step}-{browser}-{viewport}.png"})," (commit to git)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Diffs"})," — ",e.jsx("code",{className:"text-accent",children:"results/visual-diffs/{runId}/"})," (gitignored)"]})]})]})},{id:"ci-integration",title:"CI/CD Integration",category:"Enterprise Features",content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"CI/CD Integration connects AssureMind to your delivery pipeline with quality gates, PR comments, and notifications."}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"CI Config Generator"}),e.jsxs("p",{children:["From ",e.jsx("strong",{children:"Run Config → Generate CI Config"}),", generate a pipeline file for",e.jsx("strong",{children:" GitHub Actions"}),", ",e.jsx("strong",{children:"GitLab CI"}),", or ",e.jsx("strong",{children:"Jenkins"})," based on your current run settings (browsers, parallelism, device)."]}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:["The YAML opens in a ",e.jsx("strong",{children:"preview"}),". Click ",e.jsx("strong",{children:"Edit"})," to customise it (branches, Node version, extra steps); your edits apply to Copy, Download, and Write to repo. ",e.jsx("strong",{children:"Reset"})," regenerates from the run config."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Copy"})," and ",e.jsx("strong",{children:"Download"})," are always available."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Write to repo"})," (opt-in) writes the file into your project at its standard path (",e.jsx("code",{className:"text-accent",children:".github/workflows/assuremind.yml"}),", ",e.jsx("code",{className:"text-accent",children:".gitlab-ci.yml"}),", or ",e.jsx("code",{className:"text-accent",children:"Jenkinsfile"}),"). It only ",e.jsx("strong",{children:"writes the file"})," — it does ",e.jsx("strong",{children:"not"})," commit or push. Review and commit it from the ",e.jsx("strong",{children:"Git Control Center"}),"."]}),e.jsxs("li",{children:["Enable the button in ",e.jsx("strong",{children:'Settings → CI/CD Integration → "Write CI files to repo"'})," (off by default)."]})]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Quality Gates"}),e.jsxs("p",{children:["Define thresholds — minimum pass rate, maximum duration, required tags that must pass. The pipeline exits ",e.jsx("code",{className:"text-accent",children:"1"})," if any gate fails, blocking the merge or deploy."]}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"PR Comments"}),e.jsx("p",{children:"Auto-post test results as a GitHub PR comment or GitLab MR note with a metrics table, failed test details, and healing summary."}),e.jsx("pre",{className:"text-[11px] bg-surface-inset rounded-lg px-4 py-3 overflow-x-auto border border-border font-mono",children:`## AssureMind Test Results
|
|
1024
|
-
| Metric | Value |
|
|
1025
|
-
|--------------|--------------|
|
|
1026
|
-
| Pass Rate | 95% (47/50) |
|
|
1027
|
-
| Failed | 3 |
|
|
1028
|
-
| Duration | 4m 32s |
|
|
1029
|
-
| Quality Gate | ✅ Passed |`}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Notifications"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Channel"}),e.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"How It Works"})]})}),e.jsx("tbody",{className:"text-content-secondary",children:[["Slack","Webhook URL → Block Kit message on failure or every run"],["Microsoft Teams","Webhook → Adaptive Card with run summary"],["Email","SMTP or SendGrid (placeholder)"],["Custom Webhook","POST JSON payload to any URL you configure"]].map(([s,r])=>e.jsxs("tr",{className:"border-b border-border/50",children:[e.jsx("td",{className:"py-1.5 pr-4",children:s}),e.jsx("td",{className:"py-1.5",children:r})]},s))})]})}),e.jsx("h4",{className:"text-sm font-semibold text-content",children:"Use Cases"}),e.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"PR workflow"})," — Tests run → quality gate evaluates → PR comment posted → Slack alert on failure."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Nightly regression"})," — Full suite runs on schedule, results pushed to Teams channel."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Deploy pipeline"})," — Deploy → wait for healthy → run smoke tests → notify team."]})]})]})}],Lw=Array.from(new Set(ki.map(s=>s.category)));function _w(){const[s,r]=p.useState(ki[0].id),a=p.useRef({}),o=p.useRef(null);p.useEffect(()=>{const d=[];return ki.forEach(x=>{const h=a.current[x.id];if(!h)return;const f=new IntersectionObserver(([y])=>{y.isIntersecting&&r(x.id)},{root:o.current,rootMargin:"-20% 0px -60% 0px",threshold:0});f.observe(h),d.push(f)}),()=>d.forEach(x=>x.disconnect())},[]);const c=d=>{const x=a.current[d];if(x&&o.current){const h=o.current,f=x.offsetTop-24;h.scrollTo({top:f,behavior:"smooth"})}};return e.jsxs("div",{className:"flex h-full overflow-hidden bg-background",children:[e.jsx("aside",{className:"w-56 flex-shrink-0 border-r border-border bg-surface overflow-y-auto hidden lg:block",children:e.jsxs("div",{className:"px-4 py-4",children:[e.jsx("h2",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest mb-3",children:"Documentation"}),e.jsx("nav",{className:"space-y-0.5",children:Lw.map(d=>e.jsxs("div",{className:"mb-3",children:[e.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest px-2 py-1",children:d}),ki.filter(x=>x.category===d).map(x=>e.jsx("button",{type:"button",onClick:()=>c(x.id),className:O("w-full text-left px-2 py-1.5 rounded-lg text-xs transition-colors",s===x.id?"bg-accent/8 text-accent font-semibold":"text-content-secondary hover:text-content hover:bg-surface-inset"),children:x.title},x.id))]},d))})]})}),e.jsx("div",{ref:o,className:"flex-1 overflow-y-auto",children:e.jsx("div",{className:"max-w-2xl mx-auto px-6 py-6 space-y-0",children:ki.map(d=>e.jsxs("section",{id:d.id,ref:x=>{x&&(a.current[d.id]=x)},className:"mb-10 scroll-mt-6",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:d.category}),e.jsx("h2",{className:"text-base font-bold text-content mt-0.5",children:d.title})]}),e.jsx("div",{className:"text-sm text-content-secondary leading-relaxed",children:d.content}),e.jsx("div",{className:"mt-8 border-b border-border"})]},d.id))})})]})}const rl={getConfig:()=>fetch("/api/ci-integration/config").then(s=>s.json()),saveConfig:s=>fetch("/api/ci-integration/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).then(r=>r.json()),getQualityGates:()=>fetch("/api/ci-integration/quality-gates").then(s=>s.json()),testNotification:s=>fetch("/api/ci-integration/test-notification",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channel:s})}).then(r=>r.json())};function vi({checked:s,onChange:r,label:a,description:o}){return e.jsxs("label",{className:"flex items-center justify-between gap-3 cursor-pointer group",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-medium text-content",children:a}),o&&e.jsx("p",{className:"text-[10px] text-content-tertiary mt-0.5",children:o})]}),e.jsx("button",{type:"button",role:"switch","aria-checked":s,onClick:()=>r(!s),className:`relative w-9 h-5 rounded-full transition-colors ${s?"bg-accent":"bg-gray-300 dark:bg-gray-600"}`,children:e.jsx("span",{className:`absolute top-0.5 left-0.5 w-4 h-4 rounded-full bg-white shadow transition-transform ${s?"translate-x-4":""}`})})]})}function Ps({children:s}){return e.jsx("label",{className:"block text-[10px] font-semibold text-content-tertiary uppercase tracking-wider mb-1",children:s})}function Uw({value:s,onChange:r}){const a=[{key:"every-run",label:"On every run"},{key:"failure",label:"On failure only"},{key:"healing",label:"On healing events"}];return e.jsx("div",{className:"flex flex-wrap gap-3",children:a.map(o=>e.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:s.includes(o.key),onChange:c=>{c.target.checked?r([...s,o.key]):r(s.filter(d=>d!==o.key))},className:"w-3.5 h-3.5 rounded border-border text-accent focus:ring-accent/30"}),e.jsx("span",{className:"text-xs text-content-secondary",children:o.label})]},o.key))})}function $w(){const s=Pe(),[r,a]=p.useState("slack"),{data:o,isLoading:c}=Oe({queryKey:["ci-integration-config"],queryFn:rl.getConfig}),{data:d=[]}=Oe({queryKey:["ci-integration-quality-gates"],queryFn:rl.getQualityGates}),x=oe({mutationFn:rl.saveConfig,onSuccess:()=>{s.invalidateQueries({queryKey:["ci-integration-config"]}),H.success("Configuration saved")},onError:M=>H.error(M.message)}),h=oe({mutationFn:M=>rl.testNotification(M),onSuccess:M=>{M.ok?H.success("Test notification sent"):H.error(M.error??"Failed to send test notification")},onError:M=>H.error(M.message)}),[f,y]=p.useState(null),g=f??o;function j(M){const w=structuredClone(g??o);w&&(M(w),y(w))}function P(){g&&(x.mutate(g),y(null))}const S=f!==null;if(c||!g)return e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx(Me,{size:20,className:"animate-spin text-accent"})});const k=d.slice(0,5),E=[{key:"slack",label:"Slack",icon:pp},{key:"email",label:"Email",icon:Dv},{key:"teams",label:"Teams",icon:Gn},{key:"custom",label:"Custom Webhook",icon:sj}];function R(){switch(r){case"slack":return g.notifications.slack;case"email":return g.notifications.email;case"teams":return g.notifications.teams;case"custom":return g.notifications.customWebhook}}function v(M){j(w=>{const N=r==="custom"?w.notifications.customWebhook:w.notifications[r];M(N)})}const C=R(),D=C.enabled&&(r==="email"?(C.recipients?.length??0)>0:r==="custom"?!!C.url:!!C.webhookUrl);return e.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-4xl mx-auto px-5 py-4 space-y-3",children:[e.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-orange-500 to-red-600 flex items-center justify-center shadow-sm shadow-orange-500/20",children:e.jsx(Fl,{size:17,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-sm font-bold text-content",children:"CI/CD Integration"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Quality gates, PR comments, and notifications for your pipeline"})]})]}),S&&e.jsxs("button",{type:"button",onClick:P,disabled:x.isPending,className:"inline-flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-lg bg-accent text-white hover:brightness-110 transition-colors disabled:opacity-50",children:[x.isPending?e.jsx(Me,{size:13,className:"animate-spin"}):e.jsx(He,{size:13}),"Save Changes"]})]})}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center gap-2",children:[e.jsx(Wv,{size:15,className:"text-accent"}),e.jsx("span",{className:"text-xs font-bold text-content",children:"Quality Gate"})]}),e.jsxs("div",{className:"px-4 py-3 space-y-3",children:[e.jsx(vi,{checked:g.qualityGate.enabled,onChange:M=>j(w=>{w.qualityGate.enabled=M}),label:"Enable Quality Gate",description:"Block CI pipeline when thresholds are not met"}),g.qualityGate.enabled&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(Ps,{children:"Min Pass Rate (%)"}),e.jsx("input",{type:"number",min:0,max:100,value:g.qualityGate.minPassRate,onChange:M=>j(w=>{w.qualityGate.minPassRate=Number(M.target.value)}),className:"w-full px-3 py-1.5 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30"})]}),e.jsxs("div",{children:[e.jsx(Ps,{children:"Max Duration (seconds, 0 = unlimited)"}),e.jsx("input",{type:"number",min:0,value:g.qualityGate.maxDuration,onChange:M=>j(w=>{w.qualityGate.maxDuration=Number(M.target.value)}),className:"w-full px-3 py-1.5 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30"})]})]}),e.jsxs("div",{children:[e.jsx(Ps,{children:"Required Tags (comma-separated)"}),e.jsx("input",{type:"text",value:g.qualityGate.requireTags.join(", "),onChange:M=>j(w=>{w.qualityGate.requireTags=M.target.value.split(",").map(N=>N.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"})]})]}),k.length>0&&e.jsxs("div",{className:"pt-2 border-t border-border",children:[e.jsx(Ps,{children:"Recent Quality Gate Results"}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1",children:k.map(M=>e.jsxs("span",{title:`${M.runId} — ${M.passed?"Passed":"Failed"} — ${new Date(M.timestamp).toLocaleString()}`,className:`inline-flex items-center gap-1 text-[10px] px-2 py-0.5 rounded-full ${M.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:[M.passed?e.jsx(He,{size:10}):e.jsx(St,{size:10}),new Date(M.timestamp).toLocaleDateString()]},M.runId))})]})]})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center gap-2",children:[e.jsx(pp,{size:15,className:"text-accent"}),e.jsx("span",{className:"text-xs font-bold text-content",children:"PR Comments"})]}),e.jsxs("div",{className:"px-4 py-3 space-y-3",children:[e.jsx(vi,{checked:g.prComments.enabled,onChange:M=>j(w=>{w.prComments.enabled=M}),label:"Enable PR Comments",description:"Post test result summaries on pull requests"}),g.prComments.enabled&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx(Ps,{children:"Provider"}),e.jsxs("select",{value:g.prComments.provider,onChange:M=>j(w=>{w.prComments.provider=M.target.value}),className:"w-full px-3 py-1.5 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30 bg-surface",children:[e.jsx("option",{value:"github",children:"GitHub"}),e.jsx("option",{value:"gitlab",children:"GitLab"}),e.jsx("option",{value:"azure-devops",children:"Azure DevOps"})]})]}),e.jsx(vi,{checked:g.prComments.includeHealingSummary,onChange:M=>j(w=>{w.prComments.includeHealingSummary=M}),label:"Include Healing Summary"}),e.jsx(vi,{checked:g.prComments.includeVisualDiffs,onChange:M=>j(w=>{w.prComments.includeVisualDiffs=M}),label:"Include Visual Diffs"}),e.jsx("div",{className:"rounded-lg bg-blue-50 dark:bg-blue-900/10 border border-blue-200 dark:border-blue-800 px-3 py-2",children:e.jsxs("p",{className:"text-[10px] text-blue-700 dark:text-blue-300",children:["Requires ",e.jsx("code",{className:"font-mono bg-blue-100 dark:bg-blue-800/40 px-1 rounded",children:"GITHUB_TOKEN"})," /"," ",e.jsx("code",{className:"font-mono bg-blue-100 dark:bg-blue-800/40 px-1 rounded",children:"GITLAB_TOKEN"})," set in your CI environment."]})})]})]})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center gap-2",children:[e.jsx(bl,{size:15,className:"text-accent"}),e.jsx("span",{className:"text-xs font-bold text-content",children:"Notifications"})]}),e.jsx("div",{className:"flex border-b border-border",children:E.map(M=>{const w=M.icon,N=r===M.key;return e.jsxs("button",{type:"button",onClick:()=>a(M.key),className:`flex items-center gap-1.5 px-4 py-2.5 text-xs font-medium transition-colors border-b-2 ${N?"border-accent text-accent":"border-transparent text-content-tertiary hover:text-content-secondary"}`,children:[e.jsx(w,{size:13}),M.label]},M.key)})}),e.jsxs("div",{className:"px-4 py-3 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(vi,{checked:C.enabled,onChange:M=>v(w=>{w.enabled=M}),label:`Enable ${E.find(M=>M.key===r)?.label}`}),D?e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] px-2 py-0.5 rounded-full bg-emerald-50 dark:bg-emerald-900/20 text-emerald-600 dark:text-emerald-400 ring-1 ring-emerald-200 dark:ring-emerald-800",children:[e.jsx(He,{size:10})," Connected"]}):e.jsx("span",{className:"inline-flex items-center gap-1 text-[10px] px-2 py-0.5 rounded-full bg-gray-100 dark:bg-gray-800 text-content-tertiary ring-1 ring-border",children:"Not configured"})]}),C.enabled&&e.jsxs(e.Fragment,{children:[r==="slack"&&e.jsxs("div",{children:[e.jsx(Ps,{children:"Webhook URL"}),e.jsx("input",{type:"text",value:g.notifications.slack.webhookUrl??"",onChange:M=>j(w=>{w.notifications.slack.webhookUrl=M.target.value}),placeholder:"https://hooks.slack.com/services/...",className:"w-full px-3 py-1.5 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30"})]}),r==="email"&&e.jsxs("div",{children:[e.jsx(Ps,{children:"Recipients (comma-separated)"}),e.jsx("input",{type:"text",value:(g.notifications.email.recipients??[]).join(", "),onChange:M=>j(w=>{w.notifications.email.recipients=M.target.value.split(",").map(N=>N.trim()).filter(Boolean)}),placeholder:"team@example.com, qa@example.com",className:"w-full px-3 py-1.5 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30"})]}),r==="teams"&&e.jsxs("div",{children:[e.jsx(Ps,{children:"Webhook URL"}),e.jsx("input",{type:"text",value:g.notifications.teams.webhookUrl??"",onChange:M=>j(w=>{w.notifications.teams.webhookUrl=M.target.value}),placeholder:"https://outlook.office.com/webhook/...",className:"w-full px-3 py-1.5 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30"})]}),r==="custom"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx(Ps,{children:"Webhook URL"}),e.jsx("input",{type:"text",value:g.notifications.customWebhook.url??"",onChange:M=>j(w=>{w.notifications.customWebhook.url=M.target.value}),placeholder:"https://api.example.com/webhook",className:"w-full px-3 py-1.5 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30"})]}),e.jsxs("div",{children:[e.jsx(Ps,{children:"Custom Headers (JSON)"}),e.jsx("textarea",{value:JSON.stringify(g.notifications.customWebhook.headers??{},null,2),onChange:M=>{try{const w=JSON.parse(M.target.value);j(N=>{N.notifications.customWebhook.headers=w})}catch{}},rows:3,placeholder:'{"Authorization": "Bearer ..."}',className:"w-full px-3 py-1.5 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30 resize-none font-mono"})]})]}),e.jsxs("div",{children:[e.jsx(Ps,{children:"Notify On"}),e.jsx(Uw,{value:C.on,onChange:M=>v(w=>{w.on=M})})]}),r!=="email"&&e.jsxs("button",{type:"button",onClick:()=>h.mutate(r==="custom"?"custom":r),disabled:h.isPending||!D,className:"inline-flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-lg border border-border text-content-secondary hover:bg-surface-inset transition-colors disabled:opacity-50",children:[h.isPending?e.jsx(Me,{size:12,className:"animate-spin"}):e.jsx(Hv,{size:12}),"Send Test Notification"]})]})]})]})]})})})}function Bw(s){const r=new Date(s),a=Math.floor((Date.now()-r.getTime())/1e3);if(a<60)return`${a}s ago`;const o=Math.floor(a/60);if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}const qw={M:{icon:Tf,color:"text-blue-500",bg:"bg-blue-50",ring:"ring-blue-200",label:"Modified"},A:{icon:zf,color:"text-emerald-500",bg:"bg-emerald-50",ring:"ring-emerald-200",label:"Added"},D:{icon:Mf,color:"text-red-500",bg:"bg-red-50",ring:"ring-red-200",label:"Deleted"},"?":{icon:Af,color:"text-content-tertiary",bg:"bg-surface-inset",ring:"ring-border",label:"Untracked"}};function Hw(){const{operationInProgress:s,logSteps:r,hasConflict:a,conflictFiles:o}=Bl(),{data:c,isLoading:d}=ex(),{data:x}=Vf(),{data:h,refetch:f}=Gf(20),y=Qf(),g=Jf(),j=Yf(),P=Xf(),S=Zf(),k=eg(),[E,R]=p.useState(""),[v,C]=p.useState(!0),[D,M]=p.useState(!1),[w,N]=p.useState(!0),[K,_]=p.useState(!1),[ee,$]=p.useState(!1),{data:G,isFetching:le,refetch:je}=Oe({queryKey:["git-impact"],queryFn:()=>ut.impact(),enabled:ee,staleTime:0}),ke=p.useRef(null),Ce=!!s,Re=(c?.modified.length??0)+(c?.added.length??0)+(c?.deleted.length??0)+(c?.untracked.length??0);p.useEffect(()=>{ke.current?.scrollIntoView({behavior:"smooth"})},[r.length]);const be=()=>{E.trim()?S.mutate(E):k.mutate(void 0,{onSuccess:B=>{R(B.message),S.mutate(B.message)}})};return e.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 flex items-center gap-3 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-orange-500 to-rose-600 flex items-center justify-center shadow-sm shadow-orange-500/20",children:e.jsx($n,{size:17,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-sm font-bold text-content",children:"Git Control Center"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Commit, push, pull and resolve conflicts"})]})]}),e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"relative flex-shrink-0",children:[e.jsxs("button",{onClick:()=>M(!D),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg bg-surface-inset hover:bg-surface-inset/80 border border-border text-xs font-medium text-content-secondary transition-colors",children:[e.jsx($n,{size:12,className:"text-accent flex-shrink-0"}),e.jsx("span",{className:"max-w-[160px] truncate",children:c?.branch??"..."}),e.jsx(kt,{size:11,className:O("transition-transform text-content-tertiary",D&&"rotate-180")})]}),D&&x&&e.jsxs("div",{className:"absolute top-full right-0 mt-1 w-56 bg-surface border border-border rounded-xl shadow-lg z-20 max-h-56 overflow-y-auto",children:[e.jsx("div",{className:"px-3 py-1.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Local"}),x.all.map(B=>e.jsx("button",{onClick:()=>{M(!1),B!==c?.branch&&y.mutate(B)},className:O("w-full text-left px-3 py-1.5 text-xs hover:bg-surface-inset transition-colors",B===c?.branch&&"font-semibold text-accent bg-accent/5"),children:B},B)),x.remote.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 py-1.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest border-t border-border",children:"Remote"}),x.remote.map(B=>e.jsx("button",{onClick:()=>{M(!1),y.mutate(B.replace(/^origin\//,""))},className:"w-full text-left px-3 py-1.5 text-xs text-content-secondary hover:bg-surface-inset",children:B},B))]})]})]}),e.jsxs("span",{className:O("inline-flex items-center gap-1.5 text-[10px] px-2.5 py-1 rounded-lg font-semibold ring-1",c?.conflicted.length?"bg-red-50 text-red-600 ring-red-200":c?.isClean?"bg-emerald-50 text-emerald-600 ring-emerald-200":"bg-amber-50 text-amber-600 ring-amber-200"),children:[e.jsx("span",{className:O("w-1.5 h-1.5 rounded-full",c?.conflicted.length?"bg-red-500":c?.isClean?"bg-emerald-500":"bg-amber-500")}),d?"Loading…":c?.conflicted.length?"Conflict":c?.isClean?"Clean":`${Re} pending`]}),c&&(c.ahead>0||c.behind>0)&&e.jsxs("span",{className:"text-[10px] text-content-tertiary font-mono tabular-nums",children:[c.ahead>0&&e.jsxs("span",{className:"text-emerald-600",children:["↑",c.ahead]}),c.ahead>0&&c.behind>0&&" ",c.behind>0&&e.jsxs("span",{className:"text-amber-600",children:["↓",c.behind]})]})]}),e.jsxs("div",{className:"px-4 py-2.5 bg-surface-inset/40 border-t border-border flex items-center gap-2",children:[e.jsxs("div",{className:"relative flex-1 min-w-0",children:[e.jsx(br,{size:11,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-content-tertiary pointer-events-none"}),e.jsx("input",{type:"text",value:E,onChange:B=>R(B.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:B=>{B.key==="Enter"&&E.trim()&&g.mutate(E)}})]}),e.jsx("button",{onClick:()=>k.mutate(void 0,{onSuccess:B=>R(B.message)}),disabled:k.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:k.isPending?e.jsx(Me,{size:12,className:"animate-spin"}):e.jsx(Bt,{size:12})}),e.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] text-content-tertiary cursor-pointer select-none flex-shrink-0",children:[e.jsx("input",{type:"checkbox",checked:v,onChange:B=>C(B.target.checked),className:"rounded border-border text-accent focus:ring-accent w-3 h-3"}),"Rebase"]}),e.jsx("div",{className:"w-px h-5 bg-border"}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[e.jsx(il,{icon:e.jsx(br,{size:11}),label:"Commit",onClick:()=>E.trim()&&g.mutate(E),disabled:Ce||!E.trim(),loading:s==="commit"}),e.jsx(il,{icon:e.jsx(kf,{size:11}),label:"Push",onClick:()=>P.mutate(),disabled:Ce,loading:s==="push"}),e.jsx(il,{icon:e.jsx(wf,{size:11}),label:"Pull",onClick:()=>j.mutate(v),disabled:Ce,loading:s==="pull"}),e.jsx(il,{icon:e.jsx(Fl,{size:11}),label:"Full Sync",onClick:be,disabled:Ce,loading:s==="full-sync",primary:!0})]})]})]}),a&&e.jsx(Kw,{conflictFiles:o}),!a&&e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-5 gap-3",children:[e.jsxs("div",{className:"lg:col-span-2 rounded-xl border border-border bg-surface overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"px-3.5 py-2 border-b border-border flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Changes"}),Re>0&&e.jsx("span",{className:"text-[9px] font-bold text-accent bg-accent/8 px-1.5 py-px rounded ring-1 ring-accent/15",children:Re})]}),Re>0&&e.jsx("div",{className:"flex items-center gap-2",children:[{type:"M",count:c?.modified.length??0,color:"text-blue-500"},{type:"A",count:c?.added.length??0,color:"text-emerald-500"},{type:"D",count:c?.deleted.length??0,color:"text-red-500"},{type:"?",count:c?.untracked.length??0,color:"text-content-tertiary"}].filter(B=>B.count>0).map(B=>e.jsxs("span",{className:O("text-[9px] font-mono font-bold",B.color),children:[B.type,B.count]},B.type))})]}),e.jsx("div",{className:"flex-1 overflow-y-auto max-h-[400px]",children:Re===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-10 gap-1.5",children:[e.jsx(Qe,{size:18,className:"text-emerald-400"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Working tree clean"})]}):e.jsxs("div",{className:"px-1.5 py-1",children:[c?.modified.map(B=>e.jsx(al,{file:B,type:"M"},`M-${B}`)),c?.added.map(B=>e.jsx(al,{file:B,type:"A"},`A-${B}`)),c?.deleted.map(B=>e.jsx(al,{file:B,type:"D"},`D-${B}`)),c?.untracked.map(B=>e.jsx(al,{file:B,type:"?"},`?-${B}`))]})})]}),e.jsxs("div",{className:"lg:col-span-3 rounded-xl border border-border bg-surface overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"px-3.5 py-2 border-b border-border flex items-center justify-between",children:[e.jsx("h2",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Commit History"}),e.jsx("button",{onClick:()=>f(),className:"p-1 rounded-md text-content-tertiary hover:text-accent hover:bg-accent/5 transition-colors",title:"Refresh",children:e.jsx(Yu,{size:11})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto max-h-[400px]",children:!h||h.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-10 gap-1.5",children:[e.jsx(br,{size:18,className:"text-content-tertiary/40"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"No commits yet"})]}):e.jsxs("div",{className:"relative px-3.5 py-2",children:[e.jsx("div",{className:"absolute left-[22px] top-4 bottom-4 w-px bg-border"}),e.jsx("div",{className:"space-y-0.5",children:h.map((B,X)=>e.jsxs("div",{className:"flex items-start gap-2.5 relative group py-1.5 rounded-lg hover:bg-surface-inset/50 px-1 -mx-1 transition-colors",children:[e.jsx("div",{className:O("mt-1 w-3 h-3 rounded-full border-2 flex-shrink-0 z-[1]",X===0?"border-accent bg-accent/20":"border-border bg-surface")}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs text-content font-medium leading-snug truncate",title:B.message,children:B.message}),e.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-content-tertiary mt-0.5",children:[e.jsx("code",{className:"font-mono text-accent/70 text-[9px]",children:B.shortHash}),e.jsxs("span",{className:"flex items-center gap-0.5",children:[e.jsx(Zu,{size:8})," ",B.author]}),e.jsxs("span",{className:"flex items-center gap-0.5",children:[e.jsx(Er,{size:8})," ",Bw(B.date)]})]})]})]},B.hash))})]})})]})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("button",{onClick:()=>_(!K),className:"w-full px-3.5 py-2 flex items-center justify-between hover:bg-surface-inset/30 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ct,{size:12,className:"text-amber-500"}),e.jsx("h2",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Test Impact Analysis"}),G&&G.impactedCases.length>0&&e.jsxs("span",{className:"text-[9px] font-bold text-amber-600 bg-amber-50 px-1.5 py-px rounded ring-1 ring-amber-200",children:[G.impactedCases.length," impacted"]})]}),e.jsx(kt,{size:11,className:O("text-content-tertiary transition-transform",K&&"rotate-180")})]}),K&&e.jsxs("div",{className:"border-t border-border px-3.5 py-3",children:[e.jsx("p",{className:"text-[10px] text-content-tertiary mb-3",children:"Finds test cases that may be affected by uncommitted file changes."}),e.jsxs("button",{onClick:()=>{$(!0),setTimeout(()=>je(),0)},disabled:le,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:[le?e.jsx(Me,{size:12,className:"animate-spin"}):e.jsx(ct,{size:12}),"Analyze Impact"]}),G&&e.jsxs(e.Fragment,{children:[G.changedFiles.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:["Changed Files (",G.changedFiles.length,")"]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:G.changedFiles.map(B=>e.jsx("span",{className:"text-[9px] font-mono bg-surface-inset px-2 py-0.5 rounded border border-border text-content-secondary",children:B},B))})]}),G.impactedCases.length===0?e.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-emerald-600 bg-emerald-50 rounded-lg px-3 py-2",children:[e.jsx(Qe,{size:12})," No test cases appear to be impacted by current changes."]}):e.jsxs("div",{children:[e.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:["Impacted Cases (",G.impactedCases.length,")"]}),e.jsx("div",{className:"space-y-1",children:G.impactedCases.map(B=>e.jsxs("div",{className:"flex items-start gap-2 text-[10px] bg-amber-50 rounded-lg px-3 py-2 border border-amber-200",children:[e.jsx(gs,{size:11,className:"text-amber-500 mt-px flex-shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-semibold text-content",children:B.caseName}),e.jsxs("p",{className:"text-content-tertiary",children:[B.suiteName," · ",B.reason]})]})]},B.caseId))})]})]})]})]}),r.length>0&&e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("button",{onClick:()=>N(!w),className:"w-full px-3.5 py-2 border-b border-border flex items-center justify-between hover:bg-surface-inset/30 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_l,{size:12,className:"text-content-tertiary"}),e.jsx("h2",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Execution Log"}),e.jsxs("span",{className:"text-[9px] font-medium text-content-tertiary bg-surface-inset px-1.5 py-px rounded ring-1 ring-border",children:[r.length," step",r.length!==1?"s":""]}),s&&e.jsxs("span",{className:"flex items-center gap-1 text-[9px] text-blue-500 font-medium",children:[e.jsx(Me,{size:9,className:"animate-spin"})," ",s]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("button",{onClick:B=>{B.stopPropagation(),Ye.clearLogs()},className:"text-[9px] text-content-tertiary hover:text-red-500 px-1.5 py-0.5 rounded hover:bg-red-50 transition-colors",children:"Clear"}),e.jsx(kt,{size:11,className:O("text-content-tertiary transition-transform",w&&"rotate-180")})]})]}),w&&e.jsx("div",{className:"px-3.5 py-2 max-h-[200px] overflow-y-auto bg-surface-inset/20",children:e.jsxs("div",{className:"space-y-1",children:[r.map((B,X)=>e.jsxs("div",{className:"flex items-start gap-2 text-[10px] py-0.5",children:[B.status==="running"&&e.jsx(Me,{size:11,className:"mt-px text-blue-500 animate-spin flex-shrink-0"}),B.status==="done"&&e.jsx(Qe,{size:11,className:"mt-px text-emerald-500 flex-shrink-0"}),B.status==="error"&&e.jsx(St,{size:11,className:"mt-px text-red-500 flex-shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:O("font-medium",B.status==="error"?"text-red-600":"text-content-secondary"),children:B.step}),B.message&&e.jsxs("span",{className:O("ml-1.5 font-normal",B.status==="error"?"text-red-400":"text-content-tertiary"),children:["— ",B.message]})]})]},X)),e.jsx("div",{ref:ke})]})})]})]})})})}function Kw({conflictFiles:s}){const r=tg(),a=sg(),o=ng(),c=rg(),[d,x]=p.useState({}),h=v=>d[v]??{mode:"none",ours:"",theirs:"",merged:"",resolved:!1,loading:!1},f=(v,C)=>x(D=>({...D,[v]:{...h(v),...C}})),y=async v=>{f(v,{loading:!0});try{const C=await ut.conflictContent(v);f(v,{ours:C.ours,theirs:C.theirs,merged:C.ours,loading:!1})}catch{f(v,{ours:"(error)",theirs:"(error)",loading:!1})}},g=async v=>{let D=h(v).ours;D||(D=(await ut.conflictContent(v)).ours),f(v,{loading:!0}),r.mutate({filePath:v,content:D},{onSuccess:()=>f(v,{resolved:!0,loading:!1})})},j=async v=>{let D=h(v).theirs;D||(D=(await ut.conflictContent(v)).theirs),f(v,{loading:!0}),r.mutate({filePath:v,content:D},{onSuccess:()=>f(v,{resolved:!0,loading:!1})})},P=async v=>{let C=h(v);C.ours||(await y(v),C=h(v)),f(v,{mode:"ai",loading:!0}),a.mutate({filePath:v,ours:C.ours,theirs:C.theirs},{onSuccess:D=>f(v,{merged:D.resolved,loading:!1}),onError:()=>f(v,{loading:!1})})},S=async v=>{h(v).ours||await y(v),f(v,{mode:"manual"})},k=v=>{const C=h(v);f(v,{loading:!0}),r.mutate({filePath:v,content:C.merged},{onSuccess:()=>f(v,{resolved:!0,loading:!1,mode:"none"})})},E=s.every(v=>h(v).resolved),R=s.filter(v=>h(v).resolved).length;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"rounded-xl border border-red-200 bg-red-50/80 overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-red-100 flex items-center justify-center flex-shrink-0",children:e.jsx(gs,{size:15,className:"text-red-500"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-xs font-bold text-red-800",children:"Merge Conflict Detected"}),e.jsxs("p",{className:"text-[10px] text-red-600",children:[R,"/",s.length," file",s.length>1?"s":""," resolved"]})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("button",{onClick:()=>c.mutate(),disabled:c.isPending,className:"flex items-center gap-1 px-2.5 py-1.5 text-[10px] font-medium text-red-600 bg-surface border border-red-200 rounded-lg hover:bg-red-50 transition-colors disabled:opacity-50",children:[e.jsx(_i,{size:10}),c.isPending?"Aborting…":"Abort"]}),e.jsxs("button",{onClick:()=>o.mutate(),disabled:!E||o.isPending,className:O("flex items-center gap-1 px-3 py-1.5 text-[10px] font-semibold rounded-lg transition-colors",E?"bg-emerald-600 hover:bg-emerald-700 text-white shadow-sm shadow-emerald-500/20":"bg-surface-inset text-content-tertiary cursor-not-allowed ring-1 ring-border"),children:[e.jsx(Qe,{size:10}),o.isPending?"Continuing…":"Continue Rebase"]})]})]}),e.jsx("div",{className:"h-0.5 bg-red-100",children:e.jsx("div",{className:"h-full bg-emerald-500 transition-all",style:{width:`${s.length>0?R/s.length*100:0}%`}})})]}),s.map(v=>{const C=h(v);return e.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[e.jsxs("div",{className:"px-3.5 py-2.5 border-b border-border flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Of,{size:13,className:C.resolved?"text-emerald-500":"text-amber-500"}),e.jsx("code",{className:"text-xs font-mono text-content-secondary",children:v}),C.resolved&&e.jsxs("span",{className:"text-[9px] text-emerald-600 bg-emerald-50 px-1.5 py-0.5 rounded-md flex items-center gap-0.5 font-semibold ring-1 ring-emerald-200",children:[e.jsx(Qe,{size:9})," Resolved"]})]}),!C.resolved&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ol,{label:"Keep Local",onClick:()=>g(v),loading:C.loading&&C.mode==="none"}),e.jsx(ol,{label:"Accept Incoming",onClick:()=>j(v),loading:C.loading&&C.mode==="none"}),e.jsx(ol,{label:"Manual",onClick:()=>S(v)}),e.jsx(ol,{label:"AI Resolve",onClick:()=>P(v),loading:C.loading&&C.mode==="ai",icon:e.jsx(Bt,{size:9}),accent:!0})]})]}),C.mode!=="none"&&!C.resolved&&e.jsx("div",{className:"p-3.5",children:C.loading&&!C.ours?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Me,{size:16,className:"animate-spin text-content-tertiary"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-bold text-blue-600 uppercase tracking-widest mb-1 block",children:"Local (Ours)"}),e.jsx("textarea",{value:C.ours,readOnly:!0,rows:12,className:"w-full text-[10px] font-mono p-2.5 border border-blue-200 rounded-lg bg-blue-50/50 resize-y focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-bold text-orange-600 uppercase tracking-widest mb-1 block",children:"Incoming (Theirs)"}),e.jsx("textarea",{value:C.theirs,readOnly:!0,rows:12,className:"w-full text-[10px] font-mono p-2.5 border border-orange-200 rounded-lg bg-orange-50/50 resize-y focus:outline-none"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-bold text-emerald-600 uppercase tracking-widest mb-1 block",children:"Merged Output (editable)"}),e.jsx("textarea",{value:C.merged,onChange:D=>f(v,{merged:D.target.value}),rows:12,className:"w-full text-[10px] font-mono p-2.5 border border-emerald-200 rounded-lg bg-emerald-50/50 resize-y focus:outline-none focus:ring-2 focus:ring-emerald-300"})]}),e.jsx("div",{className:"flex justify-end mt-2.5",children:e.jsxs("button",{onClick:()=>k(v),disabled:C.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:[C.loading?e.jsx(Me,{size:10,className:"animate-spin"}):e.jsx(Qe,{size:10}),"Mark as Resolved"]})})]})})]},v)})]})}function al({file:s,type:r}){const a=qw[r],o=a.icon;return e.jsxs("div",{className:"flex items-center gap-2 py-1 px-2 rounded-lg hover:bg-surface-inset/60 group transition-colors",children:[e.jsx("div",{className:O("w-5 h-5 rounded flex items-center justify-center flex-shrink-0",a.bg),children:e.jsx(o,{size:10,className:a.color})}),e.jsx("span",{className:O("text-[10px] font-mono truncate flex-1",a.color),title:s,children:s}),e.jsx("span",{className:O("text-[8px] px-1.5 py-px rounded font-medium ring-1",a.bg,a.color,a.ring),children:a.label})]})}function il({icon:s,label:r,onClick:a,disabled:o,loading:c,primary:d}){return e.jsxs("button",{onClick:a,disabled:o,className:O("flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[10px] font-semibold transition-all",d?"bg-accent hover:bg-accent-dark text-white shadow-sm shadow-accent/20":"bg-surface hover:bg-surface-inset text-content-secondary border border-border",o&&"opacity-50 cursor-not-allowed",c&&"cursor-wait"),children:[c?e.jsx(Me,{size:11,className:"animate-spin"}):s,r]})}function ol({label:s,onClick:r,loading:a,icon:o,accent:c}){return e.jsxs("button",{onClick:r,disabled:a,className:O("flex items-center gap-0.5 px-2 py-1 text-[9px] font-medium rounded-lg transition-colors",c?"bg-violet-50 text-violet-600 hover:bg-violet-100 ring-1 ring-violet-200":"bg-surface-inset text-content-secondary hover:bg-surface-inset/80 ring-1 ring-border",a&&"opacity-60 cursor-wait"),children:[a?e.jsx(Me,{size:9,className:"animate-spin"}):o,s]})}function Ww(s){const r=new Date(s),a=Math.floor((Date.now()-r.getTime())/1e3);if(a<60)return`${a}s ago`;const o=Math.floor(a/60);if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}const Vw={M:{icon:Tf,color:"text-blue-500",bg:"bg-blue-50",label:"M"},A:{icon:zf,color:"text-emerald-500",bg:"bg-emerald-50",label:"A"},D:{icon:Mf,color:"text-red-500",bg:"bg-red-50",label:"D"},"?":{icon:Af,color:"text-content-tertiary",bg:"bg-surface-inset",label:"?"}};function Gw(){const{panelOpen:s,operationInProgress:r,logSteps:a,hasConflict:o}=Bl(),{data:c,isLoading:d}=ex(),{data:x}=Vf(),{data:h,refetch:f}=Gf(15),y=Qf(),g=Jf(),j=Yf(),P=Xf(),S=Zf(),k=eg(),[E,R]=p.useState(""),[v,C]=p.useState(!0),[D,M]=p.useState(!1),[w,N]=p.useState(!0),K=p.useRef(null),_=!!r,ee=(c?.modified.length??0)+(c?.added.length??0)+(c?.deleted.length??0)+(c?.untracked.length??0);p.useEffect(()=>{K.current?.scrollIntoView({behavior:"smooth"})},[a.length]);const $=()=>{E.trim()?S.mutate(E):k.mutate(void 0,{onSuccess:G=>{R(G.message),S.mutate(G.message)}})};return e.jsxs(e.Fragment,{children:[s&&e.jsx("div",{className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-[1px] transition-opacity",onClick:()=>Ye.closePanel()}),e.jsxs("div",{className:O("fixed top-0 right-0 h-full z-50 w-[400px] max-w-[90vw] bg-surface border-l border-border shadow-2xl","flex flex-col transition-transform duration-300 ease-in-out",s?"translate-x-0":"translate-x-full"),children:[e.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2.5 border-b border-border bg-surface flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-gradient-to-br from-orange-500 to-rose-600 flex items-center justify-center shadow-sm shadow-orange-500/20",children:e.jsx($n,{size:13,className:"text-white"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-xs font-bold text-content",children:"Git Control"}),e.jsx("p",{className:"text-[9px] text-content-tertiary",children:"Quick operations"})]})]}),e.jsx("button",{onClick:()=>Ye.closePanel(),className:"p-1 rounded-lg hover:bg-surface-inset text-content-tertiary hover:text-content-secondary transition-colors",children:e.jsx(Fe,{size:14})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[o&&e.jsxs("div",{className:"mx-3 mt-3 px-3 py-2 bg-red-50 border border-red-200 rounded-lg flex items-center gap-2",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-500 flex-shrink-0"}),e.jsx("span",{className:"text-[10px] text-red-700 font-medium",children:"Merge conflict — open full Git page to resolve"})]}),e.jsx("div",{className:"px-3.5 py-2.5 border-b border-border",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative flex-1 min-w-0",children:[e.jsxs("button",{onClick:()=>M(!D),className:"w-full flex items-center justify-between gap-2 px-2.5 py-1.5 rounded-lg bg-surface-inset hover:bg-surface-inset/80 border border-border text-xs font-medium text-content-secondary transition-colors",children:[e.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[e.jsx($n,{size:11,className:"text-accent flex-shrink-0"}),c?.branch??"..."]}),e.jsx(kt,{size:10,className:O("transition-transform text-content-tertiary",D&&"rotate-180")})]}),D&&x&&e.jsxs("div",{className:"absolute top-full left-0 right-0 mt-1 bg-surface border border-border rounded-xl shadow-lg z-10 max-h-48 overflow-y-auto",children:[e.jsx("div",{className:"px-2.5 py-1 text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Local"}),x.all.map(G=>e.jsx("button",{onClick:()=>{M(!1),G!==c?.branch&&y.mutate(G)},className:O("w-full text-left px-2.5 py-1.5 text-[10px] hover:bg-surface-inset transition-colors",G===c?.branch&&"font-semibold text-accent bg-accent/5"),children:G},G)),x.remote.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-2.5 py-1 text-[9px] font-bold text-content-tertiary uppercase tracking-widest border-t border-border",children:"Remote"}),x.remote.map(G=>e.jsx("button",{onClick:()=>{M(!1),y.mutate(G.replace(/^origin\//,""))},className:"w-full text-left px-2.5 py-1.5 text-[10px] text-content-secondary hover:bg-surface-inset",children:G},G))]})]})]}),e.jsxs("span",{className:O("inline-flex items-center gap-1.5 text-[9px] px-2 py-1 rounded-lg font-semibold ring-1 flex-shrink-0",c?.conflicted?.length?"bg-red-50 text-red-600 ring-red-200":c?.isClean?"bg-emerald-50 text-emerald-600 ring-emerald-200":"bg-amber-50 text-amber-600 ring-amber-200"),children:[e.jsx("span",{className:O("w-1.5 h-1.5 rounded-full",c?.conflicted?.length?"bg-red-500":c?.isClean?"bg-emerald-500":"bg-amber-500")}),d?"…":c?.conflicted?.length?"Conflict":c?.isClean?"Clean":`${ee} pending`]}),c&&(c.ahead>0||c.behind>0)&&e.jsxs("span",{className:"text-[9px] text-content-tertiary font-mono tabular-nums flex-shrink-0",children:[c.ahead>0&&e.jsxs("span",{className:"text-emerald-600",children:["↑",c.ahead]}),c.behind>0&&e.jsxs("span",{className:"text-amber-600 ml-0.5",children:["↓",c.behind]})]})]})}),e.jsxs("div",{className:"px-3.5 py-2.5 border-b border-border",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Changes"}),ee>0&&e.jsx("span",{className:"text-[9px] font-bold text-accent bg-accent/8 px-1.5 py-px rounded ring-1 ring-accent/15",children:ee})]}),ee>0&&e.jsx("div",{className:"flex items-center gap-1.5",children:[{type:"M",count:c?.modified.length??0,color:"text-blue-500"},{type:"A",count:c?.added.length??0,color:"text-emerald-500"},{type:"D",count:c?.deleted.length??0,color:"text-red-500"},{type:"?",count:c?.untracked.length??0,color:"text-content-tertiary"}].filter(G=>G.count>0).map(G=>e.jsxs("span",{className:O("text-[8px] font-mono font-bold",G.color),children:[G.type,G.count]},G.type))})]}),ee===0?e.jsxs("div",{className:"flex items-center gap-1.5 py-2",children:[e.jsx(Qe,{size:12,className:"text-emerald-400"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Working tree clean"})]}):e.jsxs("div",{className:"space-y-px max-h-[150px] overflow-y-auto",children:[c?.modified.map(G=>e.jsx(ll,{file:G,type:"M"},`M-${G}`)),c?.added.map(G=>e.jsx(ll,{file:G,type:"A"},`A-${G}`)),c?.deleted.map(G=>e.jsx(ll,{file:G,type:"D"},`D-${G}`)),c?.untracked.map(G=>e.jsx(ll,{file:G,type:"?"},`?-${G}`))]})]}),e.jsxs("div",{className:"px-3.5 py-2.5 border-b border-border space-y-2.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("div",{className:"relative flex-1 min-w-0",children:[e.jsx(br,{size:10,className:"absolute left-2 top-1/2 -translate-y-1/2 text-content-tertiary pointer-events-none"}),e.jsx("input",{type:"text",value:E,onChange:G=>R(G.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:G=>{G.key==="Enter"&&E.trim()&&g.mutate(E)}})]}),e.jsx("button",{onClick:()=>k.mutate(void 0,{onSuccess:G=>R(G.message)}),disabled:k.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:k.isPending?e.jsx(Me,{size:10,className:"animate-spin"}):e.jsx(Bt,{size:10})})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-[9px] text-content-tertiary cursor-pointer select-none",children:[e.jsx("input",{type:"checkbox",checked:v,onChange:G=>C(G.target.checked),className:"rounded border-border text-accent focus:ring-accent w-3 h-3"}),"Pull latest (rebase) before commit"]}),e.jsxs("div",{className:"grid grid-cols-4 gap-1",children:[e.jsx(cl,{icon:e.jsx(br,{size:10}),label:"Commit",onClick:()=>E.trim()&&g.mutate(E),disabled:_||!E.trim(),loading:r==="commit"}),e.jsx(cl,{icon:e.jsx(kf,{size:10}),label:"Push",onClick:()=>P.mutate(),disabled:_,loading:r==="push"}),e.jsx(cl,{icon:e.jsx(wf,{size:10}),label:"Pull",onClick:()=>j.mutate(v),disabled:_,loading:r==="pull"}),e.jsx(cl,{icon:e.jsx(Fl,{size:10}),label:"Sync",onClick:$,disabled:_,loading:r==="full-sync",primary:!0})]}),e.jsx("p",{className:"text-[8px] text-content-tertiary text-center",children:"Sync: pull --rebase → stage → commit → push"})]}),a.length>0&&e.jsxs("div",{className:"border-b border-border",children:[e.jsxs("button",{onClick:()=>N(!w),className:"w-full px-3.5 py-2 flex items-center justify-between hover:bg-surface-inset/30 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(_l,{size:10,className:"text-content-tertiary"}),e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Log"}),e.jsx("span",{className:"text-[8px] font-medium text-content-tertiary bg-surface-inset px-1.5 py-px rounded ring-1 ring-border",children:a.length}),r&&e.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] text-blue-500 font-medium",children:[e.jsx(Me,{size:8,className:"animate-spin"})," ",r]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:G=>{G.stopPropagation(),Ye.clearLogs()},className:"text-[8px] text-content-tertiary hover:text-red-500 px-1 py-0.5 rounded hover:bg-red-50 transition-colors",children:"Clear"}),e.jsx(kt,{size:10,className:O("text-content-tertiary transition-transform",w&&"rotate-180")})]})]}),w&&e.jsx("div",{className:"px-3.5 pb-2.5 max-h-[150px] overflow-y-auto",children:e.jsxs("div",{className:"space-y-0.5",children:[a.map((G,le)=>e.jsxs("div",{className:"flex items-start gap-1.5 text-[9px] py-0.5",children:[G.status==="running"&&e.jsx(Me,{size:9,className:"mt-px text-blue-500 animate-spin flex-shrink-0"}),G.status==="done"&&e.jsx(Qe,{size:9,className:"mt-px text-emerald-500 flex-shrink-0"}),G.status==="error"&&e.jsx(St,{size:9,className:"mt-px text-red-500 flex-shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:O("font-medium",G.status==="error"?"text-red-600":"text-content-secondary"),children:G.step}),G.message&&e.jsxs("span",{className:O("ml-1 font-normal",G.status==="error"?"text-red-400":"text-content-tertiary"),children:["— ",G.message]})]})]},le)),e.jsx("div",{ref:K})]})})]}),e.jsxs("div",{className:"px-3.5 py-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"History"}),e.jsx("button",{onClick:()=>f(),className:"p-1 rounded-md text-content-tertiary hover:text-accent hover:bg-accent/5 transition-colors",title:"Refresh",children:e.jsx(Yu,{size:10})})]}),!h||h.length===0?e.jsxs("div",{className:"flex items-center gap-1.5 py-3",children:[e.jsx(br,{size:12,className:"text-content-tertiary/40"}),e.jsx("p",{className:"text-[10px] text-content-tertiary",children:"No commits yet"})]}):e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute left-[5px] top-2 bottom-2 w-px bg-border"}),e.jsx("div",{className:"space-y-0.5",children:h.map((G,le)=>e.jsxs("div",{className:"flex items-start gap-2 relative py-1 rounded-lg hover:bg-surface-inset/50 px-0.5 -mx-0.5 transition-colors",children:[e.jsx("div",{className:O("mt-1.5 w-[9px] h-[9px] rounded-full border-[1.5px] flex-shrink-0 z-[1]",le===0?"border-accent bg-accent/20":"border-border bg-surface")}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-[10px] text-content font-medium leading-snug truncate",title:G.message,children:G.message}),e.jsxs("div",{className:"flex items-center gap-1.5 text-[8px] text-content-tertiary mt-0.5",children:[e.jsx("code",{className:"font-mono text-accent/70",children:G.shortHash}),e.jsxs("span",{className:"flex items-center gap-0.5",children:[e.jsx(Zu,{size:7})," ",G.author]}),e.jsxs("span",{className:"flex items-center gap-0.5",children:[e.jsx(Er,{size:7})," ",Ww(G.date)]})]})]})]},G.hash))})]})]})]})]})]})}function ll({file:s,type:r}){const a=Vw[r],o=a.icon;return e.jsxs("div",{className:"flex items-center gap-1.5 py-0.5 px-1.5 rounded-md hover:bg-surface-inset/60 transition-colors",children:[e.jsx("div",{className:O("w-4 h-4 rounded flex items-center justify-center flex-shrink-0",a.bg),children:e.jsx(o,{size:9,className:a.color})}),e.jsx("span",{className:O("text-[9px] font-mono truncate flex-1",a.color),title:s,children:s})]})}function cl({icon:s,label:r,onClick:a,disabled:o,loading:c,primary:d}){return e.jsxs("button",{onClick:a,disabled:o,className:O("flex flex-col items-center justify-center gap-0.5 px-2 py-1.5 rounded-lg text-[9px] font-semibold transition-all",d?"bg-accent hover:bg-accent-dark text-white shadow-sm shadow-accent/20":"bg-surface hover:bg-surface-inset text-content-secondary border border-border",o&&"opacity-50 cursor-not-allowed",c&&"cursor-wait"),children:[c?e.jsx(Me,{size:10,className:"animate-spin"}):s,r]})}function Qw(){const s=Gs(),r=Wn(),a=tx(),o=Ng(),{stepLogs:c}=wg(),d=a.isRunning,x=kg(d),[h,f]=p.useState(!1),[y,g]=p.useState(!1),[j,P]=p.useState(!1),S=r.pathname==="/run";p.useEffect(()=>{d&&!j&&(f(!0),g(!1))},[d,j]),p.useEffect(()=>{d&&P(!1)},[a.runId]);const k=()=>{f(!1),P(!0)},E=()=>{f(!1),P(!0),s("/run")};return!h&&!d&&!a.completed||!h||S?null:y?e.jsx(Jw,{runActive:d,elapsed:x,completed:a.completed,onExpand:()=>g(!1),onClose:k}):e.jsx(Yw,{progress:a,live:o,elapsed:x,runActive:d,stepLogs:c,onMinimise:()=>g(!0),onClose:k,onGoToRunConfig:E})}function Jw({runActive:s,elapsed:r,completed:a,onExpand:o,onClose:c}){return e.jsxs("div",{className:"fixed bottom-4 right-4 z-[9999] flex items-center gap-2 bg-slate-900 rounded-full px-3 py-1.5 shadow-2xl border border-slate-700 cursor-pointer hover:bg-slate-800 transition-colors",onClick:o,children:[s?e.jsxs(e.Fragment,{children:[e.jsx(Me,{size:12,className:"text-emerald-400 animate-spin"}),e.jsx("span",{className:"text-[10px] font-semibold text-white",children:"Running"}),e.jsx("span",{className:"text-[9px] font-mono text-slate-400",children:r})]}):a?e.jsxs(e.Fragment,{children:[a.failed>0?e.jsx(St,{size:12,className:"text-red-400"}):e.jsx(He,{size:12,className:"text-emerald-400"}),e.jsxs("span",{className:"text-[10px] font-semibold text-white",children:[a.passed,"✓ ",a.failed>0&&`${a.failed}✗`]})]}):null,e.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),c()},className:"p-0.5 rounded-full hover:bg-slate-700 text-slate-500 hover:text-white transition-colors",children:e.jsx(Fe,{size:10})})]})}function Yw({progress:s,live:r,elapsed:a,runActive:o,stepLogs:c,onMinimise:d,onClose:x,onGoToRunConfig:h}){const f=p.useRef(null),[y,g]=p.useState(null),j=p.useRef(!1),P=p.useRef({x:0,y:0}),S=p.useRef(null);p.useEffect(()=>{S.current?.scrollIntoView({behavior:"smooth"})},[c.length]);const k=p.useCallback(v=>{v.preventDefault(),j.current=!0;const C=f.current,D=y?.x??(C?C.getBoundingClientRect().left:window.innerWidth-400),M=y?.y??(C?C.getBoundingClientRect().top:window.innerHeight-400);P.current={x:v.clientX-D,y:v.clientY-M};const w=K=>{j.current&&g({x:Math.max(0,Math.min(window.innerWidth-200,K.clientX-P.current.x)),y:Math.max(0,Math.min(window.innerHeight-60,K.clientY-P.current.y))})},N=()=>{j.current=!1,window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",N)};window.addEventListener("mousemove",w),window.addEventListener("mouseup",N)},[y]),E=!!r.screenshot,R=s.completed;return e.jsxs("div",{ref:f,className:"fixed z-[9999] w-[340px] rounded-xl bg-slate-900 border border-slate-700 shadow-2xl overflow-hidden flex flex-col",style:y?{left:y.x,top:y.y,maxHeight:420}:{bottom:16,right:16,maxHeight:420},children:[e.jsxs("div",{className:"flex-shrink-0 flex items-center justify-between px-3 py-2 bg-slate-800 border-b border-slate-700 cursor-move select-none",onMouseDown:k,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Mv,{size:12,className:"text-slate-500"}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-red-500/80"}),e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-amber-500/80"}),e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-emerald-500/80"})]}),s.currentBrowser&&e.jsx(Bi,{browser:s.currentBrowser,size:14,className:"ml-1"}),e.jsx("span",{className:"text-[10px] font-semibold text-slate-400 uppercase tracking-wider ml-1",children:s.currentBrowser?ix(s.currentBrowser):o?"Browser Preview":"Run Complete"}),o&&e.jsx("span",{className:"text-[8px] font-bold px-1.5 py-0.5 rounded bg-emerald-500/20 text-emerald-400 animate-pulse",children:"LIVE"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{type:"button",onClick:v=>{v.stopPropagation(),h()},title:"Open in Run Config (full view)",className:"p-1.5 rounded text-slate-300 hover:text-accent hover:bg-slate-600 transition-colors",onMouseDown:v=>v.stopPropagation(),children:e.jsx(Ju,{size:14})}),e.jsx("button",{type:"button",onClick:v=>{v.stopPropagation(),d()},title:"Minimise",className:"p-1.5 rounded text-slate-300 hover:text-white hover:bg-slate-600 transition-colors",onMouseDown:v=>v.stopPropagation(),children:e.jsx(_f,{size:14})}),e.jsx("button",{type:"button",onClick:v=>{v.stopPropagation(),x()},title:"Close",className:"p-1.5 rounded text-slate-300 hover:text-red-400 hover:bg-slate-600 transition-colors",onMouseDown:v=>v.stopPropagation(),children:e.jsx(Fe,{size:14})})]})]}),e.jsxs("div",{className:"relative bg-slate-950 flex items-center justify-center overflow-hidden",style:{minHeight:120,maxHeight:180},children:[E&&e.jsx("img",{src:`data:image/jpeg;base64,${r.screenshot}`,alt:"Browser",className:O("w-full h-auto object-contain",R&&!o&&"opacity-30"),style:{maxHeight:180}}),!E&&o&&e.jsxs("div",{className:"flex flex-col items-center gap-2 py-6",children:[e.jsxs("div",{className:"w-12 h-8 rounded-lg bg-slate-800 border border-slate-700 overflow-hidden relative",children:[e.jsxs("div",{className:"h-2 bg-slate-750 border-b border-slate-700 flex items-center px-1 gap-0.5",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-red-500/50"}),e.jsx("div",{className:"w-1 h-1 rounded-full bg-amber-500/50"}),e.jsx("div",{className:"w-1 h-1 rounded-full bg-emerald-500/50"})]}),e.jsxs("div",{className:"p-1 space-y-0.5",children:[e.jsx("div",{className:"h-0.5 bg-slate-700 rounded w-3/4 animate-pulse"}),e.jsx("div",{className:"h-0.5 bg-slate-700 rounded w-1/2 animate-pulse"})]})]}),e.jsx("p",{className:"text-[9px] text-slate-500",children:"Waiting for screenshots..."}),e.jsx("div",{className:"flex gap-1",children:[0,120,240].map(v=>e.jsx("div",{className:"w-1 h-1 rounded-full bg-accent animate-bounce",style:{animationDelay:`${v}ms`}},v))})]}),R&&!o&&e.jsx("div",{className:O("w-full",E?"absolute inset-0 flex items-center justify-center bg-black/50 backdrop-blur-sm":"py-4 px-6"),children:e.jsxs("div",{className:O(E?"px-5 py-4":""),children:[e.jsxs("div",{className:"flex items-center gap-2.5 mb-3",children:[R.failed===0?e.jsx(He,{size:18,className:"text-emerald-400"}):e.jsx(St,{size:18,className:"text-red-400"}),e.jsxs("div",{children:[e.jsx("p",{className:O("text-xs font-bold",R.failed===0?"text-emerald-300":"text-red-300"),children:R.failed===0?"All tests passed!":"Completed with failures"}),e.jsxs("p",{className:"text-[9px] text-slate-400",children:[Math.round(R.duration/1e3),"s elapsed"]})]})]}),e.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:[{label:"Passed",v:R.passed,c:"text-emerald-400 bg-emerald-500/10 ring-emerald-500/20"},{label:"Failed",v:R.failed,c:"text-red-400 bg-red-500/10 ring-red-500/20"},{label:"Skipped",v:R.skipped,c:"text-slate-400 bg-slate-500/10 ring-slate-500/20"}].map(({label:v,v:C,c:D})=>e.jsxs("div",{className:O("rounded-lg p-2 text-center ring-1",D),children:[e.jsx("p",{className:"text-sm font-bold tabular-nums",children:C}),e.jsx("p",{className:"text-[7px] uppercase tracking-wider text-slate-500",children:v})]},v))})]})}),o&&s.currentStep&&e.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/90 to-transparent px-3 py-2",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-emerald-400 animate-pulse flex-shrink-0"}),e.jsx("p",{className:"text-[8px] text-white/70 truncate font-mono",children:s.currentStep.instruction})]})})]}),e.jsxs("div",{className:"flex-shrink-0 border-t border-slate-700",children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-1 bg-slate-800/50",children:[e.jsx("div",{className:"flex items-center gap-2",children:o?e.jsxs(e.Fragment,{children:[e.jsx(Me,{size:9,className:"text-emerald-400 animate-spin"}),e.jsx("span",{className:"text-[9px] text-slate-300 font-medium truncate max-w-[180px]",children:s.currentCase?.caseName??"Starting..."})]}):e.jsxs("span",{className:"text-[9px] text-slate-400",children:[c.length," step",c.length!==1&&"s"," executed"]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[9px] font-mono text-slate-500",children:a}),e.jsxs("button",{type:"button",onClick:h,className:"flex items-center gap-1 text-[8px] font-semibold text-accent hover:text-accent-light transition-colors",title:"Open full view in Run Config",children:[e.jsx(wa,{size:8})," Full View"]})]})]}),c.length>0&&e.jsxs("div",{className:"max-h-[72px] overflow-y-auto px-2 py-1 space-y-px",children:[c.slice(-5).map((v,C)=>e.jsxs("div",{className:"flex items-center gap-1.5 py-px text-[8px]",children:[v.status==="passed"?e.jsx(He,{size:8,className:"text-emerald-400 flex-shrink-0"}):v.status==="failed"?e.jsx(St,{size:8,className:"text-red-400 flex-shrink-0"}):e.jsx(Xt,{size:8,className:"text-slate-600 flex-shrink-0"}),e.jsx("span",{className:O("truncate flex-1 font-mono",v.status==="passed"?"text-slate-400":v.status==="failed"?"text-red-300":"text-slate-600"),children:v.instruction}),e.jsxs("span",{className:"text-slate-600 tabular-nums flex-shrink-0",children:[v.duration,"ms"]})]},`${v.stepId}-${C}`)),e.jsx("div",{ref:S})]})]})]})}function Xw(){const{hasConflict:s,conflictFiles:r}=Bl(),a=tg(),o=sg(),c=ng(),d=rg(),[x,h]=p.useState({});if(!s||r.length===0)return null;const f=v=>x[v]??{mode:"none",ours:"",theirs:"",merged:"",resolved:!1,loading:!1},y=(v,C)=>h(D=>({...D,[v]:{...f(v),...C}})),g=async v=>{y(v,{loading:!0});try{const C=await ut.conflictContent(v);y(v,{ours:C.ours,theirs:C.theirs,merged:C.ours,loading:!1})}catch{y(v,{ours:"(error loading)",theirs:"(error loading)",loading:!1})}},j=async v=>{let D=f(v).ours;D||(D=(await ut.conflictContent(v)).ours),y(v,{loading:!0}),a.mutate({filePath:v,content:D},{onSuccess:()=>y(v,{resolved:!0,loading:!1})})},P=async v=>{let D=f(v).theirs;D||(D=(await ut.conflictContent(v)).theirs),y(v,{loading:!0}),a.mutate({filePath:v,content:D},{onSuccess:()=>y(v,{resolved:!0,loading:!1})})},S=async v=>{let C=f(v);C.ours||(await g(v),C=f(v)),y(v,{mode:"ai",loading:!0}),o.mutate({filePath:v,ours:C.ours,theirs:C.theirs},{onSuccess:D=>y(v,{merged:D.resolved,loading:!1}),onError:()=>y(v,{loading:!1})})},k=async v=>{f(v).ours||await g(v),y(v,{mode:"manual"})},E=v=>{const C=f(v);y(v,{loading:!0}),a.mutate({filePath:v,content:C.merged},{onSuccess:()=>y(v,{resolved:!0,loading:!1,mode:"none"})})},R=r.every(v=>f(v).resolved);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:e.jsxs("div",{className:"bg-surface rounded-2xl shadow-2xl w-full max-w-4xl mx-4 max-h-[90vh] flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-slate-100 bg-red-50 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(gs,{size:20,className:"text-red-500"}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-bold text-red-800",children:"Merge Conflict Detected"}),e.jsxs("p",{className:"text-xs text-red-600",children:[r.length," file",r.length>1?"s":""," with conflicts"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>d.mutate(),disabled:d.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-red-600 bg-surface border border-red-200 rounded-lg hover:bg-red-50 transition-colors disabled:opacity-50",children:[e.jsx(_i,{size:11}),d.isPending?"Aborting...":"Abort Rebase"]}),e.jsxs("button",{onClick:()=>c.mutate(),disabled:!R||c.isPending,className:O("flex items-center gap-1.5 px-4 py-1.5 text-xs font-medium rounded-lg transition-colors",R?"bg-green-600 hover:bg-green-700 text-white":"bg-slate-200 text-content-tertiary cursor-not-allowed"),children:[e.jsx(Qe,{size:11}),c.isPending?"Continuing...":"Continue Rebase"]}),e.jsx("button",{onClick:()=>Ye.clearConflict(),className:"p-1.5 rounded hover:bg-red-100 text-red-400 transition-colors",children:e.jsx(Fe,{size:16})})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4",children:r.map(v=>{const C=f(v);return e.jsxs("div",{className:"border border-slate-200 rounded-xl overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-2.5 bg-surface-inset border-b border-slate-100 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Of,{size:14,className:C.resolved?"text-green-500":"text-amber-500"}),e.jsx("code",{className:"text-xs font-mono text-content-secondary",children:v}),C.resolved&&e.jsxs("span",{className:"text-[10px] text-green-600 bg-green-100 px-2 py-0.5 rounded-full flex items-center gap-1 font-medium",children:[e.jsx(Qe,{size:9})," Resolved"]})]}),!C.resolved&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(dl,{label:"Keep Local",onClick:()=>j(v),loading:C.loading&&C.mode==="none"}),e.jsx(dl,{label:"Accept Incoming",onClick:()=>P(v),loading:C.loading&&C.mode==="none"}),e.jsx(dl,{label:"Manual",onClick:()=>k(v)}),e.jsx(dl,{label:"AI Resolve",onClick:()=>S(v),loading:C.loading&&C.mode==="ai",icon:e.jsx(Bt,{size:9}),accent:!0})]})]}),C.mode!=="none"&&!C.resolved&&e.jsx("div",{className:"p-4",children:C.loading&&!C.ours?e.jsx("div",{className:"flex items-center justify-center py-6",children:e.jsx(Me,{size:18,className:"animate-spin text-content-tertiary"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-bold text-blue-600 uppercase tracking-wider mb-1 block",children:"Local (Ours)"}),e.jsx("textarea",{value:C.ours,readOnly:!0,rows:10,className:"w-full text-[11px] font-mono p-2.5 border border-blue-200 rounded-lg bg-blue-50/50 resize-y focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-bold text-orange-600 uppercase tracking-wider mb-1 block",children:"Incoming (Theirs)"}),e.jsx("textarea",{value:C.theirs,readOnly:!0,rows:10,className:"w-full text-[11px] font-mono p-2.5 border border-orange-200 rounded-lg bg-orange-50/50 resize-y focus:outline-none"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[9px] font-bold text-green-600 uppercase tracking-wider mb-1 block",children:"Merged Output (editable)"}),e.jsx("textarea",{value:C.merged,onChange:D=>y(v,{merged:D.target.value}),rows:10,className:"w-full text-[11px] font-mono p-2.5 border border-green-200 rounded-lg bg-green-50/50 resize-y focus:outline-none focus:ring-2 focus:ring-green-300"})]}),e.jsx("div",{className:"flex justify-end mt-2",children:e.jsxs("button",{onClick:()=>E(v),disabled:C.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:[C.loading?e.jsx(Me,{size:12,className:"animate-spin"}):e.jsx(Qe,{size:12}),"Mark as Resolved"]})})]})})]},v)})})]})})}function dl({label:s,onClick:r,loading:a,icon:o,accent:c}){return e.jsxs("button",{onClick:r,disabled:a,className:O("flex items-center gap-1 px-2 py-1 text-[10px] font-medium rounded-lg transition-colors",c?"bg-purple-100 text-purple-700 hover:bg-purple-200":"bg-slate-100 text-content-secondary hover:bg-slate-200",a&&"opacity-60 cursor-wait"),children:[a?e.jsx(Me,{size:9,className:"animate-spin"}):o,s]})}function Zw(s){p.useEffect(()=>{function r(a){const o=a.target;if(!(o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement||o instanceof HTMLSelectElement))for(const c of s){const d=a.key===c.key,x=!!c.ctrl,h=!!c.meta,f=!!c.shift,y=x?a.ctrlKey:!a.ctrlKey,g=h?a.metaKey:!a.metaKey,j=f?a.shiftKey:!a.shiftKey,P=(()=>{if(x||h){const S=x?a.ctrlKey:!0,k=h?a.metaKey:!0,E=f?a.shiftKey:!a.shiftKey;return x&&!h&&a.metaKey||h&&!x&&a.ctrlKey?!1:S&&k&&E}return y&&g&&j})();if(d&&P){a.preventDefault(),c.action();return}}}return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[s])}const ek=[{keys:["?"],description:"Show keyboard shortcuts"},{keys:["Ctrl","K"],description:"Search (Cmd+K)"},{keys:["Esc"],description:"Close modal / cancel"}];function tk({open:s,onClose:r}){return p.useEffect(()=>{if(!s)return;function a(o){o.key==="Escape"&&r()}return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[s,r]),s?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:r,children:e.jsxs("div",{className:"bg-surface rounded-2xl border border-border shadow-modal w-full max-w-lg mx-4 overflow-hidden",onClick:a=>a.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[e.jsx("h2",{className:"text-sm font-bold text-content",children:"Keyboard Shortcuts"}),e.jsx("button",{type:"button",onClick:r,className:"p-1.5 rounded-lg text-content-tertiary hover:bg-surface-inset hover:text-content transition-colors","aria-label":"Close",children:e.jsx(Fe,{size:14})})]}),e.jsx("div",{className:"px-5 py-4 grid grid-cols-2 gap-x-6 gap-y-3",children:ek.map(a=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-content-secondary",children:a.description}),e.jsx("div",{className:"flex items-center gap-1 flex-shrink-0",children:a.keys.map(o=>e.jsx("kbd",{className:"inline-flex items-center justify-center px-1.5 py-0.5 rounded text-[10px] font-mono font-semibold bg-surface-inset border border-border text-content-secondary min-w-[22px]",children:o},o))})]},a.description))}),e.jsx("div",{className:"px-5 py-3 border-t border-border bg-surface-inset/30",children:e.jsxs("p",{className:"text-[10px] text-content-tertiary",children:["Press ",e.jsx("kbd",{className:"inline-flex items-center justify-center px-1 py-px rounded text-[9px] font-mono bg-surface-inset border border-border text-content-tertiary",children:"Esc"})," or click outside to close"]})})]})}):null}const sk={suite:"Suites",case:"Cases",step:"Steps"},nk={name:"name",description:"description",tag:"tag",instruction:"instruction"};function rk({type:s}){return s==="suite"?e.jsx(Pr,{size:13,className:"text-indigo-500 flex-shrink-0"}):s==="case"?e.jsx(Ws,{size:13,className:"text-blue-500 flex-shrink-0"}):e.jsx(Gu,{size:13,className:"text-teal-500 flex-shrink-0"})}function ak({open:s,onClose:r}){const a=Gs(),[o,c]=p.useState(""),[d,x]=p.useState(""),[h,f]=p.useState(-1),y=p.useRef(null);p.useEffect(()=>{const R=setTimeout(()=>x(o),300);return()=>clearTimeout(R)},[o]),p.useEffect(()=>{s&&(c(""),x(""),f(-1),setTimeout(()=>y.current?.focus(),50))},[s]);const{data:g=[]}=Oe({queryKey:["search",d],queryFn:()=>xj.search(d),enabled:d.trim().length>1,staleTime:0}),j={suite:g.filter(R=>R.type==="suite"),case:g.filter(R=>R.type==="case"),step:g.filter(R=>R.type==="step")},P=g,S=R=>{R.type==="suite"?a(`/tests/${R.suiteId}`):R.type==="case"?a(`/tests/${R.suiteId}/cases/${R.caseId}`):a(`/tests/${R.suiteId}/cases/${R.caseId}`),r()},k=R=>{R.key==="ArrowDown"?(R.preventDefault(),f(v=>Math.min(v+1,P.length-1))):R.key==="ArrowUp"?(R.preventDefault(),f(v=>Math.max(v-1,-1))):R.key==="Enter"&&h>=0&&P[h]?(R.preventDefault(),S(P[h])):R.key==="Escape"&&r()};if(!s)return null;let E=-1;return e.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/60 backdrop-blur-sm pt-[15vh]",onClick:r,children:e.jsxs("div",{className:"bg-surface rounded-2xl border border-border shadow-modal w-full max-w-xl mx-4 overflow-hidden",onClick:R=>R.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border",children:[e.jsx(Bn,{size:15,className:"text-content-tertiary flex-shrink-0"}),e.jsx("input",{ref:y,type:"text",placeholder:"Search suites, cases, steps...",value:o,onChange:R=>{c(R.target.value),f(-1)},onKeyDown:k,className:"flex-1 text-sm bg-transparent text-content placeholder-content-tertiary outline-none"}),o&&e.jsx("button",{type:"button",onClick:()=>{c(""),x("")},className:"p-1 rounded text-content-tertiary hover:text-content transition-colors",children:e.jsx(Fe,{size:13})}),e.jsx("kbd",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded border border-border bg-surface-inset text-content-tertiary",children:"Esc"})]}),e.jsx("div",{className:"overflow-y-auto max-h-[50vh]",children:d.trim().length<2?e.jsx("div",{className:"px-5 py-8 text-center",children:e.jsx("p",{className:"text-sm text-content-tertiary",children:"Type at least 2 characters to search"})}):g.length===0?e.jsx("div",{className:"px-5 py-8 text-center",children:e.jsxs("p",{className:"text-sm text-content-tertiary",children:['No results for "',d,'"']})}):e.jsx("div",{className:"py-1",children:["suite","case","step"].map(R=>{const v=j[R];return v.length===0?null:e.jsxs("div",{children:[e.jsx("div",{className:"px-4 py-1.5 text-[10px] font-bold text-content-tertiary uppercase tracking-wider bg-surface-inset/50",children:sk[R]}),v.map(C=>{E++;const M=h===E;return e.jsxs("button",{type:"button",onClick:()=>S(C),className:O("w-full flex items-center gap-3 px-4 py-2.5 text-left transition-colors",M?"bg-accent/10":"hover:bg-surface-inset"),children:[e.jsx(rk,{type:C.type}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-content truncate",children:C.type==="step"?C.instruction:C.type==="case"?C.caseName:C.suiteName}),e.jsx("span",{className:O("text-[9px] px-1.5 py-0.5 rounded font-semibold uppercase flex-shrink-0",C.matchedOn==="name"?"bg-accent/10 text-accent":C.matchedOn==="tag"?"bg-purple-50 text-purple-600":"bg-surface-inset text-content-tertiary"),children:nk[C.matchedOn]})]}),e.jsxs("p",{className:"text-[11px] text-content-tertiary truncate mt-0.5",children:[C.type!=="suite"&&`${C.suiteName}`,C.type==="step"&&C.caseName&&` › ${C.caseName}`]})]}),e.jsx(gr,{size:11,className:O("text-content-tertiary transition-opacity flex-shrink-0",M?"opacity-100":"opacity-0")})]},`${C.suiteId}-${C.caseId??""}-${C.stepId??""}`)})]},R)})})}),g.length>0&&e.jsxs("div",{className:"px-4 py-2.5 border-t border-border bg-surface-inset/30 flex items-center gap-3 text-[10px] text-content-tertiary",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("kbd",{className:"px-1 py-px rounded border border-border bg-surface font-mono",children:"↑↓"})," navigate"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("kbd",{className:"px-1 py-px rounded border border-border bg-surface font-mono",children:"↵"})," select"]})]})]})})}const Rg="assuremind_onboarding_done";function cu(){localStorage.setItem(Rg,"true")}function ik(){const{data:s=[],isLoading:r}=mg(),[a,o]=p.useState(0),[c,d]=p.useState(""),[x,h]=p.useState(""),f=Gs(),y=!!localStorage.getItem(Rg),g=oe({mutationFn:S=>Cr.update({baseUrl:S}),onError:S=>H.error(S.message)}),j=oe({mutationFn:S=>Rr.create({name:S,type:"ui"}),onSuccess:()=>{cu(),f("/tests")},onError:S=>H.error(S.message)});if(r||s.length>0||y)return null;const P=[0,1,2].map(S=>e.jsx("span",{className:`w-2 h-2 rounded-full transition-colors ${S===a?"bg-accent":"bg-border"}`},S));return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:e.jsxs("div",{className:"bg-surface rounded-2xl border border-border shadow-modal w-full max-w-md mx-4 overflow-hidden",children:[a===0&&e.jsxs("div",{className:"flex flex-col items-center px-8 py-8 gap-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-2xl bg-gradient-to-br from-accent to-accent-dark flex items-center justify-center shadow-lg",children:e.jsx(ct,{size:28,className:"text-white"})}),e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-lg font-bold text-content",children:"Welcome to AssureMind Studio"}),e.jsx("p",{className:"text-sm text-content-secondary mt-2 leading-relaxed",children:"AI-powered test automation that writes, runs, and self-heals your tests. Let's get you set up in just a few steps."})]}),e.jsx("div",{className:"flex items-center gap-2 mt-2",children:P}),e.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[e.jsx(ve,{onClick:()=>o(1),className:"w-full",children:"Get Started"}),e.jsx("button",{type:"button",onClick:()=>{cu()},className:"text-xs text-content-tertiary hover:text-content-secondary transition-colors py-1",children:"Skip for now"})]})]}),a===1&&e.jsxs("div",{className:"flex flex-col items-center px-8 py-8 gap-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-2xl bg-gradient-to-br from-blue-500 to-indigo-600 flex items-center justify-center shadow-lg",children:e.jsx(Gn,{size:28,className:"text-white"})}),e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-lg font-bold text-content",children:"Set your Base URL"}),e.jsx("p",{className:"text-sm text-content-secondary mt-2 leading-relaxed",children:"This is the URL of the application you want to test."})]}),e.jsx("input",{type:"url",placeholder:"https://your-app.example.com",value:c,onChange:S=>d(S.target.value),className:"w-full px-3 py-2 rounded-lg border border-border bg-surface-inset text-sm text-content placeholder:text-content-tertiary outline-none focus:ring-2 focus:ring-accent/40 focus:border-accent transition-all"}),e.jsx("div",{className:"flex items-center gap-2",children:P}),e.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[e.jsx(ve,{onClick:async()=>{c&&await g.mutateAsync(c),o(2)},loading:g.isPending,className:"w-full",children:"Next"}),e.jsx("button",{type:"button",onClick:()=>{cu()},className:"text-xs text-content-tertiary hover:text-content-secondary transition-colors py-1",children:"Skip for now"})]})]}),a===2&&e.jsxs("div",{className:"flex flex-col items-center px-8 py-8 gap-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-2xl bg-gradient-to-br from-emerald-500 to-teal-600 flex items-center justify-center shadow-lg",children:e.jsx(Rv,{size:28,className:"text-white"})}),e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-lg font-bold text-content",children:"Create your first test suite"}),e.jsx("p",{className:"text-sm text-content-secondary mt-2 leading-relaxed",children:"Give your first test suite a name. You can add test cases to it right after."})]}),e.jsx("input",{type:"text",placeholder:"e.g. Login flow",value:x,onChange:S=>h(S.target.value),className:"w-full px-3 py-2 rounded-lg border border-border bg-surface-inset text-sm text-content placeholder:text-content-tertiary outline-none focus:ring-2 focus:ring-accent/40 focus:border-accent transition-all",onKeyDown:S=>{S.key==="Enter"&&x.trim()&&j.mutate(x.trim())}}),e.jsx("div",{className:"flex items-center gap-2",children:P}),e.jsx(ve,{onClick:()=>{x.trim()&&j.mutate(x.trim())},loading:j.isPending,disabled:!x.trim(),className:"w-full",children:"Create Suite & Continue"})]})]})})}const ok={AI_NOT_CONFIGURED:{icon:e.jsx(Bt,{size:20,className:"text-indigo-500"}),iconBg:"bg-indigo-50 border-indigo-200/50 dark:bg-indigo-900/30 dark:border-indigo-700/50",title:"AI Provider Setup Required",description:"To use AI-powered features like test generation, code generation, and self-healing, you need to configure an AI provider and its API key.",envVars:[{name:"AI_PROVIDER",example:"openai | anthropic | google | azure-openai | bedrock | ..."},{name:"<PROVIDER>_API_KEY",example:"sk-... (your provider API key)"}]},JIRA_NOT_CONFIGURED:{icon:e.jsx(jl,{size:20,className:"text-blue-500"}),iconBg:"bg-blue-50 border-blue-200/50 dark:bg-blue-900/30 dark:border-blue-700/50",title:"Jira Integration Setup Required",description:"To fetch Jira issues and enrich test generation with Jira stories, you need to configure your Jira credentials.",envVars:[{name:"JIRA_BASE_URL",example:"https://your-domain.atlassian.net"},{name:"JIRA_EMAIL",example:"your-email@company.com"},{name:"JIRA_API_TOKEN",example:"your-jira-api-token"}]},XRAY_NOT_CONFIGURED:{icon:e.jsx(jl,{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 lk(){const{activeModal:s}=cj(),[r,a]=p.useState(!1);if(p.useEffect(()=>{if(!s)return;a(!1);const c=d=>{d.key==="Escape"&&vr.dismiss()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s]),!s)return null;const o=ok[s];return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center animate-fade-in",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>vr.dismiss()}),e.jsxs("div",{className:"relative bg-surface rounded-2xl shadow-modal w-full max-w-md mx-4 overflow-hidden border border-border animate-scale-in",children:[e.jsxs("div",{className:"flex items-start gap-3.5 p-6 pb-4",children:[e.jsx("div",{className:`flex-shrink-0 w-11 h-11 rounded-xl border flex items-center justify-center ${o.iconBg}`,children:o.icon}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-base font-semibold text-content",children:o.title}),e.jsx("p",{className:"mt-1.5 text-sm text-content-secondary leading-relaxed",children:o.description})]})]}),e.jsxs("div",{className:"mx-6 mb-4 rounded-xl bg-surface-inset border border-border p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx($f,{size:14,className:"text-content-tertiary"}),e.jsx("span",{className:"text-xs font-semibold text-content-secondary uppercase tracking-wider",children:"Add to your .env file"})]}),e.jsx("div",{className:"space-y-2",children:o.envVars.map(c=>e.jsxs("div",{className:"font-mono text-xs",children:[e.jsx("span",{className:"text-accent font-semibold",children:c.name}),e.jsx("span",{className:"text-content-tertiary",children:"="}),e.jsx("span",{className:"text-content-secondary",children:c.example})]},c.name))})]}),e.jsxs("div",{className:"mx-6 mb-5 text-xs text-content-tertiary leading-relaxed",children:["After updating your ",e.jsx("code",{className:"px-1 py-0.5 rounded bg-surface-inset text-content-secondary",children:".env"})," file, restart the Studio server for changes to take effect."]}),e.jsxs("div",{className:"flex items-center justify-between px-6 pb-6",children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[e.jsx("input",{type:"checkbox",checked:r,onChange:c=>a(c.target.checked),className:"w-3.5 h-3.5 rounded border-border accent-accent cursor-pointer"}),e.jsx("span",{className:"text-xs text-content-tertiary",children:"Don't show this again"})]}),e.jsx(ve,{variant:"secondary",size:"sm",onClick:()=>vr.dismiss(r),children:"Close"})]})]})]})}function ck(){const{job:s,showPopup:r}=jg(),a=Gs();return!r||!s||s.status!=="done"?null:e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm animate-fade-in",children:e.jsxs("div",{className:"bg-surface rounded-2xl shadow-modal w-full max-w-sm mx-4 overflow-hidden border border-border animate-scale-in",children:[e.jsxs("div",{className:"flex flex-col items-center pt-8 pb-5 px-6 bg-gradient-to-b from-emerald-50/80 to-surface",children:[e.jsx("div",{className:"w-14 h-14 rounded-2xl bg-emerald-100 border border-emerald-200/50 flex items-center justify-center mb-3",children:e.jsx(He,{size:28,className:"text-emerald-500"})}),e.jsx("h2",{className:"text-lg font-bold text-content",children:"Suite Generated!"}),s.suiteName&&e.jsx("span",{className:"mt-2 px-3 py-1 rounded-lg bg-accent-muted text-accent text-xs font-semibold",children:s.suiteName}),e.jsx("p",{className:"text-sm text-content-secondary text-center mt-2.5 leading-relaxed",children:"Your test suite has been created. Open the Test Editor to review and run the generated test cases."})]}),e.jsxs("div",{className:"flex flex-col gap-2.5 px-6 pb-6",children:[e.jsxs("button",{type:"button",onClick:()=>{Rs.dismissPopup(),a("/tests",{state:{openSuiteId:s.suiteId}})},className:"w-full py-2.5 rounded-xl bg-gradient-to-b from-accent to-accent-dark text-white font-semibold text-sm hover:brightness-110 transition-all flex items-center justify-center gap-2 shadow-sm",children:[e.jsx(Zt,{size:16})," Open Test Cases"]}),e.jsx("button",{type:"button",onClick:()=>Rs.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 dk(){const{job:s}=jg(),[r,a]=p.useState(null),o=p.useRef(null),c=p.useRef(null);p.useEffect(()=>{s?.status==="running"&&a(null)},[s?.id]);const d=p.useCallback(y=>{y.preventDefault();const g=c.current;if(!g)return;g.setPointerCapture(y.pointerId);const j=g.getBoundingClientRect();o.current={startX:y.clientX,startY:y.clientY,origX:j.left,origY:j.top}},[]),x=p.useCallback(y=>{if(!o.current)return;const g=c.current;if(!g)return;const j=y.clientX-o.current.startX,P=y.clientY-o.current.startY,S=o.current.origX+j,k=o.current.origY+P,E=window.innerWidth-g.offsetWidth,R=window.innerHeight-g.offsetHeight;a({x:Math.max(0,Math.min(S,E)),y:Math.max(0,Math.min(k,R))})},[]),h=p.useCallback(()=>{o.current=null},[]);if(!s||s.status!=="running")return null;const f=r?{left:r.x,top:r.y,right:"auto",bottom:"auto"}:{right:24,bottom:80};return e.jsxs("div",{ref:c,onPointerDown:d,onPointerMove:x,onPointerUp:h,style:{...f,position:"fixed",zIndex:40,touchAction:"none",cursor:"grab",userSelect:"none"},className:"flex items-center gap-2.5 px-4 py-2.5 rounded-xl bg-gradient-to-r from-accent to-accent-dark text-white shadow-elevated text-xs font-semibold animate-pulse",children:[e.jsx(Me,{size:14,className:"animate-spin"}),"Generating: ",s.label]})}function uk(){return Ar({"run:start":s=>{$t.onRunStart(s.runId)},"run:case":s=>{const r=s;r.status==="running"&&$t.onCaseRunning(r.runId,r.caseId)},"run:case:done":s=>{const r=s;$t.onCaseDone(r.runId,r.caseId,r.status)},"run:complete":s=>{const r=s;$t.onComplete(r.runId,{passed:r.passed,failed:r.failed,skipped:r.skipped});const a=r.passed+r.failed+r.skipped;r.failed>0?H.error(`Run complete — ${r.passed}/${a} passed, ${r.failed} failed`):H.success(`Run complete — ${r.passed}/${a} passed`),jr.push({id:crypto.randomUUID(),type:"run-complete",message:`Run complete — ${r.passed} passed, ${r.failed} failed`,timestamp:Date.now(),read:!1,link:"/reports"})},"run:error":s=>{const r=s;$t.clear(),H.error(`Run error: ${r.error??"unknown"}`),jr.push({id:crypto.randomUUID(),type:"run-error",message:`Run error: ${r.error??"unknown"}`,timestamp:Date.now(),read:!1,link:"/reports"})}}),null}function xk(){return Ar({"git:log":s=>{Ye.addLogStep(s)},"git:conflict":s=>{const r=s;Ye.setConflict(r.files)},"git:operation-done":()=>{Ye.finishOperation()}}),null}const mk={"/":"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 hk(){const s=Wn();return s.pathname.startsWith("/tests")?"Test Suites":mk[s.pathname]??"AssureMind Studio"}function pk(){const{collapsed:s,mobileOpen:r,toggle:a}=oj(),o=hk(),[c,d]=p.useState(!1),[x,h]=p.useState(!1);return Zw([{key:"?",description:"Show shortcuts",action:()=>d(!0)},{key:"Escape",description:"Close modal",action:()=>{d(!1),h(!1)}},{key:"k",ctrl:!0,description:"Search (Cmd+K)",action:()=>h(!0)},{key:"k",meta:!0,description:"Search (Cmd+K)",action:()=>h(!0)}]),e.jsxs("div",{className:"flex h-full overflow-hidden",children:[e.jsx(uk,{}),e.jsx(xk,{}),e.jsx(ij,{collapsed:s,onToggle:a,mobileOpen:r}),e.jsxs("div",{className:"flex flex-col flex-1 min-w-0 overflow-hidden",children:[e.jsx($N,{title:o,onMenuClick:a}),e.jsx("main",{className:"flex flex-col flex-1 overflow-hidden bg-background",children:e.jsxs(Nb,{children:[e.jsx(It,{path:"/",element:e.jsx(KN,{})}),e.jsx(It,{path:"/tests",element:e.jsx(tu,{})}),e.jsx(It,{path:"/tests/:suiteId",element:e.jsx(tu,{})}),e.jsx(It,{path:"/tests/:suiteId/cases/:caseId",element:e.jsx(tu,{})}),e.jsx(It,{path:"/story",element:e.jsx(H2,{})}),e.jsx(It,{path:"/run",element:e.jsx(Y2,{})}),e.jsx(It,{path:"/reports",element:e.jsx(Ew,{})}),e.jsx(It,{path:"/variables",element:e.jsx(Rw,{})}),e.jsx(It,{path:"/healing",element:e.jsx(zw,{})}),e.jsx(It,{path:"/git",element:e.jsx(Hw,{})}),e.jsx(It,{path:"/settings",element:e.jsx(Dw,{})}),e.jsx(It,{path:"/env-config",element:e.jsx(Iw,{})}),e.jsx(It,{path:"/library",element:e.jsx(Fw,{})}),e.jsx(It,{path:"/ci-integration",element:e.jsx($w,{})}),e.jsx(It,{path:"/docs",element:e.jsx(_w,{})})]})})]}),e.jsx(tk,{open:c,onClose:()=>d(!1)}),e.jsx(ak,{open:x,onClose:()=>h(!1)})]})}function fk(){return e.jsxs(e.Fragment,{children:[e.jsx(pk,{}),e.jsx(Gw,{}),e.jsx(Xw,{}),e.jsx(ck,{}),e.jsx(dk,{}),e.jsx(Qw,{}),e.jsx(ik,{}),e.jsx(lk,{}),e.jsx(ov,{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 gk=new o1({defaultOptions:{queries:{retry:1,staleTime:1e4,refetchOnWindowFocus:!1}}}),Mg=document.getElementById("root");if(!Mg)throw new Error("Root element not found");Ty.createRoot(Mg).render(e.jsx(p.StrictMode,{children:e.jsx(Mb,{children:e.jsx(l1,{client:gk,children:e.jsx(fk,{})})})}));
|