@whoz-oss/coday-client 3.21.0 → 3.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/browser/{chunk-cyIUrL9y.js → chunk-7dyrHGkF.js} +1 -1
  2. package/browser/{chunk-MecHdK4O.js → chunk-B0USjT_j.js} +1 -1
  3. package/browser/{chunk-CHP4jN9Z.js → chunk-B2FRxZw1.js} +1 -1
  4. package/browser/{chunk-Dipwr8Xn.js → chunk-B3Yorxwd.js} +1 -1
  5. package/browser/{chunk-BLF3w_iN.js → chunk-B3kY-GQk.js} +1 -1
  6. package/browser/{chunk-D1v8TfDX.js → chunk-B4K0ULQ8.js} +1 -1
  7. package/browser/{chunk-CNz7zaTq.js → chunk-BCqtwdIe.js} +1 -1
  8. package/browser/{chunk-NNu6xUAE.js → chunk-BIOQZPFJ.js} +1 -1
  9. package/browser/chunk-BQFfxCd3.js +1 -0
  10. package/browser/{chunk-GG036UVD.js → chunk-BQwFVWSb.js} +1 -1
  11. package/browser/chunk-BSc7HTHd.js +1 -0
  12. package/browser/{chunk-CxnQWVA-.js → chunk-BT7IPqmu.js} +1 -1
  13. package/browser/{chunk-NBeBKSWy.js → chunk-BXGcSbBl.js} +1 -1
  14. package/browser/{chunk-DsnIWrL1.js → chunk-BZCIYJOL.js} +1 -1
  15. package/browser/{chunk-DUCSH1q7.js → chunk-Bc0TgO1-.js} +1 -1
  16. package/browser/{chunk-BKBTovXz.js → chunk-BdZ0xOqX.js} +1 -1
  17. package/browser/{chunk-gaa6JiT9.js → chunk-BfzDf8xE.js} +1 -1
  18. package/browser/{chunk-CxXOCgTg.js → chunk-BoiQFZ4H.js} +1 -1
  19. package/browser/{chunk-D4w4_Vsw.js → chunk-BpzIo3TO.js} +1 -1
  20. package/browser/{chunk-C1X5uZwT.js → chunk-BqC6QWDU.js} +1 -1
  21. package/browser/{chunk-A12eXtlW.js → chunk-BrNRhqhm.js} +1 -1
  22. package/browser/chunk-BujvNLrF.js +1 -0
  23. package/browser/{chunk-CU4qkq0J.js → chunk-C3MIs5_Y.js} +1 -1
  24. package/browser/chunk-C4IJySYO.js +2 -0
  25. package/browser/{chunk-3KjG4Ivh.js → chunk-C9T7UBD_.js} +1 -1
  26. package/browser/{chunk-CtVgyQBm.js → chunk-CJD8ErVH.js} +1 -1
  27. package/browser/{chunk-Dwp6OoVJ.js → chunk-CMHnK5hV.js} +1 -1
  28. package/browser/{chunk-afcQqtlz.js → chunk-COoOJuQT.js} +1 -1
  29. package/browser/{chunk-I_PMkbKO.js → chunk-CRyr4oOy.js} +1 -1
  30. package/browser/{chunk-CPlR5wjp.js → chunk-CT4atmse.js} +1 -1
  31. package/browser/{chunk-C5Sn2M5w.js → chunk-CWQR6xJk.js} +1 -1
  32. package/browser/chunk-CXhfjTCk.js +1 -0
  33. package/browser/{chunk-DNRaKymp.js → chunk-CXwHeDac.js} +1 -1
  34. package/browser/{chunk-BCGN7Bq-.js → chunk-CZ4gj_xn.js} +1 -1
  35. package/browser/{chunk-CYOKxOkd.js → chunk-CaL6ZXsO.js} +1 -1
  36. package/browser/{chunk-KoKdufNA.js → chunk-Cg68_3Ns.js} +1 -1
  37. package/browser/chunk-ChsKwSBf.js +1 -0
  38. package/browser/chunk-CjgyOse7.js +1 -0
  39. package/browser/{chunk-DAxRjiEx.js → chunk-CqZF9JZo.js} +1 -1
  40. package/browser/{chunk-CJKwH7Qd.js → chunk-CuOGglmC.js} +1 -1
  41. package/browser/{chunk-DXd3i3QM.js → chunk-CyJ_au6Y.js} +1 -1
  42. package/browser/chunk-CzL7jU35.js +1 -0
  43. package/browser/{chunk-B8IQI7aT.js → chunk-D7p9n5a9.js} +1 -1
  44. package/browser/{chunk-Bg-7wA2s.js → chunk-D89TfP1E.js} +1 -1
  45. package/browser/{chunk-CUv3B-19.js → chunk-D8dXXVY5.js} +4 -4
  46. package/browser/{chunk-DeRNr5E2.js → chunk-D9wXETZp.js} +1 -1
  47. package/browser/{chunk-OuaG8E_K.js → chunk-DF3Ha0Tb.js} +1 -1
  48. package/browser/{chunk-Duk6Ikve.js → chunk-DH3pQb49.js} +1 -1
  49. package/browser/{chunk-dNACuqx8.js → chunk-DHr7_ikE.js} +1 -1
  50. package/browser/{chunk-D2fwi0Hc.js → chunk-DL11Jf1L.js} +1 -1
  51. package/browser/chunk-DNlBxwgK.js +1 -0
  52. package/browser/{chunk-DBUR_gpS.js → chunk-DVGYZ6ty.js} +1 -1
  53. package/browser/{chunk-kUdwsgzt.js → chunk-DdUOdkVr.js} +1 -1
  54. package/browser/{chunk-DmbNv5OX.js → chunk-DkP2MwMu.js} +1 -1
  55. package/browser/{chunk-CPOlQJvd.js → chunk-DqfAYcrx.js} +1 -1
  56. package/browser/{chunk-B1VIKLB-.js → chunk-DrKKLE1-.js} +1 -1
  57. package/browser/{chunk-DkqPRNv1.js → chunk-KccQKSLr.js} +1 -1
  58. package/browser/{chunk-B69a5iLl.js → chunk-O1I9EEmj.js} +1 -1
  59. package/browser/chunk-SsHAmybq.js +1 -0
  60. package/browser/{chunk-BNNLW7hd.js → chunk-VyuxzGHt.js} +1 -1
  61. package/browser/{chunk-C_OF_Yht.js → chunk-YGA4ansj.js} +1 -1
  62. package/browser/{chunk-DH88xB_s.js → chunk-bHVjhtHf.js} +1 -1
  63. package/browser/{chunk-DCkYfo8J.js → chunk-bl1pitLA.js} +1 -1
  64. package/browser/{chunk-CFD2_xIF.js → chunk-lkvHsW8k.js} +1 -1
  65. package/browser/{chunk-32YJp-72.js → chunk-oIPYJtHA.js} +1 -1
  66. package/browser/{chunk-Bf3fjpOn.js → chunk-oqOgDyIj.js} +1 -1
  67. package/browser/{chunk-BD91wN51.js → chunk-sz0CVF1-.js} +1 -1
  68. package/browser/{chunk-DqDzCK-6.js → chunk-uY_BCJ93.js} +1 -1
  69. package/browser/{chunk-DzcV-nhe.js → chunk-yfVcVvz_.js} +1 -1
  70. package/browser/index.html +4 -4
  71. package/browser/{main-P72KGKGP.js → main-RXIVNUWK.js} +15 -15
  72. package/package.json +1 -1
  73. package/browser/chunk-BIeOmcVm.js +0 -2
  74. package/browser/chunk-BRwhmCei.js +0 -1
  75. package/browser/chunk-BWJO7VDR.js +0 -1
  76. package/browser/chunk-BgdV8OdP.js +0 -1
  77. package/browser/chunk-C9ckXqnn.js +0 -1
  78. package/browser/chunk-C9nbDemu.js +0 -1
  79. package/browser/chunk-CThn4VXH.js +0 -1
  80. package/browser/chunk-CoPepxeH.js +0 -1
  81. package/browser/chunk-DJaf3eTF.js +0 -1
  82. package/browser/chunk-Dpnh8sS8.js +0 -1
