hackagent-webui 0.5.8.dev45__py3-none-any.whl → 0.5.9.dev46__py3-none-any.whl

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.
Files changed (42) hide show
  1. hackagent_webui/__init__.py +1 -1
  2. hackagent_webui/static/404.html +1 -1
  3. hackagent_webui/static/VERSION +1 -1
  4. hackagent_webui/static/_next/static/chunks/130-ea2c854c99cceb32.js +1 -0
  5. hackagent_webui/static/_next/static/chunks/472-9c35d1aa1a5e3033.js +1 -0
  6. hackagent_webui/static/_next/static/chunks/594-97628408277cbac5.js +1 -0
  7. hackagent_webui/static/_next/static/chunks/924-a6df0b0f1eaa3193.js +1 -0
  8. hackagent_webui/static/_next/static/chunks/928-9af782d87164cac8.js +1 -0
  9. hackagent_webui/static/_next/static/chunks/app/agents/page-601afcbb1d489291.js +1 -0
  10. hackagent_webui/static/_next/static/chunks/app/{layout-efaecd4333ef00dc.js → layout-026360403787aaa4.js} +1 -1
  11. hackagent_webui/static/_next/static/chunks/app/reports/{page-5c5fe914aa4f6b6e.js → page-5c34dba5cdb5c82a.js} +1 -1
  12. hackagent_webui/static/_next/static/chunks/app/stats/page-59e6617db542e2d8.js +1 -0
  13. hackagent_webui/static/_next/static/css/01ff9a760430c5b3.css +1 -0
  14. hackagent_webui/static/agents.html +1 -1
  15. hackagent_webui/static/agents.txt +5 -5
  16. hackagent_webui/static/api-keys.html +1 -1
  17. hackagent_webui/static/api-keys.txt +5 -5
  18. hackagent_webui/static/attacks/builder.html +1 -1
  19. hackagent_webui/static/attacks/builder.txt +5 -5
  20. hackagent_webui/static/attacks.html +1 -1
  21. hackagent_webui/static/attacks.txt +5 -5
  22. hackagent_webui/static/index.html +1 -1
  23. hackagent_webui/static/index.txt +5 -5
  24. hackagent_webui/static/profile.html +1 -1
  25. hackagent_webui/static/profile.txt +5 -5
  26. hackagent_webui/static/reports.html +1 -1
  27. hackagent_webui/static/reports.txt +5 -5
  28. hackagent_webui/static/stats.html +1 -1
  29. hackagent_webui/static/stats.txt +5 -5
  30. {hackagent_webui-0.5.8.dev45.dist-info → hackagent_webui-0.5.9.dev46.dist-info}/METADATA +1 -1
  31. {hackagent_webui-0.5.8.dev45.dist-info → hackagent_webui-0.5.9.dev46.dist-info}/RECORD +34 -34
  32. hackagent_webui/static/_next/static/chunks/472-7be5a19832ac0441.js +0 -1
  33. hackagent_webui/static/_next/static/chunks/701-a112195c75a7cfee.js +0 -1
  34. hackagent_webui/static/_next/static/chunks/889-80b0f84a20daf258.js +0 -1
  35. hackagent_webui/static/_next/static/chunks/9-22df388e4049bb14.js +0 -1
  36. hackagent_webui/static/_next/static/chunks/924-bbaf675cfa822d94.js +0 -1
  37. hackagent_webui/static/_next/static/chunks/app/agents/page-9ae4eb31e2675d8a.js +0 -1
  38. hackagent_webui/static/_next/static/chunks/app/stats/page-2e5ec7e947f6ceb6.js +0 -1
  39. hackagent_webui/static/_next/static/css/ad4ca82c66199e5e.css +0 -1
  40. /hackagent_webui/static/_next/static/{C3j3ir9ytDUgv-14RiTcK → hr-gTAuE62YYpavO4AEWM}/_buildManifest.js +0 -0
  41. /hackagent_webui/static/_next/static/{C3j3ir9ytDUgv-14RiTcK → hr-gTAuE62YYpavO4AEWM}/_ssgManifest.js +0 -0
  42. {hackagent_webui-0.5.8.dev45.dist-info → hackagent_webui-0.5.9.dev46.dist-info}/WHEEL +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[594],{5917:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},24033:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},50803:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]])},59929:(e,t,r)=>{r.d(t,{UC:()=>tI,In:()=>tL,q7:()=>tO,VF:()=>tB,p4:()=>t_,ZL:()=>tD,bL:()=>tk,wn:()=>tF,PP:()=>tW,l9:()=>tA,WT:()=>tT,LM:()=>tM});var n,l,o=r(12115),i=r(47650),a=r(34212),s=r(92556),u=r(97239),c=r(97999),d=r(69023),f=r(3468),p=r(94446),h=r(95155);function v(e){let t=function(e){let t=o.forwardRef((e,t)=>{var r,n,l;let i,a,{children:s,...u}=e,c=o.isValidElement(s)?(a=(i=null==(n=Object.getOwnPropertyDescriptor((r=s).props,"ref"))?void 0:n.get)&&"isReactWarning"in i&&i.isReactWarning)?r.ref:(a=(i=null==(l=Object.getOwnPropertyDescriptor(r,"ref"))?void 0:l.get)&&"isReactWarning"in i&&i.isReactWarning)?r.props.ref:r.props.ref||r.ref:void 0,d=(0,p.s)(c,t);if(o.isValidElement(s)){let e=function(e,t){let r={...t};for(let n in t){let l=e[n],o=t[n];/^on[A-Z]/.test(n)?l&&o?r[n]=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let n=o(...t);return l(...t),n}:l&&(r[n]=l):"style"===n?r[n]={...l,...o}:"className"===n&&(r[n]=[l,o].filter(Boolean).join(" "))}return{...e,...r}}(u,s.props);return s.type!==o.Fragment&&(e.ref=d),o.cloneElement(s,e)}return o.Children.count(s)>1?o.Children.only(null):null});return t.displayName="".concat(e,".SlotClone"),t}(e),r=o.forwardRef((e,r)=>{let{children:n,...l}=e,i=o.Children.toArray(n),a=i.find(y);if(a){let e=a.props.children,n=i.map(t=>t!==a?t:o.Children.count(e)>1?o.Children.only(null):o.isValidElement(e)?e.props.children:null);return(0,h.jsx)(t,{...l,ref:r,children:o.isValidElement(e)?o.cloneElement(e,void 0,n):null})}return(0,h.jsx)(t,{...l,ref:r,children:n})});return r.displayName="".concat(e,".Slot"),r}var m=Symbol("radix.slottable");function y(e){return o.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===m}var g=new WeakMap;function w(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let r=function(e,t){let r=e.length,n=x(t),l=n>=0?n:r+n;return l<0||l>=r?-1:l}(e,t);return -1===r?void 0:e[r]}function x(e){return e!=e||0===e?0:Math.trunc(e)}n=new WeakMap,class e extends Map{set(e,t){return g.get(this)&&(this.has(e)?(0,u._)(this,n)[(0,u._)(this,n).indexOf(e)]=e:(0,u._)(this,n).push(e)),super.set(e,t),this}insert(e,t,r){let l,o=this.has(t),i=(0,u._)(this,n).length,a=x(e),s=a>=0?a:i+a,c=s<0||s>=i?-1:s;if(c===this.size||o&&c===this.size-1||-1===c)return this.set(t,r),this;let d=this.size+ +!o;a<0&&s++;let f=[...(0,u._)(this,n)],p=!1;for(let e=s;e<d;e++)if(s===e){let n=f[e];f[e]===t&&(n=f[e+1]),o&&this.delete(t),l=this.get(n),this.set(t,r)}else{p||f[e-1]!==t||(p=!0);let r=f[p?e:e-1],n=l;l=this.get(r),this.delete(r),this.set(r,n)}return this}with(t,r,n){let l=new e(this);return l.insert(t,r,n),l}before(e){let t=(0,u._)(this,n).indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let l=(0,u._)(this,n).indexOf(e);return -1===l?this:this.insert(l,t,r)}after(e){let t=(0,u._)(this,n).indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let l=(0,u._)(this,n).indexOf(e);return -1===l?this:this.insert(l+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return(0,d._)(this,n,[]),super.clear()}delete(e){let t=super.delete(e);return t&&(0,u._)(this,n).splice((0,u._)(this,n).indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=w((0,u._)(this,n),e);if(void 0!==t)return this.get(t)}entryAt(e){let t=w((0,u._)(this,n),e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return(0,u._)(this,n).indexOf(e)}keyAt(e){return w((0,u._)(this,n),e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.at(n)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.keyAt(n)}find(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return n;r++}}findIndex(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return r;r++}return -1}filter(t,r){let n=[],l=0;for(let e of this)Reflect.apply(t,r,[e,l,this])&&n.push(e),l++;return new e(n)}map(t,r){let n=[],l=0;for(let e of this)n.push([e[0],Reflect.apply(t,r,[e,l,this])]),l++;return new e(n)}reduce(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let[n,l]=t,o=0,i=null!=l?l:this.at(0);for(let e of this)i=0===o&&1===t.length?e:Reflect.apply(n,this,[i,e,o,this]),o++;return i}reduceRight(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let[n,l]=t,o=null!=l?l:this.at(-1);for(let e=this.size-1;e>=0;e--){let r=this.at(e);o=e===this.size-1&&1===t.length?r:Reflect.apply(n,this,[o,r,e,this])}return o}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),n=this.get(r);t.set(r,n)}return t}toSpliced(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];let l=[...this.entries()];return l.splice(...r),new e(l)}slice(t,r){let n=new e,l=this.size-1;if(void 0===t)return n;t<0&&(t+=this.size),void 0!==r&&r>0&&(l=r-1);for(let e=t;e<=l;e++){let t=this.keyAt(e),r=this.get(t);n.set(t,r)}return n}every(e,t){let r=0;for(let n of this){if(!Reflect.apply(e,t,[n,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return!0;r++}return!1}constructor(e){super(e),(0,c._)(this,n,{writable:!0,value:void 0}),(0,d._)(this,n,[...super.keys()]),g.set(this,!0)}};var b=r(66218),E=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=v(`Primitive.${t}`),n=o.forwardRef((e,n)=>{let{asChild:l,...o}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,h.jsx)(l?r:t,{...o,ref:n})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),C=r(70222),S=r(59584),R="dismissableLayer.update",P=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),N=o.forwardRef((e,t)=>{var r,n;let{disableOutsidePointerEvents:i=!1,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:c,onInteractOutside:d,onDismiss:f,...v}=e,m=o.useContext(P),[y,g]=o.useState(null),w=null!=(n=null==y?void 0:y.ownerDocument)?n:null==(r=globalThis)?void 0:r.document,[,x]=o.useState({}),b=(0,p.s)(t,e=>g(e)),N=Array.from(m.layers),[A]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),T=N.indexOf(A),L=y?N.indexOf(y):-1,D=m.layersWithOutsidePointerEventsDisabled.size>0,I=L>=T,M=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null==(t=globalThis)?void 0:t.document,n=(0,C.c)(e),l=o.useRef(!1),i=o.useRef(()=>{});return o.useEffect(()=>{let e=e=>{if(e.target&&!l.current){let t=function(){k("dismissableLayer.pointerDownOutside",n,l,{discrete:!0})},l={originalEvent:e};"touch"===e.pointerType?(r.removeEventListener("click",i.current),i.current=t,r.addEventListener("click",i.current,{once:!0})):t()}else r.removeEventListener("click",i.current);l.current=!1},t=window.setTimeout(()=>{r.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),r.removeEventListener("pointerdown",e),r.removeEventListener("click",i.current)}},[r,n]),{onPointerDownCapture:()=>l.current=!0}}(e=>{let t=e.target,r=[...m.branches].some(e=>e.contains(t));I&&!r&&(null==u||u(e),null==d||d(e),e.defaultPrevented||null==f||f())},w),O=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null==(t=globalThis)?void 0:t.document,n=(0,C.c)(e),l=o.useRef(!1);return o.useEffect(()=>{let e=e=>{e.target&&!l.current&&k("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return r.addEventListener("focusin",e),()=>r.removeEventListener("focusin",e)},[r,n]),{onFocusCapture:()=>l.current=!0,onBlurCapture:()=>l.current=!1}}(e=>{let t=e.target;![...m.branches].some(e=>e.contains(t))&&(null==c||c(e),null==d||d(e),e.defaultPrevented||null==f||f())},w);return(0,S.U)(e=>{L===m.layers.size-1&&(null==a||a(e),!e.defaultPrevented&&f&&(e.preventDefault(),f()))},w),o.useEffect(()=>{if(y)return i&&(0===m.layersWithOutsidePointerEventsDisabled.size&&(l=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(y)),m.layers.add(y),j(),()=>{i&&1===m.layersWithOutsidePointerEventsDisabled.size&&(w.body.style.pointerEvents=l)}},[y,w,i,m]),o.useEffect(()=>()=>{y&&(m.layers.delete(y),m.layersWithOutsidePointerEventsDisabled.delete(y),j())},[y,m]),o.useEffect(()=>{let e=()=>x({});return document.addEventListener(R,e),()=>document.removeEventListener(R,e)},[]),(0,h.jsx)(E.div,{...v,ref:b,style:{pointerEvents:D?I?"auto":"none":void 0,...e.style},onFocusCapture:(0,s.m)(e.onFocusCapture,O.onFocusCapture),onBlurCapture:(0,s.m)(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:(0,s.m)(e.onPointerDownCapture,M.onPointerDownCapture)})});function j(){let e=new CustomEvent(R);document.dispatchEvent(e)}function k(e,t,r,n){let{discrete:l}=n,o=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});if(t&&o.addEventListener(e,t,{once:!0}),l)o&&i.flushSync(()=>o.dispatchEvent(a));else o.dispatchEvent(a)}N.displayName="DismissableLayer",o.forwardRef((e,t)=>{let r=o.useContext(P),n=o.useRef(null),l=(0,p.s)(t,n);return o.useEffect(()=>{let e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,h.jsx)(E.div,{...e,ref:l})}).displayName="DismissableLayerBranch";var A=r(19526),T="focusScope.autoFocusOnMount",L="focusScope.autoFocusOnUnmount",D={bubbles:!1,cancelable:!0},I=o.forwardRef((e,t)=>{let{loop:r=!1,trapped:n=!1,onMountAutoFocus:l,onUnmountAutoFocus:i,...a}=e,[s,u]=o.useState(null),c=(0,C.c)(l),d=(0,C.c)(i),f=o.useRef(null),v=(0,p.s)(t,e=>u(e)),m=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(n){let e=function(e){if(m.paused||!s)return;let t=e.target;s.contains(t)?f.current=t:_(f.current,{select:!0})},t=function(e){if(m.paused||!s)return;let t=e.relatedTarget;null!==t&&(s.contains(t)||_(f.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let r=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&_(s)});return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[n,s,m.paused]),o.useEffect(()=>{if(s){B.add(m);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(T,D);s.addEventListener(T,c),s.dispatchEvent(t),t.defaultPrevented||(function(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=document.activeElement;for(let n of e)if(_(n,{select:t}),document.activeElement!==r)return}(M(s).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&_(s))}return()=>{s.removeEventListener(T,c),setTimeout(()=>{let t=new CustomEvent(L,D);s.addEventListener(L,d),s.dispatchEvent(t),t.defaultPrevented||_(null!=e?e:document.body,{select:!0}),s.removeEventListener(L,d),B.remove(m)},0)}}},[s,c,d,m]);let y=o.useCallback(e=>{if(!r&&!n||m.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,l=document.activeElement;if(t&&l){let t=e.currentTarget,[n,o]=function(e){let t=M(e);return[O(t,e),O(t.reverse(),e)]}(t);n&&o?e.shiftKey||l!==o?e.shiftKey&&l===n&&(e.preventDefault(),r&&_(o,{select:!0})):(e.preventDefault(),r&&_(n,{select:!0})):l===t&&e.preventDefault()}},[r,n,m.paused]);return(0,h.jsx)(E.div,{tabIndex:-1,...a,ref:v,onKeyDown:y})});function M(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function O(e,t){for(let r of e)if(!function(e,t){let{upTo:r}=t;if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===r||e!==r);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(r,{upTo:t}))return r}function _(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e&&e.focus){var r;let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&(r=e)instanceof HTMLInputElement&&"select"in r&&t&&e.select()}}I.displayName="FocusScope";var B=function(){let e=[];return{add(t){let r=e[0];t!==r&&(null==r||r.pause()),(e=W(e,t)).unshift(t)},remove(t){var r;null==(r=(e=W(e,t))[0])||r.resume()}}}();function W(e,t){let r=[...e],n=r.indexOf(t);return -1!==n&&r.splice(n,1),r}var F=r(68946),H=r(88334),z=r(58146),V=o.forwardRef((e,t)=>{let{children:r,width:n=10,height:l=5,...o}=e;return(0,h.jsx)(E.svg,{...o,ref:t,width:n,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,h.jsx)("polygon",{points:"0,0 30,0 15,10"})})});V.displayName="Arrow";var K=r(4129),U=r(84288),X="Popper",[Y,q]=(0,f.A)(X),[Z,$]=Y(X),G=e=>{let{__scopePopper:t,children:r}=e,[n,l]=o.useState(null);return(0,h.jsx)(Z,{scope:t,anchor:n,onAnchorChange:l,children:r})};G.displayName=X;var J="PopperAnchor",Q=o.forwardRef((e,t)=>{let{__scopePopper:r,virtualRef:n,...l}=e,i=$(J,r),a=o.useRef(null),s=(0,p.s)(t,a);return o.useEffect(()=>{i.onAnchorChange((null==n?void 0:n.current)||a.current)}),n?null:(0,h.jsx)(E.div,{...l,ref:s})});Q.displayName=J;var ee="PopperContent",[et,er]=Y(ee),en=o.forwardRef((e,t)=>{var r,n,l,i,a,s,u,c;let{__scopePopper:d,side:f="bottom",sideOffset:v=0,align:m="center",alignOffset:y=0,arrowPadding:g=0,avoidCollisions:w=!0,collisionBoundary:x=[],collisionPadding:b=0,sticky:S="partial",hideWhenDetached:R=!1,updatePositionStrategy:P="optimized",onPlaced:N,...j}=e,k=$(ee,d),[A,T]=o.useState(null),L=(0,p.s)(t,e=>T(e)),[D,I]=o.useState(null),M=(0,U.X)(D),O=null!=(u=null==M?void 0:M.width)?u:0,_=null!=(c=null==M?void 0:M.height)?c:0,B="number"==typeof b?b:{top:0,right:0,bottom:0,left:0,...b},W=Array.isArray(x)?x:[x],F=W.length>0,V={padding:B,boundary:W.filter(ea),altBoundary:F},{refs:X,floatingStyles:Y,placement:q,isPositioned:Z,middlewareData:G}=(0,H.we)({strategy:"fixed",placement:f+("center"!==m?"-"+m:""),whileElementsMounted:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,z.ll)(...t,{animationFrame:"always"===P})},elements:{reference:k.anchor},middleware:[(0,H.cY)({mainAxis:v+_,alignmentAxis:y}),w&&(0,H.BN)({mainAxis:!0,crossAxis:!1,limiter:"partial"===S?(0,H.ER)():void 0,...V}),w&&(0,H.UU)({...V}),(0,H.Ej)({...V,apply:e=>{let{elements:t,rects:r,availableWidth:n,availableHeight:l}=e,{width:o,height:i}=r.reference,a=t.floating.style;a.setProperty("--radix-popper-available-width","".concat(n,"px")),a.setProperty("--radix-popper-available-height","".concat(l,"px")),a.setProperty("--radix-popper-anchor-width","".concat(o,"px")),a.setProperty("--radix-popper-anchor-height","".concat(i,"px"))}}),D&&(0,H.UE)({element:D,padding:g}),es({arrowWidth:O,arrowHeight:_}),R&&(0,H.jD)({strategy:"referenceHidden",...V})]}),[J,Q]=eu(q),er=(0,C.c)(N);(0,K.N)(()=>{Z&&(null==er||er())},[Z,er]);let en=null==(r=G.arrow)?void 0:r.x,el=null==(n=G.arrow)?void 0:n.y,eo=(null==(l=G.arrow)?void 0:l.centerOffset)!==0,[ei,ec]=o.useState();return(0,K.N)(()=>{A&&ec(window.getComputedStyle(A).zIndex)},[A]),(0,h.jsx)("div",{ref:X.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:Z?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ei,"--radix-popper-transform-origin":[null==(i=G.transformOrigin)?void 0:i.x,null==(a=G.transformOrigin)?void 0:a.y].join(" "),...(null==(s=G.hide)?void 0:s.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,h.jsx)(et,{scope:d,placedSide:J,onArrowChange:I,arrowX:en,arrowY:el,shouldHideArrow:eo,children:(0,h.jsx)(E.div,{"data-side":J,"data-align":Q,...j,ref:L,style:{...j.style,animation:Z?void 0:"none"}})})})});en.displayName=ee;var el="PopperArrow",eo={top:"bottom",right:"left",bottom:"top",left:"right"},ei=o.forwardRef(function(e,t){let{__scopePopper:r,...n}=e,l=er(el,r),o=eo[l.placedSide];return(0,h.jsx)("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:(0,h.jsx)(V,{...n,ref:t,style:{...n.style,display:"block"}})})});function ea(e){return null!==e}ei.displayName=el;var es=e=>({name:"transformOrigin",options:e,fn(t){var r,n,l,o,i;let{placement:a,rects:s,middlewareData:u}=t,c=(null==(r=u.arrow)?void 0:r.centerOffset)!==0,d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[p,h]=eu(a),v={start:"0%",center:"50%",end:"100%"}[h],m=(null!=(o=null==(n=u.arrow)?void 0:n.x)?o:0)+d/2,y=(null!=(i=null==(l=u.arrow)?void 0:l.y)?i:0)+f/2,g="",w="";return"bottom"===p?(g=c?v:"".concat(m,"px"),w="".concat(-f,"px")):"top"===p?(g=c?v:"".concat(m,"px"),w="".concat(s.floating.height+f,"px")):"right"===p?(g="".concat(-f,"px"),w=c?v:"".concat(y,"px")):"left"===p&&(g="".concat(s.floating.width+f,"px"),w=c?v:"".concat(y,"px")),{data:{x:g,y:w}}}});function eu(e){let[t,r="center"]=e.split("-");return[t,r]}var ec=o.forwardRef((e,t)=>{var r,n;let{container:l,...a}=e,[s,u]=o.useState(!1);(0,K.N)(()=>u(!0),[]);let c=l||s&&(null==(n=globalThis)||null==(r=n.document)?void 0:r.body);return c?i.createPortal((0,h.jsx)(E.div,{...a,ref:t}),c):null});ec.displayName="Portal";var ed=r(23558),ef=r(78108),ep=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"});o.forwardRef((e,t)=>(0,h.jsx)(E.span,{...e,ref:t,style:{...ep,...e.style}})).displayName="VisuallyHidden";var eh=r(97745),ev=r(71450),em=r(60216),ey=r(78357),eg=(0,r(43711).f)(),ew=function(){},ex=o.forwardRef(function(e,t){var r=o.useRef(null),n=o.useState({onScrollCapture:ew,onWheelCapture:ew,onTouchMoveCapture:ew}),l=n[0],i=n[1],a=e.forwardProps,s=e.children,u=e.className,c=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noIsolation,v=e.inert,m=e.allowPinchZoom,y=e.as,g=e.gapMode,w=(0,ev.Tt)(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=(0,ey.S)([r,t]),b=(0,ev.Cl)((0,ev.Cl)({},w),l);return o.createElement(o.Fragment,null,d&&o.createElement(p,{sideCar:eg,removeScrollBar:c,shards:f,noIsolation:h,inert:v,setCallbacks:i,allowPinchZoom:!!m,lockRef:r,gapMode:g}),a?o.cloneElement(o.Children.only(s),(0,ev.Cl)((0,ev.Cl)({},b),{ref:x})):o.createElement(void 0===y?"div":y,(0,ev.Cl)({},b,{className:u,ref:x}),s))});ex.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ex.classNames={fullWidth:em.pN,zeroRight:em.Mi};var eb=r(39615),eE=r(46810),eC=r(65841),eS=!1;if("undefined"!=typeof window)try{var eR=Object.defineProperty({},"passive",{get:function(){return eS=!0,!0}});window.addEventListener("test",eR,eR),window.removeEventListener("test",eR,eR)}catch(e){eS=!1}var eP=!!eS&&{passive:!1},eN=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&(r.overflowY!==r.overflowX||"TEXTAREA"===e.tagName||"visible"!==r[t])},ej=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),ek(e,n)){var l=eA(e,n);if(l[1]>l[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},ek=function(e,t){return"v"===e?eN(t,"overflowY"):eN(t,"overflowX")},eA=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},eT=function(e,t,r,n,l){var o,i=(o=window.getComputedStyle(t).direction,"h"===e&&"rtl"===o?-1:1),a=i*n,s=r.target,u=t.contains(s),c=!1,d=a>0,f=0,p=0;do{var h=eA(e,s),v=h[0],m=h[1]-h[2]-i*v;(v||m)&&ek(e,s)&&(f+=m,p+=v),s=s instanceof ShadowRoot?s.host:s.parentNode}while(!u&&s!==document.body||u&&(t.contains(s)||t===s));return d&&(l&&1>Math.abs(f)||!l&&a>f)?c=!0:!d&&(l&&1>Math.abs(p)||!l&&-a>p)&&(c=!0),c},eL=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},eD=function(e){return[e.deltaX,e.deltaY]},eI=function(e){return e&&"current"in e?e.current:e},eM=0,eO=[];let e_=(0,eb.m)(eg,function(e){var t=o.useRef([]),r=o.useRef([0,0]),n=o.useRef(),l=o.useState(eM++)[0],i=o.useState(eC.T0)[0],a=o.useRef(e);o.useEffect(function(){a.current=e},[e]),o.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var t=(0,ev.fX)([e.lockRef.current],(e.shards||[]).map(eI),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var s=o.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!a.current.allowPinchZoom;var l,o=eL(e),i=r.current,s="deltaX"in e?e.deltaX:i[0]-o[0],u="deltaY"in e?e.deltaY:i[1]-o[1],c=e.target,d=Math.abs(s)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var f=ej(d,c);if(!f)return!0;if(f?l=d:(l="v"===d?"h":"v",f=ej(d,c)),!f)return!1;if(!n.current&&"changedTouches"in e&&(s||u)&&(n.current=l),!l)return!0;var p=n.current||l;return eT(p,t,e,"h"===p?s:u,!0)},[]),u=o.useCallback(function(e){if(eO.length&&eO[eO.length-1]===i){var r="deltaY"in e?eD(e):eL(e),n=t.current.filter(function(t){var n;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(n=t.delta,n[0]===r[0]&&n[1]===r[1])})[0];if(n&&n.should){e.cancelable&&e.preventDefault();return}if(!n){var l=(a.current.shards||[]).map(eI).filter(Boolean).filter(function(t){return t.contains(e.target)});(l.length>0?s(e,l[0]):!a.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),c=o.useCallback(function(e,r,n,l){var o={name:e,delta:r,target:n,should:l,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(n)};t.current.push(o),setTimeout(function(){t.current=t.current.filter(function(e){return e!==o})},1)},[]),d=o.useCallback(function(e){r.current=eL(e),n.current=void 0},[]),f=o.useCallback(function(t){c(t.type,eD(t),t.target,s(t,e.lockRef.current))},[]),p=o.useCallback(function(t){c(t.type,eL(t),t.target,s(t,e.lockRef.current))},[]);o.useEffect(function(){return eO.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",u,eP),document.addEventListener("touchmove",u,eP),document.addEventListener("touchstart",d,eP),function(){eO=eO.filter(function(e){return e!==i}),document.removeEventListener("wheel",u,eP),document.removeEventListener("touchmove",u,eP),document.removeEventListener("touchstart",d,eP)}},[]);var h=e.removeScrollBar,v=e.inert;return o.createElement(o.Fragment,null,v?o.createElement(i,{styles:"\n .block-interactivity-".concat(l," {pointer-events: none;}\n .allow-interactivity-").concat(l," {pointer-events: all;}\n")}):null,h?o.createElement(eE.jp,{gapMode:e.gapMode}):null)});var eB=o.forwardRef(function(e,t){return o.createElement(ex,(0,ev.Cl)({},e,{ref:t,sideCar:e_}))});eB.classNames=ex.classNames;var eW=[" ","Enter","ArrowUp","ArrowDown"],eF=[" ","Enter"],eH="Select",[ez,eV,eK]=function(e){let t=e+"CollectionProvider",[r,n]=(0,f.A)(t),[l,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=e=>{let{scope:t,children:r}=e,n=o.useRef(null),i=o.useRef(new Map).current;return(0,h.jsx)(l,{scope:t,itemMap:i,collectionRef:n,children:r})};a.displayName=t;let s=e+"CollectionSlot",u=v(s),c=o.forwardRef((e,t)=>{let{scope:r,children:n}=e,l=i(s,r),o=(0,p.s)(t,l.collectionRef);return(0,h.jsx)(u,{ref:o,children:n})});c.displayName=s;let d=e+"CollectionItemSlot",m="data-radix-collection-item",y=v(d),g=o.forwardRef((e,t)=>{let{scope:r,children:n,...l}=e,a=o.useRef(null),s=(0,p.s)(t,a),u=i(d,r);return o.useEffect(()=>(u.itemMap.set(a,{ref:a,...l}),()=>void u.itemMap.delete(a))),(0,h.jsx)(y,{...{[m]:""},ref:s,children:n})});return g.displayName=d,[{Provider:a,Slot:c,ItemSlot:g},function(t){let r=i(e+"CollectionConsumer",t);return o.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll("[".concat(m,"]")));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},n]}(eH),[eU,eX]=(0,f.A)(eH,[eK,q]),eY=q(),[eq,eZ]=eU(eH),[e$,eG]=eU(eH),eJ=e=>{let{__scopeSelect:t,children:r,open:n,defaultOpen:l,onOpenChange:i,value:a,defaultValue:s,onValueChange:u,dir:c,name:d,autoComplete:f,disabled:p,required:v,form:m}=e,y=eY(t),[g,w]=o.useState(null),[x,E]=o.useState(null),[C,S]=o.useState(!1),R=(0,b.jH)(c),[P,N]=(0,ed.i)({prop:n,defaultProp:null!=l&&l,onChange:i,caller:eH}),[j,k]=(0,ed.i)({prop:a,defaultProp:s,onChange:u,caller:eH}),A=o.useRef(null),T=!g||m||!!g.closest("form"),[L,D]=o.useState(new Set),I=Array.from(L).map(e=>e.props.value).join(";");return(0,h.jsx)(G,{...y,children:(0,h.jsxs)(eq,{required:v,scope:t,trigger:g,onTriggerChange:w,valueNode:x,onValueNodeChange:E,valueNodeHasChildren:C,onValueNodeHasChildrenChange:S,contentId:(0,F.B)(),value:j,onValueChange:k,open:P,onOpenChange:N,dir:R,triggerPointerDownPosRef:A,disabled:p,children:[(0,h.jsx)(ez.Provider,{scope:t,children:(0,h.jsx)(e$,{scope:e.__scopeSelect,onNativeOptionAdd:o.useCallback(e=>{D(t=>new Set(t).add(e))},[]),onNativeOptionRemove:o.useCallback(e=>{D(t=>{let r=new Set(t);return r.delete(e),r})},[]),children:r})}),T?(0,h.jsxs)(tR,{"aria-hidden":!0,required:v,tabIndex:-1,name:d,autoComplete:f,value:j,onChange:e=>k(e.target.value),disabled:p,form:m,children:[void 0===j?(0,h.jsx)("option",{value:""}):null,Array.from(L)]},I):null]})})};eJ.displayName=eH;var eQ="SelectTrigger",e0=o.forwardRef((e,t)=>{let{__scopeSelect:r,disabled:n=!1,...l}=e,i=eY(r),a=eZ(eQ,r),u=a.disabled||n,c=(0,p.s)(t,a.onTriggerChange),d=eV(r),f=o.useRef("touch"),[v,m,y]=tN(e=>{let t=d().filter(e=>!e.disabled),r=t.find(e=>e.value===a.value),n=tj(t,e,r);void 0!==n&&a.onValueChange(n.value)}),g=e=>{u||(a.onOpenChange(!0),y()),e&&(a.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,h.jsx)(Q,{asChild:!0,...i,children:(0,h.jsx)(E.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":tP(a.value)?"":void 0,...l,ref:c,onClick:(0,s.m)(l.onClick,e=>{e.currentTarget.focus(),"mouse"!==f.current&&g(e)}),onPointerDown:(0,s.m)(l.onPointerDown,e=>{f.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:(0,s.m)(l.onKeyDown,e=>{let t=""!==v.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||m(e.key),(!t||" "!==e.key)&&eW.includes(e.key)&&(g(),e.preventDefault())})})})});e0.displayName=eQ;var e1="SelectValue",e5=o.forwardRef((e,t)=>{let{__scopeSelect:r,className:n,style:l,children:o,placeholder:i="",...a}=e,s=eZ(e1,r),{onValueNodeHasChildrenChange:u}=s,c=void 0!==o,d=(0,p.s)(t,s.onValueNodeChange);return(0,K.N)(()=>{u(c)},[u,c]),(0,h.jsx)(E.span,{...a,ref:d,style:{pointerEvents:"none"},children:tP(s.value)?(0,h.jsx)(h.Fragment,{children:i}):o})});e5.displayName=e1;var e2=o.forwardRef((e,t)=>{let{__scopeSelect:r,children:n,...l}=e;return(0,h.jsx)(E.span,{"aria-hidden":!0,...l,ref:t,children:n||"▼"})});e2.displayName="SelectIcon";var e4=e=>(0,h.jsx)(ec,{asChild:!0,...e});e4.displayName="SelectPortal";var e9="SelectContent",e6=o.forwardRef((e,t)=>{let r=eZ(e9,e.__scopeSelect),[n,l]=o.useState();return((0,K.N)(()=>{l(new DocumentFragment)},[]),r.open)?(0,h.jsx)(te,{...e,ref:t}):n?i.createPortal((0,h.jsx)(e8,{scope:e.__scopeSelect,children:(0,h.jsx)(ez.Slot,{scope:e.__scopeSelect,children:(0,h.jsx)("div",{children:e.children})})}),n):null});e6.displayName=e9;var[e8,e7]=eU(e9),e3=v("SelectContent.RemoveScroll"),te=o.forwardRef((e,t)=>{let{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:i,onPointerDownOutside:a,side:u,sideOffset:c,align:d,alignOffset:f,arrowPadding:v,collisionBoundary:m,collisionPadding:y,sticky:g,hideWhenDetached:w,avoidCollisions:x,...b}=e,E=eZ(e9,r),[C,S]=o.useState(null),[R,P]=o.useState(null),j=(0,p.s)(t,e=>S(e)),[k,T]=o.useState(null),[L,D]=o.useState(null),M=eV(r),[O,_]=o.useState(!1),B=o.useRef(!1);o.useEffect(()=>{if(C)return(0,eh.Eq)(C)},[C]),(0,A.Oh)();let W=o.useCallback(e=>{let[t,...r]=M().map(e=>e.ref.current),[n]=r.slice(-1),l=document.activeElement;for(let r of e)if(r===l||(null==r||r.scrollIntoView({block:"nearest"}),r===t&&R&&(R.scrollTop=0),r===n&&R&&(R.scrollTop=R.scrollHeight),null==r||r.focus(),document.activeElement!==l))return},[M,R]),F=o.useCallback(()=>W([k,C]),[W,k,C]);o.useEffect(()=>{O&&F()},[O,F]);let{onOpenChange:H,triggerPointerDownPosRef:z}=E;o.useEffect(()=>{if(C){let e={x:0,y:0},t=t=>{var r,n,l,o;e={x:Math.abs(Math.round(t.pageX)-(null!=(l=null==(r=z.current)?void 0:r.x)?l:0)),y:Math.abs(Math.round(t.pageY)-(null!=(o=null==(n=z.current)?void 0:n.y)?o:0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():C.contains(r.target)||H(!1),document.removeEventListener("pointermove",t),z.current=null};return null!==z.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[C,H,z]),o.useEffect(()=>{let e=()=>H(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[H]);let[V,K]=tN(e=>{let t=M().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=tj(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),U=o.useCallback((e,t,r)=>{let n=!B.current&&!r;(void 0!==E.value&&E.value===t||n)&&(T(e),n&&(B.current=!0))},[E.value]),X=o.useCallback(()=>null==C?void 0:C.focus(),[C]),Y=o.useCallback((e,t,r)=>{let n=!B.current&&!r;(void 0!==E.value&&E.value===t||n)&&D(e)},[E.value]),q="popper"===n?tr:tt,Z=q===tr?{side:u,sideOffset:c,align:d,alignOffset:f,arrowPadding:v,collisionBoundary:m,collisionPadding:y,sticky:g,hideWhenDetached:w,avoidCollisions:x}:{};return(0,h.jsx)(e8,{scope:r,content:C,viewport:R,onViewportChange:P,itemRefCallback:U,selectedItem:k,onItemLeave:X,itemTextRefCallback:Y,focusSelectedItem:F,selectedItemText:L,position:n,isPositioned:O,searchRef:V,children:(0,h.jsx)(eB,{as:e3,allowPinchZoom:!0,children:(0,h.jsx)(I,{asChild:!0,trapped:E.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:(0,s.m)(l,e=>{var t;null==(t=E.trigger)||t.focus({preventScroll:!0}),e.preventDefault()}),children:(0,h.jsx)(N,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:(0,h.jsx)(q,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:e=>e.preventDefault(),...b,...Z,onPlaced:()=>_(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:(0,s.m)(b.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||K(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=M().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout(()=>W(t)),e.preventDefault()}})})})})})})});te.displayName="SelectContentImpl";var tt=o.forwardRef((e,t)=>{let{__scopeSelect:r,onPlaced:n,...l}=e,i=eZ(e9,r),s=e7(e9,r),[u,c]=o.useState(null),[d,f]=o.useState(null),v=(0,p.s)(t,e=>f(e)),m=eV(r),y=o.useRef(!1),g=o.useRef(!0),{viewport:w,selectedItem:x,selectedItemText:b,focusSelectedItem:C}=s,S=o.useCallback(()=>{if(i.trigger&&i.valueNode&&u&&d&&w&&x&&b){let e=i.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),r=i.valueNode.getBoundingClientRect(),l=b.getBoundingClientRect();if("rtl"!==i.dir){let n=l.left-t.left,o=r.left-n,i=e.left-o,s=e.width+i,c=Math.max(s,t.width),d=window.innerWidth-10,f=(0,a.q)(o,[10,Math.max(10,d-c)]);u.style.minWidth=s+"px",u.style.left=f+"px"}else{let n=t.right-l.right,o=window.innerWidth-r.right-n,i=window.innerWidth-e.right-o,s=e.width+i,c=Math.max(s,t.width),d=window.innerWidth-10,f=(0,a.q)(o,[10,Math.max(10,d-c)]);u.style.minWidth=s+"px",u.style.right=f+"px"}let o=m(),s=window.innerHeight-20,c=w.scrollHeight,f=window.getComputedStyle(d),p=parseInt(f.borderTopWidth,10),h=parseInt(f.paddingTop,10),v=parseInt(f.borderBottomWidth,10),g=p+h+c+parseInt(f.paddingBottom,10)+v,E=Math.min(5*x.offsetHeight,g),C=window.getComputedStyle(w),S=parseInt(C.paddingTop,10),R=parseInt(C.paddingBottom,10),P=e.top+e.height/2-10,N=x.offsetHeight/2,j=p+h+(x.offsetTop+N);if(j<=P){let e=o.length>0&&x===o[o.length-1].ref.current;u.style.bottom="0px";let t=Math.max(s-P,N+(e?R:0)+(d.clientHeight-w.offsetTop-w.offsetHeight)+v);u.style.height=j+t+"px"}else{let e=o.length>0&&x===o[0].ref.current;u.style.top="0px";let t=Math.max(P,p+w.offsetTop+(e?S:0)+N);u.style.height=t+(g-j)+"px",w.scrollTop=j-P+w.offsetTop}u.style.margin="".concat(10,"px 0"),u.style.minHeight=E+"px",u.style.maxHeight=s+"px",null==n||n(),requestAnimationFrame(()=>y.current=!0)}},[m,i.trigger,i.valueNode,u,d,w,x,b,i.dir,n]);(0,K.N)(()=>S(),[S]);let[R,P]=o.useState();(0,K.N)(()=>{d&&P(window.getComputedStyle(d).zIndex)},[d]);let N=o.useCallback(e=>{e&&!0===g.current&&(S(),null==C||C(),g.current=!1)},[S,C]);return(0,h.jsx)(tn,{scope:r,contentWrapper:u,shouldExpandOnScrollRef:y,onScrollButtonChange:N,children:(0,h.jsx)("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:(0,h.jsx)(E.div,{...l,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});tt.displayName="SelectItemAlignedPosition";var tr=o.forwardRef((e,t)=>{let{__scopeSelect:r,align:n="start",collisionPadding:l=10,...o}=e,i=eY(r);return(0,h.jsx)(en,{...i,...o,ref:t,align:n,collisionPadding:l,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});tr.displayName="SelectPopperPosition";var[tn,tl]=eU(e9,{}),to="SelectViewport",ti=o.forwardRef((e,t)=>{let{__scopeSelect:r,nonce:n,...l}=e,i=e7(to,r),a=tl(to,r),u=(0,p.s)(t,i.onViewportChange),c=o.useRef(0);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),(0,h.jsx)(ez.Slot,{scope:r,children:(0,h.jsx)(E.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:(0,s.m)(l.onScroll,e=>{let t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=a;if((null==n?void 0:n.current)&&r){let e=Math.abs(c.current-t.scrollTop);if(e>0){let n=window.innerHeight-20,l=Math.max(parseFloat(r.style.minHeight),parseFloat(r.style.height));if(l<n){let o=l+e,i=Math.min(n,o),a=o-i;r.style.height=i+"px","0px"===r.style.bottom&&(t.scrollTop=a>0?a:0,r.style.justifyContent="flex-end")}}}c.current=t.scrollTop})})})]})});ti.displayName=to;var ta="SelectGroup",[ts,tu]=eU(ta);o.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,l=(0,F.B)();return(0,h.jsx)(ts,{scope:r,id:l,children:(0,h.jsx)(E.div,{role:"group","aria-labelledby":l,...n,ref:t})})}).displayName=ta;var tc="SelectLabel";o.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,l=tu(tc,r);return(0,h.jsx)(E.div,{id:l.id,...n,ref:t})}).displayName=tc;var td="SelectItem",[tf,tp]=eU(td),th=o.forwardRef((e,t)=>{let{__scopeSelect:r,value:n,disabled:l=!1,textValue:i,...a}=e,u=eZ(td,r),c=e7(td,r),d=u.value===n,[f,v]=o.useState(null!=i?i:""),[m,y]=o.useState(!1),g=(0,p.s)(t,e=>{var t;return null==(t=c.itemRefCallback)?void 0:t.call(c,e,n,l)}),w=(0,F.B)(),x=o.useRef("touch"),b=()=>{l||(u.onValueChange(n),u.onOpenChange(!1))};if(""===n)throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,h.jsx)(tf,{scope:r,value:n,disabled:l,textId:w,isSelected:d,onItemTextChange:o.useCallback(e=>{v(t=>{var r;return t||(null!=(r=null==e?void 0:e.textContent)?r:"").trim()})},[]),children:(0,h.jsx)(ez.ItemSlot,{scope:r,value:n,disabled:l,textValue:f,children:(0,h.jsx)(E.div,{role:"option","aria-labelledby":w,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...a,ref:g,onFocus:(0,s.m)(a.onFocus,()=>y(!0)),onBlur:(0,s.m)(a.onBlur,()=>y(!1)),onClick:(0,s.m)(a.onClick,()=>{"mouse"!==x.current&&b()}),onPointerUp:(0,s.m)(a.onPointerUp,()=>{"mouse"===x.current&&b()}),onPointerDown:(0,s.m)(a.onPointerDown,e=>{x.current=e.pointerType}),onPointerMove:(0,s.m)(a.onPointerMove,e=>{if(x.current=e.pointerType,l){var t;null==(t=c.onItemLeave)||t.call(c)}else"mouse"===x.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,s.m)(a.onPointerLeave,e=>{if(e.currentTarget===document.activeElement){var t;null==(t=c.onItemLeave)||t.call(c)}}),onKeyDown:(0,s.m)(a.onKeyDown,e=>{var t;((null==(t=c.searchRef)?void 0:t.current)===""||" "!==e.key)&&(eF.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});th.displayName=td;var tv="SelectItemText",tm=o.forwardRef((e,t)=>{let{__scopeSelect:r,className:n,style:l,...a}=e,s=eZ(tv,r),u=e7(tv,r),c=tp(tv,r),d=eG(tv,r),[f,v]=o.useState(null),m=(0,p.s)(t,e=>v(e),c.onItemTextChange,e=>{var t;return null==(t=u.itemTextRefCallback)?void 0:t.call(u,e,c.value,c.disabled)}),y=null==f?void 0:f.textContent,g=o.useMemo(()=>(0,h.jsx)("option",{value:c.value,disabled:c.disabled,children:y},c.value),[c.disabled,c.value,y]),{onNativeOptionAdd:w,onNativeOptionRemove:x}=d;return(0,K.N)(()=>(w(g),()=>x(g)),[w,x,g]),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(E.span,{id:c.textId,...a,ref:m}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?i.createPortal(a.children,s.valueNode):null]})});tm.displayName=tv;var ty="SelectItemIndicator",tg=o.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e;return tp(ty,r).isSelected?(0,h.jsx)(E.span,{"aria-hidden":!0,...n,ref:t}):null});tg.displayName=ty;var tw="SelectScrollUpButton",tx=o.forwardRef((e,t)=>{let r=e7(tw,e.__scopeSelect),n=tl(tw,e.__scopeSelect),[l,i]=o.useState(!1),a=(0,p.s)(t,n.onScrollButtonChange);return(0,K.N)(()=>{if(r.viewport&&r.isPositioned){let e=function(){i(t.scrollTop>0)},t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),l?(0,h.jsx)(tC,{...e,ref:a,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});tx.displayName=tw;var tb="SelectScrollDownButton",tE=o.forwardRef((e,t)=>{let r=e7(tb,e.__scopeSelect),n=tl(tb,e.__scopeSelect),[l,i]=o.useState(!1),a=(0,p.s)(t,n.onScrollButtonChange);return(0,K.N)(()=>{if(r.viewport&&r.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;i(Math.ceil(t.scrollTop)<e)},t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),l?(0,h.jsx)(tC,{...e,ref:a,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});tE.displayName=tb;var tC=o.forwardRef((e,t)=>{let{__scopeSelect:r,onAutoScroll:n,...l}=e,i=e7("SelectScrollButton",r),a=o.useRef(null),u=eV(r),c=o.useCallback(()=>{null!==a.current&&(window.clearInterval(a.current),a.current=null)},[]);return o.useEffect(()=>()=>c(),[c]),(0,K.N)(()=>{var e;let t=u().find(e=>e.ref.current===document.activeElement);null==t||null==(e=t.ref.current)||e.scrollIntoView({block:"nearest"})},[u]),(0,h.jsx)(E.div,{"aria-hidden":!0,...l,ref:t,style:{flexShrink:0,...l.style},onPointerDown:(0,s.m)(l.onPointerDown,()=>{null===a.current&&(a.current=window.setInterval(n,50))}),onPointerMove:(0,s.m)(l.onPointerMove,()=>{var e;null==(e=i.onItemLeave)||e.call(i),null===a.current&&(a.current=window.setInterval(n,50))}),onPointerLeave:(0,s.m)(l.onPointerLeave,()=>{c()})})});o.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e;return(0,h.jsx)(E.div,{"aria-hidden":!0,...n,ref:t})}).displayName="SelectSeparator";var tS="SelectArrow";o.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,l=eY(r),o=eZ(tS,r),i=e7(tS,r);return o.open&&"popper"===i.position?(0,h.jsx)(ei,{...l,...n,ref:t}):null}).displayName=tS;var tR=o.forwardRef((e,t)=>{let{__scopeSelect:r,value:n,...l}=e,i=o.useRef(null),a=(0,p.s)(t,i),s=(0,ef.Z)(n);return o.useEffect(()=>{let e=i.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(s!==n&&t){let r=new Event("change",{bubbles:!0});t.call(e,n),e.dispatchEvent(r)}},[s,n]),(0,h.jsx)(E.select,{...l,style:{...ep,...l.style},ref:a,defaultValue:n})});function tP(e){return""===e||void 0===e}function tN(e){let t=(0,C.c)(e),r=o.useRef(""),n=o.useRef(0),l=o.useCallback(e=>{let l=r.current+e;t(l),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout(()=>e(""),1e3))}(l)},[t]),i=o.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return o.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,l,i]}function tj(e,t,r){var n,l;let o=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=r?e.indexOf(r):-1,a=(n=e,l=Math.max(i,0),n.map((e,t)=>n[(l+t)%n.length]));1===o.length&&(a=a.filter(e=>e!==r));let s=a.find(e=>e.textValue.toLowerCase().startsWith(o.toLowerCase()));return s!==r?s:void 0}tR.displayName="SelectBubbleInput";var tk=eJ,tA=e0,tT=e5,tL=e2,tD=e4,tI=e6,tM=ti,tO=th,t_=tm,tB=tg,tW=tx,tF=tE},78108:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(12115);function l(e){let t=n.useRef({value:e,previous:e});return n.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}},85408:(e,t,r)=>{r.d(t,{b:()=>c});var n=r(12115);r(47650);var l=r(94446),o=r(95155),i=Symbol("radix.slottable");function a(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===i}var s=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=function(e){let t=function(e){let t=n.forwardRef((e,t)=>{var r,o,i;let a,s,{children:u,...c}=e,d=n.isValidElement(u)?(s=(a=null==(o=Object.getOwnPropertyDescriptor((r=u).props,"ref"))?void 0:o.get)&&"isReactWarning"in a&&a.isReactWarning)?r.ref:(s=(a=null==(i=Object.getOwnPropertyDescriptor(r,"ref"))?void 0:i.get)&&"isReactWarning"in a&&a.isReactWarning)?r.props.ref:r.props.ref||r.ref:void 0,f=(0,l.s)(d,t);if(n.isValidElement(u)){let e=function(e,t){let r={...t};for(let n in t){let l=e[n],o=t[n];/^on[A-Z]/.test(n)?l&&o?r[n]=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let n=o(...t);return l(...t),n}:l&&(r[n]=l):"style"===n?r[n]={...l,...o}:"className"===n&&(r[n]=[l,o].filter(Boolean).join(" "))}return{...e,...r}}(c,u.props);return u.type!==n.Fragment&&(e.ref=f),n.cloneElement(u,e)}return n.Children.count(u)>1?n.Children.only(null):null});return t.displayName="".concat(e,".SlotClone"),t}(e),r=n.forwardRef((e,r)=>{let{children:l,...i}=e,s=n.Children.toArray(l),u=s.find(a);if(u){let e=u.props.children,l=s.map(t=>t!==u?t:n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null);return(0,o.jsx)(t,{...i,ref:r,children:n.isValidElement(e)?n.cloneElement(e,void 0,l):null})}return(0,o.jsx)(t,{...i,ref:r,children:l})});return r.displayName="".concat(e,".Slot"),r}(`Primitive.${t}`),i=n.forwardRef((e,n)=>{let{asChild:l,...i}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,o.jsx)(l?r:t,{...i,ref:n})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),u=n.forwardRef((e,t)=>(0,o.jsx)(s.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));u.displayName="Label";var c=u}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[924],{3998:(e,t,a)=>{a.d(t,{$:()=>u,r:()=>s});var n=a(95155);a(12115);var i=a(32467),r=a(83101),o=a(64269);let s=(0,r.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function u(e){let{className:t,variant:a,size:r,asChild:u=!1,...c}=e,l=u?i.DX:"button";return(0,n.jsx)(l,{"data-slot":"button",className:(0,o.cn)(s({variant:a,size:r,className:t})),...c})}},7831:(e,t,a)=>{a.d(t,{DR:()=>u,Iu:()=>f,KC:()=>p,ME:()=>l,gb:()=>g,in:()=>c,ki:()=>o,nu:()=>y,ui:()=>d,userApi:()=>w,vm:()=>h});var n=a(17983);let i=(0,a(41444).h)("apiClient"),r=null;function o(e){r=e,i.debug(e?"Access token set":"Access token cleared")}let s=async()=>(r||i.debug("No access token available."),r),u=new n.Vk6({basePath:"/api/proxy",middleware:[{pre:async e=>{i.debug("Running pre-request middleware...");let t=await s();t?(i.debug("Token found, adding Authorization header."),e.init.headers={...e.init.headers,Authorization:"Bearer ".concat(t)}):i.warn("No token found, Authorization header not added.")},post:async e=>{let t=e.response.headers.get("content-type");if(!e.response.ok&&t&&!t.includes("application/json")){let a=await e.response.text();throw i.error({status:e.response.status,contentType:t,preview:a.substring(0,200)},"API returned non-JSON response"),Error("API error ".concat(e.response.status,": Server returned ").concat(t," instead of JSON. Check API endpoint and CORS configuration."))}}}]}),c=new n.cwn(u),l=new n.uzR(u),d=new n.cdi(u),h=new n.Lev(u),g=new n.At2(u),w=new n.ipj(u),f=new n.UYx(u),p=new n.OgW(u),y=new n.XoK(u)},17983:(e,t,a)=>{a.d(t,{cwn:()=>I,OgW:()=>K,Lev:()=>x,Vk6:()=>i,XoK:()=>B,on2:()=>T,At2:()=>D,UYx:()=>J,cdi:()=>L,v3H:()=>W,uzR:()=>O,S5d:()=>_,Esj:()=>v,ipj:()=>N});let n="http://localhost".replace(/\/+$/,"");class i{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:n}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(n=>(function t(a,n){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=i+(i.length?"[".concat(a,"]"):a);if(n instanceof Array){let e=n.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return n instanceof Set?t(a,Array.from(n),i):n instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(n.toISOString())):n instanceof Object?e(n,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(n)))})(n,t[n],a)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){this.configuration=e}}let r=new i;class o{withMiddleware(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];let n=this.clone();return n.middleware=n.middleware.concat(...t),n}withPreMiddleware(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];let n=t.map(e=>({pre:e}));return this.withMiddleware(...n)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];let n=t.map(e=>({post:e}));return this.withMiddleware(...n)}isJsonMime(e){return!!e&&o.jsonRegex.test(e)}async request(e,t){let{url:a,init:n}=await this.createFetchParams(e,t),i=await this.fetchApi(a,n);if(i&&i.status>=200&&i.status<300)return i;throw new s(i,"Response returned an error code")}async createFetchParams(e,t){var a,n;let i,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let o=Object.assign({},this.configuration.headers,e.headers);Object.keys(o).forEach(e=>void 0===o[e]?delete o[e]:{});let s={method:e.method,headers:o,body:e.body,credentials:this.configuration.credentials},u={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return a=u.body,i="undefined"!=typeof FormData&&a instanceof FormData||u.body instanceof URLSearchParams||(n=u.body,"undefined"!=typeof Blob&&n instanceof Blob)?u.body:this.isJsonMime(o["Content-Type"])?JSON.stringify(u.body):u.body,{url:r,init:{...u,body:i}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=r){this.configuration=e,this.fetchApi=async(e,t)=>{let a,n={url:e,init:t};for(let e of this.middleware)e.pre&&(n=await e.pre({fetch:this.fetchApi,...n})||n);try{a=await (this.configuration.fetchApi||fetch)(n.url,n.init)}catch(e){for(let t of this.middleware)t.onError&&(a=await t.onError({fetch:this.fetchApi,url:n.url,init:n.init,error:e,response:a?a.clone():void 0})||a);if(void 0===a)if(e instanceof Error)throw new u(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(a=await e.post({fetch:this.fetchApi,url:n.url,init:n.init,response:a.clone()})||a);return a},this.middleware=e.middleware}}o.jsonRegex=RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i");class s extends Error{constructor(e,t){super(t),this.response=e,this.name="ResponseError"}}class u extends Error{constructor(e,t){super(t),this.cause=e,this.name="FetchError"}}class c extends Error{constructor(e,t){super(t),this.field=e,this.name="RequiredError"}}class l{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){this.raw=e,this.transformer=t}}class d{async value(){}constructor(e){this.raw=e}}function h(e){var t;return null==(t=e)?t:{id:t.id,timestamp:new Date(t.timestamp),apiKeyPrefix:t.api_key_prefix,userUsername:t.user_username,organizationName:t.organization_name,modelIdUsed:t.model_id_used,apiEndpoint:t.api_endpoint,inputTokens:t.input_tokens,outputTokens:t.output_tokens,creditsDeducted:t.credits_deducted,requestPayloadPreview:t.request_payload_preview,responsePayloadPreview:t.response_payload_preview}}function g(e,t){return null==e?e:{id:e.id,name:e.name}}function w(e,t){return null==e?e:{user:e.user,username:e.username,organization:e.organization}}function f(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,endpoint:t.endpoint,agentType:null==t.agent_type?void 0:t.agent_type,description:null==t.description?void 0:t.description,metadata:null==t.metadata?void 0:t.metadata,organization:t.organization,organizationDetail:g(t.organization_detail,!1),owner:t.owner,ownerDetail:w(t.owner_detail,!1),createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at)}}function p(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,endpoint:e.endpoint,agent_type:e.agentType,description:e.description,metadata:e.metadata}}function y(e){var t;return null==(t=e)?t:{id:t.id,type:t.type,agent:t.agent,agentName:t.agent_name,owner:t.owner,ownerUsername:t.owner_username,organization:t.organization,organizationName:t.organization_name,_configuration:t.configuration,createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at)}}function k(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{type:e.type,agent:e.agent,configuration:e._configuration}}let T={NotEvaluated:"NOT_EVALUATED",SuccessfulJailbreak:"SUCCESSFUL_JAILBREAK",FailedJailbreak:"FAILED_JAILBREAK",ErrorAgentResponse:"ERROR_AGENT_RESPONSE",ErrorTestFramework:"ERROR_TEST_FRAMEWORK",PassedCriteria:"PASSED_CRITERIA",FailedCriteria:"FAILED_CRITERIA"};function R(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at),credits:t.credits,creditsLastUpdated:new Date(t.credits_last_updated)}}function m(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name}}let v={ToolCall:"TOOL_CALL",ToolResponse:"TOOL_RESPONSE",AgentThought:"AGENT_THOUGHT",AgentResponseChunk:"AGENT_RESPONSE_CHUNK",Other:"OTHER",McpStep:"MCP_STEP",A2AComm:"A2A_COMM"};function A(e){var t,a=e;if(null==a)return a;return{id:a.id,result:a.result,sequence:a.sequence,stepType:null==a.step_type?void 0:(t=a.step_type,t),timestamp:new Date(a.timestamp),content:null==a.content?void 0:a.content}}function q(e){var t,a=e;if(null==a)return a;return{id:a.id,run:a.run,runId:a.run_id,requestPayload:null==a.request_payload?void 0:a.request_payload,responseStatusCode:null==a.response_status_code?void 0:a.response_status_code,responseHeaders:null==a.response_headers?void 0:a.response_headers,responseBody:null==a.response_body?void 0:a.response_body,latencyMs:null==a.latency_ms?void 0:a.latency_ms,detectedToolCalls:null==a.detected_tool_calls?void 0:a.detected_tool_calls,evaluationStatus:null==a.evaluation_status?void 0:(t=a.evaluation_status,t),evaluationNotes:null==a.evaluation_notes?void 0:a.evaluation_notes,evaluationMetrics:null==a.evaluation_metrics?void 0:a.evaluation_metrics,agentSpecificData:null==a.agent_specific_data?void 0:a.agent_specific_data,timestamp:new Date(a.timestamp),traces:a.traces.map(A)}}let _={Pending:"PENDING",Running:"RUNNING",Completed:"COMPLETED",Failed:"FAILED",Cancelled:"CANCELLED"};function z(e){var t,a=e;if(null==a)return a;return{id:a.id,agent:a.agent,agentName:a.agent_name,attack:a.attack,attackType:a.attack_type,owner:a.owner,ownerUsername:a.owner_username,organization:a.organization,organizationName:a.organization_name,runConfig:a.run_config,timestamp:new Date(a.timestamp),status:(t=a.status,t),runNotes:a.run_notes,isClientExecuted:a.is_client_executed,totalResults:a.total_results,successfulJailbreaks:a.successful_jailbreaks,failedJailbreaks:a.failed_jailbreaks,errors:a.errors,notEvaluated:a.not_evaluated}}function C(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,prefix:t.prefix,created:new Date(t.created),revoked:t.revoked,expiryDate:null==t.expiry_date?null:new Date(t.expiry_date),user:t.user,userDetail:w(t.user_detail,!1),organization:t.organization,organizationDetail:g(t.organization_detail,!1)}}function P(e){var t;return null==(t=e)?t:{id:t.id,user:t.user,username:t.username,email:null==t.email?void 0:t.email,firstName:null==t.first_name?void 0:t.first_name,lastName:null==t.last_name?void 0:t.last_name,organization:t.organization,organizationName:t.organization_name,keycloakUserId:t.keycloak_user_id,auth0UserId:t.auth0_user_id,analyticsConsent:null==t.analytics_consent?void 0:t.analytics_consent}}function U(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{run:e.run,request_payload:e.requestPayload,response_status_code:e.responseStatusCode,response_headers:e.responseHeaders,response_body:e.responseBody,latency_ms:e.latencyMs,detected_tool_calls:e.detectedToolCalls,evaluation_status:e.evaluationStatus,evaluation_notes:e.evaluationNotes,evaluation_metrics:e.evaluationMetrics,agent_specific_data:e.agentSpecificData}}function E(e){var t,a=e;if(null==a)return a;return{id:a.id,agent:a.agent,agentName:a.agent_name,attack:null==a.attack?void 0:a.attack,owner:a.owner,ownerUsername:a.owner_username,organization:a.organization,organizationName:a.organization_name,runConfig:null==a.run_config?void 0:a.run_config,timestamp:new Date(a.timestamp),status:null==a.status?void 0:(t=a.status,t),runNotes:null==a.run_notes?void 0:a.run_notes,isClientExecuted:a.is_client_executed,results:a.results.map(q)}}function S(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{agent:e.agent,attack:e.attack,run_config:e.runConfig,status:e.status,run_notes:e.runNotes}}function b(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{email:e.email,first_name:e.firstName,last_name:e.lastName,analytics_consent:e.analyticsConsent}}class I extends o{async agentCreateRaw(e,t){if(null==e.agentRequest)throw new c("agentRequest",'Required parameter "agentRequest" was null or undefined when calling agentCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent",method:"POST",headers:a,query:{},body:p(e.agentRequest,!1)},t),e=>f(e))}async agentCreate(e,t){let a=await this.agentCreateRaw(e,t);return await a.value()}async agentDestroyRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling agentDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new d(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async agentDestroy(e,t){await this.agentDestroyRaw(e,t)}async agentListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(f)}})}async agentList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.agentListRaw(e,t);return await a.value()}async agentPartialUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling agentPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,endpoint:e.endpoint,agent_type:e.agentType,description:e.description,metadata:e.metadata}}(e.patchedAgentRequest,!1)},t),e=>f(e))}async agentPartialUpdate(e,t){let a=await this.agentPartialUpdateRaw(e,t);return await a.value()}async agentRetrieveRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling agentRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>f(e))}async agentRetrieve(e,t){let a=await this.agentRetrieveRaw(e,t);return await a.value()}async agentUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling agentUpdate().');if(null==e.agentRequest)throw new c("agentRequest",'Required parameter "agentRequest" was null or undefined when calling agentUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:p(e.agentRequest,!1)},t),e=>f(e))}async agentUpdate(e,t){let a=await this.agentUpdateRaw(e,t);return await a.value()}}class K extends o{async apilogsListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/apilogs",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(h)}})}async apilogsList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.apilogsListRaw(e,t);return await a.value()}async apilogsRetrieveRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling apilogsRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/apilogs/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>h(e))}async apilogsRetrieve(e,t){let a=await this.apilogsRetrieveRaw(e,t);return await a.value()}async apilogsSummaryRetrieveRaw(e,t){if(null==e.endDate)throw new c("endDate",'Required parameter "endDate" was null or undefined when calling apilogsSummaryRetrieve().');if(null==e.startDate)throw new c("startDate",'Required parameter "startDate" was null or undefined when calling apilogsSummaryRetrieve().');let a={};null!=e.byKey&&(a.by_key=e.byKey),null!=e.endDate&&(a.end_date=e.endDate.toISOString().substring(0,10)),null!=e.startDate&&(a.start_date=e.startDate.toISOString().substring(0,10)),null!=e.tz&&(a.tz=e.tz);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/apilogs/summary",method:"GET",headers:n,query:a},t),e=>h(e))}async apilogsSummaryRetrieve(e,t){let a=await this.apilogsSummaryRetrieveRaw(e,t);return await a.value()}}class x extends o{async attackCreateRaw(e,t){if(null==e.attackRequest)throw new c("attackRequest",'Required parameter "attackRequest" was null or undefined when calling attackCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack",method:"POST",headers:a,query:{},body:k(e.attackRequest,!1)},t),e=>y(e))}async attackCreate(e,t){let a=await this.attackCreateRaw(e,t);return await a.value()}async attackDestroyRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling attackDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new d(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async attackDestroy(e,t){await this.attackDestroyRaw(e,t)}async attackListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(y)}})}async attackList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.attackListRaw(e,t);return await a.value()}async attackPartialUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling attackPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{type:e.type,agent:e.agent,configuration:e._configuration}}(e.patchedAttackRequest,!1)},t),e=>y(e))}async attackPartialUpdate(e,t){let a=await this.attackPartialUpdateRaw(e,t);return await a.value()}async attackRetrieveRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling attackRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>y(e))}async attackRetrieve(e,t){let a=await this.attackRetrieveRaw(e,t);return await a.value()}async attackUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling attackUpdate().');if(null==e.attackRequest)throw new c("attackRequest",'Required parameter "attackRequest" was null or undefined when calling attackUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:k(e.attackRequest,!1)},t),e=>y(e))}async attackUpdate(e,t){let a=await this.attackUpdateRaw(e,t);return await a.value()}}class B extends o{async creditsRequestCreateRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/credits/request",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{amount:e.amount,reason:e.reason}}(e.creditRequestRequest,!1)},t),e=>{var t;return null==(t=e)?t:{status:t.status}})}async creditsRequestCreate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.creditsRequestCreateRaw(e,t);return await a.value()}}class D extends o{async keyContextRetrieveRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("APIKeyAuth",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/key/context",method:"GET",headers:t,query:{}},e),e=>{var t;return null==(t=e)?t:{userId:null==t.user_id?void 0:t.user_id,username:null==t.username?void 0:t.username,organizationId:null==t.organization_id?void 0:t.organization_id,organizationName:null==t.organization_name?void 0:t.organization_name}})}async keyContextRetrieve(e){let t=await this.keyContextRetrieveRaw(e);return await t.value()}async keyCreateRaw(e,t){if(null==e.userAPIKeyRequest)throw new c("userAPIKeyRequest",'Required parameter "userAPIKeyRequest" was null or undefined when calling keyCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/key",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,key:e.key}}(e.userAPIKeyRequest,!1)},t),e=>C(e))}async keyCreate(e,t){let a=await this.keyCreateRaw(e,t);return await a.value()}async keyDestroyRaw(e,t){if(null==e.prefix)throw new c("prefix",'Required parameter "prefix" was null or undefined when calling keyDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new d(await this.request({path:"/key/{prefix}".replace("{prefix}",encodeURIComponent(String(e.prefix))),method:"DELETE",headers:a,query:{}},t))}async keyDestroy(e,t){await this.keyDestroyRaw(e,t)}async keyListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/key",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(C)}})}async keyList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.keyListRaw(e,t);return await a.value()}async keyRetrieveRaw(e,t){if(null==e.prefix)throw new c("prefix",'Required parameter "prefix" was null or undefined when calling keyRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/key/{prefix}".replace("{prefix}",encodeURIComponent(String(e.prefix))),method:"GET",headers:a,query:{}},t),e=>C(e))}async keyRetrieve(e,t){let a=await this.keyRetrieveRaw(e,t);return await a.value()}}class J extends o{async organizationCreateRaw(e,t){if(null==e.organizationRequest)throw new c("organizationRequest",'Required parameter "organizationRequest" was null or undefined when calling organizationCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization",method:"POST",headers:a,query:{},body:m(e.organizationRequest,!1)},t),e=>R(e))}async organizationCreate(e,t){let a=await this.organizationCreateRaw(e,t);return await a.value()}async organizationDestroyRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling organizationDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new d(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async organizationDestroy(e,t){await this.organizationDestroyRaw(e,t)}async organizationListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(R)}})}async organizationList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.organizationListRaw(e,t);return await a.value()}async organizationMeRetrieveRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/organization/me",method:"GET",headers:t,query:{}},e),e=>R(e))}async organizationMeRetrieve(e){let t=await this.organizationMeRetrieveRaw(e);return await t.value()}async organizationPartialUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling organizationPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name}}(e.patchedOrganizationRequest,!1)},t),e=>R(e))}async organizationPartialUpdate(e,t){let a=await this.organizationPartialUpdateRaw(e,t);return await a.value()}async organizationRetrieveRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling organizationRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>R(e))}async organizationRetrieve(e,t){let a=await this.organizationRetrieveRaw(e,t);return await a.value()}async organizationUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling organizationUpdate().');if(null==e.organizationRequest)throw new c("organizationRequest",'Required parameter "organizationRequest" was null or undefined when calling organizationUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:m(e.organizationRequest,!1)},t),e=>R(e))}async organizationUpdate(e,t){let a=await this.organizationUpdateRaw(e,t);return await a.value()}}class L extends o{async resultCreateRaw(e,t){if(null==e.resultRequest)throw new c("resultRequest",'Required parameter "resultRequest" was null or undefined when calling resultCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result",method:"POST",headers:a,query:{},body:U(e.resultRequest,!1)},t),e=>q(e))}async resultCreate(e,t){let a=await this.resultCreateRaw(e,t);return await a.value()}async resultDestroyRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling resultDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new d(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async resultDestroy(e,t){await this.resultDestroyRaw(e,t)}async resultListRaw(e,t){let a={};null!=e.evaluationStatus&&(a.evaluation_status=e.evaluationStatus),null!=e.page&&(a.page=e.page),null!=e.pageSize&&(a.page_size=e.pageSize),null!=e.run&&(a.run=e.run),null!=e.runOrganization&&(a.run__organization=e.runOrganization);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(q)}})}async resultList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.resultListRaw(e,t);return await a.value()}async resultPartialUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling resultPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{run:e.run,request_payload:e.requestPayload,response_status_code:e.responseStatusCode,response_headers:e.responseHeaders,response_body:e.responseBody,latency_ms:e.latencyMs,detected_tool_calls:e.detectedToolCalls,evaluation_status:e.evaluationStatus,evaluation_notes:e.evaluationNotes,evaluation_metrics:e.evaluationMetrics,agent_specific_data:e.agentSpecificData}}(e.patchedResultRequest,!1)},t),e=>q(e))}async resultPartialUpdate(e,t){let a=await this.resultPartialUpdateRaw(e,t);return await a.value()}async resultRetrieveRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling resultRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>q(e))}async resultRetrieve(e,t){let a=await this.resultRetrieveRaw(e,t);return await a.value()}async resultTraceCreateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling resultTraceCreate().');if(null==e.traceRequest)throw new c("traceRequest",'Required parameter "traceRequest" was null or undefined when calling resultTraceCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}/trace".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{sequence:e.sequence,step_type:e.stepType,content:e.content}}(e.traceRequest,!1)},t),e=>A(e))}async resultTraceCreate(e,t){let a=await this.resultTraceCreateRaw(e,t);return await a.value()}async resultUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling resultUpdate().');if(null==e.resultRequest)throw new c("resultRequest",'Required parameter "resultRequest" was null or undefined when calling resultUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:U(e.resultRequest,!1)},t),e=>q(e))}async resultUpdate(e,t){let a=await this.resultUpdateRaw(e,t);return await a.value()}}let W={ErrorAgentResponse:"ERROR_AGENT_RESPONSE",ErrorTestFramework:"ERROR_TEST_FRAMEWORK",FailedCriteria:"FAILED_CRITERIA",FailedJailbreak:"FAILED_JAILBREAK",NotEvaluated:"NOT_EVALUATED",PassedCriteria:"PASSED_CRITERIA",SuccessfulJailbreak:"SUCCESSFUL_JAILBREAK"};class O extends o{async runCreateRaw(e,t){if(null==e.runRequest)throw new c("runRequest",'Required parameter "runRequest" was null or undefined when calling runCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run",method:"POST",headers:a,query:{},body:S(e.runRequest,!1)},t),e=>E(e))}async runCreate(e,t){let a=await this.runCreateRaw(e,t);return await a.value()}async runDestroyRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling runDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new d(await this.request({path:"/run/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async runDestroy(e,t){await this.runDestroyRaw(e,t)}async runListRaw(e,t){let a={};null!=e.agent&&(a.agent=e.agent),null!=e.attack&&(a.attack=e.attack),null!=e.isClientExecuted&&(a.is_client_executed=e.isClientExecuted),null!=e.organization&&(a.organization=e.organization),null!=e.page&&(a.page=e.page),null!=e.pageSize&&(a.page_size=e.pageSize),null!=e.status&&(a.status=e.status);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(z)}})}async runList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.runListRaw(e,t);return await a.value()}async runPartialUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling runPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{agent:e.agent,attack:e.attack,run_config:e.runConfig,status:e.status,run_notes:e.runNotes}}(e.patchedRunRequest,!1)},t),e=>E(e))}async runPartialUpdate(e,t){let a=await this.runPartialUpdateRaw(e,t);return await a.value()}async runResultCreateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling runResultCreate().');if(null==e.runRequest)throw new c("runRequest",'Required parameter "runRequest" was null or undefined when calling runResultCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/result".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:S(e.runRequest,!1)},t),e=>q(e))}async runResultCreate(e,t){let a=await this.runResultCreateRaw(e,t);return await a.value()}async runRetrieveRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling runRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>E(e))}async runRetrieve(e,t){let a=await this.runRetrieveRaw(e,t);return await a.value()}async runRunTestsCreateRaw(e,t){if(null==e.runRequest)throw new c("runRequest",'Required parameter "runRequest" was null or undefined when calling runRunTestsCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/run_tests",method:"POST",headers:a,query:{},body:S(e.runRequest,!1)},t),e=>E(e))}async runRunTestsCreate(e,t){let a=await this.runRunTestsCreateRaw(e,t);return await a.value()}async runUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling runUpdate().');if(null==e.runRequest)throw new c("runRequest",'Required parameter "runRequest" was null or undefined when calling runUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:S(e.runRequest,!1)},t),e=>E(e))}async runUpdate(e,t){let a=await this.runUpdateRaw(e,t);return await a.value()}}class N extends o{async userCreateRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user",method:"POST",headers:a,query:{},body:b(e.userProfileRequest,!1)},t),e=>P(e))}async userCreate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.userCreateRaw(e,t);return await a.value()}async userDestroyRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling userDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new d(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async userDestroy(e,t){await this.userDestroyRaw(e,t)}async userListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(P)}})}async userList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.userListRaw(e,t);return await a.value()}async userMeRetrieveRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/user/me",method:"GET",headers:t,query:{}},e),e=>P(e))}async userMeRetrieve(e){let t=await this.userMeRetrieveRaw(e);return await t.value()}async userMeUpdateRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/me",method:"PUT",headers:a,query:{},body:b(e.userProfileRequest,!1)},t),e=>P(e))}async userMeUpdate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.userMeUpdateRaw(e,t);return await a.value()}async userPartialUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling userPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{email:e.email,first_name:e.firstName,last_name:e.lastName,analytics_consent:e.analyticsConsent}}(e.patchedUserProfileRequest,!1)},t),e=>P(e))}async userPartialUpdate(e,t){let a=await this.userPartialUpdateRaw(e,t);return await a.value()}async userRetrieveRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling userRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>P(e))}async userRetrieve(e,t){let a=await this.userRetrieveRaw(e,t);return await a.value()}async userUpdateRaw(e,t){if(null==e.id)throw new c("id",'Required parameter "id" was null or undefined when calling userUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:b(e.userProfileRequest,!1)},t),e=>P(e))}async userUpdate(e,t){let a=await this.userUpdateRaw(e,t);return await a.value()}}},41444:(e,t,a)=>{a.d(t,{h:()=>r});var n=a(65727);let i=a.n(n)()({level:"info",browser:{asObject:!1,write:{debug:e=>!1,info:e=>console.info(e),warn:e=>console.warn(e),error:e=>console.error(e)}},redact:{paths:["token","password","authorization","apiKey","api_key","wallet.address","user.wallet.address","privateKey","private_key"],censor:"[REDACTED]"}}),r=e=>i.child({module:e})},64269:(e,t,a)=>{a.d(t,{cn:()=>r});var n=a(2821),i=a(75889);function r(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,i.QP)((0,n.$)(t))}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[928],{12108:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},15870:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("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"}]])},24595:(e,t,r)=>{r.d(t,{UC:()=>ro,q7:()=>ra,ZL:()=>rn,bL:()=>rt,wv:()=>rl,l9:()=>rr});var n,o,a=r(12115),l=r(92556),i=r(94446),u=r(3468),s=r(23558),c=r(47650),d=r(95155);function f(e){let t=function(e){let t=a.forwardRef((e,t)=>{var r,n,o;let l,u,{children:s,...c}=e,d=a.isValidElement(s)?(u=(l=null==(n=Object.getOwnPropertyDescriptor((r=s).props,"ref"))?void 0:n.get)&&"isReactWarning"in l&&l.isReactWarning)?r.ref:(u=(l=null==(o=Object.getOwnPropertyDescriptor(r,"ref"))?void 0:o.get)&&"isReactWarning"in l&&l.isReactWarning)?r.props.ref:r.props.ref||r.ref:void 0,f=(0,i.s)(d,t);if(a.isValidElement(s)){let e=function(e,t){let r={...t};for(let n in t){let o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let n=a(...t);return o(...t),n}:o&&(r[n]=o):"style"===n?r[n]={...o,...a}:"className"===n&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}(c,s.props);return s.type!==a.Fragment&&(e.ref=f),a.cloneElement(s,e)}return a.Children.count(s)>1?a.Children.only(null):null});return t.displayName="".concat(e,".SlotClone"),t}(e),r=a.forwardRef((e,r)=>{let{children:n,...o}=e,l=a.Children.toArray(n),i=l.find(v);if(i){let e=i.props.children,n=l.map(t=>t!==i?t:a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null);return(0,d.jsx)(t,{...o,ref:r,children:a.isValidElement(e)?a.cloneElement(e,void 0,n):null})}return(0,d.jsx)(t,{...o,ref:r,children:n})});return r.displayName="".concat(e,".Slot"),r}var p=Symbol("radix.slottable");function v(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===p}var h=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=f(`Primitive.${t}`),n=a.forwardRef((e,n)=>{let{asChild:o,...a}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,d.jsx)(o?r:t,{...a,ref:n})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function m(e,t){e&&c.flushSync(()=>e.dispatchEvent(t))}var y=r(97239),w=r(97999),g=r(69023);function x(e){let t=e+"CollectionProvider",[r,n]=(0,u.A)(t),[o,l]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=e=>{let{scope:t,children:r}=e,n=a.useRef(null),l=a.useRef(new Map).current;return(0,d.jsx)(o,{scope:t,itemMap:l,collectionRef:n,children:r})};s.displayName=t;let c=e+"CollectionSlot",p=f(c),v=a.forwardRef((e,t)=>{let{scope:r,children:n}=e,o=l(c,r),a=(0,i.s)(t,o.collectionRef);return(0,d.jsx)(p,{ref:a,children:n})});v.displayName=c;let h=e+"CollectionItemSlot",m="data-radix-collection-item",y=f(h),w=a.forwardRef((e,t)=>{let{scope:r,children:n,...o}=e,u=a.useRef(null),s=(0,i.s)(t,u),c=l(h,r);return a.useEffect(()=>(c.itemMap.set(u,{ref:u,...o}),()=>void c.itemMap.delete(u))),(0,d.jsx)(y,{...{[m]:""},ref:s,children:n})});return w.displayName=h,[{Provider:s,Slot:v,ItemSlot:w},function(t){let r=l(e+"CollectionConsumer",t);return a.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll("[".concat(m,"]")));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},n]}var b=new WeakMap;function E(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let r=function(e,t){let r=e.length,n=C(t),o=n>=0?n:r+n;return o<0||o>=r?-1:o}(e,t);return -1===r?void 0:e[r]}function C(e){return e!=e||0===e?0:Math.trunc(e)}n=new WeakMap,class e extends Map{set(e,t){return b.get(this)&&(this.has(e)?(0,y._)(this,n)[(0,y._)(this,n).indexOf(e)]=e:(0,y._)(this,n).push(e)),super.set(e,t),this}insert(e,t,r){let o,a=this.has(t),l=(0,y._)(this,n).length,i=C(e),u=i>=0?i:l+i,s=u<0||u>=l?-1:u;if(s===this.size||a&&s===this.size-1||-1===s)return this.set(t,r),this;let c=this.size+ +!a;i<0&&u++;let d=[...(0,y._)(this,n)],f=!1;for(let e=u;e<c;e++)if(u===e){let n=d[e];d[e]===t&&(n=d[e+1]),a&&this.delete(t),o=this.get(n),this.set(t,r)}else{f||d[e-1]!==t||(f=!0);let r=d[f?e:e-1],n=o;o=this.get(r),this.delete(r),this.set(r,n)}return this}with(t,r,n){let o=new e(this);return o.insert(t,r,n),o}before(e){let t=(0,y._)(this,n).indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let o=(0,y._)(this,n).indexOf(e);return -1===o?this:this.insert(o,t,r)}after(e){let t=(0,y._)(this,n).indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let o=(0,y._)(this,n).indexOf(e);return -1===o?this:this.insert(o+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return(0,g._)(this,n,[]),super.clear()}delete(e){let t=super.delete(e);return t&&(0,y._)(this,n).splice((0,y._)(this,n).indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=E((0,y._)(this,n),e);if(void 0!==t)return this.get(t)}entryAt(e){let t=E((0,y._)(this,n),e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return(0,y._)(this,n).indexOf(e)}keyAt(e){return E((0,y._)(this,n),e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.at(n)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.keyAt(n)}find(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return n;r++}}findIndex(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return r;r++}return -1}filter(t,r){let n=[],o=0;for(let e of this)Reflect.apply(t,r,[e,o,this])&&n.push(e),o++;return new e(n)}map(t,r){let n=[],o=0;for(let e of this)n.push([e[0],Reflect.apply(t,r,[e,o,this])]),o++;return new e(n)}reduce(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let[n,o]=t,a=0,l=null!=o?o:this.at(0);for(let e of this)l=0===a&&1===t.length?e:Reflect.apply(n,this,[l,e,a,this]),a++;return l}reduceRight(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let[n,o]=t,a=null!=o?o:this.at(-1);for(let e=this.size-1;e>=0;e--){let r=this.at(e);a=e===this.size-1&&1===t.length?r:Reflect.apply(n,this,[a,r,e,this])}return a}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),n=this.get(r);t.set(r,n)}return t}toSpliced(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];let o=[...this.entries()];return o.splice(...r),new e(o)}slice(t,r){let n=new e,o=this.size-1;if(void 0===t)return n;t<0&&(t+=this.size),void 0!==r&&r>0&&(o=r-1);for(let e=t;e<=o;e++){let t=this.keyAt(e),r=this.get(t);n.set(t,r)}return n}every(e,t){let r=0;for(let n of this){if(!Reflect.apply(e,t,[n,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return!0;r++}return!1}constructor(e){super(e),(0,w._)(this,n,{writable:!0,value:void 0}),(0,g._)(this,n,[...super.keys()]),b.set(this,!0)}};var R=r(66218),M=r(70222),j=r(59584),k="dismissableLayer.update",D=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),P=a.forwardRef((e,t)=>{var r,n;let{disableOutsidePointerEvents:u=!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:p,onDismiss:v,...m}=e,y=a.useContext(D),[w,g]=a.useState(null),x=null!=(n=null==w?void 0:w.ownerDocument)?n:null==(r=globalThis)?void 0:r.document,[,b]=a.useState({}),E=(0,i.s)(t,e=>g(e)),C=Array.from(y.layers),[R]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),P=C.indexOf(R),_=w?C.indexOf(w):-1,N=y.layersWithOutsidePointerEventsDisabled.size>0,L=_>=P,T=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null==(t=globalThis)?void 0:t.document,n=(0,M.c)(e),o=a.useRef(!1),l=a.useRef(()=>{});return a.useEffect(()=>{let e=e=>{if(e.target&&!o.current){let t=function(){A("dismissableLayer.pointerDownOutside",n,o,{discrete:!0})},o={originalEvent:e};"touch"===e.pointerType?(r.removeEventListener("click",l.current),l.current=t,r.addEventListener("click",l.current,{once:!0})):t()}else r.removeEventListener("click",l.current);o.current=!1},t=window.setTimeout(()=>{r.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),r.removeEventListener("pointerdown",e),r.removeEventListener("click",l.current)}},[r,n]),{onPointerDownCapture:()=>o.current=!0}}(e=>{let t=e.target,r=[...y.branches].some(e=>e.contains(t));L&&!r&&(null==c||c(e),null==p||p(e),e.defaultPrevented||null==v||v())},x),O=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null==(t=globalThis)?void 0:t.document,n=(0,M.c)(e),o=a.useRef(!1);return a.useEffect(()=>{let e=e=>{e.target&&!o.current&&A("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return r.addEventListener("focusin",e),()=>r.removeEventListener("focusin",e)},[r,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{let t=e.target;![...y.branches].some(e=>e.contains(t))&&(null==f||f(e),null==p||p(e),e.defaultPrevented||null==v||v())},x);return(0,j.U)(e=>{_===y.layers.size-1&&(null==s||s(e),!e.defaultPrevented&&v&&(e.preventDefault(),v()))},x),a.useEffect(()=>{if(w)return u&&(0===y.layersWithOutsidePointerEventsDisabled.size&&(o=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(w)),y.layers.add(w),S(),()=>{u&&1===y.layersWithOutsidePointerEventsDisabled.size&&(x.body.style.pointerEvents=o)}},[w,x,u,y]),a.useEffect(()=>()=>{w&&(y.layers.delete(w),y.layersWithOutsidePointerEventsDisabled.delete(w),S())},[w,y]),a.useEffect(()=>{let e=()=>b({});return document.addEventListener(k,e),()=>document.removeEventListener(k,e)},[]),(0,d.jsx)(h.div,{...m,ref:E,style:{pointerEvents:N?L?"auto":"none":void 0,...e.style},onFocusCapture:(0,l.m)(e.onFocusCapture,O.onFocusCapture),onBlurCapture:(0,l.m)(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:(0,l.m)(e.onPointerDownCapture,T.onPointerDownCapture)})});function S(){let e=new CustomEvent(k);document.dispatchEvent(e)}function A(e,t,r,n){let{discrete:o}=n,a=r.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),o?m(a,l):a.dispatchEvent(l)}P.displayName="DismissableLayer",a.forwardRef((e,t)=>{let r=a.useContext(D),n=a.useRef(null),o=(0,i.s)(t,n);return a.useEffect(()=>{let e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,d.jsx)(h.div,{...e,ref:o})}).displayName="DismissableLayerBranch";var _=r(19526),N="focusScope.autoFocusOnMount",L="focusScope.autoFocusOnUnmount",T={bubbles:!1,cancelable:!0},O=a.forwardRef((e,t)=>{let{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...u}=e,[s,c]=a.useState(null),f=(0,M.c)(o),p=(0,M.c)(l),v=a.useRef(null),m=(0,i.s)(t,e=>c(e)),y=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(n){let e=function(e){if(y.paused||!s)return;let t=e.target;s.contains(t)?v.current=t:K(v.current,{select:!0})},t=function(e){if(y.paused||!s)return;let t=e.relatedTarget;null!==t&&(s.contains(t)||K(v.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let r=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&K(s)});return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[n,s,y.paused]),a.useEffect(()=>{if(s){z.add(y);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(N,T);s.addEventListener(N,f),s.dispatchEvent(t),t.defaultPrevented||(function(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=document.activeElement;for(let n of e)if(K(n,{select:t}),document.activeElement!==r)return}(I(s).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&K(s))}return()=>{s.removeEventListener(N,f),setTimeout(()=>{let t=new CustomEvent(L,T);s.addEventListener(L,p),s.dispatchEvent(t),t.defaultPrevented||K(null!=e?e:document.body,{select:!0}),s.removeEventListener(L,p),z.remove(y)},0)}}},[s,f,p,y]);let w=a.useCallback(e=>{if(!r&&!n||y.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){let t=e.currentTarget,[n,a]=function(e){let t=I(e);return[F(t,e),F(t.reverse(),e)]}(t);n&&a?e.shiftKey||o!==a?e.shiftKey&&o===n&&(e.preventDefault(),r&&K(a,{select:!0})):(e.preventDefault(),r&&K(n,{select:!0})):o===t&&e.preventDefault()}},[r,n,y.paused]);return(0,d.jsx)(h.div,{tabIndex:-1,...u,ref:m,onKeyDown:w})});function I(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function F(e,t){for(let r of e)if(!function(e,t){let{upTo:r}=t;if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===r||e!==r);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(r,{upTo:t}))return r}function K(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e&&e.focus){var r;let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&(r=e)instanceof HTMLInputElement&&"select"in r&&t&&e.select()}}O.displayName="FocusScope";var z=function(){let e=[];return{add(t){let r=e[0];t!==r&&(null==r||r.pause()),(e=B(e,t)).unshift(t)},remove(t){var r;null==(r=(e=B(e,t))[0])||r.resume()}}}();function B(e,t){let r=[...e],n=r.indexOf(t);return -1!==n&&r.splice(n,1),r}var W=r(68946),U=r(88334),H=r(58146),X=a.forwardRef((e,t)=>{let{children:r,width:n=10,height:o=5,...a}=e;return(0,d.jsx)(h.svg,{...a,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,d.jsx)("polygon",{points:"0,0 30,0 15,10"})})});X.displayName="Arrow";var G=r(4129),V=r(84288),Y="Popper",[Z,q]=(0,u.A)(Y),[$,J]=Z(Y),Q=e=>{let{__scopePopper:t,children:r}=e,[n,o]=a.useState(null);return(0,d.jsx)($,{scope:t,anchor:n,onAnchorChange:o,children:r})};Q.displayName=Y;var ee="PopperAnchor",et=a.forwardRef((e,t)=>{let{__scopePopper:r,virtualRef:n,...o}=e,l=J(ee,r),u=a.useRef(null),s=(0,i.s)(t,u);return a.useEffect(()=>{l.onAnchorChange((null==n?void 0:n.current)||u.current)}),n?null:(0,d.jsx)(h.div,{...o,ref:s})});et.displayName=ee;var er="PopperContent",[en,eo]=Z(er),ea=a.forwardRef((e,t)=>{var r,n,o,l,u,s,c,f;let{__scopePopper:p,side:v="bottom",sideOffset:m=0,align:y="center",alignOffset:w=0,arrowPadding:g=0,avoidCollisions:x=!0,collisionBoundary:b=[],collisionPadding:E=0,sticky:C="partial",hideWhenDetached:R=!1,updatePositionStrategy:j="optimized",onPlaced:k,...D}=e,P=J(er,p),[S,A]=a.useState(null),_=(0,i.s)(t,e=>A(e)),[N,L]=a.useState(null),T=(0,V.X)(N),O=null!=(c=null==T?void 0:T.width)?c:0,I=null!=(f=null==T?void 0:T.height)?f:0,F="number"==typeof E?E:{top:0,right:0,bottom:0,left:0,...E},K=Array.isArray(b)?b:[b],z=K.length>0,B={padding:F,boundary:K.filter(es),altBoundary:z},{refs:W,floatingStyles:X,placement:Y,isPositioned:Z,middlewareData:q}=(0,U.we)({strategy:"fixed",placement:v+("center"!==y?"-"+y:""),whileElementsMounted:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,H.ll)(...t,{animationFrame:"always"===j})},elements:{reference:P.anchor},middleware:[(0,U.cY)({mainAxis:m+I,alignmentAxis:w}),x&&(0,U.BN)({mainAxis:!0,crossAxis:!1,limiter:"partial"===C?(0,U.ER)():void 0,...B}),x&&(0,U.UU)({...B}),(0,U.Ej)({...B,apply:e=>{let{elements:t,rects:r,availableWidth:n,availableHeight:o}=e,{width:a,height:l}=r.reference,i=t.floating.style;i.setProperty("--radix-popper-available-width","".concat(n,"px")),i.setProperty("--radix-popper-available-height","".concat(o,"px")),i.setProperty("--radix-popper-anchor-width","".concat(a,"px")),i.setProperty("--radix-popper-anchor-height","".concat(l,"px"))}}),N&&(0,U.UE)({element:N,padding:g}),ec({arrowWidth:O,arrowHeight:I}),R&&(0,U.jD)({strategy:"referenceHidden",...B})]}),[$,Q]=ed(Y),ee=(0,M.c)(k);(0,G.N)(()=>{Z&&(null==ee||ee())},[Z,ee]);let et=null==(r=q.arrow)?void 0:r.x,eo=null==(n=q.arrow)?void 0:n.y,ea=(null==(o=q.arrow)?void 0:o.centerOffset)!==0,[el,ei]=a.useState();return(0,G.N)(()=>{S&&ei(window.getComputedStyle(S).zIndex)},[S]),(0,d.jsx)("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...X,transform:Z?X.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:el,"--radix-popper-transform-origin":[null==(l=q.transformOrigin)?void 0:l.x,null==(u=q.transformOrigin)?void 0:u.y].join(" "),...(null==(s=q.hide)?void 0:s.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,d.jsx)(en,{scope:p,placedSide:$,onArrowChange:L,arrowX:et,arrowY:eo,shouldHideArrow:ea,children:(0,d.jsx)(h.div,{"data-side":$,"data-align":Q,...D,ref:_,style:{...D.style,animation:Z?void 0:"none"}})})})});ea.displayName=er;var el="PopperArrow",ei={top:"bottom",right:"left",bottom:"top",left:"right"},eu=a.forwardRef(function(e,t){let{__scopePopper:r,...n}=e,o=eo(el,r),a=ei[o.placedSide];return(0,d.jsx)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:(0,d.jsx)(X,{...n,ref:t,style:{...n.style,display:"block"}})})});function es(e){return null!==e}eu.displayName=el;var ec=e=>({name:"transformOrigin",options:e,fn(t){var r,n,o,a,l;let{placement:i,rects:u,middlewareData:s}=t,c=(null==(r=s.arrow)?void 0:r.centerOffset)!==0,d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[p,v]=ed(i),h={start:"0%",center:"50%",end:"100%"}[v],m=(null!=(a=null==(n=s.arrow)?void 0:n.x)?a:0)+d/2,y=(null!=(l=null==(o=s.arrow)?void 0:o.y)?l:0)+f/2,w="",g="";return"bottom"===p?(w=c?h:"".concat(m,"px"),g="".concat(-f,"px")):"top"===p?(w=c?h:"".concat(m,"px"),g="".concat(u.floating.height+f,"px")):"right"===p?(w="".concat(-f,"px"),g=c?h:"".concat(y,"px")):"left"===p&&(w="".concat(u.floating.width+f,"px"),g=c?h:"".concat(y,"px")),{data:{x:w,y:g}}}});function ed(e){let[t,r="center"]=e.split("-");return[t,r]}var ef=a.forwardRef((e,t)=>{var r,n;let{container:o,...l}=e,[i,u]=a.useState(!1);(0,G.N)(()=>u(!0),[]);let s=o||i&&(null==(n=globalThis)||null==(r=n.document)?void 0:r.body);return s?c.createPortal((0,d.jsx)(h.div,{...l,ref:t}),s):null});ef.displayName="Portal";var ep=r(76842),ev="rovingFocusGroup.onEntryFocus",eh={bubbles:!1,cancelable:!0},em="RovingFocusGroup",[ey,ew,eg]=x(em),[ex,eb]=(0,u.A)(em,[eg]),[eE,eC]=ex(em),eR=a.forwardRef((e,t)=>(0,d.jsx)(ey.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(ey.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(eM,{...e,ref:t})})}));eR.displayName=em;var eM=a.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:u,currentTabStopId:c,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:p,onEntryFocus:v,preventScrollOnEntryFocus:m=!1,...y}=e,w=a.useRef(null),g=(0,i.s)(t,w),x=(0,R.jH)(u),[b,E]=(0,s.i)({prop:c,defaultProp:null!=f?f:null,onChange:p,caller:em}),[C,j]=a.useState(!1),k=(0,M.c)(v),D=ew(r),P=a.useRef(!1),[S,A]=a.useState(0);return a.useEffect(()=>{let e=w.current;if(e)return e.addEventListener(ev,k),()=>e.removeEventListener(ev,k)},[k]),(0,d.jsx)(eE,{scope:r,orientation:n,dir:x,loop:o,currentTabStopId:b,onItemFocus:a.useCallback(e=>E(e),[E]),onItemShiftTab:a.useCallback(()=>j(!0),[]),onFocusableItemAdd:a.useCallback(()=>A(e=>e+1),[]),onFocusableItemRemove:a.useCallback(()=>A(e=>e-1),[]),children:(0,d.jsx)(h.div,{tabIndex:C||0===S?-1:0,"data-orientation":n,...y,ref:g,style:{outline:"none",...e.style},onMouseDown:(0,l.m)(e.onMouseDown,()=>{P.current=!0}),onFocus:(0,l.m)(e.onFocus,e=>{let t=!P.current;if(e.target===e.currentTarget&&t&&!C){let t=new CustomEvent(ev,eh);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=D().filter(e=>e.focusable);eP([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),m)}}P.current=!1}),onBlur:(0,l.m)(e.onBlur,()=>j(!1))})})}),ej="RovingFocusGroupItem",ek=a.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:i,children:u,...s}=e,c=(0,W.B)(),f=i||c,p=eC(ej,r),v=p.currentTabStopId===f,m=ew(r),{onFocusableItemAdd:y,onFocusableItemRemove:w,currentTabStopId:g}=p;return a.useEffect(()=>{if(n)return y(),()=>w()},[n,y,w]),(0,d.jsx)(ey.ItemSlot,{scope:r,id:f,focusable:n,active:o,children:(0,d.jsx)(h.span,{tabIndex:v?0:-1,"data-orientation":p.orientation,...s,ref:t,onMouseDown:(0,l.m)(e.onMouseDown,e=>{n?p.onItemFocus(f):e.preventDefault()}),onFocus:(0,l.m)(e.onFocus,()=>p.onItemFocus(f)),onKeyDown:(0,l.m)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var n;let o=(n=e.key,"rtl"!==r?n:"ArrowLeft"===n?"ArrowRight":"ArrowRight"===n?"ArrowLeft":n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(o))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(o)))return eD[o]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=m().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();let n=r.indexOf(e.currentTarget);r=p.loop?function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(r,n+1):r.slice(n+1)}setTimeout(()=>eP(r))}}),children:"function"==typeof u?u({isCurrentTabStop:v,hasTabStop:null!=g}):u})})});ek.displayName=ej;var eD={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function eP(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}var eS=r(97745),eA=r(71450),e_=r(60216),eN=r(78357),eL=(0,r(43711).f)(),eT=function(){},eO=a.forwardRef(function(e,t){var r=a.useRef(null),n=a.useState({onScrollCapture:eT,onWheelCapture:eT,onTouchMoveCapture:eT}),o=n[0],l=n[1],i=e.forwardProps,u=e.children,s=e.className,c=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,v=e.noRelative,h=e.noIsolation,m=e.inert,y=e.allowPinchZoom,w=e.as,g=e.gapMode,x=(0,eA.Tt)(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),b=(0,eN.S)([r,t]),E=(0,eA.Cl)((0,eA.Cl)({},x),o);return a.createElement(a.Fragment,null,d&&a.createElement(p,{sideCar:eL,removeScrollBar:c,shards:f,noRelative:v,noIsolation:h,inert:m,setCallbacks:l,allowPinchZoom:!!y,lockRef:r,gapMode:g}),i?a.cloneElement(a.Children.only(u),(0,eA.Cl)((0,eA.Cl)({},E),{ref:b})):a.createElement(void 0===w?"div":w,(0,eA.Cl)({},E,{className:s,ref:b}),u))});eO.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},eO.classNames={fullWidth:e_.pN,zeroRight:e_.Mi};var eI=r(39615),eF=r(46810),eK=r(65841),ez=!1;if("undefined"!=typeof window)try{var eB=Object.defineProperty({},"passive",{get:function(){return ez=!0,!0}});window.addEventListener("test",eB,eB),window.removeEventListener("test",eB,eB)}catch(e){ez=!1}var eW=!!ez&&{passive:!1},eU=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&(r.overflowY!==r.overflowX||"TEXTAREA"===e.tagName||"visible"!==r[t])},eH=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),eX(e,n)){var o=eG(e,n);if(o[1]>o[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},eX=function(e,t){return"v"===e?eU(t,"overflowY"):eU(t,"overflowX")},eG=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},eV=function(e,t,r,n,o){var a,l=(a=window.getComputedStyle(t).direction,"h"===e&&"rtl"===a?-1:1),i=l*n,u=r.target,s=t.contains(u),c=!1,d=i>0,f=0,p=0;do{var v=eG(e,u),h=v[0],m=v[1]-v[2]-l*h;(h||m)&&eX(e,u)&&(f+=m,p+=h),u=u.parentNode.host||u.parentNode}while(!s&&u!==document.body||s&&(t.contains(u)||t===u));return d&&(o&&1>Math.abs(f)||!o&&i>f)?c=!0:!d&&(o&&1>Math.abs(p)||!o&&-i>p)&&(c=!0),c},eY=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},eZ=function(e){return[e.deltaX,e.deltaY]},eq=function(e){return e&&"current"in e?e.current:e},e$=0,eJ=[];let eQ=(0,eI.m)(eL,function(e){var t=a.useRef([]),r=a.useRef([0,0]),n=a.useRef(),o=a.useState(e$++)[0],l=a.useState(eK.T0)[0],i=a.useRef(e);a.useEffect(function(){i.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=(0,eA.fX)([e.lockRef.current],(e.shards||[]).map(eq),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var u=a.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var o,a=eY(e),l=r.current,u="deltaX"in e?e.deltaX:l[0]-a[0],s="deltaY"in e?e.deltaY:l[1]-a[1],c=e.target,d=Math.abs(u)>Math.abs(s)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var f=eH(d,c);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=eH(d,c)),!f)return!1;if(!n.current&&"changedTouches"in e&&(u||s)&&(n.current=o),!o)return!0;var p=n.current||o;return eV(p,t,e,"h"===p?u:s,!0)},[]),s=a.useCallback(function(e){if(eJ.length&&eJ[eJ.length-1]===l){var r="deltaY"in e?eZ(e):eY(e),n=t.current.filter(function(t){var n;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(n=t.delta,n[0]===r[0]&&n[1]===r[1])})[0];if(n&&n.should){e.cancelable&&e.preventDefault();return}if(!n){var o=(i.current.shards||[]).map(eq).filter(Boolean).filter(function(t){return t.contains(e.target)});(o.length>0?u(e,o[0]):!i.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),c=a.useCallback(function(e,r,n,o){var a={name:e,delta:r,target:n,should:o,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(n)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=a.useCallback(function(e){r.current=eY(e),n.current=void 0},[]),f=a.useCallback(function(t){c(t.type,eZ(t),t.target,u(t,e.lockRef.current))},[]),p=a.useCallback(function(t){c(t.type,eY(t),t.target,u(t,e.lockRef.current))},[]);a.useEffect(function(){return eJ.push(l),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",s,eW),document.addEventListener("touchmove",s,eW),document.addEventListener("touchstart",d,eW),function(){eJ=eJ.filter(function(e){return e!==l}),document.removeEventListener("wheel",s,eW),document.removeEventListener("touchmove",s,eW),document.removeEventListener("touchstart",d,eW)}},[]);var v=e.removeScrollBar,h=e.inert;return a.createElement(a.Fragment,null,h?a.createElement(l,{styles:"\n .block-interactivity-".concat(o," {pointer-events: none;}\n .allow-interactivity-").concat(o," {pointer-events: all;}\n")}):null,v?a.createElement(eF.jp,{noRelative:e.noRelative,gapMode:e.gapMode}):null)});var e0=a.forwardRef(function(e,t){return a.createElement(eO,(0,eA.Cl)({},e,{ref:t,sideCar:eQ}))});e0.classNames=eO.classNames;var e1=["Enter"," "],e2=["ArrowUp","PageDown","End"],e5=["ArrowDown","PageUp","Home",...e2],e7={ltr:[...e1,"ArrowRight"],rtl:[...e1,"ArrowLeft"]},e3={ltr:["ArrowLeft"],rtl:["ArrowRight"]},e8="Menu",[e4,e9,e6]=x(e8),[te,tt]=(0,u.A)(e8,[e6,q,eb]),tr=q(),tn=eb(),[to,ta]=te(e8),[tl,ti]=te(e8),tu=e=>{let{__scopeMenu:t,open:r=!1,children:n,dir:o,onOpenChange:l,modal:i=!0}=e,u=tr(t),[s,c]=a.useState(null),f=a.useRef(!1),p=(0,M.c)(l),v=(0,R.jH)(o);return a.useEffect(()=>{let e=()=>{f.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>f.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),(0,d.jsx)(Q,{...u,children:(0,d.jsx)(to,{scope:t,open:r,onOpenChange:p,content:s,onContentChange:c,children:(0,d.jsx)(tl,{scope:t,onClose:a.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:v,modal:i,children:n})})})};tu.displayName=e8;var ts=a.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e,o=tr(r);return(0,d.jsx)(et,{...o,...n,ref:t})});ts.displayName="MenuAnchor";var tc="MenuPortal",[td,tf]=te(tc,{forceMount:void 0}),tp=e=>{let{__scopeMenu:t,forceMount:r,children:n,container:o}=e,a=ta(tc,t);return(0,d.jsx)(td,{scope:t,forceMount:r,children:(0,d.jsx)(ep.C,{present:r||a.open,children:(0,d.jsx)(ef,{asChild:!0,container:o,children:n})})})};tp.displayName=tc;var tv="MenuContent",[th,tm]=te(tv),ty=a.forwardRef((e,t)=>{let r=tf(tv,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,a=ta(tv,e.__scopeMenu),l=ti(tv,e.__scopeMenu);return(0,d.jsx)(e4.Provider,{scope:e.__scopeMenu,children:(0,d.jsx)(ep.C,{present:n||a.open,children:(0,d.jsx)(e4.Slot,{scope:e.__scopeMenu,children:l.modal?(0,d.jsx)(tw,{...o,ref:t}):(0,d.jsx)(tg,{...o,ref:t})})})})}),tw=a.forwardRef((e,t)=>{let r=ta(tv,e.__scopeMenu),n=a.useRef(null),o=(0,i.s)(t,n);return a.useEffect(()=>{let e=n.current;if(e)return(0,eS.Eq)(e)},[]),(0,d.jsx)(tb,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:(0,l.m)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),tg=a.forwardRef((e,t)=>{let r=ta(tv,e.__scopeMenu);return(0,d.jsx)(tb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),tx=f("MenuContent.ScrollLock"),tb=a.forwardRef((e,t)=>{let{__scopeMenu:r,loop:n=!1,trapFocus:o,onOpenAutoFocus:u,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:f,onEscapeKeyDown:p,onPointerDownOutside:v,onFocusOutside:h,onInteractOutside:m,onDismiss:y,disableOutsideScroll:w,...g}=e,x=ta(tv,r),b=ti(tv,r),E=tr(r),C=tn(r),R=e9(r),[M,j]=a.useState(null),k=a.useRef(null),D=(0,i.s)(t,k,x.onContentChange),S=a.useRef(0),A=a.useRef(""),N=a.useRef(0),L=a.useRef(null),T=a.useRef("right"),I=a.useRef(0),F=w?e0:a.Fragment;a.useEffect(()=>()=>window.clearTimeout(S.current),[]),(0,_.Oh)();let K=a.useCallback(e=>{var t,r;return T.current===(null==(t=L.current)?void 0:t.side)&&function(e,t){return!!t&&function(e,t){let{x:r,y:n}=e,o=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let l=t[e],i=t[a],u=l.x,s=l.y,c=i.x,d=i.y;s>n!=d>n&&r<(c-u)*(n-s)/(d-s)+u&&(o=!o)}return o}({x:e.clientX,y:e.clientY},t)}(e,null==(r=L.current)?void 0:r.area)},[]);return(0,d.jsx)(th,{scope:r,searchRef:A,onItemEnter:a.useCallback(e=>{K(e)&&e.preventDefault()},[K]),onItemLeave:a.useCallback(e=>{var t;K(e)||(null==(t=k.current)||t.focus(),j(null))},[K]),onTriggerLeave:a.useCallback(e=>{K(e)&&e.preventDefault()},[K]),pointerGraceTimerRef:N,onPointerGraceIntentChange:a.useCallback(e=>{L.current=e},[]),children:(0,d.jsx)(F,{...w?{as:tx,allowPinchZoom:!0}:void 0,children:(0,d.jsx)(O,{asChild:!0,trapped:o,onMountAutoFocus:(0,l.m)(u,e=>{var t;e.preventDefault(),null==(t=k.current)||t.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,d.jsx)(P,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:p,onPointerDownOutside:v,onFocusOutside:h,onInteractOutside:m,onDismiss:y,children:(0,d.jsx)(eR,{asChild:!0,...C,dir:b.dir,orientation:"vertical",loop:n,currentTabStopId:M,onCurrentTabStopIdChange:j,onEntryFocus:(0,l.m)(f,e=>{b.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,d.jsx)(ea,{role:"menu","aria-orientation":"vertical","data-state":tV(x.open),"data-radix-menu-content":"",dir:b.dir,...E,...g,ref:D,style:{outline:"none",...g.style},onKeyDown:(0,l.m)(g.onKeyDown,e=>{let t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,r=e.ctrlKey||e.altKey||e.metaKey,n=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!r&&n&&(e=>{var t,r;let n=A.current+e,o=R().filter(e=>!e.disabled),a=document.activeElement,l=null==(t=o.find(e=>e.ref.current===a))?void 0:t.textValue,i=function(e,t,r){var n;let o=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=r?e.indexOf(r):-1,l=(n=Math.max(a,0),e.map((t,r)=>e[(n+r)%e.length]));1===o.length&&(l=l.filter(e=>e!==r));let i=l.find(e=>e.toLowerCase().startsWith(o.toLowerCase()));return i!==r?i:void 0}(o.map(e=>e.textValue),n,l),u=null==(r=o.find(e=>e.textValue===i))?void 0:r.ref.current;!function e(t){A.current=t,window.clearTimeout(S.current),""!==t&&(S.current=window.setTimeout(()=>e(""),1e3))}(n),u&&setTimeout(()=>u.focus())})(e.key));let o=k.current;if(e.target!==o||!e5.includes(e.key))return;e.preventDefault();let a=R().filter(e=>!e.disabled).map(e=>e.ref.current);e2.includes(e.key)&&a.reverse(),function(e){let t=document.activeElement;for(let r of e)if(r===t||(r.focus(),document.activeElement!==t))return}(a)}),onBlur:(0,l.m)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(S.current),A.current="")}),onPointerMove:(0,l.m)(e.onPointerMove,tq(e=>{let t=e.target,r=I.current!==e.clientX;e.currentTarget.contains(t)&&r&&(T.current=e.clientX>I.current?"right":"left",I.current=e.clientX)}))})})})})})})});ty.displayName=tv;var tE=a.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,d.jsx)(h.div,{role:"group",...n,ref:t})});tE.displayName="MenuGroup";var tC=a.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,d.jsx)(h.div,{...n,ref:t})});tC.displayName="MenuLabel";var tR="MenuItem",tM="menu.itemSelect",tj=a.forwardRef((e,t)=>{let{disabled:r=!1,onSelect:n,...o}=e,u=a.useRef(null),s=ti(tR,e.__scopeMenu),c=tm(tR,e.__scopeMenu),f=(0,i.s)(t,u),p=a.useRef(!1);return(0,d.jsx)(tk,{...o,ref:f,disabled:r,onClick:(0,l.m)(e.onClick,()=>{let e=u.current;if(!r&&e){let t=new CustomEvent(tM,{bubbles:!0,cancelable:!0});e.addEventListener(tM,e=>null==n?void 0:n(e),{once:!0}),m(e,t),t.defaultPrevented?p.current=!1:s.onClose()}}),onPointerDown:t=>{var r;null==(r=e.onPointerDown)||r.call(e,t),p.current=!0},onPointerUp:(0,l.m)(e.onPointerUp,e=>{var t;p.current||null==(t=e.currentTarget)||t.click()}),onKeyDown:(0,l.m)(e.onKeyDown,e=>{let t=""!==c.searchRef.current;r||t&&" "===e.key||e1.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});tj.displayName=tR;var tk=a.forwardRef((e,t)=>{let{__scopeMenu:r,disabled:n=!1,textValue:o,...u}=e,s=tm(tR,r),c=tn(r),f=a.useRef(null),p=(0,i.s)(t,f),[v,m]=a.useState(!1),[y,w]=a.useState("");return a.useEffect(()=>{let e=f.current;if(e){var t;w((null!=(t=e.textContent)?t:"").trim())}},[u.children]),(0,d.jsx)(e4.ItemSlot,{scope:r,disabled:n,textValue:null!=o?o:y,children:(0,d.jsx)(ek,{asChild:!0,...c,focusable:!n,children:(0,d.jsx)(h.div,{role:"menuitem","data-highlighted":v?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...u,ref:p,onPointerMove:(0,l.m)(e.onPointerMove,tq(e=>{n?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,l.m)(e.onPointerLeave,tq(e=>s.onItemLeave(e))),onFocus:(0,l.m)(e.onFocus,()=>m(!0)),onBlur:(0,l.m)(e.onBlur,()=>m(!1))})})})}),tD=a.forwardRef((e,t)=>{let{checked:r=!1,onCheckedChange:n,...o}=e;return(0,d.jsx)(tO,{scope:e.__scopeMenu,checked:r,children:(0,d.jsx)(tj,{role:"menuitemcheckbox","aria-checked":tY(r)?"mixed":r,...o,ref:t,"data-state":tZ(r),onSelect:(0,l.m)(o.onSelect,()=>null==n?void 0:n(!!tY(r)||!r),{checkForDefaultPrevented:!1})})})});tD.displayName="MenuCheckboxItem";var tP="MenuRadioGroup",[tS,tA]=te(tP,{value:void 0,onValueChange:()=>{}}),t_=a.forwardRef((e,t)=>{let{value:r,onValueChange:n,...o}=e,a=(0,M.c)(n);return(0,d.jsx)(tS,{scope:e.__scopeMenu,value:r,onValueChange:a,children:(0,d.jsx)(tE,{...o,ref:t})})});t_.displayName=tP;var tN="MenuRadioItem",tL=a.forwardRef((e,t)=>{let{value:r,...n}=e,o=tA(tN,e.__scopeMenu),a=r===o.value;return(0,d.jsx)(tO,{scope:e.__scopeMenu,checked:a,children:(0,d.jsx)(tj,{role:"menuitemradio","aria-checked":a,...n,ref:t,"data-state":tZ(a),onSelect:(0,l.m)(n.onSelect,()=>{var e;return null==(e=o.onValueChange)?void 0:e.call(o,r)},{checkForDefaultPrevented:!1})})})});tL.displayName=tN;var tT="MenuItemIndicator",[tO,tI]=te(tT,{checked:!1}),tF=a.forwardRef((e,t)=>{let{__scopeMenu:r,forceMount:n,...o}=e,a=tI(tT,r);return(0,d.jsx)(ep.C,{present:n||tY(a.checked)||!0===a.checked,children:(0,d.jsx)(h.span,{...o,ref:t,"data-state":tZ(a.checked)})})});tF.displayName=tT;var tK=a.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,d.jsx)(h.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});tK.displayName="MenuSeparator";var tz=a.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e,o=tr(r);return(0,d.jsx)(eu,{...o,...n,ref:t})});tz.displayName="MenuArrow";var[tB,tW]=te("MenuSub"),tU="MenuSubTrigger",tH=a.forwardRef((e,t)=>{let r=ta(tU,e.__scopeMenu),n=ti(tU,e.__scopeMenu),o=tW(tU,e.__scopeMenu),u=tm(tU,e.__scopeMenu),s=a.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:f}=u,p={__scopeMenu:e.__scopeMenu},v=a.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return a.useEffect(()=>v,[v]),a.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),f(null)}},[c,f]),(0,d.jsx)(ts,{asChild:!0,...p,children:(0,d.jsx)(tk,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":o.contentId,"data-state":tV(r.open),...e,ref:(0,i.t)(t,o.onTriggerChange),onClick:t=>{var n;null==(n=e.onClick)||n.call(e,t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:(0,l.m)(e.onPointerMove,tq(t=>{u.onItemEnter(t),!t.defaultPrevented&&(e.disabled||r.open||s.current||(u.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{r.onOpenChange(!0),v()},100)))})),onPointerLeave:(0,l.m)(e.onPointerLeave,tq(e=>{var t,n;v();let o=null==(t=r.content)?void 0:t.getBoundingClientRect();if(o){let t=null==(n=r.content)?void 0:n.dataset.side,a="right"===t,l=o[a?"left":"right"],i=o[a?"right":"left"];u.onPointerGraceIntentChange({area:[{x:e.clientX+(a?-5:5),y:e.clientY},{x:l,y:o.top},{x:i,y:o.top},{x:i,y:o.bottom},{x:l,y:o.bottom}],side:t}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>u.onPointerGraceIntentChange(null),300)}else{if(u.onTriggerLeave(e),e.defaultPrevented)return;u.onPointerGraceIntentChange(null)}})),onKeyDown:(0,l.m)(e.onKeyDown,t=>{let o=""!==u.searchRef.current;if(!e.disabled&&(!o||" "!==t.key)&&e7[n.dir].includes(t.key)){var a;r.onOpenChange(!0),null==(a=r.content)||a.focus(),t.preventDefault()}})})})});tH.displayName=tU;var tX="MenuSubContent",tG=a.forwardRef((e,t)=>{let r=tf(tv,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,u=ta(tv,e.__scopeMenu),s=ti(tv,e.__scopeMenu),c=tW(tX,e.__scopeMenu),f=a.useRef(null),p=(0,i.s)(t,f);return(0,d.jsx)(e4.Provider,{scope:e.__scopeMenu,children:(0,d.jsx)(ep.C,{present:n||u.open,children:(0,d.jsx)(e4.Slot,{scope:e.__scopeMenu,children:(0,d.jsx)(tb,{id:c.contentId,"aria-labelledby":c.triggerId,...o,ref:p,align:"start",side:"rtl"===s.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{var t;s.isUsingKeyboardRef.current&&(null==(t=f.current)||t.focus()),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:(0,l.m)(e.onFocusOutside,e=>{e.target!==c.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:(0,l.m)(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:(0,l.m)(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),r=e3[s.dir].includes(e.key);if(t&&r){var n;u.onOpenChange(!1),null==(n=c.trigger)||n.focus(),e.preventDefault()}})})})})})});function tV(e){return e?"open":"closed"}function tY(e){return"indeterminate"===e}function tZ(e){return tY(e)?"indeterminate":e?"checked":"unchecked"}function tq(e){return t=>"mouse"===t.pointerType?e(t):void 0}tG.displayName=tX;var t$="DropdownMenu",[tJ,tQ]=(0,u.A)(t$,[tt]),t0=tt(),[t1,t2]=tJ(t$),t5=e=>{let{__scopeDropdownMenu:t,children:r,dir:n,open:o,defaultOpen:l,onOpenChange:i,modal:u=!0}=e,c=t0(t),f=a.useRef(null),[p,v]=(0,s.i)({prop:o,defaultProp:null!=l&&l,onChange:i,caller:t$});return(0,d.jsx)(t1,{scope:t,triggerId:(0,W.B)(),triggerRef:f,contentId:(0,W.B)(),open:p,onOpenChange:v,onOpenToggle:a.useCallback(()=>v(e=>!e),[v]),modal:u,children:(0,d.jsx)(tu,{...c,open:p,onOpenChange:v,dir:n,modal:u,children:r})})};t5.displayName=t$;var t7="DropdownMenuTrigger",t3=a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,disabled:n=!1,...o}=e,a=t2(t7,r),u=t0(r);return(0,d.jsx)(ts,{asChild:!0,...u,children:(0,d.jsx)(h.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...o,ref:(0,i.t)(t,a.triggerRef),onPointerDown:(0,l.m)(e.onPointerDown,e=>{!n&&0===e.button&&!1===e.ctrlKey&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:(0,l.m)(e.onKeyDown,e=>{!n&&(["Enter"," "].includes(e.key)&&a.onOpenToggle(),"ArrowDown"===e.key&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});t3.displayName=t7;var t8=e=>{let{__scopeDropdownMenu:t,...r}=e,n=t0(t);return(0,d.jsx)(tp,{...n,...r})};t8.displayName="DropdownMenuPortal";var t4="DropdownMenuContent",t9=a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t2(t4,r),i=t0(r),u=a.useRef(!1);return(0,d.jsx)(ty,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...n,ref:t,onCloseAutoFocus:(0,l.m)(e.onCloseAutoFocus,e=>{var t;u.current||null==(t=o.triggerRef.current)||t.focus(),u.current=!1,e.preventDefault()}),onInteractOutside:(0,l.m)(e.onInteractOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;(!o.modal||n)&&(u.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});t9.displayName=t4,a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t0(r);return(0,d.jsx)(tE,{...o,...n,ref:t})}).displayName="DropdownMenuGroup",a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t0(r);return(0,d.jsx)(tC,{...o,...n,ref:t})}).displayName="DropdownMenuLabel";var t6=a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t0(r);return(0,d.jsx)(tj,{...o,...n,ref:t})});t6.displayName="DropdownMenuItem",a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t0(r);return(0,d.jsx)(tD,{...o,...n,ref:t})}).displayName="DropdownMenuCheckboxItem",a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t0(r);return(0,d.jsx)(t_,{...o,...n,ref:t})}).displayName="DropdownMenuRadioGroup",a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t0(r);return(0,d.jsx)(tL,{...o,...n,ref:t})}).displayName="DropdownMenuRadioItem",a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t0(r);return(0,d.jsx)(tF,{...o,...n,ref:t})}).displayName="DropdownMenuItemIndicator";var re=a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t0(r);return(0,d.jsx)(tK,{...o,...n,ref:t})});re.displayName="DropdownMenuSeparator",a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t0(r);return(0,d.jsx)(tz,{...o,...n,ref:t})}).displayName="DropdownMenuArrow",a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t0(r);return(0,d.jsx)(tH,{...o,...n,ref:t})}).displayName="DropdownMenuSubTrigger",a.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=t0(r);return(0,d.jsx)(tG,{...o,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}).displayName="DropdownMenuSubContent";var rt=t5,rr=t3,rn=t8,ro=t9,ra=t6,rl=re},57268:(e,t,r)=>{r.d(t,{b:()=>s});var n=r(12115),o=r(88142),a=r(95155),l="horizontal",i=["horizontal","vertical"],u=n.forwardRef((e,t)=>{var r;let{decorative:n,orientation:u=l,...s}=e,c=(r=u,i.includes(r))?u:l;return(0,a.jsx)(o.sG.div,{"data-orientation":c,...n?{role:"none"}:{"aria-orientation":"vertical"===c?c:void 0,role:"separator"},...s,ref:t})});u.displayName="Separator";var s=u},89715:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(71847).A)("file-text",[["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"}]])}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[165],{11186:(e,t,n)=>{"use strict";n.d(t,{bq:()=>p,eb:()=>g,gC:()=>u,l6:()=>d,yv:()=>c});var s=n(95155);n(12115);var a=n(59929),i=n(24033),r=n(5917),l=n(12108),o=n(64269);function d(e){let{...t}=e;return(0,s.jsx)(a.bL,{"data-slot":"select",...t})}function c(e){let{...t}=e;return(0,s.jsx)(a.WT,{"data-slot":"select-value",...t})}function p(e){let{className:t,size:n="default",children:r,...l}=e;return(0,s.jsxs)(a.l9,{"data-slot":"select-trigger","data-size":n,className:(0,o.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...l,children:[r,(0,s.jsx)(a.In,{asChild:!0,children:(0,s.jsx)(i.A,{className:"size-4 opacity-50"})})]})}function u(e){let{className:t,children:n,position:i="popper",...r}=e;return(0,s.jsx)(a.ZL,{children:(0,s.jsxs)(a.UC,{"data-slot":"select-content",className:(0,o.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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===i&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:i,...r,children:[(0,s.jsx)(x,{}),(0,s.jsx)(a.LM,{className:(0,o.cn)("p-1","popper"===i&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:n}),(0,s.jsx)(h,{})]})})}function g(e){let{className:t,children:n,...i}=e;return(0,s.jsxs)(a.q7,{"data-slot":"select-item",className:(0,o.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...i,children:[(0,s.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,s.jsx)(a.VF,{children:(0,s.jsx)(r.A,{className:"size-4"})})}),(0,s.jsx)(a.p4,{children:n})]})}function x(e){let{className:t,...n}=e;return(0,s.jsx)(a.PP,{"data-slot":"select-scroll-up-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...n,children:(0,s.jsx)(l.A,{className:"size-4"})})}function h(e){let{className:t,...n}=e;return(0,s.jsx)(a.wn,{"data-slot":"select-scroll-down-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...n,children:(0,s.jsx)(i.A,{className:"size-4"})})}},12108:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});let s=(0,n(71847).A)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},17254:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>P});var s=n(95155),a=n(12115),i=n(80230),r=n(7831),l=n(41444),o=n(22470),d=n(56419),c=n(35835),p=n(87270),u=n(20243),g=n(18332),x=n(98053),h=n(50803),m=n(78192),f=n(35299),j=n(3998),v=n(46826),y=n(18514),b=n(71360),N=n(51834),w=n(11186),A=n(46767),C=n(65142),E=n(76444);let k=[{value:"LITELLM",label:"LiteLLM"},{value:"OPENAI_SDK",label:"OpenAI SDK/API"},{value:"GOOGLE_ADK",label:"Google ADK"},{value:"OTHER",label:"Other / Proprietary"},{value:"UNKNOWN",label:"Unknown"}],I={LITELLM:"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300",OPENAI_SDK:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300",GOOGLE_ADK:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",OTHER:"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-300",UNKNOWN:"bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400"},z=(0,l.h)("AgentsPage");function P(){var e;let{isAuthenticated:t,isLoading:n}=(0,i.h)(),[l,P]=(0,a.useState)([]),[T,D]=(0,a.useState)(!0),[_,L]=(0,a.useState)(null),[O,F]=(0,a.useState)(null),[S,K]=(0,a.useState)(!1),[U,M]=(0,a.useState)({open:!1,title:"",description:""}),[$,q]=(0,a.useState)({open:!1,agent:null}),[G,J]=(0,a.useState)(null),[R,H]=(0,a.useState)(!0),[Z,V]=(0,a.useState)(null),[W,X]=(0,a.useState)(!1),[B,Q]=(0,a.useState)(!1),[Y,ee]=(0,a.useState)(null),[et,en]=(0,a.useState)({name:"",endpoint:"",agentType:"",description:""}),es=(0,a.useCallback)(async()=>{D(!0),L(null),z.debug("Fetching agents...");try{var e;let t=await r.in.agentList();z.info({count:null==(e=t.results)?void 0:e.length},"Agents fetched successfully"),P(t.results||[])}catch(t){z.error({err:t},"Error fetching agents");let e=t.message||"Failed to load agents. Please try again later.";if(t.response){let n=t.response.status,s="Could not read error body";try{s=await t.response.text()}catch(e){}z.error({status:n,responseBody:s},"API Error"),e=403===n?"Forbidden: Check your permissions.":401===n?"Unauthorized: Please log in again.":"API Error (".concat(n,"): ").concat(s||e)}L(e),P([])}finally{D(!1)}},[]);(0,a.useEffect)(()=>{(async()=>{if(!n&&t){H(!0),V(null);try{z.debug("Fetching user profile via /user/me...");let e=await r.userApi.userMeRetrieve();J(e),z.debug({org:e.organization},"User profile fetched")}catch(t){z.error({err:t},"Error fetching user profile");let e=t.message||"Failed to load user profile.";if(t.response){let n=t.response.status,s="Could not read error body";try{s=await t.response.text()}catch(e){}e="Profile API Error (".concat(n,"): ").concat(s||e)}V(e)}finally{H(!1)}}})()},[n,t]);let ea=()=>{en({name:"",endpoint:"",agentType:"",description:""}),X(!0)},ei=async()=>{if(!et.name||!et.endpoint)return void M({open:!0,title:"Validation Error",description:"Name and API Endpoint are required."});if(R)return void M({open:!0,title:"Please Wait",description:"User profile is still loading. Please wait a moment."});if(Z||!(null==G?void 0:G.organization))return void M({open:!0,title:"Organization Error",description:"Cannot create agent: Organization ID not found. ".concat(Z||"Organization ID missing from profile.")});K(!0);let e={name:et.name,endpoint:et.endpoint,...et.agentType&&{agentType:et.agentType},...et.description&&{description:et.description}};try{await r.in.agentCreate({agentRequest:e}),z.info({name:e.name},"Agent created successfully"),await es(),X(!1)}catch(t){z.error({err:t},"Error creating agent");let e=t.message||"Failed to create agent. Please try again.";if(t.response){let n=t.response.status,s="Could not read error body";try{s=await t.response.text()}catch(e){}z.error({status:n,responseBody:s},"Create API Error"),e="Create API Error (".concat(n,"): ").concat(s||e)}M({open:!0,title:"Error Creating Agent",description:e})}finally{K(!1)}},er=async()=>{if(!(null==Y?void 0:Y.id))return void M({open:!0,title:"Invalid Agent",description:"No agent selected for editing or ID is missing."});if(!et.name||!et.endpoint)return void M({open:!0,title:"Validation Error",description:"Name and API Endpoint are required."});K(!0);let e={name:et.name,endpoint:et.endpoint,...et.agentType&&{agentType:et.agentType},...void 0!==et.description&&{description:et.description}};try{await r.in.agentUpdate({id:Y.id,agentRequest:e}),z.info({agentId:Y.id},"Agent updated successfully"),await es(),Q(!1),ee(null)}catch(t){z.error({err:t},"Error updating agent");let e=t.message||"Failed to update agent. Please try again.";if(t.response){let n=t.response.status,s="Could not read error body";try{s=await t.response.text()}catch(e){}z.error({status:n,responseBody:s},"Update API Error"),e="Update API Error (".concat(n,"): ").concat(s||e)}M({open:!0,title:"Error Updating Agent",description:e})}finally{K(!1)}},el=async()=>{let e=$.agent;if(!(null==e?void 0:e.id))return;let t=e.id;q({open:!1,agent:null}),F(t);try{await r.in.agentDestroy({id:t}),z.info({agentId:t},"Agent deleted successfully"),P(e=>e.filter(e=>e.id!==t))}catch(n){z.error({err:n},"Error deleting agent");let t=n.message||'Failed to delete agent "'.concat(e.name,'". Please try again.');if(n.response){let e=n.response.status,s="Could not read error body";try{s=await n.response.text()}catch(e){}z.error({status:e,responseBody:s},"Delete API Error"),t="Delete API Error (".concat(e,"): ").concat(s||t)}M({open:!0,title:"Error Deleting Agent",description:t})}finally{F(null)}};return((0,a.useEffect)(()=>{!n&&t?es():n||t||(D(!1),P([]),L(null),F(null))},[n,t,es]),n||T&&0===l.length&&!_||R)?(0,s.jsx)(o.M,{title:"Agents",description:"Configure and monitor your AI agents for security testing.",children:(0,s.jsx)("div",{className:"px-6 space-y-3",children:[void 0,void 0,void 0].map((e,t)=>(0,s.jsxs)("div",{className:"border rounded-lg p-4 flex items-start gap-4",children:[(0,s.jsx)(u.E,{className:"h-10 w-10 rounded-md flex-shrink-0"}),(0,s.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,s.jsx)(u.E,{className:"h-4 w-1/4"}),(0,s.jsx)(u.E,{className:"h-3 w-1/2"})]}),(0,s.jsx)(u.E,{className:"h-6 w-20 rounded-full"}),(0,s.jsx)(u.E,{className:"h-8 w-8 rounded"}),(0,s.jsx)(u.E,{className:"h-8 w-8 rounded"})]},"skeleton-".concat(t)))})}):(0,s.jsxs)(o.M,{title:"Agents",description:"Configure and monitor your AI agents for security testing.",action:t&&(0,s.jsxs)(j.$,{onClick:ea,children:[(0,s.jsx)(v.A,{className:"mr-2 h-4 w-4"})," Create Agent"]}),children:[(0,s.jsxs)("div",{className:"px-6 space-y-4",children:[!t&&!n&&(0,s.jsxs)(g.Fc,{children:[(0,s.jsx)(h.A,{className:"h-4 w-4"}),(0,s.jsx)(g.XL,{children:"Authentication Required"}),(0,s.jsx)(g.TN,{children:"Please log in to manage agents."})]}),t&&_&&(0,s.jsxs)(g.Fc,{variant:"destructive",children:[(0,s.jsx)(h.A,{className:"h-4 w-4"}),(0,s.jsx)(g.XL,{children:"Error Loading Agents"}),(0,s.jsx)(g.TN,{children:_})]}),t&&Z&&(0,s.jsxs)(g.Fc,{variant:"destructive",children:[(0,s.jsx)(h.A,{className:"h-4 w-4"}),(0,s.jsx)(g.XL,{children:"Profile Error"}),(0,s.jsxs)(g.TN,{children:[Z," — Agent creation may not be available."]})]}),t&&!T&&0===l.length&&!_&&(0,s.jsx)(d.p,{icon:m.A,title:"No agents configured",description:"Get started by creating your first AI agent for security testing.",action:(0,s.jsxs)(j.$,{onClick:ea,children:[(0,s.jsx)(v.A,{className:"mr-2 h-4 w-4"})," Create Agent"]})}),t&&l.length>0&&(0,s.jsx)(A.Bc,{children:(0,s.jsx)("div",{className:"rounded-lg border overflow-hidden",children:(0,s.jsxs)(p.XI,{children:[(0,s.jsx)(p.A0,{children:(0,s.jsxs)(p.Hj,{className:"bg-muted/50 hover:bg-muted/50",children:[(0,s.jsx)(p.nd,{className:"w-[30%] pl-4",children:"Agent"}),(0,s.jsx)(p.nd,{className:"w-[30%]",children:"Endpoint"}),(0,s.jsx)(p.nd,{className:"w-[15%]",children:"Type"}),(0,s.jsx)(p.nd,{className:"w-[12%]",children:"Created"}),(0,s.jsx)(p.nd,{className:"w-[13%] text-right pr-4",children:"Actions"})]})}),(0,s.jsx)(p.BF,{children:l.map(e=>{var t,n,a,i;return(0,s.jsxs)(p.Hj,{className:"group",children:[(0,s.jsx)(p.nA,{className:"pl-4",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("div",{className:"mt-0.5 h-8 w-8 rounded-md bg-muted flex items-center justify-center flex-shrink-0",children:(0,s.jsx)(m.A,{className:"h-4 w-4 text-muted-foreground"})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"font-medium text-sm leading-tight",children:e.name}),e.description&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-1",children:e.description}),(null==(t=e.organizationDetail)?void 0:t.name)&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground/70 mt-0.5",children:e.organizationDetail.name})]})]})}),(0,s.jsx)(p.nA,{children:(0,s.jsxs)(A.m_,{children:[(0,s.jsx)(A.k$,{asChild:!0,children:(0,s.jsx)("span",{className:"text-sm text-muted-foreground font-mono truncate block max-w-[260px] cursor-default",children:e.endpoint})}),(0,s.jsx)(A.ZI,{side:"bottom",className:"max-w-sm break-all",children:e.endpoint})]})}),(0,s.jsx)(p.nA,{children:e.agentType?(0,s.jsx)("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ".concat(null!=(a=I[e.agentType])?a:I.UNKNOWN),children:null!=(i=null==(n=k.find(t=>t.value===e.agentType))?void 0:n.label)?i:e.agentType}):(0,s.jsx)("span",{className:"text-xs text-muted-foreground/50",children:"—"})}),(0,s.jsx)(p.nA,{children:(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:e.createdAt?new Date(e.createdAt).toLocaleDateString():"—"})}),(0,s.jsx)(p.nA,{className:"text-right pr-4",children:(0,s.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,s.jsxs)(A.m_,{children:[(0,s.jsx)(A.k$,{asChild:!0,children:(0,s.jsx)(j.$,{variant:"ghost",size:"icon",onClick:()=>(e=>{if(!e.id)return void M({open:!0,title:"Invalid Agent",description:"Cannot edit agent: ID is missing."});ee(e),en({name:e.name||"",endpoint:e.endpoint||"",agentType:e.agentType||"",description:e.description||""}),Q(!0)})(e),disabled:!!O,className:"h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,s.jsx)(y.A,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(A.ZI,{children:"Edit agent"})]}),(0,s.jsxs)(A.m_,{children:[(0,s.jsx)(A.k$,{asChild:!0,children:(0,s.jsx)(j.$,{variant:"ghost",size:"icon",onClick:()=>(e=>{if(!e.id)return void M({open:!0,title:"Invalid Agent",description:"Cannot delete agent: ID missing or invalid."});q({open:!0,agent:e})})(e),disabled:!!O,className:"h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity ".concat(O===e.id?"text-destructive opacity-100":"hover:text-destructive"),children:O===e.id?(0,s.jsx)(f.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,s.jsx)(b.A,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(A.ZI,{children:"Delete agent"})]})]})})]},e.id)})})]})})})]}),(0,s.jsx)(N.lG,{open:W,onOpenChange:X,children:(0,s.jsxs)(N.Cf,{className:"sm:max-w-[480px]",children:[(0,s.jsxs)(N.c7,{children:[(0,s.jsx)(N.L3,{children:"Create New Agent"}),(0,s.jsx)(N.rr,{children:"Configure a new AI agent for security testing. Provide the endpoint and details below."})]}),(0,s.jsxs)("div",{className:"grid gap-4 py-2",children:[(0,s.jsxs)("div",{className:"grid gap-1.5",children:[(0,s.jsxs)(E.J,{htmlFor:"create-name",children:["Name ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsx)(C.p,{id:"create-name",value:et.name,onChange:e=>en(t=>({...t,name:e.target.value})),onKeyDown:e=>{"Enter"===e.key&&ei()},placeholder:"My Awesome Agent"})]}),(0,s.jsxs)("div",{className:"grid gap-1.5",children:[(0,s.jsxs)(E.J,{htmlFor:"create-endpoint",children:["API Endpoint ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsx)(C.p,{id:"create-endpoint",value:et.endpoint,onChange:e=>en(t=>({...t,endpoint:e.target.value})),onKeyDown:e=>{"Enter"===e.key&&ei()},placeholder:"https://your-agent-api.com/invoke",className:"font-mono text-sm"})]}),(0,s.jsxs)("div",{className:"grid gap-1.5",children:[(0,s.jsx)(E.J,{htmlFor:"create-type",children:"Agent Type"}),(0,s.jsxs)(w.l6,{value:et.agentType,onValueChange:e=>en(t=>({...t,agentType:e})),children:[(0,s.jsx)(w.bq,{id:"create-type",children:(0,s.jsx)(w.yv,{placeholder:"Select agent type..."})}),(0,s.jsx)(w.gC,{children:k.map(e=>(0,s.jsx)(w.eb,{value:e.value,children:e.label},e.value))})]})]}),(0,s.jsxs)("div",{className:"grid gap-1.5",children:[(0,s.jsx)(E.J,{htmlFor:"create-description",children:"Description"}),(0,s.jsx)("textarea",{id:"create-description",value:et.description,onChange:e=>en(t=>({...t,description:e.target.value})),placeholder:"A brief description of what this agent does...",rows:3,className:"flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 resize-none"})]})]}),(0,s.jsxs)(N.Es,{children:[(0,s.jsx)(N.HM,{asChild:!0,children:(0,s.jsx)(j.$,{variant:"outline",disabled:S,children:"Cancel"})}),(0,s.jsxs)(j.$,{onClick:ei,disabled:S,children:[S&&(0,s.jsx)(f.A,{className:"mr-2 h-4 w-4 animate-spin"}),"Create Agent"]})]})]})}),(0,s.jsx)(N.lG,{open:B,onOpenChange:e=>{Q(e),e||ee(null)},children:(0,s.jsxs)(N.Cf,{className:"sm:max-w-[480px]",children:[(0,s.jsxs)(N.c7,{children:[(0,s.jsx)(N.L3,{children:"Edit Agent"}),(0,s.jsxs)(N.rr,{children:["Update the details for ",(0,s.jsx)("strong",{children:null==Y?void 0:Y.name}),"."]})]}),(0,s.jsxs)("div",{className:"grid gap-4 py-2",children:[(0,s.jsxs)("div",{className:"grid gap-1.5",children:[(0,s.jsxs)(E.J,{htmlFor:"edit-name",children:["Name ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsx)(C.p,{id:"edit-name",value:et.name,onChange:e=>en(t=>({...t,name:e.target.value})),onKeyDown:e=>{"Enter"===e.key&&er()},placeholder:"My Awesome Agent"})]}),(0,s.jsxs)("div",{className:"grid gap-1.5",children:[(0,s.jsxs)(E.J,{htmlFor:"edit-endpoint",children:["API Endpoint ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsx)(C.p,{id:"edit-endpoint",value:et.endpoint,onChange:e=>en(t=>({...t,endpoint:e.target.value})),onKeyDown:e=>{"Enter"===e.key&&er()},placeholder:"https://your-agent-api.com/invoke",className:"font-mono text-sm"})]}),(0,s.jsxs)("div",{className:"grid gap-1.5",children:[(0,s.jsx)(E.J,{htmlFor:"edit-type",children:"Agent Type"}),(0,s.jsxs)(w.l6,{value:et.agentType,onValueChange:e=>en(t=>({...t,agentType:e})),children:[(0,s.jsx)(w.bq,{id:"edit-type",children:(0,s.jsx)(w.yv,{placeholder:"Select agent type..."})}),(0,s.jsx)(w.gC,{children:k.map(e=>(0,s.jsx)(w.eb,{value:e.value,children:e.label},e.value))})]})]}),(0,s.jsxs)("div",{className:"grid gap-1.5",children:[(0,s.jsx)(E.J,{htmlFor:"edit-description",children:"Description"}),(0,s.jsx)("textarea",{id:"edit-description",value:et.description,onChange:e=>en(t=>({...t,description:e.target.value})),placeholder:"A brief description of what this agent does...",rows:3,className:"flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 resize-none"})]})]}),(0,s.jsxs)(N.Es,{children:[(0,s.jsx)(N.HM,{asChild:!0,children:(0,s.jsx)(j.$,{variant:"outline",disabled:S,onClick:()=>ee(null),children:"Cancel"})}),(0,s.jsxs)(j.$,{onClick:er,disabled:S,children:[S&&(0,s.jsx)(f.A,{className:"mr-2 h-4 w-4 animate-spin"}),"Save Changes"]})]})]})}),(0,s.jsx)(x.Lt,{open:U.open,onOpenChange:e=>M(t=>({...t,open:e})),children:(0,s.jsxs)(x.EO,{children:[(0,s.jsxs)(x.wd,{children:[(0,s.jsx)(x.r7,{children:U.title}),(0,s.jsx)(x.$v,{children:U.description})]}),(0,s.jsx)(x.ck,{children:(0,s.jsx)(x.Rx,{onClick:()=>M(e=>({...e,open:!1})),children:"OK"})})]})}),(0,s.jsx)(c.T,{open:$.open,onOpenChange:e=>q(t=>({...t,open:e})),title:"Delete Agent",description:'Are you sure you want to delete "'.concat(null==(e=$.agent)?void 0:e.name,'"? This action cannot be undone.'),onConfirm:el,confirmText:"Delete",variant:"destructive"})]})}},34212:(e,t,n)=>{"use strict";function s(e,[t,n]){return Math.min(n,Math.max(t,e))}n.d(t,{q:()=>s})},46767:(e,t,n)=>{"use strict";n.d(t,{Bc:()=>r,ZI:()=>d,k$:()=>o,m_:()=>l});var s=n(95155);n(12115);var a=n(53583),i=n(64269);function r(e){let{delayDuration:t=0,...n}=e;return(0,s.jsx)(a.Kq,{"data-slot":"tooltip-provider",delayDuration:t,...n})}function l(e){let{...t}=e;return(0,s.jsx)(r,{children:(0,s.jsx)(a.bL,{"data-slot":"tooltip",...t})})}function o(e){let{...t}=e;return(0,s.jsx)(a.l9,{"data-slot":"tooltip-trigger",...t})}function d(e){let{className:t,sideOffset:n=0,children:r,...l}=e;return(0,s.jsx)(a.ZL,{children:(0,s.jsxs)(a.UC,{"data-slot":"tooltip-content",sideOffset:n,className:(0,i.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...l,children:[r,(0,s.jsx)(a.i3,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},50952:(e,t,n)=>{Promise.resolve().then(n.bind(n,17254))}},e=>{e.O(0,[187,539,292,355,594,924,905,441,493,358],()=>e(e.s=50952)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{6259:(e,t,a)=>{"use strict";a.d(t,{SQ:()=>o,_2:()=>c,mB:()=>d,rI:()=>s,ty:()=>l});var n=a(95155);a(12115);var r=a(24595),i=a(64269);function s(e){let{...t}=e;return(0,n.jsx)(r.bL,{"data-slot":"dropdown-menu",...t})}function l(e){let{...t}=e;return(0,n.jsx)(r.l9,{"data-slot":"dropdown-menu-trigger",...t})}function o(e){let{className:t,sideOffset:a=4,...s}=e;return(0,n.jsx)(r.ZL,{children:(0,n.jsx)(r.UC,{"data-slot":"dropdown-menu-content",sideOffset:a,className:(0,i.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 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...s})})}function c(e){let{className:t,inset:a,variant:s="default",...l}=e;return(0,n.jsx)(r.q7,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":s,className:(0,i.cn)("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...l})}function d(e){let{className:t,...a}=e;return(0,n.jsx)(r.wv,{"data-slot":"dropdown-menu-separator",className:(0,i.cn)("bg-border -mx-1 my-1 h-px",t),...a})}},24323:(e,t,a)=>{"use strict";a.d(t,{P:()=>x,T:()=>f});var n=a(95155),r=a(12115),i=a(52619),s=a.n(i),l=a(68321),o=a(76784),c=a(7831),d=a(41444),u=a(3998),h=a(51834);let m=(0,d.h)("AnalyticsConsent");async function f(e){await c.userApi.userMeUpdate({userProfileRequest:{analyticsConsent:e}})}function x(){let[e,t]=(0,r.useState)(null),a=(0,r.useRef)(!1);(0,r.useEffect)(()=>{let e=!1;return c.userApi.userMeRetrieve().then(a=>{var n;e||t(null!=(n=a.analyticsConsent)?n:"unset")}).catch(e=>{m.debug({err:e},"Could not load analytics consent (not authenticated yet?)")}),()=>{e=!0}},[]);let i=async e=>{a.current=!0,t(e);try{await f(e)}catch(e){m.error({err:e},"Failed to save analytics consent")}};return(0,n.jsxs)(n.Fragment,{children:["accepted"===e&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.GoogleAnalytics,{gaId:"G-2P6K2HWVEE"}),(0,n.jsx)(l.default,{id:"microsoft-clarity",strategy:"afterInteractive",children:'(function(c,l,a,r,i,t,y){\n c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};\n t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;\n y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);\n })(window, document, "clarity", "script", "xowemo04qg");'})]}),(0,n.jsx)(h.lG,{open:"unset"===e,onOpenChange:e=>{e||a.current||i("declined")},children:(0,n.jsxs)(h.Cf,{children:[(0,n.jsxs)(h.c7,{children:[(0,n.jsx)(h.L3,{children:"Help us improve HackAgent"}),(0,n.jsxs)(h.rr,{children:["We'd like to use optional analytics to understand how HackAgent is used. This is separate from the cookies that keep you signed in, and you can change it anytime in Settings. See our"," ",(0,n.jsx)(s(),{href:"https://hackagent.dev/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Privacy Policy"}),"."]})]}),(0,n.jsxs)(h.Es,{children:[(0,n.jsx)(u.$,{variant:"outline",onClick:()=>i("declined"),children:"Not now"}),(0,n.jsx)(u.$,{onClick:()=>i("accepted"),children:"Sounds good"})]})]})})]})}},24394:()=>{},27180:(e,t,a)=>{"use strict";a.d(t,{Authorization:()=>C});var n=a(95155),r=a(67176),i=a(20063),s=a(12115),l=a(34105),o=a(7831),c=a(41444);let d=(0,c.h)("Auth0Adapter");function u(e){let{children:t}=e,{getAccessTokenSilently:i,isAuthenticated:c,isLoading:u,loginWithRedirect:h,logout:m,user:f}=(0,r.WB)(),[x,g]=(0,s.useState)(!1),p=(0,s.useRef)(!1),v=(0,s.useCallback)(async()=>{let e=await i()||"";return(0,o.ki)(e),e},[i]);(0,s.useEffect)(()=>{let e;if(u)return;let t=!1;if(!c){(0,o.ki)(null),g(!0),p.current=!1;return}let n=async()=>{try{if(await v(),!p.current){p.current=!0;let{userApi:e}=await Promise.resolve().then(a.bind(a,7831));e.userMeRetrieve().catch(()=>d.debug("User profile synchronization deferred"))}}catch(e){d.error({err:e},"Unable to obtain Auth0 access token"),(0,o.ki)(null)}finally{t||g(!0)}};return n(),e=setInterval(()=>void n(),6e5),()=>{t=!0,e&&clearInterval(e)}},[c,u,v]);let j=(0,s.useCallback)(async()=>{await h({appState:{returnTo:"/"}})},[h]),y=(0,s.useCallback)(async()=>{(0,o.ki)(null),await m({logoutParams:{returnTo:window.location.origin}})},[m]),k=(0,s.useMemo)(()=>({provider:"auth0",user:f,isAuthenticated:c,isLoading:u||c&&!x,login:j,logout:y,getAccessTokenSilently:v}),[f,c,u,x,j,y,v]);return(0,n.jsx)(l.c.Provider,{value:k,children:t})}function h(e){let{config:t,children:a}=e,l=(0,i.useRouter)(),o=(0,s.useCallback)(e=>{l.push((null==e?void 0:e.returnTo)||"/")},[l]);if(!t.auth0Domain||!t.auth0ClientId||!t.auth0Audience)return(0,n.jsx)(m,{provider:"Auth0"});let c=t.auth0RedirectUri||window.location.origin;return(0,n.jsx)(r.y2,{domain:t.auth0Domain,clientId:t.auth0ClientId,authorizationParams:{redirect_uri:c,audience:t.auth0Audience,scope:"openid profile email"},onRedirectCallback:o,cacheLocation:"localstorage",children:(0,n.jsx)(u,{children:a})})}function m(e){let{provider:t}=e;return(0,n.jsx)("div",{role:"alert",className:"flex min-h-screen items-center justify-center p-6 text-center",children:(0,n.jsxs)("p",{children:[t," authentication is selected but its runtime configuration is incomplete."]})})}let f=async()=>"mock-dev-token";function x(e){let{children:t}=e,[a,r]=(0,s.useState)(!1);(0,s.useEffect)(()=>((0,o.ki)("mock-dev-token"),r(!0),()=>(0,o.ki)(null)),[]);let i=(0,s.useMemo)(()=>({provider:"disabled",user:{email:"dev@hackagent.local",name:"Dev User",preferred_username:"dev",picture:'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48"><rect fill="%23ccc" width="48" height="48"/><text x="50%25" y="50%25" dominant-baseline="middle" text-anchor="middle" font-family="sans-serif" font-size="24" fill="%23666">D</text></svg>'},isAuthenticated:!0,isLoading:!a,login:void 0,logout:void 0,getAccessTokenSilently:f}),[a]);return(0,n.jsx)(l.c.Provider,{value:i,children:t})}var g=a(5313);let p=(0,c.h)("KeycloakAdapter"),v=async()=>"",j={provider:"keycloak",user:void 0,isAuthenticated:!1,isLoading:!0,login:void 0,logout:void 0,getAccessTokenSilently:v};function y(e){let{config:t,children:r}=e,[i,c]=(0,s.useState)(j);return((0,s.useEffect)(()=>{let e;if(!t.keycloakRealmUrl||!t.keycloakClientId)return;let n=new URL(t.keycloakRealmUrl),r="/realms/",i=n.pathname.indexOf(r),s=i>=0?"".concat(n.origin).concat(n.pathname.slice(0,i)):n.origin,l=i>=0?n.pathname.slice(i+r.length).split("/")[0]:n.pathname.split("/").filter(Boolean).at(-1)||"hackagent",d=new g.A({url:s,realm:l,clientId:t.keycloakClientId}),u=!1,h=async()=>{await d.updateToken(60);let e=d.token||"";return(0,o.ki)(e||null),e};return(async()=>{try{var t,n,r,i,s;let l=await d.init({onLoad:"login-required",silentCheckSsoRedirectUri:"".concat(window.location.origin,"/silent-check-sso.html"),pkceMethod:"S256"});if(u)return;if(!l){(0,o.ki)(null),c({provider:"keycloak",user:void 0,isAuthenticated:!1,isLoading:!1,login:async()=>{await d.login()},logout:void 0,getAccessTokenSilently:v});return}let m={sub:d.subject,email:null==(t=d.tokenParsed)?void 0:t.email,name:null==(n=d.tokenParsed)?void 0:n.name,given_name:null==(r=d.tokenParsed)?void 0:r.given_name,family_name:null==(i=d.tokenParsed)?void 0:i.family_name,preferred_username:null==(s=d.tokenParsed)?void 0:s.preferred_username};await h();let{userApi:f}=await Promise.resolve().then(a.bind(a,7831));f.userMeRetrieve().catch(()=>p.debug("User profile synchronization deferred")),c({provider:"keycloak",user:m,isAuthenticated:!0,isLoading:!1,login:async()=>{await d.login()},logout:async()=>{(0,o.ki)(null),await d.logout({redirectUri:window.location.origin})},getAccessTokenSilently:h}),e=setInterval(()=>{h().catch(e=>p.error({err:e},"Unable to refresh Keycloak access token"))},3e4)}catch(e){p.error({err:e},"Keycloak initialization failed"),(0,o.ki)(null),u||c({...j,isLoading:!1})}})(),()=>{u=!0,e&&clearInterval(e),(0,o.ki)(null)}},[t.keycloakClientId,t.keycloakRealmUrl]),t.keycloakRealmUrl&&t.keycloakClientId)?(0,n.jsx)(l.c.Provider,{value:i,children:r}):(0,n.jsx)("div",{role:"alert",className:"flex min-h-screen items-center justify-center p-6 text-center",children:(0,n.jsx)("p",{children:"Keycloak authentication is selected but its runtime configuration is incomplete."})})}function k(e){return{authProvider:e.disableAuth?"disabled":"auth0"===e.authProvider||"keycloak"===e.authProvider||"disabled"===e.authProvider?e.authProvider:e.auth0Domain&&e.auth0ClientId?"auth0":"keycloak",auth0Domain:e.auth0Domain||"",auth0ClientId:e.auth0ClientId||"",auth0Audience:e.auth0Audience||"",auth0RedirectUri:e.auth0RedirectUri||"",keycloakRealmUrl:e.keycloakRealmUrl||"",keycloakClientId:e.keycloakClientId||"",apiUrl:e.apiUrl||""}}a(95704);var b=a(95704);let w=(0,c.h)("useRuntimeConfig"),N=k({authProvider:b.env.NEXT_PUBLIC_AUTH_PROVIDER,auth0Domain:b.env.NEXT_PUBLIC_AUTH0_DOMAIN,auth0ClientId:b.env.NEXT_PUBLIC_AUTH0_CLIENT_ID,auth0Audience:b.env.NEXT_PUBLIC_AUTH0_AUDIENCE,auth0RedirectUri:b.env.NEXT_PUBLIC_AUTH0_REDIRECT_URI,keycloakRealmUrl:b.env.NEXT_PUBLIC_KEYCLOAK_REALM_URL||"",keycloakClientId:b.env.NEXT_PUBLIC_KEYCLOAK_CLIENT_ID||"",apiUrl:b.env.NEXT_PUBLIC_API_URL||"",disableAuth:!0});function C(e){let{children:t}=e,{config:a,isLoading:r}=function(){let[e,t]=(0,s.useState)(N),[a,n]=(0,s.useState)(!0);return(0,s.useEffect)(()=>{(async()=>{try{let e=await fetch("/config.json");if(!e.ok)throw Error("Failed to load config: ".concat(e.status));let a=k(await e.json());w.info("Runtime config loaded successfully"),t(a)}catch(e){w.warn("Failed to load runtime config, using build-time defaults"),t(N)}finally{n(!1)}})()},[]),{config:e,isLoading:a}}();if(r)return null;switch(a.authProvider){case"auth0":return(0,n.jsx)(h,{config:a,children:t});case"keycloak":return(0,n.jsx)(y,{config:a,children:t});case"disabled":return(0,n.jsx)(x,{children:t})}}},34105:(e,t,a)=>{"use strict";a.d(t,{c:()=>n});let n=(0,a(12115).createContext)(void 0)},46767:(e,t,a)=>{"use strict";a.d(t,{Bc:()=>s,ZI:()=>c,k$:()=>o,m_:()=>l});var n=a(95155);a(12115);var r=a(53583),i=a(64269);function s(e){let{delayDuration:t=0,...a}=e;return(0,n.jsx)(r.Kq,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function l(e){let{...t}=e;return(0,n.jsx)(s,{children:(0,n.jsx)(r.bL,{"data-slot":"tooltip",...t})})}function o(e){let{...t}=e;return(0,n.jsx)(r.l9,{"data-slot":"tooltip-trigger",...t})}function c(e){let{className:t,sideOffset:a=0,children:s,...l}=e;return(0,n.jsx)(r.ZL,{children:(0,n.jsxs)(r.UC,{"data-slot":"tooltip-content",sideOffset:a,className:(0,i.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...l,children:[s,(0,n.jsx)(r.i3,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},51834:(e,t,a)=>{"use strict";a.d(t,{Cf:()=>u,Es:()=>m,HM:()=>c,L3:()=>f,c7:()=>h,lG:()=>l,rr:()=>x});var n=a(95155);a(12115);var r=a(88292),i=a(65229),s=a(64269);function l(e){let{...t}=e;return(0,n.jsx)(r.bL,{"data-slot":"dialog",...t})}function o(e){let{...t}=e;return(0,n.jsx)(r.ZL,{"data-slot":"dialog-portal",...t})}function c(e){let{...t}=e;return(0,n.jsx)(r.bm,{"data-slot":"dialog-close",...t})}function d(e){let{className:t,...a}=e;return(0,n.jsx)(r.hJ,{"data-slot":"dialog-overlay",className:(0,s.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function u(e){let{className:t,children:a,...l}=e;return(0,n.jsxs)(o,{"data-slot":"dialog-portal",children:[(0,n.jsx)(d,{}),(0,n.jsxs)(r.UC,{"data-slot":"dialog-content",className:(0,s.cn)("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...l,children:[a,(0,n.jsxs)(r.bm,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,n.jsx)(i.A,{}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function h(e){let{className:t,...a}=e;return(0,n.jsx)("div",{"data-slot":"dialog-header",className:(0,s.cn)("flex flex-col gap-2 text-center sm:text-left",t),...a})}function m(e){let{className:t,...a}=e;return(0,n.jsx)("div",{"data-slot":"dialog-footer",className:(0,s.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function f(e){let{className:t,...a}=e;return(0,n.jsx)(r.hE,{"data-slot":"dialog-title",className:(0,s.cn)("text-lg leading-none font-semibold",t),...a})}function x(e){let{className:t,...a}=e;return(0,n.jsx)(r.VY,{"data-slot":"dialog-description",className:(0,s.cn)("text-muted-foreground text-sm",t),...a})}},63479:(e,t,a)=>{"use strict";a.d(t,{D:()=>s,N:()=>c});var n=a(95155),r=a(12115);let i=(0,r.createContext)({theme:"system",resolvedTheme:"light",setTheme:()=>{}});function s(){return(0,r.useContext)(i)}let l="hackagent-theme";function o(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function c(e){let{children:t}=e,[a,s]=(0,r.useState)("system"),[c,d]=(0,r.useState)("light"),u=e=>{let t=document.documentElement;"dark"===e?t.classList.add("dark"):t.classList.remove("dark")};return(0,r.useEffect)(()=>{var e;let t=null!=(e=localStorage.getItem(l))?e:"system";s(t);let a="system"===t?o():t;d(a),u(a)},[]),(0,r.useEffect)(()=>{let e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{if("system"===a){let e=o();d(e),u(e)}};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[a]),(0,n.jsx)(i.Provider,{value:{theme:a,resolvedTheme:c,setTheme:e=>{localStorage.setItem(l,e),s(e);let t="system"===e?o():e;d(t),u(t)}},children:t})}},75377:(e,t,a)=>{Promise.resolve().then(a.bind(a,27180)),Promise.resolve().then(a.bind(a,96280)),Promise.resolve().then(a.t.bind(a,93836,23))},80230:(e,t,a)=>{"use strict";a.d(t,{h:()=>s});var n=a(12115),r=a(34105);let i=async()=>"";function s(){let e=(0,n.useContext)(r.c);return e||{provider:"disabled",user:void 0,isAuthenticated:!1,isLoading:!0,login:void 0,logout:void 0,getAccessTokenSilently:i}}},86259:(e,t,a)=>{"use strict";a.d(t,{w:()=>s});var n=a(95155);a(12115);var r=a(57268),i=a(64269);function s(e){let{className:t,orientation:a="horizontal",decorative:s=!0,...l}=e;return(0,n.jsx)(r.b,{"data-slot":"separator-root",decorative:s,orientation:a,className:(0,i.cn)("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...l})}},91903:()=>{},93836:()=>{},96280:(e,t,a)=>{"use strict";a.d(t,{default:()=>K});var n=a(95155),r=a(12115),i=a(52619),s=a.n(i),l=a(80230),o=a(20063),c=a(15239),d=a(3998),u=a(86259),h=a(46591),m=a(64269);function f(e){let{className:t,...a}=e;return(0,n.jsx)(h.bL,{"data-slot":"avatar",className:(0,m.cn)("relative flex size-8 shrink-0 overflow-hidden rounded-full",t),...a})}function x(e){let{className:t,...a}=e;return(0,n.jsx)(h._V,{"data-slot":"avatar-image",className:(0,m.cn)("aspect-square size-full",t),...a})}function g(e){let{className:t,...a}=e;return(0,n.jsx)(h.H4,{"data-slot":"avatar-fallback",className:(0,m.cn)("bg-muted flex size-full items-center justify-center rounded-full",t),...a})}var p=a(6259),v=a(46767);let j=(0,r.createContext)(void 0),y=e=>{let{children:t}=e,[a,i]=(0,r.useState)(!1);return(0,n.jsx)(j.Provider,{value:{isCollapsed:a,toggleSidebar:()=>{i(e=>!e)}},children:t})},k=()=>{let e=(0,r.useContext)(j);if(!e)throw Error("useSidebar must be used within a SidebarProvider");return e};var b=a(65993),w=a(78192),N=a(37397),C=a(46826),A=a(80534),_=a(89715),I=a(5370),U=a(47937);let L=[{items:[{href:"/",label:"Home",icon:b.A}]},{title:"Test",items:[{href:"/agents",label:"Agents",icon:w.A},{href:"/attacks",label:"Attacks",icon:N.A},{href:"/attacks/builder",label:"New attack",icon:C.A}]},{title:"Results",items:[{href:"/stats",label:"Runs",icon:A.A},{href:"/reports",label:"Reports",icon:_.A}]},{title:"Resources",items:[{href:"/api-keys",label:"API Keys",icon:I.A},{href:"https://docs.hackagent.dev",label:"Docs",icon:U.A,external:!0}]}];var E=a(77931),P=a(26550),R=a(12108),T=a(15870),z=a(84926);let S=()=>{let{user:e,isLoading:t,isAuthenticated:a,logout:i}=(0,l.h)(),h=(0,o.usePathname)(),{isCollapsed:j,toggleSidebar:y}=k();if(t||!a||!e)return null;let b=e.name||e.preferred_username||e.email||"User",w=(e=>{if(!e||""===e.trim())return"?";if(e.startsWith("0x")&&e.length>10)return e.substring(0,2).toUpperCase();let t=e.split(/[\s.\-_@]+/).filter(e=>e.length>0);return 0===t.length?"?":1===t.length?t[0].substring(0,2).toUpperCase():((t[0][0]||"")+(t[t.length-1][0]||"")).toUpperCase()})(b),N=function(e,t){let a=e.split(/[?#]/)[0].replace(/(.)\/+$/,"$1");return t.filter(e=>"/"===e?"/"===a:a===e||a.startsWith("".concat(e,"/"))).sort((e,t)=>t.length-e.length)[0]}(h,L.flatMap(e=>e.items.filter(e=>!e.external).map(e=>e.href))),C=e=>{let{href:t,icon:a,label:r,isActive:i}=e;return(0,n.jsxs)(v.m_,{children:[(0,n.jsx)(v.k$,{asChild:!0,children:(0,n.jsx)(s(),{href:t,"aria-current":i?"page":void 0,children:(0,n.jsxs)(d.$,{variant:i?"secondary":"ghost",className:(0,m.cn)("w-full",j?"justify-center px-2":"justify-start",i&&"font-semibold"),children:[(0,n.jsx)(a,{className:(0,m.cn)("h-4 w-4",!j&&"mr-2")}),!j&&r]})})}),j&&(0,n.jsx)(v.ZI,{side:"right",children:(0,n.jsx)("p",{children:r})})]})},A=e=>{let{href:t,icon:a,label:r}=e;return(0,n.jsxs)(v.m_,{children:[(0,n.jsx)(v.k$,{asChild:!0,children:(0,n.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"block",children:(0,n.jsxs)(d.$,{variant:"ghost",className:(0,m.cn)("w-full cursor-pointer",j?"justify-center px-2":"justify-start"),children:[(0,n.jsx)(a,{className:(0,m.cn)("h-4 w-4",!j&&"mr-2")}),!j&&r]})})}),j&&(0,n.jsx)(v.ZI,{side:"right",children:(0,n.jsx)("p",{children:r})})]})};return(0,n.jsx)(v.Bc,{delayDuration:0,children:(0,n.jsxs)("aside",{className:(0,m.cn)("flex h-screen flex-col border-r bg-background p-4 fixed left-0 top-0 transition-all duration-300",j?"w-16":"w-52"),children:[(0,n.jsxs)("div",{className:(0,m.cn)("mb-6 flex",j?"flex-col items-center gap-2 px-0":"flex-row items-center justify-between px-2"),children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(c.default,{src:"/raccoon.png",alt:"HackAgent Logo",width:24,height:24,className:"text-primary"}),!j&&(0,n.jsx)("h3",{className:"font-semibold text-lg",children:"HackAgent"})]}),(0,n.jsxs)(v.m_,{children:[(0,n.jsx)(v.k$,{asChild:!0,children:(0,n.jsx)(d.$,{variant:"ghost",size:"icon",onClick:y,"aria-label":j?"Expand sidebar":"Collapse sidebar",className:"h-7 w-7 shrink-0",children:j?(0,n.jsx)(E.A,{className:"h-4 w-4"}):(0,n.jsx)(P.A,{className:"h-4 w-4"})})}),(0,n.jsx)(v.ZI,{side:"right",children:(0,n.jsx)("p",{children:j?"Expand sidebar":"Collapse sidebar"})})]})]}),(0,n.jsx)("nav",{className:(0,m.cn)("flex-1 space-y-4",j?"px-0":"px-2"),children:L.map((e,t)=>{var a;return(0,n.jsxs)(r.Fragment,{children:[t>0&&(0,n.jsx)(u.w,{}),(0,n.jsxs)("div",{className:"space-y-1",children:[e.title&&!j&&(0,n.jsx)("div",{className:"px-2 py-1",children:(0,n.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:e.title})}),e.items.map(e=>e.external?(0,n.jsx)(A,{href:e.href,icon:e.icon,label:e.label},e.href):(0,n.jsx)(C,{href:e.href,icon:e.icon,label:e.label,isActive:e.href===N},e.href))]})]},null!=(a=e.title)?a:t)})}),(0,n.jsx)(u.w,{className:"my-4"}),e&&(0,n.jsx)("div",{className:"mt-auto",children:(0,n.jsxs)(p.rI,{children:[(0,n.jsx)(p.ty,{asChild:!0,children:(0,n.jsxs)(d.$,{variant:"ghost",className:(0,m.cn)("w-full p-2 h-auto hover:bg-accent hover:text-accent-foreground",j?"justify-center":"justify-between"),children:[(0,n.jsxs)("div",{className:(0,m.cn)("flex items-center",j?"justify-center":"gap-3"),children:[(0,n.jsxs)(f,{className:"h-8 w-8",children:[e.picture&&(0,n.jsx)(x,{src:e.picture,alt:b}),(0,n.jsx)(g,{children:w})]}),!j&&(0,n.jsxs)("div",{className:"text-sm text-left",children:[(0,n.jsx)("p",{className:"font-medium leading-none truncate max-w-[105px]",children:b}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Account"})]})]}),!j&&(0,n.jsx)(R.A,{className:"h-4 w-4 opacity-50"})]})}),(0,n.jsxs)(p.SQ,{align:"start",className:"w-52 mb-2",side:"top",children:[(0,n.jsx)(p._2,{asChild:!0,children:(0,n.jsxs)(s(),{href:"/profile",className:"cursor-pointer",children:[(0,n.jsx)(T.A,{className:"mr-2 h-4 w-4"}),(0,n.jsx)("span",{children:"Settings"})]})}),(0,n.jsx)(p.mB,{}),i&&(0,n.jsxs)(p._2,{onClick:()=>i(),className:"cursor-pointer text-red-600 focus:text-red-600",children:[(0,n.jsx)(z.A,{className:"mr-2 h-4 w-4"}),(0,n.jsx)("span",{children:"Log Out"})]})]})]})})]})})};var D=a(35299),B=a(63479),H=a(24323);let M=(0,a(41444).h)("ClientLayout"),$=e=>{let{children:t}=e,{isCollapsed:a}=k();return(0,n.jsx)("main",{className:"flex-1 overflow-y-auto transition-all duration-300 ".concat(a?"ml-16":"ml-52"),children:t})},K=e=>{let{children:t}=e,{isAuthenticated:a,isLoading:i,user:s,provider:o}=(0,l.h)();return((0,r.useEffect)(()=>{M.info("ClientLayout initialized - provider=".concat(o,", isLoading=").concat(i,", isAuthenticated=").concat(a))},[o,i,a]),i)?(M.info("Authentication provider loading, showing spinner"),(0,n.jsx)("div",{className:"flex items-center justify-center min-h-screen",children:(0,n.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,n.jsx)(D.A,{className:"h-8 w-8 animate-spin text-muted-foreground"}),(0,n.jsx)("p",{className:"text-muted-foreground",children:"Loading Authentication..."})]})})):a?(M.info("User authenticated - provider=".concat(o,", userId=").concat(null==s?void 0:s.sub,", email=").concat(null==s?void 0:s.email)),(0,n.jsx)(B.N,{children:(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"flex h-screen overflow-hidden print-layout-root",children:[(0,n.jsx)(S,{}),(0,n.jsx)($,{children:t})]}),(0,n.jsx)(H.P,{})]})})):(M.info("User not authenticated, rendering public view"),(0,n.jsx)(n.Fragment,{children:t}))}}},e=>{e.O(0,[475,330,187,539,292,355,619,9,921,701,924,441,493,358],()=>e(e.s=75377)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{6259:(e,t,a)=>{"use strict";a.d(t,{SQ:()=>o,_2:()=>c,mB:()=>d,rI:()=>s,ty:()=>l});var n=a(95155);a(12115);var r=a(24595),i=a(64269);function s(e){let{...t}=e;return(0,n.jsx)(r.bL,{"data-slot":"dropdown-menu",...t})}function l(e){let{...t}=e;return(0,n.jsx)(r.l9,{"data-slot":"dropdown-menu-trigger",...t})}function o(e){let{className:t,sideOffset:a=4,...s}=e;return(0,n.jsx)(r.ZL,{children:(0,n.jsx)(r.UC,{"data-slot":"dropdown-menu-content",sideOffset:a,className:(0,i.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 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...s})})}function c(e){let{className:t,inset:a,variant:s="default",...l}=e;return(0,n.jsx)(r.q7,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":s,className:(0,i.cn)("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...l})}function d(e){let{className:t,...a}=e;return(0,n.jsx)(r.wv,{"data-slot":"dropdown-menu-separator",className:(0,i.cn)("bg-border -mx-1 my-1 h-px",t),...a})}},24323:(e,t,a)=>{"use strict";a.d(t,{P:()=>x,T:()=>f});var n=a(95155),r=a(12115),i=a(52619),s=a.n(i),l=a(68321),o=a(76784),c=a(7831),d=a(41444),u=a(3998),h=a(51834);let m=(0,d.h)("AnalyticsConsent");async function f(e){await c.userApi.userMeUpdate({userProfileRequest:{analyticsConsent:e}})}function x(){let[e,t]=(0,r.useState)(null),a=(0,r.useRef)(!1);(0,r.useEffect)(()=>{let e=!1;return c.userApi.userMeRetrieve().then(a=>{var n;e||t(null!=(n=a.analyticsConsent)?n:"unset")}).catch(e=>{m.debug({err:e},"Could not load analytics consent (not authenticated yet?)")}),()=>{e=!0}},[]);let i=async e=>{a.current=!0,t(e);try{await f(e)}catch(e){m.error({err:e},"Failed to save analytics consent")}};return(0,n.jsxs)(n.Fragment,{children:["accepted"===e&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.GoogleAnalytics,{gaId:"G-2P6K2HWVEE"}),(0,n.jsx)(l.default,{id:"microsoft-clarity",strategy:"afterInteractive",children:'(function(c,l,a,r,i,t,y){\n c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};\n t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;\n y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);\n })(window, document, "clarity", "script", "xowemo04qg");'})]}),(0,n.jsx)(h.lG,{open:"unset"===e,onOpenChange:e=>{e||a.current||i("declined")},children:(0,n.jsxs)(h.Cf,{children:[(0,n.jsxs)(h.c7,{children:[(0,n.jsx)(h.L3,{children:"Help us improve HackAgent"}),(0,n.jsxs)(h.rr,{children:["We'd like to use optional analytics to understand how HackAgent is used. This is separate from the cookies that keep you signed in, and you can change it anytime in Settings. See our"," ",(0,n.jsx)(s(),{href:"https://hackagent.dev/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Privacy Policy"}),"."]})]}),(0,n.jsxs)(h.Es,{children:[(0,n.jsx)(u.$,{variant:"outline",onClick:()=>i("declined"),children:"Not now"}),(0,n.jsx)(u.$,{onClick:()=>i("accepted"),children:"Sounds good"})]})]})})]})}},24394:()=>{},27180:(e,t,a)=>{"use strict";a.d(t,{Authorization:()=>C});var n=a(95155),r=a(67176),i=a(20063),s=a(12115),l=a(34105),o=a(7831),c=a(41444);let d=(0,c.h)("Auth0Adapter");function u(e){let{children:t}=e,{getAccessTokenSilently:i,isAuthenticated:c,isLoading:u,loginWithRedirect:h,logout:m,user:f}=(0,r.WB)(),[x,g]=(0,s.useState)(!1),p=(0,s.useRef)(!1),v=(0,s.useCallback)(async()=>{let e=await i()||"";return(0,o.ki)(e),e},[i]);(0,s.useEffect)(()=>{let e;if(u)return;let t=!1;if(!c){(0,o.ki)(null),g(!0),p.current=!1;return}let n=async()=>{try{if(await v(),!p.current){p.current=!0;let{userApi:e}=await Promise.resolve().then(a.bind(a,7831));e.userMeRetrieve().catch(()=>d.debug("User profile synchronization deferred"))}}catch(e){d.error({err:e},"Unable to obtain Auth0 access token"),(0,o.ki)(null)}finally{t||g(!0)}};return n(),e=setInterval(()=>void n(),6e5),()=>{t=!0,e&&clearInterval(e)}},[c,u,v]);let j=(0,s.useCallback)(async()=>{await h({appState:{returnTo:"/"}})},[h]),y=(0,s.useCallback)(async()=>{(0,o.ki)(null),await m({logoutParams:{returnTo:window.location.origin}})},[m]),k=(0,s.useMemo)(()=>({provider:"auth0",user:f,isAuthenticated:c,isLoading:u||c&&!x,login:j,logout:y,getAccessTokenSilently:v}),[f,c,u,x,j,y,v]);return(0,n.jsx)(l.c.Provider,{value:k,children:t})}function h(e){let{config:t,children:a}=e,l=(0,i.useRouter)(),o=(0,s.useCallback)(e=>{l.push((null==e?void 0:e.returnTo)||"/")},[l]);if(!t.auth0Domain||!t.auth0ClientId||!t.auth0Audience)return(0,n.jsx)(m,{provider:"Auth0"});let c=t.auth0RedirectUri||window.location.origin;return(0,n.jsx)(r.y2,{domain:t.auth0Domain,clientId:t.auth0ClientId,authorizationParams:{redirect_uri:c,audience:t.auth0Audience,scope:"openid profile email"},onRedirectCallback:o,cacheLocation:"localstorage",children:(0,n.jsx)(u,{children:a})})}function m(e){let{provider:t}=e;return(0,n.jsx)("div",{role:"alert",className:"flex min-h-screen items-center justify-center p-6 text-center",children:(0,n.jsxs)("p",{children:[t," authentication is selected but its runtime configuration is incomplete."]})})}let f=async()=>"mock-dev-token";function x(e){let{children:t}=e,[a,r]=(0,s.useState)(!1);(0,s.useEffect)(()=>((0,o.ki)("mock-dev-token"),r(!0),()=>(0,o.ki)(null)),[]);let i=(0,s.useMemo)(()=>({provider:"disabled",user:{email:"dev@hackagent.local",name:"Dev User",preferred_username:"dev",picture:'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48"><rect fill="%23ccc" width="48" height="48"/><text x="50%25" y="50%25" dominant-baseline="middle" text-anchor="middle" font-family="sans-serif" font-size="24" fill="%23666">D</text></svg>'},isAuthenticated:!0,isLoading:!a,login:void 0,logout:void 0,getAccessTokenSilently:f}),[a]);return(0,n.jsx)(l.c.Provider,{value:i,children:t})}var g=a(5313);let p=(0,c.h)("KeycloakAdapter"),v=async()=>"",j={provider:"keycloak",user:void 0,isAuthenticated:!1,isLoading:!0,login:void 0,logout:void 0,getAccessTokenSilently:v};function y(e){let{config:t,children:r}=e,[i,c]=(0,s.useState)(j);return((0,s.useEffect)(()=>{let e;if(!t.keycloakRealmUrl||!t.keycloakClientId)return;let n=new URL(t.keycloakRealmUrl),r="/realms/",i=n.pathname.indexOf(r),s=i>=0?"".concat(n.origin).concat(n.pathname.slice(0,i)):n.origin,l=i>=0?n.pathname.slice(i+r.length).split("/")[0]:n.pathname.split("/").filter(Boolean).at(-1)||"hackagent",d=new g.A({url:s,realm:l,clientId:t.keycloakClientId}),u=!1,h=async()=>{await d.updateToken(60);let e=d.token||"";return(0,o.ki)(e||null),e};return(async()=>{try{var t,n,r,i,s;let l=await d.init({onLoad:"login-required",silentCheckSsoRedirectUri:"".concat(window.location.origin,"/silent-check-sso.html"),pkceMethod:"S256"});if(u)return;if(!l){(0,o.ki)(null),c({provider:"keycloak",user:void 0,isAuthenticated:!1,isLoading:!1,login:async()=>{await d.login()},logout:void 0,getAccessTokenSilently:v});return}let m={sub:d.subject,email:null==(t=d.tokenParsed)?void 0:t.email,name:null==(n=d.tokenParsed)?void 0:n.name,given_name:null==(r=d.tokenParsed)?void 0:r.given_name,family_name:null==(i=d.tokenParsed)?void 0:i.family_name,preferred_username:null==(s=d.tokenParsed)?void 0:s.preferred_username};await h();let{userApi:f}=await Promise.resolve().then(a.bind(a,7831));f.userMeRetrieve().catch(()=>p.debug("User profile synchronization deferred")),c({provider:"keycloak",user:m,isAuthenticated:!0,isLoading:!1,login:async()=>{await d.login()},logout:async()=>{(0,o.ki)(null),await d.logout({redirectUri:window.location.origin})},getAccessTokenSilently:h}),e=setInterval(()=>{h().catch(e=>p.error({err:e},"Unable to refresh Keycloak access token"))},3e4)}catch(e){p.error({err:e},"Keycloak initialization failed"),(0,o.ki)(null),u||c({...j,isLoading:!1})}})(),()=>{u=!0,e&&clearInterval(e),(0,o.ki)(null)}},[t.keycloakClientId,t.keycloakRealmUrl]),t.keycloakRealmUrl&&t.keycloakClientId)?(0,n.jsx)(l.c.Provider,{value:i,children:r}):(0,n.jsx)("div",{role:"alert",className:"flex min-h-screen items-center justify-center p-6 text-center",children:(0,n.jsx)("p",{children:"Keycloak authentication is selected but its runtime configuration is incomplete."})})}function k(e){return{authProvider:e.disableAuth?"disabled":"auth0"===e.authProvider||"keycloak"===e.authProvider||"disabled"===e.authProvider?e.authProvider:e.auth0Domain&&e.auth0ClientId?"auth0":"keycloak",auth0Domain:e.auth0Domain||"",auth0ClientId:e.auth0ClientId||"",auth0Audience:e.auth0Audience||"",auth0RedirectUri:e.auth0RedirectUri||"",keycloakRealmUrl:e.keycloakRealmUrl||"",keycloakClientId:e.keycloakClientId||"",apiUrl:e.apiUrl||""}}a(95704);var b=a(95704);let w=(0,c.h)("useRuntimeConfig"),N=k({authProvider:b.env.NEXT_PUBLIC_AUTH_PROVIDER,auth0Domain:b.env.NEXT_PUBLIC_AUTH0_DOMAIN,auth0ClientId:b.env.NEXT_PUBLIC_AUTH0_CLIENT_ID,auth0Audience:b.env.NEXT_PUBLIC_AUTH0_AUDIENCE,auth0RedirectUri:b.env.NEXT_PUBLIC_AUTH0_REDIRECT_URI,keycloakRealmUrl:b.env.NEXT_PUBLIC_KEYCLOAK_REALM_URL||"",keycloakClientId:b.env.NEXT_PUBLIC_KEYCLOAK_CLIENT_ID||"",apiUrl:b.env.NEXT_PUBLIC_API_URL||"",disableAuth:!0});function C(e){let{children:t}=e,{config:a,isLoading:r}=function(){let[e,t]=(0,s.useState)(N),[a,n]=(0,s.useState)(!0);return(0,s.useEffect)(()=>{(async()=>{try{let e=await fetch("/config.json");if(!e.ok)throw Error("Failed to load config: ".concat(e.status));let a=k(await e.json());w.info("Runtime config loaded successfully"),t(a)}catch(e){w.warn("Failed to load runtime config, using build-time defaults"),t(N)}finally{n(!1)}})()},[]),{config:e,isLoading:a}}();if(r)return null;switch(a.authProvider){case"auth0":return(0,n.jsx)(h,{config:a,children:t});case"keycloak":return(0,n.jsx)(y,{config:a,children:t});case"disabled":return(0,n.jsx)(x,{children:t})}}},34105:(e,t,a)=>{"use strict";a.d(t,{c:()=>n});let n=(0,a(12115).createContext)(void 0)},46767:(e,t,a)=>{"use strict";a.d(t,{Bc:()=>s,ZI:()=>c,k$:()=>o,m_:()=>l});var n=a(95155);a(12115);var r=a(53583),i=a(64269);function s(e){let{delayDuration:t=0,...a}=e;return(0,n.jsx)(r.Kq,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function l(e){let{...t}=e;return(0,n.jsx)(s,{children:(0,n.jsx)(r.bL,{"data-slot":"tooltip",...t})})}function o(e){let{...t}=e;return(0,n.jsx)(r.l9,{"data-slot":"tooltip-trigger",...t})}function c(e){let{className:t,sideOffset:a=0,children:s,...l}=e;return(0,n.jsx)(r.ZL,{children:(0,n.jsxs)(r.UC,{"data-slot":"tooltip-content",sideOffset:a,className:(0,i.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...l,children:[s,(0,n.jsx)(r.i3,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},51834:(e,t,a)=>{"use strict";a.d(t,{Cf:()=>u,Es:()=>m,HM:()=>c,L3:()=>f,c7:()=>h,lG:()=>l,rr:()=>x});var n=a(95155);a(12115);var r=a(88292),i=a(65229),s=a(64269);function l(e){let{...t}=e;return(0,n.jsx)(r.bL,{"data-slot":"dialog",...t})}function o(e){let{...t}=e;return(0,n.jsx)(r.ZL,{"data-slot":"dialog-portal",...t})}function c(e){let{...t}=e;return(0,n.jsx)(r.bm,{"data-slot":"dialog-close",...t})}function d(e){let{className:t,...a}=e;return(0,n.jsx)(r.hJ,{"data-slot":"dialog-overlay",className:(0,s.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function u(e){let{className:t,children:a,...l}=e;return(0,n.jsxs)(o,{"data-slot":"dialog-portal",children:[(0,n.jsx)(d,{}),(0,n.jsxs)(r.UC,{"data-slot":"dialog-content",className:(0,s.cn)("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...l,children:[a,(0,n.jsxs)(r.bm,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,n.jsx)(i.A,{}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function h(e){let{className:t,...a}=e;return(0,n.jsx)("div",{"data-slot":"dialog-header",className:(0,s.cn)("flex flex-col gap-2 text-center sm:text-left",t),...a})}function m(e){let{className:t,...a}=e;return(0,n.jsx)("div",{"data-slot":"dialog-footer",className:(0,s.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function f(e){let{className:t,...a}=e;return(0,n.jsx)(r.hE,{"data-slot":"dialog-title",className:(0,s.cn)("text-lg leading-none font-semibold",t),...a})}function x(e){let{className:t,...a}=e;return(0,n.jsx)(r.VY,{"data-slot":"dialog-description",className:(0,s.cn)("text-muted-foreground text-sm",t),...a})}},63479:(e,t,a)=>{"use strict";a.d(t,{D:()=>s,N:()=>c});var n=a(95155),r=a(12115);let i=(0,r.createContext)({theme:"system",resolvedTheme:"light",setTheme:()=>{}});function s(){return(0,r.useContext)(i)}let l="hackagent-theme";function o(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function c(e){let{children:t}=e,[a,s]=(0,r.useState)("system"),[c,d]=(0,r.useState)("light"),u=e=>{let t=document.documentElement;"dark"===e?t.classList.add("dark"):t.classList.remove("dark")};return(0,r.useEffect)(()=>{var e;let t=null!=(e=localStorage.getItem(l))?e:"system";s(t);let a="system"===t?o():t;d(a),u(a)},[]),(0,r.useEffect)(()=>{let e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{if("system"===a){let e=o();d(e),u(e)}};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[a]),(0,n.jsx)(i.Provider,{value:{theme:a,resolvedTheme:c,setTheme:e=>{localStorage.setItem(l,e),s(e);let t="system"===e?o():e;d(t),u(t)}},children:t})}},75377:(e,t,a)=>{Promise.resolve().then(a.bind(a,27180)),Promise.resolve().then(a.bind(a,96280)),Promise.resolve().then(a.t.bind(a,93836,23))},80230:(e,t,a)=>{"use strict";a.d(t,{h:()=>s});var n=a(12115),r=a(34105);let i=async()=>"";function s(){let e=(0,n.useContext)(r.c);return e||{provider:"disabled",user:void 0,isAuthenticated:!1,isLoading:!0,login:void 0,logout:void 0,getAccessTokenSilently:i}}},86259:(e,t,a)=>{"use strict";a.d(t,{w:()=>s});var n=a(95155);a(12115);var r=a(57268),i=a(64269);function s(e){let{className:t,orientation:a="horizontal",decorative:s=!0,...l}=e;return(0,n.jsx)(r.b,{"data-slot":"separator-root",decorative:s,orientation:a,className:(0,i.cn)("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...l})}},91903:()=>{},93836:()=>{},96280:(e,t,a)=>{"use strict";a.d(t,{default:()=>K});var n=a(95155),r=a(12115),i=a(52619),s=a.n(i),l=a(80230),o=a(20063),c=a(15239),d=a(3998),u=a(86259),h=a(46591),m=a(64269);function f(e){let{className:t,...a}=e;return(0,n.jsx)(h.bL,{"data-slot":"avatar",className:(0,m.cn)("relative flex size-8 shrink-0 overflow-hidden rounded-full",t),...a})}function x(e){let{className:t,...a}=e;return(0,n.jsx)(h._V,{"data-slot":"avatar-image",className:(0,m.cn)("aspect-square size-full",t),...a})}function g(e){let{className:t,...a}=e;return(0,n.jsx)(h.H4,{"data-slot":"avatar-fallback",className:(0,m.cn)("bg-muted flex size-full items-center justify-center rounded-full",t),...a})}var p=a(6259),v=a(46767);let j=(0,r.createContext)(void 0),y=e=>{let{children:t}=e,[a,i]=(0,r.useState)(!1);return(0,n.jsx)(j.Provider,{value:{isCollapsed:a,toggleSidebar:()=>{i(e=>!e)}},children:t})},k=()=>{let e=(0,r.useContext)(j);if(!e)throw Error("useSidebar must be used within a SidebarProvider");return e};var b=a(65993),w=a(78192),N=a(37397),C=a(46826),A=a(80534),_=a(89715),I=a(5370),U=a(47937);let L=[{items:[{href:"/",label:"Home",icon:b.A}]},{title:"Test",items:[{href:"/agents",label:"Agents",icon:w.A},{href:"/attacks",label:"Attacks",icon:N.A},{href:"/attacks/builder",label:"New attack",icon:C.A}]},{title:"Results",items:[{href:"/stats",label:"Runs",icon:A.A},{href:"/reports",label:"Reports",icon:_.A}]},{title:"Resources",items:[{href:"/api-keys",label:"API Keys",icon:I.A},{href:"https://docs.hackagent.dev",label:"Docs",icon:U.A,external:!0}]}];var E=a(77931),P=a(26550),R=a(12108),T=a(15870),z=a(84926);let S=()=>{let{user:e,isLoading:t,isAuthenticated:a,logout:i}=(0,l.h)(),h=(0,o.usePathname)(),{isCollapsed:j,toggleSidebar:y}=k();if(t||!a||!e)return null;let b=e.name||e.preferred_username||e.email||"User",w=(e=>{if(!e||""===e.trim())return"?";if(e.startsWith("0x")&&e.length>10)return e.substring(0,2).toUpperCase();let t=e.split(/[\s.\-_@]+/).filter(e=>e.length>0);return 0===t.length?"?":1===t.length?t[0].substring(0,2).toUpperCase():((t[0][0]||"")+(t[t.length-1][0]||"")).toUpperCase()})(b),N=function(e,t){let a=e.split(/[?#]/)[0].replace(/(.)\/+$/,"$1");return t.filter(e=>"/"===e?"/"===a:a===e||a.startsWith("".concat(e,"/"))).sort((e,t)=>t.length-e.length)[0]}(h,L.flatMap(e=>e.items.filter(e=>!e.external).map(e=>e.href))),C=e=>{let{href:t,icon:a,label:r,isActive:i}=e;return(0,n.jsxs)(v.m_,{children:[(0,n.jsx)(v.k$,{asChild:!0,children:(0,n.jsx)(s(),{href:t,"aria-current":i?"page":void 0,children:(0,n.jsxs)(d.$,{variant:i?"secondary":"ghost",className:(0,m.cn)("w-full",j?"justify-center px-2":"justify-start",i&&"font-semibold"),children:[(0,n.jsx)(a,{className:(0,m.cn)("h-4 w-4",!j&&"mr-2")}),!j&&r]})})}),j&&(0,n.jsx)(v.ZI,{side:"right",children:(0,n.jsx)("p",{children:r})})]})},A=e=>{let{href:t,icon:a,label:r}=e;return(0,n.jsxs)(v.m_,{children:[(0,n.jsx)(v.k$,{asChild:!0,children:(0,n.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"block",children:(0,n.jsxs)(d.$,{variant:"ghost",className:(0,m.cn)("w-full cursor-pointer",j?"justify-center px-2":"justify-start"),children:[(0,n.jsx)(a,{className:(0,m.cn)("h-4 w-4",!j&&"mr-2")}),!j&&r]})})}),j&&(0,n.jsx)(v.ZI,{side:"right",children:(0,n.jsx)("p",{children:r})})]})};return(0,n.jsx)(v.Bc,{delayDuration:0,children:(0,n.jsxs)("aside",{className:(0,m.cn)("flex h-screen flex-col border-r bg-background p-4 fixed left-0 top-0 transition-all duration-300",j?"w-16":"w-52"),children:[(0,n.jsxs)("div",{className:(0,m.cn)("mb-6 flex",j?"flex-col items-center gap-2 px-0":"flex-row items-center justify-between px-2"),children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(c.default,{src:"/raccoon.png",alt:"HackAgent Logo",width:24,height:24,className:"text-primary"}),!j&&(0,n.jsx)("h3",{className:"font-semibold text-lg",children:"HackAgent"})]}),(0,n.jsxs)(v.m_,{children:[(0,n.jsx)(v.k$,{asChild:!0,children:(0,n.jsx)(d.$,{variant:"ghost",size:"icon",onClick:y,"aria-label":j?"Expand sidebar":"Collapse sidebar",className:"h-7 w-7 shrink-0",children:j?(0,n.jsx)(E.A,{className:"h-4 w-4"}):(0,n.jsx)(P.A,{className:"h-4 w-4"})})}),(0,n.jsx)(v.ZI,{side:"right",children:(0,n.jsx)("p",{children:j?"Expand sidebar":"Collapse sidebar"})})]})]}),(0,n.jsx)("nav",{className:(0,m.cn)("flex-1 space-y-4",j?"px-0":"px-2"),children:L.map((e,t)=>{var a;return(0,n.jsxs)(r.Fragment,{children:[t>0&&(0,n.jsx)(u.w,{}),(0,n.jsxs)("div",{className:"space-y-1",children:[e.title&&!j&&(0,n.jsx)("div",{className:"px-2 py-1",children:(0,n.jsx)("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:e.title})}),e.items.map(e=>e.external?(0,n.jsx)(A,{href:e.href,icon:e.icon,label:e.label},e.href):(0,n.jsx)(C,{href:e.href,icon:e.icon,label:e.label,isActive:e.href===N},e.href))]})]},null!=(a=e.title)?a:t)})}),(0,n.jsx)(u.w,{className:"my-4"}),e&&(0,n.jsx)("div",{className:"mt-auto",children:(0,n.jsxs)(p.rI,{children:[(0,n.jsx)(p.ty,{asChild:!0,children:(0,n.jsxs)(d.$,{variant:"ghost",className:(0,m.cn)("w-full p-2 h-auto hover:bg-accent hover:text-accent-foreground",j?"justify-center":"justify-between"),children:[(0,n.jsxs)("div",{className:(0,m.cn)("flex items-center",j?"justify-center":"gap-3"),children:[(0,n.jsxs)(f,{className:"h-8 w-8",children:[e.picture&&(0,n.jsx)(x,{src:e.picture,alt:b}),(0,n.jsx)(g,{children:w})]}),!j&&(0,n.jsxs)("div",{className:"text-sm text-left",children:[(0,n.jsx)("p",{className:"font-medium leading-none truncate max-w-[105px]",children:b}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Account"})]})]}),!j&&(0,n.jsx)(R.A,{className:"h-4 w-4 opacity-50"})]})}),(0,n.jsxs)(p.SQ,{align:"start",className:"w-52 mb-2",side:"top",children:[(0,n.jsx)(p._2,{asChild:!0,children:(0,n.jsxs)(s(),{href:"/profile",className:"cursor-pointer",children:[(0,n.jsx)(T.A,{className:"mr-2 h-4 w-4"}),(0,n.jsx)("span",{children:"Settings"})]})}),(0,n.jsx)(p.mB,{}),i&&(0,n.jsxs)(p._2,{onClick:()=>i(),className:"cursor-pointer text-red-600 focus:text-red-600",children:[(0,n.jsx)(z.A,{className:"mr-2 h-4 w-4"}),(0,n.jsx)("span",{children:"Log Out"})]})]})]})})]})})};var D=a(35299),B=a(63479),H=a(24323);let M=(0,a(41444).h)("ClientLayout"),$=e=>{let{children:t}=e,{isCollapsed:a}=k();return(0,n.jsx)("main",{className:"flex-1 overflow-y-auto transition-all duration-300 ".concat(a?"ml-16":"ml-52"),children:t})},K=e=>{let{children:t}=e,{isAuthenticated:a,isLoading:i,user:s,provider:o}=(0,l.h)();return((0,r.useEffect)(()=>{M.info("ClientLayout initialized - provider=".concat(o,", isLoading=").concat(i,", isAuthenticated=").concat(a))},[o,i,a]),i)?(M.info("Authentication provider loading, showing spinner"),(0,n.jsx)("div",{className:"flex items-center justify-center min-h-screen",children:(0,n.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,n.jsx)(D.A,{className:"h-8 w-8 animate-spin text-muted-foreground"}),(0,n.jsx)("p",{className:"text-muted-foreground",children:"Loading Authentication..."})]})})):a?(M.info("User authenticated - provider=".concat(o,", userId=").concat(null==s?void 0:s.sub,", email=").concat(null==s?void 0:s.email)),(0,n.jsx)(B.N,{children:(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"flex h-screen overflow-hidden print-layout-root",children:[(0,n.jsx)(S,{}),(0,n.jsx)($,{children:t})]}),(0,n.jsx)(H.P,{})]})})):(M.info("User not authenticated, rendering public view"),(0,n.jsx)(n.Fragment,{children:t}))}}},e=>{e.O(0,[475,330,187,539,292,355,619,928,921,130,924,441,493,358],()=>e(e.s=75377)),_N_E=e.O()}]);