@whoz-oss/coday-client 3.10.0 → 3.10.1

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 (70) hide show
  1. package/browser/{chunk-BGWBjvwQ.js → chunk-1LsZyzCe.js} +1 -1
  2. package/browser/{chunk-BZz5YcIe.js → chunk-3cJY-y-K.js} +1 -1
  3. package/browser/{chunk-DyD311Os.js → chunk-538NlE7s.js} +1 -1
  4. package/browser/{chunk-TVb3vD1X.js → chunk-7IDkwdi0.js} +1 -1
  5. package/browser/{chunk-Bsfux6Ph.js → chunk-B1Tv2Ebu.js} +1 -1
  6. package/browser/{chunk-CaXQnKEW.js → chunk-B3QJ8PhL.js} +1 -1
  7. package/browser/{chunk-Cm1-CoCU.js → chunk-B5rsaW2b.js} +1 -1
  8. package/browser/{chunk-Bampatce.js → chunk-B8YsdH5W.js} +1 -1
  9. package/browser/{chunk-DqUBpSwH.js → chunk-BA23pyYd.js} +1 -1
  10. package/browser/{chunk-MIRdYHA6.js → chunk-BDkp40LI.js} +2 -2
  11. package/browser/{chunk-CC3VBVuU.js → chunk-BGILLpeT.js} +1 -1
  12. package/browser/{chunk-DlBSfQiR.js → chunk-BJ4jWcd_.js} +1 -1
  13. package/browser/{chunk-7R07nDPZ.js → chunk-BM08gUt6.js} +1 -1
  14. package/browser/{chunk-BrxgjRsW.js → chunk-BPt7wScV.js} +1 -1
  15. package/browser/{chunk-EUKNlco8.js → chunk-BTvzcZ1s.js} +1 -1
  16. package/browser/{chunk-BwivPJC3.js → chunk-BWbwxWKa.js} +1 -1
  17. package/browser/{chunk-Cdb2CX2Q.js → chunk-BkVtgsRG.js} +1 -1
  18. package/browser/{chunk-CjRw0M6d.js → chunk-Bpth0xKt.js} +2 -2
  19. package/browser/{chunk-D-WJGEwY.js → chunk-BsaBLbYE.js} +1 -1
  20. package/browser/{chunk-loSw75E5.js → chunk-BuSLhs6I.js} +1 -1
  21. package/browser/{chunk-Ba945z-E.js → chunk-C1xOKACR.js} +1 -1
  22. package/browser/{chunk-D7ubXpF6.js → chunk-C2OedcEU.js} +1 -1
  23. package/browser/{chunk-Cksl5AD8.js → chunk-C2fhkSx5.js} +1 -1
  24. package/browser/{chunk-BJzVFbX0.js → chunk-C2rlLV-W.js} +2 -2
  25. package/browser/{chunk-YSBUI5Fn.js → chunk-CE3CVQYJ.js} +1 -1
  26. package/browser/{chunk-C6ZQFaHV.js → chunk-CFQpQly7.js} +1 -1
  27. package/browser/{chunk-D5aCMhSf.js → chunk-CFU4PT4-.js} +1 -1
  28. package/browser/{chunk-DbP7sgsG.js → chunk-CJdqLI4x.js} +1 -1
  29. package/browser/{chunk-Y92IHTQj.js → chunk-CPUMKiuB.js} +1 -1
  30. package/browser/{chunk-5c_jmV57.js → chunk-CQXNmLda.js} +1 -1
  31. package/browser/{chunk-DJEez-Yg.js → chunk-CRoK_gKa.js} +1 -1
  32. package/browser/{chunk-Bd2CH26d.js → chunk-CUmZcEGx.js} +1 -1
  33. package/browser/{chunk-QtmhX0X1.js → chunk-CX02zIUT.js} +1 -1
  34. package/browser/{chunk-nhFfwaIm.js → chunk-CaZlpLSd.js} +1 -1
  35. package/browser/{chunk-CiUdI8_s.js → chunk-CbXRaZ5e.js} +1 -1
  36. package/browser/{chunk-CGBTxglZ.js → chunk-CeTOubPL.js} +1 -1
  37. package/browser/{chunk-GAwnZGMd.js → chunk-CgurnF00.js} +1 -1
  38. package/browser/{chunk-DxZvzVYB.js → chunk-CkfpO0Ui.js} +1 -1
  39. package/browser/chunk-CmUHL9Tg.js +1 -0
  40. package/browser/{chunk-CnlsBi4s.js → chunk-CqkMIKRg.js} +5 -5
  41. package/browser/{chunk-Bc0GuFnm.js → chunk-Ct1RBakr.js} +1 -1
  42. package/browser/{chunk-B66h5RwF.js → chunk-D73z8OGT.js} +1 -1
  43. package/browser/{chunk-Brb8CVHb.js → chunk-DAEEDI2g.js} +1 -1
  44. package/browser/{chunk-LGfFQHFU.js → chunk-DAOnyJ7c.js} +1 -1
  45. package/browser/{chunk-DNFP1xT9.js → chunk-DB97l2cM.js} +1 -1
  46. package/browser/{chunk-CfqdY4Mw.js → chunk-DDdQkLim.js} +1 -1
  47. package/browser/{chunk-ybjAFl7I.js → chunk-Db48BeGH.js} +1 -1
  48. package/browser/{chunk-Dkhotd2g.js → chunk-DbmrZGxd.js} +1 -1
  49. package/browser/{chunk-BJAZmQ7l.js → chunk-DfnvTJ7R.js} +1 -1
  50. package/browser/{chunk-BdHdehhQ.js → chunk-DhYK3aRa.js} +1 -1
  51. package/browser/{chunk-DR_6ChV2.js → chunk-Dk3h998A.js} +1 -1
  52. package/browser/{chunk-wlytGgOb.js → chunk-DkFy_8tW.js} +1 -1
  53. package/browser/{chunk-CIgFq37k.js → chunk-DngVvVw1.js} +1 -1
  54. package/browser/{chunk-DIahKei4.js → chunk-DqfT0kg4.js} +1 -1
  55. package/browser/{chunk-B0MWdje6.js → chunk-Dx68TWlI.js} +1 -1
  56. package/browser/{chunk-BJWqi_bR.js → chunk-DxhQHX1Y.js} +1 -1
  57. package/browser/{chunk-CWKiaMQh.js → chunk-DzZlI93U.js} +1 -1
  58. package/browser/{chunk-Cc8mup8X.js → chunk-IM1UfDv7.js} +1 -1
  59. package/browser/{chunk-8Uub9JWj.js → chunk-LlG18Htx.js} +1 -1
  60. package/browser/{chunk-DLGt0phX.js → chunk-O1wALPze.js} +1 -1
  61. package/browser/{chunk-CUISPpfB.js → chunk-TngDHyxp.js} +1 -1
  62. package/browser/{chunk-BIM6FY9C.js → chunk-TxtSVoMY.js} +1 -1
  63. package/browser/{chunk-tOt8zs3G.js → chunk-ZtJnIW3b.js} +1 -1
  64. package/browser/{chunk-Dvnd0JmL.js → chunk-_aUM9QLW.js} +1 -1
  65. package/browser/{chunk-C516j1og.js → chunk-b_e1R_FV.js} +1 -1
  66. package/browser/{chunk-CThSpKxi.js → chunk-zmM38Yul.js} +2 -2
  67. package/browser/index.html +1 -1
  68. package/browser/{main-SY6UM2GV.js → main-MX6O2FH4.js} +1 -1
  69. package/package.json +1 -1
  70. package/browser/chunk-DWsrvadK.js +0 -1