@@ -1,4 +1,4 @@
1
- import {W as We$1,Q as Qt}from'./chunk-DAxRjiEx.js';import {_,b as _e,d as an,E as En}from'./chunk-BLF3w_iN.js';import {aL as wo,aM as Zn,cq as Se,aO as wt$1,g,az as Xt,bs as bl,bG as p,aT as Ut$1,aP as G,aW as C,cr as tV,T as TT,cs as rV,ct as vi,W as Wi,an as ue,aS as K,bt as Qn,cd as $f,bR as Sd,r as re,au as cv,ae as kt$1,ap as zy,bP as Jy,cu as sV,j as jw,ce as kb,bA as bC,af as wg,ag as ET,k as Cs,n as kg,o as aC,bB as SC,m as hl,t as sI,w as zg,u as cC,b5 as lT,cv as Vg,x as jg,cw as xC,y as MC,N as NC,cx as Bg,bv as Lg,aZ as Bs,aR as Ps,cy as si,cz as to,aC as bu,a_ as rb,c0 as Rg,S as Sg,bF as J,b6 as Ng,aw as gl,ax as ml,ac as CC,M as Mg,_ as _g,A as AC,cA as Mn,aX as D,cB as on,cC as R,cD as Te,J as JC,a8 as Kg,aF as R$1,cE as kd}from'./main-P72KGKGP.js';var oe=class{_box;_destroyed=new ue;_resizeSubject=new ue;_resizeObserver;_elementObservables=new Map;constructor(l){this._box=l,typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(e=>this._resizeSubject.next(e)));}observe(l){return this._elementObservables.has(l)||this._elementObservables.set(l,new R$1(e=>{let t=this._resizeSubject.subscribe(e);return this._resizeObserver?.observe(l,{box:this._box}),()=>{this._resizeObserver?.unobserve(l),t.unsubscribe(),this._elementObservables.delete(l);}}).pipe(kt$1(e=>e.some(t=>t.target===l)),kd({bufferSize:1,refCount:true}),zy(this._destroyed))),this._elementObservables.get(l)}destroy(){this._destroyed.next(),this._destroyed.complete(),this._resizeSubject.complete(),this._elementObservables.clear();}},qe=(()=>{class i{_cleanupErrorListener;_observers=new Map;_ngZone=g(G);constructor(){}ngOnDestroy(){for(let[,e]of this._observers)e.destroy();this._observers.clear(),this._cleanupErrorListener?.();}observe(e,t){let n=t?.box||"content-box";return this._observers.has(n)||this._observers.set(n,new oe(n)),this._observers.get(n).observe(e)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=Te({token:i,factory:i.\u0275fac})}return i})();var ut=["notch"],ht=["*"],Ue=["iconPrefixContainer"],We=["textPrefixContainer"],Ge=["iconSuffixContainer"],$e=["textSuffixContainer"],pt=["textField"],_t=["*",[["mat-label"]],[["","matPrefix",""],["","matIconPrefix",""]],[["","matTextPrefix",""]],[["","matTextSuffix",""]],[["","matSuffix",""],["","matIconSuffix",""]],[["mat-error"],["","matError",""]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],bt=["*","mat-label","[matPrefix], [matIconPrefix]","[matTextPrefix]","[matTextSuffix]","[matSuffix], [matIconSuffix]","mat-error, [matError]","mat-hint:not([align='end'])","mat-hint[align='end']"];function gt(i,l){i&1&&Mg(0,"span",21);}function vt(i,l){if(i&1&&(Cs(0,"label",20),SC(1,1),aC(2,gt,1,0,"span",21),hl()),i&2){let e=CC(2);_g("floating",e._shouldLabelFloat())("monitorResize",e._hasOutline())("id",e._labelId),Sg("for",e._control.disableAutomaticLabeling?null:e._control.id),sI(2),cC(!e.hideRequiredMarker&&e._control.required?2:-1);}}function xt(i,l){if(i&1&&aC(0,vt,3,5,"label",20),i&2){let e=CC();cC(e._hasFloatingLabel()?0:-1);}}function yt(i,l){i&1&&Mg(0,"div",7);}function Ft(i,l){}function Ct(i,l){if(i&1&&wg(0,Ft,0,0,"ng-template",13),i&2){CC(2);let e=AC(1);_g("ngTemplateOutlet",e);}}function wt(i,l){if(i&1&&(Cs(0,"div",9),aC(1,Ct,1,1,null,13),hl()),i&2){let e=CC();_g("matFormFieldNotchedOutlineOpen",e._shouldLabelFloat()),sI(),cC(e._forceDisplayInfixLabel()?-1:1);}}function Mt(i,l){i&1&&(Cs(0,"div",10,2),SC(2,2),hl());}function Et(i,l){i&1&&(Cs(0,"div",11,3),SC(2,3),hl());}function St(i,l){}function Tt(i,l){if(i&1&&wg(0,St,0,0,"ng-template",13),i&2){CC();let e=AC(1);_g("ngTemplateOutlet",e);}}function Rt(i,l){i&1&&(Cs(0,"div",14,4),SC(2,4),hl());}function Dt(i,l){i&1&&(Cs(0,"div",15,5),SC(2,5),hl());}function Nt(i,l){i&1&&Mg(0,"div",16);}function At(i,l){i&1&&(Cs(0,"div",18),SC(1,6),hl());}function It(i,l){if(i&1&&(Cs(0,"mat-hint",22),JC(1),hl()),i&2){let e=CC(2);_g("id",e._hintLabelId),sI(),Kg(e.hintLabel);}}function Lt(i,l){if(i&1&&(Cs(0,"div",19),aC(1,It,2,2,"mat-hint",22),SC(2,7),Mg(3,"div",23),SC(4,8),hl()),i&2){let e=CC();sI(),cC(e.hintLabel?1:-1);}}var ae=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275dir=Bs({type:i,selectors:[["mat-label"]]})}return i})(),kt=new C("MatError");var le=(()=>{class i{align="start";id=g(Ut$1).getId("mat-mdc-hint-");static \u0275fac=function(t){return new(t||i)};static \u0275dir=Bs({type:i,selectors:[["mat-hint"]],hostAttrs:[1,"mat-mdc-form-field-hint","mat-mdc-form-field-bottom-align"],hostVars:4,hostBindings:function(t,n){t&2&&(Rg("id",n.id),Sg("align",null),zg("mat-mdc-form-field-hint-end",n.align==="end"));},inputs:{align:"align",id:"id"}})}return i})(),et=new C("MatPrefix"),Ot=(()=>{class i{set _isTextSelector(e){this._isText=true;}_isText=false;static \u0275fac=function(t){return new(t||i)};static \u0275dir=Bs({type:i,selectors:[["","matPrefix",""],["","matIconPrefix",""],["","matTextPrefix",""]],inputs:{_isTextSelector:[0,"matTextPrefix","_isTextSelector"]},features:[lT([{provide:et,useExisting:i}])]})}return i})(),tt=new C("MatSuffix"),zt=(()=>{class i{set _isTextSelector(e){this._isText=true;}_isText=false;static \u0275fac=function(t){return new(t||i)};static \u0275dir=Bs({type:i,selectors:[["","matSuffix",""],["","matIconSuffix",""],["","matTextSuffix",""]],inputs:{_isTextSelector:[0,"matTextSuffix","_isTextSelector"]},features:[lT([{provide:tt,useExisting:i}])]})}return i})(),it=new C("FloatingLabelParent"),Ze=(()=>{class i{_elementRef=g(Xt);get floating(){return this._floating}set floating(e){this._floating=e,this.monitorResize&&this._handleResize();}_floating=false;get monitorResize(){return this._monitorResize}set monitorResize(e){this._monitorResize=e,this._monitorResize?this._subscribeToResize():this._resizeSubscription.unsubscribe();}_monitorResize=false;_resizeObserver=g(qe);_ngZone=g(G);_parent=g(it);_resizeSubscription=new J;ngOnDestroy(){this._resizeSubscription.unsubscribe();}getWidth(){return Pt(this._elementRef.nativeElement)}get element(){return this._elementRef.nativeElement}_handleResize(){setTimeout(()=>this._parent._handleLabelResized());}_subscribeToResize(){this._resizeSubscription.unsubscribe(),this._ngZone.runOutsideAngular(()=>{this._resizeSubscription=this._resizeObserver.observe(this._elementRef.nativeElement,{box:"border-box"}).subscribe(()=>this._handleResize());});}static \u0275fac=function(t){return new(t||i)};static \u0275dir=Bs({type:i,selectors:[["label","matFormFieldFloatingLabel",""]],hostAttrs:[1,"mdc-floating-label","mat-mdc-floating-label"],hostVars:2,hostBindings:function(t,n){t&2&&zg("mdc-floating-label--float-above",n.floating);},inputs:{floating:"floating",monitorResize:"monitorResize"}})}return i})();function Pt(i){let l=i;if(l.offsetParent!==null)return l.scrollWidth;let e=l.cloneNode(true);e.style.setProperty("position","absolute"),e.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(e);let t=e.scrollWidth;return e.remove(),t}var Qe="mdc-line-ripple--active",Z="mdc-line-ripple--deactivating",Xe=(()=>{class i{_elementRef=g(Xt);_cleanupTransitionEnd;constructor(){let e=g(G),t=g(Ps);e.runOutsideAngular(()=>{this._cleanupTransitionEnd=t.listen(this._elementRef.nativeElement,"transitionend",this._handleTransitionEnd);});}activate(){let e=this._elementRef.nativeElement.classList;e.remove(Z),e.add(Qe);}deactivate(){this._elementRef.nativeElement.classList.add(Z);}_handleTransitionEnd=e=>{let t=this._elementRef.nativeElement.classList,n=t.contains(Z);e.propertyName==="opacity"&&n&&t.remove(Qe,Z);};ngOnDestroy(){this._cleanupTransitionEnd();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=Bs({type:i,selectors:[["div","matFormFieldLineRipple",""]],hostAttrs:[1,"mdc-line-ripple"]})}return i})(),Ye=(()=>{class i{_elementRef=g(Xt);_ngZone=g(G);open=false;_notch;ngAfterViewInit(){let e=this._elementRef.nativeElement,t=e.querySelector(".mdc-floating-label");t?(e.classList.add("mdc-notched-outline--upgraded"),typeof requestAnimationFrame=="function"&&(t.style.transitionDuration="0s",this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>t.style.transitionDuration="");}))):e.classList.add("mdc-notched-outline--no-label");}_setNotchWidth(e){let t=this._notch.nativeElement;!this.open||!e?t.style.width="":t.style.width=`calc(${e}px * var(--mat-mdc-form-field-floating-label-scale, 0.75) + 9px)`;}_setMaxWidth(e){this._notch.nativeElement.style.setProperty("--mat-form-field-notch-max-width",`calc(100% - ${e}px)`);}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=jw({type:i,selectors:[["div","matFormFieldNotchedOutline",""]],viewQuery:function(t,n){if(t&1&&jg(ut,5),t&2){let r;MC(r=NC())&&(n._notch=r.first);}},hostAttrs:[1,"mdc-notched-outline"],hostVars:2,hostBindings:function(t,n){t&2&&zg("mdc-notched-outline--notched",n.open);},inputs:{open:[0,"matFormFieldNotchedOutlineOpen","open"]},ngContentSelectors:ht,decls:5,vars:0,consts:[["notch",""],[1,"mat-mdc-notch-piece","mdc-notched-outline__leading"],[1,"mat-mdc-notch-piece","mdc-notched-outline__notch"],[1,"mat-mdc-notch-piece","mdc-notched-outline__trailing"]],template:function(t,n){t&1&&(bC(),Ng(0,"div",1),gl(1,"div",2,0),SC(3),ml(),Ng(4,"div",3));},encapsulation:2})}return i})(),de=(()=>{class i{value=null;stateChanges;id;placeholder;ngControl=null;focused=false;empty=false;shouldLabelFloat=false;required=false;disabled=false;errorState=false;controlType;autofilled;userAriaDescribedBy;disableAutomaticLabeling;describedByIds;static \u0275fac=function(t){return new(t||i)};static \u0275dir=Bs({type:i})}return i})();var se=new C("MatFormField"),Bt=new C("MAT_FORM_FIELD_DEFAULT_OPTIONS"),Ke="fill",Vt="auto",Je="fixed",Ht="translateY(-50%)",nt=(()=>{class i{_elementRef=g(Xt);_changeDetectorRef=g(bl);_platform=g(p);_idGenerator=g(Ut$1);_ngZone=g(G);_defaults=g(Bt,{optional:true});_currentDirection;_textField;_iconPrefixContainer;_textPrefixContainer;_iconSuffixContainer;_textSuffixContainer;_floatingLabel;_notchedOutline;_lineRipple;_iconPrefixContainerSignal=tV("iconPrefixContainer");_textPrefixContainerSignal=tV("textPrefixContainer");_iconSuffixContainerSignal=tV("iconSuffixContainer");_textSuffixContainerSignal=tV("textSuffixContainer");_prefixSuffixContainers=TT(()=>[this._iconPrefixContainerSignal(),this._textPrefixContainerSignal(),this._iconSuffixContainerSignal(),this._textSuffixContainerSignal()].map(e=>e?.nativeElement).filter(e=>e!==void 0));_formFieldControl;_prefixChildren;_suffixChildren;_errorChildren;_hintChildren;_labelChild=rV(ae);get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(e){this._hideRequiredMarker=vi(e);}_hideRequiredMarker=false;color="primary";get floatLabel(){return this._floatLabel||this._defaults?.floatLabel||Vt}set floatLabel(e){e!==this._floatLabel&&(this._floatLabel=e,this._changeDetectorRef.markForCheck());}_floatLabel;get appearance(){return this._appearanceSignal()}set appearance(e){let t=e||this._defaults?.appearance||Ke;this._appearanceSignal.set(t);}_appearanceSignal=Wi(Ke);get subscriptSizing(){return this._subscriptSizing||this._defaults?.subscriptSizing||Je}set subscriptSizing(e){this._subscriptSizing=e||this._defaults?.subscriptSizing||Je;}_subscriptSizing=null;get hintLabel(){return this._hintLabel}set hintLabel(e){this._hintLabel=e,this._processHints();}_hintLabel="";_hasIconPrefix=false;_hasTextPrefix=false;_hasIconSuffix=false;_hasTextSuffix=false;_labelId=this._idGenerator.getId("mat-mdc-form-field-label-");_hintLabelId=this._idGenerator.getId("mat-mdc-hint-");_describedByIds;get _control(){return this._explicitFormFieldControl||this._formFieldControl}set _control(e){this._explicitFormFieldControl=e;}_destroyed=new ue;_isFocused=null;_explicitFormFieldControl;_previousControl=null;_previousControlValidatorFn=null;_stateChanges;_valueChanges;_describedByChanges;_outlineLabelOffsetResizeObserver=null;_animationsDisabled=K();constructor(){let e=this._defaults,t=g(Qn);e&&(e.appearance&&(this.appearance=e.appearance),this._hideRequiredMarker=!!e?.hideRequiredMarker,e.color&&(this.color=e.color)),$f(()=>this._currentDirection=t.valueSignal()),this._syncOutlineLabelOffset();}ngAfterViewInit(){this._updateFocusState(),this._animationsDisabled||this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-form-field-animations-enabled");},300);}),this._changeDetectorRef.detectChanges();}ngAfterContentInit(){this._assertFormFieldControl(),this._initializeSubscript(),this._initializePrefixAndSuffix();}ngAfterContentChecked(){this._assertFormFieldControl(),this._control!==this._previousControl&&(this._initializeControl(this._previousControl),this._control.ngControl&&this._control.ngControl.control&&(this._previousControlValidatorFn=this._control.ngControl.control.validator),this._previousControl=this._control),this._control.ngControl&&this._control.ngControl.control&&this._control.ngControl.control.validator!==this._previousControlValidatorFn&&this._changeDetectorRef.markForCheck();}ngOnDestroy(){this._outlineLabelOffsetResizeObserver?.disconnect(),this._stateChanges?.unsubscribe(),this._valueChanges?.unsubscribe(),this._describedByChanges?.unsubscribe(),this._destroyed.next(),this._destroyed.complete();}getLabelId=TT(()=>this._hasFloatingLabel()?this._labelId:null);getConnectedOverlayOrigin(){return this._textField||this._elementRef}_animateAndLockLabel(){this._hasFloatingLabel()&&(this.floatLabel="always");}_initializeControl(e){let t=this._control,n="mat-mdc-form-field-type-";e&&this._elementRef.nativeElement.classList.remove(n+e.controlType),t.controlType&&this._elementRef.nativeElement.classList.add(n+t.controlType),this._stateChanges?.unsubscribe(),this._stateChanges=t.stateChanges.subscribe(()=>{this._updateFocusState(),this._changeDetectorRef.markForCheck();}),this._describedByChanges?.unsubscribe(),this._describedByChanges=t.stateChanges.pipe(Sd([void 0,void 0]),re(()=>[t.errorState,t.userAriaDescribedBy]),cv(),kt$1(([[r,a],[s,C]])=>r!==s||a!==C)).subscribe(()=>this._syncDescribedByIds()),this._valueChanges?.unsubscribe(),t.ngControl&&t.ngControl.valueChanges&&(this._valueChanges=t.ngControl.valueChanges.pipe(zy(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()));}_checkPrefixAndSuffixTypes(){this._hasIconPrefix=!!this._prefixChildren.find(e=>!e._isText),this._hasTextPrefix=!!this._prefixChildren.find(e=>e._isText),this._hasIconSuffix=!!this._suffixChildren.find(e=>!e._isText),this._hasTextSuffix=!!this._suffixChildren.find(e=>e._isText);}_initializePrefixAndSuffix(){this._checkPrefixAndSuffixTypes(),Jy(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._checkPrefixAndSuffixTypes(),this._changeDetectorRef.markForCheck();});}_initializeSubscript(){this._hintChildren.changes.subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck();}),this._errorChildren.changes.subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck();}),this._validateHints(),this._syncDescribedByIds();}_assertFormFieldControl(){this._control;}_updateFocusState(){let e=this._control.focused;e&&!this._isFocused?(this._isFocused=true,this._lineRipple?.activate()):!e&&(this._isFocused||this._isFocused===null)&&(this._isFocused=false,this._lineRipple?.deactivate()),this._elementRef.nativeElement.classList.toggle("mat-focused",e),this._textField?.nativeElement.classList.toggle("mdc-text-field--focused",e);}_syncOutlineLabelOffset(){sV({earlyRead:()=>{if(this._appearanceSignal()!=="outline")return this._outlineLabelOffsetResizeObserver?.disconnect(),null;if(globalThis.ResizeObserver){this._outlineLabelOffsetResizeObserver||=new globalThis.ResizeObserver(()=>{this._writeOutlinedLabelStyles(this._getOutlinedLabelOffset());});for(let e of this._prefixSuffixContainers())this._outlineLabelOffsetResizeObserver.observe(e,{box:"border-box"});}return this._getOutlinedLabelOffset()},write:e=>this._writeOutlinedLabelStyles(e())});}_shouldAlwaysFloat(){return this.floatLabel==="always"}_hasOutline(){return this.appearance==="outline"}_forceDisplayInfixLabel(){return !this._platform.isBrowser&&this._prefixChildren.length&&!this._shouldLabelFloat()}_hasFloatingLabel=TT(()=>!!this._labelChild());_shouldLabelFloat(){return this._hasFloatingLabel()?this._control.shouldLabelFloat||this._shouldAlwaysFloat():false}_shouldForward(e){let t=this._control?this._control.ngControl:null;return t&&t[e]}_getSubscriptMessageType(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_handleLabelResized(){this._refreshOutlineNotchWidth();}_refreshOutlineNotchWidth(){!this._hasOutline()||!this._floatingLabel||!this._shouldLabelFloat()?this._notchedOutline?._setNotchWidth(0):this._notchedOutline?._setNotchWidth(this._floatingLabel.getWidth());}_processHints(){this._validateHints(),this._syncDescribedByIds();}_validateHints(){this._hintChildren;}_syncDescribedByIds(){if(this._control){let e=[];if(this._control.userAriaDescribedBy&&typeof this._control.userAriaDescribedBy=="string"&&e.push(...this._control.userAriaDescribedBy.split(" ")),this._getSubscriptMessageType()==="hint"){let r=this._hintChildren?this._hintChildren.find(s=>s.align==="start"):null,a=this._hintChildren?this._hintChildren.find(s=>s.align==="end"):null;r?e.push(r.id):this._hintLabel&&e.push(this._hintLabelId),a&&e.push(a.id);}else this._errorChildren&&e.push(...this._errorChildren.map(r=>r.id));let t=this._control.describedByIds,n;if(t){let r=this._describedByIds||e;n=e.concat(t.filter(a=>a&&!r.includes(a)));}else n=e;this._control.setDescribedByIds(n),this._describedByIds=e;}}_getOutlinedLabelOffset(){if(!this._hasOutline()||!this._floatingLabel)return null;if(!this._iconPrefixContainer&&!this._textPrefixContainer)return ["",null];if(!this._isAttachedToDom())return null;let e=this._iconPrefixContainer?.nativeElement,t=this._textPrefixContainer?.nativeElement,n=this._iconSuffixContainer?.nativeElement,r=this._textSuffixContainer?.nativeElement,a=e?.getBoundingClientRect().width??0,s=t?.getBoundingClientRect().width??0,C=n?.getBoundingClientRect().width??0,M=r?.getBoundingClientRect().width??0,dt=this._currentDirection==="rtl"?"-1":"1",st=`${a+s}px`,ct=`calc(${dt} * (${st} + var(--mat-mdc-form-field-label-offset-x, 0px)))`,ft=`var(--mat-mdc-form-field-label-transform, ${Ht} translateX(${ct}))`,mt=a+s+C+M;return [ft,mt]}_writeOutlinedLabelStyles(e){if(e!==null){let[t,n]=e;this._floatingLabel&&(this._floatingLabel.element.style.transform=t),n!==null&&this._notchedOutline?._setMaxWidth(n);}}_isAttachedToDom(){let e=this._elementRef.nativeElement;if(e.getRootNode){let t=e.getRootNode();return t&&t!==e}return document.documentElement.contains(e)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=jw({type:i,selectors:[["mat-form-field"]],contentQueries:function(t,n,r){if(t&1&&(Bg(r,n._labelChild,ae,5),Lg(r,de,5)(r,et,5)(r,tt,5)(r,kt,5)(r,le,5)),t&2){xC();let a;MC(a=NC())&&(n._formFieldControl=a.first),MC(a=NC())&&(n._prefixChildren=a),MC(a=NC())&&(n._suffixChildren=a),MC(a=NC())&&(n._errorChildren=a),MC(a=NC())&&(n._hintChildren=a);}},viewQuery:function(t,n){if(t&1&&(Vg(n._iconPrefixContainerSignal,Ue,5)(n._textPrefixContainerSignal,We,5)(n._iconSuffixContainerSignal,Ge,5)(n._textSuffixContainerSignal,$e,5),jg(pt,5)(Ue,5)(We,5)(Ge,5)($e,5)(Ze,5)(Ye,5)(Xe,5)),t&2){xC(4);let r;MC(r=NC())&&(n._textField=r.first),MC(r=NC())&&(n._iconPrefixContainer=r.first),MC(r=NC())&&(n._textPrefixContainer=r.first),MC(r=NC())&&(n._iconSuffixContainer=r.first),MC(r=NC())&&(n._textSuffixContainer=r.first),MC(r=NC())&&(n._floatingLabel=r.first),MC(r=NC())&&(n._notchedOutline=r.first),MC(r=NC())&&(n._lineRipple=r.first);}},hostAttrs:[1,"mat-mdc-form-field"],hostVars:38,hostBindings:function(t,n){t&2&&zg("mat-mdc-form-field-label-always-float",n._shouldAlwaysFloat())("mat-mdc-form-field-has-icon-prefix",n._hasIconPrefix)("mat-mdc-form-field-has-icon-suffix",n._hasIconSuffix)("mat-form-field-invalid",n._control.errorState)("mat-form-field-disabled",n._control.disabled)("mat-form-field-autofilled",n._control.autofilled)("mat-form-field-appearance-fill",n.appearance=="fill")("mat-form-field-appearance-outline",n.appearance=="outline")("mat-form-field-hide-placeholder",n._hasFloatingLabel()&&!n._shouldLabelFloat())("mat-primary",n.color!=="accent"&&n.color!=="warn")("mat-accent",n.color==="accent")("mat-warn",n.color==="warn")("ng-untouched",n._shouldForward("untouched"))("ng-touched",n._shouldForward("touched"))("ng-pristine",n._shouldForward("pristine"))("ng-dirty",n._shouldForward("dirty"))("ng-valid",n._shouldForward("valid"))("ng-invalid",n._shouldForward("invalid"))("ng-pending",n._shouldForward("pending"));},inputs:{hideRequiredMarker:"hideRequiredMarker",color:"color",floatLabel:"floatLabel",appearance:"appearance",subscriptSizing:"subscriptSizing",hintLabel:"hintLabel"},exportAs:["matFormField"],features:[lT([{provide:se,useExisting:i},{provide:it,useExisting:i}])],ngContentSelectors:bt,decls:18,vars:21,consts:[["labelTemplate",""],["textField",""],["iconPrefixContainer",""],["textPrefixContainer",""],["textSuffixContainer",""],["iconSuffixContainer",""],[1,"mat-mdc-text-field-wrapper","mdc-text-field",3,"click"],[1,"mat-mdc-form-field-focus-overlay"],[1,"mat-mdc-form-field-flex"],["matFormFieldNotchedOutline","",3,"matFormFieldNotchedOutlineOpen"],[1,"mat-mdc-form-field-icon-prefix"],[1,"mat-mdc-form-field-text-prefix"],[1,"mat-mdc-form-field-infix"],[3,"ngTemplateOutlet"],[1,"mat-mdc-form-field-text-suffix"],[1,"mat-mdc-form-field-icon-suffix"],["matFormFieldLineRipple",""],["aria-atomic","true","aria-live","polite",1,"mat-mdc-form-field-subscript-wrapper","mat-mdc-form-field-bottom-align"],[1,"mat-mdc-form-field-error-wrapper"],[1,"mat-mdc-form-field-hint-wrapper"],["matFormFieldFloatingLabel","",3,"floating","monitorResize","id"],["aria-hidden","true",1,"mat-mdc-form-field-required-marker","mdc-floating-label--required"],[3,"id"],[1,"mat-mdc-form-field-hint-spacer"]],template:function(t,n){if(t&1&&(bC(_t),wg(0,xt,1,1,"ng-template",null,0,ET),Cs(2,"div",6,1),kg("click",function(a){return n._control.onContainerClick(a)}),aC(4,yt,1,0,"div",7),Cs(5,"div",8),aC(6,wt,2,2,"div",9),aC(7,Mt,3,0,"div",10),aC(8,Et,3,0,"div",11),Cs(9,"div",12),aC(10,Tt,1,1,null,13),SC(11),hl(),aC(12,Rt,3,0,"div",14),aC(13,Dt,3,0,"div",15),hl(),aC(14,Nt,1,0,"div",16),hl(),Cs(15,"div",17),aC(16,At,2,0,"div",18)(17,Lt,5,1,"div",19),hl()),t&2){let r;sI(2),zg("mdc-text-field--filled",!n._hasOutline())("mdc-text-field--outlined",n._hasOutline())("mdc-text-field--no-label",!n._hasFloatingLabel())("mdc-text-field--disabled",n._control.disabled)("mdc-text-field--invalid",n._control.errorState),sI(2),cC(!n._hasOutline()&&!n._control.disabled?4:-1),sI(2),cC(n._hasOutline()?6:-1),sI(),cC(n._hasIconPrefix?7:-1),sI(),cC(n._hasTextPrefix?8:-1),sI(2),cC(!n._hasOutline()||n._forceDisplayInfixLabel()?10:-1),sI(2),cC(n._hasTextSuffix?12:-1),sI(),cC(n._hasIconSuffix?13:-1),sI(),cC(n._hasOutline()?-1:14),sI(),zg("mat-mdc-form-field-subscript-dynamic-size",n.subscriptSizing==="dynamic");let a=n._getSubscriptMessageType();sI(),cC((r=a)==="error"?16:r==="hint"?17:-1);}},dependencies:[Ze,Ye,kb,Xe,le],styles:[`.mdc-text-field {
1
+ import {W as We$1,Q as Qt}from'./chunk-CqZF9JZo.js';import {_,b as _e,d as an,E as En}from'./chunk-B3kY-GQk.js';import {aL as wo,aM as Zn,cq as Se,aO as wt$1,g,az as Xt,bs as bl,bG as p,aT as Ut$1,aP as G,aW as C,cr as tV,T as TT,cs as rV,ct as vi,W as Wi,an as ue,aS as K,bt as Qn,cd as $f,bR as Sd,r as re,au as cv,ae as kt$1,ap as zy,bP as Jy,cu as sV,j as jw,ce as kb,bA as bC,af as wg,ag as ET,k as Cs,n as kg,o as aC,bB as SC,m as hl,t as sI,w as zg,u as cC,b5 as lT,cv as Vg,x as jg,cw as xC,y as MC,N as NC,cx as Bg,bv as Lg,aZ as Bs,aR as Ps,cy as si,cz as to,aC as bu,a_ as rb,c0 as Rg,S as Sg,bF as J,b6 as Ng,aw as gl,ax as ml,ac as CC,M as Mg,_ as _g,A as AC,cA as Mn,aX as D,cB as on,cC as R,cD as Te,J as JC,a8 as Kg,aF as R$1,cE as kd}from'./main-RXIVNUWK.js';var oe=class{_box;_destroyed=new ue;_resizeSubject=new ue;_resizeObserver;_elementObservables=new Map;constructor(l){this._box=l,typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(e=>this._resizeSubject.next(e)));}observe(l){return this._elementObservables.has(l)||this._elementObservables.set(l,new R$1(e=>{let t=this._resizeSubject.subscribe(e);return this._resizeObserver?.observe(l,{box:this._box}),()=>{this._resizeObserver?.unobserve(l),t.unsubscribe(),this._elementObservables.delete(l);}}).pipe(kt$1(e=>e.some(t=>t.target===l)),kd({bufferSize:1,refCount:true}),zy(this._destroyed))),this._elementObservables.get(l)}destroy(){this._destroyed.next(),this._destroyed.complete(),this._resizeSubject.complete(),this._elementObservables.clear();}},qe=(()=>{class i{_cleanupErrorListener;_observers=new Map;_ngZone=g(G);constructor(){}ngOnDestroy(){for(let[,e]of this._observers)e.destroy();this._observers.clear(),this._cleanupErrorListener?.();}observe(e,t){let n=t?.box||"content-box";return this._observers.has(n)||this._observers.set(n,new oe(n)),this._observers.get(n).observe(e)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=Te({token:i,factory:i.\u0275fac})}return i})();var ut=["notch"],ht=["*"],Ue=["iconPrefixContainer"],We=["textPrefixContainer"],Ge=["iconSuffixContainer"],$e=["textSuffixContainer"],pt=["textField"],_t=["*",[["mat-label"]],[["","matPrefix",""],["","matIconPrefix",""]],[["","matTextPrefix",""]],[["","matTextSuffix",""]],[["","matSuffix",""],["","matIconSuffix",""]],[["mat-error"],["","matError",""]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],bt=["*","mat-label","[matPrefix], [matIconPrefix]","[matTextPrefix]","[matTextSuffix]","[matSuffix], [matIconSuffix]","mat-error, [matError]","mat-hint:not([align='end'])","mat-hint[align='end']"];function gt(i,l){i&1&&Mg(0,"span",21);}function vt(i,l){if(i&1&&(Cs(0,"label",20),SC(1,1),aC(2,gt,1,0,"span",21),hl()),i&2){let e=CC(2);_g("floating",e._shouldLabelFloat())("monitorResize",e._hasOutline())("id",e._labelId),Sg("for",e._control.disableAutomaticLabeling?null:e._control.id),sI(2),cC(!e.hideRequiredMarker&&e._control.required?2:-1);}}function xt(i,l){if(i&1&&aC(0,vt,3,5,"label",20),i&2){let e=CC();cC(e._hasFloatingLabel()?0:-1);}}function yt(i,l){i&1&&Mg(0,"div",7);}function Ft(i,l){}function Ct(i,l){if(i&1&&wg(0,Ft,0,0,"ng-template",13),i&2){CC(2);let e=AC(1);_g("ngTemplateOutlet",e);}}function wt(i,l){if(i&1&&(Cs(0,"div",9),aC(1,Ct,1,1,null,13),hl()),i&2){let e=CC();_g("matFormFieldNotchedOutlineOpen",e._shouldLabelFloat()),sI(),cC(e._forceDisplayInfixLabel()?-1:1);}}function Mt(i,l){i&1&&(Cs(0,"div",10,2),SC(2,2),hl());}function Et(i,l){i&1&&(Cs(0,"div",11,3),SC(2,3),hl());}function St(i,l){}function Tt(i,l){if(i&1&&wg(0,St,0,0,"ng-template",13),i&2){CC();let e=AC(1);_g("ngTemplateOutlet",e);}}function Rt(i,l){i&1&&(Cs(0,"div",14,4),SC(2,4),hl());}function Dt(i,l){i&1&&(Cs(0,"div",15,5),SC(2,5),hl());}function Nt(i,l){i&1&&Mg(0,"div",16);}function At(i,l){i&1&&(Cs(0,"div",18),SC(1,6),hl());}function It(i,l){if(i&1&&(Cs(0,"mat-hint",22),JC(1),hl()),i&2){let e=CC(2);_g("id",e._hintLabelId),sI(),Kg(e.hintLabel);}}function Lt(i,l){if(i&1&&(Cs(0,"div",19),aC(1,It,2,2,"mat-hint",22),SC(2,7),Mg(3,"div",23),SC(4,8),hl()),i&2){let e=CC();sI(),cC(e.hintLabel?1:-1);}}var ae=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275dir=Bs({type:i,selectors:[["mat-label"]]})}return i})(),kt=new C("MatError");var le=(()=>{class i{align="start";id=g(Ut$1).getId("mat-mdc-hint-");static \u0275fac=function(t){return new(t||i)};static \u0275dir=Bs({type:i,selectors:[["mat-hint"]],hostAttrs:[1,"mat-mdc-form-field-hint","mat-mdc-form-field-bottom-align"],hostVars:4,hostBindings:function(t,n){t&2&&(Rg("id",n.id),Sg("align",null),zg("mat-mdc-form-field-hint-end",n.align==="end"));},inputs:{align:"align",id:"id"}})}return i})(),et=new C("MatPrefix"),Ot=(()=>{class i{set _isTextSelector(e){this._isText=true;}_isText=false;static \u0275fac=function(t){return new(t||i)};static \u0275dir=Bs({type:i,selectors:[["","matPrefix",""],["","matIconPrefix",""],["","matTextPrefix",""]],inputs:{_isTextSelector:[0,"matTextPrefix","_isTextSelector"]},features:[lT([{provide:et,useExisting:i}])]})}return i})(),tt=new C("MatSuffix"),zt=(()=>{class i{set _isTextSelector(e){this._isText=true;}_isText=false;static \u0275fac=function(t){return new(t||i)};static \u0275dir=Bs({type:i,selectors:[["","matSuffix",""],["","matIconSuffix",""],["","matTextSuffix",""]],inputs:{_isTextSelector:[0,"matTextSuffix","_isTextSelector"]},features:[lT([{provide:tt,useExisting:i}])]})}return i})(),it=new C("FloatingLabelParent"),Ze=(()=>{class i{_elementRef=g(Xt);get floating(){return this._floating}set floating(e){this._floating=e,this.monitorResize&&this._handleResize();}_floating=false;get monitorResize(){return this._monitorResize}set monitorResize(e){this._monitorResize=e,this._monitorResize?this._subscribeToResize():this._resizeSubscription.unsubscribe();}_monitorResize=false;_resizeObserver=g(qe);_ngZone=g(G);_parent=g(it);_resizeSubscription=new J;ngOnDestroy(){this._resizeSubscription.unsubscribe();}getWidth(){return Pt(this._elementRef.nativeElement)}get element(){return this._elementRef.nativeElement}_handleResize(){setTimeout(()=>this._parent._handleLabelResized());}_subscribeToResize(){this._resizeSubscription.unsubscribe(),this._ngZone.runOutsideAngular(()=>{this._resizeSubscription=this._resizeObserver.observe(this._elementRef.nativeElement,{box:"border-box"}).subscribe(()=>this._handleResize());});}static \u0275fac=function(t){return new(t||i)};static \u0275dir=Bs({type:i,selectors:[["label","matFormFieldFloatingLabel",""]],hostAttrs:[1,"mdc-floating-label","mat-mdc-floating-label"],hostVars:2,hostBindings:function(t,n){t&2&&zg("mdc-floating-label--float-above",n.floating);},inputs:{floating:"floating",monitorResize:"monitorResize"}})}return i})();function Pt(i){let l=i;if(l.offsetParent!==null)return l.scrollWidth;let e=l.cloneNode(true);e.style.setProperty("position","absolute"),e.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(e);let t=e.scrollWidth;return e.remove(),t}var Qe="mdc-line-ripple--active",Z="mdc-line-ripple--deactivating",Xe=(()=>{class i{_elementRef=g(Xt);_cleanupTransitionEnd;constructor(){let e=g(G),t=g(Ps);e.runOutsideAngular(()=>{this._cleanupTransitionEnd=t.listen(this._elementRef.nativeElement,"transitionend",this._handleTransitionEnd);});}activate(){let e=this._elementRef.nativeElement.classList;e.remove(Z),e.add(Qe);}deactivate(){this._elementRef.nativeElement.classList.add(Z);}_handleTransitionEnd=e=>{let t=this._elementRef.nativeElement.classList,n=t.contains(Z);e.propertyName==="opacity"&&n&&t.remove(Qe,Z);};ngOnDestroy(){this._cleanupTransitionEnd();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=Bs({type:i,selectors:[["div","matFormFieldLineRipple",""]],hostAttrs:[1,"mdc-line-ripple"]})}return i})(),Ye=(()=>{class i{_elementRef=g(Xt);_ngZone=g(G);open=false;_notch;ngAfterViewInit(){let e=this._elementRef.nativeElement,t=e.querySelector(".mdc-floating-label");t?(e.classList.add("mdc-notched-outline--upgraded"),typeof requestAnimationFrame=="function"&&(t.style.transitionDuration="0s",this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>t.style.transitionDuration="");}))):e.classList.add("mdc-notched-outline--no-label");}_setNotchWidth(e){let t=this._notch.nativeElement;!this.open||!e?t.style.width="":t.style.width=`calc(${e}px * var(--mat-mdc-form-field-floating-label-scale, 0.75) + 9px)`;}_setMaxWidth(e){this._notch.nativeElement.style.setProperty("--mat-form-field-notch-max-width",`calc(100% - ${e}px)`);}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=jw({type:i,selectors:[["div","matFormFieldNotchedOutline",""]],viewQuery:function(t,n){if(t&1&&jg(ut,5),t&2){let r;MC(r=NC())&&(n._notch=r.first);}},hostAttrs:[1,"mdc-notched-outline"],hostVars:2,hostBindings:function(t,n){t&2&&zg("mdc-notched-outline--notched",n.open);},inputs:{open:[0,"matFormFieldNotchedOutlineOpen","open"]},ngContentSelectors:ht,decls:5,vars:0,consts:[["notch",""],[1,"mat-mdc-notch-piece","mdc-notched-outline__leading"],[1,"mat-mdc-notch-piece","mdc-notched-outline__notch"],[1,"mat-mdc-notch-piece","mdc-notched-outline__trailing"]],template:function(t,n){t&1&&(bC(),Ng(0,"div",1),gl(1,"div",2,0),SC(3),ml(),Ng(4,"div",3));},encapsulation:2})}return i})(),de=(()=>{class i{value=null;stateChanges;id;placeholder;ngControl=null;focused=false;empty=false;shouldLabelFloat=false;required=false;disabled=false;errorState=false;controlType;autofilled;userAriaDescribedBy;disableAutomaticLabeling;describedByIds;static \u0275fac=function(t){return new(t||i)};static \u0275dir=Bs({type:i})}return i})();var se=new C("MatFormField"),Bt=new C("MAT_FORM_FIELD_DEFAULT_OPTIONS"),Ke="fill",Vt="auto",Je="fixed",Ht="translateY(-50%)",nt=(()=>{class i{_elementRef=g(Xt);_changeDetectorRef=g(bl);_platform=g(p);_idGenerator=g(Ut$1);_ngZone=g(G);_defaults=g(Bt,{optional:true});_currentDirection;_textField;_iconPrefixContainer;_textPrefixContainer;_iconSuffixContainer;_textSuffixContainer;_floatingLabel;_notchedOutline;_lineRipple;_iconPrefixContainerSignal=tV("iconPrefixContainer");_textPrefixContainerSignal=tV("textPrefixContainer");_iconSuffixContainerSignal=tV("iconSuffixContainer");_textSuffixContainerSignal=tV("textSuffixContainer");_prefixSuffixContainers=TT(()=>[this._iconPrefixContainerSignal(),this._textPrefixContainerSignal(),this._iconSuffixContainerSignal(),this._textSuffixContainerSignal()].map(e=>e?.nativeElement).filter(e=>e!==void 0));_formFieldControl;_prefixChildren;_suffixChildren;_errorChildren;_hintChildren;_labelChild=rV(ae);get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(e){this._hideRequiredMarker=vi(e);}_hideRequiredMarker=false;color="primary";get floatLabel(){return this._floatLabel||this._defaults?.floatLabel||Vt}set floatLabel(e){e!==this._floatLabel&&(this._floatLabel=e,this._changeDetectorRef.markForCheck());}_floatLabel;get appearance(){return this._appearanceSignal()}set appearance(e){let t=e||this._defaults?.appearance||Ke;this._appearanceSignal.set(t);}_appearanceSignal=Wi(Ke);get subscriptSizing(){return this._subscriptSizing||this._defaults?.subscriptSizing||Je}set subscriptSizing(e){this._subscriptSizing=e||this._defaults?.subscriptSizing||Je;}_subscriptSizing=null;get hintLabel(){return this._hintLabel}set hintLabel(e){this._hintLabel=e,this._processHints();}_hintLabel="";_hasIconPrefix=false;_hasTextPrefix=false;_hasIconSuffix=false;_hasTextSuffix=false;_labelId=this._idGenerator.getId("mat-mdc-form-field-label-");_hintLabelId=this._idGenerator.getId("mat-mdc-hint-");_describedByIds;get _control(){return this._explicitFormFieldControl||this._formFieldControl}set _control(e){this._explicitFormFieldControl=e;}_destroyed=new ue;_isFocused=null;_explicitFormFieldControl;_previousControl=null;_previousControlValidatorFn=null;_stateChanges;_valueChanges;_describedByChanges;_outlineLabelOffsetResizeObserver=null;_animationsDisabled=K();constructor(){let e=this._defaults,t=g(Qn);e&&(e.appearance&&(this.appearance=e.appearance),this._hideRequiredMarker=!!e?.hideRequiredMarker,e.color&&(this.color=e.color)),$f(()=>this._currentDirection=t.valueSignal()),this._syncOutlineLabelOffset();}ngAfterViewInit(){this._updateFocusState(),this._animationsDisabled||this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-form-field-animations-enabled");},300);}),this._changeDetectorRef.detectChanges();}ngAfterContentInit(){this._assertFormFieldControl(),this._initializeSubscript(),this._initializePrefixAndSuffix();}ngAfterContentChecked(){this._assertFormFieldControl(),this._control!==this._previousControl&&(this._initializeControl(this._previousControl),this._control.ngControl&&this._control.ngControl.control&&(this._previousControlValidatorFn=this._control.ngControl.control.validator),this._previousControl=this._control),this._control.ngControl&&this._control.ngControl.control&&this._control.ngControl.control.validator!==this._previousControlValidatorFn&&this._changeDetectorRef.markForCheck();}ngOnDestroy(){this._outlineLabelOffsetResizeObserver?.disconnect(),this._stateChanges?.unsubscribe(),this._valueChanges?.unsubscribe(),this._describedByChanges?.unsubscribe(),this._destroyed.next(),this._destroyed.complete();}getLabelId=TT(()=>this._hasFloatingLabel()?this._labelId:null);getConnectedOverlayOrigin(){return this._textField||this._elementRef}_animateAndLockLabel(){this._hasFloatingLabel()&&(this.floatLabel="always");}_initializeControl(e){let t=this._control,n="mat-mdc-form-field-type-";e&&this._elementRef.nativeElement.classList.remove(n+e.controlType),t.controlType&&this._elementRef.nativeElement.classList.add(n+t.controlType),this._stateChanges?.unsubscribe(),this._stateChanges=t.stateChanges.subscribe(()=>{this._updateFocusState(),this._changeDetectorRef.markForCheck();}),this._describedByChanges?.unsubscribe(),this._describedByChanges=t.stateChanges.pipe(Sd([void 0,void 0]),re(()=>[t.errorState,t.userAriaDescribedBy]),cv(),kt$1(([[r,a],[s,C]])=>r!==s||a!==C)).subscribe(()=>this._syncDescribedByIds()),this._valueChanges?.unsubscribe(),t.ngControl&&t.ngControl.valueChanges&&(this._valueChanges=t.ngControl.valueChanges.pipe(zy(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()));}_checkPrefixAndSuffixTypes(){this._hasIconPrefix=!!this._prefixChildren.find(e=>!e._isText),this._hasTextPrefix=!!this._prefixChildren.find(e=>e._isText),this._hasIconSuffix=!!this._suffixChildren.find(e=>!e._isText),this._hasTextSuffix=!!this._suffixChildren.find(e=>e._isText);}_initializePrefixAndSuffix(){this._checkPrefixAndSuffixTypes(),Jy(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._checkPrefixAndSuffixTypes(),this._changeDetectorRef.markForCheck();});}_initializeSubscript(){this._hintChildren.changes.subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck();}),this._errorChildren.changes.subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck();}),this._validateHints(),this._syncDescribedByIds();}_assertFormFieldControl(){this._control;}_updateFocusState(){let e=this._control.focused;e&&!this._isFocused?(this._isFocused=true,this._lineRipple?.activate()):!e&&(this._isFocused||this._isFocused===null)&&(this._isFocused=false,this._lineRipple?.deactivate()),this._elementRef.nativeElement.classList.toggle("mat-focused",e),this._textField?.nativeElement.classList.toggle("mdc-text-field--focused",e);}_syncOutlineLabelOffset(){sV({earlyRead:()=>{if(this._appearanceSignal()!=="outline")return this._outlineLabelOffsetResizeObserver?.disconnect(),null;if(globalThis.ResizeObserver){this._outlineLabelOffsetResizeObserver||=new globalThis.ResizeObserver(()=>{this._writeOutlinedLabelStyles(this._getOutlinedLabelOffset());});for(let e of this._prefixSuffixContainers())this._outlineLabelOffsetResizeObserver.observe(e,{box:"border-box"});}return this._getOutlinedLabelOffset()},write:e=>this._writeOutlinedLabelStyles(e())});}_shouldAlwaysFloat(){return this.floatLabel==="always"}_hasOutline(){return this.appearance==="outline"}_forceDisplayInfixLabel(){return !this._platform.isBrowser&&this._prefixChildren.length&&!this._shouldLabelFloat()}_hasFloatingLabel=TT(()=>!!this._labelChild());_shouldLabelFloat(){return this._hasFloatingLabel()?this._control.shouldLabelFloat||this._shouldAlwaysFloat():false}_shouldForward(e){let t=this._control?this._control.ngControl:null;return t&&t[e]}_getSubscriptMessageType(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_handleLabelResized(){this._refreshOutlineNotchWidth();}_refreshOutlineNotchWidth(){!this._hasOutline()||!this._floatingLabel||!this._shouldLabelFloat()?this._notchedOutline?._setNotchWidth(0):this._notchedOutline?._setNotchWidth(this._floatingLabel.getWidth());}_processHints(){this._validateHints(),this._syncDescribedByIds();}_validateHints(){this._hintChildren;}_syncDescribedByIds(){if(this._control){let e=[];if(this._control.userAriaDescribedBy&&typeof this._control.userAriaDescribedBy=="string"&&e.push(...this._control.userAriaDescribedBy.split(" ")),this._getSubscriptMessageType()==="hint"){let r=this._hintChildren?this._hintChildren.find(s=>s.align==="start"):null,a=this._hintChildren?this._hintChildren.find(s=>s.align==="end"):null;r?e.push(r.id):this._hintLabel&&e.push(this._hintLabelId),a&&e.push(a.id);}else this._errorChildren&&e.push(...this._errorChildren.map(r=>r.id));let t=this._control.describedByIds,n;if(t){let r=this._describedByIds||e;n=e.concat(t.filter(a=>a&&!r.includes(a)));}else n=e;this._control.setDescribedByIds(n),this._describedByIds=e;}}_getOutlinedLabelOffset(){if(!this._hasOutline()||!this._floatingLabel)return null;if(!this._iconPrefixContainer&&!this._textPrefixContainer)return ["",null];if(!this._isAttachedToDom())return null;let e=this._iconPrefixContainer?.nativeElement,t=this._textPrefixContainer?.nativeElement,n=this._iconSuffixContainer?.nativeElement,r=this._textSuffixContainer?.nativeElement,a=e?.getBoundingClientRect().width??0,s=t?.getBoundingClientRect().width??0,C=n?.getBoundingClientRect().width??0,M=r?.getBoundingClientRect().width??0,dt=this._currentDirection==="rtl"?"-1":"1",st=`${a+s}px`,ct=`calc(${dt} * (${st} + var(--mat-mdc-form-field-label-offset-x, 0px)))`,ft=`var(--mat-mdc-form-field-label-transform, ${Ht} translateX(${ct}))`,mt=a+s+C+M;return [ft,mt]}_writeOutlinedLabelStyles(e){if(e!==null){let[t,n]=e;this._floatingLabel&&(this._floatingLabel.element.style.transform=t),n!==null&&this._notchedOutline?._setMaxWidth(n);}}_isAttachedToDom(){let e=this._elementRef.nativeElement;if(e.getRootNode){let t=e.getRootNode();return t&&t!==e}return document.documentElement.contains(e)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=jw({type:i,selectors:[["mat-form-field"]],contentQueries:function(t,n,r){if(t&1&&(Bg(r,n._labelChild,ae,5),Lg(r,de,5)(r,et,5)(r,tt,5)(r,kt,5)(r,le,5)),t&2){xC();let a;MC(a=NC())&&(n._formFieldControl=a.first),MC(a=NC())&&(n._prefixChildren=a),MC(a=NC())&&(n._suffixChildren=a),MC(a=NC())&&(n._errorChildren=a),MC(a=NC())&&(n._hintChildren=a);}},viewQuery:function(t,n){if(t&1&&(Vg(n._iconPrefixContainerSignal,Ue,5)(n._textPrefixContainerSignal,We,5)(n._iconSuffixContainerSignal,Ge,5)(n._textSuffixContainerSignal,$e,5),jg(pt,5)(Ue,5)(We,5)(Ge,5)($e,5)(Ze,5)(Ye,5)(Xe,5)),t&2){xC(4);let r;MC(r=NC())&&(n._textField=r.first),MC(r=NC())&&(n._iconPrefixContainer=r.first),MC(r=NC())&&(n._textPrefixContainer=r.first),MC(r=NC())&&(n._iconSuffixContainer=r.first),MC(r=NC())&&(n._textSuffixContainer=r.first),MC(r=NC())&&(n._floatingLabel=r.first),MC(r=NC())&&(n._notchedOutline=r.first),MC(r=NC())&&(n._lineRipple=r.first);}},hostAttrs:[1,"mat-mdc-form-field"],hostVars:38,hostBindings:function(t,n){t&2&&zg("mat-mdc-form-field-label-always-float",n._shouldAlwaysFloat())("mat-mdc-form-field-has-icon-prefix",n._hasIconPrefix)("mat-mdc-form-field-has-icon-suffix",n._hasIconSuffix)("mat-form-field-invalid",n._control.errorState)("mat-form-field-disabled",n._control.disabled)("mat-form-field-autofilled",n._control.autofilled)("mat-form-field-appearance-fill",n.appearance=="fill")("mat-form-field-appearance-outline",n.appearance=="outline")("mat-form-field-hide-placeholder",n._hasFloatingLabel()&&!n._shouldLabelFloat())("mat-primary",n.color!=="accent"&&n.color!=="warn")("mat-accent",n.color==="accent")("mat-warn",n.color==="warn")("ng-untouched",n._shouldForward("untouched"))("ng-touched",n._shouldForward("touched"))("ng-pristine",n._shouldForward("pristine"))("ng-dirty",n._shouldForward("dirty"))("ng-valid",n._shouldForward("valid"))("ng-invalid",n._shouldForward("invalid"))("ng-pending",n._shouldForward("pending"));},inputs:{hideRequiredMarker:"hideRequiredMarker",color:"color",floatLabel:"floatLabel",appearance:"appearance",subscriptSizing:"subscriptSizing",hintLabel:"hintLabel"},exportAs:["matFormField"],features:[lT([{provide:se,useExisting:i},{provide:it,useExisting:i}])],ngContentSelectors:bt,decls:18,vars:21,consts:[["labelTemplate",""],["textField",""],["iconPrefixContainer",""],["textPrefixContainer",""],["textSuffixContainer",""],["iconSuffixContainer",""],[1,"mat-mdc-text-field-wrapper","mdc-text-field",3,"click"],[1,"mat-mdc-form-field-focus-overlay"],[1,"mat-mdc-form-field-flex"],["matFormFieldNotchedOutline","",3,"matFormFieldNotchedOutlineOpen"],[1,"mat-mdc-form-field-icon-prefix"],[1,"mat-mdc-form-field-text-prefix"],[1,"mat-mdc-form-field-infix"],[3,"ngTemplateOutlet"],[1,"mat-mdc-form-field-text-suffix"],[1,"mat-mdc-form-field-icon-suffix"],["matFormFieldLineRipple",""],["aria-atomic","true","aria-live","polite",1,"mat-mdc-form-field-subscript-wrapper","mat-mdc-form-field-bottom-align"],[1,"mat-mdc-form-field-error-wrapper"],[1,"mat-mdc-form-field-hint-wrapper"],["matFormFieldFloatingLabel","",3,"floating","monitorResize","id"],["aria-hidden","true",1,"mat-mdc-form-field-required-marker","mdc-floating-label--required"],[3,"id"],[1,"mat-mdc-form-field-hint-spacer"]],template:function(t,n){if(t&1&&(bC(_t),wg(0,xt,1,1,"ng-template",null,0,ET),Cs(2,"div",6,1),kg("click",function(a){return n._control.onContainerClick(a)}),aC(4,yt,1,0,"div",7),Cs(5,"div",8),aC(6,wt,2,2,"div",9),aC(7,Mt,3,0,"div",10),aC(8,Et,3,0,"div",11),Cs(9,"div",12),aC(10,Tt,1,1,null,13),SC(11),hl(),aC(12,Rt,3,0,"div",14),aC(13,Dt,3,0,"div",15),hl(),aC(14,Nt,1,0,"div",16),hl(),Cs(15,"div",17),aC(16,At,2,0,"div",18)(17,Lt,5,1,"div",19),hl()),t&2){let r;sI(2),zg("mdc-text-field--filled",!n._hasOutline())("mdc-text-field--outlined",n._hasOutline())("mdc-text-field--no-label",!n._hasFloatingLabel())("mdc-text-field--disabled",n._control.disabled)("mdc-text-field--invalid",n._control.errorState),sI(2),cC(!n._hasOutline()&&!n._control.disabled?4:-1),sI(2),cC(n._hasOutline()?6:-1),sI(),cC(n._hasIconPrefix?7:-1),sI(),cC(n._hasTextPrefix?8:-1),sI(2),cC(!n._hasOutline()||n._forceDisplayInfixLabel()?10:-1),sI(2),cC(n._hasTextSuffix?12:-1),sI(),cC(n._hasIconSuffix?13:-1),sI(),cC(n._hasOutline()?-1:14),sI(),zg("mat-mdc-form-field-subscript-dynamic-size",n.subscriptSizing==="dynamic");let a=n._getSubscriptMessageType();sI(),cC((r=a)==="error"?16:r==="hint"?17:-1);}},dependencies:[Ze,Ye,kb,Xe,le],styles:[`.mdc-text-field {
2
2
  display: inline-flex;
3
3
  align-items: baseline;
4
4
  padding: 0 16px;
@@ -0,0 +1 @@
1
+ import {S as S$1}from'./chunk-CuOGglmC.js';import {g,G,C as Ce,df as U,aJ as Tr,W as Wi,bS as Da,r as re,b as U$1,j as jw,aK as Lb,k as Cs,bf as gT,n as kg,m as hl,af as wg,A as AC,_ as _g,bg as yT,ah as dT,o as aC,ac as CC,u as cC,a9 as vC,aa as Cf,ab as Tf,ag as ET}from'./main-RXIVNUWK.js';import {W as Wn,S as Se}from'./chunk-CaL6ZXsO.js';import'./chunk-CqZF9JZo.js';import'./chunk-B3kY-GQk.js';var S=()=>[];function V(r,e){if(r&1){let t=vC();Cs(0,"agentos-ai-provider-item",4),kg("editRequested",function(i){Cf(t);let p=CC(2);return Tf(p.onEdit(i))})("deleteRequested",function(i){Cf(t);let p=CC(2);return Tf(p.onDelete(i))}),hl();}r&2&&_g("config",e)("showBadge",false);}function F(r,e){if(r&1&&aC(0,V,1,2,"agentos-ai-provider-item",3),r&2){let t,o=e.$implicit,i=CC();cC((t=i.resolveProvider(o.id))?0:-1,t);}}var E=class r{router=g(G);destroyRef=g(Ce);aiProviderController=g(U);refresh$=new Tr(void 0);isLoading=Wi(true);providers$=this.refresh$.pipe(Da(()=>(this.isLoading.set(true),this.aiProviderController.listAiProvider("none"))));providerItems$=this.providers$.pipe(re(e=>e.map(t=>({id:t.id??"",name:t.name,description:t.apiType}))));providersById=new Map;constructor(){this.providers$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.providersById=new Map(e.map(t=>[t.id??"",t])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","ai-providers","new"]);}onEdit(e){e.id&&this.router.navigate(["/agentos","admin","ai-providers",e.id,"edit"]);}onDelete(e){e.id&&this.aiProviderController.deleteAiProvider(e.id).pipe(U$1(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolveProvider(e){return this.providersById.get(e)??null}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=jw({type:r,selectors:[["agentos-platform-ai-providers"]],decls:5,vars:7,consts:[["aiProviderItemTpl",""],["title","Platform AI Providers","emptyMessage","No platform AI providers defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],["scope","namespace",3,"config","showBadge"],["scope","namespace",3,"editRequested","deleteRequested","config","showBadge"]],template:function(t,o){if(t&1&&(Cs(0,"ds-entity-list",1),gT(1,"async"),kg("createRequested",function(){return o.openCreateForm()}),Cs(2,"ds-icon-button",2),kg("action",function(){return o.goBack()}),hl()(),wg(3,F,1,1,"ng-template",null,0,ET)),t&2){let i=AC(4);_g("items",yT(1,4,o.providerItems$)??dT(6,S))("loading",o.isLoading())("showCreate",true)("itemTemplate",i);}},dependencies:[Wn,S$1,Se,Lb],styles:[".platform-ai-providers__back[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;font-family:inherit;font-size:.875rem;color:var(--color-text-secondary, #6e6e73);padding:.25rem .5rem;border-radius:4px;transition:color .15s ease}.platform-ai-providers__back[_ngcontent-%COMP%]:hover{color:var(--color-primary, #007aff)}"]})};export{E as PlatformAiProvidersComponent};
@@ -1 +1 @@
1
- import {I}from'./chunk-dNACuqx8.js';import {m}from'./chunk-CUv3B-19.js';import {g,ao as V$1,G as G$1,C as Ce,aJ as Tr,W as Wi,bS as Da,$ as $y,a7 as va,I as br,r as re,b as U$1,j as jw,aK as Lb,k as Cs,bf as gT,n as kg,J as JC,m as hl,af as wg,A as AC,_ as _g,bg as yT,ah as dT,o as aC,ac as CC,u as cC,a9 as vC,aa as Cf,ab as Tf,ag as ET}from'./main-P72KGKGP.js';import {W as Wn}from'./chunk-CYOKxOkd.js';import'./chunk-DAxRjiEx.js';import'./chunk-BLF3w_iN.js';import'./chunk-C_OF_Yht.js';var U=()=>[];function V(r,t){if(r&1){let o=vC();Cs(0,"agentos-prompt-item",4),kg("deleteRequested",function(n){Cf(o);let F=CC(2);return Tf(F.deletePrompt(n))}),hl();}if(r&2){let o=CC().$implicit,e=CC();_g("prompt",t)("namespaceId",e.namespaceId)("readOnly",e.isPlatformPrompt(o.id));}}function j(r,t){if(r&1&&aC(0,V,1,3,"agentos-prompt-item",3),r&2){let o,e=t.$implicit,n=CC();cC((o=n.resolvePrompt(e.id))?0:-1,o);}}var G="platform",K="namespace",A=class r{route=g(V$1);router=g(G$1);destroyRef=g(Ce);promptState=g(m);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=Wi(true);allPrompts$=this.refresh$.pipe(Da(()=>(this.isLoading.set(true),$y({platform:this.promptState.listPlatform().pipe(va(()=>br([]))),namespace:this.promptState.listByNamespace(this.namespaceId)}))));promptItems$=this.allPrompts$.pipe(re(({platform:t,namespace:o})=>[...t.map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:G,groupLabel:"Platform (read-only)"})),...o.map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:K,groupLabel:"Namespace"}))]));namespacePromptsById=new Map;platformPromptsById=new Map;constructor(){this.allPrompts$.pipe(U$1(this.destroyRef)).subscribe({next:({platform:t,namespace:o})=>{this.platformPromptsById=new Map(t.map(e=>[e.id??"",e])),this.namespacePromptsById=new Map(o.map(e=>[e.id??"",e])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"prompts","new"]);}deletePrompt(t){this.promptState.delete(t.id??"").pipe(U$1(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolvePrompt(t){return this.platformPromptsById.get(t)??this.namespacePromptsById.get(t)??null}isPlatformPrompt(t){return this.platformPromptsById.has(t)}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=jw({type:r,selectors:[["agentos-namespace-prompts"]],decls:6,vars:7,consts:[["promptItemTpl",""],["title","Prompts","emptyMessage","No prompts defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","type","button",1,"namespace-prompts__back",3,"click"],[3,"prompt","namespaceId","readOnly"],[3,"deleteRequested","prompt","namespaceId","readOnly"]],template:function(o,e){if(o&1&&(Cs(0,"ds-entity-list",1),gT(1,"async"),kg("createRequested",function(){return e.openCreateForm()}),Cs(2,"button",2),kg("click",function(){return e.goBack()}),JC(3,"\u2190 Namespaces"),hl()(),wg(4,j,1,1,"ng-template",null,0,ET)),o&2){let n=AC(5);_g("items",yT(1,4,e.promptItems$)??dT(6,U))("loading",e.isLoading())("showCreate",true)("itemTemplate",n);}},dependencies:[Wn,I,Lb],styles:[".namespace-prompts__back[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.namespace-prompts__back[_ngcontent-%COMP%]:hover{text-decoration:underline}"]})};export{A as NamespacePromptsComponent};
1
+ import {I}from'./chunk-DHr7_ikE.js';import {m}from'./chunk-D8dXXVY5.js';import {g,ao as V$1,G as G$1,C as Ce,aJ as Tr,W as Wi,bS as Da,$ as $y,a7 as va,I as br,r as re,b as U$1,j as jw,aK as Lb,k as Cs,bf as gT,n as kg,J as JC,m as hl,af as wg,A as AC,_ as _g,bg as yT,ah as dT,o as aC,ac as CC,u as cC,a9 as vC,aa as Cf,ab as Tf,ag as ET}from'./main-RXIVNUWK.js';import {W as Wn}from'./chunk-CaL6ZXsO.js';import'./chunk-CqZF9JZo.js';import'./chunk-B3kY-GQk.js';import'./chunk-YGA4ansj.js';var U=()=>[];function V(r,t){if(r&1){let o=vC();Cs(0,"agentos-prompt-item",4),kg("deleteRequested",function(n){Cf(o);let F=CC(2);return Tf(F.deletePrompt(n))}),hl();}if(r&2){let o=CC().$implicit,e=CC();_g("prompt",t)("namespaceId",e.namespaceId)("readOnly",e.isPlatformPrompt(o.id));}}function j(r,t){if(r&1&&aC(0,V,1,3,"agentos-prompt-item",3),r&2){let o,e=t.$implicit,n=CC();cC((o=n.resolvePrompt(e.id))?0:-1,o);}}var G="platform",K="namespace",A=class r{route=g(V$1);router=g(G$1);destroyRef=g(Ce);promptState=g(m);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=Wi(true);allPrompts$=this.refresh$.pipe(Da(()=>(this.isLoading.set(true),$y({platform:this.promptState.listPlatform().pipe(va(()=>br([]))),namespace:this.promptState.listByNamespace(this.namespaceId)}))));promptItems$=this.allPrompts$.pipe(re(({platform:t,namespace:o})=>[...t.map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:G,groupLabel:"Platform (read-only)"})),...o.map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:K,groupLabel:"Namespace"}))]));namespacePromptsById=new Map;platformPromptsById=new Map;constructor(){this.allPrompts$.pipe(U$1(this.destroyRef)).subscribe({next:({platform:t,namespace:o})=>{this.platformPromptsById=new Map(t.map(e=>[e.id??"",e])),this.namespacePromptsById=new Map(o.map(e=>[e.id??"",e])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"prompts","new"]);}deletePrompt(t){this.promptState.delete(t.id??"").pipe(U$1(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolvePrompt(t){return this.platformPromptsById.get(t)??this.namespacePromptsById.get(t)??null}isPlatformPrompt(t){return this.platformPromptsById.has(t)}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=jw({type:r,selectors:[["agentos-namespace-prompts"]],decls:6,vars:7,consts:[["promptItemTpl",""],["title","Prompts","emptyMessage","No prompts defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","type","button",1,"namespace-prompts__back",3,"click"],[3,"prompt","namespaceId","readOnly"],[3,"deleteRequested","prompt","namespaceId","readOnly"]],template:function(o,e){if(o&1&&(Cs(0,"ds-entity-list",1),gT(1,"async"),kg("createRequested",function(){return e.openCreateForm()}),Cs(2,"button",2),kg("click",function(){return e.goBack()}),JC(3,"\u2190 Namespaces"),hl()(),wg(4,j,1,1,"ng-template",null,0,ET)),o&2){let n=AC(5);_g("items",yT(1,4,e.promptItems$)??dT(6,U))("loading",e.isLoading())("showCreate",true)("itemTemplate",n);}},dependencies:[Wn,I,Lb],styles:[".namespace-prompts__back[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.namespace-prompts__back[_ngcontent-%COMP%]:hover{text-decoration:underline}"]})};export{A as NamespacePromptsComponent};
@@ -0,0 +1 @@
1
+ import {O}from'./chunk-DF3Ha0Tb.js';import {N as N$1}from'./chunk-7dyrHGkF.js';import {g,G,C as Ce,d9 as F$1,aJ as Tr,W as Wi,bS as Da,r as re,b as U,j as jw,aK as Lb,k as Cs,bf as gT,n as kg,m as hl,af as wg,A as AC,_ as _g,bg as yT,ah as dT,o as aC,ac as CC,u as cC,a9 as vC,aa as Cf,ab as Tf,ag as ET}from'./main-RXIVNUWK.js';import'./chunk-D8dXXVY5.js';import {W as Wn,S as Se}from'./chunk-CaL6ZXsO.js';import'./chunk-CqZF9JZo.js';import'./chunk-B3kY-GQk.js';import'./chunk-CzL7jU35.js';import'./chunk-YGA4ansj.js';var F=()=>[];function N(i,t){if(i&1){let e=vC();Cs(0,"agentos-integration-config-item",4),kg("editRequested",function(n){Cf(e);let f=CC(2);return Tf(f.onEdit(n))})("deleteRequested",function(n){Cf(e);let f=CC(2);return Tf(f.deleteConfig(n))}),hl();}i&2&&_g("config",t);}function j(i,t){if(i&1&&aC(0,N,1,1,"agentos-integration-config-item",3),i&2){let e,o=t.$implicit,n=CC();cC((e=n.resolveConfig(o.id))?0:-1,e);}}var V=class i{router=g(G);destroyRef=g(Ce);state=g(N$1);integrationConfigController=g(F$1);refresh$=new Tr(void 0);isLoading=Wi(true);configs$=this.refresh$.pipe(Da(()=>(this.isLoading.set(true),this.state.loadPlatformConfigs())));configItems$=this.configs$.pipe(re(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.integrationType}))));configsById=new Map;constructor(){this.configs$.pipe(U(this.destroyRef)).subscribe({next:t=>{this.configsById=new Map(t.map(e=>[e.id??"",e])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","integration-configs","new"]);}deleteConfig(t){this.integrationConfigController.deleteIntegrationConfig(t.id??"").pipe(U(this.destroyRef)).subscribe(()=>this.refresh$.next());}onEdit(t){this.router.navigate(["/agentos","admin","integration-configs",t.id??"","edit"]);}resolveConfig(t){return this.configsById.get(t)??null}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=jw({type:i,selectors:[["agentos-platform-integration-configs"]],decls:5,vars:7,consts:[["integrationConfigItemTpl",""],["title","Platform Integration Configs","emptyMessage","No platform integration configs defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],["scope","platform",3,"config"],["scope","platform",3,"editRequested","deleteRequested","config"]],template:function(e,o){if(e&1&&(Cs(0,"ds-entity-list",1),gT(1,"async"),kg("createRequested",function(){return o.openCreateForm()}),Cs(2,"ds-icon-button",2),kg("action",function(){return o.goBack()}),hl()(),wg(3,j,1,1,"ng-template",null,0,ET)),e&2){let n=AC(4);_g("items",yT(1,4,o.configItems$)??dT(6,F))("loading",o.isLoading())("showCreate",true)("itemTemplate",n);}},dependencies:[Wn,O,Se,Lb],styles:[".platform-integration-configs__back[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.platform-integration-configs__back[_ngcontent-%COMP%]:hover{text-decoration:underline}"]})};export{V as PlatformIntegrationConfigsComponent};
@@ -1 +1 @@
1
- import {g,bm as xm,W as Wi,T as TT,cF as $b,j as jw,h as hr,i as Gn,k as Cs,n as kg,J as JC,m as hl,a3 as ZI,o as aC,t as sI,_ as _g,a6 as QI,u as cC,C as Ce,z as z$1,a as P,$ as $y,b as U,K as x,b1 as On,bf as gT,ac as CC,a8 as Kg,bi as vT,cG as DT,q as dC,cH as iC,M as Mg,v as fC,B as gy,cI as xt,aw as gl,ax as ml,c9 as Pf,b6 as Ng,ck as Lf,S as Sg,a5 as Dl,a9 as vC,cJ as Fg,aa as Cf,ab as Tf,ad as $g}from'./main-P72KGKGP.js';import {t as ti,Q as Qn,e as ei,Y as Ye$1,A as At,Z as Zn,c as cn,y as yt,w as wt}from'./chunk-BLF3w_iN.js';var Ae=(o,t)=>t.date,He=(o,t)=>t.x,$e=(o,t)=>t.label;function Ve(o,t){o&1&&(gl(0,"div",0),JC(1,"No daily data points for this period."),ml());}function Le(o,t){if(o&1&&(Pf(),Ng(0,"rect",18)),o&2){let e=CC().$implicit,n=CC(2);Sg("x",e.w+6)("y",n.yBase-e.tokensStubH)("width",e.w)("height",e.tokensStubH);}}function Ge(o,t){if(o&1&&(Pf(),Ng(0,"rect",19)(1,"rect",20)),o&2){let e=CC().$implicit,n=CC(2);Sg("x",e.w+6)("y",n.yBase-(e.promptH??0))("width",e.w)("height",e.promptH??0),sI(),Sg("x",e.w+6)("y",n.yBase-((e.promptH??0)+(e.completionH??0)))("width",e.w)("height",e.completionH??0);}}function Ye(o,t){if(o&1){let e=vC();Pf(),gl(0,"g",15),Fg("mouseenter",function(i){let d=Cf(e).$implicit,u=CC(2);return Tf(u.showTooltip(i,d.point))})("mousemove",function(i){let d=Cf(e).$implicit,u=CC(2);return Tf(u.showTooltip(i,d.point))})("mouseleave",function(){Cf(e);let i=CC(2);return Tf(i.hideTooltip())}),Ng(1,"rect",16)(2,"rect",17),aC(3,Le,1,4,":svg:rect",18)(4,Ge,2,8),ml();}if(o&2){let e=t.$implicit,n=CC(2);Sg("transform","translate("+e.xGroup+",0)"),sI(),Sg("y",n.yTop)("width",e.groupW)("height",n.yBase-n.yTop),sI(),Sg("y",n.yBase-e.costH)("width",e.w)("height",e.costH),sI(),cC(e.tokensStubH!==null?3:4);}}function We(o,t){if(o&1&&(Pf(),gl(0,"text",5),JC(1),ml()),o&2){let e=t.$implicit,n=CC(2);Sg("x",e.x)("y",n.yAxis),sI(),Kg(e.label);}}function je(o,t){if(o&1&&(gl(0,"div",24),JC(1),ml(),gl(2,"div",25),JC(3),ml()),o&2){let e=t.$implicit;sI(),Kg(e.label),sI(2),Kg(e.value);}}function ze(o,t){if(o&1&&(gl(0,"div",21)(1,"div",22),JC(2),ml(),gl(3,"div",23),dC(4,je,4,2,null,null,$e),ml()()),o&2){let e=CC(2);$g("left",e.tooltip().x+12,"px")("top",e.tooltip().y+12,"px"),sI(2),Kg(e.tooltip().data.date),sI(2),fC(e.tooltipLines());}}function Xe(o,t){if(o&1&&(gl(0,"div",8)(1,"span",10),JC(2),ml()()),o&2){let e=CC(2);sI(2),Kg(e.tokenCoverageLabel());}}function Je(o,t){if(o&1&&(gl(0,"div",1),Pf(),gl(1,"svg",2),Ng(2,"line",3)(3,"line",3),dC(4,Ye,5,8,":svg:g",4,Ae),dC(6,We,2,3,":svg:text",5,He),ml(),aC(8,ze,6,5,"div",6),Lf(),gl(9,"div",7)(10,"div",8),Ng(11,"span",9),gl(12,"span",10),JC(13,"Cost (per day)"),ml(),gl(14,"span",11),JC(15),ml()(),gl(16,"div",8),Ng(17,"span",12),gl(18,"span",10),JC(19,"Prompt tokens"),ml()(),gl(20,"div",8),Ng(21,"span",13),gl(22,"span",10),JC(23,"Completion tokens"),ml()(),gl(24,"div",8),Ng(25,"span",14),gl(26,"span",10),JC(27,"Tokens missing"),ml()(),gl(28,"div",8)(29,"span",10),JC(30,"Tokens scale"),ml(),gl(31,"span",11),JC(32),ml()(),aC(33,Xe,3,1,"div",8),ml()()),o&2){let e=CC();sI(),Sg("viewBox",e.viewBox),sI(),Sg("y1",e.yTop)("x2",720)("y2",e.yTop),sI(),Sg("y1",e.yBase)("x2",720)("y2",e.yBase),sI(),fC(e.bars()),sI(2),fC(e.axisLabels()),sI(2),cC(e.tooltip().visible&&e.tooltip().data?8:-1),sI(7),Dl("max ",e.maxCostLabel()),sI(17),Dl("max ",e.maxTokensLabel()),sI(),cC(e.tokenCoverageLabel()?33:-1);}}var j=class o{points=[];width=720;height=240;paddingX=12;paddingY=16;bottomAxisH=48;viewBox=`0 0 ${this.width} ${this.height}`;innerW=this.width-this.paddingX*2;innerH=this.height-this.paddingY*2-this.bottomAxisH;barGap=6;groupGap=14;safePoints=TT(()=>(this.points??[]).filter(t=>!!t.date));maxCost=TT(()=>Math.max(0,...this.safePoints().map(t=>t.cost??0)));maxTokens=TT(()=>{let t=this.safePoints().map(e=>{let n=e.promptTokens??null,i=e.completionTokens??null;return n===null&&i===null?null:(n??0)+(i??0)}).filter(e=>e!==null);return Math.max(0,...t)});tokenCoverageLabel=TT(()=>{let t=this.safePoints();return t.length===0?"":`Tokens available for ${t.filter(n=>n.promptTokens!==null||n.completionTokens!==null).length}/${t.length} days`});maxCostLabel=TT(()=>"$"+(new $b("en-US").transform(this.maxCost(),"1.2-2")??"0.00"));maxTokensLabel=TT(()=>new $b("en-US").transform(this.maxTokens(),"1.0-2")??"0");tooltip=Wi({visible:false,x:0,y:0,data:null});toTooltipData(t){let e=t.promptTokens,n=t.completionTokens,i=e===null&&n===null?null:(e??0)+(n??0);return {date:t.date,cost:t.cost??0,promptTokens:e,completionTokens:n,totalTokens:i,callCount:t.callCount??0}}showTooltip(t,e){let i=t.currentTarget?.closest(".chart")?.getBoundingClientRect(),d=i?t.clientX-i.left:t.clientX,u=i?t.clientY-i.top:t.clientY,f=320,k=170,U=12,C=i?Math.max(0,i.width-f-U):d,B=i?Math.max(0,i.height-k-U):u,F=i?Math.min(Math.max(0,d),C):d,ne=i?Math.min(Math.max(0,u),B):u;this.tooltip.set({visible:true,x:F,y:ne,data:this.toTooltipData(e)});}hideTooltip(){this.tooltip.update(t=>z$1(P({},t),{visible:false}));}formatTokens(t){return t===null?"\u2014":new $b("en-US").transform(t,"1.0-2")??"0"}formatCost(t){return "$"+(new $b("en-US").transform(t??0,"1.2-2")??"0.00")}tooltipLines=TT(()=>{let t=this.tooltip(),e=t.data;return !t.visible||!e?[]:[{label:"Cost",value:this.formatCost(e.cost)},{label:"Prompt tokens",value:this.formatTokens(e.promptTokens)},{label:"Completion tokens",value:this.formatTokens(e.completionTokens)},{label:"Total tokens",value:this.formatTokens(e.totalTokens)},{label:"Calls",value:`${e.callCount}`}]});bars=TT(()=>{let t=this.safePoints(),e=t.length;if(e===0)return [];let n=(this.innerW-(e-1)*this.groupGap)/e,i=Math.max(2,n),d=(i-this.barGap)/2,u=Math.max(1,d),f=this.maxCost()||1,k=this.maxTokens()||1,U=45;return t.map((C,B)=>{let F=this.paddingX+B*(i+this.groupGap),Ie=(C.cost??0)/f*this.innerH,oe=C.promptTokens,ae=C.completionTokens,Z=oe!==null||ae!==null,Ne=oe??0,Ue=ae??0,Be=Z?Ne/k*this.innerH:null,Fe=Z?Ue/k*this.innerH:null;return {date:C.date,point:C,xGroup:F,groupW:i,xCost:F,w:u,costH:Ie,xTokens:F+u+this.barGap,promptH:Be,completionH:Fe,tokensStubH:Z?null:U}})});axisLabels=TT(()=>{let t=this.safePoints(),e=t.length;if(e===0)return [];let i=Math.max(1,Math.ceil(e/8)),d=(this.innerW-(e-1)*this.groupGap)/e,u=Math.max(2,d);return t.map((f,k)=>({p:f,i:k})).filter(({i:f})=>f%i===0||f===e-1).map(({p:f,i:k})=>{let C=this.paddingX+k*(u+this.groupGap)+u/2,B=f.date.slice(5);return {x:C,label:B}})});yTop=this.paddingY;yBase=this.paddingY+this.innerH;yAxis=this.yBase+28;static \u0275fac=function(e){return new(e||o)};static \u0275cmp=jw({type:o,selectors:[["app-daily-series-chart"]],inputs:{points:"points"},decls:2,vars:1,consts:[[1,"muted"],[1,"chart"],["preserveAspectRatio","none","role","img","aria-label","Daily token and cost usage",1,"chart__svg"],["x1","0",1,"chart__grid"],[1,"chart__day"],["text-anchor","middle",1,"chart__axis-label"],[1,"chart__tooltip",3,"left","top"],[1,"chart__legend"],[1,"chart__legend-item"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--cost"],[1,"chart__legend-label"],[1,"chart__legend-value"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--prompt"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--completion"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--tokens-missing"],[1,"chart__day",3,"mouseenter","mousemove","mouseleave"],["x","0",1,"chart__hover"],["x","0",1,"chart__bar","chart__bar--cost"],[1,"chart__bar","chart__bar--tokens-missing"],[1,"chart__bar","chart__bar--prompt"],[1,"chart__bar","chart__bar--completion"],[1,"chart__tooltip"],[1,"chart__tooltip-title"],[1,"chart__tooltip-grid"],[1,"chart__tooltip-label"],[1,"chart__tooltip-value"]],template:function(e,n){e&1&&aC(0,Ve,2,0,"div",0)(1,Je,34,11,"div",1),e&2&&cC(n.safePoints().length===0?0:1);},styles:[".chart[_ngcontent-%COMP%]{display:grid;gap:.5rem;position:relative}.chart__svg[_ngcontent-%COMP%]{width:100%;height:260px;display:block;border-radius:12px;background:var(--color-bg-secondary, rgba(255, 255, 255, .72));border:1px solid var(--color-border-light, rgba(0, 0, 0, .08))}.chart__grid[_ngcontent-%COMP%]{stroke:var(--color-border-light, rgba(0, 0, 0, .08));stroke-width:1}.chart__day[_ngcontent-%COMP%]{cursor:default}.chart__hover[_ngcontent-%COMP%]{fill:transparent}.chart__day[_ngcontent-%COMP%]:hover .chart__hover[_ngcontent-%COMP%]{fill:var(--color-bg-hover, rgba(0, 0, 0, .03))}.chart__tooltip[_ngcontent-%COMP%]{position:absolute;z-index:2;min-width:220px;max-width:320px;padding:10px 12px;border-radius:12px;background:rgb(var(--color-bg-secondary-rgb, 255 255 255)/1);border:1px solid var(--color-border-light, rgba(0, 0, 0, .08));box-shadow:var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, .12));pointer-events:none}.chart__tooltip-title[_ngcontent-%COMP%]{font-weight:650;margin-bottom:6px}.chart__tooltip-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr auto;column-gap:10px;row-gap:4px}.chart__tooltip-label[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.85rem}.chart__tooltip-value[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums;text-align:right}.chart__bar[_ngcontent-%COMP%]{shape-rendering:geometricPrecision;rx:2;ry:2}.chart__bar--cost[_ngcontent-%COMP%]{fill:var(--color-primary, #007aff);opacity:.85}.chart__bar--prompt[_ngcontent-%COMP%]{fill:var(--color-success, #34c759);opacity:.85}.chart__bar--completion[_ngcontent-%COMP%]{fill:var(--color-warning, #ff9500);opacity:.85}.chart__bar--tokens-missing[_ngcontent-%COMP%]{fill:transparent;stroke:var(--color-text-secondary, rgba(29, 29, 31, .55));stroke-width:1.5;stroke-dasharray:4 3}.chart__axis-label[_ngcontent-%COMP%]{fill:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:12px;font-variant-numeric:tabular-nums}.chart__legend[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:.75rem;flex-wrap:wrap}.chart__legend-item[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:baseline}.chart__legend-swatch[_ngcontent-%COMP%]{width:10px;height:10px;border-radius:3px;align-self:center}.chart__legend-swatch--cost[_ngcontent-%COMP%]{background:var(--color-primary, #007aff)}.chart__legend-swatch--prompt[_ngcontent-%COMP%]{background:var(--color-success, #34c759)}.chart__legend-swatch--completion[_ngcontent-%COMP%]{background:var(--color-warning, #ff9500)}.chart__legend-swatch--tokens-missing[_ngcontent-%COMP%]{background:transparent;border:1px dashed var(--color-text-secondary, rgba(29, 29, 31, .55))}.chart__legend-label[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.85rem}.chart__legend-value[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums}.muted[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7))}"]})};var X=class o{http=g(gy);getTokenUsage(t){let e=new xt;return t.from&&(e=e.set("from",t.from)),t.to&&(e=e.set("to",t.to)),this.http.get("/api/token-usage",{params:e})}getTokenUsageSeries(t){let e=new xt;return t.from&&(e=e.set("from",t.from)),t.to&&(e=e.set("to",t.to)),this.http.get("/api/token-usage/series",{params:e})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=x({token:o,factory:o.\u0275fac,providedIn:"root"})};function Pe(o){return `${o}`.padStart(2,"0")}function we(o){return `${o.getUTCFullYear()}-${Pe(o.getUTCMonth()+1)}-${Pe(o.getUTCDate())}`}function qe(o=new Date){return new Date(Date.UTC(o.getUTCFullYear(),o.getUTCMonth(),1))}function Ke(o=new Date){return new Date(Date.UTC(o.getUTCFullYear(),o.getUTCMonth()+1,1))}var J=class o{api=g(X);destroyRef=g(Ce);defaultFrom=we(qe());defaultTo=we(Ke());draftFilters=Wi({from:this.defaultFrom,to:this.defaultTo});appliedFilters=Wi({from:this.defaultFrom,to:this.defaultTo});loading=Wi(false);error=Wi(null);aggregation=Wi(null);seriesResponse=Wi(null);series=Wi(null);tokenDataPartial=Wi(false);aggregationByModelId=Wi(null);seriesByModelId=Wi(null);init(){this.reload();}setDraftFrom(t){this.draftFilters.update(e=>z$1(P({},e),{from:t}));}setDraftTo(t){this.draftFilters.update(e=>z$1(P({},e),{to:t}));}clearDraftFrom(){this.setDraftFrom(null);}clearDraftTo(){this.setDraftTo(null);}apply(){this.appliedFilters.set(this.draftFilters()),this.reload();}addNullableTokens(t,e){return t===null&&e===null?null:(t??0)+(e??0)}aggregateByModelId(t){let e=new Map;for(let n of t){let i=n.modelId,d=e.get(i);d?(d.promptTokens=this.addNullableTokens(d.promptTokens,n.promptTokens),d.completionTokens=this.addNullableTokens(d.completionTokens,n.completionTokens),d.totalTokens=this.addNullableTokens(d.totalTokens,n.totalTokens),d.callCount+=n.callCount??0,d.cost=(d.cost??0)+(n.cost??0)):e.set(i,{agentName:"All agents",providerName:"all",modelId:n.modelId,promptTokens:n.promptTokens,completionTokens:n.completionTokens,totalTokens:n.totalTokens,callCount:n.callCount??0,cost:n.cost??0});}return [...e.values()].sort((n,i)=>(i.totalTokens??0)-(n.totalTokens??0))}aggregateSeriesByModelId(t){let e=new Map;for(let n of t){let i=`${n.date}|${n.modelId}`,d=e.get(i);d?(d.promptTokens=this.addNullableTokens(d.promptTokens,n.promptTokens),d.completionTokens=this.addNullableTokens(d.completionTokens,n.completionTokens),d.totalTokens=this.addNullableTokens(d.totalTokens,n.totalTokens),d.callCount+=n.callCount??0,d.cost=(d.cost??0)+(n.cost??0)):e.set(i,{date:n.date,agentName:"All agents",providerName:"all",modelId:n.modelId,promptTokens:n.promptTokens,completionTokens:n.completionTokens,totalTokens:n.totalTokens,callCount:n.callCount??0,cost:n.cost??0});}return [...e.values()].sort((n,i)=>n.date<i.date?-1:1)}reload(){let{from:t,to:e}=this.appliedFilters();this.loading.set(true),this.error.set(null),$y({aggregation:this.api.getTokenUsage({from:t,to:e}),series:this.api.getTokenUsageSeries({from:t,to:e})}).pipe(U(this.destroyRef)).subscribe({next:({aggregation:n,series:i})=>{this.aggregation.set(n),this.seriesResponse.set(i);let d=i.points??[];this.series.set(d),this.tokenDataPartial.set(n.tokenDataPartial||i.tokenDataPartial);let u=this.aggregateByModelId(n.models??[]);this.aggregationByModelId.set(u),this.seriesByModelId.set(this.aggregateSeriesByModelId(d)),this.loading.set(false);},error:n=>{this.loading.set(false),this.aggregation.set(null),this.seriesResponse.set(null),this.series.set(null),this.tokenDataPartial.set(false),this.aggregationByModelId.set(null),this.seriesByModelId.set(null),this.error.set(n instanceof Error?n.message:"Failed to load token usage");}});}static \u0275fac=function(e){return new(e||o)};static \u0275prov=x({token:o,factory:o.\u0275fac,providedIn:"root"})};var q=function(){throw new Error("DON'T USE this INSIDE A FUNCTION CALLED BY | call OR | apply IT MUST BE A PURE FUNCTION!")},De=typeof Proxy!="function"?Object.seal({}):new Proxy({},{get:q,set:q,deleteProperty:q,has:q}),K=class o{transform(t,e){if(typeof e!="function")throw new TypeError("You must pass a PURE function to | call");return e?.call(De,t)}static \u0275fac=function(e){return new(e||o)};static \u0275pipe=On({name:"call",type:o,pure:true})},Q=class o{transform(t,...e){if(typeof t!="function")throw new TypeError("You must use | apply on a PURE function");return t.apply(De,e)}static \u0275fac=function(e){return new(e||o)};static \u0275pipe=On({name:"apply",type:o,pure:true})};function Qe(o,t){o&1&&(Cs(0,"div",23),JC(1," Partial data \u2014 token counts may not cover the full period "),hl());}function Ze(o,t){o&1&&(Cs(0,"div",24),JC(1," No token data collected for this period "),hl());}function et(o,t){if(o&1&&(Cs(0,"div",19)(1,"div",20)(2,"div",21),JC(3,"Total tokens"),hl(),Cs(4,"div",22),JC(5),gT(6,"call"),hl()(),Cs(7,"div",20)(8,"div",21),JC(9,"Total calls"),hl(),Cs(10,"div",22),JC(11),hl()(),Cs(12,"div",20)(13,"div",21),JC(14,"Total cost"),hl(),Cs(15,"div",22),JC(16),gT(17,"apply"),hl()()(),aC(18,Qe,2,0,"div",23),aC(19,Ze,2,0,"div",24)),o&2){let e=CC();sI(5),Kg(vT(6,5,e.totalRow().totalTokens,e.formatTokenValue)),sI(6),Kg(e.totalRow().callCount),sI(5),Kg(DT(17,8,e.formatCostValue,e.isMissingPeriod(),e.totalRow().cost)),sI(2),cC(e.isPartialPeriod()?18:-1),sI(),cC(e.isMissingPeriod()?19:-1);}}function tt(o,t){o&1&&(Cs(0,"div",16)(1,"div",25),JC(2,"Loading token usage\u2026"),hl()());}function nt(o,t){if(o&1&&(Cs(0,"div",17)(1,"div",26),JC(2,"Failed to load"),hl(),Cs(3,"div",25),JC(4),hl()()),o&2){let e=CC();sI(4),Kg(e.state.error());}}function ot(o,t){o&1&&(Cs(0,"div",16)(1,"div",26),JC(2,"No data"),hl(),Cs(3,"div",25),JC(4,"No token usage recorded yet for this period."),hl()());}function at(o,t){if(o&1&&(Cs(0,"div",32)(1,"div",29),JC(2),hl(),Cs(3,"div",29),JC(4),hl(),Cs(5,"div",29),JC(6),hl(),Cs(7,"div",30),JC(8),gT(9,"call"),hl(),Cs(10,"div",30),JC(11),gT(12,"call"),hl(),Cs(13,"div",30),JC(14),gT(15,"call"),hl(),Cs(16,"div",30),JC(17),hl(),Cs(18,"div",30),JC(19),gT(20,"apply"),hl()()),o&2){let e=t.$implicit,n=CC(2);sI(2),Kg(e.agentName),sI(2),Kg(e.providerName),sI(2),Kg(e.modelId),sI(2),Kg(vT(9,8,e.promptTokens,n.formatTokenValue)),sI(3),Kg(vT(12,11,e.completionTokens,n.formatTokenValue)),sI(3),Kg(vT(15,14,e.totalTokens,n.formatTokenValue)),sI(3),Kg(e.callCount),sI(2),Dl(" ",DT(20,17,n.formatCostValue,n.isMissingPeriod(),e.cost)," ");}}function it(o,t){if(o&1&&(Cs(0,"div",33)(1,"div",29),JC(2),hl(),Cs(3,"div",29),JC(4),hl(),Cs(5,"div",29),JC(6),hl(),Cs(7,"div",30),JC(8),gT(9,"call"),hl(),Cs(10,"div",30),JC(11),gT(12,"call"),hl(),Cs(13,"div",30),JC(14),gT(15,"call"),hl(),Cs(16,"div",30),JC(17),hl(),Cs(18,"div",30),JC(19),gT(20,"apply"),hl()()),o&2){let e=CC(2);sI(2),Kg(e.totalRow().agentName),sI(2),Kg(e.totalRow().providerName),sI(2),Kg(e.totalRow().modelId),sI(2),Kg(vT(9,8,e.totalRow().promptTokens,e.formatTokenValue)),sI(3),Dl(" ",vT(12,11,e.totalRow().completionTokens,e.formatTokenValue)," "),sI(3),Kg(vT(15,14,e.totalRow().totalTokens,e.formatTokenValue)),sI(3),Kg(e.totalRow().callCount),sI(2),Dl(" ",DT(20,17,e.formatCostValue,e.isMissingPeriod(),e.totalRow().cost)," ");}}function rt(o,t){if(o&1&&(Cs(0,"div",18)(1,"section",16)(2,"div",26),JC(3,"Summary"),hl(),Cs(4,"div",27)(5,"div",28)(6,"div",29),JC(7,"agentName"),hl(),Cs(8,"div",29),JC(9,"providerName"),hl(),Cs(10,"div",29),JC(11,"modelId"),hl(),Cs(12,"div",30),JC(13,"promptTokens"),hl(),Cs(14,"div",30),JC(15,"completionTokens"),hl(),Cs(16,"div",30),JC(17,"totalTokens"),hl(),Cs(18,"div",30),JC(19,"callCount"),hl(),Cs(20,"div",30),JC(21,"cost"),hl()(),Cs(22,"div",31),dC(23,at,21,21,"div",32,iC().trackRow,true),aC(25,it,21,21,"div",33),hl()()(),Cs(26,"section",16)(27,"div",26),JC(28,"Daily series"),hl(),Mg(29,"app-daily-series-chart",34),hl()()),o&2){let e=CC();sI(23),fC(e.rows()),sI(2),cC(e.totalRow()?25:-1),sI(4),_g("points",e.chartPoints());}}var Ee="\u2014",Oe=class o{location=g(xm);state=g(J);view=Wi("byModel");rowsByAgent=TT(()=>this.state.aggregation()?.models??[]);totalRow=TT(()=>this.state.aggregation()?.total??null);rowsByModel=TT(()=>this.state.aggregationByModelId()??[]);chartPointsByAgent=TT(()=>{let t=this.state.series()??[];return this.aggregateDailyPoints(t)});chartPointsByModel=TT(()=>{let t=this.state.seriesByModelId()??[];return this.aggregateDailyPoints(t)});chartPoints=TT(()=>this.view()==="byAgent"?this.chartPointsByAgent():this.chartPointsByModel());rows=TT(()=>this.view()==="byAgent"?this.rowsByAgent():this.rowsByModel());isEmpty=TT(()=>{let t=this.state.aggregation();return t?(t.models?.length??0)===0&&(t.total?.callCount??0)===0:false});ngOnInit(){this.state.init();}onFromChange(t){this.state.setDraftFrom(t||null);}onToChange(t){this.state.setDraftTo(t||null);}clearFrom(){this.state.clearDraftFrom();}clearTo(){this.state.clearDraftTo();}apply(){this.state.apply();}aggregateDailyPoints(t){let e=new Map;for(let n of t){let i=e.get(n.date);if(!i)e.set(n.date,{date:n.date,promptTokens:n.promptTokens,completionTokens:n.completionTokens,cost:n.cost??0,callCount:n.callCount??0});else {let d=(u,f)=>u===null&&f===null?null:(u??0)+(f??0);i.promptTokens=d(i.promptTokens,n.promptTokens),i.completionTokens=d(i.completionTokens,n.completionTokens),i.cost=(i.cost??0)+(n.cost??0),i.callCount=(i.callCount??0)+(n.callCount??0);}}return [...e.values()].sort((n,i)=>n.date<i.date?-1:1)}trackRow(t,e){return `${e.agentName}|${e.providerName}|${e.modelId}`}isMissingPeriod=TT(()=>{if(this.state.loading())return false;let t=this.state.aggregation()?.total;return t?t.totalTokens===null&&(t.cost===null||t.cost===void 0):false});isPartialPeriod=TT(()=>!this.isMissingPeriod()&&this.state.tokenDataPartial());navigateBack(){this.location.back();}formatTokenValue(t){return t===null?Ee:new $b("en-US").transform(t,"1.0-2")??"0"}formatCostValue(t,e){return t?Ee:"$"+(new $b("en-US").transform(e??0,"1.2-2")??"0.00")}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=jw({type:o,selectors:[["app-token-usage"]],decls:41,vars:8,consts:[[1,"page"],[1,"page__header"],[1,"page__title-block"],["mat-icon-button","","title","Back",3,"click"],[1,"page__title"],[1,"page__subtitle"],[1,"filters"],[1,"filters__field"],[1,"filters__label"],[1,"filters__control"],["type","date",1,"filters__input",3,"ngModelChange","ngModel"],["type","button",1,"filters__clear",3,"click","disabled"],[1,"filters__select",3,"ngModelChange","ngModel"],["value","byModel"],["value","byAgent"],["type","button",1,"filters__apply",3,"click","disabled"],[1,"card"],[1,"card","card--error"],[1,"grid"],[1,"kpis"],[1,"kpi"],[1,"kpi__label"],[1,"kpi__value"],["title","Some calls in this period were recorded before token tracking was enabled. Token counts reflect only the portion where data was collected.",1,"hint"],["title","No token usage data was collected for this period.",1,"hint"],[1,"muted"],[1,"card__title"],[1,"table"],[1,"table__head"],[1,"table__cell"],[1,"table__cell","table__cell--num"],[1,"table__body"],[1,"table__row"],[1,"table__row","table__row--total"],[3,"points"]],template:function(e,n){e&1&&(Cs(0,"section",0)(1,"header",1)(2,"div",2)(3,"button",3),kg("click",function(){return n.navigateBack()}),Cs(4,"mat-icon"),JC(5,"chevron_left"),hl()(),Cs(6,"div")(7,"h1",4),JC(8,"Token Usage"),hl(),Cs(9,"p",5),JC(10,"Track prompt and completion token usage by agent and model."),hl()()(),Cs(11,"div",6)(12,"label",7)(13,"span",8),JC(14,"From"),hl(),Cs(15,"div",9)(16,"input",10),kg("ngModelChange",function(d){return n.onFromChange(d)}),hl(),ZI(),Cs(17,"button",11),kg("click",function(){return n.clearFrom()}),JC(18," Clear "),hl()()(),Cs(19,"label",7)(20,"span",8),JC(21,"To"),hl(),Cs(22,"div",9)(23,"input",10),kg("ngModelChange",function(d){return n.onToChange(d)}),hl(),ZI(),Cs(24,"button",11),kg("click",function(){return n.clearTo()}),JC(25," Clear "),hl()()(),Cs(26,"label",7)(27,"span",8),JC(28,"View"),hl(),Cs(29,"select",12),kg("ngModelChange",function(d){return n.view.set(d)}),Cs(30,"option",13),JC(31,"By model"),hl(),Cs(32,"option",14),JC(33,"By agent"),hl()(),ZI(),hl(),Cs(34,"button",15),kg("click",function(){return n.apply()}),JC(35,"Apply"),hl()()(),aC(36,et,20,12),aC(37,tt,3,0,"div",16)(38,nt,5,1,"div",17)(39,ot,5,0,"div",16)(40,rt,30,2,"div",18),hl()),e&2&&(sI(16),_g("ngModel",n.state.draftFilters().from),QI(),sI(),_g("disabled",!n.state.draftFilters().from),sI(6),_g("ngModel",n.state.draftFilters().to),QI(),sI(),_g("disabled",!n.state.draftFilters().to),sI(5),_g("ngModel",n.view()),QI(),sI(5),_g("disabled",n.state.loading()),sI(2),cC(n.totalRow()?36:-1),sI(),cC(n.state.loading()?37:n.state.error()?38:n.isEmpty()?39:40));},dependencies:[ti,Qn,ei,Ye$1,At,Zn,cn,j,hr,Gn,yt,wt,K,Q],styles:[".page[_ngcontent-%COMP%]{padding:1.5rem;color:var(--color-text, #1d1d1f)}.page__header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:1.5rem;margin-bottom:1rem}.page__title-block[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.75rem}.page__title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:650}.page__subtitle[_ngcontent-%COMP%]{margin:.25rem 0 0;color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.95rem}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:flex-end;gap:.75rem}.filters__field[_ngcontent-%COMP%]{display:grid;gap:.25rem}.filters__label[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7))}.filters__control[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.filters__input[_ngcontent-%COMP%], .filters__select[_ngcontent-%COMP%]{height:34px;padding:0 .5rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:var(--color-bg-secondary, rgba(255, 255, 255, .72));color:var(--color-text, #1d1d1f)}.filters__apply[_ngcontent-%COMP%], .filters__clear[_ngcontent-%COMP%]{height:34px;padding:0 .75rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:var(--color-bg-secondary, rgba(255, 255, 255, .72));color:var(--color-text, #1d1d1f);cursor:pointer}.kpis[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem;margin:.75rem 0 1rem}@media(max-width:900px){.kpis[_ngcontent-%COMP%]{grid-template-columns:1fr}}.kpi[_ngcontent-%COMP%]{border-radius:14px;padding:.75rem 1rem;background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));box-shadow:var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, .08))}.kpi__label[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7))}.kpi__value[_ngcontent-%COMP%]{margin-top:.25rem;font-size:1.2rem;font-weight:650;font-variant-numeric:tabular-nums}.filters__apply[_ngcontent-%COMP%]{border-color:var(--color-primary, #007aff);background:var(--color-primary, #007aff);color:var(--color-text-inverse, #ffffff)}.filters__apply[_ngcontent-%COMP%]:disabled, .filters__clear[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1.5fr 1fr;gap:1rem;align-items:start}@media(max-width:1100px){.grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.card[_ngcontent-%COMP%]{border-radius:14px;padding:1rem;background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));box-shadow:var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, .08))}.card--error[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.card__title[_ngcontent-%COMP%]{font-weight:650;margin-bottom:.75rem}.muted[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7))}.table[_ngcontent-%COMP%]{overflow-x:auto}.table__head[_ngcontent-%COMP%], .table__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr 2fr 1fr 1fr 1fr .7fr 1fr;gap:.5rem;align-items:center}.table__head[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7));padding:.25rem 0;border-bottom:1px solid var(--color-border-light, rgba(0, 0, 0, .08))}.table__row[_ngcontent-%COMP%]{padding:.5rem 0;border-bottom:1px solid var(--color-border-light, rgba(0, 0, 0, .08))}.table__row--total[_ngcontent-%COMP%]{font-weight:650;background:var(--color-bg-hover, rgba(0, 0, 0, .03));border-radius:10px;padding:.6rem .5rem;border-bottom:none;margin-top:.5rem}.table__cell[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.table__cell--num[_ngcontent-%COMP%]{text-align:right;font-variant-numeric:tabular-nums}.hint[_ngcontent-%COMP%]{margin:.25rem 0 1rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.85rem}"],changeDetection:1})};export{Oe as TokenUsageComponent};
1
+ import {g,bm as xm,W as Wi,T as TT,cF as $b,j as jw,h as hr,i as Gn,k as Cs,n as kg,J as JC,m as hl,a3 as ZI,o as aC,t as sI,_ as _g,a6 as QI,u as cC,C as Ce,z as z$1,a as P,$ as $y,b as U,K as x,b1 as On,bf as gT,ac as CC,a8 as Kg,bi as vT,cG as DT,q as dC,cH as iC,M as Mg,v as fC,B as gy,cI as xt,aw as gl,ax as ml,c9 as Pf,b6 as Ng,ck as Lf,S as Sg,a5 as Dl,a9 as vC,cJ as Fg,aa as Cf,ab as Tf,ad as $g}from'./main-RXIVNUWK.js';import {t as ti,Q as Qn,e as ei,Y as Ye$1,A as At,Z as Zn,c as cn,y as yt,w as wt}from'./chunk-B3kY-GQk.js';var Ae=(o,t)=>t.date,He=(o,t)=>t.x,$e=(o,t)=>t.label;function Ve(o,t){o&1&&(gl(0,"div",0),JC(1,"No daily data points for this period."),ml());}function Le(o,t){if(o&1&&(Pf(),Ng(0,"rect",18)),o&2){let e=CC().$implicit,n=CC(2);Sg("x",e.w+6)("y",n.yBase-e.tokensStubH)("width",e.w)("height",e.tokensStubH);}}function Ge(o,t){if(o&1&&(Pf(),Ng(0,"rect",19)(1,"rect",20)),o&2){let e=CC().$implicit,n=CC(2);Sg("x",e.w+6)("y",n.yBase-(e.promptH??0))("width",e.w)("height",e.promptH??0),sI(),Sg("x",e.w+6)("y",n.yBase-((e.promptH??0)+(e.completionH??0)))("width",e.w)("height",e.completionH??0);}}function Ye(o,t){if(o&1){let e=vC();Pf(),gl(0,"g",15),Fg("mouseenter",function(i){let d=Cf(e).$implicit,u=CC(2);return Tf(u.showTooltip(i,d.point))})("mousemove",function(i){let d=Cf(e).$implicit,u=CC(2);return Tf(u.showTooltip(i,d.point))})("mouseleave",function(){Cf(e);let i=CC(2);return Tf(i.hideTooltip())}),Ng(1,"rect",16)(2,"rect",17),aC(3,Le,1,4,":svg:rect",18)(4,Ge,2,8),ml();}if(o&2){let e=t.$implicit,n=CC(2);Sg("transform","translate("+e.xGroup+",0)"),sI(),Sg("y",n.yTop)("width",e.groupW)("height",n.yBase-n.yTop),sI(),Sg("y",n.yBase-e.costH)("width",e.w)("height",e.costH),sI(),cC(e.tokensStubH!==null?3:4);}}function We(o,t){if(o&1&&(Pf(),gl(0,"text",5),JC(1),ml()),o&2){let e=t.$implicit,n=CC(2);Sg("x",e.x)("y",n.yAxis),sI(),Kg(e.label);}}function je(o,t){if(o&1&&(gl(0,"div",24),JC(1),ml(),gl(2,"div",25),JC(3),ml()),o&2){let e=t.$implicit;sI(),Kg(e.label),sI(2),Kg(e.value);}}function ze(o,t){if(o&1&&(gl(0,"div",21)(1,"div",22),JC(2),ml(),gl(3,"div",23),dC(4,je,4,2,null,null,$e),ml()()),o&2){let e=CC(2);$g("left",e.tooltip().x+12,"px")("top",e.tooltip().y+12,"px"),sI(2),Kg(e.tooltip().data.date),sI(2),fC(e.tooltipLines());}}function Xe(o,t){if(o&1&&(gl(0,"div",8)(1,"span",10),JC(2),ml()()),o&2){let e=CC(2);sI(2),Kg(e.tokenCoverageLabel());}}function Je(o,t){if(o&1&&(gl(0,"div",1),Pf(),gl(1,"svg",2),Ng(2,"line",3)(3,"line",3),dC(4,Ye,5,8,":svg:g",4,Ae),dC(6,We,2,3,":svg:text",5,He),ml(),aC(8,ze,6,5,"div",6),Lf(),gl(9,"div",7)(10,"div",8),Ng(11,"span",9),gl(12,"span",10),JC(13,"Cost (per day)"),ml(),gl(14,"span",11),JC(15),ml()(),gl(16,"div",8),Ng(17,"span",12),gl(18,"span",10),JC(19,"Prompt tokens"),ml()(),gl(20,"div",8),Ng(21,"span",13),gl(22,"span",10),JC(23,"Completion tokens"),ml()(),gl(24,"div",8),Ng(25,"span",14),gl(26,"span",10),JC(27,"Tokens missing"),ml()(),gl(28,"div",8)(29,"span",10),JC(30,"Tokens scale"),ml(),gl(31,"span",11),JC(32),ml()(),aC(33,Xe,3,1,"div",8),ml()()),o&2){let e=CC();sI(),Sg("viewBox",e.viewBox),sI(),Sg("y1",e.yTop)("x2",720)("y2",e.yTop),sI(),Sg("y1",e.yBase)("x2",720)("y2",e.yBase),sI(),fC(e.bars()),sI(2),fC(e.axisLabels()),sI(2),cC(e.tooltip().visible&&e.tooltip().data?8:-1),sI(7),Dl("max ",e.maxCostLabel()),sI(17),Dl("max ",e.maxTokensLabel()),sI(),cC(e.tokenCoverageLabel()?33:-1);}}var j=class o{points=[];width=720;height=240;paddingX=12;paddingY=16;bottomAxisH=48;viewBox=`0 0 ${this.width} ${this.height}`;innerW=this.width-this.paddingX*2;innerH=this.height-this.paddingY*2-this.bottomAxisH;barGap=6;groupGap=14;safePoints=TT(()=>(this.points??[]).filter(t=>!!t.date));maxCost=TT(()=>Math.max(0,...this.safePoints().map(t=>t.cost??0)));maxTokens=TT(()=>{let t=this.safePoints().map(e=>{let n=e.promptTokens??null,i=e.completionTokens??null;return n===null&&i===null?null:(n??0)+(i??0)}).filter(e=>e!==null);return Math.max(0,...t)});tokenCoverageLabel=TT(()=>{let t=this.safePoints();return t.length===0?"":`Tokens available for ${t.filter(n=>n.promptTokens!==null||n.completionTokens!==null).length}/${t.length} days`});maxCostLabel=TT(()=>"$"+(new $b("en-US").transform(this.maxCost(),"1.2-2")??"0.00"));maxTokensLabel=TT(()=>new $b("en-US").transform(this.maxTokens(),"1.0-2")??"0");tooltip=Wi({visible:false,x:0,y:0,data:null});toTooltipData(t){let e=t.promptTokens,n=t.completionTokens,i=e===null&&n===null?null:(e??0)+(n??0);return {date:t.date,cost:t.cost??0,promptTokens:e,completionTokens:n,totalTokens:i,callCount:t.callCount??0}}showTooltip(t,e){let i=t.currentTarget?.closest(".chart")?.getBoundingClientRect(),d=i?t.clientX-i.left:t.clientX,u=i?t.clientY-i.top:t.clientY,f=320,k=170,U=12,C=i?Math.max(0,i.width-f-U):d,B=i?Math.max(0,i.height-k-U):u,F=i?Math.min(Math.max(0,d),C):d,ne=i?Math.min(Math.max(0,u),B):u;this.tooltip.set({visible:true,x:F,y:ne,data:this.toTooltipData(e)});}hideTooltip(){this.tooltip.update(t=>z$1(P({},t),{visible:false}));}formatTokens(t){return t===null?"\u2014":new $b("en-US").transform(t,"1.0-2")??"0"}formatCost(t){return "$"+(new $b("en-US").transform(t??0,"1.2-2")??"0.00")}tooltipLines=TT(()=>{let t=this.tooltip(),e=t.data;return !t.visible||!e?[]:[{label:"Cost",value:this.formatCost(e.cost)},{label:"Prompt tokens",value:this.formatTokens(e.promptTokens)},{label:"Completion tokens",value:this.formatTokens(e.completionTokens)},{label:"Total tokens",value:this.formatTokens(e.totalTokens)},{label:"Calls",value:`${e.callCount}`}]});bars=TT(()=>{let t=this.safePoints(),e=t.length;if(e===0)return [];let n=(this.innerW-(e-1)*this.groupGap)/e,i=Math.max(2,n),d=(i-this.barGap)/2,u=Math.max(1,d),f=this.maxCost()||1,k=this.maxTokens()||1,U=45;return t.map((C,B)=>{let F=this.paddingX+B*(i+this.groupGap),Ie=(C.cost??0)/f*this.innerH,oe=C.promptTokens,ae=C.completionTokens,Z=oe!==null||ae!==null,Ne=oe??0,Ue=ae??0,Be=Z?Ne/k*this.innerH:null,Fe=Z?Ue/k*this.innerH:null;return {date:C.date,point:C,xGroup:F,groupW:i,xCost:F,w:u,costH:Ie,xTokens:F+u+this.barGap,promptH:Be,completionH:Fe,tokensStubH:Z?null:U}})});axisLabels=TT(()=>{let t=this.safePoints(),e=t.length;if(e===0)return [];let i=Math.max(1,Math.ceil(e/8)),d=(this.innerW-(e-1)*this.groupGap)/e,u=Math.max(2,d);return t.map((f,k)=>({p:f,i:k})).filter(({i:f})=>f%i===0||f===e-1).map(({p:f,i:k})=>{let C=this.paddingX+k*(u+this.groupGap)+u/2,B=f.date.slice(5);return {x:C,label:B}})});yTop=this.paddingY;yBase=this.paddingY+this.innerH;yAxis=this.yBase+28;static \u0275fac=function(e){return new(e||o)};static \u0275cmp=jw({type:o,selectors:[["app-daily-series-chart"]],inputs:{points:"points"},decls:2,vars:1,consts:[[1,"muted"],[1,"chart"],["preserveAspectRatio","none","role","img","aria-label","Daily token and cost usage",1,"chart__svg"],["x1","0",1,"chart__grid"],[1,"chart__day"],["text-anchor","middle",1,"chart__axis-label"],[1,"chart__tooltip",3,"left","top"],[1,"chart__legend"],[1,"chart__legend-item"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--cost"],[1,"chart__legend-label"],[1,"chart__legend-value"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--prompt"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--completion"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--tokens-missing"],[1,"chart__day",3,"mouseenter","mousemove","mouseleave"],["x","0",1,"chart__hover"],["x","0",1,"chart__bar","chart__bar--cost"],[1,"chart__bar","chart__bar--tokens-missing"],[1,"chart__bar","chart__bar--prompt"],[1,"chart__bar","chart__bar--completion"],[1,"chart__tooltip"],[1,"chart__tooltip-title"],[1,"chart__tooltip-grid"],[1,"chart__tooltip-label"],[1,"chart__tooltip-value"]],template:function(e,n){e&1&&aC(0,Ve,2,0,"div",0)(1,Je,34,11,"div",1),e&2&&cC(n.safePoints().length===0?0:1);},styles:[".chart[_ngcontent-%COMP%]{display:grid;gap:.5rem;position:relative}.chart__svg[_ngcontent-%COMP%]{width:100%;height:260px;display:block;border-radius:12px;background:var(--color-bg-secondary, rgba(255, 255, 255, .72));border:1px solid var(--color-border-light, rgba(0, 0, 0, .08))}.chart__grid[_ngcontent-%COMP%]{stroke:var(--color-border-light, rgba(0, 0, 0, .08));stroke-width:1}.chart__day[_ngcontent-%COMP%]{cursor:default}.chart__hover[_ngcontent-%COMP%]{fill:transparent}.chart__day[_ngcontent-%COMP%]:hover .chart__hover[_ngcontent-%COMP%]{fill:var(--color-bg-hover, rgba(0, 0, 0, .03))}.chart__tooltip[_ngcontent-%COMP%]{position:absolute;z-index:2;min-width:220px;max-width:320px;padding:10px 12px;border-radius:12px;background:rgb(var(--color-bg-secondary-rgb, 255 255 255)/1);border:1px solid var(--color-border-light, rgba(0, 0, 0, .08));box-shadow:var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, .12));pointer-events:none}.chart__tooltip-title[_ngcontent-%COMP%]{font-weight:650;margin-bottom:6px}.chart__tooltip-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr auto;column-gap:10px;row-gap:4px}.chart__tooltip-label[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.85rem}.chart__tooltip-value[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums;text-align:right}.chart__bar[_ngcontent-%COMP%]{shape-rendering:geometricPrecision;rx:2;ry:2}.chart__bar--cost[_ngcontent-%COMP%]{fill:var(--color-primary, #007aff);opacity:.85}.chart__bar--prompt[_ngcontent-%COMP%]{fill:var(--color-success, #34c759);opacity:.85}.chart__bar--completion[_ngcontent-%COMP%]{fill:var(--color-warning, #ff9500);opacity:.85}.chart__bar--tokens-missing[_ngcontent-%COMP%]{fill:transparent;stroke:var(--color-text-secondary, rgba(29, 29, 31, .55));stroke-width:1.5;stroke-dasharray:4 3}.chart__axis-label[_ngcontent-%COMP%]{fill:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:12px;font-variant-numeric:tabular-nums}.chart__legend[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:.75rem;flex-wrap:wrap}.chart__legend-item[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:baseline}.chart__legend-swatch[_ngcontent-%COMP%]{width:10px;height:10px;border-radius:3px;align-self:center}.chart__legend-swatch--cost[_ngcontent-%COMP%]{background:var(--color-primary, #007aff)}.chart__legend-swatch--prompt[_ngcontent-%COMP%]{background:var(--color-success, #34c759)}.chart__legend-swatch--completion[_ngcontent-%COMP%]{background:var(--color-warning, #ff9500)}.chart__legend-swatch--tokens-missing[_ngcontent-%COMP%]{background:transparent;border:1px dashed var(--color-text-secondary, rgba(29, 29, 31, .55))}.chart__legend-label[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.85rem}.chart__legend-value[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums}.muted[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7))}"]})};var X=class o{http=g(gy);getTokenUsage(t){let e=new xt;return t.from&&(e=e.set("from",t.from)),t.to&&(e=e.set("to",t.to)),this.http.get("/api/token-usage",{params:e})}getTokenUsageSeries(t){let e=new xt;return t.from&&(e=e.set("from",t.from)),t.to&&(e=e.set("to",t.to)),this.http.get("/api/token-usage/series",{params:e})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=x({token:o,factory:o.\u0275fac,providedIn:"root"})};function Pe(o){return `${o}`.padStart(2,"0")}function we(o){return `${o.getUTCFullYear()}-${Pe(o.getUTCMonth()+1)}-${Pe(o.getUTCDate())}`}function qe(o=new Date){return new Date(Date.UTC(o.getUTCFullYear(),o.getUTCMonth(),1))}function Ke(o=new Date){return new Date(Date.UTC(o.getUTCFullYear(),o.getUTCMonth()+1,1))}var J=class o{api=g(X);destroyRef=g(Ce);defaultFrom=we(qe());defaultTo=we(Ke());draftFilters=Wi({from:this.defaultFrom,to:this.defaultTo});appliedFilters=Wi({from:this.defaultFrom,to:this.defaultTo});loading=Wi(false);error=Wi(null);aggregation=Wi(null);seriesResponse=Wi(null);series=Wi(null);tokenDataPartial=Wi(false);aggregationByModelId=Wi(null);seriesByModelId=Wi(null);init(){this.reload();}setDraftFrom(t){this.draftFilters.update(e=>z$1(P({},e),{from:t}));}setDraftTo(t){this.draftFilters.update(e=>z$1(P({},e),{to:t}));}clearDraftFrom(){this.setDraftFrom(null);}clearDraftTo(){this.setDraftTo(null);}apply(){this.appliedFilters.set(this.draftFilters()),this.reload();}addNullableTokens(t,e){return t===null&&e===null?null:(t??0)+(e??0)}aggregateByModelId(t){let e=new Map;for(let n of t){let i=n.modelId,d=e.get(i);d?(d.promptTokens=this.addNullableTokens(d.promptTokens,n.promptTokens),d.completionTokens=this.addNullableTokens(d.completionTokens,n.completionTokens),d.totalTokens=this.addNullableTokens(d.totalTokens,n.totalTokens),d.callCount+=n.callCount??0,d.cost=(d.cost??0)+(n.cost??0)):e.set(i,{agentName:"All agents",providerName:"all",modelId:n.modelId,promptTokens:n.promptTokens,completionTokens:n.completionTokens,totalTokens:n.totalTokens,callCount:n.callCount??0,cost:n.cost??0});}return [...e.values()].sort((n,i)=>(i.totalTokens??0)-(n.totalTokens??0))}aggregateSeriesByModelId(t){let e=new Map;for(let n of t){let i=`${n.date}|${n.modelId}`,d=e.get(i);d?(d.promptTokens=this.addNullableTokens(d.promptTokens,n.promptTokens),d.completionTokens=this.addNullableTokens(d.completionTokens,n.completionTokens),d.totalTokens=this.addNullableTokens(d.totalTokens,n.totalTokens),d.callCount+=n.callCount??0,d.cost=(d.cost??0)+(n.cost??0)):e.set(i,{date:n.date,agentName:"All agents",providerName:"all",modelId:n.modelId,promptTokens:n.promptTokens,completionTokens:n.completionTokens,totalTokens:n.totalTokens,callCount:n.callCount??0,cost:n.cost??0});}return [...e.values()].sort((n,i)=>n.date<i.date?-1:1)}reload(){let{from:t,to:e}=this.appliedFilters();this.loading.set(true),this.error.set(null),$y({aggregation:this.api.getTokenUsage({from:t,to:e}),series:this.api.getTokenUsageSeries({from:t,to:e})}).pipe(U(this.destroyRef)).subscribe({next:({aggregation:n,series:i})=>{this.aggregation.set(n),this.seriesResponse.set(i);let d=i.points??[];this.series.set(d),this.tokenDataPartial.set(n.tokenDataPartial||i.tokenDataPartial);let u=this.aggregateByModelId(n.models??[]);this.aggregationByModelId.set(u),this.seriesByModelId.set(this.aggregateSeriesByModelId(d)),this.loading.set(false);},error:n=>{this.loading.set(false),this.aggregation.set(null),this.seriesResponse.set(null),this.series.set(null),this.tokenDataPartial.set(false),this.aggregationByModelId.set(null),this.seriesByModelId.set(null),this.error.set(n instanceof Error?n.message:"Failed to load token usage");}});}static \u0275fac=function(e){return new(e||o)};static \u0275prov=x({token:o,factory:o.\u0275fac,providedIn:"root"})};var q=function(){throw new Error("DON'T USE this INSIDE A FUNCTION CALLED BY | call OR | apply IT MUST BE A PURE FUNCTION!")},De=typeof Proxy!="function"?Object.seal({}):new Proxy({},{get:q,set:q,deleteProperty:q,has:q}),K=class o{transform(t,e){if(typeof e!="function")throw new TypeError("You must pass a PURE function to | call");return e?.call(De,t)}static \u0275fac=function(e){return new(e||o)};static \u0275pipe=On({name:"call",type:o,pure:true})},Q=class o{transform(t,...e){if(typeof t!="function")throw new TypeError("You must use | apply on a PURE function");return t.apply(De,e)}static \u0275fac=function(e){return new(e||o)};static \u0275pipe=On({name:"apply",type:o,pure:true})};function Qe(o,t){o&1&&(Cs(0,"div",23),JC(1," Partial data \u2014 token counts may not cover the full period "),hl());}function Ze(o,t){o&1&&(Cs(0,"div",24),JC(1," No token data collected for this period "),hl());}function et(o,t){if(o&1&&(Cs(0,"div",19)(1,"div",20)(2,"div",21),JC(3,"Total tokens"),hl(),Cs(4,"div",22),JC(5),gT(6,"call"),hl()(),Cs(7,"div",20)(8,"div",21),JC(9,"Total calls"),hl(),Cs(10,"div",22),JC(11),hl()(),Cs(12,"div",20)(13,"div",21),JC(14,"Total cost"),hl(),Cs(15,"div",22),JC(16),gT(17,"apply"),hl()()(),aC(18,Qe,2,0,"div",23),aC(19,Ze,2,0,"div",24)),o&2){let e=CC();sI(5),Kg(vT(6,5,e.totalRow().totalTokens,e.formatTokenValue)),sI(6),Kg(e.totalRow().callCount),sI(5),Kg(DT(17,8,e.formatCostValue,e.isMissingPeriod(),e.totalRow().cost)),sI(2),cC(e.isPartialPeriod()?18:-1),sI(),cC(e.isMissingPeriod()?19:-1);}}function tt(o,t){o&1&&(Cs(0,"div",16)(1,"div",25),JC(2,"Loading token usage\u2026"),hl()());}function nt(o,t){if(o&1&&(Cs(0,"div",17)(1,"div",26),JC(2,"Failed to load"),hl(),Cs(3,"div",25),JC(4),hl()()),o&2){let e=CC();sI(4),Kg(e.state.error());}}function ot(o,t){o&1&&(Cs(0,"div",16)(1,"div",26),JC(2,"No data"),hl(),Cs(3,"div",25),JC(4,"No token usage recorded yet for this period."),hl()());}function at(o,t){if(o&1&&(Cs(0,"div",32)(1,"div",29),JC(2),hl(),Cs(3,"div",29),JC(4),hl(),Cs(5,"div",29),JC(6),hl(),Cs(7,"div",30),JC(8),gT(9,"call"),hl(),Cs(10,"div",30),JC(11),gT(12,"call"),hl(),Cs(13,"div",30),JC(14),gT(15,"call"),hl(),Cs(16,"div",30),JC(17),hl(),Cs(18,"div",30),JC(19),gT(20,"apply"),hl()()),o&2){let e=t.$implicit,n=CC(2);sI(2),Kg(e.agentName),sI(2),Kg(e.providerName),sI(2),Kg(e.modelId),sI(2),Kg(vT(9,8,e.promptTokens,n.formatTokenValue)),sI(3),Kg(vT(12,11,e.completionTokens,n.formatTokenValue)),sI(3),Kg(vT(15,14,e.totalTokens,n.formatTokenValue)),sI(3),Kg(e.callCount),sI(2),Dl(" ",DT(20,17,n.formatCostValue,n.isMissingPeriod(),e.cost)," ");}}function it(o,t){if(o&1&&(Cs(0,"div",33)(1,"div",29),JC(2),hl(),Cs(3,"div",29),JC(4),hl(),Cs(5,"div",29),JC(6),hl(),Cs(7,"div",30),JC(8),gT(9,"call"),hl(),Cs(10,"div",30),JC(11),gT(12,"call"),hl(),Cs(13,"div",30),JC(14),gT(15,"call"),hl(),Cs(16,"div",30),JC(17),hl(),Cs(18,"div",30),JC(19),gT(20,"apply"),hl()()),o&2){let e=CC(2);sI(2),Kg(e.totalRow().agentName),sI(2),Kg(e.totalRow().providerName),sI(2),Kg(e.totalRow().modelId),sI(2),Kg(vT(9,8,e.totalRow().promptTokens,e.formatTokenValue)),sI(3),Dl(" ",vT(12,11,e.totalRow().completionTokens,e.formatTokenValue)," "),sI(3),Kg(vT(15,14,e.totalRow().totalTokens,e.formatTokenValue)),sI(3),Kg(e.totalRow().callCount),sI(2),Dl(" ",DT(20,17,e.formatCostValue,e.isMissingPeriod(),e.totalRow().cost)," ");}}function rt(o,t){if(o&1&&(Cs(0,"div",18)(1,"section",16)(2,"div",26),JC(3,"Summary"),hl(),Cs(4,"div",27)(5,"div",28)(6,"div",29),JC(7,"agentName"),hl(),Cs(8,"div",29),JC(9,"providerName"),hl(),Cs(10,"div",29),JC(11,"modelId"),hl(),Cs(12,"div",30),JC(13,"promptTokens"),hl(),Cs(14,"div",30),JC(15,"completionTokens"),hl(),Cs(16,"div",30),JC(17,"totalTokens"),hl(),Cs(18,"div",30),JC(19,"callCount"),hl(),Cs(20,"div",30),JC(21,"cost"),hl()(),Cs(22,"div",31),dC(23,at,21,21,"div",32,iC().trackRow,true),aC(25,it,21,21,"div",33),hl()()(),Cs(26,"section",16)(27,"div",26),JC(28,"Daily series"),hl(),Mg(29,"app-daily-series-chart",34),hl()()),o&2){let e=CC();sI(23),fC(e.rows()),sI(2),cC(e.totalRow()?25:-1),sI(4),_g("points",e.chartPoints());}}var Ee="\u2014",Oe=class o{location=g(xm);state=g(J);view=Wi("byModel");rowsByAgent=TT(()=>this.state.aggregation()?.models??[]);totalRow=TT(()=>this.state.aggregation()?.total??null);rowsByModel=TT(()=>this.state.aggregationByModelId()??[]);chartPointsByAgent=TT(()=>{let t=this.state.series()??[];return this.aggregateDailyPoints(t)});chartPointsByModel=TT(()=>{let t=this.state.seriesByModelId()??[];return this.aggregateDailyPoints(t)});chartPoints=TT(()=>this.view()==="byAgent"?this.chartPointsByAgent():this.chartPointsByModel());rows=TT(()=>this.view()==="byAgent"?this.rowsByAgent():this.rowsByModel());isEmpty=TT(()=>{let t=this.state.aggregation();return t?(t.models?.length??0)===0&&(t.total?.callCount??0)===0:false});ngOnInit(){this.state.init();}onFromChange(t){this.state.setDraftFrom(t||null);}onToChange(t){this.state.setDraftTo(t||null);}clearFrom(){this.state.clearDraftFrom();}clearTo(){this.state.clearDraftTo();}apply(){this.state.apply();}aggregateDailyPoints(t){let e=new Map;for(let n of t){let i=e.get(n.date);if(!i)e.set(n.date,{date:n.date,promptTokens:n.promptTokens,completionTokens:n.completionTokens,cost:n.cost??0,callCount:n.callCount??0});else {let d=(u,f)=>u===null&&f===null?null:(u??0)+(f??0);i.promptTokens=d(i.promptTokens,n.promptTokens),i.completionTokens=d(i.completionTokens,n.completionTokens),i.cost=(i.cost??0)+(n.cost??0),i.callCount=(i.callCount??0)+(n.callCount??0);}}return [...e.values()].sort((n,i)=>n.date<i.date?-1:1)}trackRow(t,e){return `${e.agentName}|${e.providerName}|${e.modelId}`}isMissingPeriod=TT(()=>{if(this.state.loading())return false;let t=this.state.aggregation()?.total;return t?t.totalTokens===null&&(t.cost===null||t.cost===void 0):false});isPartialPeriod=TT(()=>!this.isMissingPeriod()&&this.state.tokenDataPartial());navigateBack(){this.location.back();}formatTokenValue(t){return t===null?Ee:new $b("en-US").transform(t,"1.0-2")??"0"}formatCostValue(t,e){return t?Ee:"$"+(new $b("en-US").transform(e??0,"1.2-2")??"0.00")}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=jw({type:o,selectors:[["app-token-usage"]],decls:41,vars:8,consts:[[1,"page"],[1,"page__header"],[1,"page__title-block"],["mat-icon-button","","title","Back",3,"click"],[1,"page__title"],[1,"page__subtitle"],[1,"filters"],[1,"filters__field"],[1,"filters__label"],[1,"filters__control"],["type","date",1,"filters__input",3,"ngModelChange","ngModel"],["type","button",1,"filters__clear",3,"click","disabled"],[1,"filters__select",3,"ngModelChange","ngModel"],["value","byModel"],["value","byAgent"],["type","button",1,"filters__apply",3,"click","disabled"],[1,"card"],[1,"card","card--error"],[1,"grid"],[1,"kpis"],[1,"kpi"],[1,"kpi__label"],[1,"kpi__value"],["title","Some calls in this period were recorded before token tracking was enabled. Token counts reflect only the portion where data was collected.",1,"hint"],["title","No token usage data was collected for this period.",1,"hint"],[1,"muted"],[1,"card__title"],[1,"table"],[1,"table__head"],[1,"table__cell"],[1,"table__cell","table__cell--num"],[1,"table__body"],[1,"table__row"],[1,"table__row","table__row--total"],[3,"points"]],template:function(e,n){e&1&&(Cs(0,"section",0)(1,"header",1)(2,"div",2)(3,"button",3),kg("click",function(){return n.navigateBack()}),Cs(4,"mat-icon"),JC(5,"chevron_left"),hl()(),Cs(6,"div")(7,"h1",4),JC(8,"Token Usage"),hl(),Cs(9,"p",5),JC(10,"Track prompt and completion token usage by agent and model."),hl()()(),Cs(11,"div",6)(12,"label",7)(13,"span",8),JC(14,"From"),hl(),Cs(15,"div",9)(16,"input",10),kg("ngModelChange",function(d){return n.onFromChange(d)}),hl(),ZI(),Cs(17,"button",11),kg("click",function(){return n.clearFrom()}),JC(18," Clear "),hl()()(),Cs(19,"label",7)(20,"span",8),JC(21,"To"),hl(),Cs(22,"div",9)(23,"input",10),kg("ngModelChange",function(d){return n.onToChange(d)}),hl(),ZI(),Cs(24,"button",11),kg("click",function(){return n.clearTo()}),JC(25," Clear "),hl()()(),Cs(26,"label",7)(27,"span",8),JC(28,"View"),hl(),Cs(29,"select",12),kg("ngModelChange",function(d){return n.view.set(d)}),Cs(30,"option",13),JC(31,"By model"),hl(),Cs(32,"option",14),JC(33,"By agent"),hl()(),ZI(),hl(),Cs(34,"button",15),kg("click",function(){return n.apply()}),JC(35,"Apply"),hl()()(),aC(36,et,20,12),aC(37,tt,3,0,"div",16)(38,nt,5,1,"div",17)(39,ot,5,0,"div",16)(40,rt,30,2,"div",18),hl()),e&2&&(sI(16),_g("ngModel",n.state.draftFilters().from),QI(),sI(),_g("disabled",!n.state.draftFilters().from),sI(6),_g("ngModel",n.state.draftFilters().to),QI(),sI(),_g("disabled",!n.state.draftFilters().to),sI(5),_g("ngModel",n.view()),QI(),sI(5),_g("disabled",n.state.loading()),sI(2),cC(n.totalRow()?36:-1),sI(),cC(n.state.loading()?37:n.state.error()?38:n.isEmpty()?39:40));},dependencies:[ti,Qn,ei,Ye$1,At,Zn,cn,j,hr,Gn,yt,wt,K,Q],styles:[".page[_ngcontent-%COMP%]{padding:1.5rem;color:var(--color-text, #1d1d1f)}.page__header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:1.5rem;margin-bottom:1rem}.page__title-block[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.75rem}.page__title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:650}.page__subtitle[_ngcontent-%COMP%]{margin:.25rem 0 0;color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.95rem}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:flex-end;gap:.75rem}.filters__field[_ngcontent-%COMP%]{display:grid;gap:.25rem}.filters__label[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7))}.filters__control[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.filters__input[_ngcontent-%COMP%], .filters__select[_ngcontent-%COMP%]{height:34px;padding:0 .5rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:var(--color-bg-secondary, rgba(255, 255, 255, .72));color:var(--color-text, #1d1d1f)}.filters__apply[_ngcontent-%COMP%], .filters__clear[_ngcontent-%COMP%]{height:34px;padding:0 .75rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:var(--color-bg-secondary, rgba(255, 255, 255, .72));color:var(--color-text, #1d1d1f);cursor:pointer}.kpis[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem;margin:.75rem 0 1rem}@media(max-width:900px){.kpis[_ngcontent-%COMP%]{grid-template-columns:1fr}}.kpi[_ngcontent-%COMP%]{border-radius:14px;padding:.75rem 1rem;background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));box-shadow:var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, .08))}.kpi__label[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7))}.kpi__value[_ngcontent-%COMP%]{margin-top:.25rem;font-size:1.2rem;font-weight:650;font-variant-numeric:tabular-nums}.filters__apply[_ngcontent-%COMP%]{border-color:var(--color-primary, #007aff);background:var(--color-primary, #007aff);color:var(--color-text-inverse, #ffffff)}.filters__apply[_ngcontent-%COMP%]:disabled, .filters__clear[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1.5fr 1fr;gap:1rem;align-items:start}@media(max-width:1100px){.grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.card[_ngcontent-%COMP%]{border-radius:14px;padding:1rem;background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));box-shadow:var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, .08))}.card--error[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.card__title[_ngcontent-%COMP%]{font-weight:650;margin-bottom:.75rem}.muted[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7))}.table[_ngcontent-%COMP%]{overflow-x:auto}.table__head[_ngcontent-%COMP%], .table__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr 2fr 1fr 1fr 1fr .7fr 1fr;gap:.5rem;align-items:center}.table__head[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7));padding:.25rem 0;border-bottom:1px solid var(--color-border-light, rgba(0, 0, 0, .08))}.table__row[_ngcontent-%COMP%]{padding:.5rem 0;border-bottom:1px solid var(--color-border-light, rgba(0, 0, 0, .08))}.table__row--total[_ngcontent-%COMP%]{font-weight:650;background:var(--color-bg-hover, rgba(0, 0, 0, .03));border-radius:10px;padding:.6rem .5rem;border-bottom:none;margin-top:.5rem}.table__cell[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.table__cell--num[_ngcontent-%COMP%]{text-align:right;font-variant-numeric:tabular-nums}.hint[_ngcontent-%COMP%]{margin:.25rem 0 1rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.85rem}"],changeDetection:1})};export{Oe as TokenUsageComponent};
@@ -1 +1 @@
1
- import {c}from'./chunk-kUdwsgzt.js';import {g,ao as V,G,C as Ce$1,da as M,db as ye$1,dc as me$1,W as Wi,dd as Ae$1,F,bR as Sd,T as TT,$ as $y,b as U,a7 as va,I as br,z as z$1,a as P,j as jw,k as Cs,n as kg,J as JC,m as hl,o as aC,t as sI,a5 as Dl,u as cC,a9 as vC,M as Mg,a3 as ZI,q as dC,ac as CC,_ as _g,w as zg,a6 as QI,v as fC,a8 as Kg,aa as Cf,ab as Tf,bk as Dh}from'./main-P72KGKGP.js';import {o as z,k as _t,b as _e$1,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,f as fn,a as wt,A as At,Z as Zn,l as Xn,$ as $t,C as Cn,E as En}from'./chunk-BLF3w_iN.js';var A=(n,t)=>t.value,me=(n,t)=>t.id;function pe(n,t){n&1&&(Cs(0,"p",5),JC(1,"Loading\u2026"),hl());}function ue(n,t){n&1&&(Cs(0,"span",12),JC(1," Name is required. "),hl());}function fe(n,t){if(n&1&&(Cs(0,"p",42),JC(1),hl(),Cs(2,"span",13),JC(3,"Agent Config cannot be changed after creation."),hl()),n&2){let e=CC(2);sI(),Kg(e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function _e(n,t){if(n&1&&(Cs(0,"a",43),JC(1,"Add an agent config"),hl(),JC(2," first. ")),n&2){let e=CC(3);_g("href","/agentos/"+e.namespaceId+"/agent-configs/new",Dh);}}function he(n,t){if(n&1&&(Cs(0,"p",13),JC(1," No agent configs available in this scope yet. "),aC(2,_e,3,1),hl()),n&2){let e=CC(2);sI(2),cC(e.isPlatformMode?-1:2);}}function ge(n,t){if(n&1&&(Cs(0,"option",23),JC(1),hl()),n&2){let e=t.$implicit;_g("value",e.id),sI(),Kg(e.name);}}function Ce(n,t){n&1&&(Cs(0,"span",12),JC(1,"Agent Config is required."),hl());}function ve(n,t){if(n&1&&(Cs(0,"select",44)(1,"option",45),JC(2,"Select an agent config\u2026"),hl(),dC(3,ge,2,2,"option",23,me),hl(),ZI(),aC(5,Ce,2,0,"span",12),Cs(6,"span",13),JC(7,"Immutable after creation."),hl()),n&2){let e=CC(2);_g("formControl",e.agentConfigIdControl),QI(),sI(3),fC(e.availableAgentConfigs()),sI(2),cC(e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?5:-1);}}function xe(n,t){n&1&&(Cs(0,"span",12),JC(1,"Opening message is required."),hl());}function ye(n,t){if(n&1&&(Cs(0,"option",23),JC(1),hl()),n&2){let e=t.$implicit;_g("value",e.value),sI(),Kg(e.label);}}function be(n,t){if(n&1){let e=vC();Cs(0,"label",48)(1,"input",49),kg("change",function(){let g=Cf(e).$implicit,v=CC(3);return Tf(v.toggleDay(g.value))}),hl(),Cs(2,"span",50),JC(3),hl()();}if(n&2){let e=t.$implicit,d=CC(3);sI(),_g("checked",d.isDaySelected(e.value)),sI(2),Kg(e.label);}}function Se(n,t){if(n&1&&(Cs(0,"div",8)(1,"span",46),JC(2,"Days of week"),hl(),Cs(3,"div",47),dC(4,be,4,2,"label",48,A),hl(),Cs(6,"span",13),JC(7,"Leave empty to run every day of the week."),hl()()),n&2){let e=CC(2);sI(4),fC(e.dayOptions);}}function Ee(n,t){n&1&&(Cs(0,"span",12),JC(1,"Valid time is required (HH:mm)."),hl());}function Pe(n,t){n&1&&(Cs(0,"span",12),JC(1,"Start date is required."),hl());}function Me(n,t){if(n&1&&(Cs(0,"option",23),JC(1),hl()),n&2){let e=t.$implicit;_g("value",e.value),sI(),Kg(e.label);}}function Oe(n,t){n&1&&(Cs(0,"span",12),JC(1,"End date is required."),hl());}function De(n,t){if(n&1&&(Cs(0,"div",8)(1,"label",51),JC(2," End date "),Cs(3,"span",10),JC(4,"*"),hl()(),Mg(5,"input",52),ZI(),aC(6,Oe,2,0,"span",12),hl()),n&2){let e=CC(2);sI(5),zg("scheduled-prompt-form__input--invalid",e.form.hasError("endDateRequired")&&e.endDateControl.touched),_g("formControl",e.endDateControl),QI(),sI(),cC(e.form.hasError("endDateRequired")&&e.endDateControl.touched?6:-1);}}function Te(n,t){n&1&&(Cs(0,"span",12),JC(1,"Must be at least 1."),hl());}function we(n,t){if(n&1&&(Cs(0,"div",8)(1,"label",53),JC(2," Number of occurrences "),Cs(3,"span",10),JC(4,"*"),hl()(),Mg(5,"input",54),ZI(),aC(6,Te,2,0,"span",12),hl()),n&2){let e=CC(2);sI(5),zg("scheduled-prompt-form__input--invalid",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched),_g("formControl",e.occurrenceCountControl),QI(),sI(),cC(e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?6:-1);}}function ke(n,t){n&1&&(Cs(0,"span",12),JC(1,"Invalid JSON."),hl());}function Ne(n,t){if(n&1&&(Cs(0,"p",38),JC(1),hl()),n&2){let e=CC(2);sI(),Kg(e.errorMessage());}}function Fe(n,t){if(n&1){let e=vC();Cs(0,"form",7),kg("ngSubmit",function(){Cf(e);let g=CC();return Tf(g.submit())}),Cs(1,"div",8)(2,"label",9),JC(3," Name "),Cs(4,"span",10),JC(5,"*"),hl()(),Mg(6,"input",11),ZI(),aC(7,ue,2,0,"span",12),Cs(8,"span",13),JC(9,'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.'),hl()(),Cs(10,"div",8)(11,"label",14),JC(12,"Description"),hl(),Mg(13,"input",15),ZI(),hl(),Cs(14,"div",8)(15,"label",16),JC(16," Agent Config "),Cs(17,"span",10),JC(18,"*"),hl()(),aC(19,fe,4,1)(20,he,3,1,"p",13)(21,ve,8,2),hl(),Cs(22,"div",8)(23,"label",17),JC(24," Opening message "),Cs(25,"span",10),JC(26,"*"),hl()(),Mg(27,"textarea",18),ZI(),aC(28,xe,2,0,"span",12),Cs(29,"span",13),JC(30," The message sent to the agent when the scheduled prompt fires. "),hl()(),Cs(31,"fieldset",19)(32,"legend",20),JC(33,"Recurrence"),hl(),Cs(34,"div",8)(35,"label",21),JC(36," Unit "),Cs(37,"span",10),JC(38,"*"),hl()(),Cs(39,"select",22),dC(40,ye,2,2,"option",23,A),hl(),ZI(),hl(),aC(42,Se,8,0,"div",8),Cs(43,"div",8)(44,"label",24),JC(45," Time (UTC) "),Cs(46,"span",10),JC(47,"*"),hl()(),Cs(48,"div",25),Mg(49,"input",26),ZI(),Cs(50,"span",27),JC(51,"UTC"),hl()(),aC(52,Ee,2,0,"span",12),hl()(),Cs(53,"fieldset",19)(54,"legend",20),JC(55,"Planning"),hl(),Cs(56,"div",8)(57,"label",28),JC(58," Start date "),Cs(59,"span",10),JC(60,"*"),hl()(),Mg(61,"input",29),ZI(),aC(62,Pe,2,0,"span",12),hl(),Cs(63,"div",8)(64,"label",30),JC(65," Ends "),Cs(66,"span",10),JC(67,"*"),hl()(),Cs(68,"select",31),dC(69,Me,2,2,"option",23,A),hl(),ZI(),hl(),aC(71,De,7,4,"div",8),aC(72,we,7,4,"div",8),hl(),Cs(73,"div",8)(74,"label",32),Mg(75,"input",33),ZI(),Cs(76,"span",34),JC(77,"Enabled"),hl()(),Cs(78,"p",35),JC(79," When disabled, the scheduled prompt is saved but will not run on schedule. "),hl()(),Cs(80,"div",8)(81,"label",36),JC(82,"External Metadata"),hl(),Mg(83,"textarea",37),ZI(),aC(84,ke,2,0,"span",12),Cs(85,"span",13),JC(86,"Optional. Opaque JSON object stored as-is. Leave empty to clear."),hl()(),aC(87,Ne,2,1,"p",38),Cs(88,"div",39)(89,"button",40),JC(90),hl(),Cs(91,"button",41),kg("click",function(){Cf(e);let g=CC();return Tf(g.cancel())}),JC(92,"Cancel"),hl()()();}if(n&2){let e=CC();_g("formGroup",e.form),sI(6),zg("scheduled-prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),_g("formControl",e.nameControl),QI(),sI(),cC(e.nameControl.invalid&&e.nameControl.touched?7:-1),sI(6),_g("formControl",e.descriptionControl),QI(),sI(6),cC(e.isEditMode()?19:e.availableAgentConfigs().length===0?20:21),sI(8),zg("scheduled-prompt-form__textarea--invalid",e.promptContentControl.invalid&&e.promptContentControl.touched),_g("formControl",e.promptContentControl),QI(),sI(),cC(e.promptContentControl.invalid&&e.promptContentControl.touched?28:-1),sI(11),_g("formControl",e.unitControl),QI(),sI(),fC(e.schedulerUnits),sI(2),cC(e.showDayFilter()?42:-1),sI(7),_g("formControl",e.timeUtcControl),QI(),sI(3),cC(e.timeUtcControl.invalid&&e.timeUtcControl.touched?52:-1),sI(9),zg("scheduled-prompt-form__input--invalid",e.startDateControl.invalid&&e.startDateControl.touched),_g("formControl",e.startDateControl),QI(),sI(),cC(e.startDateControl.invalid&&e.startDateControl.touched?62:-1),sI(6),_g("formControl",e.endTypeControl),QI(),sI(),fC(e.endTypes),sI(2),cC(e.showEndDate()?71:-1),sI(),cC(e.showOccurrenceCount()?72:-1),sI(3),_g("formControl",e.enabledControl),QI(),sI(8),_g("formControl",e.externalMetadataJsonControl),QI(),sI(),cC(e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?84:-1),sI(3),cC(e.errorMessage()?87:-1),sI(2),_g("disabled",e.form.invalid||e.isSubmitting()),sI(),Dl(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var se=class n{route=g(V);router=g(G);destroyRef=g(Ce$1);state=g(c);agentConfigController=g(M);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new z({name:new _t("",{nonNullable:true,validators:[_e$1.required]}),description:new _t(null),agentConfigId:new _t("",{nonNullable:true,validators:[_e$1.required]}),promptContent:new _t("",{nonNullable:true,validators:[_e$1.required]}),unit:new _t(me$1.WEEK,{nonNullable:true,validators:[_e$1.required]}),days:new _t([],{nonNullable:true}),timeUtc:new _t("09:00",{nonNullable:true,validators:[_e$1.required,_e$1.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new _t("",{nonNullable:true,validators:[_e$1.required]}),endType:new _t(ye$1.NEVER,{nonNullable:true,validators:[_e$1.required]}),endDate:new _t(null),occurrenceCount:new _t(null),enabled:new _t(true,{nonNullable:true}),externalMetadataJson:new _t("",{nonNullable:true,validators:[Ae]})},{validators:[Ie,Ve]});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get promptContentControl(){return this.form.controls.promptContent}get unitControl(){return this.form.controls.unit}get daysControl(){return this.form.controls.days}get timeUtcControl(){return this.form.controls.timeUtc}get startDateControl(){return this.form.controls.startDate}get endTypeControl(){return this.form.controls.endType}get endDateControl(){return this.form.controls.endDate}get occurrenceCountControl(){return this.form.controls.occurrenceCount}get enabledControl(){return this.form.controls.enabled}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}isEditMode=Wi(false);isSubmitting=Wi(false);isLoading=Wi(false);errorMessage=Wi(null);SchedulerUnit=me$1;SchedulerEndType=ye$1;schedulerUnits=[{value:me$1.WEEK,label:"Week(s)"},{value:me$1.MONTH,label:"Month(s)"}];endTypes=[{value:ye$1.NEVER,label:"Never"},{value:ye$1.ON_DATE,label:"On date"},{value:ye$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(Ae$1).map(([t,e])=>({value:t,label:e}));unitSignal=F(this.unitControl.valueChanges.pipe(Sd(this.unitControl.value)));endTypeSignal=F(this.endTypeControl.valueChanges.pipe(Sd(this.endTypeControl.value)));showDayFilter=TT(()=>this.unitSignal()===me$1.WEEK);showEndDate=TT(()=>this.endTypeSignal()===ye$1.ON_DATE);showOccurrenceCount=TT(()=>this.endTypeSignal()===ye$1.OCCURRENCES);agentConfigs=Wi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Re());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(true),this.loadPromptAndResources(t)):this.loadResources();}loadPromptAndResources(t){this.isLoading.set(true),$y({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:d})=>{this.existingPrompt=e,this.agentConfigs.set(d),this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadResources(){this.agentConfigs$().pipe(U(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(va(()=>br([])))}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId),this.promptContentControl.setValue(t.promptContent),this.unitControl.setValue(t.recurrence.unit),this.daysControl.setValue(t.recurrence.days??[]),this.timeUtcControl.setValue(t.recurrence.timeUtc),this.startDateControl.setValue(t.planning.startDate),this.endTypeControl.setValue(t.planning.endType),this.endDateControl.setValue(t.planning.endDate??null),this.occurrenceCountControl.setValue(t.planning.maxOccurrenceCount??null),this.enabledControl.setValue(t.enabled),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,d=e.includes(t)?e.filter(g=>g!==t):[...e,t];this.daysControl.setValue(d);}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=this.endTypeControl.value,d=z$1(P({},this.existingPrompt??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,agentConfigId:t?this.existingPrompt.agentConfigId:this.agentConfigIdControl.value,promptContent:this.promptContentControl.value.trim(),recurrence:{unit:this.unitControl.value,days:this.daysControl.value,timeUtc:this.timeUtcControl.value},planning:{startDate:this.startDateControl.value,endType:e,endDate:e===ye$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===ye$1.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value,removed:this.existingPrompt?.removed??false,externalMetadata:(()=>{let v=this.externalMetadataJsonControl.value.trim();return v?JSON.parse(v):null})()});(t?this.state.update(this.existingPrompt.id,d):this.state.create(d)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:v=>{this.isSubmitting.set(false),v.status===409?this.errorMessage.set(`A scheduled prompt named "${d.name}" already exists in this scope.`):v.status===400?this.errorMessage.set(v.error?.message??"Invalid scheduled prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","scheduled-prompts"]):this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=jw({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:10,vars:3,consts:[[1,"scheduled-prompt-form"],[1,"scheduled-prompt-form__header"],["type","button","title","Back to scheduled prompts",1,"scheduled-prompt-form__back",3,"click"],[1,"scheduled-prompt-form__back-icon"],[1,"scheduled-prompt-form__title"],[1,"scheduled-prompt-form__loading"],[1,"scheduled-prompt-form__form",3,"formGroup"],[1,"scheduled-prompt-form__form",3,"ngSubmit","formGroup"],[1,"scheduled-prompt-form__field"],["for","sp-name",1,"scheduled-prompt-form__label"],["aria-hidden","true"],["id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],[1,"scheduled-prompt-form__field-error"],[1,"scheduled-prompt-form__field-hint"],["for","sp-description",1,"scheduled-prompt-form__label"],["id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-agent-config",1,"scheduled-prompt-form__label"],["for","sp-prompt-content",1,"scheduled-prompt-form__label"],["id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",1,"scheduled-prompt-form__textarea",3,"formControl"],[1,"scheduled-prompt-form__fieldset"],[1,"scheduled-prompt-form__legend"],["for","sp-unit",1,"scheduled-prompt-form__label"],["id","sp-unit",1,"scheduled-prompt-form__select",3,"formControl"],[3,"value"],["for","sp-time",1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__time-wrapper"],["id","sp-time","type","time",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--time",3,"formControl"],[1,"scheduled-prompt-form__utc-badge"],["for","sp-start-date",1,"scheduled-prompt-form__label"],["id","sp-start-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-end-type",1,"scheduled-prompt-form__label"],["id","sp-end-type",1,"scheduled-prompt-form__select",3,"formControl"],[1,"scheduled-prompt-form__toggle-label"],["type","checkbox",1,"scheduled-prompt-form__toggle-checkbox",3,"formControl"],[1,"scheduled-prompt-form__toggle-text"],[1,"scheduled-prompt-form__toggle-hint"],["for","sp-external-metadata",1,"scheduled-prompt-form__label"],["id","sp-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",1,"scheduled-prompt-form__textarea","scheduled-prompt-form__textarea--code",3,"formControl"],[1,"scheduled-prompt-form__error"],[1,"scheduled-prompt-form__actions"],["type","submit",1,"scheduled-prompt-form__btn","scheduled-prompt-form__btn--primary",3,"disabled"],["type","button",1,"scheduled-prompt-form__btn",3,"click"],[1,"scheduled-prompt-form__readonly-value"],[3,"href"],["id","sp-agent-config",1,"scheduled-prompt-form__select",3,"formControl"],["value","","disabled",""],[1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__day-grid"],[1,"scheduled-prompt-form__day-label"],["type","checkbox",1,"scheduled-prompt-form__day-checkbox",3,"change","checked"],[1,"scheduled-prompt-form__day-text"],["for","sp-end-date",1,"scheduled-prompt-form__label"],["id","sp-end-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-occurrence-count",1,"scheduled-prompt-form__label"],["id","sp-occurrence-count","type","number","min","1",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--number",3,"formControl"]],template:function(e,d){e&1&&(Cs(0,"div",0)(1,"header",1)(2,"button",2),kg("click",function(){return d.cancel()}),Cs(3,"span",3),JC(4,"\u2190"),hl(),JC(5),hl(),Cs(6,"h1",4),JC(7),hl()(),aC(8,pe,2,0,"p",5)(9,Fe,93,28,"form",6),hl()),e&2&&(sI(5),Dl(" ",d.isPlatformMode?"Platform Scheduled Prompts":"Scheduled Prompts"," "),sI(2),Dl(" ",d.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"," "),sI(),cC(d.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,fn,wt,At,Zn,Xn,$t,Cn,En],styles:[".scheduled-prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.scheduled-prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.scheduled-prompt-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.scheduled-prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.scheduled-prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.scheduled-prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.scheduled-prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.scheduled-prompt-form__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.scheduled-prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__input[_ngcontent-%COMP%], .scheduled-prompt-form__select[_ngcontent-%COMP%], .scheduled-prompt-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.scheduled-prompt-form__input[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__select[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.scheduled-prompt-form__input[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__select[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__select[_ngcontent-%COMP%]{cursor:pointer;appearance:auto}.scheduled-prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.scheduled-prompt-form__input--time[_ngcontent-%COMP%]{flex:1;min-width:0}.scheduled-prompt-form__input--number[_ngcontent-%COMP%]{max-width:120px}.scheduled-prompt-form__time-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.scheduled-prompt-form__utc-badge[_ngcontent-%COMP%]{flex-shrink:0;font-size:.75rem;font-weight:600;font-family:monospace;color:var(--color-text-secondary, #6e6e73);background:var(--color-surface, rgba(0, 0, 0, .05));padding:.25rem .5rem;border-radius:4px;text-transform:uppercase;letter-spacing:.06em}.scheduled-prompt-form__fieldset[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:8px;padding:1rem 1.25rem 1.25rem;margin:0;display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__legend[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--color-text-secondary, #6e6e73);padding:0 .375rem}.scheduled-prompt-form__day-grid[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}.scheduled-prompt-form__day-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__day-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__day-text[_ngcontent-%COMP%]{font-size:.875rem;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__hint[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30);margin:0}.scheduled-prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30)}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__readonly-value[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--color-surface, rgba(0, 0, 0, .03))}.scheduled-prompt-form__input--invalid[_ngcontent-%COMP%], .scheduled-prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.scheduled-prompt-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.scheduled-prompt-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"]})};function Ie(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===ye$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===ye$1.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function Ae(n){let t=n.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}function Re(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),d=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${d}`}export{se as ScheduledPromptFormComponent};
1
+ import {c}from'./chunk-DdUOdkVr.js';import {g,ao as V,G,C as Ce$1,da as M,db as Ae$1,dc as ye$1,W as Wi,dd as ve$1,F,bR as Sd,T as TT,$ as $y,b as U,a7 as va,I as br,z as z$1,a as P,j as jw,k as Cs,n as kg,J as JC,m as hl,o as aC,t as sI,a5 as Dl,u as cC,a9 as vC,M as Mg,a3 as ZI,q as dC,ac as CC,_ as _g,w as zg,a6 as QI,v as fC,a8 as Kg,aa as Cf,ab as Tf,bk as Dh}from'./main-RXIVNUWK.js';import {o as z,k as _t,b as _e$1,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,f as fn,a as wt,A as At,Z as Zn,l as Xn,$ as $t,C as Cn,E as En}from'./chunk-B3kY-GQk.js';var A=(n,t)=>t.value,me=(n,t)=>t.id;function pe(n,t){n&1&&(Cs(0,"p",5),JC(1,"Loading\u2026"),hl());}function ue(n,t){n&1&&(Cs(0,"span",12),JC(1," Name is required. "),hl());}function fe(n,t){if(n&1&&(Cs(0,"p",42),JC(1),hl(),Cs(2,"span",13),JC(3,"Agent Config cannot be changed after creation."),hl()),n&2){let e=CC(2);sI(),Kg(e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function _e(n,t){if(n&1&&(Cs(0,"a",43),JC(1,"Add an agent config"),hl(),JC(2," first. ")),n&2){let e=CC(3);_g("href","/agentos/"+e.namespaceId+"/agent-configs/new",Dh);}}function he(n,t){if(n&1&&(Cs(0,"p",13),JC(1," No agent configs available in this scope yet. "),aC(2,_e,3,1),hl()),n&2){let e=CC(2);sI(2),cC(e.isPlatformMode?-1:2);}}function ge(n,t){if(n&1&&(Cs(0,"option",23),JC(1),hl()),n&2){let e=t.$implicit;_g("value",e.id),sI(),Kg(e.name);}}function Ce(n,t){n&1&&(Cs(0,"span",12),JC(1,"Agent Config is required."),hl());}function ve(n,t){if(n&1&&(Cs(0,"select",44)(1,"option",45),JC(2,"Select an agent config\u2026"),hl(),dC(3,ge,2,2,"option",23,me),hl(),ZI(),aC(5,Ce,2,0,"span",12),Cs(6,"span",13),JC(7,"Immutable after creation."),hl()),n&2){let e=CC(2);_g("formControl",e.agentConfigIdControl),QI(),sI(3),fC(e.availableAgentConfigs()),sI(2),cC(e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?5:-1);}}function xe(n,t){n&1&&(Cs(0,"span",12),JC(1,"Opening message is required."),hl());}function ye(n,t){if(n&1&&(Cs(0,"option",23),JC(1),hl()),n&2){let e=t.$implicit;_g("value",e.value),sI(),Kg(e.label);}}function be(n,t){if(n&1){let e=vC();Cs(0,"label",48)(1,"input",49),kg("change",function(){let g=Cf(e).$implicit,v=CC(3);return Tf(v.toggleDay(g.value))}),hl(),Cs(2,"span",50),JC(3),hl()();}if(n&2){let e=t.$implicit,d=CC(3);sI(),_g("checked",d.isDaySelected(e.value)),sI(2),Kg(e.label);}}function Se(n,t){if(n&1&&(Cs(0,"div",8)(1,"span",46),JC(2,"Days of week"),hl(),Cs(3,"div",47),dC(4,be,4,2,"label",48,A),hl(),Cs(6,"span",13),JC(7,"Leave empty to run every day of the week."),hl()()),n&2){let e=CC(2);sI(4),fC(e.dayOptions);}}function Ee(n,t){n&1&&(Cs(0,"span",12),JC(1,"Valid time is required (HH:mm)."),hl());}function Pe(n,t){n&1&&(Cs(0,"span",12),JC(1,"Start date is required."),hl());}function Me(n,t){if(n&1&&(Cs(0,"option",23),JC(1),hl()),n&2){let e=t.$implicit;_g("value",e.value),sI(),Kg(e.label);}}function Oe(n,t){n&1&&(Cs(0,"span",12),JC(1,"End date is required."),hl());}function De(n,t){if(n&1&&(Cs(0,"div",8)(1,"label",51),JC(2," End date "),Cs(3,"span",10),JC(4,"*"),hl()(),Mg(5,"input",52),ZI(),aC(6,Oe,2,0,"span",12),hl()),n&2){let e=CC(2);sI(5),zg("scheduled-prompt-form__input--invalid",e.form.hasError("endDateRequired")&&e.endDateControl.touched),_g("formControl",e.endDateControl),QI(),sI(),cC(e.form.hasError("endDateRequired")&&e.endDateControl.touched?6:-1);}}function Te(n,t){n&1&&(Cs(0,"span",12),JC(1,"Must be at least 1."),hl());}function we(n,t){if(n&1&&(Cs(0,"div",8)(1,"label",53),JC(2," Number of occurrences "),Cs(3,"span",10),JC(4,"*"),hl()(),Mg(5,"input",54),ZI(),aC(6,Te,2,0,"span",12),hl()),n&2){let e=CC(2);sI(5),zg("scheduled-prompt-form__input--invalid",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched),_g("formControl",e.occurrenceCountControl),QI(),sI(),cC(e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?6:-1);}}function ke(n,t){n&1&&(Cs(0,"span",12),JC(1,"Invalid JSON."),hl());}function Ne(n,t){if(n&1&&(Cs(0,"p",38),JC(1),hl()),n&2){let e=CC(2);sI(),Kg(e.errorMessage());}}function Fe(n,t){if(n&1){let e=vC();Cs(0,"form",7),kg("ngSubmit",function(){Cf(e);let g=CC();return Tf(g.submit())}),Cs(1,"div",8)(2,"label",9),JC(3," Name "),Cs(4,"span",10),JC(5,"*"),hl()(),Mg(6,"input",11),ZI(),aC(7,ue,2,0,"span",12),Cs(8,"span",13),JC(9,'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.'),hl()(),Cs(10,"div",8)(11,"label",14),JC(12,"Description"),hl(),Mg(13,"input",15),ZI(),hl(),Cs(14,"div",8)(15,"label",16),JC(16," Agent Config "),Cs(17,"span",10),JC(18,"*"),hl()(),aC(19,fe,4,1)(20,he,3,1,"p",13)(21,ve,8,2),hl(),Cs(22,"div",8)(23,"label",17),JC(24," Opening message "),Cs(25,"span",10),JC(26,"*"),hl()(),Mg(27,"textarea",18),ZI(),aC(28,xe,2,0,"span",12),Cs(29,"span",13),JC(30," The message sent to the agent when the scheduled prompt fires. "),hl()(),Cs(31,"fieldset",19)(32,"legend",20),JC(33,"Recurrence"),hl(),Cs(34,"div",8)(35,"label",21),JC(36," Unit "),Cs(37,"span",10),JC(38,"*"),hl()(),Cs(39,"select",22),dC(40,ye,2,2,"option",23,A),hl(),ZI(),hl(),aC(42,Se,8,0,"div",8),Cs(43,"div",8)(44,"label",24),JC(45," Time (UTC) "),Cs(46,"span",10),JC(47,"*"),hl()(),Cs(48,"div",25),Mg(49,"input",26),ZI(),Cs(50,"span",27),JC(51,"UTC"),hl()(),aC(52,Ee,2,0,"span",12),hl()(),Cs(53,"fieldset",19)(54,"legend",20),JC(55,"Planning"),hl(),Cs(56,"div",8)(57,"label",28),JC(58," Start date "),Cs(59,"span",10),JC(60,"*"),hl()(),Mg(61,"input",29),ZI(),aC(62,Pe,2,0,"span",12),hl(),Cs(63,"div",8)(64,"label",30),JC(65," Ends "),Cs(66,"span",10),JC(67,"*"),hl()(),Cs(68,"select",31),dC(69,Me,2,2,"option",23,A),hl(),ZI(),hl(),aC(71,De,7,4,"div",8),aC(72,we,7,4,"div",8),hl(),Cs(73,"div",8)(74,"label",32),Mg(75,"input",33),ZI(),Cs(76,"span",34),JC(77,"Enabled"),hl()(),Cs(78,"p",35),JC(79," When disabled, the scheduled prompt is saved but will not run on schedule. "),hl()(),Cs(80,"div",8)(81,"label",36),JC(82,"External Metadata"),hl(),Mg(83,"textarea",37),ZI(),aC(84,ke,2,0,"span",12),Cs(85,"span",13),JC(86,"Optional. Opaque JSON object stored as-is. Leave empty to clear."),hl()(),aC(87,Ne,2,1,"p",38),Cs(88,"div",39)(89,"button",40),JC(90),hl(),Cs(91,"button",41),kg("click",function(){Cf(e);let g=CC();return Tf(g.cancel())}),JC(92,"Cancel"),hl()()();}if(n&2){let e=CC();_g("formGroup",e.form),sI(6),zg("scheduled-prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),_g("formControl",e.nameControl),QI(),sI(),cC(e.nameControl.invalid&&e.nameControl.touched?7:-1),sI(6),_g("formControl",e.descriptionControl),QI(),sI(6),cC(e.isEditMode()?19:e.availableAgentConfigs().length===0?20:21),sI(8),zg("scheduled-prompt-form__textarea--invalid",e.promptContentControl.invalid&&e.promptContentControl.touched),_g("formControl",e.promptContentControl),QI(),sI(),cC(e.promptContentControl.invalid&&e.promptContentControl.touched?28:-1),sI(11),_g("formControl",e.unitControl),QI(),sI(),fC(e.schedulerUnits),sI(2),cC(e.showDayFilter()?42:-1),sI(7),_g("formControl",e.timeUtcControl),QI(),sI(3),cC(e.timeUtcControl.invalid&&e.timeUtcControl.touched?52:-1),sI(9),zg("scheduled-prompt-form__input--invalid",e.startDateControl.invalid&&e.startDateControl.touched),_g("formControl",e.startDateControl),QI(),sI(),cC(e.startDateControl.invalid&&e.startDateControl.touched?62:-1),sI(6),_g("formControl",e.endTypeControl),QI(),sI(),fC(e.endTypes),sI(2),cC(e.showEndDate()?71:-1),sI(),cC(e.showOccurrenceCount()?72:-1),sI(3),_g("formControl",e.enabledControl),QI(),sI(8),_g("formControl",e.externalMetadataJsonControl),QI(),sI(),cC(e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?84:-1),sI(3),cC(e.errorMessage()?87:-1),sI(2),_g("disabled",e.form.invalid||e.isSubmitting()),sI(),Dl(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var se=class n{route=g(V);router=g(G);destroyRef=g(Ce$1);state=g(c);agentConfigController=g(M);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new z({name:new _t("",{nonNullable:true,validators:[_e$1.required]}),description:new _t(null),agentConfigId:new _t("",{nonNullable:true,validators:[_e$1.required]}),promptContent:new _t("",{nonNullable:true,validators:[_e$1.required]}),unit:new _t(ye$1.WEEK,{nonNullable:true,validators:[_e$1.required]}),days:new _t([],{nonNullable:true}),timeUtc:new _t("09:00",{nonNullable:true,validators:[_e$1.required,_e$1.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new _t("",{nonNullable:true,validators:[_e$1.required]}),endType:new _t(Ae$1.NEVER,{nonNullable:true,validators:[_e$1.required]}),endDate:new _t(null),occurrenceCount:new _t(null),enabled:new _t(true,{nonNullable:true}),externalMetadataJson:new _t("",{nonNullable:true,validators:[Ae]})},{validators:[Ie,Ve]});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get promptContentControl(){return this.form.controls.promptContent}get unitControl(){return this.form.controls.unit}get daysControl(){return this.form.controls.days}get timeUtcControl(){return this.form.controls.timeUtc}get startDateControl(){return this.form.controls.startDate}get endTypeControl(){return this.form.controls.endType}get endDateControl(){return this.form.controls.endDate}get occurrenceCountControl(){return this.form.controls.occurrenceCount}get enabledControl(){return this.form.controls.enabled}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}isEditMode=Wi(false);isSubmitting=Wi(false);isLoading=Wi(false);errorMessage=Wi(null);SchedulerUnit=ye$1;SchedulerEndType=Ae$1;schedulerUnits=[{value:ye$1.WEEK,label:"Week(s)"},{value:ye$1.MONTH,label:"Month(s)"}];endTypes=[{value:Ae$1.NEVER,label:"Never"},{value:Ae$1.ON_DATE,label:"On date"},{value:Ae$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(ve$1).map(([t,e])=>({value:t,label:e}));unitSignal=F(this.unitControl.valueChanges.pipe(Sd(this.unitControl.value)));endTypeSignal=F(this.endTypeControl.valueChanges.pipe(Sd(this.endTypeControl.value)));showDayFilter=TT(()=>this.unitSignal()===ye$1.WEEK);showEndDate=TT(()=>this.endTypeSignal()===Ae$1.ON_DATE);showOccurrenceCount=TT(()=>this.endTypeSignal()===Ae$1.OCCURRENCES);agentConfigs=Wi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Re());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(true),this.loadPromptAndResources(t)):this.loadResources();}loadPromptAndResources(t){this.isLoading.set(true),$y({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:d})=>{this.existingPrompt=e,this.agentConfigs.set(d),this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadResources(){this.agentConfigs$().pipe(U(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(va(()=>br([])))}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId),this.promptContentControl.setValue(t.promptContent),this.unitControl.setValue(t.recurrence.unit),this.daysControl.setValue(t.recurrence.days??[]),this.timeUtcControl.setValue(t.recurrence.timeUtc),this.startDateControl.setValue(t.planning.startDate),this.endTypeControl.setValue(t.planning.endType),this.endDateControl.setValue(t.planning.endDate??null),this.occurrenceCountControl.setValue(t.planning.maxOccurrenceCount??null),this.enabledControl.setValue(t.enabled),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,d=e.includes(t)?e.filter(g=>g!==t):[...e,t];this.daysControl.setValue(d);}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=this.endTypeControl.value,d=z$1(P({},this.existingPrompt??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,agentConfigId:t?this.existingPrompt.agentConfigId:this.agentConfigIdControl.value,promptContent:this.promptContentControl.value.trim(),recurrence:{unit:this.unitControl.value,days:this.daysControl.value,timeUtc:this.timeUtcControl.value},planning:{startDate:this.startDateControl.value,endType:e,endDate:e===Ae$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===Ae$1.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value,removed:this.existingPrompt?.removed??false,externalMetadata:(()=>{let v=this.externalMetadataJsonControl.value.trim();return v?JSON.parse(v):null})()});(t?this.state.update(this.existingPrompt.id,d):this.state.create(d)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:v=>{this.isSubmitting.set(false),v.status===409?this.errorMessage.set(`A scheduled prompt named "${d.name}" already exists in this scope.`):v.status===400?this.errorMessage.set(v.error?.message??"Invalid scheduled prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","scheduled-prompts"]):this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=jw({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:10,vars:3,consts:[[1,"scheduled-prompt-form"],[1,"scheduled-prompt-form__header"],["type","button","title","Back to scheduled prompts",1,"scheduled-prompt-form__back",3,"click"],[1,"scheduled-prompt-form__back-icon"],[1,"scheduled-prompt-form__title"],[1,"scheduled-prompt-form__loading"],[1,"scheduled-prompt-form__form",3,"formGroup"],[1,"scheduled-prompt-form__form",3,"ngSubmit","formGroup"],[1,"scheduled-prompt-form__field"],["for","sp-name",1,"scheduled-prompt-form__label"],["aria-hidden","true"],["id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],[1,"scheduled-prompt-form__field-error"],[1,"scheduled-prompt-form__field-hint"],["for","sp-description",1,"scheduled-prompt-form__label"],["id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-agent-config",1,"scheduled-prompt-form__label"],["for","sp-prompt-content",1,"scheduled-prompt-form__label"],["id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",1,"scheduled-prompt-form__textarea",3,"formControl"],[1,"scheduled-prompt-form__fieldset"],[1,"scheduled-prompt-form__legend"],["for","sp-unit",1,"scheduled-prompt-form__label"],["id","sp-unit",1,"scheduled-prompt-form__select",3,"formControl"],[3,"value"],["for","sp-time",1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__time-wrapper"],["id","sp-time","type","time",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--time",3,"formControl"],[1,"scheduled-prompt-form__utc-badge"],["for","sp-start-date",1,"scheduled-prompt-form__label"],["id","sp-start-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-end-type",1,"scheduled-prompt-form__label"],["id","sp-end-type",1,"scheduled-prompt-form__select",3,"formControl"],[1,"scheduled-prompt-form__toggle-label"],["type","checkbox",1,"scheduled-prompt-form__toggle-checkbox",3,"formControl"],[1,"scheduled-prompt-form__toggle-text"],[1,"scheduled-prompt-form__toggle-hint"],["for","sp-external-metadata",1,"scheduled-prompt-form__label"],["id","sp-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",1,"scheduled-prompt-form__textarea","scheduled-prompt-form__textarea--code",3,"formControl"],[1,"scheduled-prompt-form__error"],[1,"scheduled-prompt-form__actions"],["type","submit",1,"scheduled-prompt-form__btn","scheduled-prompt-form__btn--primary",3,"disabled"],["type","button",1,"scheduled-prompt-form__btn",3,"click"],[1,"scheduled-prompt-form__readonly-value"],[3,"href"],["id","sp-agent-config",1,"scheduled-prompt-form__select",3,"formControl"],["value","","disabled",""],[1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__day-grid"],[1,"scheduled-prompt-form__day-label"],["type","checkbox",1,"scheduled-prompt-form__day-checkbox",3,"change","checked"],[1,"scheduled-prompt-form__day-text"],["for","sp-end-date",1,"scheduled-prompt-form__label"],["id","sp-end-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-occurrence-count",1,"scheduled-prompt-form__label"],["id","sp-occurrence-count","type","number","min","1",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--number",3,"formControl"]],template:function(e,d){e&1&&(Cs(0,"div",0)(1,"header",1)(2,"button",2),kg("click",function(){return d.cancel()}),Cs(3,"span",3),JC(4,"\u2190"),hl(),JC(5),hl(),Cs(6,"h1",4),JC(7),hl()(),aC(8,pe,2,0,"p",5)(9,Fe,93,28,"form",6),hl()),e&2&&(sI(5),Dl(" ",d.isPlatformMode?"Platform Scheduled Prompts":"Scheduled Prompts"," "),sI(2),Dl(" ",d.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"," "),sI(),cC(d.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,fn,wt,At,Zn,Xn,$t,Cn,En],styles:[".scheduled-prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.scheduled-prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.scheduled-prompt-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.scheduled-prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.scheduled-prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.scheduled-prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.scheduled-prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.scheduled-prompt-form__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.scheduled-prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__input[_ngcontent-%COMP%], .scheduled-prompt-form__select[_ngcontent-%COMP%], .scheduled-prompt-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.scheduled-prompt-form__input[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__select[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.scheduled-prompt-form__input[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__select[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__select[_ngcontent-%COMP%]{cursor:pointer;appearance:auto}.scheduled-prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.scheduled-prompt-form__input--time[_ngcontent-%COMP%]{flex:1;min-width:0}.scheduled-prompt-form__input--number[_ngcontent-%COMP%]{max-width:120px}.scheduled-prompt-form__time-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.scheduled-prompt-form__utc-badge[_ngcontent-%COMP%]{flex-shrink:0;font-size:.75rem;font-weight:600;font-family:monospace;color:var(--color-text-secondary, #6e6e73);background:var(--color-surface, rgba(0, 0, 0, .05));padding:.25rem .5rem;border-radius:4px;text-transform:uppercase;letter-spacing:.06em}.scheduled-prompt-form__fieldset[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:8px;padding:1rem 1.25rem 1.25rem;margin:0;display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__legend[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--color-text-secondary, #6e6e73);padding:0 .375rem}.scheduled-prompt-form__day-grid[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}.scheduled-prompt-form__day-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__day-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__day-text[_ngcontent-%COMP%]{font-size:.875rem;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__hint[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30);margin:0}.scheduled-prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30)}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__readonly-value[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--color-surface, rgba(0, 0, 0, .03))}.scheduled-prompt-form__input--invalid[_ngcontent-%COMP%], .scheduled-prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.scheduled-prompt-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.scheduled-prompt-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"]})};function Ie(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===Ae$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===Ae$1.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function Ae(n){let t=n.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}function Re(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),d=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${d}`}export{se as ScheduledPromptFormComponent};
@@ -1 +1 @@
1
- import {z}from'./chunk-Dwp6OoVJ.js';import {s}from'./chunk-afcQqtlz.js';import {g as g$1,G,P,R as Re,C as Ce,F,T as TT,z as z$1,a as P$1,ae as kt,b as U,j as jw,i as Gn,s as si,k as Cs,n as kg,M as Mg,m as hl,af as wg,ag as ET,A as AC,t as sI,_ as _g,a9 as vC,aa as Cf,ac as CC,ab as Tf,J as JC,ah as dT}from'./main-P72KGKGP.js';import'./chunk-CtVgyQBm.js';import {W as Wn,o as ot}from'./chunk-CYOKxOkd.js';import'./chunk-DAxRjiEx.js';import {y as yt,w as wt}from'./chunk-BLF3w_iN.js';var ee=()=>[];function te(u,t){if(u&1){let o=vC();Cs(0,"div",5)(1,"ds-entity-card",6),kg("selected",function(r){Cf(o);let i=CC();return Tf(i.onItemSelected(r))}),hl(),Cs(2,"button",7),kg("click",function(r){let i=Cf(o).$implicit,f=CC();return r.stopPropagation(),Tf(f.onDeleteRequested(i.id))}),Cs(3,"mat-icon"),JC(4,"close"),hl()()();}if(u&2){let o=t.$implicit;sI(),_g("id",o.id)("name",o.name)("description",o.description)("badges",o.badges??dT(4,ee));}}var g="__",Y=class u{router=g$1(G);projectStateService=g$1(P);dialog=g$1(Re);destroyRef=g$1(Ce);notification=g$1(s);projects=F(this.projectStateService.projectList$);forcedProject=F(this.projectStateService.forcedProject$,{initialValue:null});isLoading=F(this.projectStateService.isLoading$,{initialValue:false});projectItems=TT(()=>{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=TT(()=>!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(kt(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=jw({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&&(Cs(0,"div",1)(1,"ds-entity-list",2),kg("itemSelected",function(i){return n.onItemSelected(i)})("createRequested",function(){return n.onCreateRequested()}),Cs(2,"a",3),Mg(3,"img",4),hl()()(),wg(4,te,5,5,"ng-template",null,0,ET)),o&2){let r=AC(5);sI(),_g("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-CMHnK5hV.js';import {s}from'./chunk-COoOJuQT.js';import {g as g$1,G,P,R as Re,C as Ce,F,T as TT,z as z$1,a as P$1,ae as kt,b as U,j as jw,i as Gn,s as si,k as Cs,n as kg,M as Mg,m as hl,af as wg,ag as ET,A as AC,t as sI,_ as _g,a9 as vC,aa as Cf,ac as CC,ab as Tf,J as JC,ah as dT}from'./main-RXIVNUWK.js';import'./chunk-CJD8ErVH.js';import {W as Wn,o as ot}from'./chunk-CaL6ZXsO.js';import'./chunk-CqZF9JZo.js';import {y as yt,w as wt}from'./chunk-B3kY-GQk.js';var ee=()=>[];function te(u,t){if(u&1){let o=vC();Cs(0,"div",5)(1,"ds-entity-card",6),kg("selected",function(r){Cf(o);let i=CC();return Tf(i.onItemSelected(r))}),hl(),Cs(2,"button",7),kg("click",function(r){let i=Cf(o).$implicit,f=CC();return r.stopPropagation(),Tf(f.onDeleteRequested(i.id))}),Cs(3,"mat-icon"),JC(4,"close"),hl()()();}if(u&2){let o=t.$implicit;sI(),_g("id",o.id)("name",o.name)("description",o.description)("badges",o.badges??dT(4,ee));}}var g="__",Y=class u{router=g$1(G);projectStateService=g$1(P);dialog=g$1(Re);destroyRef=g$1(Ce);notification=g$1(s);projects=F(this.projectStateService.projectList$);forcedProject=F(this.projectStateService.forcedProject$,{initialValue:null});isLoading=F(this.projectStateService.isLoading$,{initialValue:false});projectItems=TT(()=>{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=TT(()=>!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(kt(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=jw({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&&(Cs(0,"div",1)(1,"ds-entity-list",2),kg("itemSelected",function(i){return n.onItemSelected(i)})("createRequested",function(){return n.onCreateRequested()}),Cs(2,"a",3),Mg(3,"img",4),hl()()(),wg(4,te,5,5,"ng-template",null,0,ET)),o&2){let r=AC(5);sI(),_g("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 {g,G,cb as JB,cc as XB,W as Wi,j as jw,k as Cs,J as JC,m as hl,o as aC,t as sI,a8 as Kg,u as cC,ac as CC,a9 as vC,n as kg,_ as _g,aa as Cf,ab as Tf}from'./main-P72KGKGP.js';import {K as Kn,Z as Zn,S as Se}from'./chunk-CYOKxOkd.js';function P(n,o){if(n&1&&(Cs(0,"span",3),JC(1),hl()),n&2){let e=CC();sI(),Kg(e.config().modelName);}}function k(n,o){if(n&1&&(Cs(0,"span",4),JC(1),hl()),n&2){let e=CC();sI(),Kg(e.config().description);}}function S(n,o){if(n&1){let e=vC();Cs(0,"span",7),JC(1,"Delete?"),hl(),Cs(2,"ds-icon-button",8),kg("action",function(){Cf(e);let l=CC();return Tf(l.onDeleteConfirmed())}),hl(),Cs(3,"ds-icon-button",9),kg("action",function(){Cf(e);let l=CC();return Tf(l.onDeleteCancelled())}),hl();}}function E(n,o){if(n&1){let e=vC();Cs(0,"ds-kebab-menu",10),kg("itemSelected",function(l){Cf(e);let A=CC();return Tf(A.onMenuAction(l))}),hl();}if(n&2){let e=CC();_g("items",e.readOnly()?e.readOnlyMenuItems:e.menuItems);}}var O=class n{router=g(G);config=JB.required();namespaceId=JB(void 0);platformMode=JB(false);readOnly=JB(false);deleteRequested=XB();pendingDelete=Wi(false);menuItems=[{key:"edit",label:"Edit agent config",icon:"edit"},{key:"inspect",label:"Inspect definition",icon:"search"},{key:"delete",label:"Delete agent config",icon:"delete",variant:"danger"}];readOnlyMenuItems=[{key:"inspect",label:"Inspect definition",icon:"search"}];onMenuAction(o){switch(o){case "edit":this.platformMode()?this.router.navigate(["/agentos","admin","agent-configs",this.config().id,"edit"]):this.router.navigate(["/agentos",this.namespaceId(),"agent-configs",this.config().id,"edit"]);break;case "inspect":this.platformMode()?this.router.navigate(["/agentos","admin","agent-configs",this.config().id,"inspect"]):this.router.navigate(["/agentos",this.namespaceId(),"agent-configs",this.config().id,"inspect"]);break;case "delete":this.pendingDelete.set(true);break}}onDeleteConfirmed(){this.pendingDelete.set(false),this.deleteRequested.emit(this.config());}onDeleteCancelled(){this.pendingDelete.set(false);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=jw({type:n,selectors:[["agentos-agent-config-item"]],inputs:{config:[1,"config"],namespaceId:[1,"namespaceId"],platformMode:[1,"platformMode"],readOnly:[1,"readOnly"]},outputs:{deleteRequested:"deleteRequested"},decls:9,vars:4,consts:[["role","listitem","dsBlueprint","",1,"agent-config-item"],[1,"agent-config-item__body"],[1,"agent-config-item__name"],[1,"agent-config-item__model"],[1,"agent-config-item__description"],[1,"agent-config-item__actions"],[3,"items"],[1,"agent-config-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,a){e&1&&(Cs(0,"div",0)(1,"div",1)(2,"span",2),JC(3),hl(),aC(4,P,2,1,"span",3),aC(5,k,2,1,"span",4),hl(),Cs(6,"div",5),aC(7,S,4,0)(8,E,1,1,"ds-kebab-menu",6),hl()()),e&2&&(sI(3),Kg(a.config().name),sI(),cC(a.config().modelName?4:-1),sI(),cC(a.config().description?5:-1),sI(2),cC(a.pendingDelete()?7:8));},dependencies:[Kn,Zn,Se],styles:[".agent-config-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:14px 16px;position:relative;border-radius:0;border:1px solid var(--color-divider);background:var(--color-bg);box-shadow:var(--shadow-sm);overflow:visible;transition:border-color .15s ease}.agent-config-item[_ngcontent-%COMP%]:hover{border-color:var(--color-accent)}.agent-config-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.agent-config-item__name[_ngcontent-%COMP%]{font-size:15px;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-config-item__model[_ngcontent-%COMP%], .agent-config-item__description[_ngcontent-%COMP%]{font-size:13px;color:var(--color-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-config-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.agent-config-item[_ngcontent-%COMP%]:hover .agent-config-item__actions[_ngcontent-%COMP%], .agent-config-item[_ngcontent-%COMP%]:focus-within .agent-config-item__actions[_ngcontent-%COMP%]{opacity:1}.agent-config-item[_ngcontent-%COMP%]:has(.agent-config-item__confirm-label) .agent-config-item__actions[_ngcontent-%COMP%]{opacity:1}.agent-config-item__confirm-label[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--red-deep);margin-right:.25rem;white-space:nowrap}"]})};export{O};
1
+ import {g,G,cb as JB,cc as XB,W as Wi,j as jw,k as Cs,J as JC,m as hl,o as aC,t as sI,a8 as Kg,u as cC,ac as CC,a9 as vC,n as kg,_ as _g,aa as Cf,ab as Tf}from'./main-RXIVNUWK.js';import {K as Kn,Z as Zn,S as Se}from'./chunk-CaL6ZXsO.js';function P(n,o){if(n&1&&(Cs(0,"span",3),JC(1),hl()),n&2){let e=CC();sI(),Kg(e.config().modelName);}}function k(n,o){if(n&1&&(Cs(0,"span",4),JC(1),hl()),n&2){let e=CC();sI(),Kg(e.config().description);}}function S(n,o){if(n&1){let e=vC();Cs(0,"span",7),JC(1,"Delete?"),hl(),Cs(2,"ds-icon-button",8),kg("action",function(){Cf(e);let l=CC();return Tf(l.onDeleteConfirmed())}),hl(),Cs(3,"ds-icon-button",9),kg("action",function(){Cf(e);let l=CC();return Tf(l.onDeleteCancelled())}),hl();}}function E(n,o){if(n&1){let e=vC();Cs(0,"ds-kebab-menu",10),kg("itemSelected",function(l){Cf(e);let A=CC();return Tf(A.onMenuAction(l))}),hl();}if(n&2){let e=CC();_g("items",e.readOnly()?e.readOnlyMenuItems:e.menuItems);}}var O=class n{router=g(G);config=JB.required();namespaceId=JB(void 0);platformMode=JB(false);readOnly=JB(false);deleteRequested=XB();pendingDelete=Wi(false);menuItems=[{key:"edit",label:"Edit agent config",icon:"edit"},{key:"inspect",label:"Inspect definition",icon:"search"},{key:"delete",label:"Delete agent config",icon:"delete",variant:"danger"}];readOnlyMenuItems=[{key:"inspect",label:"Inspect definition",icon:"search"}];onMenuAction(o){switch(o){case "edit":this.platformMode()?this.router.navigate(["/agentos","admin","agent-configs",this.config().id,"edit"]):this.router.navigate(["/agentos",this.namespaceId(),"agent-configs",this.config().id,"edit"]);break;case "inspect":this.platformMode()?this.router.navigate(["/agentos","admin","agent-configs",this.config().id,"inspect"]):this.router.navigate(["/agentos",this.namespaceId(),"agent-configs",this.config().id,"inspect"]);break;case "delete":this.pendingDelete.set(true);break}}onDeleteConfirmed(){this.pendingDelete.set(false),this.deleteRequested.emit(this.config());}onDeleteCancelled(){this.pendingDelete.set(false);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=jw({type:n,selectors:[["agentos-agent-config-item"]],inputs:{config:[1,"config"],namespaceId:[1,"namespaceId"],platformMode:[1,"platformMode"],readOnly:[1,"readOnly"]},outputs:{deleteRequested:"deleteRequested"},decls:9,vars:4,consts:[["role","listitem","dsBlueprint","",1,"agent-config-item"],[1,"agent-config-item__body"],[1,"agent-config-item__name"],[1,"agent-config-item__model"],[1,"agent-config-item__description"],[1,"agent-config-item__actions"],[3,"items"],[1,"agent-config-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,a){e&1&&(Cs(0,"div",0)(1,"div",1)(2,"span",2),JC(3),hl(),aC(4,P,2,1,"span",3),aC(5,k,2,1,"span",4),hl(),Cs(6,"div",5),aC(7,S,4,0)(8,E,1,1,"ds-kebab-menu",6),hl()()),e&2&&(sI(3),Kg(a.config().name),sI(),cC(a.config().modelName?4:-1),sI(),cC(a.config().description?5:-1),sI(2),cC(a.pendingDelete()?7:8));},dependencies:[Kn,Zn,Se],styles:[".agent-config-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:14px 16px;position:relative;border-radius:0;border:1px solid var(--color-divider);background:var(--color-bg);box-shadow:var(--shadow-sm);overflow:visible;transition:border-color .15s ease}.agent-config-item[_ngcontent-%COMP%]:hover{border-color:var(--color-accent)}.agent-config-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.agent-config-item__name[_ngcontent-%COMP%]{font-size:15px;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-config-item__model[_ngcontent-%COMP%], .agent-config-item__description[_ngcontent-%COMP%]{font-size:13px;color:var(--color-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-config-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.agent-config-item[_ngcontent-%COMP%]:hover .agent-config-item__actions[_ngcontent-%COMP%], .agent-config-item[_ngcontent-%COMP%]:focus-within .agent-config-item__actions[_ngcontent-%COMP%]{opacity:1}.agent-config-item[_ngcontent-%COMP%]:has(.agent-config-item__confirm-label) .agent-config-item__actions[_ngcontent-%COMP%]{opacity:1}.agent-config-item__confirm-label[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--red-deep);margin-right:.25rem;white-space:nowrap}"]})};export{O};
@@ -1,4 +1,4 @@
1
- import {an as ue,g,L,ci as me,ap as zy,av as dt$1,j as jw,k as Cs,J as JC,m as hl,ai as rm,aj as iT,n as kg,a3 as ZI,M as Mg,o as aC,q as dC,t as sI,ak as nm,a6 as QI,_ as _g,u as cC,v as fC,a5 as Dl,aL as wo,aM as Zn$1,aO as wt$1,az as Xt,aW as C,cj as Pn,ce as kb,c8 as ob,af as wg,ag as ET,c9 as Pf,ck as Lf,ch as Ag,A as AC,S as Sg,ad as $g,b$ as UC,w as zg,x as jg,y as MC,N as NC,aJ as Tr,aG as fe,cl as be,p as pe,l as le,bU as Fd,b9 as T,b8 as B,be as A,b7 as u,bd as h,cm as M,d as O,ba as v,bb as m,c as b,cn as F,f,V,bc as R,co as H,cp as K,ca as _e,K as x,X as z$1,Y as Ue,am as Ym,i as Gn,e as pr,a0 as jt,a2 as Nt,a1 as Vt,b0 as Xg,ac as CC}from'./main-P72KGKGP.js';import {s as se}from'./chunk-B1VIKLB-.js';import {t as ti,Q as Qn,e as ei,Y as Ye$1,h as _n,A as At,m as mn,Z as Zn,c as cn,w as wt}from'./chunk-BLF3w_iN.js';var Xe=["determinateSpinner"];function et(c,e){if(c&1&&(Pf(),Cs(0,"svg",11),Mg(1,"circle",12),hl()),c&2){let t=CC();Sg("viewBox",t._viewBox()),sI(),$g("stroke-dasharray",t._strokeCircumference(),"px")("stroke-dashoffset",t._strokeCircumference()/2,"px")("stroke-width",t._circleStrokeWidth(),"%"),Sg("r",t._circleRadius());}}var tt=new C("mat-progress-spinner-default-options",{providedIn:"root",factory:()=>({diameter:qe})}),qe=100,nt=10,yt=(()=>{class c{_elementRef=g(Xt);_noopAnimations;get color(){return this._color||this._defaultColor}set color(t){this._color=t;}_color;_defaultColor="primary";_determinateCircle;constructor(){let t=g(tt),n=Pn(),i=this._elementRef.nativeElement;this._noopAnimations=n==="di-disabled"&&!!t&&!t._forceAnimations,this.mode=i.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",!this._noopAnimations&&n==="reduced-motion"&&i.classList.add("mat-progress-spinner-reduced-motion"),t&&(t.color&&(this.color=this._defaultColor=t.color),t.diameter&&(this.diameter=t.diameter),t.strokeWidth&&(this.strokeWidth=t.strokeWidth));}mode;get value(){return this.mode==="determinate"?this._value:0}set value(t){this._value=Math.max(0,Math.min(100,t||0));}_value=0;get diameter(){return this._diameter}set diameter(t){this._diameter=t||0;}_diameter=qe;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(t){this._strokeWidth=t||0;}_strokeWidth;_circleRadius(){return (this.diameter-nt)/2}_viewBox(){let t=this._circleRadius()*2+this.strokeWidth;return `0 0 ${t} ${t}`}_strokeCircumference(){return 2*Math.PI*this._circleRadius()}_strokeDashOffset(){return this.mode==="determinate"?this._strokeCircumference()*(100-this._value)/100:null}_circleStrokeWidth(){return this.strokeWidth/this.diameter*100}static \u0275fac=function(n){return new(n||c)};static \u0275cmp=jw({type:c,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(n,i){if(n&1&&jg(Xe,5),n&2){let o;MC(o=NC())&&(i._determinateCircle=o.first);}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(n,i){n&2&&(Sg("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",i.mode==="determinate"?i.value:null)("mode",i.mode),UC("mat-"+i.color),$g("width",i.diameter,"px")("height",i.diameter,"px")("--mat-progress-spinner-size",i.diameter+"px")("--mat-progress-spinner-active-indicator-width",i.diameter+"px"),zg("_mat-animation-noopable",i._noopAnimations)("mdc-circular-progress--indeterminate",i.mode==="indeterminate"));},inputs:{color:"color",mode:"mode",value:[2,"value","value",ob],diameter:[2,"diameter","diameter",ob],strokeWidth:[2,"strokeWidth","strokeWidth",ob]},exportAs:["matProgressSpinner"],decls:14,vars:11,consts:[["circle",""],["determinateSpinner",""],["aria-hidden","true",1,"mdc-circular-progress__determinate-container"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__determinate-circle-graphic"],["cx","50%","cy","50%",1,"mdc-circular-progress__determinate-circle"],["aria-hidden","true",1,"mdc-circular-progress__indeterminate-container"],[1,"mdc-circular-progress__spinner-layer"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-left"],[3,"ngTemplateOutlet"],[1,"mdc-circular-progress__gap-patch"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-right"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__indeterminate-circle-graphic"],["cx","50%","cy","50%"]],template:function(n,i){if(n&1&&(wg(0,et,2,8,"ng-template",null,0,ET),Cs(2,"div",2,1),Pf(),Cs(4,"svg",3),Mg(5,"circle",4),hl()(),Lf(),Cs(6,"div",5)(7,"div",6)(8,"div",7),Ag(9,8),hl(),Cs(10,"div",9),Ag(11,8),hl(),Cs(12,"div",10),Ag(13,8),hl()()()),n&2){let o=AC(1);sI(4),Sg("viewBox",i._viewBox()),sI(),$g("stroke-dasharray",i._strokeCircumference(),"px")("stroke-dashoffset",i._strokeDashOffset(),"px")("stroke-width",i._circleStrokeWidth(),"%"),Sg("r",i._circleRadius()),sI(4),_g("ngTemplateOutlet",o),sI(2),_g("ngTemplateOutlet",o),sI(2),_g("ngTemplateOutlet",o);}},dependencies:[kb],styles:[`.mat-mdc-progress-spinner {
1
+ import {an as ue,g,L,ci as me,ap as zy,av as dt$1,j as jw,k as Cs,J as JC,m as hl,ai as rm,aj as iT,n as kg,a3 as ZI,M as Mg,o as aC,q as dC,t as sI,ak as nm,a6 as QI,_ as _g,u as cC,v as fC,a5 as Dl,aL as wo,aM as Zn$1,aO as wt$1,az as Xt,aW as C,cj as Pn,ce as kb,c8 as ob,af as wg,ag as ET,c9 as Pf,ck as Lf,ch as Ag,A as AC,S as Sg,ad as $g,b$ as UC,w as zg,x as jg,y as MC,N as NC,aJ as Tr,aG as fe,cl as be,p as pe,l as le,bU as Fd,b9 as T,b8 as B,be as A,b7 as u,bd as h,cm as M,d as O,ba as v,bb as m,c as b,cn as F,f,V,bc as R,co as H,cp as K,ca as _e,K as x,X as z$1,Y as Ue,am as Ym,i as Gn,e as pr,a0 as jt,a2 as Nt,a1 as Vt,b0 as Xg,ac as CC}from'./main-RXIVNUWK.js';import {s as se}from'./chunk-DrKKLE1-.js';import {t as ti,Q as Qn,e as ei,Y as Ye$1,h as _n,A as At,m as mn,Z as Zn,c as cn,w as wt}from'./chunk-B3kY-GQk.js';var Xe=["determinateSpinner"];function et(c,e){if(c&1&&(Pf(),Cs(0,"svg",11),Mg(1,"circle",12),hl()),c&2){let t=CC();Sg("viewBox",t._viewBox()),sI(),$g("stroke-dasharray",t._strokeCircumference(),"px")("stroke-dashoffset",t._strokeCircumference()/2,"px")("stroke-width",t._circleStrokeWidth(),"%"),Sg("r",t._circleRadius());}}var tt=new C("mat-progress-spinner-default-options",{providedIn:"root",factory:()=>({diameter:qe})}),qe=100,nt=10,yt=(()=>{class c{_elementRef=g(Xt);_noopAnimations;get color(){return this._color||this._defaultColor}set color(t){this._color=t;}_color;_defaultColor="primary";_determinateCircle;constructor(){let t=g(tt),n=Pn(),i=this._elementRef.nativeElement;this._noopAnimations=n==="di-disabled"&&!!t&&!t._forceAnimations,this.mode=i.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",!this._noopAnimations&&n==="reduced-motion"&&i.classList.add("mat-progress-spinner-reduced-motion"),t&&(t.color&&(this.color=this._defaultColor=t.color),t.diameter&&(this.diameter=t.diameter),t.strokeWidth&&(this.strokeWidth=t.strokeWidth));}mode;get value(){return this.mode==="determinate"?this._value:0}set value(t){this._value=Math.max(0,Math.min(100,t||0));}_value=0;get diameter(){return this._diameter}set diameter(t){this._diameter=t||0;}_diameter=qe;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(t){this._strokeWidth=t||0;}_strokeWidth;_circleRadius(){return (this.diameter-nt)/2}_viewBox(){let t=this._circleRadius()*2+this.strokeWidth;return `0 0 ${t} ${t}`}_strokeCircumference(){return 2*Math.PI*this._circleRadius()}_strokeDashOffset(){return this.mode==="determinate"?this._strokeCircumference()*(100-this._value)/100:null}_circleStrokeWidth(){return this.strokeWidth/this.diameter*100}static \u0275fac=function(n){return new(n||c)};static \u0275cmp=jw({type:c,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(n,i){if(n&1&&jg(Xe,5),n&2){let o;MC(o=NC())&&(i._determinateCircle=o.first);}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(n,i){n&2&&(Sg("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",i.mode==="determinate"?i.value:null)("mode",i.mode),UC("mat-"+i.color),$g("width",i.diameter,"px")("height",i.diameter,"px")("--mat-progress-spinner-size",i.diameter+"px")("--mat-progress-spinner-active-indicator-width",i.diameter+"px"),zg("_mat-animation-noopable",i._noopAnimations)("mdc-circular-progress--indeterminate",i.mode==="indeterminate"));},inputs:{color:"color",mode:"mode",value:[2,"value","value",ob],diameter:[2,"diameter","diameter",ob],strokeWidth:[2,"strokeWidth","strokeWidth",ob]},exportAs:["matProgressSpinner"],decls:14,vars:11,consts:[["circle",""],["determinateSpinner",""],["aria-hidden","true",1,"mdc-circular-progress__determinate-container"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__determinate-circle-graphic"],["cx","50%","cy","50%",1,"mdc-circular-progress__determinate-circle"],["aria-hidden","true",1,"mdc-circular-progress__indeterminate-container"],[1,"mdc-circular-progress__spinner-layer"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-left"],[3,"ngTemplateOutlet"],[1,"mdc-circular-progress__gap-patch"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-right"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__indeterminate-circle-graphic"],["cx","50%","cy","50%"]],template:function(n,i){if(n&1&&(wg(0,et,2,8,"ng-template",null,0,ET),Cs(2,"div",2,1),Pf(),Cs(4,"svg",3),Mg(5,"circle",4),hl()(),Lf(),Cs(6,"div",5)(7,"div",6)(8,"div",7),Ag(9,8),hl(),Cs(10,"div",9),Ag(11,8),hl(),Cs(12,"div",10),Ag(13,8),hl()()()),n&2){let o=AC(1);sI(4),Sg("viewBox",i._viewBox()),sI(),$g("stroke-dasharray",i._strokeCircumference(),"px")("stroke-dashoffset",i._strokeDashOffset(),"px")("stroke-width",i._circleStrokeWidth(),"%"),Sg("r",i._circleRadius()),sI(4),_g("ngTemplateOutlet",o),sI(2),_g("ngTemplateOutlet",o),sI(2),_g("ngTemplateOutlet",o);}},dependencies:[kb],styles:[`.mat-mdc-progress-spinner {
2
2
  --mat-progress-spinner-animation-multiplier: 1;
3
3
  display: block;
4
4
  overflow: hidden;