Files

1 line
84 KiB
JavaScript
Vendored

(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,97882,e=>{"use strict";let t=(0,e.i(75254).default)("loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);e.s(["LoaderIcon",()=>t],97882)},10708,e=>{"use strict";var t=e.i(43476),r=e.i(71645),a=e.i(48425),s=r.forwardRef((e,r)=>(0,t.jsx)(a.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));s.displayName="Label";var o=e.i(47163);function l({className:e,...r}){return(0,t.jsx)(s,{"data-slot":"label",className:(0,o.cn)("flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...r})}e.s(["Label",()=>l],10708)},71435,e=>{"use strict";var t=e.i(43476),r=e.i(71645);e.i(74080);var a=e.i(20783),s=Symbol("radix.slottable");function o(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===s}var l=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,s)=>{var l,n;let i,c,d,u=(n=l=`Primitive.${s}`,(i=r.forwardRef((e,t)=>{let{children:s,...o}=e;if(r.isValidElement(s)){var l;let e,n,i=(l=s,(n=(e=Object.getOwnPropertyDescriptor(l.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?l.ref:(n=(e=Object.getOwnPropertyDescriptor(l,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?l.props.ref:l.props.ref||l.ref),c=function(e,t){let r={...t};for(let a in t){let s=e[a],o=t[a];/^on[A-Z]/.test(a)?s&&o?r[a]=(...e)=>{let t=o(...e);return s(...e),t}:s&&(r[a]=s):"style"===a?r[a]={...s,...o}:"className"===a&&(r[a]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}(o,s.props);return s.type!==r.Fragment&&(c.ref=t?(0,a.composeRefs)(t,i):i),r.cloneElement(s,c)}return r.Children.count(s)>1?r.Children.only(null):null})).displayName=`${n}.SlotClone`,c=i,(d=r.forwardRef((e,a)=>{let{children:s,...l}=e,n=r.Children.toArray(s),i=n.find(o);if(i){let e=i.props.children,s=n.map(t=>t!==i?t:r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null);return(0,t.jsx)(c,{...l,ref:a,children:r.isValidElement(e)?r.cloneElement(e,void 0,s):null})}return(0,t.jsx)(c,{...l,ref:a,children:s})})).displayName=`${l}.Slot`,d),p=r.forwardRef((e,r)=>{let{asChild:a,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(a?u:s,{...o,ref:r})});return p.displayName=`Primitive.${s}`,{...e,[s]:p}},{}),n=e.i(96626),i=e.i(30207),c=e.i(86318),d=e.i(34620),u=e.i(70152),p=e.i(81140),m="ScrollArea",[h,f]=function(e,a=[]){let s=[],o=()=>{let t=s.map(e=>r.createContext(e));return function(a){let s=a?.[e]||t;return r.useMemo(()=>({[`__scope${e}`]:{...a,[e]:s}}),[a,s])}};return o.scopeName=e,[function(a,o){let l=r.createContext(o),n=s.length;s=[...s,o];let i=a=>{let{scope:s,children:o,...i}=a,c=s?.[e]?.[n]||l,d=r.useMemo(()=>i,Object.values(i));return(0,t.jsx)(c.Provider,{value:d,children:o})};return i.displayName=a+"Provider",[i,function(t,s){let i=s?.[e]?.[n]||l,c=r.useContext(i);if(c)return c;if(void 0!==o)return o;throw Error(`\`${t}\` must be used within \`${a}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let a=()=>{let a=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let s=a.reduce((t,{useScope:r,scopeName:a})=>{let s=r(e)[`__scope${a}`];return{...t,...s}},{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return a.scopeName=t.scopeName,a}(o,...a)]}(m),[g,w]=h(m),x=r.forwardRef((e,s)=>{let{__scopeScrollArea:o,type:n="hover",dir:i,scrollHideDelay:d=600,...u}=e,[p,m]=r.useState(null),[h,f]=r.useState(null),[w,x]=r.useState(null),[v,y]=r.useState(null),[b,_]=r.useState(null),[k,j]=r.useState(0),[S,N]=r.useState(0),[C,D]=r.useState(!1),[I,R]=r.useState(!1),P=(0,a.useComposedRefs)(s,e=>m(e)),A=(0,c.useDirection)(i);return(0,t.jsx)(g,{scope:o,type:n,dir:A,scrollHideDelay:d,scrollArea:p,viewport:h,onViewportChange:f,content:w,onContentChange:x,scrollbarX:v,onScrollbarXChange:y,scrollbarXEnabled:C,onScrollbarXEnabledChange:D,scrollbarY:b,onScrollbarYChange:_,scrollbarYEnabled:I,onScrollbarYEnabledChange:R,onCornerWidthChange:j,onCornerHeightChange:N,children:(0,t.jsx)(l.div,{dir:A,...u,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":k+"px","--radix-scroll-area-corner-height":S+"px",...e.style}})})});x.displayName=m;var v="ScrollAreaViewport",y=r.forwardRef((e,s)=>{let{__scopeScrollArea:o,children:n,nonce:i,...c}=e,d=w(v,o),u=r.useRef(null),p=(0,a.useComposedRefs)(s,u,d.onViewportChange);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),(0,t.jsx)(l.div,{"data-radix-scroll-area-viewport":"",...c,ref:p,style:{overflowX:d.scrollbarXEnabled?"scroll":"hidden",overflowY:d.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,t.jsx)("div",{ref:d.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});y.displayName=v;var b="ScrollAreaScrollbar",_=r.forwardRef((e,a)=>{let{forceMount:s,...o}=e,l=w(b,e.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:i}=l,c="horizontal"===e.orientation;return r.useEffect(()=>(c?n(!0):i(!0),()=>{c?n(!1):i(!1)}),[c,n,i]),"hover"===l.type?(0,t.jsx)(k,{...o,ref:a,forceMount:s}):"scroll"===l.type?(0,t.jsx)(j,{...o,ref:a,forceMount:s}):"auto"===l.type?(0,t.jsx)(S,{...o,ref:a,forceMount:s}):"always"===l.type?(0,t.jsx)(N,{...o,ref:a}):null});_.displayName=b;var k=r.forwardRef((e,a)=>{let{forceMount:s,...o}=e,l=w(b,e.__scopeScrollArea),[i,c]=r.useState(!1);return r.useEffect(()=>{let e=l.scrollArea,t=0;if(e){let r=()=>{window.clearTimeout(t),c(!0)},a=()=>{t=window.setTimeout(()=>c(!1),l.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",a),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",a)}}},[l.scrollArea,l.scrollHideDelay]),(0,t.jsx)(n.Presence,{present:s||i,children:(0,t.jsx)(S,{"data-state":i?"visible":"hidden",...o,ref:a})})}),j=r.forwardRef((e,a)=>{var s;let{forceMount:o,...l}=e,i=w(b,e.__scopeScrollArea),c="horizontal"===e.orientation,d=q(()=>m("SCROLL_END"),100),[u,m]=(s={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},r.useReducer((e,t)=>s[e][t]??e,"hidden"));return r.useEffect(()=>{if("idle"===u){let e=window.setTimeout(()=>m("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[u,i.scrollHideDelay,m]),r.useEffect(()=>{let e=i.viewport,t=c?"scrollLeft":"scrollTop";if(e){let r=e[t],a=()=>{let a=e[t];r!==a&&(m("SCROLL"),d()),r=a};return e.addEventListener("scroll",a),()=>e.removeEventListener("scroll",a)}},[i.viewport,c,m,d]),(0,t.jsx)(n.Presence,{present:o||"hidden"!==u,children:(0,t.jsx)(N,{"data-state":"hidden"===u?"hidden":"visible",...l,ref:a,onPointerEnter:(0,p.composeEventHandlers)(e.onPointerEnter,()=>m("POINTER_ENTER")),onPointerLeave:(0,p.composeEventHandlers)(e.onPointerLeave,()=>m("POINTER_LEAVE"))})})}),S=r.forwardRef((e,a)=>{let s=w(b,e.__scopeScrollArea),{forceMount:o,...l}=e,[i,c]=r.useState(!1),d="horizontal"===e.orientation,u=q(()=>{if(s.viewport){let e=s.viewport.offsetWidth<s.viewport.scrollWidth,t=s.viewport.offsetHeight<s.viewport.scrollHeight;c(d?e:t)}},10);return X(s.viewport,u),X(s.content,u),(0,t.jsx)(n.Presence,{present:o||i,children:(0,t.jsx)(N,{"data-state":i?"visible":"hidden",...l,ref:a})})}),N=r.forwardRef((e,a)=>{let{orientation:s="vertical",...o}=e,l=w(b,e.__scopeScrollArea),n=r.useRef(null),i=r.useRef(0),[c,d]=r.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=F(c.viewport,c.content),p={...o,sizes:c,onSizesChange:d,hasThumb:!!(u>0&&u<1),onThumbChange:e=>n.current=e,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:e=>i.current=e};function m(e,t){return function(e,t,r,a="ltr"){let s=O(r),o=t||s/2,l=r.scrollbar.paddingStart+o,n=r.scrollbar.size-r.scrollbar.paddingEnd-(s-o),i=r.content-r.viewport;return H([l,n],"ltr"===a?[0,i]:[-1*i,0])(e)}(e,i.current,c,t)}return"horizontal"===s?(0,t.jsx)(C,{...p,ref:a,onThumbPositionChange:()=>{if(l.viewport&&n.current){let e=V(l.viewport.scrollLeft,c,l.dir);n.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{l.viewport&&(l.viewport.scrollLeft=e)},onDragScroll:e=>{l.viewport&&(l.viewport.scrollLeft=m(e,l.dir))}}):"vertical"===s?(0,t.jsx)(D,{...p,ref:a,onThumbPositionChange:()=>{if(l.viewport&&n.current){let e=V(l.viewport.scrollTop,c);n.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{l.viewport&&(l.viewport.scrollTop=e)},onDragScroll:e=>{l.viewport&&(l.viewport.scrollTop=m(e))}}):null}),C=r.forwardRef((e,s)=>{let{sizes:o,onSizesChange:l,...n}=e,i=w(b,e.__scopeScrollArea),[c,d]=r.useState(),u=r.useRef(null),p=(0,a.useComposedRefs)(s,u,i.onScrollbarXChange);return r.useEffect(()=>{u.current&&d(getComputedStyle(u.current))},[u]),(0,t.jsx)(P,{"data-orientation":"horizontal",...n,ref:p,sizes:o,style:{bottom:0,left:"rtl"===i.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===i.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":O(o)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,r)=>{if(i.viewport){var a,s;let o=i.viewport.scrollLeft+t.deltaX;e.onWheelScroll(o),a=o,s=r,a>0&&a<s&&t.preventDefault()}},onResize:()=>{u.current&&i.viewport&&c&&l({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:$(c.paddingLeft),paddingEnd:$(c.paddingRight)}})}})}),D=r.forwardRef((e,s)=>{let{sizes:o,onSizesChange:l,...n}=e,i=w(b,e.__scopeScrollArea),[c,d]=r.useState(),u=r.useRef(null),p=(0,a.useComposedRefs)(s,u,i.onScrollbarYChange);return r.useEffect(()=>{u.current&&d(getComputedStyle(u.current))},[u]),(0,t.jsx)(P,{"data-orientation":"vertical",...n,ref:p,sizes:o,style:{top:0,right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":O(o)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,r)=>{if(i.viewport){var a,s;let o=i.viewport.scrollTop+t.deltaY;e.onWheelScroll(o),a=o,s=r,a>0&&a<s&&t.preventDefault()}},onResize:()=>{u.current&&i.viewport&&c&&l({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:$(c.paddingTop),paddingEnd:$(c.paddingBottom)}})}})}),[I,R]=h(b),P=r.forwardRef((e,s)=>{let{__scopeScrollArea:o,sizes:n,hasThumb:c,onThumbChange:d,onThumbPointerUp:u,onThumbPointerDown:m,onThumbPositionChange:h,onDragScroll:f,onWheelScroll:g,onResize:x,...v}=e,y=w(b,o),[_,k]=r.useState(null),j=(0,a.useComposedRefs)(s,e=>k(e)),S=r.useRef(null),N=r.useRef(""),C=y.viewport,D=n.content-n.viewport,R=(0,i.useCallbackRef)(g),P=(0,i.useCallbackRef)(h),A=q(x,10);function M(e){S.current&&f({x:e.clientX-S.current.left,y:e.clientY-S.current.top})}return r.useEffect(()=>{let e=e=>{let t=e.target;_?.contains(t)&&R(e,D)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[C,_,D,R]),r.useEffect(P,[n,P]),X(_,A),X(y.content,A),(0,t.jsx)(I,{scope:o,scrollbar:_,hasThumb:c,onThumbChange:(0,i.useCallbackRef)(d),onThumbPointerUp:(0,i.useCallbackRef)(u),onThumbPositionChange:P,onThumbPointerDown:(0,i.useCallbackRef)(m),children:(0,t.jsx)(l.div,{...v,ref:j,style:{position:"absolute",...v.style},onPointerDown:(0,p.composeEventHandlers)(e.onPointerDown,e=>{0===e.button&&(e.target.setPointerCapture(e.pointerId),S.current=_.getBoundingClientRect(),N.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),M(e))}),onPointerMove:(0,p.composeEventHandlers)(e.onPointerMove,M),onPointerUp:(0,p.composeEventHandlers)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=N.current,y.viewport&&(y.viewport.style.scrollBehavior=""),S.current=null})})})}),A="ScrollAreaThumb",M=r.forwardRef((e,r)=>{let{forceMount:a,...s}=e,o=R(A,e.__scopeScrollArea);return(0,t.jsx)(n.Presence,{present:a||o.hasThumb,children:(0,t.jsx)(E,{ref:r,...s})})}),E=r.forwardRef((e,s)=>{let{__scopeScrollArea:o,style:n,...i}=e,c=w(A,o),d=R(A,o),{onThumbPositionChange:u}=d,m=(0,a.useComposedRefs)(s,e=>d.onThumbChange(e)),h=r.useRef(void 0),f=q(()=>{h.current&&(h.current(),h.current=void 0)},100);return r.useEffect(()=>{let e=c.viewport;if(e){let t=()=>{f(),h.current||(h.current=W(e,u),u())};return u(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[c.viewport,f,u]),(0,t.jsx)(l.div,{"data-state":d.hasThumb?"visible":"hidden",...i,ref:m,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:(0,p.composeEventHandlers)(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),r=e.clientX-t.left,a=e.clientY-t.top;d.onThumbPointerDown({x:r,y:a})}),onPointerUp:(0,p.composeEventHandlers)(e.onPointerUp,d.onThumbPointerUp)})});M.displayName=A;var T="ScrollAreaCorner",L=r.forwardRef((e,r)=>{let a=w(T,e.__scopeScrollArea),s=!!(a.scrollbarX&&a.scrollbarY);return"scroll"!==a.type&&s?(0,t.jsx)(z,{...e,ref:r}):null});L.displayName=T;var z=r.forwardRef((e,a)=>{let{__scopeScrollArea:s,...o}=e,n=w(T,s),[i,c]=r.useState(0),[d,u]=r.useState(0),p=!!(i&&d);return X(n.scrollbarX,()=>{let e=n.scrollbarX?.offsetHeight||0;n.onCornerHeightChange(e),u(e)}),X(n.scrollbarY,()=>{let e=n.scrollbarY?.offsetWidth||0;n.onCornerWidthChange(e),c(e)}),p?(0,t.jsx)(l.div,{...o,ref:a,style:{width:i,height:d,position:"absolute",right:"ltr"===n.dir?0:void 0,left:"rtl"===n.dir?0:void 0,bottom:0,...e.style}}):null});function $(e){return e?parseInt(e,10):0}function F(e,t){let r=e/t;return isNaN(r)?0:r}function O(e){let t=F(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd;return Math.max((e.scrollbar.size-r)*t,18)}function V(e,t,r="ltr"){let a=O(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,l=t.content-t.viewport,n=(0,u.clamp)(e,"ltr"===r?[0,l]:[-1*l,0]);return H([0,l],[0,o-a])(n)}function H(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(r-e[0])}}var W=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},a=0;return!function s(){let o={left:e.scrollLeft,top:e.scrollTop},l=r.left!==o.left,n=r.top!==o.top;(l||n)&&t(),r=o,a=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(a)};function q(e,t){let a=(0,i.useCallbackRef)(e),s=r.useRef(0);return r.useEffect(()=>()=>window.clearTimeout(s.current),[]),r.useCallback(()=>{window.clearTimeout(s.current),s.current=window.setTimeout(a,t)},[a,t])}function X(e,t){let r=(0,i.useCallbackRef)(t);(0,d.useLayoutEffect)(()=>{let t=0;if(e){let a=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(r)});return a.observe(e),()=>{window.cancelAnimationFrame(t),a.unobserve(e)}}},[e,r])}var B=e.i(47163);function K({className:e,children:r,...a}){return(0,t.jsxs)(x,{"data-slot":"scroll-area",className:(0,B.cn)("relative overflow-hidden",e),...a,children:[(0,t.jsx)(y,{className:"h-full w-full rounded-[inherit]",children:r}),(0,t.jsx)(U,{}),(0,t.jsx)(L,{})]})}function U({className:e,orientation:r="vertical",...a}){return(0,t.jsx)(_,{"data-slot":"scroll-bar",orientation:r,className:(0,B.cn)("flex touch-none select-none transition-colors","vertical"===r&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===r&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...a,children:(0,t.jsx)(M,{className:"relative flex-1 rounded-full bg-border"})})}e.s(["ScrollArea",()=>K],71435)},11369,e=>{"use strict";var t=e.i(43476),r=e.i(71645),a=e.i(81140),s=e.i(69340),o=e.i(34620),l=e.i(20783);e.i(74080);var n=Symbol("radix.slottable");function i(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===n}var c=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,a)=>{var s,o;let n,c,d,u=(o=s=`Primitive.${a}`,(n=r.forwardRef((e,t)=>{let{children:a,...s}=e;if(r.isValidElement(a)){var o;let e,n,i=(o=a,(n=(e=Object.getOwnPropertyDescriptor(o.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?o.ref:(n=(e=Object.getOwnPropertyDescriptor(o,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?o.props.ref:o.props.ref||o.ref),c=function(e,t){let r={...t};for(let a in t){let s=e[a],o=t[a];/^on[A-Z]/.test(a)?s&&o?r[a]=(...e)=>{let t=o(...e);return s(...e),t}:s&&(r[a]=s):"style"===a?r[a]={...s,...o}:"className"===a&&(r[a]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}(s,a.props);return a.type!==r.Fragment&&(c.ref=t?(0,l.composeRefs)(t,i):i),r.cloneElement(a,c)}return r.Children.count(a)>1?r.Children.only(null):null})).displayName=`${o}.SlotClone`,c=n,(d=r.forwardRef((e,a)=>{let{children:s,...o}=e,l=r.Children.toArray(s),n=l.find(i);if(n){let e=n.props.children,s=l.map(t=>t!==n?t:r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null);return(0,t.jsx)(c,{...o,ref:a,children:r.isValidElement(e)?r.cloneElement(e,void 0,s):null})}return(0,t.jsx)(c,{...o,ref:a,children:s})})).displayName=`${s}.Slot`,d),p=r.forwardRef((e,r)=>{let{asChild:s,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(s?u:a,{...o,ref:r})});return p.displayName=`Primitive.${a}`,{...e,[a]:p}},{}),d=e.i(96626),u=e.i(10772),p="Collapsible",[m,h]=function(e,a=[]){let s=[],o=()=>{let t=s.map(e=>r.createContext(e));return function(a){let s=a?.[e]||t;return r.useMemo(()=>({[`__scope${e}`]:{...a,[e]:s}}),[a,s])}};return o.scopeName=e,[function(a,o){let l=r.createContext(o),n=s.length;s=[...s,o];let i=a=>{let{scope:s,children:o,...i}=a,c=s?.[e]?.[n]||l,d=r.useMemo(()=>i,Object.values(i));return(0,t.jsx)(c.Provider,{value:d,children:o})};return i.displayName=a+"Provider",[i,function(t,s){let i=s?.[e]?.[n]||l,c=r.useContext(i);if(c)return c;if(void 0!==o)return o;throw Error(`\`${t}\` must be used within \`${a}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let a=()=>{let a=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let s=a.reduce((t,{useScope:r,scopeName:a})=>{let s=r(e)[`__scope${a}`];return{...t,...s}},{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return a.scopeName=t.scopeName,a}(o,...a)]}(p),[f,g]=m(p),w=r.forwardRef((e,a)=>{let{__scopeCollapsible:o,open:l,defaultOpen:n,disabled:i,onOpenChange:d,...m}=e,[h,g]=(0,s.useControllableState)({prop:l,defaultProp:n??!1,onChange:d,caller:p});return(0,t.jsx)(f,{scope:o,disabled:i,contentId:(0,u.useId)(),open:h,onOpenToggle:r.useCallback(()=>g(e=>!e),[g]),children:(0,t.jsx)(c.div,{"data-state":k(h),"data-disabled":i?"":void 0,...m,ref:a})})});w.displayName=p;var x="CollapsibleTrigger",v=r.forwardRef((e,r)=>{let{__scopeCollapsible:s,...o}=e,l=g(x,s);return(0,t.jsx)(c.button,{type:"button","aria-controls":l.contentId,"aria-expanded":l.open||!1,"data-state":k(l.open),"data-disabled":l.disabled?"":void 0,disabled:l.disabled,...o,ref:r,onClick:(0,a.composeEventHandlers)(e.onClick,l.onOpenToggle)})});v.displayName=x;var y="CollapsibleContent",b=r.forwardRef((e,r)=>{let{forceMount:a,...s}=e,o=g(y,e.__scopeCollapsible);return(0,t.jsx)(d.Presence,{present:a||o.open,children:({present:e})=>(0,t.jsx)(_,{...s,ref:r,present:e})})});b.displayName=y;var _=r.forwardRef((e,a)=>{let{__scopeCollapsible:s,present:n,children:i,...d}=e,u=g(y,s),[p,m]=r.useState(n),h=r.useRef(null),f=(0,l.useComposedRefs)(a,h),w=r.useRef(0),x=w.current,v=r.useRef(0),b=v.current,_=u.open||p,j=r.useRef(_),S=r.useRef(void 0);return r.useEffect(()=>{let e=requestAnimationFrame(()=>j.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,o.useLayoutEffect)(()=>{let e=h.current;if(e){S.current=S.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let t=e.getBoundingClientRect();w.current=t.height,v.current=t.width,j.current||(e.style.transitionDuration=S.current.transitionDuration,e.style.animationName=S.current.animationName),m(n)}},[u.open,n]),(0,t.jsx)(c.div,{"data-state":k(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!_,...d,ref:f,style:{"--radix-collapsible-content-height":x?`${x}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:_&&i})});function k(e){return e?"open":"closed"}function j({...e}){return(0,t.jsx)(w,{"data-slot":"collapsible",...e})}function S({...e}){return(0,t.jsx)(v,{"data-slot":"collapsible-trigger",...e})}function N({...e}){return(0,t.jsx)(b,{"data-slot":"collapsible-content",...e})}e.s(["Collapsible",()=>j,"CollapsibleContent",()=>N,"CollapsibleTrigger",()=>S],11369)},56505,e=>{"use strict";let t=(0,e.i(75254).default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);e.s(["PlayIcon",()=>t],56505)},19036,e=>{"use strict";var t=e.i(43476),r=e.i(71645),a=e.i(81140),s=e.i(20783),o=e.i(69340),l=e.i(99682),n=e.i(35804);e.i(74080);var i=Symbol("radix.slottable");function c(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===i}var d=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,a)=>{var o,l;let n,i,d,u=(l=o=`Primitive.${a}`,(n=r.forwardRef((e,t)=>{let{children:a,...o}=e;if(r.isValidElement(a)){var l;let e,n,i=(l=a,(n=(e=Object.getOwnPropertyDescriptor(l.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?l.ref:(n=(e=Object.getOwnPropertyDescriptor(l,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?l.props.ref:l.props.ref||l.ref),c=function(e,t){let r={...t};for(let a in t){let s=e[a],o=t[a];/^on[A-Z]/.test(a)?s&&o?r[a]=(...e)=>{let t=o(...e);return s(...e),t}:s&&(r[a]=s):"style"===a?r[a]={...s,...o}:"className"===a&&(r[a]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}(o,a.props);return a.type!==r.Fragment&&(c.ref=t?(0,s.composeRefs)(t,i):i),r.cloneElement(a,c)}return r.Children.count(a)>1?r.Children.only(null):null})).displayName=`${l}.SlotClone`,i=n,(d=r.forwardRef((e,a)=>{let{children:s,...o}=e,l=r.Children.toArray(s),n=l.find(c);if(n){let e=n.props.children,s=l.map(t=>t!==n?t:r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null);return(0,t.jsx)(i,{...o,ref:a,children:r.isValidElement(e)?r.cloneElement(e,void 0,s):null})}return(0,t.jsx)(i,{...o,ref:a,children:s})})).displayName=`${o}.Slot`,d),p=r.forwardRef((e,r)=>{let{asChild:s,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(s?u:a,{...o,ref:r})});return p.displayName=`Primitive.${a}`,{...e,[a]:p}},{}),u="Switch",[p,m]=function(e,a=[]){let s=[],o=()=>{let t=s.map(e=>r.createContext(e));return function(a){let s=a?.[e]||t;return r.useMemo(()=>({[`__scope${e}`]:{...a,[e]:s}}),[a,s])}};return o.scopeName=e,[function(a,o){let l=r.createContext(o),n=s.length;s=[...s,o];let i=a=>{let{scope:s,children:o,...i}=a,c=s?.[e]?.[n]||l,d=r.useMemo(()=>i,Object.values(i));return(0,t.jsx)(c.Provider,{value:d,children:o})};return i.displayName=a+"Provider",[i,function(t,s){let i=s?.[e]?.[n]||l,c=r.useContext(i);if(c)return c;if(void 0!==o)return o;throw Error(`\`${t}\` must be used within \`${a}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let a=()=>{let a=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let s=a.reduce((t,{useScope:r,scopeName:a})=>{let s=r(e)[`__scope${a}`];return{...t,...s}},{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return a.scopeName=t.scopeName,a}(o,...a)]}(u),[h,f]=p(u),g=r.forwardRef((e,l)=>{let{__scopeSwitch:n,name:i,checked:c,defaultChecked:p,required:m,disabled:f,value:g="on",onCheckedChange:w,form:x,...b}=e,[_,k]=r.useState(null),j=(0,s.useComposedRefs)(l,e=>k(e)),S=r.useRef(!1),N=!_||x||!!_.closest("form"),[C,D]=(0,o.useControllableState)({prop:c,defaultProp:p??!1,onChange:w,caller:u});return(0,t.jsxs)(h,{scope:n,checked:C,disabled:f,children:[(0,t.jsx)(d.button,{type:"button",role:"switch","aria-checked":C,"aria-required":m,"data-state":y(C),"data-disabled":f?"":void 0,disabled:f,value:g,...b,ref:j,onClick:(0,a.composeEventHandlers)(e.onClick,e=>{D(e=>!e),N&&(S.current=e.isPropagationStopped(),S.current||e.stopPropagation())})}),N&&(0,t.jsx)(v,{control:_,bubbles:!S.current,name:i,value:g,checked:C,required:m,disabled:f,form:x,style:{transform:"translateX(-100%)"}})]})});g.displayName=u;var w="SwitchThumb",x=r.forwardRef((e,r)=>{let{__scopeSwitch:a,...s}=e,o=f(w,a);return(0,t.jsx)(d.span,{"data-state":y(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:r})});x.displayName=w;var v=r.forwardRef(({__scopeSwitch:e,control:a,checked:o,bubbles:i=!0,...c},d)=>{let u=r.useRef(null),p=(0,s.useComposedRefs)(u,d),m=(0,l.usePrevious)(o),h=(0,n.useSize)(a);return r.useEffect(()=>{let e=u.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(m!==o&&t){let r=new Event("click",{bubbles:i});t.call(e,o),e.dispatchEvent(r)}},[m,o,i]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o,...c,tabIndex:-1,ref:p,style:{...c.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function y(e){return e?"checked":"unchecked"}v.displayName="SwitchBubbleInput";var b=e.i(47163);function _({className:e,...r}){return(0,t.jsx)(g,{"data-slot":"switch",className:(0,b.cn)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-xs transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...r,children:(0,t.jsx)(x,{"data-slot":"switch-thumb",className:(0,b.cn)("pointer-events-none block size-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})})}e.s(["Switch",()=>_],19036)},97239,e=>{"use strict";let t=(0,e.i(75254).default)("triangle-alert",[["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"}]]);e.s(["AlertTriangleIcon",()=>t],97239)},11764,e=>{"use strict";var t=e.i(55161),r=e.i(62280),a=e.i(72536);let s=[{id:1,name:"example.com",data_source:"local",local_path:"/home/user/osmedeus-base/workspaces/example.com",state_execution_log:"/home/user/osmedeus-base/workspaces/example.com/log/execution.log",state_completed_file:"/home/user/osmedeus-base/workspaces/example.com/state/completed",state_workflow_file:"/home/user/osmedeus-base/workspaces/example.com/state/workflow.yaml",state_workflow_folder:"/home/user/osmedeus-base/workspaces/example.com/state",total_assets:150,total_subdomains:1247,total_urls:856,total_vulns:23,vuln_critical:2,vuln_high:5,vuln_medium:8,vuln_low:8,vuln_potential:3,risk_score:7.5,tags:["production","priority"],last_run:new Date(Date.now()-36e5).toISOString(),run_workflow:"subdomain-enum",created_at:"2024-01-15T08:00:00Z",updated_at:new Date(Date.now()-36e5).toISOString()},{id:2,name:"testsite.org",data_source:"cloud",local_path:"/home/user/osmedeus-base/workspaces/testsite.org",state_execution_log:"/home/user/osmedeus-base/workspaces/testsite.org/log/execution.log",state_completed_file:"/home/user/osmedeus-base/workspaces/testsite.org/state/completed",state_workflow_file:"/home/user/osmedeus-base/workspaces/testsite.org/state/workflow.yaml",state_workflow_folder:"/home/user/osmedeus-base/workspaces/testsite.org/state",total_assets:50,total_subdomains:342,total_urls:189,total_vulns:7,vuln_critical:0,vuln_high:1,vuln_medium:3,vuln_low:3,vuln_potential:2,risk_score:4.2,tags:["staging"],last_run:new Date(Date.now()-864e5).toISOString(),run_workflow:"port-scan",created_at:"2024-02-20T12:00:00Z",updated_at:new Date(Date.now()-864e5).toISOString()},{id:3,name:"acme.io",data_source:"imported",local_path:"/home/user/osmedeus-base/workspaces/acme.io",state_execution_log:"/home/user/osmedeus-base/workspaces/acme.io/log/execution.log",state_completed_file:"/home/user/osmedeus-base/workspaces/acme.io/state/completed",state_workflow_file:"/home/user/osmedeus-base/workspaces/acme.io/state/workflow.yaml",state_workflow_folder:"/home/user/osmedeus-base/workspaces/acme.io/state",total_assets:320,total_subdomains:2156,total_urls:1432,total_vulns:45,vuln_critical:5,vuln_high:12,vuln_medium:15,vuln_low:13,vuln_potential:8,risk_score:8.8,tags:["production","critical"],last_run:new Date(Date.now()-1728e5).toISOString(),run_workflow:"full-scan",created_at:"2024-03-10T10:00:00Z",updated_at:new Date(Date.now()-1728e5).toISOString()},{id:4,name:"secure.bank.com",data_source:"local",local_path:"/home/user/osmedeus-base/workspaces/secure.bank.com",state_execution_log:"/home/user/osmedeus-base/workspaces/secure.bank.com/log/execution.log",state_completed_file:"/home/user/osmedeus-base/workspaces/secure.bank.com/state/completed",state_workflow_file:"/home/user/osmedeus-base/workspaces/secure.bank.com/state/workflow.yaml",state_workflow_folder:"/home/user/osmedeus-base/workspaces/secure.bank.com/state",total_assets:80,total_subdomains:567,total_urls:312,total_vulns:12,vuln_critical:1,vuln_high:2,vuln_medium:5,vuln_low:4,vuln_potential:0,risk_score:5.5,tags:["finance","priority"],last_run:new Date(Date.now()-432e5).toISOString(),run_workflow:"vuln-scan",created_at:"2024-04-05T09:00:00Z",updated_at:new Date(Date.now()-432e5).toISOString()},{id:5,name:"startup.dev",data_source:"cloud",local_path:"/home/user/osmedeus-base/workspaces/startup.dev",state_execution_log:"/home/user/osmedeus-base/workspaces/startup.dev/log/execution.log",state_completed_file:"/home/user/osmedeus-base/workspaces/startup.dev/state/completed",state_workflow_file:"/home/user/osmedeus-base/workspaces/startup.dev/state/workflow.yaml",state_workflow_folder:"/home/user/osmedeus-base/workspaces/startup.dev/state",total_assets:20,total_subdomains:89,total_urls:45,total_vulns:3,vuln_critical:0,vuln_high:0,vuln_medium:1,vuln_low:2,vuln_potential:5,risk_score:2.1,tags:["development"],last_run:new Date(Date.now()-6048e5).toISOString(),run_workflow:"quick-scan",created_at:"2024-05-01T14:00:00Z",updated_at:new Date(Date.now()-6048e5).toISOString()},{id:6,name:"megacorp.com",data_source:"local",local_path:"/home/user/osmedeus-base/workspaces/megacorp.com",state_execution_log:"/home/user/osmedeus-base/workspaces/megacorp.com/log/execution.log",state_completed_file:"/home/user/osmedeus-base/workspaces/megacorp.com/state/completed",state_workflow_file:"/home/user/osmedeus-base/workspaces/megacorp.com/state/workflow.yaml",state_workflow_folder:"/home/user/osmedeus-base/workspaces/megacorp.com/state",total_assets:890,total_subdomains:8934,total_urls:4521,total_vulns:89,vuln_critical:8,vuln_high:22,vuln_medium:35,vuln_low:24,vuln_potential:15,risk_score:9.2,tags:["enterprise","production","critical"],last_run:new Date(Date.now()-2592e5).toISOString(),run_workflow:"full-scan",created_at:"2024-01-01T08:00:00Z",updated_at:new Date(Date.now()-2592e5).toISOString()},{id:7,name:"shop.retail.com",data_source:"imported",local_path:"/home/user/osmedeus-base/workspaces/shop.retail.com",state_execution_log:"/home/user/osmedeus-base/workspaces/shop.retail.com/log/execution.log",state_completed_file:"/home/user/osmedeus-base/workspaces/shop.retail.com/state/completed",state_workflow_file:"/home/user/osmedeus-base/workspaces/shop.retail.com/state/workflow.yaml",state_workflow_folder:"/home/user/osmedeus-base/workspaces/shop.retail.com/state",total_assets:45,total_subdomains:234,total_urls:167,total_vulns:5,vuln_critical:0,vuln_high:1,vuln_medium:2,vuln_low:2,vuln_potential:3,risk_score:3.5,tags:["retail","staging"],last_run:new Date(Date.now()-6e5).toISOString(),run_workflow:"subdomain-enum",created_at:"2024-06-15T11:00:00Z",updated_at:new Date(Date.now()-6e5).toISOString()}];function o(e,t){let r=["api","www","mail","admin","dashboard","app","cdn","static","dev","staging","test","beta","secure","auth","login","portal","shop","store","blog","docs","support","help","status","monitor"],a=["Welcome to Our API","Admin Dashboard","Login Portal","Documentation","Help Center","Status Page","Application Home","Secure Portal",void 0,"Blog","Store","Developer Portal"],s=[200,200,200,200,301,302,403,404,500,200,200,200],o=[];for(let l=0;l<t;l++){let t=r[l%r.length],n=s[l%s.length],i=`https://${t}.example.com${l>0?`/path-${l}`:""}`;o.push({id:`asset-${e}-${l.toString().padStart(4,"0")}`,workspace:e,assetValue:`${t}.example.com`,url:i,input:`${t}.example.com`,scheme:"https",method:"GET",path:l>0?`/path-${l}`:"/",statusCode:n,contentType:200===n?"text/html; charset=utf-8":"",contentLength:Math.floor(5e5*Math.random())+1e3,title:200===n?a[l%a.length]:void 0,words:Math.floor(5e3*Math.random())+100,lines:Math.floor(500*Math.random())+10,hostIp:`192.168.${Math.floor(255*Math.random())}.${Math.floor(255*Math.random())}`,aRecords:[`192.168.${Math.floor(255*Math.random())}.${Math.floor(255*Math.random())}`],tls:"TLS 1.3",assetType:"web",technologies:200===n?["nginx","React","Node.js"].slice(0,Math.floor(3*Math.random())+1):[],responseTime:`${Math.floor(500*Math.random())+50}ms`,source:"httpx",createdAt:new Date(Date.now()-Math.floor(7*Math.random()*864e5)),updatedAt:new Date(Date.now()-Math.floor(3*Math.random()*864e5))})}return o}let l={"ws-001":o("ws-001",856),"ws-002":o("ws-002",189),"ws-003":o("ws-003",1432),"ws-004":o("ws-004",312),"ws-005":o("ws-005",45),"ws-006":o("ws-006",4521),"ws-007":o("ws-007",167)};async function n(e={}){return(await i(e)).items}async function i(e={}){if((0,a.isDemoMode)()){let t=s.map(e=>c(e)),r=e.search?.trim().toLowerCase(),a=e.data_source?.trim().toLowerCase(),o=r?t.filter(e=>!!(e.name.toLowerCase().includes(r)||e.local_path.toLowerCase().includes(r)||e.data_source?.toLowerCase().includes(r))||e.tags.some(e=>e.toLowerCase().includes(r))):t,l=a&&"all"!==a?o.filter(e=>(e.data_source??"").toLowerCase()===a):o,n="number"==typeof e.offset?e.offset:0,i="number"==typeof e.limit?e.limit:l.length;return{items:l.slice(n,n+i),pagination:{total:l.length,offset:n,limit:i},mode:e.filesystem?"filesystem":"database"}}let o={};"number"==typeof e.offset&&(o.offset=e.offset),"number"==typeof e.limit&&(o.limit=e.limit),e.search&&(o.search=e.search),e.filesystem&&(o.filesystem=!0),e.data_source&&(o.data_source=e.data_source);let l=(await t.http.get(`${r.API_PREFIX}/workspaces`,{params:o})).data||{},n=Array.isArray(l.data)?l.data:Array.isArray(l.items)?l.items:[],d=l.pagination||l.meta?.pagination||{},u=d.total??d.totalItems,p=d.offset,m=d.limit,h=d.page,f=d.pageSize,g=void 0!==p?p:"number"==typeof h&&"number"==typeof f?Math.max(0,(h-1)*f):"number"==typeof e.offset?e.offset:0,w=void 0!==m?m:"number"==typeof f?f:"number"==typeof e.limit?e.limit:n.length,x=Number(u);return{items:n.map(c),pagination:{total:Number.isFinite(x)?x:n.length,offset:Number(g)||0,limit:Number(w)||n.length},mode:l.mode??l.meta?.mode??(e.filesystem?"filesystem":"database")}}function c(e){return{id:Number(e?.id??e?.workspace_id??0)||0,name:String(e?.name??e?.workspace??e?.target??""),data_source:"string"==typeof e?.data_source?e.data_source:"string"==typeof e?.dataSource?e.dataSource:void 0,local_path:String(e?.local_path??e?.workspace_path??e?.path??""),total_assets:Number(e?.total_assets??e?.assets_total??e?.assets?.total??0)||0,total_subdomains:Number(e?.total_subdomains??e?.subdomains_total??e?.subdomains?.total??0)||0,total_urls:Number(e?.total_urls??e?.urls_total??e?.http_assets_total??e?.http_assets?.total??0)||0,total_vulns:Number(e?.total_vulns??e?.vulns_total??e?.vulnerabilities?.total??0)||0,vuln_critical:Number(e?.vuln_critical??e?.vulnerabilities?.critical??0)||0,vuln_high:Number(e?.vuln_high??e?.vulnerabilities?.high??0)||0,vuln_medium:Number(e?.vuln_medium??e?.vulnerabilities?.medium??0)||0,vuln_low:Number(e?.vuln_low??e?.vulnerabilities?.low??0)||0,vuln_potential:Number(e?.vuln_potential??e?.vulnerabilities?.potential??e?.vulnerabilities?.info??0)||0,risk_score:Number(e?.risk_score??e?.risk?.score??e?.score??0)||0,tags:Array.isArray(e?.tags)?e.tags:Array.isArray(e?.labels)?e.labels:[],last_run:String(e?.last_run??e?.last_scan??e?.latest_run_at??e?.last_run_at??""),run_workflow:String(e?.run_workflow??e?.last_workflow??e?.workflow??""),state_execution_log:"string"==typeof e?.state_execution_log?e.state_execution_log:"string"==typeof e?.state?.execution_log?e.state.execution_log:void 0,state_completed_file:"string"==typeof e?.state_completed_file?e.state_completed_file:"string"==typeof e?.state?.completed_file?e.state.completed_file:void 0,state_workflow_file:"string"==typeof e?.state_workflow_file?e.state_workflow_file:"string"==typeof e?.state?.workflow_file?e.state.workflow_file:void 0,state_workflow_folder:"string"==typeof e?.state_workflow_folder?e.state_workflow_folder:"string"==typeof e?.state?.workflow_folder?e.state.workflow_folder:void 0,created_at:String(e?.created_at??e?.createdAt??""),updated_at:String(e?.updated_at??e?.updatedAt??"")}}async function d(e){if((0,a.isDemoMode)()){let t=s.find(t=>String(t.id)===e||t.name===e);return t?c(t):null}try{let a=await t.http.get(`${r.API_PREFIX}/workspaces`,{params:{offset:0,limit:1e3}}),s=(a.data?.data||[]).find(t=>String(t.id)===e||t.name===e);if(!s)return null;return c(s)}catch{return null}}async function u(e,o){let n=o.page??1,i=o.pageSize??20,c=(n-1)*i,d=o.filters??{};if((0,a.isDemoMode)()){let t=(e??"").trim(),r=t?s.find(e=>e.name===t)||s.find(e=>e.name.toLowerCase()===t.toLowerCase()):void 0,a=l[r?`ws-${String(r.id).padStart(3,"0")}`:t.startsWith("ws-")?t:"ws-001"]??[],o=(d.search??"").trim().toLowerCase(),u=new Set(d.statusCodes??[]),p=(d.technologies??[]).map(e=>e.trim().toLowerCase()).filter(Boolean),m=(d.contentTypes??[]).map(e=>e.trim().toLowerCase()).filter(Boolean),h=(d.tlsVersion??"").trim().toLowerCase(),f=(d.location??"").trim().toLowerCase(),g=a.filter(e=>{if(o&&![e.url,e.assetValue,e.title??"",e.hostIp??""].join(" ").toLowerCase().includes(o)||u.size>0&&!u.has(e.statusCode))return!1;if(p.length>0){let t=new Set(e.technologies.map(e=>String(e).trim().toLowerCase()));if(!p.some(e=>t.has(e)))return!1}if(m.length>0){let t=(e.contentType??"").toLowerCase();if(!m.some(e=>t.includes(e)))return!1}return(!h||String(e.tls??"").toLowerCase()===h)&&(!f||!![e.url,e.assetValue,e.hostIp??""].join(" ").toLowerCase().includes(f))&&("number"!=typeof d.minContentLength||!(e.contentLength<d.minContentLength))&&("number"!=typeof d.maxContentLength||!(e.contentLength>d.maxContentLength))}),w=g.slice(c,c+i),x=g.length;return{data:w,pagination:{page:n,pageSize:i,totalItems:x,totalPages:Math.ceil(x/i)}}}let u={offset:c,limit:i};e&&(u.workspace=e),d.search&&(u.search=d.search),d.statusCodes?.length&&(u.status_code=d.statusCodes.join(",")),"number"==typeof d.minContentLength&&(u.min_content_length=d.minContentLength),"number"==typeof d.maxContentLength&&(u.max_content_length=d.maxContentLength),d.location&&(u.location=d.location),d.technologies?.length&&(u.tech=d.technologies.join(",")),d.contentTypes?.length&&(u.content_type=d.contentTypes.join(",")),d.tlsVersion&&(u.tls=d.tlsVersion);let p=await t.http.get(`${r.API_PREFIX}/assets`,{params:u}),m=(p.data?.data||[]).map(e=>({id:String(e.id??e.url),workspace:e.workspace??"",assetValue:e.asset_value??"",url:e.url??"",input:e.input??"",scheme:e.scheme??"",method:e.method??"GET",path:e.path??"/",statusCode:e.status_code??0,contentType:e.content_type??"",contentLength:e.content_length??0,title:e.title,words:e.words??0,lines:e.lines??0,hostIp:e.host_ip,aRecords:e.a??[],tls:e.tls,assetType:e.asset_type??"web",technologies:e.tech??[],responseTime:e.time,remarks:e.remarks,source:e.source??"",createdAt:e.created_at?new Date(e.created_at):new Date,updatedAt:e.updated_at?new Date(e.updated_at):new Date})),h=p.data?.pagination?.total??m.length;return{data:m,pagination:{page:n,pageSize:i,totalItems:h,totalPages:Math.ceil(h/i)}}}e.s(["fetchHttpAssets",()=>u,"fetchWorkspace",()=>d,"fetchWorkspaces",()=>n,"fetchWorkspacesList",()=>i],11764)},49200,e=>{"use strict";let t=(0,e.i(75254).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s(["ChevronsUpDownIcon",()=>t],49200)},70065,e=>{"use strict";var t=e.i(43476),r=e.i(47163);function a({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,r.cn)("bg-card/80 backdrop-blur-sm text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm transition-all duration-300 hover:shadow-[0_0_30px_rgba(32,178,170,0.12)] hover:-translate-y-0.5",e),...a})}function s({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,r.cn)("flex flex-col gap-1.5 px-6",e),...a})}function o({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,r.cn)("leading-none font-semibold",e),...a})}function l({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,r.cn)("text-muted-foreground text-sm",e),...a})}function n({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,r.cn)("px-6",e),...a})}function i({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-footer",className:(0,r.cn)("flex items-center px-6",e),...a})}e.s(["Card",()=>a,"CardContent",()=>n,"CardDescription",()=>l,"CardFooter",()=>i,"CardHeader",()=>s,"CardTitle",()=>o])},70152,e=>{"use strict";function t(e,[t,r]){return Math.min(r,Math.max(t,e))}e.s(["clamp",()=>t])},88846,e=>{"use strict";let t=(0,e.i(75254).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["SearchIcon",()=>t],88846)},59377,e=>{"use strict";var t=e.i(43476),r=e.i(71645),a=e.i(81140),s=e.i(20783),o=e.i(26330),l=e.i(3536),n=e.i(65491),i=e.i(10772),c=e.i(53660),d=e.i(74606),u=e.i(96626);function p(e){var a;let o,l=(a=e,(o=r.forwardRef((e,t)=>{let{children:a,...o}=e;if(r.isValidElement(a)){var l;let e,n,i=(l=a,(n=(e=Object.getOwnPropertyDescriptor(l.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?l.ref:(n=(e=Object.getOwnPropertyDescriptor(l,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?l.props.ref:l.props.ref||l.ref),c=function(e,t){let r={...t};for(let a in t){let s=e[a],o=t[a];/^on[A-Z]/.test(a)?s&&o?r[a]=(...e)=>{let t=o(...e);return s(...e),t}:s&&(r[a]=s):"style"===a?r[a]={...s,...o}:"className"===a&&(r[a]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}(o,a.props);return a.type!==r.Fragment&&(c.ref=t?(0,s.composeRefs)(t,i):i),r.cloneElement(a,c)}return r.Children.count(a)>1?r.Children.only(null):null})).displayName=`${a}.SlotClone`,o),n=r.forwardRef((e,a)=>{let{children:s,...o}=e,n=r.Children.toArray(s),i=n.find(h);if(i){let e=i.props.children,s=n.map(t=>t!==i?t:r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null);return(0,t.jsx)(l,{...o,ref:a,children:r.isValidElement(e)?r.cloneElement(e,void 0,s):null})}return(0,t.jsx)(l,{...o,ref:a,children:s})});return n.displayName=`${e}.Slot`,n}e.i(74080);var m=Symbol("radix.slottable");function h(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===m}var f=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,a)=>{let s=p(`Primitive.${a}`),o=r.forwardRef((e,r)=>{let{asChild:o,...l}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(o?s:a,{...l,ref:r})});return o.displayName=`Primitive.${a}`,{...e,[a]:o}},{}),g=e.i(69340),w=e.i(86312),x=e.i(85369),v="Popover",[y,b]=function(e,a=[]){let s=[],o=()=>{let t=s.map(e=>r.createContext(e));return function(a){let s=a?.[e]||t;return r.useMemo(()=>({[`__scope${e}`]:{...a,[e]:s}}),[a,s])}};return o.scopeName=e,[function(a,o){let l=r.createContext(o),n=s.length;s=[...s,o];let i=a=>{let{scope:s,children:o,...i}=a,c=s?.[e]?.[n]||l,d=r.useMemo(()=>i,Object.values(i));return(0,t.jsx)(c.Provider,{value:d,children:o})};return i.displayName=a+"Provider",[i,function(t,s){let i=s?.[e]?.[n]||l,c=r.useContext(i);if(c)return c;if(void 0!==o)return o;throw Error(`\`${t}\` must be used within \`${a}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let a=()=>{let a=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let s=a.reduce((t,{useScope:r,scopeName:a})=>{let s=r(e)[`__scope${a}`];return{...t,...s}},{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return a.scopeName=t.scopeName,a}(o,...a)]}(v,[c.createPopperScope]),_=(0,c.createPopperScope)(),[k,j]=y(v),S=e=>{let{__scopePopover:a,children:s,open:o,defaultOpen:l,onOpenChange:n,modal:d=!1}=e,u=_(a),p=r.useRef(null),[m,h]=r.useState(!1),[f,w]=(0,g.useControllableState)({prop:o,defaultProp:l??!1,onChange:n,caller:v});return(0,t.jsx)(c.Root,{...u,children:(0,t.jsx)(k,{scope:a,contentId:(0,i.useId)(),triggerRef:p,open:f,onOpenChange:w,onOpenToggle:r.useCallback(()=>w(e=>!e),[w]),hasCustomAnchor:m,onCustomAnchorAdd:r.useCallback(()=>h(!0),[]),onCustomAnchorRemove:r.useCallback(()=>h(!1),[]),modal:d,children:s})})};S.displayName=v;var N="PopoverAnchor";r.forwardRef((e,a)=>{let{__scopePopover:s,...o}=e,l=j(N,s),n=_(s),{onCustomAnchorAdd:i,onCustomAnchorRemove:d}=l;return r.useEffect(()=>(i(),()=>d()),[i,d]),(0,t.jsx)(c.Anchor,{...n,...o,ref:a})}).displayName=N;var C="PopoverTrigger",D=r.forwardRef((e,r)=>{let{__scopePopover:o,...l}=e,n=j(C,o),i=_(o),d=(0,s.useComposedRefs)(r,n.triggerRef),u=(0,t.jsx)(f.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":O(n.open),...l,ref:d,onClick:(0,a.composeEventHandlers)(e.onClick,n.onOpenToggle)});return n.hasCustomAnchor?u:(0,t.jsx)(c.Anchor,{asChild:!0,...i,children:u})});D.displayName=C;var I="PopoverPortal",[R,P]=y(I,{forceMount:void 0}),A=e=>{let{__scopePopover:r,forceMount:a,children:s,container:o}=e,l=j(I,r);return(0,t.jsx)(R,{scope:r,forceMount:a,children:(0,t.jsx)(u.Presence,{present:a||l.open,children:(0,t.jsx)(d.Portal,{asChild:!0,container:o,children:s})})})};A.displayName=I;var M="PopoverContent",E=r.forwardRef((e,r)=>{let a=P(M,e.__scopePopover),{forceMount:s=a.forceMount,...o}=e,l=j(M,e.__scopePopover);return(0,t.jsx)(u.Presence,{present:s||l.open,children:l.modal?(0,t.jsx)(L,{...o,ref:r}):(0,t.jsx)(z,{...o,ref:r})})});E.displayName=M;var T=p("PopoverContent.RemoveScroll"),L=r.forwardRef((e,o)=>{let l=j(M,e.__scopePopover),n=r.useRef(null),i=(0,s.useComposedRefs)(o,n),c=r.useRef(!1);return r.useEffect(()=>{let e=n.current;if(e)return(0,w.hideOthers)(e)},[]),(0,t.jsx)(x.RemoveScroll,{as:T,allowPinchZoom:!0,children:(0,t.jsx)($,{...e,ref:i,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,a.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),c.current||l.triggerRef.current?.focus()}),onPointerDownOutside:(0,a.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;c.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,a.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),z=r.forwardRef((e,a)=>{let s=j(M,e.__scopePopover),o=r.useRef(!1),l=r.useRef(!1);return(0,t.jsx)($,{...e,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||s.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,l.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(l.current=!0));let r=t.target;s.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&l.current&&t.preventDefault()}})}),$=r.forwardRef((e,r)=>{let{__scopePopover:a,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:d,disableOutsidePointerEvents:u,onEscapeKeyDown:p,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:f,...g}=e,w=j(M,a),x=_(a);return(0,l.useFocusGuards)(),(0,t.jsx)(n.FocusScope,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:d,children:(0,t.jsx)(o.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:f,onEscapeKeyDown:p,onPointerDownOutside:m,onFocusOutside:h,onDismiss:()=>w.onOpenChange(!1),children:(0,t.jsx)(c.Content,{"data-state":O(w.open),role:"dialog",id:w.contentId,...x,...g,ref:r,style:{...g.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),F="PopoverClose";function O(e){return e?"open":"closed"}r.forwardRef((e,r)=>{let{__scopePopover:s,...o}=e,l=j(F,s);return(0,t.jsx)(f.button,{type:"button",...o,ref:r,onClick:(0,a.composeEventHandlers)(e.onClick,()=>l.onOpenChange(!1))})}).displayName=F,r.forwardRef((e,r)=>{let{__scopePopover:a,...s}=e,o=_(a);return(0,t.jsx)(c.Arrow,{...o,...s,ref:r})}).displayName="PopoverArrow";var V=e.i(47163);function H({...e}){return(0,t.jsx)(S,{"data-slot":"popover",...e})}function W({...e}){return(0,t.jsx)(D,{"data-slot":"popover-trigger",...e})}function q({className:e,align:r="center",sideOffset:a=4,...s}){return(0,t.jsx)(A,{children:(0,t.jsx)(E,{"data-slot":"popover-content",align:r,sideOffset:a,className:(0,V.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...s})})}e.s(["Popover",()=>H,"PopoverContent",()=>q,"PopoverTrigger",()=>W],59377)},79307,e=>{"use strict";let t=(0,e.i(75254).default)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]);e.s(["ListIcon",()=>t],79307)},37007,e=>{"use strict";let t=(0,e.i(75254).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["PlusIcon",()=>t],37007)},68118,e=>{"use strict";let t=(0,e.i(75254).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["InfoIcon",()=>t],68118)},31447,e=>{"use strict";let t=(0,e.i(75254).default)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["ClockIcon",()=>t],31447)},67003,e=>{"use strict";var t=e.i(55161),r=e.i(62280),a=e.i(72536);let s=[{id:"scan-001",runId:"run-2025-01-15-subdomain-enum-example.com",workflowName:"subdomain-enum",workflowKind:"flow",target:"example.com",status:"completed",startedAt:new Date(Date.now()-36e5),completedAt:new Date(Date.now()-18e5),totalSteps:10,completedSteps:10,triggerType:"manual",createdAt:new Date(Date.now()-36e5),updatedAt:new Date(Date.now()-18e5)},{id:"scan-002",runId:"run-2025-01-15-vulnerability-scan-api.example.com",workflowName:"vulnerability-scan",workflowKind:"flow",target:"api.example.com",status:"running",startedAt:new Date(Date.now()-9e5),totalSteps:15,completedSteps:10,triggerType:"manual",createdAt:new Date(Date.now()-9e5),updatedAt:new Date},{id:"scan-003",runId:"run-2025-01-15-full-recon-testsite.org",workflowName:"full-recon",workflowKind:"flow",target:"testsite.org",status:"pending",totalSteps:20,completedSteps:0,triggerType:"scheduled",createdAt:new Date(Date.now()-3e5),updatedAt:new Date(Date.now()-3e5)},{id:"scan-004",runId:"run-2025-01-15-subdomain-enum-acme.io",workflowName:"subdomain-enum",workflowKind:"flow",target:"acme.io",status:"failed",startedAt:new Date(Date.now()-72e5),completedAt:new Date(Date.now()-68e5),totalSteps:10,completedSteps:3,triggerType:"manual",errorMessage:"Connection timeout after 5 retries",createdAt:new Date(Date.now()-72e5),updatedAt:new Date(Date.now()-68e5)},{id:"scan-005",runId:"run-2025-01-14-http-probe-secure.bank.com",workflowName:"http-probe",workflowKind:"module",target:"secure.bank.com",status:"completed",startedAt:new Date(Date.now()-864e5),completedAt:new Date(Date.now()-828e5),totalSteps:5,completedSteps:5,triggerType:"scheduled",createdAt:new Date(Date.now()-864e5),updatedAt:new Date(Date.now()-828e5)},{id:"scan-006",runId:"run-2025-01-13-subdomain-enum-startup.dev",workflowName:"subdomain-enum",workflowKind:"flow",target:"startup.dev",status:"cancelled",startedAt:new Date(Date.now()-1728e5),completedAt:new Date(Date.now()-171e6),totalSteps:10,completedSteps:5,triggerType:"manual",createdAt:new Date(Date.now()-1728e5),updatedAt:new Date(Date.now()-171e6)},{id:"scan-007",runId:"run-2025-01-12-full-recon-megacorp.com",workflowName:"full-recon",workflowKind:"flow",target:"megacorp.com",status:"completed",startedAt:new Date(Date.now()-2592e5),completedAt:new Date(Date.now()-252e6),totalSteps:20,completedSteps:20,triggerType:"manual",createdAt:new Date(Date.now()-2592e5),updatedAt:new Date(Date.now()-252e6)},{id:"scan-008",runId:"run-2025-01-15-vulnerability-scan-shop.retail.com",workflowName:"vulnerability-scan",workflowKind:"flow",target:"shop.retail.com",status:"running",startedAt:new Date(Date.now()-6e5),totalSteps:15,completedSteps:5,triggerType:"manual",createdAt:new Date(Date.now()-6e5),updatedAt:new Date}];function o(e){return{id:String(e.id??e.run_id??""),runId:e.run_id??"",workflowName:e.workflow_name??"",workflowKind:"module"===e.workflow_kind?"module":"flow",target:e.target??"",params:e.params,status:e.status??"pending",workspacePath:e.workspace_path,startedAt:e.started_at?new Date(e.started_at):void 0,completedAt:e.completed_at?new Date(e.completed_at):void 0,totalSteps:e.total_steps??0,completedSteps:e.completed_steps??0,triggerType:e.trigger_type??"manual",triggerName:e.trigger_name,errorMessage:e.error_message,createdAt:e.created_at?new Date(e.created_at):new Date,updatedAt:e.updated_at?new Date(e.updated_at):new Date}}async function l(e){let l=e.page??1,n=e.pageSize??20,i=(l-1)*n,c=e.filters??{};if((0,a.isDemoMode)()){let e=(c.status??"").trim().toLowerCase(),t=(c.workflowName??"").trim().toLowerCase(),r=(c.target??"").trim().toLowerCase(),a=[...s.filter(a=>(!e||"all"===e||String(a.status).toLowerCase()===e)&&(!t||!!a.workflowName.toLowerCase().includes(t))&&(!r||!!a.target.toLowerCase().includes(r)))].sort((e,t)=>{let r=e.startedAt?.getTime()??e.createdAt?.getTime()??0;return(t.startedAt?.getTime()??t.createdAt?.getTime()??0)-r}),o=a.slice(i,i+n),d=a.length;return{data:o,pagination:{page:l,pageSize:n,totalItems:d,totalPages:Math.ceil(d/n)}}}let d={offset:i,limit:n};c.status&&"all"!==c.status&&(d.status=c.status),c.workflowName&&(d.workflow_name=c.workflowName),c.target&&(d.target=c.target);let u=await t.http.get(`${r.API_PREFIX}/runs`,{params:d}),p=(u.data?.data||[]).map(o),m=u.data?.pagination?.total??p.length,h=u.data?.pagination?.limit??n;return{data:p,pagination:{page:Math.floor((u.data?.pagination?.offset??i)/h)+1,pageSize:h,totalItems:m,totalPages:Math.ceil(m/h)}}}async function n(e=5){if((0,a.isDemoMode)())return[...s].sort((e,t)=>{let r=e.startedAt?.getTime()??e.createdAt?.getTime()??0;return(t.startedAt?.getTime()??t.createdAt?.getTime()??0)-r}).slice(0,e);let l=await t.http.get(`${r.API_PREFIX}/runs`,{params:{limit:e,offset:0}});return(l.data?.data||[]).map(o)}async function i(e){if((0,a.isDemoMode)()){let t=new Date,r={id:`scan-${Math.random().toString(16).slice(2,10)}`,runId:`run-demo-${Date.now()}`,workflowName:e.workflowId,workflowKind:e.workflowKind||"flow",target:e.target||(Array.isArray(e.targets)&&e.targets.length>0?e.targets[0]:"")||(e.target_file??""),status:e.schedule?"pending":"running",totalSteps:0,completedSteps:0,triggerType:e.schedule?"scheduled":"manual",createdAt:t,updatedAt:t,startedAt:e.schedule?void 0:t};return s=[r,...s],r}if(e.schedule){let a={name:`scheduled-${e.workflowId}-${Date.now()}`,workflow_name:e.workflowId,workflow_kind:"module"===e.workflowKind?"module":"flow",target:e.target||"",schedule:e.schedule,enabled:!0};return await t.http.post(`${r.API_PREFIX}/schedules`,a),{id:`scan-${Date.now()}`,runId:"",workflowName:e.workflowId,workflowKind:e.workflowKind||"flow",target:e.target||"",status:"pending",totalSteps:0,completedSteps:0,triggerType:"scheduled",createdAt:new Date,updatedAt:new Date}}let o={};return e.workflowId&&("module"===e.workflowKind?o.module=e.workflowId:o.flow=e.workflowId),"number"==typeof e.threads_hold&&(o.threads_hold=e.threads_hold),"string"==typeof e.heuristics_check&&e.heuristics_check.trim()&&(o.heuristics_check=e.heuristics_check.trim()),"boolean"==typeof e.repeat&&(o.repeat=e.repeat),"string"==typeof e.repeat_wait_time&&e.repeat_wait_time.trim()&&(o.repeat_wait_time=e.repeat_wait_time.trim()),e.empty_target&&(o.empty_target=!0),Array.isArray(e.targets)&&e.targets.length>0?(o.targets=e.targets,"number"==typeof e.concurrency&&(o.concurrency=e.concurrency)):e.target_file?(o.target_file=e.target_file,"number"==typeof e.concurrency&&(o.concurrency=e.concurrency)):!e.empty_target&&e.target&&(o.target=e.target),e.params&&Object.keys(e.params).length>0&&(o.params=e.params),e.priority&&(o.priority=e.priority),"number"==typeof e.timeout&&(o.timeout=e.timeout),e.runner_type&&"local"!==e.runner_type&&(o.runner_type=e.runner_type,"docker"===e.runner_type&&e.docker_image&&(o.docker_image=e.docker_image),"ssh"===e.runner_type&&e.ssh_host&&(o.ssh_host=e.ssh_host)),await t.http.post(`${r.API_PREFIX}/runs`,o),{id:`scan-${Date.now()}`,runId:"",workflowName:e.workflowId,workflowKind:e.workflowKind||"flow",target:e.target||(Array.isArray(e.targets)&&e.targets.length>0?e.targets[0]:"")||(e.target_file??""),status:"running",totalSteps:0,completedSteps:0,triggerType:"manual",createdAt:new Date,updatedAt:new Date}}async function c(e){if((0,a.isDemoMode)()){let t=s.findIndex(t=>t.id===e||t.runId===e);if(-1===t)return!1;let r=new Date,a=[...s];return a[t]={...a[t],status:"cancelled",completedAt:a[t].completedAt??r,updatedAt:r},s=a,!0}try{return await t.http.delete(`${r.API_PREFIX}/runs/${encodeURIComponent(e)}`),!0}catch{return!1}}async function d(e){return c(e)}e.s(["cancelScan",()=>c,"createScan",()=>i,"deleteScan",()=>d,"fetchRecentScans",()=>n,"fetchScans",()=>l],67003)},91888,e=>{"use strict";let t=(0,e.i(75254).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2Icon",()=>t],91888)},2202,e=>{"use strict";let t=(0,e.i(75254).default)("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"}]]);e.s(["ServerIcon",()=>t],2202)},68745,e=>{"use strict";var t=e.i(55161),r=e.i(62280),a=e.i(72536);async function s(e){if((0,a.isDemoMode)())return{message:"Demo mode: file upload is a stub",filename:e.name,path:`/tmp/demo/${e.name}`,size:e.size};let s=new FormData;return s.append("file",e),(await t.http.post(`${r.API_PREFIX}/upload-file`,s,{headers:{"Content-Type":"multipart/form-data"}})).data}async function o(e){if((0,a.isDemoMode)())return{message:"Demo mode: workflow upload is a stub",name:e.name.replace(/\.(ya?ml)$/i,""),kind:"flow",path:`/tmp/demo/${e.name}`};let s=new FormData;return s.append("file",e),(await t.http.post(`${r.API_PREFIX}/workflow-upload`,s,{headers:{"Content-Type":"multipart/form-data"}})).data}e.s(["uploadTargetsFile",()=>s,"uploadWorkflowFile",()=>o])},58998,e=>{"use strict";var t=e.i(43476),r=e.i(71645),a=e.i(18566),s=e.i(70065),o=e.i(67881),l=e.i(23750),n=e.i(10708),i=e.i(19036),c=e.i(11369),d=e.i(59377),u=e.i(71435),p=e.i(69035),m=e.i(62870),h=e.i(51673),f=e.i(11764),g=e.i(67003),w=e.i(68745),x=e.i(46696),v=e.i(97882),y=e.i(68118),b=e.i(9797),_=e.i(75254);let k=(0,_.default)("mouse-pointer-2",[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]),j=(0,_.default)("folder",[["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"}]]),S=(0,_.default)("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);var N=e.i(79307);let C=(0,_.default)("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]),D=(0,_.default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]),I=(0,_.default)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);var R=e.i(37007),P=e.i(91888),A=e.i(97239);let M=(0,_.default)("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"}]]),E=(0,_.default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]),T=(0,_.default)("container",[["path",{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z",key:"1t2lqe"}],["path",{d:"M10 21.9V14L2.1 9.1",key:"o7czzq"}],["path",{d:"m10 14 11.9-6.9",key:"zm5e20"}],["path",{d:"M14 19.8v-8.1",key:"159ecu"}],["path",{d:"M18 17.5V9.4",key:"11uown"}]]);var L=e.i(2202);let z=(0,_.default)("calendar-clock",[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]);var $=e.i(31447),F=e.i(95926),O=e.i(56505);let V=(0,_.default)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]),H=(0,_.default)("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]),W=(0,_.default)("bean-off",[["path",{d:"M9 9c-.64.64-1.521.954-2.402 1.165A6 6 0 0 0 8 22a13.96 13.96 0 0 0 9.9-4.1",key:"bq3udt"}],["path",{d:"M10.75 5.093A6 6 0 0 1 22 8c0 2.411-.61 4.68-1.683 6.66",key:"17ccse"}],["path",{d:"M5.341 10.62a4 4 0 0 0 6.487 1.208M10.62 5.341a4.015 4.015 0 0 1 2.039 2.04",key:"18zqgq"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);var q=e.i(49200),X=e.i(78784),B=e.i(88846);function K(){let e=(0,a.useRouter)(),[_,K]=r.useState([]),[U,Z]=r.useState([]),[Y,G]=r.useState(!0),[J,Q]=r.useState(!1),[ee,et]=r.useState(!1),[er,ea]=r.useState(!1),[es,eo]=r.useState(""),[el,en]=r.useState(""),[ei,ec]=r.useState(""),[ed,eu]=r.useState(""),[ep,em]=r.useState("single"),[eh,ef]=r.useState(""),[eg,ew]=r.useState(""),[ex,ev]=r.useState(1),[ey,eb]=r.useState(10),[e_,ek]=r.useState("advanced"),[ej,eS]=r.useState(!0),[eN,eC]=r.useState("2h"),[eD,eI]=r.useState([]),[eR,eP]=r.useState("medium"),[eA,eM]=r.useState(""),[eE,eT]=r.useState("local"),[eL,ez]=r.useState(""),[e$,eF]=r.useState(""),[eO,eV]=r.useState(!1),[eH,eW]=r.useState(""),[eq,eX]=r.useState(null);r.useEffect(()=>{(async()=>{try{let[e,t]=await Promise.all([(0,h.fetchWorkflows)(),(0,f.fetchWorkspaces)()]);K(e),Z(t)}catch(e){console.error("Failed to load data:",e),x.toast.error("Failed to load form data")}finally{G(!1)}})()},[]);let eB=r.useMemo(()=>{let e=es.trim().toLowerCase();return e?_.filter(t=>`${t.name} ${t.kind} ${t.description??""}`.toLowerCase().includes(e)):_},[es,_]),eK=r.useMemo(()=>el?_.find(e=>e.name===el)??null:null,[el,_]),eU=e=>e.trim()?5!==e.trim().split(/\s+/).length?(eX("Cron expression must have 5 parts (minute hour day month weekday)"),!1):(eX(null),!0):(eX("Cron expression is required when scheduling is enabled"),!1),eZ=async t=>{if(t.preventDefault(),!el)return void x.toast.error("Please select a workflow");if("single"===ep){if(!ed.trim())return void x.toast.error("Please enter a target")}else if("multiple"===ep){if(0===eh.split(/\r?\n/).map(e=>e.trim()).filter(e=>!!e).length)return void x.toast.error("Please enter at least one target")}else if("file"===ep&&!eg.trim())return void x.toast.error("Please upload a targets file");if(!eO||eU(eH)){Q(!0);try{let t=_.find(e=>e.name===el),r={workflowId:el,workflowKind:t?.kind||"flow",workspaceId:ei||void 0,schedule:eO?eH.trim():void 0};if(!eO){Number.isFinite(ey)&&ey>0&&(r.threads_hold=ey),r.heuristics_check=e_,r.repeat=ej,ej&&eN.trim()&&(r.repeat_wait_time=eN.trim()),"single"===ep?r.target=ed.trim():"multiple"===ep?(r.targets=eh.split(/\r?\n/).map(e=>e.trim()).filter(e=>!!e),r.concurrency=ex):"file"===ep?(r.target_file=eg.trim(),r.concurrency=ex):"empty"===ep&&(r.empty_target=!0);let e={};eD.forEach(t=>{let r=t.key.trim(),a=t.value.trim();r&&a&&(e[r]=a)}),Object.keys(e).length>0&&(r.params=e),r.priority=eR,""===eA||Number.isNaN(Number(eA))||(r.timeout=Number(eA)),"local"!==eE&&(r.runner_type=eE,"docker"===eE&&eL.trim()&&(r.docker_image=eL.trim()),"ssh"===eE&&e$.trim()&&(r.ssh_host=e$.trim()))}await (0,g.createScan)(r),x.toast.success("Scan started successfully",{description:eO?"Your scan has been scheduled.":"Your scan is now running."}),e.push("/scans")}catch(e){x.toast.error("Failed to start scan",{description:e instanceof Error?e.message:"Please try again."})}finally{Q(!1)}}};return(0,t.jsx)("div",{className:"m-4 lg:m-6",children:(0,t.jsxs)(s.Card,{className:"rounded-xl overflow-hidden",children:[(0,t.jsxs)(s.CardHeader,{className:"border-b pb-4",children:[(0,t.jsx)(s.CardTitle,{children:"Scan Configuration"}),(0,t.jsx)(s.CardDescription,{className:"pb-1",children:"Select a workflow, configure targets and parameters, and optionally schedule the scan"})]}),(0,t.jsx)(s.CardContent,{className:"p-0",children:(0,t.jsxs)("form",{onSubmit:eZ,className:"w-full space-y-6 p-4 lg:p-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-2 text-xs font-medium text-muted-foreground",children:[(0,t.jsx)(k,{className:"size-4"}),"Workflow"]}),(0,t.jsx)(p.Separator,{className:"flex-1"})]}),(0,t.jsxs)("div",{className:"grid gap-4 md:grid-cols-3 md:items-end",children:[(0,t.jsx)("div",{className:"space-y-2 md:col-span-2",children:(0,t.jsxs)(d.Popover,{open:er,onOpenChange:ea,children:[(0,t.jsx)(d.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)(o.Button,{id:"workflow",type:"button",variant:"outline",role:"combobox","aria-label":"Workflow","aria-expanded":er,disabled:Y,className:"w-full justify-between",children:[(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(k,{className:"size-4 text-muted-foreground"}),eK?(0,t.jsxs)("span",{className:"truncate",children:[eK.name," ",(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",eK.kind,")"]})]}):(0,t.jsx)("span",{className:"text-muted-foreground",children:"Select a workflow"})]}),(0,t.jsx)(q.ChevronsUpDownIcon,{className:"size-4 opacity-50"})]})}),(0,t.jsxs)(d.PopoverContent,{className:"w-[--radix-popover-trigger-width] p-0",align:"start",children:[(0,t.jsx)("div",{className:"p-2 border-b",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(B.SearchIcon,{className:"absolute left-2 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(l.Input,{placeholder:"Search workflows...",value:es,onChange:e=>eo(e.target.value),className:"h-8 pl-8"})]})}),(0,t.jsx)(u.ScrollArea,{className:"h-[280px]",children:(0,t.jsxs)("div",{className:"p-2 space-y-1",children:[eB.map(e=>{let r=e.name===el;return(0,t.jsx)("button",{type:"button",onClick:()=>{en(e.name),ea(!1),eo("")},className:"w-full rounded-sm px-2 py-1.5 text-left hover:bg-muted",children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)("span",{className:"mt-0.5 flex size-4 items-center justify-center",children:r?(0,t.jsx)(X.CheckIcon,{className:"size-4"}):null}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"truncate text-sm",children:[e.name," ",(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",e.kind,")"]})]}),e.description?(0,t.jsx)("div",{className:"truncate text-xs text-muted-foreground",children:e.description}):null]})]})},e.name)}),0===eB.length&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No workflows found"})]})})]})]})}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 md:col-span-1",children:[(0,t.jsxs)(n.Label,{htmlFor:"target_mode",className:"flex items-center gap-2 whitespace-nowrap",children:[(0,t.jsx)(S,{className:"size-4 text-muted-foreground"}),"Target Mode"]}),(0,t.jsxs)(m.Select,{value:ep,onValueChange:e=>em(e),children:[(0,t.jsx)(m.SelectTrigger,{id:"target_mode",className:"flex-1 min-w-[220px] md:flex-none md:w-[220px] rounded-full","aria-label":"Target Mode",children:(0,t.jsx)(m.SelectValue,{placeholder:"Select mode"})}),(0,t.jsxs)(m.SelectContent,{children:[(0,t.jsx)(m.SelectItem,{value:"single",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)(S,{className:"size-4 text-muted-foreground"}),"Single"]})}),(0,t.jsx)(m.SelectItem,{value:"multiple",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)(N.ListIcon,{className:"size-4 text-muted-foreground"}),"Multiple"]})}),(0,t.jsx)(m.SelectItem,{value:"file",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)(H,{className:"size-4 text-muted-foreground"}),"From File"]})}),(0,t.jsx)(m.SelectItem,{value:"empty",children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)(W,{className:"size-4 text-muted-foreground"}),"Empty Target"]})})]})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 pt-2",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-2 text-xs font-medium text-muted-foreground",children:[(0,t.jsx)(S,{className:"size-4"}),"Target"]}),(0,t.jsx)(p.Separator,{className:"flex-1"})]}),"single"===ep&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(l.Input,{id:"target",type:"text","aria-label":"Target",placeholder:"example.com",value:ed,onChange:e=>eu(e.target.value),disabled:Y}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Domain or IP address to scan"})]}),"multiple"===ep&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(n.Label,{htmlFor:"targets",className:"flex items-center gap-2",children:[(0,t.jsx)(N.ListIcon,{className:"size-4 text-muted-foreground"}),"Targets (one per line)"]}),(0,t.jsx)("textarea",{id:"targets",value:eh,onChange:e=>ef(e.target.value),className:"min-h-32 w-full rounded-md border bg-background p-2 text-sm",placeholder:"example.com\\ndemo.com"}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)(n.Label,{htmlFor:"concurrency",className:"flex items-center gap-2 whitespace-nowrap",children:[(0,t.jsx)(C,{className:"size-4 text-muted-foreground"}),"Concurrency"]}),(0,t.jsxs)(m.Select,{value:String(ex),onValueChange:e=>ev(Number(e)),children:[(0,t.jsx)(m.SelectTrigger,{id:"concurrency",className:"h-9 w-24",children:(0,t.jsx)(m.SelectValue,{})}),(0,t.jsxs)(m.SelectContent,{children:[(0,t.jsx)(m.SelectItem,{value:"1",children:"1"}),(0,t.jsx)(m.SelectItem,{value:"2",children:"2"}),(0,t.jsx)(m.SelectItem,{value:"3",children:"3"})]})]})]})]}),"file"===ep&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(n.Label,{htmlFor:"file",className:"flex items-center gap-2",children:[(0,t.jsx)(D,{className:"size-4 text-muted-foreground"}),"Upload Targets File"]}),(0,t.jsx)("input",{id:"file",type:"file",accept:".txt",onChange:async e=>{let t=e.target.files?.[0];if(t)try{let e=await (0,w.uploadTargetsFile)(t);ew(e.path),x.toast.success("File uploaded",{description:e.filename})}catch(e){x.toast.error("Upload failed",{description:e instanceof Error?e.message:""})}}}),eg?(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Server path: ",eg]}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Text file with one target per line"}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)(n.Label,{htmlFor:"concurrency-file",className:"flex items-center gap-2 whitespace-nowrap",children:[(0,t.jsx)(C,{className:"size-4 text-muted-foreground"}),"Concurrency"]}),(0,t.jsxs)(m.Select,{value:String(ex),onValueChange:e=>ev(Number(e)),children:[(0,t.jsx)(m.SelectTrigger,{id:"concurrency-file",className:"h-9 w-24",children:(0,t.jsx)(m.SelectValue,{})}),(0,t.jsxs)(m.SelectContent,{children:[(0,t.jsx)(m.SelectItem,{value:"1",children:"1"}),(0,t.jsx)(m.SelectItem,{value:"2",children:"2"}),(0,t.jsx)(m.SelectItem,{value:"3",children:"3"})]})]})]})]}),"empty"===ep&&(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"No target will be sent for this scan"})}),(0,t.jsxs)("div",{className:"flex items-center gap-3 pt-2",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-2 text-xs font-medium text-muted-foreground",children:[(0,t.jsx)(V,{className:"size-4"}),"Extra Configuration"]}),(0,t.jsx)(p.Separator,{className:"flex-1"})]}),(0,t.jsxs)(c.Collapsible,{open:ee,onOpenChange:et,children:[(0,t.jsx)(c.CollapsibleTrigger,{asChild:!0,children:(0,t.jsxs)(o.Button,{type:"button",variant:"outline",className:"w-full justify-between",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)(V,{className:"size-4"}),"Extra Configuration"]}),(0,t.jsx)(b.ChevronDownIcon,{className:`size-4 transition-transform ${ee?"rotate-180":""}`})]})}),(0,t.jsxs)(c.CollapsibleContent,{className:"space-y-6 pt-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(n.Label,{htmlFor:"workspace",className:"flex items-center gap-2",children:[(0,t.jsx)(j,{className:"size-4 text-muted-foreground"}),"Workspace"]}),(0,t.jsxs)(m.Select,{value:ei,onValueChange:e=>{ec(e);let t=U.find(t=>String(t.id)===e);t&&eu(t.name)},disabled:Y,children:[(0,t.jsx)(m.SelectTrigger,{id:"workspace",children:(0,t.jsx)(m.SelectValue,{placeholder:"Optional: Select a workspace to prefill target"})}),(0,t.jsx)(m.SelectContent,{children:U.map(e=>(0,t.jsx)(m.SelectItem,{value:String(e.id),children:(0,t.jsxs)("div",{className:"flex flex-col items-start",children:[(0,t.jsx)("span",{children:e.name}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:e.local_path})]})},e.id))})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(n.Label,{className:"flex items-center gap-2",children:[(0,t.jsx)(I,{className:"size-4 text-muted-foreground"}),"Parameters"]}),(0,t.jsxs)("div",{className:"space-y-2",children:[eD.map((e,r)=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{placeholder:"key",value:e.key,onChange:e=>{let t=eD.slice();t[r]={...t[r],key:e.target.value},eI(t)},className:"w-40"}),(0,t.jsx)(l.Input,{placeholder:"value",value:e.value,onChange:e=>{let t=eD.slice();t[r]={...t[r],value:e.target.value},eI(t)},className:"w-56"}),(0,t.jsxs)(o.Button,{type:"button",variant:"outline",onClick:()=>{let e=eD.slice();e.splice(r,1),eI(e)},children:[(0,t.jsx)(P.Trash2Icon,{className:"mr-2 size-4"}),"Remove"]})]},r)),(0,t.jsxs)(o.Button,{type:"button",variant:"outline",onClick:()=>eI([...eD,{key:"",value:""}]),children:[(0,t.jsx)(R.PlusIcon,{className:"mr-2 size-4"}),"Add Parameter"]})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(n.Label,{htmlFor:"threads_hold",className:"flex items-center gap-2",children:[(0,t.jsx)(C,{className:"size-4 text-muted-foreground"}),"Threads Hold"]}),(0,t.jsx)(l.Input,{id:"threads_hold",type:"number",min:1,placeholder:"10",value:ey,onChange:e=>{let t=Number(e.target.value);eb(Number.isFinite(t)?t:10)},className:"h-9"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(n.Label,{htmlFor:"heuristics_check",className:"flex items-center gap-2",children:[(0,t.jsx)(I,{className:"size-4 text-muted-foreground"}),"Heuristics Check"]}),(0,t.jsxs)(m.Select,{value:e_,onValueChange:e=>ek(e),children:[(0,t.jsx)(m.SelectTrigger,{id:"heuristics_check",className:"h-9",children:(0,t.jsx)(m.SelectValue,{placeholder:"Select mode"})}),(0,t.jsxs)(m.SelectContent,{children:[(0,t.jsx)(m.SelectItem,{value:"basic",children:"basic"}),(0,t.jsx)(m.SelectItem,{value:"advanced",children:"advanced"})]})]})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 rounded-lg border px-3 py-2",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)(n.Label,{htmlFor:"repeat",className:"flex items-center gap-2",children:[(0,t.jsx)(z,{className:"size-4 text-muted-foreground"}),"Repeat"]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Restart scan after waiting time"})]}),(0,t.jsx)(i.Switch,{id:"repeat",checked:ej,onCheckedChange:eS})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(n.Label,{htmlFor:"repeat_wait_time",className:"flex items-center gap-2",children:[(0,t.jsx)($.ClockIcon,{className:"size-4 text-muted-foreground"}),"Repeat Wait Time"]}),(0,t.jsx)(l.Input,{id:"repeat_wait_time",type:"text",placeholder:"2h",value:eN,onChange:e=>eC(e.target.value),disabled:!ej,className:"h-9"})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(n.Label,{htmlFor:"priority",className:"flex items-center gap-2",children:[(0,t.jsx)(A.AlertTriangleIcon,{className:"size-4 text-muted-foreground"}),"Priority"]}),(0,t.jsxs)(m.Select,{value:eR,onValueChange:e=>eP(e),children:[(0,t.jsx)(m.SelectTrigger,{id:"priority",className:"h-9",children:(0,t.jsx)(m.SelectValue,{placeholder:"Select priority"})}),(0,t.jsxs)(m.SelectContent,{children:[(0,t.jsx)(m.SelectItem,{value:"low",children:"low"}),(0,t.jsx)(m.SelectItem,{value:"medium",children:"medium"}),(0,t.jsx)(m.SelectItem,{value:"high",children:"high"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(n.Label,{htmlFor:"timeout",className:"flex items-center gap-2",children:[(0,t.jsx)(M,{className:"size-4 text-muted-foreground"}),"Timeout (seconds)"]}),(0,t.jsx)(l.Input,{id:"timeout",type:"number",min:1,placeholder:"60",value:eA,onChange:e=>eM(""===e.target.value?"":Number(e.target.value)),className:"h-9"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(n.Label,{htmlFor:"runner",className:"flex items-center gap-2",children:[(0,t.jsx)(E,{className:"size-4 text-muted-foreground"}),"Runner Type"]}),(0,t.jsxs)(m.Select,{value:eE,onValueChange:e=>eT(e),children:[(0,t.jsx)(m.SelectTrigger,{id:"runner",className:"h-9",children:(0,t.jsx)(m.SelectValue,{placeholder:"Select runner"})}),(0,t.jsxs)(m.SelectContent,{children:[(0,t.jsx)(m.SelectItem,{value:"local",children:"local"}),(0,t.jsx)(m.SelectItem,{value:"docker",children:"docker"}),(0,t.jsx)(m.SelectItem,{value:"ssh",children:"ssh"})]})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:["docker"===eE&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(n.Label,{htmlFor:"docker_image",className:"flex items-center gap-2",children:[(0,t.jsx)(T,{className:"size-4 text-muted-foreground"}),"Docker Image"]}),(0,t.jsx)(l.Input,{id:"docker_image",type:"text",placeholder:"osmedeus/osmedeus:latest",value:eL,onChange:e=>ez(e.target.value)})]}),"ssh"===eE&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(n.Label,{htmlFor:"ssh_host",className:"flex items-center gap-2",children:[(0,t.jsx)(L.ServerIcon,{className:"size-4 text-muted-foreground"}),"SSH Host"]}),(0,t.jsx)(l.Input,{id:"ssh_host",type:"text",placeholder:"worker1.example.com",value:e$,onChange:e=>eF(e.target.value)})]})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 pt-2",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-2 text-xs font-medium text-muted-foreground",children:[(0,t.jsx)(O.PlayIcon,{className:"size-4"}),"Execute the Scan"]}),(0,t.jsx)(p.Separator,{className:"flex-1"})]}),(0,t.jsxs)("div",{className:"space-y-4 pt-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 min-w-[240px] rounded-lg border border-sky-200/70 bg-sky-50/60 px-3 py-2 dark:border-sky-900/60 dark:bg-sky-950/25",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)(n.Label,{htmlFor:"schedule",className:"flex items-center gap-2 text-sky-900 dark:text-sky-100",children:[(0,t.jsx)(z,{className:"size-4 text-sky-500 dark:text-sky-400"}),"Enable Scheduling"]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Run this scan on a recurring schedule"})]}),(0,t.jsx)(i.Switch,{id:"schedule",checked:eO,onCheckedChange:eV,className:"data-[state=checked]:bg-sky-500 data-[state=unchecked]:bg-sky-200/70 dark:data-[state=unchecked]:bg-sky-950/50 [&_[data-slot=switch-thumb]]:!bg-white"})]}),(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsxs)(o.Button,{type:"button",variant:"outline",onClick:()=>e.push("/scans"),disabled:J,children:[(0,t.jsx)(F.XIcon,{className:"mr-2 size-4"}),"Cancel"]}),(0,t.jsx)(o.Button,{type:"submit",variant:eO?"default":"outline",disabled:J||Y,className:`rounded-full ${eO?"bg-sky-500 text-white hover:bg-sky-600 hover:shadow-[0_0_20px_rgba(14,165,233,0.30)]":"border-yellow-500 text-yellow-700 hover:bg-yellow-500/10 hover:border-yellow-500 hover:shadow-[0_0_15px_rgba(234,179,8,0.35)] dark:border-yellow-400 dark:text-yellow-400 dark:hover:bg-yellow-400/10"}`,children:J?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v.LoaderIcon,{className:"mr-2 size-4 animate-spin"}),"Starting..."]}):eO?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(z,{className:"mr-2 size-4"}),"Schedule Scan"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(O.PlayIcon,{className:"mr-2 size-4"}),"Start Scan"]})})]})]}),eO&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(n.Label,{htmlFor:"cron",className:"flex items-center gap-2",children:[(0,t.jsx)($.ClockIcon,{className:"size-4 text-muted-foreground"}),"Cron Expression"]}),(0,t.jsx)(l.Input,{id:"cron",type:"text",placeholder:"0 0 * * *",value:eH,onChange:e=>{eW(e.target.value),eq&&eU(e.target.value)}}),eq?(0,t.jsx)("p",{className:"text-xs text-destructive",children:eq}):(0,t.jsxs)("div",{className:"flex items-start gap-2 rounded-lg bg-muted p-3",children:[(0,t.jsx)(y.InfoIcon,{className:"size-4 text-muted-foreground shrink-0 mt-0.5"}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground space-y-1",children:[(0,t.jsx)("p",{children:"Format: minute hour day month weekday"}),(0,t.jsx)("p",{children:"Examples:"}),(0,t.jsxs)("ul",{className:"list-disc list-inside",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("code",{className:"bg-background px-1 rounded",children:"0 0 * * *"})," - Daily at midnight"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("code",{className:"bg-background px-1 rounded",children:"0 */6 * * *"})," - Every 6 hours"]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("code",{className:"bg-background px-1 rounded",children:"0 0 * * 0"})," - Weekly on Sunday"]})]})]})]})]})]})]})})]})})}e.s(["default",()=>K],58998)}]);