@@ -1,4 +1,4 @@
1
- import {ct as vi,A as Aw,C as Cg,y as Hg,aL as Do,aM as qn,bE as vt,aO as wt,cZ as fn,cT as Gp,c_ as he$1,cV as yg,bA as vC,v as vs,bB as DC,j as fl,b5 as nT,ad as Vg,n as eC,t as tC,X as XE,aW as w,bv as kg,I as IC,E as wC,g,az as Qt$1,c$ as kn,bw as St,bG as p,aP as G,aR as As,aU as Ue,aV as U,H as Hi,an as ce$1,al as yt,ae as Ot,u as ue,d0 as va,bL as pe,bs as Cl,ap as Vy,bu as Ve$1,c2 as ME,aA as sn,D as Fg,bt as Qn,aS as K,cO as is,bN as F,bR as bd,cL as Id,bP as Yy,a9 as dC,k as Ag,ac as mC,bV as Ky,aN as Nn,bD as ge,aQ as $a,bM as mr,d1 as lt,d2 as wt$1,d3 as I,b_ as xt,bX as Pt,a as P,aZ as ks,aw as pl,cJ as Rg,W as WC,ax as hl,b$ as FC,a8 as Zg,c3 as kt,cD as Ce,cz as Xr,aa as If,ab as wf}from'./main-SY6UM2GV.js';var Xt=["tooltip"],Ut=20;var qt=new w("mat-tooltip-scroll-strategy",{providedIn:"root",factory:()=>{let n=g(pe);return ()=>kt(n,{scrollThrottle:Ut})}}),$t=new w("mat-tooltip-default-options",{providedIn:"root",factory:()=>({showDelay:0,hideDelay:0,touchendHideDelay:1500})});var Ht="tooltip-panel",Kt={passive:true},Jt=8,te=8,ee=24,ie=200,ne=(()=>{class n{_elementRef=g(Qt$1);_ngZone=g(G);_platform=g(p);_ariaDescriber=g($a);_focusMonitor=g(St);_dir=g(Qn);_injector=g(pe);_viewContainerRef=g(mr);_mediaMatcher=g(lt);_document=g(U);_renderer=g(As);_animationsDisabled=K();_defaultOptions=g($t,{optional:true});_overlayRef=null;_tooltipInstance=null;_overlayPanelClass;_portal;_position="below";_positionAtOrigin=false;_disabled=false;_tooltipClass;_viewInitialized=false;_pointerExitEventsInitialized=false;_tooltipComponent=Gt;_viewportMargin=8;_currentPosition;_cssClassPrefix="mat-mdc";_ariaDescriptionPending=false;_dirSubscribed=false;get position(){return this._position}set position(t){t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(this._overlayRef),this._tooltipInstance?.show(0),this._overlayRef.updatePosition()));}get positionAtOrigin(){return this._positionAtOrigin}set positionAtOrigin(t){this._positionAtOrigin=vi(t),this._detach(),this._overlayRef=null;}get disabled(){return this._disabled}set disabled(t){let e=vi(t);this._disabled!==e&&(this._disabled=e,e?this.hide(0):this._setupPointerEnterEventsIfNeeded(),this._syncAriaDescription(this.message));}get showDelay(){return this._showDelay}set showDelay(t){this._showDelay=fn(t);}_showDelay;get hideDelay(){return this._hideDelay}set hideDelay(t){this._hideDelay=fn(t),this._tooltipInstance&&(this._tooltipInstance._mouseLeaveHideDelay=this._hideDelay);}_hideDelay;touchGestures="auto";get message(){return this._message}set message(t){let e=this._message;this._message=t!=null?String(t).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage()),this._syncAriaDescription(e);}_message="";get tooltipClass(){return this._tooltipClass}set tooltipClass(t){this._tooltipClass=t,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass);}_eventCleanups=[];_touchstartTimeout=null;_destroyed=new ce$1;_isDestroyed=false;constructor(){let t=this._defaultOptions;t&&(this._showDelay=t.showDelay,this._hideDelay=t.hideDelay,t.position&&(this.position=t.position),t.positionAtOrigin&&(this.positionAtOrigin=t.positionAtOrigin),t.touchGestures&&(this.touchGestures=t.touchGestures),t.tooltipClass&&(this.tooltipClass=t.tooltipClass)),this._viewportMargin=Jt;}ngAfterViewInit(){this._viewInitialized=true,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(Vy(this._destroyed)).subscribe(t=>{t?t==="keyboard"&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0));});}ngOnDestroy(){let t=this._elementRef.nativeElement;this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),this._eventCleanups.forEach(e=>e()),this._eventCleanups.length=0,this._destroyed.next(),this._destroyed.complete(),this._isDestroyed=true,this._ariaDescriber.removeDescription(t,this.message,"tooltip"),this._focusMonitor.stopMonitoring(t);}show(t=this.showDelay,e){if(this.disabled||!this.message||this._isTooltipVisible()){this._tooltipInstance?._cancelPendingAnimations();return}let i=this._createOverlay(e);this._detach(),this._portal=this._portal||new wt$1(this._tooltipComponent,this._viewContainerRef);let r=this._tooltipInstance=i.attach(this._portal).instance;r._triggerElement=this._elementRef.nativeElement,r._mouseLeaveHideDelay=this._hideDelay,r.afterHidden().pipe(Vy(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),r.show(t);}hide(t=this.hideDelay){let e=this._tooltipInstance;e&&(e.isVisible()?e.hide(t):(e._cancelPendingAnimations(),this._detach()));}toggle(t){this._isTooltipVisible()?this.hide():this.show(void 0,t);}_isTooltipVisible(){return !!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(t){if(this._overlayRef){let a=this._overlayRef.getConfig().positionStrategy;if((!this.positionAtOrigin||!t)&&a._origin instanceof Qt$1)return this._overlayRef;this._detach();}let e=this._injector.get(I).getAncestorScrollContainers(this._elementRef),i=`${this._cssClassPrefix}-${Ht}`,r=xt(this._injector,this.positionAtOrigin?t||this._elementRef:this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(false).withViewportMargin(this._viewportMargin).withScrollableContainers(e).withPopoverLocation("global");return r.positionChanges.pipe(Vy(this._destroyed)).subscribe(a=>{this._updateCurrentPositionClass(a.connectionPair),this._tooltipInstance&&a.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0));}),this._overlayRef=Pt(this._injector,{direction:this._dir,positionStrategy:r,panelClass:this._overlayPanelClass?[...this._overlayPanelClass,i]:i,scrollStrategy:this._injector.get(qt)(),disableAnimations:this._animationsDisabled,eventPredicate:this._overlayEventPredicate}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(Vy(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(Vy(this._destroyed)).subscribe(()=>this._tooltipInstance?._handleBodyInteraction()),this._overlayRef.keydownEvents().pipe(Vy(this._destroyed)).subscribe(a=>{a.preventDefault(),a.stopPropagation(),this._ngZone.run(()=>this.hide(0));}),this._defaultOptions?.disableTooltipInteractivity&&this._overlayRef.addPanelClass(`${this._cssClassPrefix}-tooltip-panel-non-interactive`),this._dirSubscribed||(this._dirSubscribed=true,this._dir.change.pipe(Vy(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef);})),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null;}_updatePosition(t){let e=t.getConfig().positionStrategy,i=this._getOrigin(),r=this._getOverlayPosition();e.withPositions([this._addOffset(P(P({},i.main),r.main)),this._addOffset(P(P({},i.fallback),r.fallback))]);}_addOffset(t){let e=te,i=!this._dir||this._dir.value=="ltr";return t.originY==="top"?t.offsetY=-e:t.originY==="bottom"?t.offsetY=e:t.originX==="start"?t.offsetX=i?-e:e:t.originX==="end"&&(t.offsetX=i?e:-e),t}_getOrigin(){let t=!this._dir||this._dir.value=="ltr",e=this.position,i;e=="above"||e=="below"?i={originX:"center",originY:e=="above"?"top":"bottom"}:e=="before"||e=="left"&&t||e=="right"&&!t?i={originX:"start",originY:"center"}:(e=="after"||e=="right"&&t||e=="left"&&!t)&&(i={originX:"end",originY:"center"});let{x:r,y:a}=this._invertPosition(i.originX,i.originY);return {main:i,fallback:{originX:r,originY:a}}}_getOverlayPosition(){let t=!this._dir||this._dir.value=="ltr",e=this.position,i;e=="above"?i={overlayX:"center",overlayY:"bottom"}:e=="below"?i={overlayX:"center",overlayY:"top"}:e=="before"||e=="left"&&t||e=="right"&&!t?i={overlayX:"end",overlayY:"center"}:(e=="after"||e=="right"&&t||e=="left"&&!t)&&(i={overlayX:"start",overlayY:"center"});let{x:r,y:a}=this._invertPosition(i.overlayX,i.overlayY);return {main:i,fallback:{overlayX:r,overlayY:a}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),ME(()=>{this._tooltipInstance&&this._overlayRef.updatePosition();},{injector:this._injector}));}_setTooltipClass(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t instanceof Set?Array.from(t):t,this._tooltipInstance._markForCheck());}_invertPosition(t,e){return this.position==="above"||this.position==="below"?e==="top"?e="bottom":e==="bottom"&&(e="top"):t==="end"?t="start":t==="start"&&(t="end"),{x:t,y:e}}_updateCurrentPositionClass(t){let{overlayY:e,originX:i,originY:r}=t,a;if(e==="center"?this._dir&&this._dir.value==="rtl"?a=i==="end"?"left":"right":a=i==="start"?"left":"right":a=e==="bottom"&&r==="top"?"above":"below",a!==this._currentPosition){let A=this._overlayRef;if(A){let ut=`${this._cssClassPrefix}-${Ht}-`;A.removePanelClass(ut+this._currentPosition),A.addPanelClass(ut+a);}this._currentPosition=a;}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._eventCleanups.length||(this._isTouchPlatform()?this.touchGestures!=="off"&&(this._disableNativeGesturesIfNecessary(),this._addListener("touchstart",t=>{let e=t.targetTouches?.[0],i=e?{x:e.clientX,y:e.clientY}:void 0;this._setupPointerExitEventsIfNeeded(),this._touchstartTimeout&&clearTimeout(this._touchstartTimeout);let r=500;this._touchstartTimeout=setTimeout(()=>{this._touchstartTimeout=null,this.show(void 0,i);},this._defaultOptions?.touchLongPressShowDelay??r);})):this._addListener("mouseenter",t=>{this._setupPointerExitEventsIfNeeded();let e;t.x!==void 0&&t.y!==void 0&&(e=t),this.show(void 0,e);}));}_setupPointerExitEventsIfNeeded(){if(!this._pointerExitEventsInitialized){if(this._pointerExitEventsInitialized=true,!this._isTouchPlatform())this._addListener("mouseleave",t=>{let e=t.relatedTarget;(!e||!this._overlayRef?.overlayElement.contains(e))&&this.hide();}),this._addListener("wheel",t=>{if(this._isTooltipVisible()){let e=this._document.elementFromPoint(t.clientX,t.clientY),i=this._elementRef.nativeElement;e!==i&&!i.contains(e)&&this.hide();}});else if(this.touchGestures!=="off"){this._disableNativeGesturesIfNecessary();let t=()=>{this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions?.touchendHideDelay);};this._addListener("touchend",t),this._addListener("touchcancel",t);}}}_addListener(t,e){this._eventCleanups.push(this._renderer.listen(this._elementRef.nativeElement,t,e,Kt));}_isTouchPlatform(){let t=this._defaultOptions?.detectHoverCapability;return typeof t=="function"?!t():this._platform.IOS||this._platform.ANDROID?true:this._platform.isBrowser?!!t&&this._mediaMatcher.matchMedia("(any-hover: none)").matches:false}_disableNativeGesturesIfNecessary(){let t=this.touchGestures;if(t!=="off"){let e=this._elementRef.nativeElement,i=e.style;(t==="on"||e.nodeName!=="INPUT"&&e.nodeName!=="TEXTAREA")&&(i.userSelect=i.msUserSelect=i.webkitUserSelect=i.MozUserSelect="none"),(t==="on"||!e.draggable)&&(i.webkitUserDrag="none"),i.touchAction="none",i.webkitTapHighlightColor="transparent";}}_syncAriaDescription(t){this._ariaDescriptionPending||(this._ariaDescriptionPending=true,this._ariaDescriber.removeDescription(this._elementRef.nativeElement,t,"tooltip"),this._isDestroyed||ME({write:()=>{this._ariaDescriptionPending=false,this.message&&!this.disabled&&this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip");}},{injector:this._injector}));}_overlayEventPredicate=t=>t.type==="keydown"?this._isTooltipVisible()&&t.keyCode===27&&!Ve$1(t):true;static \u0275fac=function(e){return new(e||n)};static \u0275dir=ks({type:n,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-mdc-tooltip-trigger"],hostVars:2,hostBindings:function(e,i){e&2&&Hg("mat-mdc-tooltip-disabled",i.disabled);},inputs:{position:[0,"matTooltipPosition","position"],positionAtOrigin:[0,"matTooltipPositionAtOrigin","positionAtOrigin"],disabled:[0,"matTooltipDisabled","disabled"],showDelay:[0,"matTooltipShowDelay","showDelay"],hideDelay:[0,"matTooltipHideDelay","hideDelay"],touchGestures:[0,"matTooltipTouchGestures","touchGestures"],message:[0,"matTooltip","message"],tooltipClass:[0,"matTooltipClass","tooltipClass"]},exportAs:["matTooltip"]})}return n})(),Gt=(()=>{class n{_changeDetectorRef=g(Cl);_elementRef=g(Qt$1);_isMultiline=false;message;tooltipClass;_showTimeoutId;_hideTimeoutId;_triggerElement;_mouseLeaveHideDelay;_animationsDisabled=K();_tooltip;_closeOnInteraction=false;_isVisible=false;_onHide=new ce$1;_showAnimation="mat-mdc-tooltip-show";_hideAnimation="mat-mdc-tooltip-hide";show(t){this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=setTimeout(()=>{this._toggleVisibility(true),this._showTimeoutId=void 0;},t);}hide(t){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._toggleVisibility(false),this._hideTimeoutId=void 0;},t);}afterHidden(){return this._onHide}isVisible(){return this._isVisible}ngOnDestroy(){this._cancelPendingAnimations(),this._onHide.complete(),this._triggerElement=null;}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0);}_markForCheck(){this._changeDetectorRef.markForCheck();}_handleMouseLeave({relatedTarget:t}){(!t||!this._triggerElement.contains(t))&&(this.isVisible()?this.hide(this._mouseLeaveHideDelay):this._finalizeAnimation(false));}_onShow(){this._isMultiline=this._isTooltipMultiline(),this._markForCheck();}_isTooltipMultiline(){let t=this._elementRef.nativeElement.getBoundingClientRect();return t.height>ee&&t.width>=ie}_handleAnimationEnd({animationName:t}){(t===this._showAnimation||t===this._hideAnimation)&&this._finalizeAnimation(t===this._showAnimation);}_cancelPendingAnimations(){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=this._hideTimeoutId=void 0;}_finalizeAnimation(t){t?this._closeOnInteraction=true:this.isVisible()||this._onHide.next();}_toggleVisibility(t){let e=this._tooltip.nativeElement,i=this._showAnimation,r=this._hideAnimation;if(e.classList.remove(t?r:i),e.classList.add(t?i:r),this._isVisible!==t&&(this._isVisible=t,this._changeDetectorRef.markForCheck()),t&&!this._animationsDisabled&&typeof getComputedStyle=="function"){let a=getComputedStyle(e);(a.getPropertyValue("animation-duration")==="0s"||a.getPropertyValue("animation-name")==="none")&&(this._animationsDisabled=true);}t&&this._onShow(),this._animationsDisabled&&(e.classList.add("_mat-animation-noopable"),this._finalizeAnimation(t));}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Aw({type:n,selectors:[["mat-tooltip-component"]],viewQuery:function(e,i){if(e&1&&Fg(Xt,7),e&2){let r;IC(r=wC())&&(i._tooltip=r.first);}},hostAttrs:["aria-hidden","true"],hostBindings:function(e,i){e&1&&Ag("mouseleave",function(a){return i._handleMouseLeave(a)});},decls:4,vars:5,consts:[["tooltip",""],[1,"mdc-tooltip","mat-mdc-tooltip",3,"animationend"],[1,"mat-mdc-tooltip-surface","mdc-tooltip__surface"]],template:function(e,i){e&1&&(pl(0,"div",1,0),Rg("animationend",function(a){return i._handleAnimationEnd(a)}),pl(2,"div",2),WC(3),hl()()),e&2&&(FC(i.tooltipClass),Hg("mdc-tooltip--multiline",i._isMultiline),XE(3),Zg(i.message));},styles:[`.mat-mdc-tooltip {
1
+ import {ct as vi,A as Aw,C as Cg,y as Hg,aL as Do,aM as qn,bE as vt,aO as wt,cZ as fn,cT as Gp,c_ as he$1,cV as yg,bA as vC,v as vs,bB as DC,j as fl,b5 as nT,ad as Vg,n as eC,t as tC,X as XE,aW as w,bv as kg,I as IC,E as wC,g,az as Qt$1,c$ as kn,bw as St,bG as p,aP as G,aR as As,aU as Ue,aV as U,H as Hi,an as ce$1,al as yt,ae as Ot,u as ue,d0 as va,bL as pe,bs as Cl,ap as Vy,bu as Ve$1,c2 as ME,aA as sn,D as Fg,bt as Qn,aS as K,cO as is,bN as F,bR as bd,cL as Id,bP as Yy,a9 as dC,k as Ag,ac as mC,bV as Ky,aN as Nn,bD as ge,aQ as $a,bM as mr,d1 as lt,d2 as wt$1,d3 as I,b_ as xt,bX as Pt,a as P,aZ as ks,aw as pl,cJ as Rg,W as WC,ax as hl,b$ as FC,a8 as Zg,c3 as kt,cD as Ce,cz as Xr,aa as If,ab as wf}from'./main-MX6O2FH4.js';var Xt=["tooltip"],Ut=20;var qt=new w("mat-tooltip-scroll-strategy",{providedIn:"root",factory:()=>{let n=g(pe);return ()=>kt(n,{scrollThrottle:Ut})}}),$t=new w("mat-tooltip-default-options",{providedIn:"root",factory:()=>({showDelay:0,hideDelay:0,touchendHideDelay:1500})});var Ht="tooltip-panel",Kt={passive:true},Jt=8,te=8,ee=24,ie=200,ne=(()=>{class n{_elementRef=g(Qt$1);_ngZone=g(G);_platform=g(p);_ariaDescriber=g($a);_focusMonitor=g(St);_dir=g(Qn);_injector=g(pe);_viewContainerRef=g(mr);_mediaMatcher=g(lt);_document=g(U);_renderer=g(As);_animationsDisabled=K();_defaultOptions=g($t,{optional:true});_overlayRef=null;_tooltipInstance=null;_overlayPanelClass;_portal;_position="below";_positionAtOrigin=false;_disabled=false;_tooltipClass;_viewInitialized=false;_pointerExitEventsInitialized=false;_tooltipComponent=Gt;_viewportMargin=8;_currentPosition;_cssClassPrefix="mat-mdc";_ariaDescriptionPending=false;_dirSubscribed=false;get position(){return this._position}set position(t){t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(this._overlayRef),this._tooltipInstance?.show(0),this._overlayRef.updatePosition()));}get positionAtOrigin(){return this._positionAtOrigin}set positionAtOrigin(t){this._positionAtOrigin=vi(t),this._detach(),this._overlayRef=null;}get disabled(){return this._disabled}set disabled(t){let e=vi(t);this._disabled!==e&&(this._disabled=e,e?this.hide(0):this._setupPointerEnterEventsIfNeeded(),this._syncAriaDescription(this.message));}get showDelay(){return this._showDelay}set showDelay(t){this._showDelay=fn(t);}_showDelay;get hideDelay(){return this._hideDelay}set hideDelay(t){this._hideDelay=fn(t),this._tooltipInstance&&(this._tooltipInstance._mouseLeaveHideDelay=this._hideDelay);}_hideDelay;touchGestures="auto";get message(){return this._message}set message(t){let e=this._message;this._message=t!=null?String(t).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage()),this._syncAriaDescription(e);}_message="";get tooltipClass(){return this._tooltipClass}set tooltipClass(t){this._tooltipClass=t,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass);}_eventCleanups=[];_touchstartTimeout=null;_destroyed=new ce$1;_isDestroyed=false;constructor(){let t=this._defaultOptions;t&&(this._showDelay=t.showDelay,this._hideDelay=t.hideDelay,t.position&&(this.position=t.position),t.positionAtOrigin&&(this.positionAtOrigin=t.positionAtOrigin),t.touchGestures&&(this.touchGestures=t.touchGestures),t.tooltipClass&&(this.tooltipClass=t.tooltipClass)),this._viewportMargin=Jt;}ngAfterViewInit(){this._viewInitialized=true,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(Vy(this._destroyed)).subscribe(t=>{t?t==="keyboard"&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0));});}ngOnDestroy(){let t=this._elementRef.nativeElement;this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),this._eventCleanups.forEach(e=>e()),this._eventCleanups.length=0,this._destroyed.next(),this._destroyed.complete(),this._isDestroyed=true,this._ariaDescriber.removeDescription(t,this.message,"tooltip"),this._focusMonitor.stopMonitoring(t);}show(t=this.showDelay,e){if(this.disabled||!this.message||this._isTooltipVisible()){this._tooltipInstance?._cancelPendingAnimations();return}let i=this._createOverlay(e);this._detach(),this._portal=this._portal||new wt$1(this._tooltipComponent,this._viewContainerRef);let r=this._tooltipInstance=i.attach(this._portal).instance;r._triggerElement=this._elementRef.nativeElement,r._mouseLeaveHideDelay=this._hideDelay,r.afterHidden().pipe(Vy(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),r.show(t);}hide(t=this.hideDelay){let e=this._tooltipInstance;e&&(e.isVisible()?e.hide(t):(e._cancelPendingAnimations(),this._detach()));}toggle(t){this._isTooltipVisible()?this.hide():this.show(void 0,t);}_isTooltipVisible(){return !!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(t){if(this._overlayRef){let a=this._overlayRef.getConfig().positionStrategy;if((!this.positionAtOrigin||!t)&&a._origin instanceof Qt$1)return this._overlayRef;this._detach();}let e=this._injector.get(I).getAncestorScrollContainers(this._elementRef),i=`${this._cssClassPrefix}-${Ht}`,r=xt(this._injector,this.positionAtOrigin?t||this._elementRef:this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(false).withViewportMargin(this._viewportMargin).withScrollableContainers(e).withPopoverLocation("global");return r.positionChanges.pipe(Vy(this._destroyed)).subscribe(a=>{this._updateCurrentPositionClass(a.connectionPair),this._tooltipInstance&&a.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0));}),this._overlayRef=Pt(this._injector,{direction:this._dir,positionStrategy:r,panelClass:this._overlayPanelClass?[...this._overlayPanelClass,i]:i,scrollStrategy:this._injector.get(qt)(),disableAnimations:this._animationsDisabled,eventPredicate:this._overlayEventPredicate}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(Vy(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(Vy(this._destroyed)).subscribe(()=>this._tooltipInstance?._handleBodyInteraction()),this._overlayRef.keydownEvents().pipe(Vy(this._destroyed)).subscribe(a=>{a.preventDefault(),a.stopPropagation(),this._ngZone.run(()=>this.hide(0));}),this._defaultOptions?.disableTooltipInteractivity&&this._overlayRef.addPanelClass(`${this._cssClassPrefix}-tooltip-panel-non-interactive`),this._dirSubscribed||(this._dirSubscribed=true,this._dir.change.pipe(Vy(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef);})),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null;}_updatePosition(t){let e=t.getConfig().positionStrategy,i=this._getOrigin(),r=this._getOverlayPosition();e.withPositions([this._addOffset(P(P({},i.main),r.main)),this._addOffset(P(P({},i.fallback),r.fallback))]);}_addOffset(t){let e=te,i=!this._dir||this._dir.value=="ltr";return t.originY==="top"?t.offsetY=-e:t.originY==="bottom"?t.offsetY=e:t.originX==="start"?t.offsetX=i?-e:e:t.originX==="end"&&(t.offsetX=i?e:-e),t}_getOrigin(){let t=!this._dir||this._dir.value=="ltr",e=this.position,i;e=="above"||e=="below"?i={originX:"center",originY:e=="above"?"top":"bottom"}:e=="before"||e=="left"&&t||e=="right"&&!t?i={originX:"start",originY:"center"}:(e=="after"||e=="right"&&t||e=="left"&&!t)&&(i={originX:"end",originY:"center"});let{x:r,y:a}=this._invertPosition(i.originX,i.originY);return {main:i,fallback:{originX:r,originY:a}}}_getOverlayPosition(){let t=!this._dir||this._dir.value=="ltr",e=this.position,i;e=="above"?i={overlayX:"center",overlayY:"bottom"}:e=="below"?i={overlayX:"center",overlayY:"top"}:e=="before"||e=="left"&&t||e=="right"&&!t?i={overlayX:"end",overlayY:"center"}:(e=="after"||e=="right"&&t||e=="left"&&!t)&&(i={overlayX:"start",overlayY:"center"});let{x:r,y:a}=this._invertPosition(i.overlayX,i.overlayY);return {main:i,fallback:{overlayX:r,overlayY:a}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),ME(()=>{this._tooltipInstance&&this._overlayRef.updatePosition();},{injector:this._injector}));}_setTooltipClass(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t instanceof Set?Array.from(t):t,this._tooltipInstance._markForCheck());}_invertPosition(t,e){return this.position==="above"||this.position==="below"?e==="top"?e="bottom":e==="bottom"&&(e="top"):t==="end"?t="start":t==="start"&&(t="end"),{x:t,y:e}}_updateCurrentPositionClass(t){let{overlayY:e,originX:i,originY:r}=t,a;if(e==="center"?this._dir&&this._dir.value==="rtl"?a=i==="end"?"left":"right":a=i==="start"?"left":"right":a=e==="bottom"&&r==="top"?"above":"below",a!==this._currentPosition){let A=this._overlayRef;if(A){let ut=`${this._cssClassPrefix}-${Ht}-`;A.removePanelClass(ut+this._currentPosition),A.addPanelClass(ut+a);}this._currentPosition=a;}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._eventCleanups.length||(this._isTouchPlatform()?this.touchGestures!=="off"&&(this._disableNativeGesturesIfNecessary(),this._addListener("touchstart",t=>{let e=t.targetTouches?.[0],i=e?{x:e.clientX,y:e.clientY}:void 0;this._setupPointerExitEventsIfNeeded(),this._touchstartTimeout&&clearTimeout(this._touchstartTimeout);let r=500;this._touchstartTimeout=setTimeout(()=>{this._touchstartTimeout=null,this.show(void 0,i);},this._defaultOptions?.touchLongPressShowDelay??r);})):this._addListener("mouseenter",t=>{this._setupPointerExitEventsIfNeeded();let e;t.x!==void 0&&t.y!==void 0&&(e=t),this.show(void 0,e);}));}_setupPointerExitEventsIfNeeded(){if(!this._pointerExitEventsInitialized){if(this._pointerExitEventsInitialized=true,!this._isTouchPlatform())this._addListener("mouseleave",t=>{let e=t.relatedTarget;(!e||!this._overlayRef?.overlayElement.contains(e))&&this.hide();}),this._addListener("wheel",t=>{if(this._isTooltipVisible()){let e=this._document.elementFromPoint(t.clientX,t.clientY),i=this._elementRef.nativeElement;e!==i&&!i.contains(e)&&this.hide();}});else if(this.touchGestures!=="off"){this._disableNativeGesturesIfNecessary();let t=()=>{this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions?.touchendHideDelay);};this._addListener("touchend",t),this._addListener("touchcancel",t);}}}_addListener(t,e){this._eventCleanups.push(this._renderer.listen(this._elementRef.nativeElement,t,e,Kt));}_isTouchPlatform(){let t=this._defaultOptions?.detectHoverCapability;return typeof t=="function"?!t():this._platform.IOS||this._platform.ANDROID?true:this._platform.isBrowser?!!t&&this._mediaMatcher.matchMedia("(any-hover: none)").matches:false}_disableNativeGesturesIfNecessary(){let t=this.touchGestures;if(t!=="off"){let e=this._elementRef.nativeElement,i=e.style;(t==="on"||e.nodeName!=="INPUT"&&e.nodeName!=="TEXTAREA")&&(i.userSelect=i.msUserSelect=i.webkitUserSelect=i.MozUserSelect="none"),(t==="on"||!e.draggable)&&(i.webkitUserDrag="none"),i.touchAction="none",i.webkitTapHighlightColor="transparent";}}_syncAriaDescription(t){this._ariaDescriptionPending||(this._ariaDescriptionPending=true,this._ariaDescriber.removeDescription(this._elementRef.nativeElement,t,"tooltip"),this._isDestroyed||ME({write:()=>{this._ariaDescriptionPending=false,this.message&&!this.disabled&&this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip");}},{injector:this._injector}));}_overlayEventPredicate=t=>t.type==="keydown"?this._isTooltipVisible()&&t.keyCode===27&&!Ve$1(t):true;static \u0275fac=function(e){return new(e||n)};static \u0275dir=ks({type:n,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-mdc-tooltip-trigger"],hostVars:2,hostBindings:function(e,i){e&2&&Hg("mat-mdc-tooltip-disabled",i.disabled);},inputs:{position:[0,"matTooltipPosition","position"],positionAtOrigin:[0,"matTooltipPositionAtOrigin","positionAtOrigin"],disabled:[0,"matTooltipDisabled","disabled"],showDelay:[0,"matTooltipShowDelay","showDelay"],hideDelay:[0,"matTooltipHideDelay","hideDelay"],touchGestures:[0,"matTooltipTouchGestures","touchGestures"],message:[0,"matTooltip","message"],tooltipClass:[0,"matTooltipClass","tooltipClass"]},exportAs:["matTooltip"]})}return n})(),Gt=(()=>{class n{_changeDetectorRef=g(Cl);_elementRef=g(Qt$1);_isMultiline=false;message;tooltipClass;_showTimeoutId;_hideTimeoutId;_triggerElement;_mouseLeaveHideDelay;_animationsDisabled=K();_tooltip;_closeOnInteraction=false;_isVisible=false;_onHide=new ce$1;_showAnimation="mat-mdc-tooltip-show";_hideAnimation="mat-mdc-tooltip-hide";show(t){this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=setTimeout(()=>{this._toggleVisibility(true),this._showTimeoutId=void 0;},t);}hide(t){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._toggleVisibility(false),this._hideTimeoutId=void 0;},t);}afterHidden(){return this._onHide}isVisible(){return this._isVisible}ngOnDestroy(){this._cancelPendingAnimations(),this._onHide.complete(),this._triggerElement=null;}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0);}_markForCheck(){this._changeDetectorRef.markForCheck();}_handleMouseLeave({relatedTarget:t}){(!t||!this._triggerElement.contains(t))&&(this.isVisible()?this.hide(this._mouseLeaveHideDelay):this._finalizeAnimation(false));}_onShow(){this._isMultiline=this._isTooltipMultiline(),this._markForCheck();}_isTooltipMultiline(){let t=this._elementRef.nativeElement.getBoundingClientRect();return t.height>ee&&t.width>=ie}_handleAnimationEnd({animationName:t}){(t===this._showAnimation||t===this._hideAnimation)&&this._finalizeAnimation(t===this._showAnimation);}_cancelPendingAnimations(){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=this._hideTimeoutId=void 0;}_finalizeAnimation(t){t?this._closeOnInteraction=true:this.isVisible()||this._onHide.next();}_toggleVisibility(t){let e=this._tooltip.nativeElement,i=this._showAnimation,r=this._hideAnimation;if(e.classList.remove(t?r:i),e.classList.add(t?i:r),this._isVisible!==t&&(this._isVisible=t,this._changeDetectorRef.markForCheck()),t&&!this._animationsDisabled&&typeof getComputedStyle=="function"){let a=getComputedStyle(e);(a.getPropertyValue("animation-duration")==="0s"||a.getPropertyValue("animation-name")==="none")&&(this._animationsDisabled=true);}t&&this._onShow(),this._animationsDisabled&&(e.classList.add("_mat-animation-noopable"),this._finalizeAnimation(t));}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Aw({type:n,selectors:[["mat-tooltip-component"]],viewQuery:function(e,i){if(e&1&&Fg(Xt,7),e&2){let r;IC(r=wC())&&(i._tooltip=r.first);}},hostAttrs:["aria-hidden","true"],hostBindings:function(e,i){e&1&&Ag("mouseleave",function(a){return i._handleMouseLeave(a)});},decls:4,vars:5,consts:[["tooltip",""],[1,"mdc-tooltip","mat-mdc-tooltip",3,"animationend"],[1,"mat-mdc-tooltip-surface","mdc-tooltip__surface"]],template:function(e,i){e&1&&(pl(0,"div",1,0),Rg("animationend",function(a){return i._handleAnimationEnd(a)}),pl(2,"div",2),WC(3),hl()()),e&2&&(FC(i.tooltipClass),Hg("mdc-tooltip--multiline",i._isMultiline),XE(3),Zg(i.message));},styles:[`.mat-mdc-tooltip {
2
2
  position: relative;
3
3
  transform: scale(0);
4
4
  display: inline-flex;
@@ -1 +1 @@
1
- import {n}from'./chunk-CfgXrte_.js';import {O}from'./chunk-DR_6ChV2.js';import {v}from'./chunk-BrxgjRsW.js';import {R}from'./chunk-CfqdY4Mw.js';import {g,ao as V,G,w as we,H as Hi,u as ue,b as U$1,bS as ma,S as ha,A as Aw,aK as Nb,v as vs,bf as aT,k as Ag,j as fl,af as Dg,T as TC,r as Tg,bg as uT,ah as rT,n as eC,ac as mC,t as tC,W as WC,X as XE,a8 as Zg,a9 as dC,aa as If,ab as wf,ag as fT}from'./main-SY6UM2GV.js';import'./chunk-MIRdYHA6.js';import {W as Wn,S as Se}from'./chunk-8Uub9JWj.js';import'./chunk-Bd2CH26d.js';import'./chunk-DbP7sgsG.js';import'./chunk-DWsrvadK.js';import'./chunk-Cdb2CX2Q.js';var W=()=>[];function z(s,e){if(s&1&&(vs(0,"p",3),WC(1),fl()),s&2){let t=mC().$implicit;XE(),Zg(t.name);}}function U(s,e){if(s&1){let t=dC();vs(0,"agentos-auth-setting-item",5),Ag("editRequested",function(){let i=If(t),r=mC(2);return wf(r.onEdit(i))})("deleteRequested",function(){let i=If(t),r=mC(2);return wf(r.onDelete(i))})("duplicateRequested",function(){let i=If(t),r=mC(2);return wf(r.onDuplicate(i))}),fl();}if(s&2){let t=e,n=mC(2);Tg("config",t.config)("scope",t.scope)("readOnly",t.scope==="platform"||t.scope==="namespace"&&!n.isAdmin());}}function X(s,e){if(s&1&&eC(0,z,2,1,"p",3)(1,U,1,3,"agentos-auth-setting-item",4),s&2){let t,n=e.$implicit,i=mC();tC(i.isEmptyPlaceholder(n.id)?0:(t=i.resolve(n.id))?1:-1,t);}}var k=Object.freeze({platform:"Platform (read-only)",namespace:"Auth Settings du namespace",userOnNs:"Mes overrides sur ce namespace",userGlobal:"Mes overrides globaux"}),F="__empty__",j=class s{route=g(V);router=g(G);destroyRef=g(we);state=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=Hi(false);listItems$=this.state.vm$.pipe(ue(e=>this.toListItems(e)));isLoading=Hi(true);resolved=new Map;ngOnInit(){this.route.paramMap.pipe(U$1(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t);}),this.route.paramMap.pipe(ue(e=>e.get("namespaceId")??""),ma(e=>e?this.namespaceRole.isAdminOfNamespace$(e):ha(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe(e=>{this.isLoading.set(false);let t=new Map;e.platform.forEach(n=>{n.id&&t.set(this.itemKey("platform",n.id),{config:n,scope:"platform"});}),e.namespace.forEach(n=>{n.id&&t.set(this.itemKey("namespace",n.id),{config:n,scope:"namespace"});}),e.userOnNs.forEach(n=>{n.id&&t.set(this.itemKey("userOnNs",n.id),{config:n,scope:"userOnNs"});}),e.userGlobal.forEach(n=>{n.id&&t.set(this.itemKey("userGlobal",n.id),{config:n,scope:"userGlobal"});}),this.resolved=t;});}isEmptyPlaceholder(e){return e.startsWith(F)}resolve(e){return this.resolved.get(e)??null}itemKey(e,t){return `${e}:${t}`}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:n(this.isAdmin())}});}onEdit(e){let t=e.config.id;t&&this.router.navigate(["/agentos",this.namespaceId,"auth-settings",t,"edit"],{queryParams:{scope:e.scope}});}onDelete(e){let t=e.config.id;t&&this.state.delete(t,e.scope).pipe(U$1(this.destroyRef)).subscribe({error:n=>{console.error(`[AuthSettingsAllScopes] Delete failed for ${e.scope}:${t}:`,n);}});}onDuplicate(e){if(!e.config.id)return;let t=e.scope==="platform"||e.scope==="namespace"&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:t,template:e.config.id,templateScope:e.scope}});}toListItems(e){let t=[];return t.push(...this.sectionItems("platform",e.platform)),t.push(...this.sectionItems("namespace",e.namespace)),t.push(...this.sectionItems("userOnNs",e.userOnNs)),t.push(...this.sectionItems("userGlobal",e.userGlobal)),t}sectionItems(e,t){return t.length===0?[{id:`${F}${e}`,name:"Aucun Auth Setting",groupKey:e,groupLabel:k[e]}]:t.filter(n=>!!n.id).map(n=>({id:this.itemKey(e,n.id),name:n.name,description:n.authType,groupKey:e,groupLabel:k[e]}))}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=Aw({type:s,selectors:[["agentos-auth-settings-all-scopes"]],decls:5,vars:7,consts:[["authSettingItemTpl",""],["title","Auth Settings","emptyMessage","No auth settings available.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[1,"auth-settings-all-scopes__empty"],[3,"config","scope","readOnly"],[3,"editRequested","deleteRequested","duplicateRequested","config","scope","readOnly"]],template:function(t,n){if(t&1&&(vs(0,"ds-entity-list",1),aT(1,"async"),Ag("createRequested",function(){return n.openCreateForm()}),vs(2,"ds-icon-button",2),Ag("action",function(){return n.goBack()}),fl()(),Dg(3,X,2,1,"ng-template",null,0,fT)),t&2){let i=TC(4);Tg("items",uT(1,4,n.listItems$)??rT(6,W))("loading",n.isLoading())("showCreate",true)("itemTemplate",i);}},dependencies:[Wn,O,Se,Nb],encapsulation:2})};export{j as AuthSettingsAllScopesComponent};
1
+ import {n}from'./chunk-CfgXrte_.js';import {O}from'./chunk-Dk3h998A.js';import {v}from'./chunk-BPt7wScV.js';import {R}from'./chunk-DDdQkLim.js';import {g,ao as V,G,w as we,H as Hi,u as ue,b as U$1,bS as ma,S as ha,A as Aw,aK as Nb,v as vs,bf as aT,k as Ag,j as fl,af as Dg,T as TC,r as Tg,bg as uT,ah as rT,n as eC,ac as mC,t as tC,W as WC,X as XE,a8 as Zg,a9 as dC,aa as If,ab as wf,ag as fT}from'./main-MX6O2FH4.js';import'./chunk-BDkp40LI.js';import {W as Wn,S as Se}from'./chunk-LlG18Htx.js';import'./chunk-CUmZcEGx.js';import'./chunk-CJdqLI4x.js';import'./chunk-CmUHL9Tg.js';import'./chunk-BkVtgsRG.js';var W=()=>[];function z(s,e){if(s&1&&(vs(0,"p",3),WC(1),fl()),s&2){let t=mC().$implicit;XE(),Zg(t.name);}}function U(s,e){if(s&1){let t=dC();vs(0,"agentos-auth-setting-item",5),Ag("editRequested",function(){let i=If(t),r=mC(2);return wf(r.onEdit(i))})("deleteRequested",function(){let i=If(t),r=mC(2);return wf(r.onDelete(i))})("duplicateRequested",function(){let i=If(t),r=mC(2);return wf(r.onDuplicate(i))}),fl();}if(s&2){let t=e,n=mC(2);Tg("config",t.config)("scope",t.scope)("readOnly",t.scope==="platform"||t.scope==="namespace"&&!n.isAdmin());}}function X(s,e){if(s&1&&eC(0,z,2,1,"p",3)(1,U,1,3,"agentos-auth-setting-item",4),s&2){let t,n=e.$implicit,i=mC();tC(i.isEmptyPlaceholder(n.id)?0:(t=i.resolve(n.id))?1:-1,t);}}var k=Object.freeze({platform:"Platform (read-only)",namespace:"Auth Settings du namespace",userOnNs:"Mes overrides sur ce namespace",userGlobal:"Mes overrides globaux"}),F="__empty__",j=class s{route=g(V);router=g(G);destroyRef=g(we);state=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=Hi(false);listItems$=this.state.vm$.pipe(ue(e=>this.toListItems(e)));isLoading=Hi(true);resolved=new Map;ngOnInit(){this.route.paramMap.pipe(U$1(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t);}),this.route.paramMap.pipe(ue(e=>e.get("namespaceId")??""),ma(e=>e?this.namespaceRole.isAdminOfNamespace$(e):ha(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe(e=>{this.isLoading.set(false);let t=new Map;e.platform.forEach(n=>{n.id&&t.set(this.itemKey("platform",n.id),{config:n,scope:"platform"});}),e.namespace.forEach(n=>{n.id&&t.set(this.itemKey("namespace",n.id),{config:n,scope:"namespace"});}),e.userOnNs.forEach(n=>{n.id&&t.set(this.itemKey("userOnNs",n.id),{config:n,scope:"userOnNs"});}),e.userGlobal.forEach(n=>{n.id&&t.set(this.itemKey("userGlobal",n.id),{config:n,scope:"userGlobal"});}),this.resolved=t;});}isEmptyPlaceholder(e){return e.startsWith(F)}resolve(e){return this.resolved.get(e)??null}itemKey(e,t){return `${e}:${t}`}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:n(this.isAdmin())}});}onEdit(e){let t=e.config.id;t&&this.router.navigate(["/agentos",this.namespaceId,"auth-settings",t,"edit"],{queryParams:{scope:e.scope}});}onDelete(e){let t=e.config.id;t&&this.state.delete(t,e.scope).pipe(U$1(this.destroyRef)).subscribe({error:n=>{console.error(`[AuthSettingsAllScopes] Delete failed for ${e.scope}:${t}:`,n);}});}onDuplicate(e){if(!e.config.id)return;let t=e.scope==="platform"||e.scope==="namespace"&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:t,template:e.config.id,templateScope:e.scope}});}toListItems(e){let t=[];return t.push(...this.sectionItems("platform",e.platform)),t.push(...this.sectionItems("namespace",e.namespace)),t.push(...this.sectionItems("userOnNs",e.userOnNs)),t.push(...this.sectionItems("userGlobal",e.userGlobal)),t}sectionItems(e,t){return t.length===0?[{id:`${F}${e}`,name:"Aucun Auth Setting",groupKey:e,groupLabel:k[e]}]:t.filter(n=>!!n.id).map(n=>({id:this.itemKey(e,n.id),name:n.name,description:n.authType,groupKey:e,groupLabel:k[e]}))}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=Aw({type:s,selectors:[["agentos-auth-settings-all-scopes"]],decls:5,vars:7,consts:[["authSettingItemTpl",""],["title","Auth Settings","emptyMessage","No auth settings available.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[1,"auth-settings-all-scopes__empty"],[3,"config","scope","readOnly"],[3,"editRequested","deleteRequested","duplicateRequested","config","scope","readOnly"]],template:function(t,n){if(t&1&&(vs(0,"ds-entity-list",1),aT(1,"async"),Ag("createRequested",function(){return n.openCreateForm()}),vs(2,"ds-icon-button",2),Ag("action",function(){return n.goBack()}),fl()(),Dg(3,X,2,1,"ng-template",null,0,fT)),t&2){let i=TC(4);Tg("items",uT(1,4,n.listItems$)??rT(6,W))("loading",n.isLoading())("showCreate",true)("itemTemplate",i);}},dependencies:[Wn,O,Se,Nb],encapsulation:2})};export{j as AuthSettingsAllScopesComponent};
@@ -1 +1 @@
1
- import {S as St}from'./chunk-CjRw0M6d.js';import {an as ce,g,L,ao as V,G,N as N$1,ap as Vy,A as Aw,aq as a,ar as S,as as F,at as c,v as vs,k as Ag,n as eC,j as fl,r as Tg,X as XE,t as tC,D as Fg,I as IC,E as wC,au as tv,ae as Ot,av as dt,Y as x,aw as pl,W as WC,ax as hl,a8 as Zg,a9 as dC,aa as If,ac as mC,ab as wf,o as bg}from'./main-SY6UM2GV.js';import {a as at,s as st,r as rt,_ as _i}from'./chunk-BJzVFbX0.js';import'./chunk-LGfFQHFU.js';import {G as Ge}from'./chunk-CnlsBi4s.js';import'./chunk-Cdb2CX2Q.js';import'./chunk-Cm1-CoCU.js';import'./chunk-loSw75E5.js';import'./chunk-C6ZQFaHV.js';import'./chunk-Bampatce.js';import'./chunk-8Uub9JWj.js';import'./chunk-Bd2CH26d.js';import'./chunk-DbP7sgsG.js';var T=class o{welcomeMessages=["Welcome to Coday","Bienvenue sur Coday","Bienvenido a Coday","Willkommen bei Coday","Benvenuto su Coday","Bem-vindo ao Coday","Welkom bij Coday","\u0414\u043E\u0431\u0440\u043E \u043F\u043E\u0436\u0430\u043B\u043E\u0432\u0430\u0442\u044C \u0432 Coday","Coday \u3078\u3088\u3046\u3053\u305D","\u6B22\u8FCE\u6765\u5230 Coday","Coday \uC5D0 \uC624\uC2E0 \uAC83\uC744 \uD658\uC601\uD569\uB2C8\uB2E4","\u0645\u0631\u062D\u0628\u064B\u0627 \u0628\u0643 \u0641\u064A Coday"];currentWelcomeIndex=0;currentWelcomeMessage=this.welcomeMessages[0];welcomeRotationInterval;ngOnInit(){this.startWelcomeRotation();}ngOnDestroy(){this.stopWelcomeRotation();}startWelcomeRotation(){this.welcomeRotationInterval=window.setInterval(()=>{this.currentWelcomeIndex=(this.currentWelcomeIndex+1)%this.welcomeMessages.length,this.currentWelcomeMessage=this.welcomeMessages[this.currentWelcomeIndex];},3e3);}stopWelcomeRotation(){this.welcomeRotationInterval&&(clearInterval(this.welcomeRotationInterval),this.welcomeRotationInterval=void 0);}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=Aw({type:o,selectors:[["app-welcome-message"]],decls:2,vars:1,consts:[[1,"welcome-title"]],template:function(t,i){t&1&&(pl(0,"h1",0),WC(1),hl()),t&2&&(XE(),Zg(i.currentWelcomeMessage));},styles:[".welcome-title[_ngcontent-%COMP%]{font-size:clamp(1.5rem,4vw,4rem);font-weight:700;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite;margin:0;padding:0;line-height:1.2;transition:opacity .5s ease-in-out;display:block;min-height:1.2em;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0% center}50%{background-position:100% center}to{background-position:0% center}}"],changeDetection:1})};var N=class o{destroy$=new ce;isSetup=false;codayService=g(Ge);preferencesService=g(L);setup(){if(this.isSetup){console.warn("[AGENT-NOTIFICATION] Service already set up");return}console.log("[AGENT-NOTIFICATION] Setting up agent notification service"),this.codayService.isThinking$.pipe(Vy(this.destroy$),tv(),Ot(([e,t])=>e===true&&t===false)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Agent stopped thinking, notifying task finished"),this.notifyTaskFinishedIfEnabled();}),this.preferencesService.browserNotificationEnabled$.pipe(Vy(this.destroy$),tv(),Ot(([e,t])=>e===false&&t===true)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Browser notifications enabled, checking permission"),this.handleBrowserNotificationEnabled();}),this.isSetup=true;}notifyTaskFinishedIfEnabled(){this.preferencesService.getAgentNotificationEnabled()&&(this.preferencesService.getNotificationSoundEnabled()&&this.playCompletionSound(),this.preferencesService.getBrowserNotificationEnabled()&&this.sendBrowserNotification());}playCompletionSound(){try{let e=new(window.AudioContext||window.webkitAudioContext),t=e.createOscillator(),i=e.createGain();t.connect(i),i.connect(e.destination),t.frequency.setValueAtTime(700,e.currentTime),i.gain.setValueAtTime(.1,e.currentTime),i.gain.exponentialRampToValueAtTime(.01,e.currentTime+.08),t.start(e.currentTime),t.stop(e.currentTime+.08);let n=e.createOscillator(),r=e.createGain();n.connect(r),r.connect(e.destination);let l=e.currentTime+.11;n.frequency.setValueAtTime(950,l),r.gain.setValueAtTime(.1,l),r.gain.exponentialRampToValueAtTime(.01,l+.09),n.start(l),n.stop(l+.09),console.log("[AGENT-NOTIFICATION] Completion sound played");}catch(e){console.error("[AGENT-NOTIFICATION] Failed to play completion sound:",e);}}handleBrowserNotificationEnabled(){return dt(this,null,function*(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications"),this.preferencesService.setBrowserNotificationEnabled(false);return}if(Notification.permission==="denied"){console.warn("[AGENT-NOTIFICATION] Permission denied, disabling browser notifications"),this.preferencesService.setBrowserNotificationEnabled(false);return}if(Notification.permission==="granted"){console.log("[AGENT-NOTIFICATION] Permission already granted, showing confirmation"),this.createConfirmationNotification();return}try{(yield Notification.requestPermission())==="granted"?(console.log("[AGENT-NOTIFICATION] Permission granted, showing confirmation"),this.createConfirmationNotification()):(console.log("[AGENT-NOTIFICATION] Permission denied or dismissed"),this.preferencesService.setBrowserNotificationEnabled(!1));}catch(e){console.error("[AGENT-NOTIFICATION] Error requesting permission:",e),this.preferencesService.setBrowserNotificationEnabled(false);}})}sendBrowserNotification(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications");return}if(document.hasFocus()){console.warn("[AGENT-NOTIFICATION] Document is focused, skipping browser notification");return}Notification.permission==="granted"?this.createTaskCompleteNotification():console.warn("[AGENT-NOTIFICATION] Permission not granted, cannot send notification");}createConfirmationNotification(){let e=new Notification("Coday - Notifications Enabled",{body:"You will be notified when the agent completes tasks",icon:"/favicon.ico",tag:"coday-notifications-enabled",requireInteraction:false});setTimeout(()=>e.close(),4e3),e.onclick=()=>{window.focus(),e.close();},console.log("[AGENT-NOTIFICATION] Confirmation notification sent");}createTaskCompleteNotification(){let e=new Notification("Coday - Task Complete",{body:"The agent has finished and is waiting for your input",icon:"/favicon.ico",tag:"coday-task-complete",requireInteraction:false});setTimeout(()=>e.close(),5e3),e.onclick=()=>{window.focus(),e.close();},console.log("[AGENT-NOTIFICATION] Task complete notification sent");}ngOnDestroy(){console.log("[AGENT-NOTIFICATION] Service destroyed"),this.destroy$.next(),this.destroy$.complete();}static \u0275fac=function(t){return new(t||o)};static \u0275prov=x({token:o,factory:o.\u0275fac,providedIn:"root"})};var Z=["inputSection"];function ee(o,e){if(o&1){let t=dC();vs(0,"app-thread",4),Ag("chatFocused",function(){If(t);let n=mC();return wf(n.onChatFocusedOnMobile())})("drawerStateChange",function(n){If(t);let r=mC();return wf(r.onDrawerStateChange(n))}),fl();}if(o&2){let t=mC();Tg("projectName",t.projectName)("threadId",t.threadId);}}function te(o,e){if(o&1){let t=dC();vs(0,"div",5),bg(1,"app-welcome-message"),fl(),vs(2,"div",6,0)(4,"div",7)(5,"div",8)(6,"app-chat-textarea",9),Ag("messageSubmitted",function(n){If(t);let r=mC();return wf(r.onMessageSubmitted(n))})("voiceMessageReady",function(n){If(t);let r=mC();return wf(r.onVoiceMessageReady(n))})("voiceRecordingToggled",function(n){If(t);let r=mC();return wf(r.onVoiceToggled(n))})("heightChanged",function(n){If(t);let r=mC();return wf(r.onInputHeightChanged(n))})("textareaFocused",function(){If(t);let n=mC();return wf(n.onChatFocusedOnMobile())}),fl()()()();}if(o&2){let t=mC();XE(6),Tg("isDisabled",t.isSessionInitializing)("isSessionInitializing",t.isSessionInitializing)("showWelcome",true)("isThinking",false)("isStarting",t.isStartingFirstMessage);}}var K=class o{destroy$=new ce;inputSection;sidenav;projectName="";threadId=null;isSessionInitializing=false;isStartingFirstMessage=false;inputSectionHeight=80;codayService=g(Ge);titleService=g(at);preferencesService=g(L);route=g(V);router=g(G);threadApiService=g(N$1);agentNotificationService=g(N);firstMessageState=g(st);constructor(){console.log("[MAIN-APP] Using new thread-based architecture (no clientId needed)");}ngOnInit(){this.agentNotificationService.setup(),this.setupPrintHandlers(),this.route.params.pipe(Vy(this.destroy$)).subscribe(e=>{let t=e.projectName,i=e.threadId||null;console.log("[MAIN-APP] Route params updated:",{project:t,thread:i,previousProject:this.projectName,previousThread:this.threadId}),this.projectName=t,this.threadId=i,this.threadId?console.log("[MAIN-APP] Thread selected - ThreadComponent will display"):(console.log("[MAIN-APP] No thread selected - showing welcome view"),this.initializeWelcomeView());});}initializeWelcomeView(){this.codayService.setTabTitleService(this.titleService);}ngAfterViewInit(){setTimeout(()=>this.updateInputSectionHeight(),100);}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),window.removeEventListener("beforeprint",this.handleBeforePrint),window.removeEventListener("afterprint",this.handleAfterPrint);}onMessageSubmitted(e){console.log("[MAIN-APP] First message submitted from welcome view:",e),this.isSessionInitializing=true,this.isStartingFirstMessage=true,this.threadApiService.createThread().subscribe({next:t=>{console.log("[MAIN-APP] Thread created:",t.thread.id),this.firstMessageState.setPendingFirstMessage(e),this.router.navigate(["project",this.projectName,"thread",t.thread.id]);},error:t=>{console.error("[MAIN-APP] Failed to create thread:",t),this.isSessionInitializing=false,this.isStartingFirstMessage=false,alert("Failed to create conversation: "+(t.message||"Unknown error"));}});}onVoiceToggled(e){console.log("[VOICE] Recording in welcome view:",e);}onVoiceMessageReady(e){console.log("[MAIN-APP] Voice message ready from welcome view"),this.isSessionInitializing=true,this.isStartingFirstMessage=true,this.threadApiService.createThread().subscribe({next:t=>{console.log("[MAIN-APP] Thread created for voice message:",t.thread.id),this.firstMessageState.setPendingVoiceMessage(e),this.router.navigate(["project",this.projectName,"thread",t.thread.id]);},error:t=>{console.error("[MAIN-APP] Failed to create thread for voice message:",t),this.isSessionInitializing=false,this.isStartingFirstMessage=false,alert("Failed to create conversation: "+(t.message||"Unknown error"));}});}isDrawerOpen=false;onDrawerStateChange(e){this.isDrawerOpen=e;}onChatFocusedOnMobile(){window.innerWidth<1024&&this.sidenav?.close();}onInputHeightChanged(e){console.log("[MAIN-APP] Input height changed:",e),this.inputSectionHeight=e;}updateInputSectionHeight(){if(this.inputSection?.nativeElement){let e=this.inputSection.nativeElement.offsetHeight;e!==this.inputSectionHeight&&(console.log("[MAIN-APP] Input section height updated:",e),this.inputSectionHeight=e);}}setupPrintHandlers(){window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint);}handleBeforePrint=()=>{console.log("[PRINT] Before print event triggered");let e=this.preferencesService.getPrintTechnicalMessages();console.log("[PRINT] Print technical messages:",e),e?document.body.classList.add("print-include-technical"):document.body.classList.remove("print-include-technical");};handleAfterPrint=()=>{console.log("[PRINT] After print event triggered"),document.body.classList.remove("print-include-technical");};static \u0275fac=function(t){return new(t||o)};static \u0275cmp=Aw({type:o,selectors:[["app-main"]],viewQuery:function(t,i){if(t&1&&Fg(Z,5)(St,5),t&2){let n;IC(n=wC())&&(i.inputSection=n.first),IC(n=wC())&&(i.sidenav=n.first);}},decls:4,vars:2,consts:[["inputSection",""],[3,"drawerOpen"],[1,"app",3,"mousedown","touchstart"],[3,"projectName","threadId"],[3,"chatFocused","drawerStateChange","projectName","threadId"],[1,"welcome-section"],[1,"input-section"],[1,"input-center"],[1,"input-glass"],[3,"messageSubmitted","voiceMessageReady","voiceRecordingToggled","heightChanged","textareaFocused","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"]],template:function(t,i){t&1&&(vs(0,"app-sidenav",1)(1,"div",2),Ag("mousedown",function(){return i.onChatFocusedOnMobile()})("touchstart",function(){return i.onChatFocusedOnMobile()}),eC(2,ee,1,2,"app-thread",3)(3,te,7,5),fl()()),t&2&&(Tg("drawerOpen",i.isDrawerOpen),XE(2),tC(i.threadId?2:3));},dependencies:[rt,_i,T,St],styles:["[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden;justify-content:center}.app[_ngcontent-%COMP%]{width:100%;max-width:100%;min-width:0;height:100%;display:flex;flex-direction:column;background:var(--color-bg);color:var(--color-text);transition:all .3s ease;position:relative;justify-content:center;overflow:hidden}.chat-wrapper[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;background:transparent;width:100%;padding:2.5rem 0 1.5rem;display:flex;justify-content:center}.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem}@media(max-width:768px){.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{padding:0 1rem}}.welcome-section[_ngcontent-%COMP%]{flex-shrink:0;text-align:center;padding:2rem 1rem;animation:_ngcontent-%COMP%_fadeInUp .8s ease-out;display:flex;justify-content:center;align-items:center;width:100%;min-width:0;overflow:hidden}@keyframes _ngcontent-%COMP%_fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.input-section[_ngcontent-%COMP%]{flex-shrink:0;position:relative;border-top:none;background:transparent;box-shadow:none;padding:2.5rem 0 2rem;overflow-y:visible;max-height:none;width:100%;z-index:10;pointer-events:none;display:flex;justify-content:center}.input-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem;display:flex;justify-content:center;align-items:end;position:relative;pointer-events:auto}@media(max-width:768px){.input-center[_ngcontent-%COMP%]{padding:0 1rem}}.input-glass[_ngcontent-%COMP%]{background:none;box-shadow:none;width:100%;min-height:64px;display:flex;align-items:stretch;gap:0;pointer-events:auto;position:relative;overflow:visible}.input-glass[_ngcontent-%COMP%] app-chat-textarea[_ngcontent-%COMP%]{width:100%;min-width:0;flex:1 1 auto;align-self:stretch;display:flex}body.dark[_nghost-%COMP%], body.dark [_nghost-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .input-glass[_ngcontent-%COMP%]{background:#24283073;border-color:#b4c8ff17;box-shadow:0 8px 32px #0000002b,0 1.5px 8px #00000012}.choice-overlay[_ngcontent-%COMP%]{z-index:10;width:100%;display:flex;justify-content:center;align-items:center}.upload-status[_ngcontent-%COMP%]{position:fixed;bottom:100px;left:50%;transform:translate(-50%);z-index:1000;display:flex;align-items:center;padding:12px 20px;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);border-radius:16px;font-size:.9em;color:var(--color-text);box-shadow:var(--glass-shadow);max-width:300px;text-align:center}.upload-status.error[_ngcontent-%COMP%]{background:#ff3b3026;color:var(--color-error);border-color:#ff3b304d}@media(max-width:768px){.welcome-section[_ngcontent-%COMP%]{padding:1.5rem 1rem}.input-section[_ngcontent-%COMP%]{padding:1.5rem .75rem 1rem}.input-center[_ngcontent-%COMP%]{padding:0 .5rem}}@media print{[_nghost-%COMP%]{display:block!important;height:auto!important;overflow:visible!important}.app[_ngcontent-%COMP%]{height:auto!important;overflow:visible!important;display:block!important}.input-section[_ngcontent-%COMP%], .welcome-section[_ngcontent-%COMP%]{display:none!important}}"],data:{animation:[a("slideIn",[S(":enter",[F({transform:"translateY(100%)",opacity:0}),c("300ms ease-out",F({transform:"translateY(0)",opacity:1}))]),S(":leave",[c("200ms ease-in",F({transform:"translateY(100%)",opacity:0}))])])]},changeDetection:1})};export{K as MainAppComponent};
1
+ import {S as St}from'./chunk-Bpth0xKt.js';import {an as ce,g,L,ao as V,G,N as N$1,ap as Vy,A as Aw,aq as a,ar as S,as as F,at as c,v as vs,k as Ag,n as eC,j as fl,r as Tg,X as XE,t as tC,D as Fg,I as IC,E as wC,au as tv,ae as Ot,av as dt,Y as x,aw as pl,W as WC,ax as hl,a8 as Zg,a9 as dC,aa as If,ac as mC,ab as wf,o as bg}from'./main-MX6O2FH4.js';import {a as at,s as st,r as rt,_ as _i}from'./chunk-C2rlLV-W.js';import'./chunk-DAOnyJ7c.js';import {G as Ge}from'./chunk-CqkMIKRg.js';import'./chunk-BkVtgsRG.js';import'./chunk-B5rsaW2b.js';import'./chunk-BuSLhs6I.js';import'./chunk-CFQpQly7.js';import'./chunk-B8YsdH5W.js';import'./chunk-LlG18Htx.js';import'./chunk-CUmZcEGx.js';import'./chunk-CJdqLI4x.js';var T=class o{welcomeMessages=["Welcome to Coday","Bienvenue sur Coday","Bienvenido a Coday","Willkommen bei Coday","Benvenuto su Coday","Bem-vindo ao Coday","Welkom bij Coday","\u0414\u043E\u0431\u0440\u043E \u043F\u043E\u0436\u0430\u043B\u043E\u0432\u0430\u0442\u044C \u0432 Coday","Coday \u3078\u3088\u3046\u3053\u305D","\u6B22\u8FCE\u6765\u5230 Coday","Coday \uC5D0 \uC624\uC2E0 \uAC83\uC744 \uD658\uC601\uD569\uB2C8\uB2E4","\u0645\u0631\u062D\u0628\u064B\u0627 \u0628\u0643 \u0641\u064A Coday"];currentWelcomeIndex=0;currentWelcomeMessage=this.welcomeMessages[0];welcomeRotationInterval;ngOnInit(){this.startWelcomeRotation();}ngOnDestroy(){this.stopWelcomeRotation();}startWelcomeRotation(){this.welcomeRotationInterval=window.setInterval(()=>{this.currentWelcomeIndex=(this.currentWelcomeIndex+1)%this.welcomeMessages.length,this.currentWelcomeMessage=this.welcomeMessages[this.currentWelcomeIndex];},3e3);}stopWelcomeRotation(){this.welcomeRotationInterval&&(clearInterval(this.welcomeRotationInterval),this.welcomeRotationInterval=void 0);}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=Aw({type:o,selectors:[["app-welcome-message"]],decls:2,vars:1,consts:[[1,"welcome-title"]],template:function(t,i){t&1&&(pl(0,"h1",0),WC(1),hl()),t&2&&(XE(),Zg(i.currentWelcomeMessage));},styles:[".welcome-title[_ngcontent-%COMP%]{font-size:clamp(1.5rem,4vw,4rem);font-weight:700;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite;margin:0;padding:0;line-height:1.2;transition:opacity .5s ease-in-out;display:block;min-height:1.2em;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0% center}50%{background-position:100% center}to{background-position:0% center}}"],changeDetection:1})};var N=class o{destroy$=new ce;isSetup=false;codayService=g(Ge);preferencesService=g(L);setup(){if(this.isSetup){console.warn("[AGENT-NOTIFICATION] Service already set up");return}console.log("[AGENT-NOTIFICATION] Setting up agent notification service"),this.codayService.isThinking$.pipe(Vy(this.destroy$),tv(),Ot(([e,t])=>e===true&&t===false)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Agent stopped thinking, notifying task finished"),this.notifyTaskFinishedIfEnabled();}),this.preferencesService.browserNotificationEnabled$.pipe(Vy(this.destroy$),tv(),Ot(([e,t])=>e===false&&t===true)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Browser notifications enabled, checking permission"),this.handleBrowserNotificationEnabled();}),this.isSetup=true;}notifyTaskFinishedIfEnabled(){this.preferencesService.getAgentNotificationEnabled()&&(this.preferencesService.getNotificationSoundEnabled()&&this.playCompletionSound(),this.preferencesService.getBrowserNotificationEnabled()&&this.sendBrowserNotification());}playCompletionSound(){try{let e=new(window.AudioContext||window.webkitAudioContext),t=e.createOscillator(),i=e.createGain();t.connect(i),i.connect(e.destination),t.frequency.setValueAtTime(700,e.currentTime),i.gain.setValueAtTime(.1,e.currentTime),i.gain.exponentialRampToValueAtTime(.01,e.currentTime+.08),t.start(e.currentTime),t.stop(e.currentTime+.08);let n=e.createOscillator(),r=e.createGain();n.connect(r),r.connect(e.destination);let l=e.currentTime+.11;n.frequency.setValueAtTime(950,l),r.gain.setValueAtTime(.1,l),r.gain.exponentialRampToValueAtTime(.01,l+.09),n.start(l),n.stop(l+.09),console.log("[AGENT-NOTIFICATION] Completion sound played");}catch(e){console.error("[AGENT-NOTIFICATION] Failed to play completion sound:",e);}}handleBrowserNotificationEnabled(){return dt(this,null,function*(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications"),this.preferencesService.setBrowserNotificationEnabled(false);return}if(Notification.permission==="denied"){console.warn("[AGENT-NOTIFICATION] Permission denied, disabling browser notifications"),this.preferencesService.setBrowserNotificationEnabled(false);return}if(Notification.permission==="granted"){console.log("[AGENT-NOTIFICATION] Permission already granted, showing confirmation"),this.createConfirmationNotification();return}try{(yield Notification.requestPermission())==="granted"?(console.log("[AGENT-NOTIFICATION] Permission granted, showing confirmation"),this.createConfirmationNotification()):(console.log("[AGENT-NOTIFICATION] Permission denied or dismissed"),this.preferencesService.setBrowserNotificationEnabled(!1));}catch(e){console.error("[AGENT-NOTIFICATION] Error requesting permission:",e),this.preferencesService.setBrowserNotificationEnabled(false);}})}sendBrowserNotification(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications");return}if(document.hasFocus()){console.warn("[AGENT-NOTIFICATION] Document is focused, skipping browser notification");return}Notification.permission==="granted"?this.createTaskCompleteNotification():console.warn("[AGENT-NOTIFICATION] Permission not granted, cannot send notification");}createConfirmationNotification(){let e=new Notification("Coday - Notifications Enabled",{body:"You will be notified when the agent completes tasks",icon:"/favicon.ico",tag:"coday-notifications-enabled",requireInteraction:false});setTimeout(()=>e.close(),4e3),e.onclick=()=>{window.focus(),e.close();},console.log("[AGENT-NOTIFICATION] Confirmation notification sent");}createTaskCompleteNotification(){let e=new Notification("Coday - Task Complete",{body:"The agent has finished and is waiting for your input",icon:"/favicon.ico",tag:"coday-task-complete",requireInteraction:false});setTimeout(()=>e.close(),5e3),e.onclick=()=>{window.focus(),e.close();},console.log("[AGENT-NOTIFICATION] Task complete notification sent");}ngOnDestroy(){console.log("[AGENT-NOTIFICATION] Service destroyed"),this.destroy$.next(),this.destroy$.complete();}static \u0275fac=function(t){return new(t||o)};static \u0275prov=x({token:o,factory:o.\u0275fac,providedIn:"root"})};var Z=["inputSection"];function ee(o,e){if(o&1){let t=dC();vs(0,"app-thread",4),Ag("chatFocused",function(){If(t);let n=mC();return wf(n.onChatFocusedOnMobile())})("drawerStateChange",function(n){If(t);let r=mC();return wf(r.onDrawerStateChange(n))}),fl();}if(o&2){let t=mC();Tg("projectName",t.projectName)("threadId",t.threadId);}}function te(o,e){if(o&1){let t=dC();vs(0,"div",5),bg(1,"app-welcome-message"),fl(),vs(2,"div",6,0)(4,"div",7)(5,"div",8)(6,"app-chat-textarea",9),Ag("messageSubmitted",function(n){If(t);let r=mC();return wf(r.onMessageSubmitted(n))})("voiceMessageReady",function(n){If(t);let r=mC();return wf(r.onVoiceMessageReady(n))})("voiceRecordingToggled",function(n){If(t);let r=mC();return wf(r.onVoiceToggled(n))})("heightChanged",function(n){If(t);let r=mC();return wf(r.onInputHeightChanged(n))})("textareaFocused",function(){If(t);let n=mC();return wf(n.onChatFocusedOnMobile())}),fl()()()();}if(o&2){let t=mC();XE(6),Tg("isDisabled",t.isSessionInitializing)("isSessionInitializing",t.isSessionInitializing)("showWelcome",true)("isThinking",false)("isStarting",t.isStartingFirstMessage);}}var K=class o{destroy$=new ce;inputSection;sidenav;projectName="";threadId=null;isSessionInitializing=false;isStartingFirstMessage=false;inputSectionHeight=80;codayService=g(Ge);titleService=g(at);preferencesService=g(L);route=g(V);router=g(G);threadApiService=g(N$1);agentNotificationService=g(N);firstMessageState=g(st);constructor(){console.log("[MAIN-APP] Using new thread-based architecture (no clientId needed)");}ngOnInit(){this.agentNotificationService.setup(),this.setupPrintHandlers(),this.route.params.pipe(Vy(this.destroy$)).subscribe(e=>{let t=e.projectName,i=e.threadId||null;console.log("[MAIN-APP] Route params updated:",{project:t,thread:i,previousProject:this.projectName,previousThread:this.threadId}),this.projectName=t,this.threadId=i,this.threadId?console.log("[MAIN-APP] Thread selected - ThreadComponent will display"):(console.log("[MAIN-APP] No thread selected - showing welcome view"),this.initializeWelcomeView());});}initializeWelcomeView(){this.codayService.setTabTitleService(this.titleService);}ngAfterViewInit(){setTimeout(()=>this.updateInputSectionHeight(),100);}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),window.removeEventListener("beforeprint",this.handleBeforePrint),window.removeEventListener("afterprint",this.handleAfterPrint);}onMessageSubmitted(e){console.log("[MAIN-APP] First message submitted from welcome view:",e),this.isSessionInitializing=true,this.isStartingFirstMessage=true,this.threadApiService.createThread().subscribe({next:t=>{console.log("[MAIN-APP] Thread created:",t.thread.id),this.firstMessageState.setPendingFirstMessage(e),this.router.navigate(["project",this.projectName,"thread",t.thread.id]);},error:t=>{console.error("[MAIN-APP] Failed to create thread:",t),this.isSessionInitializing=false,this.isStartingFirstMessage=false,alert("Failed to create conversation: "+(t.message||"Unknown error"));}});}onVoiceToggled(e){console.log("[VOICE] Recording in welcome view:",e);}onVoiceMessageReady(e){console.log("[MAIN-APP] Voice message ready from welcome view"),this.isSessionInitializing=true,this.isStartingFirstMessage=true,this.threadApiService.createThread().subscribe({next:t=>{console.log("[MAIN-APP] Thread created for voice message:",t.thread.id),this.firstMessageState.setPendingVoiceMessage(e),this.router.navigate(["project",this.projectName,"thread",t.thread.id]);},error:t=>{console.error("[MAIN-APP] Failed to create thread for voice message:",t),this.isSessionInitializing=false,this.isStartingFirstMessage=false,alert("Failed to create conversation: "+(t.message||"Unknown error"));}});}isDrawerOpen=false;onDrawerStateChange(e){this.isDrawerOpen=e;}onChatFocusedOnMobile(){window.innerWidth<1024&&this.sidenav?.close();}onInputHeightChanged(e){console.log("[MAIN-APP] Input height changed:",e),this.inputSectionHeight=e;}updateInputSectionHeight(){if(this.inputSection?.nativeElement){let e=this.inputSection.nativeElement.offsetHeight;e!==this.inputSectionHeight&&(console.log("[MAIN-APP] Input section height updated:",e),this.inputSectionHeight=e);}}setupPrintHandlers(){window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint);}handleBeforePrint=()=>{console.log("[PRINT] Before print event triggered");let e=this.preferencesService.getPrintTechnicalMessages();console.log("[PRINT] Print technical messages:",e),e?document.body.classList.add("print-include-technical"):document.body.classList.remove("print-include-technical");};handleAfterPrint=()=>{console.log("[PRINT] After print event triggered"),document.body.classList.remove("print-include-technical");};static \u0275fac=function(t){return new(t||o)};static \u0275cmp=Aw({type:o,selectors:[["app-main"]],viewQuery:function(t,i){if(t&1&&Fg(Z,5)(St,5),t&2){let n;IC(n=wC())&&(i.inputSection=n.first),IC(n=wC())&&(i.sidenav=n.first);}},decls:4,vars:2,consts:[["inputSection",""],[3,"drawerOpen"],[1,"app",3,"mousedown","touchstart"],[3,"projectName","threadId"],[3,"chatFocused","drawerStateChange","projectName","threadId"],[1,"welcome-section"],[1,"input-section"],[1,"input-center"],[1,"input-glass"],[3,"messageSubmitted","voiceMessageReady","voiceRecordingToggled","heightChanged","textareaFocused","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"]],template:function(t,i){t&1&&(vs(0,"app-sidenav",1)(1,"div",2),Ag("mousedown",function(){return i.onChatFocusedOnMobile()})("touchstart",function(){return i.onChatFocusedOnMobile()}),eC(2,ee,1,2,"app-thread",3)(3,te,7,5),fl()()),t&2&&(Tg("drawerOpen",i.isDrawerOpen),XE(2),tC(i.threadId?2:3));},dependencies:[rt,_i,T,St],styles:["[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden;justify-content:center}.app[_ngcontent-%COMP%]{width:100%;max-width:100%;min-width:0;height:100%;display:flex;flex-direction:column;background:var(--color-bg);color:var(--color-text);transition:all .3s ease;position:relative;justify-content:center;overflow:hidden}.chat-wrapper[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;background:transparent;width:100%;padding:2.5rem 0 1.5rem;display:flex;justify-content:center}.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem}@media(max-width:768px){.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{padding:0 1rem}}.welcome-section[_ngcontent-%COMP%]{flex-shrink:0;text-align:center;padding:2rem 1rem;animation:_ngcontent-%COMP%_fadeInUp .8s ease-out;display:flex;justify-content:center;align-items:center;width:100%;min-width:0;overflow:hidden}@keyframes _ngcontent-%COMP%_fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.input-section[_ngcontent-%COMP%]{flex-shrink:0;position:relative;border-top:none;background:transparent;box-shadow:none;padding:2.5rem 0 2rem;overflow-y:visible;max-height:none;width:100%;z-index:10;pointer-events:none;display:flex;justify-content:center}.input-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem;display:flex;justify-content:center;align-items:end;position:relative;pointer-events:auto}@media(max-width:768px){.input-center[_ngcontent-%COMP%]{padding:0 1rem}}.input-glass[_ngcontent-%COMP%]{background:none;box-shadow:none;width:100%;min-height:64px;display:flex;align-items:stretch;gap:0;pointer-events:auto;position:relative;overflow:visible}.input-glass[_ngcontent-%COMP%] app-chat-textarea[_ngcontent-%COMP%]{width:100%;min-width:0;flex:1 1 auto;align-self:stretch;display:flex}body.dark[_nghost-%COMP%], body.dark [_nghost-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .input-glass[_ngcontent-%COMP%]{background:#24283073;border-color:#b4c8ff17;box-shadow:0 8px 32px #0000002b,0 1.5px 8px #00000012}.choice-overlay[_ngcontent-%COMP%]{z-index:10;width:100%;display:flex;justify-content:center;align-items:center}.upload-status[_ngcontent-%COMP%]{position:fixed;bottom:100px;left:50%;transform:translate(-50%);z-index:1000;display:flex;align-items:center;padding:12px 20px;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);border-radius:16px;font-size:.9em;color:var(--color-text);box-shadow:var(--glass-shadow);max-width:300px;text-align:center}.upload-status.error[_ngcontent-%COMP%]{background:#ff3b3026;color:var(--color-error);border-color:#ff3b304d}@media(max-width:768px){.welcome-section[_ngcontent-%COMP%]{padding:1.5rem 1rem}.input-section[_ngcontent-%COMP%]{padding:1.5rem .75rem 1rem}.input-center[_ngcontent-%COMP%]{padding:0 .5rem}}@media print{[_nghost-%COMP%]{display:block!important;height:auto!important;overflow:visible!important}.app[_ngcontent-%COMP%]{height:auto!important;overflow:visible!important;display:block!important}.input-section[_ngcontent-%COMP%], .welcome-section[_ngcontent-%COMP%]{display:none!important}}"],data:{animation:[a("slideIn",[S(":enter",[F({transform:"translateY(100%)",opacity:0}),c("300ms ease-out",F({transform:"translateY(0)",opacity:1}))]),S(":leave",[c("200ms ease-in",F({transform:"translateY(100%)",opacity:0}))])])]},changeDetection:1})};export{K as MainAppComponent};
@@ -1 +1 @@
1
- import {g,G,cb as mB,cc as gB,H as Hi,da as ge,dk as xe,A as Aw,v as vs,W as WC,j as fl,n as eC,X as XE,a8 as Zg,y as Hg,a5 as yl,t as tC,ac as mC,a9 as dC,k as Ag,r as Tg,aa as If,ab as wf}from'./main-SY6UM2GV.js';import {Z as Zn,S as Se}from'./chunk-8Uub9JWj.js';function L(n,t){if(n&1&&(vs(0,"span",5),WC(1),fl()),n&2){let e=mC();XE(),Zg(e.definition().description);}}function q(n,t){if(n&1&&(vs(0,"span",7),WC(1),fl()),n&2){let e=mC();XE(),yl("Next: ",e.nextRunLabel);}}function U(n,t){if(n&1&&(vs(0,"span",8),WC(1),fl()),n&2){let e=mC();XE(),yl("Last run: ",e.lastRunLabel);}}function $(n,t){if(n&1){let e=dC();vs(0,"span",12),WC(1,"Delete?"),fl(),vs(2,"ds-icon-button",13),Ag("action",function(){If(e);let a=mC(2);return wf(a.onDeleteConfirmed())}),fl(),vs(3,"ds-icon-button",14),Ag("action",function(){If(e);let a=mC(2);return wf(a.onDeleteCancelled())}),fl();}}function N(n,t){if(n&1){let e=dC();vs(0,"ds-kebab-menu",15),Ag("itemSelected",function(a){If(e);let p=mC(2);return wf(p.onMenuAction(a))}),fl();}if(n&2){let e=mC(2);Tg("items",e.menuItems);}}function V(n,t){if(n&1&&(vs(0,"div",10),eC(1,$,4,0)(2,N,1,1,"ds-kebab-menu",11),fl()),n&2){let e=mC();Hg("scheduled-prompt-item__actions--confirming",e.pendingDelete()),XE(),tC(e.pendingDelete()?1:2);}}var R=class n{router=g(G);definition=mB.required();namespaceId=mB(void 0);platformMode=mB(false);readOnly=mB(false);enableRequested=gB();disableRequested=gB();deleteRequested=gB();pendingDelete=Hi(false);get scheduleLabel(){let{recurrence:t}=this.definition(),e=t.unit,i=t.timeUtc,a=e===ge.WEEK?"week":"month",p=e===ge.WEEK&&t.days?.length?` (${t.days.map(_=>xe[_]??_).join(", ")})`:"";return `Every ${a}${p} at ${i} UTC`}formatInstant(t){if(!t)return null;let e=new Date(t),i=e.getUTCDate(),a=e.toLocaleString("en-GB",{month:"short",timeZone:"UTC"}),p=e.getUTCFullYear(),_=String(e.getUTCHours()).padStart(2,"0"),T=String(e.getUTCMinutes()).padStart(2,"0");return `${i} ${a} ${p} at ${_}:${T} UTC`}get nextRunLabel(){return this.formatInstant(this.definition().nextRunAt)}get lastRunLabel(){return this.formatInstant(this.definition().lastRunAt)}get menuItems(){let t=this.definition();return [{key:"edit",label:"Edit scheduled prompt",icon:"edit"},{key:"toggle",label:t.enabled?"Disable":"Enable",icon:t.enabled?"toggle_on":"toggle_off"},{key:"delete",label:"Delete scheduled prompt",icon:"delete",variant:"danger"}]}onMenuAction(t){let e=this.definition();switch(t){case "edit":this.platformMode()?this.router.navigate(["/agentos","admin","scheduled-prompts",e.id,"edit"]):this.router.navigate(["/agentos",this.namespaceId(),"scheduled-prompts",e.id,"edit"]);break;case "toggle":e.enabled?this.disableRequested.emit(e):this.enableRequested.emit(e);break;case "delete":this.pendingDelete.set(true);break}}onDeleteConfirmed(){this.pendingDelete.set(false),this.deleteRequested.emit(this.definition());}onDeleteCancelled(){this.pendingDelete.set(false);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Aw({type:n,selectors:[["agentos-scheduled-prompt-item"]],inputs:{definition:[1,"definition"],namespaceId:[1,"namespaceId"],platformMode:[1,"platformMode"],readOnly:[1,"readOnly"]},outputs:{enableRequested:"enableRequested",disableRequested:"disableRequested",deleteRequested:"deleteRequested"},decls:13,vars:11,consts:[["role","listitem",1,"scheduled-prompt-item"],[1,"scheduled-prompt-item__body"],[1,"scheduled-prompt-item__header"],[1,"scheduled-prompt-item__name"],[1,"scheduled-prompt-item__status"],[1,"scheduled-prompt-item__description"],[1,"scheduled-prompt-item__schedule"],[1,"scheduled-prompt-item__next-run"],[1,"scheduled-prompt-item__last-run"],[1,"scheduled-prompt-item__actions",3,"scheduled-prompt-item__actions--confirming"],[1,"scheduled-prompt-item__actions"],[3,"items"],[1,"scheduled-prompt-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],[3,"itemSelected","items"]],template:function(e,i){e&1&&(vs(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),WC(4),fl(),vs(5,"span",4),WC(6),fl()(),eC(7,L,2,1,"span",5),vs(8,"span",6),WC(9),fl(),eC(10,q,2,1,"span",7),eC(11,U,2,1,"span",8),fl(),eC(12,V,3,3,"div",9),fl()),e&2&&(XE(4),Zg(i.definition().name),XE(),Hg("scheduled-prompt-item__status--enabled",i.definition().enabled)("scheduled-prompt-item__status--disabled",!i.definition().enabled),XE(),yl(" ",i.definition().enabled?"Enabled":"Disabled"," "),XE(),tC(i.definition().description?7:-1),XE(2),Zg(i.scheduleLabel),XE(),tC(i.nextRunLabel?10:-1),XE(),tC(i.lastRunLabel?11:-1),XE(),tC(i.readOnly()?-1:12));},dependencies:[Zn,Se],styles:[".scheduled-prompt-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:10px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));transition:background .15s ease,border-color .15s ease}.scheduled-prompt-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.scheduled-prompt-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.scheduled-prompt-item__header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;min-width:0}.scheduled-prompt-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}.scheduled-prompt-item__status[_ngcontent-%COMP%]{font-size:.7rem;font-weight:600;padding:.15rem .5rem;border-radius:999px;white-space:nowrap;flex-shrink:0;text-transform:uppercase;letter-spacing:.04em}.scheduled-prompt-item__status--enabled[_ngcontent-%COMP%]{background:var(--color-success-bg, rgba(52, 199, 89, .12));color:var(--color-success, #34c759)}.scheduled-prompt-item__status--disabled[_ngcontent-%COMP%]{background:var(--color-warning-bg, rgba(255, 159, 10, .12));color:var(--color-warning, #ff9f0a)}.scheduled-prompt-item__description[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scheduled-prompt-item__schedule[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);font-family:monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scheduled-prompt-item__next-run[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scheduled-prompt-item__last-run[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scheduled-prompt-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.scheduled-prompt-item[_ngcontent-%COMP%]:hover .scheduled-prompt-item__actions[_ngcontent-%COMP%], .scheduled-prompt-item[_ngcontent-%COMP%]:focus-within .scheduled-prompt-item__actions[_ngcontent-%COMP%]{opacity:1}.scheduled-prompt-item__actions--confirming[_ngcontent-%COMP%]{opacity:1}.scheduled-prompt-item__confirm-label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:500;color:var(--color-error, #ff3b30);margin-right:.25rem;white-space:nowrap}"]})};export{R};
1
+ import {g,G,cb as mB,cc as gB,H as Hi,da as ge,dk as xe,A as Aw,v as vs,W as WC,j as fl,n as eC,X as XE,a8 as Zg,y as Hg,a5 as yl,t as tC,ac as mC,a9 as dC,k as Ag,r as Tg,aa as If,ab as wf}from'./main-MX6O2FH4.js';import {Z as Zn,S as Se}from'./chunk-LlG18Htx.js';function L(n,t){if(n&1&&(vs(0,"span",5),WC(1),fl()),n&2){let e=mC();XE(),Zg(e.definition().description);}}function q(n,t){if(n&1&&(vs(0,"span",7),WC(1),fl()),n&2){let e=mC();XE(),yl("Next: ",e.nextRunLabel);}}function U(n,t){if(n&1&&(vs(0,"span",8),WC(1),fl()),n&2){let e=mC();XE(),yl("Last run: ",e.lastRunLabel);}}function $(n,t){if(n&1){let e=dC();vs(0,"span",12),WC(1,"Delete?"),fl(),vs(2,"ds-icon-button",13),Ag("action",function(){If(e);let a=mC(2);return wf(a.onDeleteConfirmed())}),fl(),vs(3,"ds-icon-button",14),Ag("action",function(){If(e);let a=mC(2);return wf(a.onDeleteCancelled())}),fl();}}function N(n,t){if(n&1){let e=dC();vs(0,"ds-kebab-menu",15),Ag("itemSelected",function(a){If(e);let p=mC(2);return wf(p.onMenuAction(a))}),fl();}if(n&2){let e=mC(2);Tg("items",e.menuItems);}}function V(n,t){if(n&1&&(vs(0,"div",10),eC(1,$,4,0)(2,N,1,1,"ds-kebab-menu",11),fl()),n&2){let e=mC();Hg("scheduled-prompt-item__actions--confirming",e.pendingDelete()),XE(),tC(e.pendingDelete()?1:2);}}var R=class n{router=g(G);definition=mB.required();namespaceId=mB(void 0);platformMode=mB(false);readOnly=mB(false);enableRequested=gB();disableRequested=gB();deleteRequested=gB();pendingDelete=Hi(false);get scheduleLabel(){let{recurrence:t}=this.definition(),e=t.unit,i=t.timeUtc,a=e===ge.WEEK?"week":"month",p=e===ge.WEEK&&t.days?.length?` (${t.days.map(_=>xe[_]??_).join(", ")})`:"";return `Every ${a}${p} at ${i} UTC`}formatInstant(t){if(!t)return null;let e=new Date(t),i=e.getUTCDate(),a=e.toLocaleString("en-GB",{month:"short",timeZone:"UTC"}),p=e.getUTCFullYear(),_=String(e.getUTCHours()).padStart(2,"0"),T=String(e.getUTCMinutes()).padStart(2,"0");return `${i} ${a} ${p} at ${_}:${T} UTC`}get nextRunLabel(){return this.formatInstant(this.definition().nextRunAt)}get lastRunLabel(){return this.formatInstant(this.definition().lastRunAt)}get menuItems(){let t=this.definition();return [{key:"edit",label:"Edit scheduled prompt",icon:"edit"},{key:"toggle",label:t.enabled?"Disable":"Enable",icon:t.enabled?"toggle_on":"toggle_off"},{key:"delete",label:"Delete scheduled prompt",icon:"delete",variant:"danger"}]}onMenuAction(t){let e=this.definition();switch(t){case "edit":this.platformMode()?this.router.navigate(["/agentos","admin","scheduled-prompts",e.id,"edit"]):this.router.navigate(["/agentos",this.namespaceId(),"scheduled-prompts",e.id,"edit"]);break;case "toggle":e.enabled?this.disableRequested.emit(e):this.enableRequested.emit(e);break;case "delete":this.pendingDelete.set(true);break}}onDeleteConfirmed(){this.pendingDelete.set(false),this.deleteRequested.emit(this.definition());}onDeleteCancelled(){this.pendingDelete.set(false);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Aw({type:n,selectors:[["agentos-scheduled-prompt-item"]],inputs:{definition:[1,"definition"],namespaceId:[1,"namespaceId"],platformMode:[1,"platformMode"],readOnly:[1,"readOnly"]},outputs:{enableRequested:"enableRequested",disableRequested:"disableRequested",deleteRequested:"deleteRequested"},decls:13,vars:11,consts:[["role","listitem",1,"scheduled-prompt-item"],[1,"scheduled-prompt-item__body"],[1,"scheduled-prompt-item__header"],[1,"scheduled-prompt-item__name"],[1,"scheduled-prompt-item__status"],[1,"scheduled-prompt-item__description"],[1,"scheduled-prompt-item__schedule"],[1,"scheduled-prompt-item__next-run"],[1,"scheduled-prompt-item__last-run"],[1,"scheduled-prompt-item__actions",3,"scheduled-prompt-item__actions--confirming"],[1,"scheduled-prompt-item__actions"],[3,"items"],[1,"scheduled-prompt-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],[3,"itemSelected","items"]],template:function(e,i){e&1&&(vs(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),WC(4),fl(),vs(5,"span",4),WC(6),fl()(),eC(7,L,2,1,"span",5),vs(8,"span",6),WC(9),fl(),eC(10,q,2,1,"span",7),eC(11,U,2,1,"span",8),fl(),eC(12,V,3,3,"div",9),fl()),e&2&&(XE(4),Zg(i.definition().name),XE(),Hg("scheduled-prompt-item__status--enabled",i.definition().enabled)("scheduled-prompt-item__status--disabled",!i.definition().enabled),XE(),yl(" ",i.definition().enabled?"Enabled":"Disabled"," "),XE(),tC(i.definition().description?7:-1),XE(2),Zg(i.scheduleLabel),XE(),tC(i.nextRunLabel?10:-1),XE(),tC(i.lastRunLabel?11:-1),XE(),tC(i.readOnly()?-1:12));},dependencies:[Zn,Se],styles:[".scheduled-prompt-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:10px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));transition:background .15s ease,border-color .15s ease}.scheduled-prompt-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.scheduled-prompt-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.scheduled-prompt-item__header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;min-width:0}.scheduled-prompt-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}.scheduled-prompt-item__status[_ngcontent-%COMP%]{font-size:.7rem;font-weight:600;padding:.15rem .5rem;border-radius:999px;white-space:nowrap;flex-shrink:0;text-transform:uppercase;letter-spacing:.04em}.scheduled-prompt-item__status--enabled[_ngcontent-%COMP%]{background:var(--color-success-bg, rgba(52, 199, 89, .12));color:var(--color-success, #34c759)}.scheduled-prompt-item__status--disabled[_ngcontent-%COMP%]{background:var(--color-warning-bg, rgba(255, 159, 10, .12));color:var(--color-warning, #ff9f0a)}.scheduled-prompt-item__description[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scheduled-prompt-item__schedule[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);font-family:monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scheduled-prompt-item__next-run[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scheduled-prompt-item__last-run[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scheduled-prompt-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.scheduled-prompt-item[_ngcontent-%COMP%]:hover .scheduled-prompt-item__actions[_ngcontent-%COMP%], .scheduled-prompt-item[_ngcontent-%COMP%]:focus-within .scheduled-prompt-item__actions[_ngcontent-%COMP%]{opacity:1}.scheduled-prompt-item__actions--confirming[_ngcontent-%COMP%]{opacity:1}.scheduled-prompt-item__confirm-label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:500;color:var(--color-error, #ff3b30);margin-right:.25rem;white-space:nowrap}"]})};export{R};
@@ -1 +1 @@
1
- import {z}from'./chunk-Cc8mup8X.js';import {s}from'./chunk-Cm1-CoCU.js';import {g as g$1,G,P,R as Re,w as we,F,m as mT,z as z$1,a as P$1,ae as Ot,b as U,A as Aw,i as Gn,s as si,v as vs,k as Ag,o as bg,j as fl,af as Dg,ag as fT,T as TC,X as XE,r as Tg,a9 as dC,aa as If,ac as mC,ab as wf,W as WC,ah as rT}from'./main-SY6UM2GV.js';import'./chunk-DxZvzVYB.js';import {W as Wn,o as ot}from'./chunk-8Uub9JWj.js';import'./chunk-Bd2CH26d.js';import {y as yt,w as wt}from'./chunk-DbP7sgsG.js';var ee=()=>[];function te(u,t){if(u&1){let o=dC();vs(0,"div",5)(1,"ds-entity-card",6),Ag("selected",function(r){If(o);let i=mC();return wf(i.onItemSelected(r))}),fl(),vs(2,"button",7),Ag("click",function(r){let i=If(o).$implicit,f=mC();return r.stopPropagation(),wf(f.onDeleteRequested(i.id))}),vs(3,"mat-icon"),WC(4,"close"),fl()()();}if(u&2){let o=t.$implicit;XE(),Tg("id",o.id)("name",o.name)("description",o.description)("badges",o.badges??rT(4,ee));}}var g="__",Y=class u{router=g$1(G);projectStateService=g$1(P);dialog=g$1(Re);destroyRef=g$1(we);notification=g$1(s);projects=F(this.projectStateService.projectList$);forcedProject=F(this.projectStateService.forcedProject$,{initialValue:null});isLoading=F(this.projectStateService.isLoading$,{initialValue:false});projectItems=mT(()=>{let t=this.projects();if(!t)return [];let o=t.filter(e=>!e.name.includes(g)),n=t.filter(e=>e.name.includes(g)),r=new Set(o.map(e=>e.name)),i=e=>e.split(g)[0]??null,f=new Set(n.map(e=>i(e.name)).filter(e=>e!==null&&r.has(e))),l=[],G=[...f].sort((e,a)=>e.localeCompare(a));for(let e of G){let a=o.find(s=>s.name===e);l.push(z$1(P$1({},this.toEntityListItem(a)),{groupKey:e,groupLabel:e}));let Z=n.filter(s=>i(s.name)===e).sort((s,C)=>s.name.localeCompare(C.name));for(let s of Z){let C=s.name.slice(e.length+g.length);l.push(z$1(P$1({},this.toEntityListItem(s)),{name:C,description:s.name,groupKey:e,groupLabel:e}));}}let H=[...o].filter(e=>!f.has(e.name)&&!e.volatile).sort((e,a)=>e.name.localeCompare(a.name));for(let e of H)l.push(z$1(P$1({},this.toEntityListItem(e)),{groupKey:"__standalone__",groupLabel:"Projects"}));let Q=[...o].filter(e=>!f.has(e.name)&&e.volatile).sort((e,a)=>e.name.localeCompare(a.name));for(let e of Q)l.push(z$1(P$1({},this.toEntityListItem(e)),{groupKey:"__volatile__",groupLabel:"Temporary"}));let X=n.filter(e=>{let a=i(e.name);return a!==null&&!r.has(a)}).sort((e,a)=>e.name.localeCompare(a.name));for(let e of X)l.push(z$1(P$1({},this.toEntityListItem(e)),{groupKey:"__orphaned__",groupLabel:"Orphaned worktrees"}));return l});showCreateButton=mT(()=>!this.forcedProject());constructor(){}onItemSelected(t){this.projectStateService.selectProject(t),this.router.navigate(["project",t]);}onCreateRequested(){this.router.navigate(["project","new"]);}onDeleteRequested(t){let o=t.includes(g);this.dialog.open(z,{width:"400px",panelClass:"confirm-dialog-panel",data:P$1({title:"Delete project",message:`This will remove the project "${t}" from Coday and archive its configuration. The project source code on disk is not affected.`,confirmLabel:"Delete",cancelLabel:"Cancel",isDestructive:true},o?{checkboxLabel:"Also remove git worktree from disk"}:{})}).afterClosed().pipe(Ot(r=>r?.confirmed===true),U(this.destroyRef)).subscribe(r=>{this.notification.info("Deleting project\u2026"),this.projectStateService.deleteProject(t,r.checkboxChecked).pipe(U(this.destroyRef)).subscribe({next:()=>{this.notification.success(`Project "${t}" deleted`),this.router.url.includes(`/project/${encodeURIComponent(t)}`)&&this.router.navigate(["/"]);},error:i=>{console.error("[PROJECT-LIST] Failed to delete project:",i),this.notification.error(i?.error?.error??"Failed to delete project");}});});}toEntityListItem(t){return {id:t.name,name:t.name,badges:t.volatile?[{label:"temp",variant:"warning"}]:[]}}static \u0275fac=function(o){return new(o||u)};static \u0275cmp=Aw({type:u,selectors:[["app-project-selection"]],decls:6,vars:5,consts:[["projectCard",""],[1,"project-page-layout"],["title","Projects","contentMaxWidth","1400px","searchPlaceholder","Filter projects\u2026","emptyMessage","No projects found.",3,"itemSelected","createRequested","items","loading","itemTemplate","showCreate","autoFocusSearch"],["toolbar-start","","routerLink","/","title","Back to tasks",1,"project-list__logo"],["src","CODAY-Logo.png","alt","Coday"],[1,"project-card-wrapper"],[3,"selected","id","name","description","badges"],["mat-icon-button","","title","Delete project",1,"project-card-wrapper__delete",3,"click"]],template:function(o,n){if(o&1&&(vs(0,"div",1)(1,"ds-entity-list",2),Ag("itemSelected",function(i){return n.onItemSelected(i)})("createRequested",function(){return n.onCreateRequested()}),vs(2,"a",3),bg(3,"img",4),fl()()(),Dg(4,te,5,5,"ng-template",null,0,fT)),o&2){let r=TC(5);XE(),Tg("items",n.projectItems())("loading",n.isLoading())("itemTemplate",r)("showCreate",n.showCreateButton())("autoFocusSearch",true);}},dependencies:[Wn,ot,yt,wt,Gn,si],styles:["[_nghost-%COMP%]{display:block;width:100%;min-height:100vh;background:var(--color-bg);overflow-y:auto}.project-page-layout[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%}.project-list__logo[_ngcontent-%COMP%]{display:flex;align-items:center;flex-shrink:0;border-radius:4px;opacity:.85;transition:opacity .15s ease;cursor:pointer}.project-list__logo[_ngcontent-%COMP%]:hover{opacity:1}.project-list__logo[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:40px;height:40px;object-fit:contain;border-radius:4px}.project-card-wrapper[_ngcontent-%COMP%]{position:relative}.project-card-wrapper__delete[_ngcontent-%COMP%]{position:absolute;top:4px;right:4px;width:28px;height:28px;line-height:28px;padding:0;opacity:0;transition:opacity .15s ease;color:var(--color-text-secondary, #6e6e73)}.project-card-wrapper__delete[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px}.project-card-wrapper__delete[_ngcontent-%COMP%]:hover{color:var(--color-error, #ff3b30)}.project-card-wrapper[_ngcontent-%COMP%]:hover .project-card-wrapper__delete[_ngcontent-%COMP%]{opacity:1}"],changeDetection:1})};export{Y as ProjectListComponent};
1
+ import {z}from'./chunk-IM1UfDv7.js';import {s}from'./chunk-B5rsaW2b.js';import {g as g$1,G,P,R as Re,w as we,F,m as mT,z as z$1,a as P$1,ae as Ot,b as U,A as Aw,i as Gn,s as si,v as vs,k as Ag,o as bg,j as fl,af as Dg,ag as fT,T as TC,X as XE,r as Tg,a9 as dC,aa as If,ac as mC,ab as wf,W as WC,ah as rT}from'./main-MX6O2FH4.js';import'./chunk-CkfpO0Ui.js';import {W as Wn,o as ot}from'./chunk-LlG18Htx.js';import'./chunk-CUmZcEGx.js';import {y as yt,w as wt}from'./chunk-CJdqLI4x.js';var ee=()=>[];function te(u,t){if(u&1){let o=dC();vs(0,"div",5)(1,"ds-entity-card",6),Ag("selected",function(r){If(o);let i=mC();return wf(i.onItemSelected(r))}),fl(),vs(2,"button",7),Ag("click",function(r){let i=If(o).$implicit,f=mC();return r.stopPropagation(),wf(f.onDeleteRequested(i.id))}),vs(3,"mat-icon"),WC(4,"close"),fl()()();}if(u&2){let o=t.$implicit;XE(),Tg("id",o.id)("name",o.name)("description",o.description)("badges",o.badges??rT(4,ee));}}var g="__",Y=class u{router=g$1(G);projectStateService=g$1(P);dialog=g$1(Re);destroyRef=g$1(we);notification=g$1(s);projects=F(this.projectStateService.projectList$);forcedProject=F(this.projectStateService.forcedProject$,{initialValue:null});isLoading=F(this.projectStateService.isLoading$,{initialValue:false});projectItems=mT(()=>{let t=this.projects();if(!t)return [];let o=t.filter(e=>!e.name.includes(g)),n=t.filter(e=>e.name.includes(g)),r=new Set(o.map(e=>e.name)),i=e=>e.split(g)[0]??null,f=new Set(n.map(e=>i(e.name)).filter(e=>e!==null&&r.has(e))),l=[],G=[...f].sort((e,a)=>e.localeCompare(a));for(let e of G){let a=o.find(s=>s.name===e);l.push(z$1(P$1({},this.toEntityListItem(a)),{groupKey:e,groupLabel:e}));let Z=n.filter(s=>i(s.name)===e).sort((s,C)=>s.name.localeCompare(C.name));for(let s of Z){let C=s.name.slice(e.length+g.length);l.push(z$1(P$1({},this.toEntityListItem(s)),{name:C,description:s.name,groupKey:e,groupLabel:e}));}}let H=[...o].filter(e=>!f.has(e.name)&&!e.volatile).sort((e,a)=>e.name.localeCompare(a.name));for(let e of H)l.push(z$1(P$1({},this.toEntityListItem(e)),{groupKey:"__standalone__",groupLabel:"Projects"}));let Q=[...o].filter(e=>!f.has(e.name)&&e.volatile).sort((e,a)=>e.name.localeCompare(a.name));for(let e of Q)l.push(z$1(P$1({},this.toEntityListItem(e)),{groupKey:"__volatile__",groupLabel:"Temporary"}));let X=n.filter(e=>{let a=i(e.name);return a!==null&&!r.has(a)}).sort((e,a)=>e.name.localeCompare(a.name));for(let e of X)l.push(z$1(P$1({},this.toEntityListItem(e)),{groupKey:"__orphaned__",groupLabel:"Orphaned worktrees"}));return l});showCreateButton=mT(()=>!this.forcedProject());constructor(){}onItemSelected(t){this.projectStateService.selectProject(t),this.router.navigate(["project",t]);}onCreateRequested(){this.router.navigate(["project","new"]);}onDeleteRequested(t){let o=t.includes(g);this.dialog.open(z,{width:"400px",panelClass:"confirm-dialog-panel",data:P$1({title:"Delete project",message:`This will remove the project "${t}" from Coday and archive its configuration. The project source code on disk is not affected.`,confirmLabel:"Delete",cancelLabel:"Cancel",isDestructive:true},o?{checkboxLabel:"Also remove git worktree from disk"}:{})}).afterClosed().pipe(Ot(r=>r?.confirmed===true),U(this.destroyRef)).subscribe(r=>{this.notification.info("Deleting project\u2026"),this.projectStateService.deleteProject(t,r.checkboxChecked).pipe(U(this.destroyRef)).subscribe({next:()=>{this.notification.success(`Project "${t}" deleted`),this.router.url.includes(`/project/${encodeURIComponent(t)}`)&&this.router.navigate(["/"]);},error:i=>{console.error("[PROJECT-LIST] Failed to delete project:",i),this.notification.error(i?.error?.error??"Failed to delete project");}});});}toEntityListItem(t){return {id:t.name,name:t.name,badges:t.volatile?[{label:"temp",variant:"warning"}]:[]}}static \u0275fac=function(o){return new(o||u)};static \u0275cmp=Aw({type:u,selectors:[["app-project-selection"]],decls:6,vars:5,consts:[["projectCard",""],[1,"project-page-layout"],["title","Projects","contentMaxWidth","1400px","searchPlaceholder","Filter projects\u2026","emptyMessage","No projects found.",3,"itemSelected","createRequested","items","loading","itemTemplate","showCreate","autoFocusSearch"],["toolbar-start","","routerLink","/","title","Back to tasks",1,"project-list__logo"],["src","CODAY-Logo.png","alt","Coday"],[1,"project-card-wrapper"],[3,"selected","id","name","description","badges"],["mat-icon-button","","title","Delete project",1,"project-card-wrapper__delete",3,"click"]],template:function(o,n){if(o&1&&(vs(0,"div",1)(1,"ds-entity-list",2),Ag("itemSelected",function(i){return n.onItemSelected(i)})("createRequested",function(){return n.onCreateRequested()}),vs(2,"a",3),bg(3,"img",4),fl()()(),Dg(4,te,5,5,"ng-template",null,0,fT)),o&2){let r=TC(5);XE(),Tg("items",n.projectItems())("loading",n.isLoading())("itemTemplate",r)("showCreate",n.showCreateButton())("autoFocusSearch",true);}},dependencies:[Wn,ot,yt,wt,Gn,si],styles:["[_nghost-%COMP%]{display:block;width:100%;min-height:100vh;background:var(--color-bg);overflow-y:auto}.project-page-layout[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%}.project-list__logo[_ngcontent-%COMP%]{display:flex;align-items:center;flex-shrink:0;border-radius:4px;opacity:.85;transition:opacity .15s ease;cursor:pointer}.project-list__logo[_ngcontent-%COMP%]:hover{opacity:1}.project-list__logo[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:40px;height:40px;object-fit:contain;border-radius:4px}.project-card-wrapper[_ngcontent-%COMP%]{position:relative}.project-card-wrapper__delete[_ngcontent-%COMP%]{position:absolute;top:4px;right:4px;width:28px;height:28px;line-height:28px;padding:0;opacity:0;transition:opacity .15s ease;color:var(--color-text-secondary, #6e6e73)}.project-card-wrapper__delete[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px}.project-card-wrapper__delete[_ngcontent-%COMP%]:hover{color:var(--color-error, #ff3b30)}.project-card-wrapper[_ngcontent-%COMP%]:hover .project-card-wrapper__delete[_ngcontent-%COMP%]{opacity:1}"],changeDetection:1})};export{Y as ProjectListComponent};
@@ -1 +1 @@
1
- import {f}from'./chunk-LGfFQHFU.js';import {g,bm as Sm,R as Re,H as Hi,m as mT,A as Aw,h as hr,i as Gn,v as vs,k as Ag,W as WC,j as fl,n as eC,af as Dg,ag as fT,T as TC,X as XE,r as Tg,t as tC,J as dy,P,aF as A,Y as x,Z as z,_ as Ue,$ as zt,a0 as jt,a1 as Vt,a2 as Nt,e as pr,bn as Xt,ai as Jg,aj as KC,a3 as HI,q as oC,bo as nC,a8 as Zg,ak as Xg,a6 as $I,x as iC,a5 as yl,ac as mC,a9 as dC,aa as If,ab as wf,bp as gl,bq as ml,ah as rT,b4 as oT,y as Hg,b0 as Yg,a4 as rC,C as Cg,o as bg}from'./main-SY6UM2GV.js';import {P as Pt}from'./chunk-CWKiaMQh.js';import {T as Tn,S as Sn,n as nt$1,a as ae,l as le,c as ce}from'./chunk-Bampatce.js';import {W as Wn,o as ot$1,i as it$1,I as In,D as De,B as Be,y as ya,E as En}from'./chunk-8Uub9JWj.js';import'./chunk-Bd2CH26d.js';import {y as yt,w as wt,t as ti,Q as Qn,e as ei,Y as Ye$1,f as fn,m as mn,Z as Zn,g as gt,$ as $t,W as Wt,c as cn}from'./chunk-DbP7sgsG.js';var w=class s{http=g(dy);projectState=g(P);getBaseUrl(){return `/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/agents`}listEditableAgents(){return this.http.get(`${this.getBaseUrl()}/editable`)}getAgent(t){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}createAgent(t,e){return this.http.post(this.getBaseUrl(),{location:e,definition:t})}updateAgent(t,e){return this.http.put(`${this.getBaseUrl()}/${encodeURIComponent(t)}`,{definition:e})}listDocuments(t){return this.http.get(`${this.getBaseUrl()}/documents`,{params:{location:t}})}uploadDocument(t,e){return new A(n=>{let a=new FileReader;a.onload=()=>{let r=a.result.split(",")[1];this.http.post(`${this.getBaseUrl()}/documents`,{filename:e.name,content:r,mimeType:e.type},{params:{location:t}}).subscribe(n);},a.onerror=()=>n.error(a.error),a.readAsDataURL(e);})}deleteAgent(t){return this.http.delete(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}static \u0275fac=function(e){return new(e||s)};static \u0275prov=x({token:s,factory:s.\u0275fac,providedIn:"root"})};function ze(s,t){s&1&&(vs(0,"p",15),WC(1,"No integrations defined \u2014 agent will have access to all tools."),fl());}function qe(s,t){if(s&1){let e=dC();vs(0,"div",16)(1,"mat-form-field",22)(2,"mat-label"),WC(3,"Integration"),fl(),vs(4,"input",23),Jg("ngModelChange",function(a){let r=If(e).$implicit;return KC(r.integration,a)||(r.integration=a),wf(a)}),fl(),HI(),fl(),vs(5,"mat-form-field",24)(6,"mat-label"),WC(7,"Tools (comma-separated)"),fl(),vs(8,"input",25),Jg("ngModelChange",function(a){let r=If(e).$implicit;return KC(r.tools,a)||(r.tools=a),wf(a)}),fl(),HI(),fl(),vs(9,"button",26),Ag("click",function(){let a=If(e).$index,r=mC();return wf(r.removeIntegrationRow(a))}),vs(10,"mat-icon"),WC(11,"delete"),fl()()();}if(s&2){let e=t.$implicit;XE(4),Xg("ngModel",e.integration),$I(),XE(4),Xg("ngModel",e.tools),$I();}}function He(s,t){if(s&1&&(vs(0,"p",30),WC(1),fl()),s&2){let e=mC(2);XE(),Zg(e.docUploadError);}}function Ge(s,t){s&1&&(vs(0,"p",15),WC(1,"No mandatory documents defined."),fl());}function Ze(s,t){if(s&1&&bg(0,"option",35),s&2){let e=t.$implicit;Tg("value","documents/"+e);}}function Ke(s,t){if(s&1){let e=dC();vs(0,"div",31)(1,"mat-form-field",32)(2,"mat-label"),WC(3,"Document path"),fl(),vs(4,"input",33),Jg("ngModelChange",function(a){let r=If(e).$index,j=mC(2);return KC(j.mandatoryDocs[r],a)||(j.mandatoryDocs[r]=a),wf(a)}),fl(),HI(),vs(5,"datalist",34),oC(6,Ze,1,1,"option",35,rC),fl()(),vs(8,"button",26),Ag("click",function(){let a=If(e).$index,r=mC(2);return wf(r.removeDocRow(a))}),vs(9,"mat-icon"),WC(10,"delete"),fl()()();}if(s&2){let e=t.$index,n=mC(2);XE(4),Xg("ngModel",n.mandatoryDocs[e]),Cg("list","docs-list-"+e),$I(),XE(),Tg("id","docs-list-"+e),XE(),iC(n.availableDocuments);}}function Je(s,t){if(s&1){let e=dC();vs(0,"div",6)(1,"span"),WC(2,"Mandatory Documents"),fl(),vs(3,"button",27),Ag("click",function(){If(e);let a=mC();return wf(a.addDocRow())}),vs(4,"mat-icon"),WC(5,"add"),fl()(),vs(6,"label",28)(7,"mat-icon"),WC(8,"upload_file"),fl(),vs(9,"input",29),Ag("change",function(a){If(e);let r=mC();return wf(r.onDocFileSelected(a))}),fl()()(),eC(10,He,2,1,"p",30),eC(11,Ge,2,0,"p",15),oC(12,Ke,11,3,"div",31,nC);}if(s&2){let e=mC();XE(6),Hg("uploading",e.isUploadingDoc),XE(3),Tg("disabled",e.isUploadingDoc),XE(),tC(e.docUploadError?10:-1),XE(),tC(e.mandatoryDocs.length===0?11:-1),XE(),iC(e.mandatoryDocs);}}function Qe(s,t){s&1&&(vs(0,"p",15),WC(1,"\u{1F4A1} Documents can be added after the agent is created."),fl());}function Xe(s,t){if(s&1){let e=dC();vs(0,"div",6),WC(1,"Save to"),fl(),vs(2,"div",36)(3,"label",37)(4,"input",38),Jg("ngModelChange",function(a){If(e);let r=mC();return KC(r.location,a)||(r.location=a),wf(a)}),fl(),HI(),vs(5,"div",39)(6,"div",40)(7,"span",41),WC(8,"\u{1F464}"),fl(),vs(9,"span",42),WC(10,"Project config"),fl()(),vs(11,"p",43),WC(12),fl()()(),vs(13,"label",37)(14,"input",44),Jg("ngModelChange",function(a){If(e);let r=mC();return KC(r.location,a)||(r.location=a),wf(a)}),fl(),HI(),vs(15,"div",39)(16,"div",40)(17,"span",41),WC(18,"\u{1F4E6}"),fl(),vs(19,"span",42),WC(20,"Colocated"),fl()(),vs(21,"p",43),WC(22,"Next to coday.yaml in ./agents/ (committable)"),fl()()()(),vs(23,"p",15),WC(24,"Storage location is permanent and cannot be changed after creation."),fl();}if(s&2){let e=mC();XE(3),Hg("selected",e.location==="project"),XE(),Xg("ngModel",e.location),$I(),XE(8),Yg("~/.coday/projects/","{","name","}","/agents/ (not committed)"),XE(),Hg("selected",e.location==="colocated"),XE(),Xg("ngModel",e.location),$I();}}function Ye(s,t){if(s&1&&(vs(0,"div",17)(1,"span",6),WC(2,"Storage Location"),fl(),vs(3,"span",45),WC(4),fl(),vs(5,"p",15),WC(6,"Cannot be changed after creation."),fl()()),s&2){let e=mC();XE(3),Hg("badge-project",e.location==="project")("badge-colocated",e.location==="colocated"),XE(),yl(" ",e.location==="project"?"\u{1F464} Project config":"\u{1F4E6} Colocated"," ");}}function $e(s,t){if(s&1&&(vs(0,"div",18)(1,"mat-icon"),WC(2,"error"),fl(),vs(3,"span"),WC(4),fl()()),s&2){let e=mC();XE(4),Zg(e.errorMessage);}}var E=class s{agentCrudApi=g(w);agentApi=g(f);dialogRef=g(z);data=g(Ue);name="";description="";instructions="";aiProvider="";modelName="";temperature=null;maxOutputTokens=null;openaiAssistantId="";integrationRows=[];mandatoryDocs=[];availableDocuments=[];isUploadingDoc=false;docUploadError="";location="project";isSaving=false;errorMessage="";isEditMode=false;ngOnInit(){if(this.isEditMode=this.data.mode==="edit",this.isEditMode&&this.data.agent){let t=this.data.agent.definition;this.name=t.name,this.description=t.description,this.instructions=t.instructions??"",this.aiProvider=t.aiProvider??"",this.modelName=t.modelName??"",this.temperature=t.temperature??null,this.maxOutputTokens=t.maxOutputTokens??null,this.openaiAssistantId=t.openaiAssistantId??"",this.location=this.data.agent.source,t.integrations&&(this.integrationRows=Object.entries(t.integrations).map(([e,n])=>({integration:e,tools:n?.join(", ")??""}))),this.mandatoryDocs=[...t.mandatoryDocs??[]],this.loadAvailableDocuments();}}loadAvailableDocuments(){this.agentCrudApi.listDocuments(this.location).subscribe({next:t=>this.availableDocuments=t,error:()=>this.availableDocuments=[]});}addDocRow(){this.mandatoryDocs.push("");}removeDocRow(t){this.mandatoryDocs.splice(t,1);}onDocFileSelected(t){let e=t.target,n=e.files?.[0];n&&(this.isUploadingDoc=true,this.docUploadError="",this.agentCrudApi.uploadDocument(this.location,n).subscribe({next:a=>{this.isUploadingDoc=false,this.mandatoryDocs.push(a.relativePath),this.loadAvailableDocuments(),e.value="";},error:a=>{this.isUploadingDoc=false,this.docUploadError=a?.error?.error??a?.message??"Upload failed",e.value="";}}));}addIntegrationRow(){this.integrationRows.push({integration:"",tools:""});}removeIntegrationRow(t){this.integrationRows.splice(t,1);}trackByIndex(t){return t}validateForm(){if(!this.name.trim())return this.errorMessage="Name is required",false;if(!/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/.test(this.name.trim()))return this.errorMessage="Name must start with alphanumeric and contain only letters, digits, hyphens or underscores",false;if(!this.description.trim())return this.errorMessage="Description is required",false;for(let t of this.integrationRows)if(!t.integration.trim())return this.errorMessage="Integration name cannot be empty",false;return true}buildDefinition(){let t=this.mandatoryDocs.map(n=>n.trim()).filter(Boolean),e=this.integrationRows.length>0?Object.fromEntries(this.integrationRows.filter(n=>n.integration.trim()).map(n=>[n.integration.trim(),n.tools.split(",").map(a=>a.trim()).filter(Boolean)])):void 0;return {name:this.name.trim(),description:this.description.trim(),instructions:this.instructions.trim()||void 0,aiProvider:this.aiProvider.trim()||void 0,modelName:this.modelName.trim()||void 0,temperature:this.temperature??void 0,maxOutputTokens:this.maxOutputTokens??void 0,openaiAssistantId:this.openaiAssistantId.trim()||void 0,integrations:e,mandatoryDocs:t.length>0?t:void 0}}save(){if(this.errorMessage="",!this.validateForm())return;let t=this.buildDefinition();this.isSaving=true,(this.isEditMode?this.agentCrudApi.updateAgent(this.name.trim(),t):this.agentCrudApi.createAgent(t,this.location)).subscribe({next:()=>{this.isSaving=false,this.agentApi.clearAllCache(),this.dialogRef.close(true);},error:n=>{this.isSaving=false,this.errorMessage=n?.error?.error||n?.message||"Failed to save agent";}});}cancel(){this.dialogRef.close(false);}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=Aw({type:s,selectors:[["app-agent-form"]],decls:69,vars:18,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-agent","required","",3,"ngModelChange","ngModel","readonly"],["matInput","","placeholder","What does this agent do?","rows","2","required","",3,"ngModelChange","ngModel"],["matInput","","placeholder","System instructions for the agent...","rows","6",3,"ngModelChange","ngModel"],[1,"section-title"],[1,"row-2col"],["appearance","outline"],["matInput","","placeholder","e.g. anthropic, openai",3,"ngModelChange","ngModel"],["matInput","","placeholder","e.g. claude-sonnet-4-5",3,"ngModelChange","ngModel"],["matInput","","type","number","min","0","max","2","step","0.1","placeholder","0.0 \u2013 2.0",3,"ngModelChange","ngModel"],["matInput","","type","number","min","1","placeholder","e.g. 4096",3,"ngModelChange","ngModel"],["matInput","","placeholder","asst_...",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Add integration",3,"click"],[1,"hint"],[1,"integration-row"],[1,"source-display"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"integration-name"],["matInput","","placeholder","e.g. GITHUB",3,"ngModelChange","ngModel"],["appearance","outline",1,"integration-tools"],["matInput","","placeholder","Leave empty for all tools",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove",3,"click"],["mat-icon-button","","type","button","title","Add document path",3,"click"],["title","Upload a document to the pool",1,"upload-btn"],["type","file","hidden","",3,"change","disabled"],[1,"doc-upload-error"],[1,"doc-row"],["appearance","outline",1,"doc-field"],["matInput","","placeholder","documents/guide.md",3,"ngModelChange","ngModel"],[3,"id"],[3,"value"],[1,"source-options"],[1,"source-option"],["type","radio","name","location","value","project",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","location","value","colocated",3,"ngModelChange","ngModel"],[1,"source-badge"]],template:function(e,n){e&1&&(vs(0,"h2",0),WC(1),fl(),vs(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),WC(6,"Name"),fl(),vs(7,"input",3),Jg("ngModelChange",function(r){return KC(n.name,r)||(n.name=r),r}),fl(),HI(),vs(8,"mat-hint"),WC(9,"Alphanumeric, hyphens and underscores only. Cannot be changed after creation."),fl()(),vs(10,"mat-form-field",2)(11,"mat-label"),WC(12,"Description"),fl(),vs(13,"textarea",4),Jg("ngModelChange",function(r){return KC(n.description,r)||(n.description=r),r}),fl(),HI(),fl(),vs(14,"mat-form-field",2)(15,"mat-label"),WC(16,"Instructions"),fl(),vs(17,"textarea",5),Jg("ngModelChange",function(r){return KC(n.instructions,r)||(n.instructions=r),r}),fl(),HI(),vs(18,"mat-hint"),WC(19,"System prompt / instructions sent to the AI model"),fl()(),vs(20,"div",6),WC(21,"AI Configuration"),fl(),vs(22,"div",7)(23,"mat-form-field",8)(24,"mat-label"),WC(25,"AI Provider"),fl(),vs(26,"input",9),Jg("ngModelChange",function(r){return KC(n.aiProvider,r)||(n.aiProvider=r),r}),fl(),HI(),fl(),vs(27,"mat-form-field",8)(28,"mat-label"),WC(29,"Model Name"),fl(),vs(30,"input",10),Jg("ngModelChange",function(r){return KC(n.modelName,r)||(n.modelName=r),r}),fl(),HI(),fl()(),vs(31,"div",7)(32,"mat-form-field",8)(33,"mat-label"),WC(34,"Temperature"),fl(),vs(35,"input",11),Jg("ngModelChange",function(r){return KC(n.temperature,r)||(n.temperature=r),r}),fl(),HI(),vs(36,"mat-hint"),WC(37,"Leave empty for model default"),fl()(),vs(38,"mat-form-field",8)(39,"mat-label"),WC(40,"Max Output Tokens"),fl(),vs(41,"input",12),Jg("ngModelChange",function(r){return KC(n.maxOutputTokens,r)||(n.maxOutputTokens=r),r}),fl(),HI(),vs(42,"mat-hint"),WC(43,"Leave empty for model default"),fl()()(),vs(44,"mat-form-field",2)(45,"mat-label"),WC(46,"OpenAI Assistant ID"),fl(),vs(47,"input",13),Jg("ngModelChange",function(r){return KC(n.openaiAssistantId,r)||(n.openaiAssistantId=r),r}),fl(),HI(),vs(48,"mat-hint"),WC(49,"If set, forces aiProvider to openai"),fl()(),vs(50,"div",6)(51,"span"),WC(52,"Integrations"),fl(),vs(53,"button",14),Ag("click",function(){return n.addIntegrationRow()}),vs(54,"mat-icon"),WC(55,"add"),fl()()(),eC(56,ze,2,0,"p",15),oC(57,qe,12,2,"div",16,nC),eC(59,Je,14,5)(60,Qe,2,0,"p",15),eC(61,Xe,25,8),eC(62,Ye,7,5,"div",17),eC(63,$e,5,1,"div",18),fl()(),vs(64,"mat-dialog-actions",19)(65,"button",20),Ag("click",function(){return n.cancel()}),WC(66,"Cancel"),fl(),vs(67,"button",21),Ag("click",function(){return n.save()}),WC(68),fl()()),e&2&&(XE(),Zg(n.isEditMode?"Edit Agent":"Create Agent"),XE(6),Xg("ngModel",n.name),Tg("readonly",n.isEditMode),$I(),XE(6),Xg("ngModel",n.description),$I(),XE(4),Xg("ngModel",n.instructions),$I(),XE(9),Xg("ngModel",n.aiProvider),$I(),XE(4),Xg("ngModel",n.modelName),$I(),XE(5),Xg("ngModel",n.temperature),$I(),XE(6),Xg("ngModel",n.maxOutputTokens),$I(),XE(6),Xg("ngModel",n.openaiAssistantId),$I(),XE(9),tC(n.integrationRows.length===0?56:-1),XE(),iC(n.integrationRows),XE(2),tC(n.isEditMode?59:60),XE(2),tC(n.isEditMode?-1:61),XE(),tC(n.isEditMode?62:-1),XE(),tC(n.errorMessage?63:-1),XE(2),Tg("disabled",n.isSaving),XE(2),Tg("disabled",n.isSaving),XE(),yl(" ",n.isSaving?"Saving...":"Save"," "));},dependencies:[ti,Qn,ei,Ye$1,fn,mn,Zn,gt,$t,Wt,cn,zt,jt,Vt,Nt,hr,pr,Gn,Tn,Sn,nt$1,ae,le,ce,yt,wt,Pt,Xt],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:560px}@media(max-width:768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.section-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;font-size:1rem;font-weight:600;margin-top:.5rem;margin-bottom:-.25rem}.row-2col[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}@media(max-width:768px){.row-2col[_ngcontent-%COMP%]{grid-template-columns:1fr}}.integration-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.integration-row[_ngcontent-%COMP%] .integration-name[_ngcontent-%COMP%]{flex:0 0 180px}.integration-row[_ngcontent-%COMP%] .integration-tools[_ngcontent-%COMP%]{flex:1}.hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.5rem}@media(max-width:768px){.source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-family:monospace;line-height:1.4}.source-display[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500}.source-badge.badge-project[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-badge.badge-colocated[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.doc-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.doc-row[_ngcontent-%COMP%] .doc-field[_ngcontent-%COMP%]{flex:1}.upload-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;cursor:pointer;color:var(--color-text-secondary);transition:background .2s}.upload-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);color:var(--color-primary)}.upload-btn.uploading[_ngcontent-%COMP%]{opacity:.5;cursor:wait}.upload-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.doc-upload-error[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-error)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}"],changeDetection:1})};var et=()=>[],tt=s=>({id:s});function nt(s,t){if(s&1&&(vs(0,"div",5),WC(1),fl()),s&2){let e=mC();XE(),Zg(e.errorMessage());}}function it(s,t){if(s&1){let e=dC();vs(0,"ds-entity-card",7),Ag("selected",function(a){If(e);let r=mC();return wf(r.onEdit(a))}),gl(1,8),vs(2,"button",9),Ag("click",function(a){return a.stopPropagation()}),vs(3,"mat-icon"),WC(4,"more_vert"),fl()(),ml(),fl();}if(s&2){let e=t.$implicit;mC();let n=TC(9);Tg("id",e.id)("name",e.name)("description",e.description)("badges",e.badges??rT(6,et)),XE(2),Tg("matMenuTriggerFor",n)("matMenuTriggerData",oT(7,tt,e.id));}}function ot(s,t){if(s&1){let e=dC();vs(0,"button",10),Ag("click",function(){let a=If(e).id,r=mC();return wf(r.onEdit(a))}),vs(1,"mat-icon"),WC(2,"edit"),fl(),WC(3," Edit "),fl(),vs(4,"button",11),Ag("click",function(){let a=If(e).id,r=mC();return wf(r.onDelete(a))}),vs(5,"mat-icon"),WC(6,"delete"),fl(),WC(7," Delete "),fl();}}var Ve=class s{agentCrudApi=g(w);location=g(Sm);dialog=g(Re);agents=Hi([]);isLoading=Hi(false);errorMessage=Hi(null);agentItems=mT(()=>this.agents().map(t=>({id:t.name,name:t.name,description:t.description,badges:this.buildBadges(t),groupKey:t.source,groupLabel:t.source==="project"?"Project (~/.coday/)":"Colocated (next to coday.yaml)"})));ngOnInit(){this.loadAgents();}loadAgents(){this.isLoading.set(true),this.errorMessage.set(null),this.agentCrudApi.listEditableAgents().subscribe({next:t=>{this.agents.set(t),this.isLoading.set(false);},error:t=>{this.errorMessage.set(t?.error?.error??"Failed to load agents"),this.isLoading.set(false);}});}onBack(){this.location.back();}onCreate(){this.dialog.open(E,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadAgents();});}onEdit(t){this.agentCrudApi.getAgent(t).subscribe({next:e=>{this.dialog.open(E,{width:"700px",maxHeight:"90vh",data:{mode:"edit",agent:e}}).afterClosed().subscribe(a=>{a&&this.loadAgents();});},error:e=>this.errorMessage.set(e?.error?.error??"Failed to load agent")});}onDelete(t){confirm(`Are you sure you want to delete agent "${t}"?`)&&this.agentCrudApi.deleteAgent(t).subscribe({next:()=>this.loadAgents(),error:e=>this.errorMessage.set(e?.error?.error??"Failed to delete agent")});}buildBadges(t){return [t.source==="project"?{label:"project",variant:"info"}:{label:"colocated",variant:"success"}]}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=Aw({type:s,selectors:[["app-agent-list"]],decls:11,vars:5,consts:[["agentCard",""],["cardMenu","matMenu"],[1,"agent-list-page"],["title","Agents","cardMinWidth","260px","contentMaxWidth","1400px","searchPlaceholder","Filter agents\u2026","emptyMessage","No file-based agents found.",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","mat-icon-button","","title","Back",3,"click"],[1,"agent-list__error"],["matMenuContent",""],[3,"selected","id","name","description","badges"],["dsCardActions",""],["mat-icon-button","",3,"click","matMenuTriggerFor","matMenuTriggerData"],["mat-menu-item","",3,"click"],["mat-menu-item","",1,"agent-list__delete-item",3,"click"]],template:function(e,n){if(e&1&&(vs(0,"div",2)(1,"ds-entity-list",3),Ag("createRequested",function(){return n.onCreate()}),vs(2,"button",4),Ag("click",function(){return n.onBack()}),vs(3,"mat-icon"),WC(4,"chevron_left"),fl()()(),eC(5,nt,2,1,"div",5),fl(),Dg(6,it,5,9,"ng-template",null,0,fT),vs(8,"mat-menu",null,1),Dg(10,ot,8,0,"ng-template",6),fl()),e&2){let a=TC(7);XE(),Tg("items",n.agentItems())("loading",n.isLoading())("showCreate",true)("itemTemplate",a),XE(4),tC(n.errorMessage()?5:-1);}},dependencies:[Wn,ot$1,it$1,hr,Gn,yt,wt,In,De,Be,ya,En],styles:["[_nghost-%COMP%]{display:block;width:100%;min-height:100vh;background:var(--color-bg);overflow-y:auto}.agent-list__delete-item[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.agent-list__delete-item[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:inherit}.agent-list__error[_ngcontent-%COMP%]{margin:1rem auto;max-width:900px;padding:.75rem 1rem;background:#dc262614;border:1px solid rgba(220,38,38,.25);border-radius:8px;color:var(--color-error, #ff3b30);font-size:.875rem}"],changeDetection:1})};export{Ve as AgentListComponent};
1
+ import {f}from'./chunk-DAOnyJ7c.js';import {g,bm as Sm,R as Re,H as Hi,m as mT,A as Aw,h as hr,i as Gn,v as vs,k as Ag,W as WC,j as fl,n as eC,af as Dg,ag as fT,T as TC,X as XE,r as Tg,t as tC,J as dy,P,aF as A,Y as x,Z as z,_ as Ue,$ as zt,a0 as jt,a1 as Vt,a2 as Nt,e as pr,bn as Xt,ai as Jg,aj as KC,a3 as HI,q as oC,bo as nC,a8 as Zg,ak as Xg,a6 as $I,x as iC,a5 as yl,ac as mC,a9 as dC,aa as If,ab as wf,bp as gl,bq as ml,ah as rT,b4 as oT,y as Hg,b0 as Yg,a4 as rC,C as Cg,o as bg}from'./main-MX6O2FH4.js';import {P as Pt}from'./chunk-DzZlI93U.js';import {T as Tn,S as Sn,n as nt$1,a as ae,l as le,c as ce}from'./chunk-B8YsdH5W.js';import {W as Wn,o as ot$1,i as it$1,I as In,D as De,B as Be,y as ya,E as En}from'./chunk-LlG18Htx.js';import'./chunk-CUmZcEGx.js';import {y as yt,w as wt,t as ti,Q as Qn,e as ei,Y as Ye$1,f as fn,m as mn,Z as Zn,g as gt,$ as $t,W as Wt,c as cn}from'./chunk-CJdqLI4x.js';var w=class s{http=g(dy);projectState=g(P);getBaseUrl(){return `/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/agents`}listEditableAgents(){return this.http.get(`${this.getBaseUrl()}/editable`)}getAgent(t){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}createAgent(t,e){return this.http.post(this.getBaseUrl(),{location:e,definition:t})}updateAgent(t,e){return this.http.put(`${this.getBaseUrl()}/${encodeURIComponent(t)}`,{definition:e})}listDocuments(t){return this.http.get(`${this.getBaseUrl()}/documents`,{params:{location:t}})}uploadDocument(t,e){return new A(n=>{let a=new FileReader;a.onload=()=>{let r=a.result.split(",")[1];this.http.post(`${this.getBaseUrl()}/documents`,{filename:e.name,content:r,mimeType:e.type},{params:{location:t}}).subscribe(n);},a.onerror=()=>n.error(a.error),a.readAsDataURL(e);})}deleteAgent(t){return this.http.delete(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}static \u0275fac=function(e){return new(e||s)};static \u0275prov=x({token:s,factory:s.\u0275fac,providedIn:"root"})};function ze(s,t){s&1&&(vs(0,"p",15),WC(1,"No integrations defined \u2014 agent will have access to all tools."),fl());}function qe(s,t){if(s&1){let e=dC();vs(0,"div",16)(1,"mat-form-field",22)(2,"mat-label"),WC(3,"Integration"),fl(),vs(4,"input",23),Jg("ngModelChange",function(a){let r=If(e).$implicit;return KC(r.integration,a)||(r.integration=a),wf(a)}),fl(),HI(),fl(),vs(5,"mat-form-field",24)(6,"mat-label"),WC(7,"Tools (comma-separated)"),fl(),vs(8,"input",25),Jg("ngModelChange",function(a){let r=If(e).$implicit;return KC(r.tools,a)||(r.tools=a),wf(a)}),fl(),HI(),fl(),vs(9,"button",26),Ag("click",function(){let a=If(e).$index,r=mC();return wf(r.removeIntegrationRow(a))}),vs(10,"mat-icon"),WC(11,"delete"),fl()()();}if(s&2){let e=t.$implicit;XE(4),Xg("ngModel",e.integration),$I(),XE(4),Xg("ngModel",e.tools),$I();}}function He(s,t){if(s&1&&(vs(0,"p",30),WC(1),fl()),s&2){let e=mC(2);XE(),Zg(e.docUploadError);}}function Ge(s,t){s&1&&(vs(0,"p",15),WC(1,"No mandatory documents defined."),fl());}function Ze(s,t){if(s&1&&bg(0,"option",35),s&2){let e=t.$implicit;Tg("value","documents/"+e);}}function Ke(s,t){if(s&1){let e=dC();vs(0,"div",31)(1,"mat-form-field",32)(2,"mat-label"),WC(3,"Document path"),fl(),vs(4,"input",33),Jg("ngModelChange",function(a){let r=If(e).$index,j=mC(2);return KC(j.mandatoryDocs[r],a)||(j.mandatoryDocs[r]=a),wf(a)}),fl(),HI(),vs(5,"datalist",34),oC(6,Ze,1,1,"option",35,rC),fl()(),vs(8,"button",26),Ag("click",function(){let a=If(e).$index,r=mC(2);return wf(r.removeDocRow(a))}),vs(9,"mat-icon"),WC(10,"delete"),fl()()();}if(s&2){let e=t.$index,n=mC(2);XE(4),Xg("ngModel",n.mandatoryDocs[e]),Cg("list","docs-list-"+e),$I(),XE(),Tg("id","docs-list-"+e),XE(),iC(n.availableDocuments);}}function Je(s,t){if(s&1){let e=dC();vs(0,"div",6)(1,"span"),WC(2,"Mandatory Documents"),fl(),vs(3,"button",27),Ag("click",function(){If(e);let a=mC();return wf(a.addDocRow())}),vs(4,"mat-icon"),WC(5,"add"),fl()(),vs(6,"label",28)(7,"mat-icon"),WC(8,"upload_file"),fl(),vs(9,"input",29),Ag("change",function(a){If(e);let r=mC();return wf(r.onDocFileSelected(a))}),fl()()(),eC(10,He,2,1,"p",30),eC(11,Ge,2,0,"p",15),oC(12,Ke,11,3,"div",31,nC);}if(s&2){let e=mC();XE(6),Hg("uploading",e.isUploadingDoc),XE(3),Tg("disabled",e.isUploadingDoc),XE(),tC(e.docUploadError?10:-1),XE(),tC(e.mandatoryDocs.length===0?11:-1),XE(),iC(e.mandatoryDocs);}}function Qe(s,t){s&1&&(vs(0,"p",15),WC(1,"\u{1F4A1} Documents can be added after the agent is created."),fl());}function Xe(s,t){if(s&1){let e=dC();vs(0,"div",6),WC(1,"Save to"),fl(),vs(2,"div",36)(3,"label",37)(4,"input",38),Jg("ngModelChange",function(a){If(e);let r=mC();return KC(r.location,a)||(r.location=a),wf(a)}),fl(),HI(),vs(5,"div",39)(6,"div",40)(7,"span",41),WC(8,"\u{1F464}"),fl(),vs(9,"span",42),WC(10,"Project config"),fl()(),vs(11,"p",43),WC(12),fl()()(),vs(13,"label",37)(14,"input",44),Jg("ngModelChange",function(a){If(e);let r=mC();return KC(r.location,a)||(r.location=a),wf(a)}),fl(),HI(),vs(15,"div",39)(16,"div",40)(17,"span",41),WC(18,"\u{1F4E6}"),fl(),vs(19,"span",42),WC(20,"Colocated"),fl()(),vs(21,"p",43),WC(22,"Next to coday.yaml in ./agents/ (committable)"),fl()()()(),vs(23,"p",15),WC(24,"Storage location is permanent and cannot be changed after creation."),fl();}if(s&2){let e=mC();XE(3),Hg("selected",e.location==="project"),XE(),Xg("ngModel",e.location),$I(),XE(8),Yg("~/.coday/projects/","{","name","}","/agents/ (not committed)"),XE(),Hg("selected",e.location==="colocated"),XE(),Xg("ngModel",e.location),$I();}}function Ye(s,t){if(s&1&&(vs(0,"div",17)(1,"span",6),WC(2,"Storage Location"),fl(),vs(3,"span",45),WC(4),fl(),vs(5,"p",15),WC(6,"Cannot be changed after creation."),fl()()),s&2){let e=mC();XE(3),Hg("badge-project",e.location==="project")("badge-colocated",e.location==="colocated"),XE(),yl(" ",e.location==="project"?"\u{1F464} Project config":"\u{1F4E6} Colocated"," ");}}function $e(s,t){if(s&1&&(vs(0,"div",18)(1,"mat-icon"),WC(2,"error"),fl(),vs(3,"span"),WC(4),fl()()),s&2){let e=mC();XE(4),Zg(e.errorMessage);}}var E=class s{agentCrudApi=g(w);agentApi=g(f);dialogRef=g(z);data=g(Ue);name="";description="";instructions="";aiProvider="";modelName="";temperature=null;maxOutputTokens=null;openaiAssistantId="";integrationRows=[];mandatoryDocs=[];availableDocuments=[];isUploadingDoc=false;docUploadError="";location="project";isSaving=false;errorMessage="";isEditMode=false;ngOnInit(){if(this.isEditMode=this.data.mode==="edit",this.isEditMode&&this.data.agent){let t=this.data.agent.definition;this.name=t.name,this.description=t.description,this.instructions=t.instructions??"",this.aiProvider=t.aiProvider??"",this.modelName=t.modelName??"",this.temperature=t.temperature??null,this.maxOutputTokens=t.maxOutputTokens??null,this.openaiAssistantId=t.openaiAssistantId??"",this.location=this.data.agent.source,t.integrations&&(this.integrationRows=Object.entries(t.integrations).map(([e,n])=>({integration:e,tools:n?.join(", ")??""}))),this.mandatoryDocs=[...t.mandatoryDocs??[]],this.loadAvailableDocuments();}}loadAvailableDocuments(){this.agentCrudApi.listDocuments(this.location).subscribe({next:t=>this.availableDocuments=t,error:()=>this.availableDocuments=[]});}addDocRow(){this.mandatoryDocs.push("");}removeDocRow(t){this.mandatoryDocs.splice(t,1);}onDocFileSelected(t){let e=t.target,n=e.files?.[0];n&&(this.isUploadingDoc=true,this.docUploadError="",this.agentCrudApi.uploadDocument(this.location,n).subscribe({next:a=>{this.isUploadingDoc=false,this.mandatoryDocs.push(a.relativePath),this.loadAvailableDocuments(),e.value="";},error:a=>{this.isUploadingDoc=false,this.docUploadError=a?.error?.error??a?.message??"Upload failed",e.value="";}}));}addIntegrationRow(){this.integrationRows.push({integration:"",tools:""});}removeIntegrationRow(t){this.integrationRows.splice(t,1);}trackByIndex(t){return t}validateForm(){if(!this.name.trim())return this.errorMessage="Name is required",false;if(!/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/.test(this.name.trim()))return this.errorMessage="Name must start with alphanumeric and contain only letters, digits, hyphens or underscores",false;if(!this.description.trim())return this.errorMessage="Description is required",false;for(let t of this.integrationRows)if(!t.integration.trim())return this.errorMessage="Integration name cannot be empty",false;return true}buildDefinition(){let t=this.mandatoryDocs.map(n=>n.trim()).filter(Boolean),e=this.integrationRows.length>0?Object.fromEntries(this.integrationRows.filter(n=>n.integration.trim()).map(n=>[n.integration.trim(),n.tools.split(",").map(a=>a.trim()).filter(Boolean)])):void 0;return {name:this.name.trim(),description:this.description.trim(),instructions:this.instructions.trim()||void 0,aiProvider:this.aiProvider.trim()||void 0,modelName:this.modelName.trim()||void 0,temperature:this.temperature??void 0,maxOutputTokens:this.maxOutputTokens??void 0,openaiAssistantId:this.openaiAssistantId.trim()||void 0,integrations:e,mandatoryDocs:t.length>0?t:void 0}}save(){if(this.errorMessage="",!this.validateForm())return;let t=this.buildDefinition();this.isSaving=true,(this.isEditMode?this.agentCrudApi.updateAgent(this.name.trim(),t):this.agentCrudApi.createAgent(t,this.location)).subscribe({next:()=>{this.isSaving=false,this.agentApi.clearAllCache(),this.dialogRef.close(true);},error:n=>{this.isSaving=false,this.errorMessage=n?.error?.error||n?.message||"Failed to save agent";}});}cancel(){this.dialogRef.close(false);}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=Aw({type:s,selectors:[["app-agent-form"]],decls:69,vars:18,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-agent","required","",3,"ngModelChange","ngModel","readonly"],["matInput","","placeholder","What does this agent do?","rows","2","required","",3,"ngModelChange","ngModel"],["matInput","","placeholder","System instructions for the agent...","rows","6",3,"ngModelChange","ngModel"],[1,"section-title"],[1,"row-2col"],["appearance","outline"],["matInput","","placeholder","e.g. anthropic, openai",3,"ngModelChange","ngModel"],["matInput","","placeholder","e.g. claude-sonnet-4-5",3,"ngModelChange","ngModel"],["matInput","","type","number","min","0","max","2","step","0.1","placeholder","0.0 \u2013 2.0",3,"ngModelChange","ngModel"],["matInput","","type","number","min","1","placeholder","e.g. 4096",3,"ngModelChange","ngModel"],["matInput","","placeholder","asst_...",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Add integration",3,"click"],[1,"hint"],[1,"integration-row"],[1,"source-display"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"integration-name"],["matInput","","placeholder","e.g. GITHUB",3,"ngModelChange","ngModel"],["appearance","outline",1,"integration-tools"],["matInput","","placeholder","Leave empty for all tools",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove",3,"click"],["mat-icon-button","","type","button","title","Add document path",3,"click"],["title","Upload a document to the pool",1,"upload-btn"],["type","file","hidden","",3,"change","disabled"],[1,"doc-upload-error"],[1,"doc-row"],["appearance","outline",1,"doc-field"],["matInput","","placeholder","documents/guide.md",3,"ngModelChange","ngModel"],[3,"id"],[3,"value"],[1,"source-options"],[1,"source-option"],["type","radio","name","location","value","project",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","location","value","colocated",3,"ngModelChange","ngModel"],[1,"source-badge"]],template:function(e,n){e&1&&(vs(0,"h2",0),WC(1),fl(),vs(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),WC(6,"Name"),fl(),vs(7,"input",3),Jg("ngModelChange",function(r){return KC(n.name,r)||(n.name=r),r}),fl(),HI(),vs(8,"mat-hint"),WC(9,"Alphanumeric, hyphens and underscores only. Cannot be changed after creation."),fl()(),vs(10,"mat-form-field",2)(11,"mat-label"),WC(12,"Description"),fl(),vs(13,"textarea",4),Jg("ngModelChange",function(r){return KC(n.description,r)||(n.description=r),r}),fl(),HI(),fl(),vs(14,"mat-form-field",2)(15,"mat-label"),WC(16,"Instructions"),fl(),vs(17,"textarea",5),Jg("ngModelChange",function(r){return KC(n.instructions,r)||(n.instructions=r),r}),fl(),HI(),vs(18,"mat-hint"),WC(19,"System prompt / instructions sent to the AI model"),fl()(),vs(20,"div",6),WC(21,"AI Configuration"),fl(),vs(22,"div",7)(23,"mat-form-field",8)(24,"mat-label"),WC(25,"AI Provider"),fl(),vs(26,"input",9),Jg("ngModelChange",function(r){return KC(n.aiProvider,r)||(n.aiProvider=r),r}),fl(),HI(),fl(),vs(27,"mat-form-field",8)(28,"mat-label"),WC(29,"Model Name"),fl(),vs(30,"input",10),Jg("ngModelChange",function(r){return KC(n.modelName,r)||(n.modelName=r),r}),fl(),HI(),fl()(),vs(31,"div",7)(32,"mat-form-field",8)(33,"mat-label"),WC(34,"Temperature"),fl(),vs(35,"input",11),Jg("ngModelChange",function(r){return KC(n.temperature,r)||(n.temperature=r),r}),fl(),HI(),vs(36,"mat-hint"),WC(37,"Leave empty for model default"),fl()(),vs(38,"mat-form-field",8)(39,"mat-label"),WC(40,"Max Output Tokens"),fl(),vs(41,"input",12),Jg("ngModelChange",function(r){return KC(n.maxOutputTokens,r)||(n.maxOutputTokens=r),r}),fl(),HI(),vs(42,"mat-hint"),WC(43,"Leave empty for model default"),fl()()(),vs(44,"mat-form-field",2)(45,"mat-label"),WC(46,"OpenAI Assistant ID"),fl(),vs(47,"input",13),Jg("ngModelChange",function(r){return KC(n.openaiAssistantId,r)||(n.openaiAssistantId=r),r}),fl(),HI(),vs(48,"mat-hint"),WC(49,"If set, forces aiProvider to openai"),fl()(),vs(50,"div",6)(51,"span"),WC(52,"Integrations"),fl(),vs(53,"button",14),Ag("click",function(){return n.addIntegrationRow()}),vs(54,"mat-icon"),WC(55,"add"),fl()()(),eC(56,ze,2,0,"p",15),oC(57,qe,12,2,"div",16,nC),eC(59,Je,14,5)(60,Qe,2,0,"p",15),eC(61,Xe,25,8),eC(62,Ye,7,5,"div",17),eC(63,$e,5,1,"div",18),fl()(),vs(64,"mat-dialog-actions",19)(65,"button",20),Ag("click",function(){return n.cancel()}),WC(66,"Cancel"),fl(),vs(67,"button",21),Ag("click",function(){return n.save()}),WC(68),fl()()),e&2&&(XE(),Zg(n.isEditMode?"Edit Agent":"Create Agent"),XE(6),Xg("ngModel",n.name),Tg("readonly",n.isEditMode),$I(),XE(6),Xg("ngModel",n.description),$I(),XE(4),Xg("ngModel",n.instructions),$I(),XE(9),Xg("ngModel",n.aiProvider),$I(),XE(4),Xg("ngModel",n.modelName),$I(),XE(5),Xg("ngModel",n.temperature),$I(),XE(6),Xg("ngModel",n.maxOutputTokens),$I(),XE(6),Xg("ngModel",n.openaiAssistantId),$I(),XE(9),tC(n.integrationRows.length===0?56:-1),XE(),iC(n.integrationRows),XE(2),tC(n.isEditMode?59:60),XE(2),tC(n.isEditMode?-1:61),XE(),tC(n.isEditMode?62:-1),XE(),tC(n.errorMessage?63:-1),XE(2),Tg("disabled",n.isSaving),XE(2),Tg("disabled",n.isSaving),XE(),yl(" ",n.isSaving?"Saving...":"Save"," "));},dependencies:[ti,Qn,ei,Ye$1,fn,mn,Zn,gt,$t,Wt,cn,zt,jt,Vt,Nt,hr,pr,Gn,Tn,Sn,nt$1,ae,le,ce,yt,wt,Pt,Xt],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:560px}@media(max-width:768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.section-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;font-size:1rem;font-weight:600;margin-top:.5rem;margin-bottom:-.25rem}.row-2col[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}@media(max-width:768px){.row-2col[_ngcontent-%COMP%]{grid-template-columns:1fr}}.integration-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.integration-row[_ngcontent-%COMP%] .integration-name[_ngcontent-%COMP%]{flex:0 0 180px}.integration-row[_ngcontent-%COMP%] .integration-tools[_ngcontent-%COMP%]{flex:1}.hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.5rem}@media(max-width:768px){.source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-family:monospace;line-height:1.4}.source-display[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500}.source-badge.badge-project[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-badge.badge-colocated[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.doc-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.doc-row[_ngcontent-%COMP%] .doc-field[_ngcontent-%COMP%]{flex:1}.upload-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;cursor:pointer;color:var(--color-text-secondary);transition:background .2s}.upload-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);color:var(--color-primary)}.upload-btn.uploading[_ngcontent-%COMP%]{opacity:.5;cursor:wait}.upload-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.doc-upload-error[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-error)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}"],changeDetection:1})};var et=()=>[],tt=s=>({id:s});function nt(s,t){if(s&1&&(vs(0,"div",5),WC(1),fl()),s&2){let e=mC();XE(),Zg(e.errorMessage());}}function it(s,t){if(s&1){let e=dC();vs(0,"ds-entity-card",7),Ag("selected",function(a){If(e);let r=mC();return wf(r.onEdit(a))}),gl(1,8),vs(2,"button",9),Ag("click",function(a){return a.stopPropagation()}),vs(3,"mat-icon"),WC(4,"more_vert"),fl()(),ml(),fl();}if(s&2){let e=t.$implicit;mC();let n=TC(9);Tg("id",e.id)("name",e.name)("description",e.description)("badges",e.badges??rT(6,et)),XE(2),Tg("matMenuTriggerFor",n)("matMenuTriggerData",oT(7,tt,e.id));}}function ot(s,t){if(s&1){let e=dC();vs(0,"button",10),Ag("click",function(){let a=If(e).id,r=mC();return wf(r.onEdit(a))}),vs(1,"mat-icon"),WC(2,"edit"),fl(),WC(3," Edit "),fl(),vs(4,"button",11),Ag("click",function(){let a=If(e).id,r=mC();return wf(r.onDelete(a))}),vs(5,"mat-icon"),WC(6,"delete"),fl(),WC(7," Delete "),fl();}}var Ve=class s{agentCrudApi=g(w);location=g(Sm);dialog=g(Re);agents=Hi([]);isLoading=Hi(false);errorMessage=Hi(null);agentItems=mT(()=>this.agents().map(t=>({id:t.name,name:t.name,description:t.description,badges:this.buildBadges(t),groupKey:t.source,groupLabel:t.source==="project"?"Project (~/.coday/)":"Colocated (next to coday.yaml)"})));ngOnInit(){this.loadAgents();}loadAgents(){this.isLoading.set(true),this.errorMessage.set(null),this.agentCrudApi.listEditableAgents().subscribe({next:t=>{this.agents.set(t),this.isLoading.set(false);},error:t=>{this.errorMessage.set(t?.error?.error??"Failed to load agents"),this.isLoading.set(false);}});}onBack(){this.location.back();}onCreate(){this.dialog.open(E,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadAgents();});}onEdit(t){this.agentCrudApi.getAgent(t).subscribe({next:e=>{this.dialog.open(E,{width:"700px",maxHeight:"90vh",data:{mode:"edit",agent:e}}).afterClosed().subscribe(a=>{a&&this.loadAgents();});},error:e=>this.errorMessage.set(e?.error?.error??"Failed to load agent")});}onDelete(t){confirm(`Are you sure you want to delete agent "${t}"?`)&&this.agentCrudApi.deleteAgent(t).subscribe({next:()=>this.loadAgents(),error:e=>this.errorMessage.set(e?.error?.error??"Failed to delete agent")});}buildBadges(t){return [t.source==="project"?{label:"project",variant:"info"}:{label:"colocated",variant:"success"}]}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=Aw({type:s,selectors:[["app-agent-list"]],decls:11,vars:5,consts:[["agentCard",""],["cardMenu","matMenu"],[1,"agent-list-page"],["title","Agents","cardMinWidth","260px","contentMaxWidth","1400px","searchPlaceholder","Filter agents\u2026","emptyMessage","No file-based agents found.",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","mat-icon-button","","title","Back",3,"click"],[1,"agent-list__error"],["matMenuContent",""],[3,"selected","id","name","description","badges"],["dsCardActions",""],["mat-icon-button","",3,"click","matMenuTriggerFor","matMenuTriggerData"],["mat-menu-item","",3,"click"],["mat-menu-item","",1,"agent-list__delete-item",3,"click"]],template:function(e,n){if(e&1&&(vs(0,"div",2)(1,"ds-entity-list",3),Ag("createRequested",function(){return n.onCreate()}),vs(2,"button",4),Ag("click",function(){return n.onBack()}),vs(3,"mat-icon"),WC(4,"chevron_left"),fl()()(),eC(5,nt,2,1,"div",5),fl(),Dg(6,it,5,9,"ng-template",null,0,fT),vs(8,"mat-menu",null,1),Dg(10,ot,8,0,"ng-template",6),fl()),e&2){let a=TC(7);XE(),Tg("items",n.agentItems())("loading",n.isLoading())("showCreate",true)("itemTemplate",a),XE(4),tC(n.errorMessage()?5:-1);}},dependencies:[Wn,ot$1,it$1,hr,Gn,yt,wt,In,De,Be,ya,En],styles:["[_nghost-%COMP%]{display:block;width:100%;min-height:100vh;background:var(--color-bg);overflow-y:auto}.agent-list__delete-item[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.agent-list__delete-item[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:inherit}.agent-list__error[_ngcontent-%COMP%]{margin:1rem auto;max-width:900px;padding:.75rem 1rem;background:#dc262614;border:1px solid rgba(220,38,38,.25);border-radius:8px;color:var(--color-error, #ff3b30);font-size:.875rem}"],changeDetection:1})};export{Ve as AgentListComponent};
@@ -1,4 +1,4 @@
1
- import {b as Qe}from'./chunk-Bd2CH26d.js';import {D as D$1,i as y}from'./chunk-DbP7sgsG.js';import {aL as Do,aM as qn,aO as wt,g as g$1,az as Qt,bs as Cl,aP as G,aS as K,aW as w,al as yt,aX as D,bx as on,by as am,aT as Ut,H as Hi,A as Aw,bz as Oi,aC as Cu,a_ as YT,bA as vC,v as vs,k as Ag,j as fl,o as bg,c9 as kf,ck as Ff,bB as DC,T as TC,r as Tg,X as XE,y as Hg,C as Cg,b5 as nT,bC as Ii,c8 as QT,c0 as Ng,b$ as FC,D as Fg,I as IC,E as wC}from'./main-SY6UM2GV.js';var W=["input"],Y=["label"],ee=["*"],f={color:"accent",clickAction:"check-indeterminate",disabledInteractive:false},ce=new w("mat-checkbox-default-options",{providedIn:"root",factory:()=>f}),a=(function(t){return t[t.Init=0]="Init",t[t.Checked=1]="Checked",t[t.Unchecked=2]="Unchecked",t[t.Indeterminate=3]="Indeterminate",t})(a||{}),g=class{source;checked},ne=(()=>{class t{_elementRef=g$1(Qt);_changeDetectorRef=g$1(Cl);_ngZone=g$1(G);_animationsDisabled=K();_options=g$1(ce,{optional:true});focus(){this._inputElement.nativeElement.focus();}_createChangeEvent(e){let n=new g;return n.source=this,n.checked=e,n}_getAnimationTargetElement(){return this._inputElement?.nativeElement}_animationClasses={uncheckedToChecked:"mdc-checkbox--anim-unchecked-checked",uncheckedToIndeterminate:"mdc-checkbox--anim-unchecked-indeterminate",checkedToUnchecked:"mdc-checkbox--anim-checked-unchecked",checkedToIndeterminate:"mdc-checkbox--anim-checked-indeterminate",indeterminateToChecked:"mdc-checkbox--anim-indeterminate-checked",indeterminateToUnchecked:"mdc-checkbox--anim-indeterminate-unchecked"};ariaLabel="";ariaLabelledby=null;ariaDescribedby;ariaExpanded;ariaControls;ariaOwns;_uniqueId;id;get inputId(){return `${this.id||this._uniqueId}-input`}required=false;labelPosition="after";name=null;change=new yt;indeterminateChange=new yt;value;disableRipple=false;_inputElement;_labelElement;tabIndex;color;disabledInteractive;_onTouched=()=>{};_currentAnimationClass="";_currentCheckState=a.Init;_controlValueAccessorChangeFn=()=>{};_validatorChangeFn=()=>{};constructor(){g$1(D).load(on);let e=g$1(new am("tabindex"),{optional:true});this._options=this._options||f,this.color=this._options.color||f.color,this.tabIndex=e==null?0:parseInt(e)||0,this.id=this._uniqueId=g$1(Ut).getId("mat-mdc-checkbox-"),this.disabledInteractive=this._options?.disabledInteractive??false;}ngOnChanges(e){e.required&&this._validatorChangeFn();}ngAfterViewInit(){this._syncIndeterminate(this.indeterminate);}get checked(){return this._checked}set checked(e){e!=this.checked&&(this._checked=e,this._changeDetectorRef.markForCheck());}_checked=false;get disabled(){return this._disabled}set disabled(e){e!==this.disabled&&(this._disabled=e,this._changeDetectorRef.markForCheck());}_disabled=false;get indeterminate(){return this._indeterminate()}set indeterminate(e){let n=e!=this._indeterminate();this._indeterminate.set(e),n&&(e?this._transitionCheckState(a.Indeterminate):this._transitionCheckState(this.checked?a.Checked:a.Unchecked),this.indeterminateChange.emit(e)),this._syncIndeterminate(e);}_indeterminate=Hi(false);_isRippleDisabled(){return this.disableRipple||this.disabled}_onLabelTextChange(){this._changeDetectorRef.detectChanges();}writeValue(e){this.checked=!!e;}registerOnChange(e){this._controlValueAccessorChangeFn=e;}registerOnTouched(e){this._onTouched=e;}setDisabledState(e){this.disabled=e;}validate(e){return this.required&&e.value!==true?{required:true}:null}registerOnValidatorChange(e){this._validatorChangeFn=e;}_transitionCheckState(e){let n=this._currentCheckState,c=this._getAnimationTargetElement();if(!(n===e||!c)&&(this._currentAnimationClass&&c.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(n,e),this._currentCheckState=e,this._currentAnimationClass.length>0)){c.classList.add(this._currentAnimationClass);let o=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{c.classList.remove(o);},1e3);});}}_emitChangeEvent(){this._controlValueAccessorChangeFn(this.checked),this.change.emit(this._createChangeEvent(this.checked)),this._inputElement&&(this._inputElement.nativeElement.checked=this.checked);}toggle(){this.checked=!this.checked,this._controlValueAccessorChangeFn(this.checked);}_handleInputClick(){let e=this._options?.clickAction;!this.disabled&&e!=="noop"?(this.indeterminate&&e!=="check"&&Promise.resolve().then(()=>{this._indeterminate.set(false),this.indeterminateChange.emit(false);}),this._checked=!this._checked,this._transitionCheckState(this._checked?a.Checked:a.Unchecked),this._emitChangeEvent()):(this.disabled&&this.disabledInteractive||!this.disabled&&e==="noop")&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate);}_onInteractionEvent(e){e.stopPropagation();}_onBlur(){Promise.resolve().then(()=>{this._onTouched(),this._changeDetectorRef.markForCheck();});}_getAnimationClassForCheckStateTransition(e,n){if(this._animationsDisabled)return "";switch(e){case a.Init:if(n===a.Checked)return this._animationClasses.uncheckedToChecked;if(n==a.Indeterminate)return this._checked?this._animationClasses.checkedToIndeterminate:this._animationClasses.uncheckedToIndeterminate;break;case a.Unchecked:return n===a.Checked?this._animationClasses.uncheckedToChecked:this._animationClasses.uncheckedToIndeterminate;case a.Checked:return n===a.Unchecked?this._animationClasses.checkedToUnchecked:this._animationClasses.checkedToIndeterminate;case a.Indeterminate:return n===a.Checked?this._animationClasses.indeterminateToChecked:this._animationClasses.indeterminateToUnchecked}return ""}_syncIndeterminate(e){let n=this._inputElement;n&&(n.nativeElement.indeterminate=e);}_onInputClick(){this._handleInputClick();}_onTouchTargetClick(){this._handleInputClick(),this.disabled||this._inputElement.nativeElement.focus();}_preventBubblingFromLabel(e){e.target&&this._labelElement.nativeElement.contains(e.target)&&e.stopPropagation();}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Aw({type:t,selectors:[["mat-checkbox"]],viewQuery:function(n,c){if(n&1&&Fg(W,5)(Y,5),n&2){let o;IC(o=wC())&&(c._inputElement=o.first),IC(o=wC())&&(c._labelElement=o.first);}},hostAttrs:[1,"mat-mdc-checkbox"],hostVars:16,hostBindings:function(n,c){n&2&&(Ng("id",c.id),Cg("tabindex",null)("aria-label",null)("aria-labelledby",null),FC(c.color?"mat-"+c.color:"mat-accent"),Hg("_mat-animation-noopable",c._animationsDisabled)("mdc-checkbox--disabled",c.disabled)("mat-mdc-checkbox-disabled",c.disabled)("mat-mdc-checkbox-checked",c.checked)("mat-mdc-checkbox-disabled-interactive",c.disabledInteractive));},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],ariaExpanded:[2,"aria-expanded","ariaExpanded",YT],ariaControls:[0,"aria-controls","ariaControls"],ariaOwns:[0,"aria-owns","ariaOwns"],id:"id",required:[2,"required","required",YT],labelPosition:"labelPosition",name:"name",value:"value",disableRipple:[2,"disableRipple","disableRipple",YT],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?void 0:QT(e)],color:"color",disabledInteractive:[2,"disabledInteractive","disabledInteractive",YT],checked:[2,"checked","checked",YT],disabled:[2,"disabled","disabled",YT],indeterminate:[2,"indeterminate","indeterminate",YT]},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[nT([{provide:D$1,useExisting:Ii(()=>t),multi:true},{provide:y,useExisting:t,multi:true}]),Cu],ngContentSelectors:ee,decls:15,vars:23,consts:[["checkbox",""],["input",""],["label",""],["mat-internal-form-field","",3,"click","labelPosition"],[1,"mdc-checkbox"],["aria-hidden","true",1,"mat-mdc-checkbox-touch-target",3,"click"],["type","checkbox",1,"mdc-checkbox__native-control",3,"blur","click","change","checked","indeterminate","disabled","id","required","tabIndex"],["aria-hidden","true",1,"mdc-checkbox__ripple"],["aria-hidden","true",1,"mdc-checkbox__background"],["focusable","false","viewBox","0 0 24 24",1,"mdc-checkbox__checkmark"],["fill","none","d","M1.73,12.91 8.1,19.28 22.79,4.59",1,"mdc-checkbox__checkmark-path"],[1,"mdc-checkbox__mixedmark"],["mat-ripple","","aria-hidden","true",1,"mat-mdc-checkbox-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-label",3,"for"]],template:function(n,c){if(n&1&&(vC(),vs(0,"div",3),Ag("click",function(k){return c._preventBubblingFromLabel(k)}),vs(1,"div",4,0)(3,"div",5),Ag("click",function(){return c._onTouchTargetClick()}),fl(),vs(4,"input",6,1),Ag("blur",function(){return c._onBlur()})("click",function(){return c._onInputClick()})("change",function(k){return c._onInteractionEvent(k)}),fl(),bg(6,"div",7),vs(7,"div",8),kf(),vs(8,"svg",9),bg(9,"path",10),fl(),Ff(),bg(10,"div",11),fl(),bg(11,"div",12),fl(),vs(12,"label",13,2),DC(14),fl()()),n&2){let o=TC(2);Tg("labelPosition",c.labelPosition),XE(4),Hg("mdc-checkbox--selected",c.checked),Tg("checked",c.checked)("indeterminate",c.indeterminate)("disabled",c.disabled&&!c.disabledInteractive)("id",c.inputId)("required",c.required)("tabIndex",c.disabled&&!c.disabledInteractive?-1:c.tabIndex),Cg("aria-label",c.ariaLabel||null)("aria-labelledby",c.ariaLabelledby)("aria-describedby",c.ariaDescribedby)("aria-checked",c.indeterminate?"mixed":null)("aria-controls",c.ariaControls)("aria-disabled",c.disabled&&c.disabledInteractive?true:null)("aria-expanded",c.ariaExpanded)("aria-owns",c.ariaOwns)("name",c.name)("value",c.value),XE(7),Tg("matRippleTrigger",o)("matRippleDisabled",c.disableRipple||c.disabled)("matRippleCentered",true),XE(),Tg("for",c.inputId);}},dependencies:[Oi,Qe],styles:[`.mdc-checkbox {
1
+ import {b as Qe}from'./chunk-CUmZcEGx.js';import {D as D$1,i as y}from'./chunk-CJdqLI4x.js';import {aL as Do,aM as qn,aO as wt,g as g$1,az as Qt,bs as Cl,aP as G,aS as K,aW as w,al as yt,aX as D,bx as on,by as am,aT as Ut,H as Hi,A as Aw,bz as Oi,aC as Cu,a_ as YT,bA as vC,v as vs,k as Ag,j as fl,o as bg,c9 as kf,ck as Ff,bB as DC,T as TC,r as Tg,X as XE,y as Hg,C as Cg,b5 as nT,bC as Ii,c8 as QT,c0 as Ng,b$ as FC,D as Fg,I as IC,E as wC}from'./main-MX6O2FH4.js';var W=["input"],Y=["label"],ee=["*"],f={color:"accent",clickAction:"check-indeterminate",disabledInteractive:false},ce=new w("mat-checkbox-default-options",{providedIn:"root",factory:()=>f}),a=(function(t){return t[t.Init=0]="Init",t[t.Checked=1]="Checked",t[t.Unchecked=2]="Unchecked",t[t.Indeterminate=3]="Indeterminate",t})(a||{}),g=class{source;checked},ne=(()=>{class t{_elementRef=g$1(Qt);_changeDetectorRef=g$1(Cl);_ngZone=g$1(G);_animationsDisabled=K();_options=g$1(ce,{optional:true});focus(){this._inputElement.nativeElement.focus();}_createChangeEvent(e){let n=new g;return n.source=this,n.checked=e,n}_getAnimationTargetElement(){return this._inputElement?.nativeElement}_animationClasses={uncheckedToChecked:"mdc-checkbox--anim-unchecked-checked",uncheckedToIndeterminate:"mdc-checkbox--anim-unchecked-indeterminate",checkedToUnchecked:"mdc-checkbox--anim-checked-unchecked",checkedToIndeterminate:"mdc-checkbox--anim-checked-indeterminate",indeterminateToChecked:"mdc-checkbox--anim-indeterminate-checked",indeterminateToUnchecked:"mdc-checkbox--anim-indeterminate-unchecked"};ariaLabel="";ariaLabelledby=null;ariaDescribedby;ariaExpanded;ariaControls;ariaOwns;_uniqueId;id;get inputId(){return `${this.id||this._uniqueId}-input`}required=false;labelPosition="after";name=null;change=new yt;indeterminateChange=new yt;value;disableRipple=false;_inputElement;_labelElement;tabIndex;color;disabledInteractive;_onTouched=()=>{};_currentAnimationClass="";_currentCheckState=a.Init;_controlValueAccessorChangeFn=()=>{};_validatorChangeFn=()=>{};constructor(){g$1(D).load(on);let e=g$1(new am("tabindex"),{optional:true});this._options=this._options||f,this.color=this._options.color||f.color,this.tabIndex=e==null?0:parseInt(e)||0,this.id=this._uniqueId=g$1(Ut).getId("mat-mdc-checkbox-"),this.disabledInteractive=this._options?.disabledInteractive??false;}ngOnChanges(e){e.required&&this._validatorChangeFn();}ngAfterViewInit(){this._syncIndeterminate(this.indeterminate);}get checked(){return this._checked}set checked(e){e!=this.checked&&(this._checked=e,this._changeDetectorRef.markForCheck());}_checked=false;get disabled(){return this._disabled}set disabled(e){e!==this.disabled&&(this._disabled=e,this._changeDetectorRef.markForCheck());}_disabled=false;get indeterminate(){return this._indeterminate()}set indeterminate(e){let n=e!=this._indeterminate();this._indeterminate.set(e),n&&(e?this._transitionCheckState(a.Indeterminate):this._transitionCheckState(this.checked?a.Checked:a.Unchecked),this.indeterminateChange.emit(e)),this._syncIndeterminate(e);}_indeterminate=Hi(false);_isRippleDisabled(){return this.disableRipple||this.disabled}_onLabelTextChange(){this._changeDetectorRef.detectChanges();}writeValue(e){this.checked=!!e;}registerOnChange(e){this._controlValueAccessorChangeFn=e;}registerOnTouched(e){this._onTouched=e;}setDisabledState(e){this.disabled=e;}validate(e){return this.required&&e.value!==true?{required:true}:null}registerOnValidatorChange(e){this._validatorChangeFn=e;}_transitionCheckState(e){let n=this._currentCheckState,c=this._getAnimationTargetElement();if(!(n===e||!c)&&(this._currentAnimationClass&&c.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(n,e),this._currentCheckState=e,this._currentAnimationClass.length>0)){c.classList.add(this._currentAnimationClass);let o=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{c.classList.remove(o);},1e3);});}}_emitChangeEvent(){this._controlValueAccessorChangeFn(this.checked),this.change.emit(this._createChangeEvent(this.checked)),this._inputElement&&(this._inputElement.nativeElement.checked=this.checked);}toggle(){this.checked=!this.checked,this._controlValueAccessorChangeFn(this.checked);}_handleInputClick(){let e=this._options?.clickAction;!this.disabled&&e!=="noop"?(this.indeterminate&&e!=="check"&&Promise.resolve().then(()=>{this._indeterminate.set(false),this.indeterminateChange.emit(false);}),this._checked=!this._checked,this._transitionCheckState(this._checked?a.Checked:a.Unchecked),this._emitChangeEvent()):(this.disabled&&this.disabledInteractive||!this.disabled&&e==="noop")&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate);}_onInteractionEvent(e){e.stopPropagation();}_onBlur(){Promise.resolve().then(()=>{this._onTouched(),this._changeDetectorRef.markForCheck();});}_getAnimationClassForCheckStateTransition(e,n){if(this._animationsDisabled)return "";switch(e){case a.Init:if(n===a.Checked)return this._animationClasses.uncheckedToChecked;if(n==a.Indeterminate)return this._checked?this._animationClasses.checkedToIndeterminate:this._animationClasses.uncheckedToIndeterminate;break;case a.Unchecked:return n===a.Checked?this._animationClasses.uncheckedToChecked:this._animationClasses.uncheckedToIndeterminate;case a.Checked:return n===a.Unchecked?this._animationClasses.checkedToUnchecked:this._animationClasses.checkedToIndeterminate;case a.Indeterminate:return n===a.Checked?this._animationClasses.indeterminateToChecked:this._animationClasses.indeterminateToUnchecked}return ""}_syncIndeterminate(e){let n=this._inputElement;n&&(n.nativeElement.indeterminate=e);}_onInputClick(){this._handleInputClick();}_onTouchTargetClick(){this._handleInputClick(),this.disabled||this._inputElement.nativeElement.focus();}_preventBubblingFromLabel(e){e.target&&this._labelElement.nativeElement.contains(e.target)&&e.stopPropagation();}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Aw({type:t,selectors:[["mat-checkbox"]],viewQuery:function(n,c){if(n&1&&Fg(W,5)(Y,5),n&2){let o;IC(o=wC())&&(c._inputElement=o.first),IC(o=wC())&&(c._labelElement=o.first);}},hostAttrs:[1,"mat-mdc-checkbox"],hostVars:16,hostBindings:function(n,c){n&2&&(Ng("id",c.id),Cg("tabindex",null)("aria-label",null)("aria-labelledby",null),FC(c.color?"mat-"+c.color:"mat-accent"),Hg("_mat-animation-noopable",c._animationsDisabled)("mdc-checkbox--disabled",c.disabled)("mat-mdc-checkbox-disabled",c.disabled)("mat-mdc-checkbox-checked",c.checked)("mat-mdc-checkbox-disabled-interactive",c.disabledInteractive));},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],ariaExpanded:[2,"aria-expanded","ariaExpanded",YT],ariaControls:[0,"aria-controls","ariaControls"],ariaOwns:[0,"aria-owns","ariaOwns"],id:"id",required:[2,"required","required",YT],labelPosition:"labelPosition",name:"name",value:"value",disableRipple:[2,"disableRipple","disableRipple",YT],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?void 0:QT(e)],color:"color",disabledInteractive:[2,"disabledInteractive","disabledInteractive",YT],checked:[2,"checked","checked",YT],disabled:[2,"disabled","disabled",YT],indeterminate:[2,"indeterminate","indeterminate",YT]},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[nT([{provide:D$1,useExisting:Ii(()=>t),multi:true},{provide:y,useExisting:t,multi:true}]),Cu],ngContentSelectors:ee,decls:15,vars:23,consts:[["checkbox",""],["input",""],["label",""],["mat-internal-form-field","",3,"click","labelPosition"],[1,"mdc-checkbox"],["aria-hidden","true",1,"mat-mdc-checkbox-touch-target",3,"click"],["type","checkbox",1,"mdc-checkbox__native-control",3,"blur","click","change","checked","indeterminate","disabled","id","required","tabIndex"],["aria-hidden","true",1,"mdc-checkbox__ripple"],["aria-hidden","true",1,"mdc-checkbox__background"],["focusable","false","viewBox","0 0 24 24",1,"mdc-checkbox__checkmark"],["fill","none","d","M1.73,12.91 8.1,19.28 22.79,4.59",1,"mdc-checkbox__checkmark-path"],[1,"mdc-checkbox__mixedmark"],["mat-ripple","","aria-hidden","true",1,"mat-mdc-checkbox-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-label",3,"for"]],template:function(n,c){if(n&1&&(vC(),vs(0,"div",3),Ag("click",function(k){return c._preventBubblingFromLabel(k)}),vs(1,"div",4,0)(3,"div",5),Ag("click",function(){return c._onTouchTargetClick()}),fl(),vs(4,"input",6,1),Ag("blur",function(){return c._onBlur()})("click",function(){return c._onInputClick()})("change",function(k){return c._onInteractionEvent(k)}),fl(),bg(6,"div",7),vs(7,"div",8),kf(),vs(8,"svg",9),bg(9,"path",10),fl(),Ff(),bg(10,"div",11),fl(),bg(11,"div",12),fl(),vs(12,"label",13,2),DC(14),fl()()),n&2){let o=TC(2);Tg("labelPosition",c.labelPosition),XE(4),Hg("mdc-checkbox--selected",c.checked),Tg("checked",c.checked)("indeterminate",c.indeterminate)("disabled",c.disabled&&!c.disabledInteractive)("id",c.inputId)("required",c.required)("tabIndex",c.disabled&&!c.disabledInteractive?-1:c.tabIndex),Cg("aria-label",c.ariaLabel||null)("aria-labelledby",c.ariaLabelledby)("aria-describedby",c.ariaDescribedby)("aria-checked",c.indeterminate?"mixed":null)("aria-controls",c.ariaControls)("aria-disabled",c.disabled&&c.disabledInteractive?true:null)("aria-expanded",c.ariaExpanded)("aria-owns",c.ariaOwns)("name",c.name)("value",c.value),XE(7),Tg("matRippleTrigger",o)("matRippleDisabled",c.disableRipple||c.disabled)("matRippleCentered",true),XE(),Tg("for",c.inputId);}},dependencies:[Oi,Qe],styles:[`.mdc-checkbox {
2
2
  display: inline-block;
3
3
  position: relative;
4
4
  flex: 0 0 18px;
@@ -0,0 +1 @@
1
+ import {bS as ma,a7 as ga,S as ha,cE as Rd}from'./main-MX6O2FH4.js';function i(t,o,p){return t.pipe(ma(()=>o().pipe(ga(()=>ha(p)))),Rd({bufferSize:1,refCount:true}))}export{i};