@whoz-oss/coday-client 0.249.3 → 0.249.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{chunk-tiXMntK-.js → chunk-33vlVNIU.js} +1 -1
- package/browser/{chunk-CSLsbjtc.js → chunk-4T0Wfhqy.js} +1 -1
- package/browser/{chunk-TsE9fL5L.js → chunk-B4fIYjLb.js} +1 -1
- package/browser/{chunk-sQ2hJaJy.js → chunk-BIsBTTbQ.js} +1 -1
- package/browser/{chunk-B1T1lhxO.js → chunk-BJTPtUco.js} +1 -1
- package/browser/{chunk-DIeUX6U7.js → chunk-BKMFWybZ.js} +1 -1
- package/browser/{chunk-hivMYdms.js → chunk-BLEV4Kd8.js} +1 -1
- package/browser/{chunk-BYobt-yL.js → chunk-BMNFjpsg.js} +1 -1
- package/browser/{chunk-R1YuCBfk.js → chunk-BOSz-hxC.js} +1 -1
- package/browser/{chunk-8QCOKWfy.js → chunk-BQWolQ1_.js} +1 -1
- package/browser/{chunk-Tnt17Uum.js → chunk-BUPJDuFO.js} +1 -1
- package/browser/{chunk-D615HDbJ.js → chunk-BXfg4Cn0.js} +1 -1
- package/browser/{chunk-D8jkRlhn.js → chunk-BcgV9w1p.js} +1 -1
- package/browser/{chunk-DrzUXE6a.js → chunk-BiPnnB8X.js} +1 -1
- package/browser/{chunk-BbkTgcYb.js → chunk-BxmtpvI3.js} +1 -1
- package/browser/{chunk-Js79q0Hk.js → chunk-C2gFixjV.js} +1 -1
- package/browser/{chunk-B9VW5ZdD.js → chunk-C7pLql5T.js} +1 -1
- package/browser/{chunk-B0QeL_YS.js → chunk-CGgxj8Ll.js} +1 -1
- package/browser/{chunk-CoVKXwLW.js → chunk-CK3s5ul2.js} +2 -2
- package/browser/{chunk-DW95Jf_o.js → chunk-CKzcFadZ.js} +1 -1
- package/browser/{chunk-Dv3y4cq8.js → chunk-CL8NUXXa.js} +1 -1
- package/browser/{chunk-ZgaZX2Mw.js → chunk-COF9QnRG.js} +1 -1
- package/browser/{chunk-DuetvIR9.js → chunk-COcrCp25.js} +1 -1
- package/browser/{chunk-Cl7N3gK-.js → chunk-CPHT__IG.js} +1 -1
- package/browser/{chunk-CyUSpM0s.js → chunk-CRB1wakd.js} +1 -1
- package/browser/{chunk-D4O2SdR-.js → chunk-CiJ-4xLE.js} +1 -1
- package/browser/{chunk-B4ZxVpmQ.js → chunk-CjgqGSbb.js} +1 -1
- package/browser/{chunk-CujZ5wxO.js → chunk-Cm8hWWGc.js} +1 -1
- package/browser/{chunk-BngP4FHh.js → chunk-CnhLV6NJ.js} +1 -1
- package/browser/{chunk-CawleOYk.js → chunk-Ct5Qp4E2.js} +1 -1
- package/browser/{chunk-CESBNo1v.js → chunk-CvpbNH1V.js} +1 -1
- package/browser/{chunk-D3bTMcOe.js → chunk-CwXyQ4Ju.js} +1 -1
- package/browser/{chunk-cxvtBPGk.js → chunk-Cy26cHH0.js} +1 -1
- package/browser/{chunk-CRujMca4.js → chunk-DBDq5Tbc.js} +1 -1
- package/browser/{chunk-6uQvW5vO.js → chunk-DBcvm9ht.js} +1 -1
- package/browser/{chunk-DWXHIgAs.js → chunk-DCcqC6CZ.js} +1 -1
- package/browser/chunk-DEYaa_7l.js +1 -0
- package/browser/chunk-DIqcovfM.js +276 -0
- package/browser/{chunk-D36CcRIa.js → chunk-DJZUs7_z.js} +1 -1
- package/browser/{chunk-CI20rCP1.js → chunk-DNuwJ0p8.js} +1 -1
- package/browser/{chunk-DqOy3vx6.js → chunk-DQ4FoWyz.js} +1 -1
- package/browser/{chunk-Dc58xQxP.js → chunk-DVCs6PIN.js} +1 -1
- package/browser/{chunk-NZ2JSd9Y.js → chunk-DVY7ZRkn.js} +1 -1
- package/browser/{chunk-ChlM0KaI.js → chunk-D_sXoT68.js} +1 -1
- package/browser/{chunk-DATqkmXk.js → chunk-Dd7TuG2v.js} +1 -1
- package/browser/{chunk-DVw6VVSF.js → chunk-Ddzyej-S.js} +1 -1
- package/browser/{chunk-CSWaefpi.js → chunk-DijOcbn5.js} +1 -1
- package/browser/{chunk-Bo7V2O_x.js → chunk-Dm3IJf8m.js} +1 -1
- package/browser/{chunk-CMgbU-FY.js → chunk-DxYwvtCM.js} +1 -1
- package/browser/{chunk-hpkckHAH.js → chunk-FfWh7yzS.js} +1 -1
- package/browser/{chunk-BHrJwQJY.js → chunk-FlhMcqxz.js} +1 -1
- package/browser/{chunk-DF9JuMSS.js → chunk-GBM7ZdiS.js} +1 -1
- package/browser/{chunk-CEFRpdhC.js → chunk-HGwsSYC8.js} +1 -1
- package/browser/{chunk-CtCrz21E.js → chunk-Lq8skGXv.js} +1 -1
- package/browser/{chunk-BXRE8Jnn.js → chunk-MEeAhlKz.js} +1 -1
- package/browser/{chunk-Dh70Sw4n.js → chunk-McdsPwbe.js} +1 -1
- package/browser/{chunk-BXeg32ej.js → chunk-UDqQWKAg.js} +1 -1
- package/browser/{chunk-Ims5pjdx.js → chunk-XR8SsRgz.js} +1 -1
- package/browser/{chunk-C_hps2N_.js → chunk-Y_yj5Q5X.js} +1 -1
- package/browser/{chunk-otU95DGd.js → chunk-ZQW3-vPv.js} +1 -1
- package/browser/{chunk-Df2NmKyO.js → chunk-ZUPZhG8s.js} +1 -1
- package/browser/{chunk-DxyVrxwh.js → chunk-dpvvF4wU.js} +1 -1
- package/browser/{chunk-Bb8FM5N7.js → chunk-f86mGfJT.js} +1 -1
- package/browser/{chunk-Cvmc37VM.js → chunk-iOgvtXqW.js} +1 -1
- package/browser/{chunk-rdNDu_G5.js → chunk-kfNFXWlK.js} +1 -1
- package/browser/{chunk-BGG8qTjD.js → chunk-osSFU_ft.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/{main-CERDHS7N.js → main-Z5SI5ZVQ.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-BWVGuXWV.js +0 -1
- package/browser/chunk-CeEsFGfn.js +0 -276
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {W as We$1,Q as Qt$1}from'./chunk-Dv3y4cq8.js';import {_,b as _e,d as an,E as En}from'./chunk-D615HDbJ.js';import {aK as Do,aL as Wn,cp as Se,aN as wt$1,g,az as Qt,br as wl,bF as p,aS as Ut$1,aO as G,aV as w,cq as mB,m as mT,cr as vB,cs as vi,H as Hi,an as ce$1,aR as K,bs as Qn,cc as Hf,bQ as bd,u as ue,au as tv,ae as Ot$1,ap as Vy,bO as Yy,ct as IB,A as Aw,cd as Sb,bz as vC,af as Dg,ag as fT,v as vs,l as Ag,n as eC,bA as DC,k as dl,X as XE,y as Hg,t as tC,b4 as nT,cu as Lg,D as Fg,cv as CC,I as IC,E as wC,cw as Pg,bu as kg,aY as ks,aQ as As,cx as si,cy as Xr,aC as wu,aZ as YT,b$ as Ng,C as Cg,bE as X,b5 as Sg,aw as fl,ax as pl,ac as mC,o as bg,r as Tg,T as TC,cz as Sn$1,aW as D,cA as on,cB as R,cC as Ce,W as WC,a8 as Zg,aE as A,cD as Rd}from'./main-CERDHS7N.js';var oe=class{_box;_destroyed=new ce$1;_resizeSubject=new ce$1;_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 A(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(Ot$1(e=>e.some(t=>t.target===l)),Rd({bufferSize:1,refCount:true}),Vy(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=Ce({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&&bg(0,"span",21);}function vt(i,l){if(i&1&&(vs(0,"label",20),DC(1,1),eC(2,gt,1,0,"span",21),dl()),i&2){let e=mC(2);Tg("floating",e._shouldLabelFloat())("monitorResize",e._hasOutline())("id",e._labelId),Cg("for",e._control.disableAutomaticLabeling?null:e._control.id),XE(2),tC(!e.hideRequiredMarker&&e._control.required?2:-1);}}function xt(i,l){if(i&1&&eC(0,vt,3,5,"label",20),i&2){let e=mC();tC(e._hasFloatingLabel()?0:-1);}}function yt(i,l){i&1&&bg(0,"div",7);}function Ft(i,l){}function Ct(i,l){if(i&1&&Dg(0,Ft,0,0,"ng-template",13),i&2){mC(2);let e=TC(1);Tg("ngTemplateOutlet",e);}}function wt(i,l){if(i&1&&(vs(0,"div",9),eC(1,Ct,1,1,null,13),dl()),i&2){let e=mC();Tg("matFormFieldNotchedOutlineOpen",e._shouldLabelFloat()),XE(),tC(e._forceDisplayInfixLabel()?-1:1);}}function Mt(i,l){i&1&&(vs(0,"div",10,2),DC(2,2),dl());}function Et(i,l){i&1&&(vs(0,"div",11,3),DC(2,3),dl());}function St(i,l){}function Tt(i,l){if(i&1&&Dg(0,St,0,0,"ng-template",13),i&2){mC();let e=TC(1);Tg("ngTemplateOutlet",e);}}function Rt(i,l){i&1&&(vs(0,"div",14,4),DC(2,4),dl());}function Dt(i,l){i&1&&(vs(0,"div",15,5),DC(2,5),dl());}function Nt(i,l){i&1&&bg(0,"div",16);}function At(i,l){i&1&&(vs(0,"div",18),DC(1,6),dl());}function It(i,l){if(i&1&&(vs(0,"mat-hint",22),WC(1),dl()),i&2){let e=mC(2);Tg("id",e._hintLabelId),XE(),Zg(e.hintLabel);}}function Lt(i,l){if(i&1&&(vs(0,"div",19),eC(1,It,2,2,"mat-hint",22),DC(2,7),bg(3,"div",23),DC(4,8),dl()),i&2){let e=mC();XE(),tC(e.hintLabel?1:-1);}}var ae=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275dir=ks({type:i,selectors:[["mat-label"]]})}return i})(),kt=new w("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=ks({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&&(Ng("id",n.id),Cg("align",null),Hg("mat-mdc-form-field-hint-end",n.align==="end"));},inputs:{align:"align",id:"id"}})}return i})(),et=new w("MatPrefix"),Ot=(()=>{class i{set _isTextSelector(e){this._isText=true;}_isText=false;static \u0275fac=function(t){return new(t||i)};static \u0275dir=ks({type:i,selectors:[["","matPrefix",""],["","matIconPrefix",""],["","matTextPrefix",""]],inputs:{_isTextSelector:[0,"matTextPrefix","_isTextSelector"]},features:[nT([{provide:et,useExisting:i}])]})}return i})(),tt=new w("MatSuffix"),zt=(()=>{class i{set _isTextSelector(e){this._isText=true;}_isText=false;static \u0275fac=function(t){return new(t||i)};static \u0275dir=ks({type:i,selectors:[["","matSuffix",""],["","matIconSuffix",""],["","matTextSuffix",""]],inputs:{_isTextSelector:[0,"matTextSuffix","_isTextSelector"]},features:[nT([{provide:tt,useExisting:i}])]})}return i})(),it=new w("FloatingLabelParent"),Ze=(()=>{class i{_elementRef=g(Qt);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 X;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=ks({type:i,selectors:[["label","matFormFieldFloatingLabel",""]],hostAttrs:[1,"mdc-floating-label","mat-mdc-floating-label"],hostVars:2,hostBindings:function(t,n){t&2&&Hg("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(Qt);_cleanupTransitionEnd;constructor(){let e=g(G),t=g(As);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=ks({type:i,selectors:[["div","matFormFieldLineRipple",""]],hostAttrs:[1,"mdc-line-ripple"]})}return i})(),Ye=(()=>{class i{_elementRef=g(Qt);_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=Aw({type:i,selectors:[["div","matFormFieldNotchedOutline",""]],viewQuery:function(t,n){if(t&1&&Fg(ut,5),t&2){let r;IC(r=wC())&&(n._notch=r.first);}},hostAttrs:[1,"mdc-notched-outline"],hostVars:2,hostBindings:function(t,n){t&2&&Hg("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&&(vC(),Sg(0,"div",1),fl(1,"div",2,0),DC(3),pl(),Sg(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=ks({type:i})}return i})();var se=new w("MatFormField"),Bt=new w("MAT_FORM_FIELD_DEFAULT_OPTIONS"),Ke="fill",Vt="auto",Je="fixed",Ht="translateY(-50%)",nt=(()=>{class i{_elementRef=g(Qt);_changeDetectorRef=g(wl);_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=mB("iconPrefixContainer");_textPrefixContainerSignal=mB("textPrefixContainer");_iconSuffixContainerSignal=mB("iconSuffixContainer");_textSuffixContainerSignal=mB("textSuffixContainer");_prefixSuffixContainers=mT(()=>[this._iconPrefixContainerSignal(),this._textPrefixContainerSignal(),this._iconSuffixContainerSignal(),this._textSuffixContainerSignal()].map(e=>e?.nativeElement).filter(e=>e!==void 0));_formFieldControl;_prefixChildren;_suffixChildren;_errorChildren;_hintChildren;_labelChild=vB(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=Hi(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 ce$1;_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)),Hf(()=>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=mT(()=>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(bd([void 0,void 0]),ue(()=>[t.errorState,t.userAriaDescribedBy]),tv(),Ot$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(Vy(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(),Yy(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(){IB({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=mT(()=>!!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=Aw({type:i,selectors:[["mat-form-field"]],contentQueries:function(t,n,r){if(t&1&&(Pg(r,n._labelChild,ae,5),kg(r,de,5)(r,et,5)(r,tt,5)(r,kt,5)(r,le,5)),t&2){CC();let a;IC(a=wC())&&(n._formFieldControl=a.first),IC(a=wC())&&(n._prefixChildren=a),IC(a=wC())&&(n._suffixChildren=a),IC(a=wC())&&(n._errorChildren=a),IC(a=wC())&&(n._hintChildren=a);}},viewQuery:function(t,n){if(t&1&&(Lg(n._iconPrefixContainerSignal,Ue,5)(n._textPrefixContainerSignal,We,5)(n._iconSuffixContainerSignal,Ge,5)(n._textSuffixContainerSignal,$e,5),Fg(pt,5)(Ue,5)(We,5)(Ge,5)($e,5)(Ze,5)(Ye,5)(Xe,5)),t&2){CC(4);let r;IC(r=wC())&&(n._textField=r.first),IC(r=wC())&&(n._iconPrefixContainer=r.first),IC(r=wC())&&(n._textPrefixContainer=r.first),IC(r=wC())&&(n._iconSuffixContainer=r.first),IC(r=wC())&&(n._textSuffixContainer=r.first),IC(r=wC())&&(n._floatingLabel=r.first),IC(r=wC())&&(n._notchedOutline=r.first),IC(r=wC())&&(n._lineRipple=r.first);}},hostAttrs:[1,"mat-mdc-form-field"],hostVars:38,hostBindings:function(t,n){t&2&&Hg("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:[nT([{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&&(vC(_t),Dg(0,xt,1,1,"ng-template",null,0,fT),vs(2,"div",6,1),Ag("click",function(a){return n._control.onContainerClick(a)}),eC(4,yt,1,0,"div",7),vs(5,"div",8),eC(6,wt,2,2,"div",9),eC(7,Mt,3,0,"div",10),eC(8,Et,3,0,"div",11),vs(9,"div",12),eC(10,Tt,1,1,null,13),DC(11),dl(),eC(12,Rt,3,0,"div",14),eC(13,Dt,3,0,"div",15),dl(),eC(14,Nt,1,0,"div",16),dl(),vs(15,"div",17),eC(16,At,2,0,"div",18)(17,Lt,5,1,"div",19),dl()),t&2){let r;XE(2),Hg("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),XE(2),tC(!n._hasOutline()&&!n._control.disabled?4:-1),XE(2),tC(n._hasOutline()?6:-1),XE(),tC(n._hasIconPrefix?7:-1),XE(),tC(n._hasTextPrefix?8:-1),XE(2),tC(!n._hasOutline()||n._forceDisplayInfixLabel()?10:-1),XE(2),tC(n._hasTextSuffix?12:-1),XE(),tC(n._hasIconSuffix?13:-1),XE(),tC(n._hasOutline()?-1:14),XE(),Hg("mat-mdc-form-field-subscript-dynamic-size",n.subscriptSizing==="dynamic");let a=n._getSubscriptMessageType();XE(),tC((r=a)==="error"?16:r==="hint"?17:-1);}},dependencies:[Ze,Ye,Sb,Xe,le],styles:[`.mdc-text-field {
|
|
1
|
+
import {W as We$1,Q as Qt$1}from'./chunk-CL8NUXXa.js';import {_,b as _e,d as an,E as En}from'./chunk-BXfg4Cn0.js';import {aK as Do,aL as Wn,cp as Se,aN as wt$1,g,az as Qt,br as wl,bF as p,aS as Ut$1,aO as G,aV as w,cq as mB,m as mT,cr as vB,cs as vi,H as Hi,an as ce$1,aR as K,bs as Qn,cc as Hf,bQ as bd,u as ue,au as tv,ae as Ot$1,ap as Vy,bO as Yy,ct as IB,A as Aw,cd as Sb,bz as vC,af as Dg,ag as fT,v as vs,l as Ag,n as eC,bA as DC,k as dl,X as XE,y as Hg,t as tC,b4 as nT,cu as Lg,D as Fg,cv as CC,I as IC,E as wC,cw as Pg,bu as kg,aY as ks,aQ as As,cx as si,cy as Xr,aC as wu,aZ as YT,b$ as Ng,C as Cg,bE as X,b5 as Sg,aw as fl,ax as pl,ac as mC,o as bg,r as Tg,T as TC,cz as Sn$1,aW as D,cA as on,cB as R,cC as Ce,W as WC,a8 as Zg,aE as A,cD as Rd}from'./main-Z5SI5ZVQ.js';var oe=class{_box;_destroyed=new ce$1;_resizeSubject=new ce$1;_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 A(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(Ot$1(e=>e.some(t=>t.target===l)),Rd({bufferSize:1,refCount:true}),Vy(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=Ce({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&&bg(0,"span",21);}function vt(i,l){if(i&1&&(vs(0,"label",20),DC(1,1),eC(2,gt,1,0,"span",21),dl()),i&2){let e=mC(2);Tg("floating",e._shouldLabelFloat())("monitorResize",e._hasOutline())("id",e._labelId),Cg("for",e._control.disableAutomaticLabeling?null:e._control.id),XE(2),tC(!e.hideRequiredMarker&&e._control.required?2:-1);}}function xt(i,l){if(i&1&&eC(0,vt,3,5,"label",20),i&2){let e=mC();tC(e._hasFloatingLabel()?0:-1);}}function yt(i,l){i&1&&bg(0,"div",7);}function Ft(i,l){}function Ct(i,l){if(i&1&&Dg(0,Ft,0,0,"ng-template",13),i&2){mC(2);let e=TC(1);Tg("ngTemplateOutlet",e);}}function wt(i,l){if(i&1&&(vs(0,"div",9),eC(1,Ct,1,1,null,13),dl()),i&2){let e=mC();Tg("matFormFieldNotchedOutlineOpen",e._shouldLabelFloat()),XE(),tC(e._forceDisplayInfixLabel()?-1:1);}}function Mt(i,l){i&1&&(vs(0,"div",10,2),DC(2,2),dl());}function Et(i,l){i&1&&(vs(0,"div",11,3),DC(2,3),dl());}function St(i,l){}function Tt(i,l){if(i&1&&Dg(0,St,0,0,"ng-template",13),i&2){mC();let e=TC(1);Tg("ngTemplateOutlet",e);}}function Rt(i,l){i&1&&(vs(0,"div",14,4),DC(2,4),dl());}function Dt(i,l){i&1&&(vs(0,"div",15,5),DC(2,5),dl());}function Nt(i,l){i&1&&bg(0,"div",16);}function At(i,l){i&1&&(vs(0,"div",18),DC(1,6),dl());}function It(i,l){if(i&1&&(vs(0,"mat-hint",22),WC(1),dl()),i&2){let e=mC(2);Tg("id",e._hintLabelId),XE(),Zg(e.hintLabel);}}function Lt(i,l){if(i&1&&(vs(0,"div",19),eC(1,It,2,2,"mat-hint",22),DC(2,7),bg(3,"div",23),DC(4,8),dl()),i&2){let e=mC();XE(),tC(e.hintLabel?1:-1);}}var ae=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275dir=ks({type:i,selectors:[["mat-label"]]})}return i})(),kt=new w("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=ks({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&&(Ng("id",n.id),Cg("align",null),Hg("mat-mdc-form-field-hint-end",n.align==="end"));},inputs:{align:"align",id:"id"}})}return i})(),et=new w("MatPrefix"),Ot=(()=>{class i{set _isTextSelector(e){this._isText=true;}_isText=false;static \u0275fac=function(t){return new(t||i)};static \u0275dir=ks({type:i,selectors:[["","matPrefix",""],["","matIconPrefix",""],["","matTextPrefix",""]],inputs:{_isTextSelector:[0,"matTextPrefix","_isTextSelector"]},features:[nT([{provide:et,useExisting:i}])]})}return i})(),tt=new w("MatSuffix"),zt=(()=>{class i{set _isTextSelector(e){this._isText=true;}_isText=false;static \u0275fac=function(t){return new(t||i)};static \u0275dir=ks({type:i,selectors:[["","matSuffix",""],["","matIconSuffix",""],["","matTextSuffix",""]],inputs:{_isTextSelector:[0,"matTextSuffix","_isTextSelector"]},features:[nT([{provide:tt,useExisting:i}])]})}return i})(),it=new w("FloatingLabelParent"),Ze=(()=>{class i{_elementRef=g(Qt);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 X;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=ks({type:i,selectors:[["label","matFormFieldFloatingLabel",""]],hostAttrs:[1,"mdc-floating-label","mat-mdc-floating-label"],hostVars:2,hostBindings:function(t,n){t&2&&Hg("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(Qt);_cleanupTransitionEnd;constructor(){let e=g(G),t=g(As);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=ks({type:i,selectors:[["div","matFormFieldLineRipple",""]],hostAttrs:[1,"mdc-line-ripple"]})}return i})(),Ye=(()=>{class i{_elementRef=g(Qt);_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=Aw({type:i,selectors:[["div","matFormFieldNotchedOutline",""]],viewQuery:function(t,n){if(t&1&&Fg(ut,5),t&2){let r;IC(r=wC())&&(n._notch=r.first);}},hostAttrs:[1,"mdc-notched-outline"],hostVars:2,hostBindings:function(t,n){t&2&&Hg("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&&(vC(),Sg(0,"div",1),fl(1,"div",2,0),DC(3),pl(),Sg(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=ks({type:i})}return i})();var se=new w("MatFormField"),Bt=new w("MAT_FORM_FIELD_DEFAULT_OPTIONS"),Ke="fill",Vt="auto",Je="fixed",Ht="translateY(-50%)",nt=(()=>{class i{_elementRef=g(Qt);_changeDetectorRef=g(wl);_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=mB("iconPrefixContainer");_textPrefixContainerSignal=mB("textPrefixContainer");_iconSuffixContainerSignal=mB("iconSuffixContainer");_textSuffixContainerSignal=mB("textSuffixContainer");_prefixSuffixContainers=mT(()=>[this._iconPrefixContainerSignal(),this._textPrefixContainerSignal(),this._iconSuffixContainerSignal(),this._textSuffixContainerSignal()].map(e=>e?.nativeElement).filter(e=>e!==void 0));_formFieldControl;_prefixChildren;_suffixChildren;_errorChildren;_hintChildren;_labelChild=vB(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=Hi(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 ce$1;_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)),Hf(()=>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=mT(()=>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(bd([void 0,void 0]),ue(()=>[t.errorState,t.userAriaDescribedBy]),tv(),Ot$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(Vy(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(),Yy(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(){IB({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=mT(()=>!!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=Aw({type:i,selectors:[["mat-form-field"]],contentQueries:function(t,n,r){if(t&1&&(Pg(r,n._labelChild,ae,5),kg(r,de,5)(r,et,5)(r,tt,5)(r,kt,5)(r,le,5)),t&2){CC();let a;IC(a=wC())&&(n._formFieldControl=a.first),IC(a=wC())&&(n._prefixChildren=a),IC(a=wC())&&(n._suffixChildren=a),IC(a=wC())&&(n._errorChildren=a),IC(a=wC())&&(n._hintChildren=a);}},viewQuery:function(t,n){if(t&1&&(Lg(n._iconPrefixContainerSignal,Ue,5)(n._textPrefixContainerSignal,We,5)(n._iconSuffixContainerSignal,Ge,5)(n._textSuffixContainerSignal,$e,5),Fg(pt,5)(Ue,5)(We,5)(Ge,5)($e,5)(Ze,5)(Ye,5)(Xe,5)),t&2){CC(4);let r;IC(r=wC())&&(n._textField=r.first),IC(r=wC())&&(n._iconPrefixContainer=r.first),IC(r=wC())&&(n._textPrefixContainer=r.first),IC(r=wC())&&(n._iconSuffixContainer=r.first),IC(r=wC())&&(n._textSuffixContainer=r.first),IC(r=wC())&&(n._floatingLabel=r.first),IC(r=wC())&&(n._notchedOutline=r.first),IC(r=wC())&&(n._lineRipple=r.first);}},hostAttrs:[1,"mat-mdc-form-field"],hostVars:38,hostBindings:function(t,n){t&2&&Hg("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:[nT([{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&&(vC(_t),Dg(0,xt,1,1,"ng-template",null,0,fT),vs(2,"div",6,1),Ag("click",function(a){return n._control.onContainerClick(a)}),eC(4,yt,1,0,"div",7),vs(5,"div",8),eC(6,wt,2,2,"div",9),eC(7,Mt,3,0,"div",10),eC(8,Et,3,0,"div",11),vs(9,"div",12),eC(10,Tt,1,1,null,13),DC(11),dl(),eC(12,Rt,3,0,"div",14),eC(13,Dt,3,0,"div",15),dl(),eC(14,Nt,1,0,"div",16),dl(),vs(15,"div",17),eC(16,At,2,0,"div",18)(17,Lt,5,1,"div",19),dl()),t&2){let r;XE(2),Hg("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),XE(2),tC(!n._hasOutline()&&!n._control.disabled?4:-1),XE(2),tC(n._hasOutline()?6:-1),XE(),tC(n._hasIconPrefix?7:-1),XE(),tC(n._hasTextPrefix?8:-1),XE(2),tC(!n._hasOutline()||n._forceDisplayInfixLabel()?10:-1),XE(2),tC(n._hasTextSuffix?12:-1),XE(),tC(n._hasIconSuffix?13:-1),XE(),tC(n._hasOutline()?-1:14),XE(),Hg("mat-mdc-form-field-subscript-dynamic-size",n.subscriptSizing==="dynamic");let a=n._getSubscriptMessageType();XE(),tC((r=a)==="error"?16:r==="hint"?17:-1);}},dependencies:[Ze,Ye,Sb,Xe,le],styles:[`.mdc-text-field {
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
align-items: baseline;
|
|
4
4
|
padding: 0 16px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {Z as Zn,D as De}from'./chunk-
|
|
1
|
+
import {Z as Zn,D as De}from'./chunk-McdsPwbe.js';import {ca as hB,cb as pB,H as Hi,m as mT,A as Aw,v as vs,W as WC,k as dl,n as eC,X as XE,a8 as Zg,t as tC,ac as mC,C as Cg,a5 as ml,a9 as dC,l as Ag,r as Tg,aa as If,ab as wf}from'./main-Z5SI5ZVQ.js';function k(t,r){if(t&1&&(vs(0,"span",4),WC(1),dl()),t&2){let e=mC();Cg("data-variant",e.badge().variant)("aria-label",e.badge().ariaLabel),XE(),ml(" ",e.badge().label," ");}}function I(t,r){if(t&1){let e=dC();vs(0,"span",7),WC(1,"Delete?"),dl(),vs(2,"ds-icon-button",8),Ag("action",function(){If(e);let l=mC();return wf(l.onDeleteConfirmed())}),dl(),vs(3,"ds-icon-button",9),Ag("action",function(){If(e);let l=mC();return wf(l.onDeleteCancelled())}),dl();}}function P(t,r){if(t&1){let e=dC();vs(0,"ds-kebab-menu",12),Ag("itemSelected",function(l){If(e);let A=mC(2);return wf(A.onMenuAction(l))}),dl();}if(t&2){let e=mC(2);Tg("items",e.menuItems());}}function R(t,r){if(t&1){let e=dC();vs(0,"ds-icon-button",10),Ag("action",function(){If(e);let l=mC();return wf(l.onDuplicate())}),dl(),eC(1,P,1,1,"ds-kebab-menu",11);}if(t&2){let e=mC();XE(),tC(e.readOnly()?-1:1);}}var E=Object.freeze({platform:{label:"PLATFORM",ariaLabel:"Configuration plateforme (lecture seule)",variant:"neutral"},namespace:{label:"NS",ariaLabel:"Configuration partag\xE9e du namespace",variant:"neutral"},userOnNs:{label:"USER \xD7 NS",ariaLabel:"Configuration utilisateur sur ce namespace",variant:"info"},userGlobal:{label:"USER GLOBAL",ariaLabel:"Configuration utilisateur globale",variant:"warning"}}),O=class t{config=hB.required();scope=hB.required();readOnly=hB(false);showBadge=hB(true);editRequested=pB();deleteRequested=pB();duplicateRequested=pB();pendingDelete=Hi(false);badge=mT(()=>E[this.scope()]);menuItems=mT(()=>[{key:"edit",label:"Edit auth setting",icon:"edit"},{key:"delete",label:"Delete auth setting",icon:"delete",variant:"danger"}]);onMenuAction(r){switch(r){case "edit":this.editRequested.emit(this.config());break;case "delete":this.pendingDelete.set(true);break}}onDuplicate(){this.duplicateRequested.emit(this.config());}onDeleteConfirmed(){this.pendingDelete.set(false),this.deleteRequested.emit(this.config());}onDeleteCancelled(){this.pendingDelete.set(false);}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=Aw({type:t,selectors:[["agentos-auth-setting-item"]],inputs:{config:[1,"config"],scope:[1,"scope"],readOnly:[1,"readOnly"],showBadge:[1,"showBadge"]},outputs:{editRequested:"editRequested",deleteRequested:"deleteRequested",duplicateRequested:"duplicateRequested"},decls:11,vars:4,consts:[["role","listitem",1,"auth-setting-item"],[1,"auth-setting-item__body"],[1,"auth-setting-item__heading"],[1,"auth-setting-item__name"],[1,"auth-setting-item__badge"],[1,"auth-setting-item__type"],[1,"auth-setting-item__actions"],[1,"auth-setting-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],["icon","content_copy","title","Duplicate this auth setting",3,"action"],[3,"items"],[3,"itemSelected","items"]],template:function(e,o){e&1&&(vs(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),WC(4),dl(),eC(5,k,2,3,"span",4),dl(),vs(6,"span",5),WC(7),dl()(),vs(8,"div",6),eC(9,I,4,0)(10,R,2,1),dl()()),e&2&&(XE(4),Zg(o.config().name),XE(),tC(o.showBadge()?5:-1),XE(2),Zg(o.config().authType),XE(2),tC(o.pendingDelete()?9:10));},dependencies:[Zn,De],styles:[".auth-setting-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:10px;border:1px solid var(--color-border);background:var(--glass-bg);-webkit-backdrop-filter:var(--glass-backdrop-blur);backdrop-filter:var(--glass-backdrop-blur);transition:background .15s ease,border-color .15s ease}.auth-setting-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);border-color:var(--color-primary)}.auth-setting-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.auth-setting-item__heading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;min-width:0}.auth-setting-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.auth-setting-item__badge[_ngcontent-%COMP%]{flex-shrink:0;font-size:.65rem;font-weight:600;letter-spacing:.04em;text-transform:uppercase;padding:.1rem .4rem;border-radius:4px;line-height:1.2}.auth-setting-item__badge[data-variant=neutral][_ngcontent-%COMP%]{background:var(--color-bg-secondary);color:var(--color-text-secondary)}.auth-setting-item__badge[data-variant=info][_ngcontent-%COMP%]{background:color-mix(in srgb,var(--color-info) 15%,transparent);color:var(--color-info)}.auth-setting-item__badge[data-variant=warning][_ngcontent-%COMP%]{background:color-mix(in srgb,var(--color-warning) 15%,transparent);color:var(--color-warning)}.auth-setting-item__type[_ngcontent-%COMP%]{font-size:.78rem;color:var(--color-text-secondary);font-family:monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.auth-setting-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.auth-setting-item[_ngcontent-%COMP%]:hover .auth-setting-item__actions[_ngcontent-%COMP%], .auth-setting-item[_ngcontent-%COMP%]:focus-within .auth-setting-item__actions[_ngcontent-%COMP%]{opacity:1}.auth-setting-item__confirm-label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:500;color:var(--color-error);margin-right:.25rem;white-space:nowrap}"]})};export{O};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {g,di as te,Y as x}from'./main-
|
|
1
|
+
import {g,di as te,Y as x}from'./main-Z5SI5ZVQ.js';var c=class r{api=g(te);getById(e){return this.api.getByIdScheduledPrompt(e)}listPlatform(){return this.api.searchScheduledPrompt({namespaceId:null,userId:null})}listByNamespace(e){return this.api.searchScheduledPrompt({namespaceId:e,userId:null})}search(e){return this.api.searchScheduledPrompt(e)}listEffective(e){return this.api.resolveEffectiveScheduledPrompt(e)}create(e){return this.api.createScheduledPrompt(e)}update(e,t){return this.api.updateScheduledPrompt(e,t)}enable(e){return this.api.enableScheduledPrompt(e)}disable(e){return this.api.disableScheduledPrompt(e)}delete(e){return this.api.deleteScheduledPrompt(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=x({token:r,factory:r.\u0275fac,providedIn:"root"})};export{c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {an as ce,g,L,ch as ge,ap as Vy,av as dt$1,A as Aw,v as vs,W as WC,k as dl,ai as Jg,aj as KC,l as Ag,a3 as HI,o as bg,n as eC,q as oC,X as XE,ak as Xg,a6 as $I,r as Tg,t as tC,x as iC,a5 as ml,aK as Do,aL as Wn,aN as wt$1,az as Qt,aV as w,ci as Pn,cd as Sb,c7 as QT,af as Dg,ag as fT,c8 as kf,cj as Ff,cg as Mg,T as TC,C as Cg,ad as Vg,b_ as FC,y as Hg,D as Fg,I as IC,E as wC,aI as Tr,aF as me,ck as fe,h as he,c as ce$1,bT as Od,b8 as T,b7 as B,bd as A,b6 as u,bc as h,cl as M,e as O,b9 as v,ba as m,d as b,cm as F,f,V,bb as R,cn as H,co as _,c9 as We,Y as x,Z as z,_ as Ue,am as Gm,j as Gn,p as pr,a0 as jt,a2 as Nt,a1 as Vt,a$ as Yg,ac as mC}from'./main-
|
|
1
|
+
import {an as ce,g,L,ch as ge,ap as Vy,av as dt$1,A as Aw,v as vs,W as WC,k as dl,ai as Jg,aj as KC,l as Ag,a3 as HI,o as bg,n as eC,q as oC,X as XE,ak as Xg,a6 as $I,r as Tg,t as tC,x as iC,a5 as ml,aK as Do,aL as Wn,aN as wt$1,az as Qt,aV as w,ci as Pn,cd as Sb,c7 as QT,af as Dg,ag as fT,c8 as kf,cj as Ff,cg as Mg,T as TC,C as Cg,ad as Vg,b_ as FC,y as Hg,D as Fg,I as IC,E as wC,aI as Tr,aF as me,ck as fe,h as he,c as ce$1,bT as Od,b8 as T,b7 as B,bd as A,b6 as u,bc as h,cl as M,e as O,b9 as v,ba as m,d as b,cm as F,f,V,bb as R,cn as H,co as _,c9 as We,Y as x,Z as z,_ as Ue,am as Gm,j as Gn,p as pr,a0 as jt,a2 as Nt,a1 as Vt,a$ as Yg,ac as mC}from'./main-Z5SI5ZVQ.js';import {s as se}from'./chunk-4T0Wfhqy.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-BXfg4Cn0.js';var Ze=["determinateSpinner"];function Xe(c,e){if(c&1&&(kf(),vs(0,"svg",11),bg(1,"circle",12),dl()),c&2){let t=mC();Cg("viewBox",t._viewBox()),XE(),Vg("stroke-dasharray",t._strokeCircumference(),"px")("stroke-dashoffset",t._strokeCircumference()/2,"px")("stroke-width",t._circleStrokeWidth(),"%"),Cg("r",t._circleRadius());}}var et=new w("mat-progress-spinner-default-options",{providedIn:"root",factory:()=>({diameter:qe})}),qe=100,tt=10,yt=(()=>{class c{_elementRef=g(Qt);_noopAnimations;get color(){return this._color||this._defaultColor}set color(t){this._color=t;}_color;_defaultColor="primary";_determinateCircle;constructor(){let t=g(et),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-tt)/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=Aw({type:c,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(n,i){if(n&1&&Fg(Ze,5),n&2){let o;IC(o=wC())&&(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&&(Cg("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",i.mode==="determinate"?i.value:null)("mode",i.mode),FC("mat-"+i.color),Vg("width",i.diameter,"px")("height",i.diameter,"px")("--mat-progress-spinner-size",i.diameter+"px")("--mat-progress-spinner-active-indicator-width",i.diameter+"px"),Hg("_mat-animation-noopable",i._noopAnimations)("mdc-circular-progress--indeterminate",i.mode==="indeterminate"));},inputs:{color:"color",mode:"mode",value:[2,"value","value",QT],diameter:[2,"diameter","diameter",QT],strokeWidth:[2,"strokeWidth","strokeWidth",QT]},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&&(Dg(0,Xe,2,8,"ng-template",null,0,fT),vs(2,"div",2,1),kf(),vs(4,"svg",3),bg(5,"circle",4),dl()(),Ff(),vs(6,"div",5)(7,"div",6)(8,"div",7),Mg(9,8),dl(),vs(10,"div",9),Mg(11,8),dl(),vs(12,"div",10),Mg(13,8),dl()()()),n&2){let o=TC(1);XE(4),Cg("viewBox",i._viewBox()),XE(),Vg("stroke-dasharray",i._strokeCircumference(),"px")("stroke-dashoffset",i._strokeDashOffset(),"px")("stroke-width",i._circleStrokeWidth(),"%"),Cg("r",i._circleRadius()),XE(4),Tg("ngTemplateOutlet",o),XE(2),Tg("ngTemplateOutlet",o),XE(2),Tg("ngTemplateOutlet",o);}},dependencies:[Sb],styles:[`.mat-mdc-progress-spinner {
|
|
2
2
|
--mat-progress-spinner-animation-multiplier: 1;
|
|
3
3
|
display: block;
|
|
4
4
|
overflow: hidden;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c}from'./chunk-DATqkmXk.js';import {g,ao as V,G,w as we$1,d8 as M,d9 as he$1,da as fe$1,H as Hi,db as ge$1,F,bQ as bd,m as mT,Q as By,b as U,a7 as ha,S as pa,z as z$1,a as P,A as Aw,v as vs,l as Ag,W as WC,k as dl,n as eC,X as XE,a5 as ml,t as tC,a9 as dC,o as bg,a3 as HI,q as oC,ac as mC,r as Tg,y as Hg,a6 as $I,x as iC,a8 as Zg,aa as If,ab as wf,bj as yh}from'./main-CERDHS7N.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-D615HDbJ.js';var A=(n,t)=>t.value,se=(n,t)=>t.id;function pe(n,t){n&1&&(vs(0,"p",5),WC(1,"Loading\u2026"),dl());}function ue(n,t){n&1&&(vs(0,"span",12),WC(1," Name is required. "),dl());}function fe(n,t){if(n&1&&(vs(0,"p",40),WC(1),dl(),vs(2,"span",13),WC(3,"Agent Config cannot be changed after creation."),dl()),n&2){let e=mC(2);XE(),Zg(e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function _e(n,t){if(n&1&&(vs(0,"a",41),WC(1,"Add an agent config"),dl(),WC(2," first. ")),n&2){let e=mC(3);Tg("href","/agentos/"+e.namespaceId+"/agent-configs/new",yh);}}function he(n,t){if(n&1&&(vs(0,"p",13),WC(1," No agent configs available in this scope yet. "),eC(2,_e,3,1),dl()),n&2){let e=mC(2);XE(2),tC(e.isPlatformMode?-1:2);}}function ge(n,t){if(n&1&&(vs(0,"option",23),WC(1),dl()),n&2){let e=t.$implicit;Tg("value",e.id),XE(),Zg(e.name);}}function Ce(n,t){n&1&&(vs(0,"span",12),WC(1,"Agent Config is required."),dl());}function ve(n,t){if(n&1&&(vs(0,"select",42)(1,"option",43),WC(2,"Select an agent config\u2026"),dl(),oC(3,ge,2,2,"option",23,se),dl(),HI(),eC(5,Ce,2,0,"span",12),vs(6,"span",13),WC(7,"Immutable after creation."),dl()),n&2){let e=mC(2);Tg("formControl",e.agentConfigIdControl),$I(),XE(3),iC(e.availableAgentConfigs()),XE(2),tC(e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?5:-1);}}function ye(n,t){n&1&&(vs(0,"span",12),WC(1,"Opening message is required."),dl());}function be(n,t){if(n&1&&(vs(0,"option",23),WC(1),dl()),n&2){let e=t.$implicit;Tg("value",e.value),XE(),Zg(e.label);}}function xe(n,t){if(n&1){let e=dC();vs(0,"label",46)(1,"input",47),Ag("change",function(){let h=If(e).$implicit,P=mC(3);return wf(P.toggleDay(h.value))}),dl(),vs(2,"span",48),WC(3),dl()();}if(n&2){let e=t.$implicit,l=mC(3);XE(),Tg("checked",l.isDaySelected(e.value)),XE(2),Zg(e.label);}}function Se(n,t){if(n&1&&(vs(0,"div",8)(1,"span",44),WC(2,"Days of week"),dl(),vs(3,"div",45),oC(4,xe,4,2,"label",46,A),dl(),vs(6,"span",13),WC(7,"Leave empty to run every day of the week."),dl()()),n&2){let e=mC(2);XE(4),iC(e.dayOptions);}}function Pe(n,t){n&1&&(vs(0,"span",12),WC(1,"Valid time is required (HH:mm)."),dl());}function Ee(n,t){n&1&&(vs(0,"span",12),WC(1,"Start date is required."),dl());}function Me(n,t){if(n&1&&(vs(0,"option",23),WC(1),dl()),n&2){let e=t.$implicit;Tg("value",e.value),XE(),Zg(e.label);}}function Oe(n,t){n&1&&(vs(0,"span",12),WC(1,"End date is required."),dl());}function De(n,t){if(n&1&&(vs(0,"div",8)(1,"label",49),WC(2," End date "),vs(3,"span",10),WC(4,"*"),dl()(),bg(5,"input",50),HI(),eC(6,Oe,2,0,"span",12),dl()),n&2){let e=mC(2);XE(5),Hg("scheduled-prompt-form__input--invalid",e.form.hasError("endDateRequired")&&e.endDateControl.touched),Tg("formControl",e.endDateControl),$I(),XE(),tC(e.form.hasError("endDateRequired")&&e.endDateControl.touched?6:-1);}}function Te(n,t){n&1&&(vs(0,"span",12),WC(1,"Must be at least 1."),dl());}function we(n,t){if(n&1&&(vs(0,"div",8)(1,"label",51),WC(2," Number of occurrences "),vs(3,"span",10),WC(4,"*"),dl()(),bg(5,"input",52),HI(),eC(6,Te,2,0,"span",12),dl()),n&2){let e=mC(2);XE(5),Hg("scheduled-prompt-form__input--invalid",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched),Tg("formControl",e.occurrenceCountControl),$I(),XE(),tC(e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?6:-1);}}function ke(n,t){if(n&1&&(vs(0,"p",36),WC(1),dl()),n&2){let e=mC(2);XE(),Zg(e.errorMessage());}}function Fe(n,t){if(n&1){let e=dC();vs(0,"form",7),Ag("ngSubmit",function(){If(e);let h=mC();return wf(h.submit())}),vs(1,"div",8)(2,"label",9),WC(3," Name "),vs(4,"span",10),WC(5,"*"),dl()(),bg(6,"input",11),HI(),eC(7,ue,2,0,"span",12),vs(8,"span",13),WC(9,'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.'),dl()(),vs(10,"div",8)(11,"label",14),WC(12,"Description"),dl(),bg(13,"input",15),HI(),dl(),vs(14,"div",8)(15,"label",16),WC(16," Agent Config "),vs(17,"span",10),WC(18,"*"),dl()(),eC(19,fe,4,1)(20,he,3,1,"p",13)(21,ve,8,2),dl(),vs(22,"div",8)(23,"label",17),WC(24," Opening message "),vs(25,"span",10),WC(26,"*"),dl()(),bg(27,"textarea",18),HI(),eC(28,ye,2,0,"span",12),vs(29,"span",13),WC(30," The message sent to the agent when the scheduled prompt fires. "),dl()(),vs(31,"fieldset",19)(32,"legend",20),WC(33,"Recurrence"),dl(),vs(34,"div",8)(35,"label",21),WC(36," Unit "),vs(37,"span",10),WC(38,"*"),dl()(),vs(39,"select",22),oC(40,be,2,2,"option",23,A),dl(),HI(),dl(),eC(42,Se,8,0,"div",8),vs(43,"div",8)(44,"label",24),WC(45," Time (UTC) "),vs(46,"span",10),WC(47,"*"),dl()(),vs(48,"div",25),bg(49,"input",26),HI(),vs(50,"span",27),WC(51,"UTC"),dl()(),eC(52,Pe,2,0,"span",12),dl()(),vs(53,"fieldset",19)(54,"legend",20),WC(55,"Planning"),dl(),vs(56,"div",8)(57,"label",28),WC(58," Start date "),vs(59,"span",10),WC(60,"*"),dl()(),bg(61,"input",29),HI(),eC(62,Ee,2,0,"span",12),dl(),vs(63,"div",8)(64,"label",30),WC(65," Ends "),vs(66,"span",10),WC(67,"*"),dl()(),vs(68,"select",31),oC(69,Me,2,2,"option",23,A),dl(),HI(),dl(),eC(71,De,7,4,"div",8),eC(72,we,7,4,"div",8),dl(),vs(73,"div",8)(74,"label",32),bg(75,"input",33),HI(),vs(76,"span",34),WC(77,"Enabled"),dl()(),vs(78,"p",35),WC(79," When disabled, the scheduled prompt is saved but will not run on schedule. "),dl()(),eC(80,ke,2,1,"p",36),vs(81,"div",37)(82,"button",38),WC(83),dl(),vs(84,"button",39),Ag("click",function(){If(e);let h=mC();return wf(h.cancel())}),WC(85,"Cancel"),dl()()();}if(n&2){let e=mC();Tg("formGroup",e.form),XE(6),Hg("scheduled-prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),Tg("formControl",e.nameControl),$I(),XE(),tC(e.nameControl.invalid&&e.nameControl.touched?7:-1),XE(6),Tg("formControl",e.descriptionControl),$I(),XE(6),tC(e.isEditMode()?19:e.availableAgentConfigs().length===0?20:21),XE(8),Hg("scheduled-prompt-form__textarea--invalid",e.promptContentControl.invalid&&e.promptContentControl.touched),Tg("formControl",e.promptContentControl),$I(),XE(),tC(e.promptContentControl.invalid&&e.promptContentControl.touched?28:-1),XE(11),Tg("formControl",e.unitControl),$I(),XE(),iC(e.schedulerUnits),XE(2),tC(e.showDayFilter()?42:-1),XE(7),Tg("formControl",e.timeUtcControl),$I(),XE(3),tC(e.timeUtcControl.invalid&&e.timeUtcControl.touched?52:-1),XE(9),Hg("scheduled-prompt-form__input--invalid",e.startDateControl.invalid&&e.startDateControl.touched),Tg("formControl",e.startDateControl),$I(),XE(),tC(e.startDateControl.invalid&&e.startDateControl.touched?62:-1),XE(6),Tg("formControl",e.endTypeControl),$I(),XE(),iC(e.endTypes),XE(2),tC(e.showEndDate()?71:-1),XE(),tC(e.showOccurrenceCount()?72:-1),XE(3),Tg("formControl",e.enabledControl),$I(),XE(5),tC(e.errorMessage()?80:-1),XE(2),Tg("disabled",e.form.invalid||e.isSubmitting()),XE(),ml(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var me=class n{route=g(V);router=g(G);destroyRef=g(we$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(fe$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(he$1.NEVER,{nonNullable:true,validators:[_e$1.required]}),endDate:new _t(null),occurrenceCount:new _t(null),enabled:new _t(true,{nonNullable:true})},{validators:[Ne,Ie]});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}isEditMode=Hi(false);isSubmitting=Hi(false);isLoading=Hi(false);errorMessage=Hi(null);SchedulerUnit=fe$1;SchedulerEndType=he$1;schedulerUnits=[{value:fe$1.WEEK,label:"Week(s)"},{value:fe$1.MONTH,label:"Month(s)"}];endTypes=[{value:he$1.NEVER,label:"Never"},{value:he$1.ON_DATE,label:"On date"},{value:he$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(ge$1).map(([t,e])=>({value:t,label:e}));unitSignal=F(this.unitControl.valueChanges.pipe(bd(this.unitControl.value)));endTypeSignal=F(this.endTypeControl.valueChanges.pipe(bd(this.endTypeControl.value)));showDayFilter=mT(()=>this.unitSignal()===fe$1.WEEK);showEndDate=mT(()=>this.endTypeSignal()===he$1.ON_DATE);showOccurrenceCount=mT(()=>this.endTypeSignal()===he$1.OCCURRENCES);agentConfigs=Hi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Ve());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(true),this.loadPromptAndResources(t)):this.loadResources();}loadPromptAndResources(t){this.isLoading.set(true),By({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:l})=>{this.existingPrompt=e,this.agentConfigs.set(l),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(ha(()=>pa([])))}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);}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,l=e.includes(t)?e.filter(h=>h!==t):[...e,t];this.daysControl.setValue(l);}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,l=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===he$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===he$1.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value});(t?this.state.update(this.existingPrompt.id,l):this.state.create(l)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:P=>{this.isSubmitting.set(false),P.status===409?this.errorMessage.set(`A scheduled prompt named "${l.name}" already exists in this scope.`):P.status===400?this.errorMessage.set(P.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=Aw({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"],[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,l){e&1&&(vs(0,"div",0)(1,"header",1)(2,"button",2),Ag("click",function(){return l.cancel()}),vs(3,"span",3),WC(4,"\u2190"),dl(),WC(5),dl(),vs(6,"h1",4),WC(7),dl()(),eC(8,pe,2,0,"p",5)(9,Fe,86,26,"form",6),dl()),e&2&&(XE(5),ml(" ",l.isPlatformMode?"Platform Scheduled Prompts":"Scheduled Prompts"," "),XE(2),ml(" ",l.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"," "),XE(),tC(l.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 Ne(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===he$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ie(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===he$1.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function Ve(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),l=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${l}`}export{me as ScheduledPromptFormComponent};
|
|
1
|
+
import {c}from'./chunk-Dd7TuG2v.js';import {g,ao as V,G,w as we$1,d8 as M,d9 as he$1,da as fe$1,H as Hi,db as ge$1,F,bQ as bd,m as mT,Q as By,b as U,a7 as ha,S as pa,z as z$1,a as P,A as Aw,v as vs,l as Ag,W as WC,k as dl,n as eC,X as XE,a5 as ml,t as tC,a9 as dC,o as bg,a3 as HI,q as oC,ac as mC,r as Tg,y as Hg,a6 as $I,x as iC,a8 as Zg,aa as If,ab as wf,bj as yh}from'./main-Z5SI5ZVQ.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-BXfg4Cn0.js';var A=(n,t)=>t.value,se=(n,t)=>t.id;function pe(n,t){n&1&&(vs(0,"p",5),WC(1,"Loading\u2026"),dl());}function ue(n,t){n&1&&(vs(0,"span",12),WC(1," Name is required. "),dl());}function fe(n,t){if(n&1&&(vs(0,"p",40),WC(1),dl(),vs(2,"span",13),WC(3,"Agent Config cannot be changed after creation."),dl()),n&2){let e=mC(2);XE(),Zg(e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function _e(n,t){if(n&1&&(vs(0,"a",41),WC(1,"Add an agent config"),dl(),WC(2," first. ")),n&2){let e=mC(3);Tg("href","/agentos/"+e.namespaceId+"/agent-configs/new",yh);}}function he(n,t){if(n&1&&(vs(0,"p",13),WC(1," No agent configs available in this scope yet. "),eC(2,_e,3,1),dl()),n&2){let e=mC(2);XE(2),tC(e.isPlatformMode?-1:2);}}function ge(n,t){if(n&1&&(vs(0,"option",23),WC(1),dl()),n&2){let e=t.$implicit;Tg("value",e.id),XE(),Zg(e.name);}}function Ce(n,t){n&1&&(vs(0,"span",12),WC(1,"Agent Config is required."),dl());}function ve(n,t){if(n&1&&(vs(0,"select",42)(1,"option",43),WC(2,"Select an agent config\u2026"),dl(),oC(3,ge,2,2,"option",23,se),dl(),HI(),eC(5,Ce,2,0,"span",12),vs(6,"span",13),WC(7,"Immutable after creation."),dl()),n&2){let e=mC(2);Tg("formControl",e.agentConfigIdControl),$I(),XE(3),iC(e.availableAgentConfigs()),XE(2),tC(e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?5:-1);}}function ye(n,t){n&1&&(vs(0,"span",12),WC(1,"Opening message is required."),dl());}function be(n,t){if(n&1&&(vs(0,"option",23),WC(1),dl()),n&2){let e=t.$implicit;Tg("value",e.value),XE(),Zg(e.label);}}function xe(n,t){if(n&1){let e=dC();vs(0,"label",46)(1,"input",47),Ag("change",function(){let h=If(e).$implicit,P=mC(3);return wf(P.toggleDay(h.value))}),dl(),vs(2,"span",48),WC(3),dl()();}if(n&2){let e=t.$implicit,l=mC(3);XE(),Tg("checked",l.isDaySelected(e.value)),XE(2),Zg(e.label);}}function Se(n,t){if(n&1&&(vs(0,"div",8)(1,"span",44),WC(2,"Days of week"),dl(),vs(3,"div",45),oC(4,xe,4,2,"label",46,A),dl(),vs(6,"span",13),WC(7,"Leave empty to run every day of the week."),dl()()),n&2){let e=mC(2);XE(4),iC(e.dayOptions);}}function Pe(n,t){n&1&&(vs(0,"span",12),WC(1,"Valid time is required (HH:mm)."),dl());}function Ee(n,t){n&1&&(vs(0,"span",12),WC(1,"Start date is required."),dl());}function Me(n,t){if(n&1&&(vs(0,"option",23),WC(1),dl()),n&2){let e=t.$implicit;Tg("value",e.value),XE(),Zg(e.label);}}function Oe(n,t){n&1&&(vs(0,"span",12),WC(1,"End date is required."),dl());}function De(n,t){if(n&1&&(vs(0,"div",8)(1,"label",49),WC(2," End date "),vs(3,"span",10),WC(4,"*"),dl()(),bg(5,"input",50),HI(),eC(6,Oe,2,0,"span",12),dl()),n&2){let e=mC(2);XE(5),Hg("scheduled-prompt-form__input--invalid",e.form.hasError("endDateRequired")&&e.endDateControl.touched),Tg("formControl",e.endDateControl),$I(),XE(),tC(e.form.hasError("endDateRequired")&&e.endDateControl.touched?6:-1);}}function Te(n,t){n&1&&(vs(0,"span",12),WC(1,"Must be at least 1."),dl());}function we(n,t){if(n&1&&(vs(0,"div",8)(1,"label",51),WC(2," Number of occurrences "),vs(3,"span",10),WC(4,"*"),dl()(),bg(5,"input",52),HI(),eC(6,Te,2,0,"span",12),dl()),n&2){let e=mC(2);XE(5),Hg("scheduled-prompt-form__input--invalid",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched),Tg("formControl",e.occurrenceCountControl),$I(),XE(),tC(e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?6:-1);}}function ke(n,t){if(n&1&&(vs(0,"p",36),WC(1),dl()),n&2){let e=mC(2);XE(),Zg(e.errorMessage());}}function Fe(n,t){if(n&1){let e=dC();vs(0,"form",7),Ag("ngSubmit",function(){If(e);let h=mC();return wf(h.submit())}),vs(1,"div",8)(2,"label",9),WC(3," Name "),vs(4,"span",10),WC(5,"*"),dl()(),bg(6,"input",11),HI(),eC(7,ue,2,0,"span",12),vs(8,"span",13),WC(9,'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.'),dl()(),vs(10,"div",8)(11,"label",14),WC(12,"Description"),dl(),bg(13,"input",15),HI(),dl(),vs(14,"div",8)(15,"label",16),WC(16," Agent Config "),vs(17,"span",10),WC(18,"*"),dl()(),eC(19,fe,4,1)(20,he,3,1,"p",13)(21,ve,8,2),dl(),vs(22,"div",8)(23,"label",17),WC(24," Opening message "),vs(25,"span",10),WC(26,"*"),dl()(),bg(27,"textarea",18),HI(),eC(28,ye,2,0,"span",12),vs(29,"span",13),WC(30," The message sent to the agent when the scheduled prompt fires. "),dl()(),vs(31,"fieldset",19)(32,"legend",20),WC(33,"Recurrence"),dl(),vs(34,"div",8)(35,"label",21),WC(36," Unit "),vs(37,"span",10),WC(38,"*"),dl()(),vs(39,"select",22),oC(40,be,2,2,"option",23,A),dl(),HI(),dl(),eC(42,Se,8,0,"div",8),vs(43,"div",8)(44,"label",24),WC(45," Time (UTC) "),vs(46,"span",10),WC(47,"*"),dl()(),vs(48,"div",25),bg(49,"input",26),HI(),vs(50,"span",27),WC(51,"UTC"),dl()(),eC(52,Pe,2,0,"span",12),dl()(),vs(53,"fieldset",19)(54,"legend",20),WC(55,"Planning"),dl(),vs(56,"div",8)(57,"label",28),WC(58," Start date "),vs(59,"span",10),WC(60,"*"),dl()(),bg(61,"input",29),HI(),eC(62,Ee,2,0,"span",12),dl(),vs(63,"div",8)(64,"label",30),WC(65," Ends "),vs(66,"span",10),WC(67,"*"),dl()(),vs(68,"select",31),oC(69,Me,2,2,"option",23,A),dl(),HI(),dl(),eC(71,De,7,4,"div",8),eC(72,we,7,4,"div",8),dl(),vs(73,"div",8)(74,"label",32),bg(75,"input",33),HI(),vs(76,"span",34),WC(77,"Enabled"),dl()(),vs(78,"p",35),WC(79," When disabled, the scheduled prompt is saved but will not run on schedule. "),dl()(),eC(80,ke,2,1,"p",36),vs(81,"div",37)(82,"button",38),WC(83),dl(),vs(84,"button",39),Ag("click",function(){If(e);let h=mC();return wf(h.cancel())}),WC(85,"Cancel"),dl()()();}if(n&2){let e=mC();Tg("formGroup",e.form),XE(6),Hg("scheduled-prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),Tg("formControl",e.nameControl),$I(),XE(),tC(e.nameControl.invalid&&e.nameControl.touched?7:-1),XE(6),Tg("formControl",e.descriptionControl),$I(),XE(6),tC(e.isEditMode()?19:e.availableAgentConfigs().length===0?20:21),XE(8),Hg("scheduled-prompt-form__textarea--invalid",e.promptContentControl.invalid&&e.promptContentControl.touched),Tg("formControl",e.promptContentControl),$I(),XE(),tC(e.promptContentControl.invalid&&e.promptContentControl.touched?28:-1),XE(11),Tg("formControl",e.unitControl),$I(),XE(),iC(e.schedulerUnits),XE(2),tC(e.showDayFilter()?42:-1),XE(7),Tg("formControl",e.timeUtcControl),$I(),XE(3),tC(e.timeUtcControl.invalid&&e.timeUtcControl.touched?52:-1),XE(9),Hg("scheduled-prompt-form__input--invalid",e.startDateControl.invalid&&e.startDateControl.touched),Tg("formControl",e.startDateControl),$I(),XE(),tC(e.startDateControl.invalid&&e.startDateControl.touched?62:-1),XE(6),Tg("formControl",e.endTypeControl),$I(),XE(),iC(e.endTypes),XE(2),tC(e.showEndDate()?71:-1),XE(),tC(e.showOccurrenceCount()?72:-1),XE(3),Tg("formControl",e.enabledControl),$I(),XE(5),tC(e.errorMessage()?80:-1),XE(2),Tg("disabled",e.form.invalid||e.isSubmitting()),XE(),ml(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var me=class n{route=g(V);router=g(G);destroyRef=g(we$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(fe$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(he$1.NEVER,{nonNullable:true,validators:[_e$1.required]}),endDate:new _t(null),occurrenceCount:new _t(null),enabled:new _t(true,{nonNullable:true})},{validators:[Ne,Ie]});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}isEditMode=Hi(false);isSubmitting=Hi(false);isLoading=Hi(false);errorMessage=Hi(null);SchedulerUnit=fe$1;SchedulerEndType=he$1;schedulerUnits=[{value:fe$1.WEEK,label:"Week(s)"},{value:fe$1.MONTH,label:"Month(s)"}];endTypes=[{value:he$1.NEVER,label:"Never"},{value:he$1.ON_DATE,label:"On date"},{value:he$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(ge$1).map(([t,e])=>({value:t,label:e}));unitSignal=F(this.unitControl.valueChanges.pipe(bd(this.unitControl.value)));endTypeSignal=F(this.endTypeControl.valueChanges.pipe(bd(this.endTypeControl.value)));showDayFilter=mT(()=>this.unitSignal()===fe$1.WEEK);showEndDate=mT(()=>this.endTypeSignal()===he$1.ON_DATE);showOccurrenceCount=mT(()=>this.endTypeSignal()===he$1.OCCURRENCES);agentConfigs=Hi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Ve());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(true),this.loadPromptAndResources(t)):this.loadResources();}loadPromptAndResources(t){this.isLoading.set(true),By({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:l})=>{this.existingPrompt=e,this.agentConfigs.set(l),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(ha(()=>pa([])))}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);}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,l=e.includes(t)?e.filter(h=>h!==t):[...e,t];this.daysControl.setValue(l);}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,l=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===he$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===he$1.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value});(t?this.state.update(this.existingPrompt.id,l):this.state.create(l)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:P=>{this.isSubmitting.set(false),P.status===409?this.errorMessage.set(`A scheduled prompt named "${l.name}" already exists in this scope.`):P.status===400?this.errorMessage.set(P.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=Aw({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"],[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,l){e&1&&(vs(0,"div",0)(1,"header",1)(2,"button",2),Ag("click",function(){return l.cancel()}),vs(3,"span",3),WC(4,"\u2190"),dl(),WC(5),dl(),vs(6,"h1",4),WC(7),dl()(),eC(8,pe,2,0,"p",5)(9,Fe,86,26,"form",6),dl()),e&2&&(XE(5),ml(" ",l.isPlatformMode?"Platform Scheduled Prompts":"Scheduled Prompts"," "),XE(2),ml(" ",l.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"," "),XE(),tC(l.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 Ne(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===he$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ie(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===he$1.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function Ve(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),l=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${l}`}export{me as ScheduledPromptFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {y}from'./chunk-Tnt17Uum.js';import {g,ao as V,G,w as we,d8 as M,dk as D,d5 as N,H as Hi,Q as By,S as pa,b as U,u as ue$1,a7 as ha,z as z$1,a as P,A as Aw,s as si,v as vs,l as Ag,W as WC,k as dl,n as eC,X as XE,a8 as Zg,t as tC,ac as mC,r as Tg,a9 as dC,o as bg,a3 as HI,a6 as $I,a5 as ml,q as oC,x as iC,bn as nC,aa as If,ab as wf,C as Cg}from'./main-CERDHS7N.js';import'./chunk-CoVKXwLW.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,a as wt,Z as Zn,l as Xn,C as Cn,E as En}from'./chunk-D615HDbJ.js';import'./chunk-BWVGuXWV.js';import'./chunk-rdNDu_G5.js';import'./chunk-Dh70Sw4n.js';import'./chunk-Dv3y4cq8.js';var le=(r,t)=>t.config.id,ce=(r,t)=>t.type;function ge(r,t){if(r&1&&(vs(0,"a",5),WC(1,"View resolved definition \u2192"),dl()),r&2){let e=mC();Tg("routerLink",e.inspectRoute());}}function se(r,t){r&1&&(vs(0,"span",6),WC(1,"Platform level"),dl());}function de(r,t){r&1&&(vs(0,"p",7),WC(1,"Loading\u2026"),dl());}function me(r,t){if(r&1&&(vs(0,"span",41),WC(1),dl()),r&2){let e=mC().$implicit;XE(),Zg(e.config.integrationType);}}function fe(r,t){if(r&1&&(bg(0,"input",42),HI()),r&2){let e=mC().$implicit;Tg("formControl",e.toolsControl),$I();}}function pe(r,t){if(r&1){let e=dC();vs(0,"div",37)(1,"label",38)(2,"input",39),Ag("change",function(){let l=If(e).$implicit,g=mC(3);return wf(g.toggleIntegration(l))}),dl(),vs(3,"span",40),WC(4),dl(),eC(5,me,2,1,"span",41),dl(),eC(6,fe,1,1,"input",42),dl();}if(r&2){let e=t.$implicit;XE(2),Tg("checked",e.enabled()),XE(2),Zg(e.config.name),XE(),tC(e.config.integrationType?5:-1),XE(),tC(e.enabled()?6:-1);}}function _e(r,t){if(r&1&&(vs(0,"p",48),WC(1),dl()),r&2){let e=mC().$implicit;XE(),ml(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function ue(r,t){if(r&1){let e=dC();vs(0,"div",37)(1,"label",38)(2,"span",40),WC(3),dl(),vs(4,"span",41),WC(5,"built-in"),dl()(),vs(6,"select",44),Ag("change",function(l){let g=If(e).$implicit,m=mC(4);return wf(m.setBuiltInState(g,l.target.value))}),vs(7,"option",45),WC(8),dl(),vs(9,"option",46),WC(10,"Enabled"),dl(),vs(11,"option",47),WC(12,"Disabled"),dl()(),eC(13,_e,2,1,"p",48),vs(14,"p",49),WC(15),dl()();}if(r&2){let e=t.$implicit,o=mC(4);XE(),Cg("for","built-in-"+e.type),XE(2),Zg(e.displayName),XE(3),Tg("id","built-in-"+e.type)("value",e.state()),XE(2),Zg(o.builtInDefaultLabel(e)),XE(5),tC(e.state()==="on"&&e.restrictedTools?13:-1),XE(2),Zg(e.description);}}function be(r,t){if(r&1&&(vs(0,"p",43),WC(1,"Built-in integrations"),dl(),oC(2,ue,16,7,"div",37,ce)),r&2){let e=mC(3);XE(2),iC(e.builtInRows());}}function Ce(r,t){if(r&1&&(vs(0,"fieldset",20)(1,"legend",25),WC(2,"Integrations"),dl(),vs(3,"p",36),WC(4," Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration. "),dl(),oC(5,pe,7,4,"div",37,le),eC(7,be,4,0),dl()),r&2){let e=mC(2);XE(5),iC(e.integrationRows()),XE(2),tC(e.builtInRows().length>0?7:-1);}}function xe(r,t){if(r&1){let e=dC();vs(0,"li",50),bg(1,"input",51),HI(),vs(2,"button",52),Ag("click",function(){let l=If(e).$implicit,g=mC(3);return wf(g.removeSubAgent(l))}),WC(3," \u{1F5D1} "),dl()();}if(r&2){let e=t.$implicit;XE(),Tg("formControl",e.control),$I();}}function ye(r,t){if(r&1&&(vs(0,"ul",28),oC(1,xe,4,1,"li",50,nC),dl()),r&2){let e=mC(2);XE(),iC(e.subAgentRows());}}function he(r,t){if(r&1){let e=dC();vs(0,"button",53),Ag("click",function(){If(e);let l=mC(2);return wf(l.exportYaml())}),WC(1),dl();}if(r&2){let e=mC(2);Tg("disabled",e.isExporting()),XE(),ml(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function ve(r,t){if(r&1){let e=dC();vs(0,"form",9),Ag("ngSubmit",function(){If(e);let l=mC();return wf(l.submit())}),vs(1,"div",10)(2,"label",11),WC(3,"Name "),vs(4,"span",12),WC(5,"*"),dl()(),bg(6,"input",13),HI(),dl(),vs(7,"div",10)(8,"label",14),WC(9,"Description"),dl(),bg(10,"input",15),HI(),dl(),vs(11,"div",10)(12,"label",16),WC(13,"Model name"),dl(),bg(14,"input",17),HI(),dl(),vs(15,"div",10)(16,"label",18),WC(17,"Instructions"),dl(),bg(18,"textarea",19),HI(),dl(),eC(19,Ce,8,1,"fieldset",20),vs(20,"div",10)(21,"label",21),bg(22,"input",22),HI(),vs(23,"span",23),WC(24,"Advanced mode"),dl()(),vs(25,"p",24),WC(26," When enabled, this agent uses a multi-step reasoning loop instead of a single LLM call. "),dl()(),vs(27,"div",10)(28,"label",21),bg(29,"input",22),HI(),vs(30,"span",23),WC(31,"Enabled"),dl()(),vs(32,"p",24),WC(33,"Disabled agents are excluded from namespace resolution."),dl()(),vs(34,"div",10)(35,"span",25),WC(36,"Sub-agents"),dl(),vs(37,"p",26),WC(38," Glob patterns for agents this agent may delegate to. "),vs(39,"code",27),WC(40,"*"),dl(),WC(41," matches any sequence of characters (e.g.\xA0"),vs(42,"code",27),WC(43,"*Fixer"),dl(),WC(44,", "),vs(45,"code",27),WC(46,"*"),dl(),WC(47," for all). Leave empty to disable delegation. "),dl(),eC(48,ye,3,0,"ul",28),vs(49,"div",29)(50,"input",30),Ag("keydown.enter",function(){If(e);let l=mC();return wf(l.addSubAgent())}),dl(),HI(),vs(51,"button",31),Ag("click",function(){If(e);let l=mC();return wf(l.addSubAgent())}),WC(52," + "),dl()()(),vs(53,"div",32)(54,"button",33),WC(55),dl(),eC(56,he,2,2,"button",34),vs(57,"button",35),Ag("click",function(){If(e);let l=mC();return wf(l.cancel())}),WC(58,"Cancel"),dl()()();}if(r&2){let e=mC();Tg("formGroup",e.form),XE(6),Tg("formControl",e.nameControl),$I(),XE(4),Tg("formControl",e.descriptionControl),$I(),XE(4),Tg("formControl",e.modelNameControl),$I(),XE(4),Tg("formControl",e.instructionsControl),$I(),XE(),tC(e.integrationRows().length>0||e.builtInRows().length>0?19:-1),XE(3),Tg("formControl",e.advancedExecutionControl),$I(),XE(7),Tg("formControl",e.enabledControl),$I(),XE(19),tC(e.subAgentRows().length>0?48:-1),XE(2),Tg("formControl",e.newSubAgentControl),$I(),XE(),Tg("disabled",!e.newSubAgentControl.value.trim()),XE(3),Tg("disabled",e.form.invalid||e.isSubmitting()),XE(),ml(" ",e.isEditMode()?"Save changes":"Create"," "),XE(),tC(e.isEditMode()?56:-1);}}var ae=class r{route=g(V);router=g(G);destroyRef=g(we);agentConfigController=g(M);exportService=g(D);integrationConfigState=g(y);integrationTypeController=g(N);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new z({name:new _t("",{nonNullable:true,validators:[_e$1.required,_e$1.minLength(1)]}),description:new _t(null),modelName:new _t(null),instructions:new _t(null),advancedExecution:new _t(false,{nonNullable:true}),enabled:new _t(false,{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get modelNameControl(){return this.form.controls.modelName}get instructionsControl(){return this.form.controls.instructions}get advancedExecutionControl(){return this.form.controls.advancedExecution}get enabledControl(){return this.form.controls.enabled}subAgentRows=Hi([]);newSubAgentControl=new _t("",{nonNullable:true});isEditMode=Hi(false);isSubmitting=Hi(false);isLoading=Hi(false);isExporting=Hi(false);builtInRows=Hi([]);inspectRoute(){let t=this.route.snapshot.paramMap.get("agentConfigId")??"";return this.isPlatformMode?["/agentos","admin","agent-configs",t,"inspect"]:["/agentos",this.namespaceId,"agent-configs",t,"inspect"]}integrationRows=Hi([]);existingConfig=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("agentConfigId");t?(this.isEditMode.set(true),this.loadConfigAndIntegrations(t)):this.loadIntegrations(void 0);}loadConfigAndIntegrations(t){this.isLoading.set(true),By({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):pa([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes()}).pipe(U(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:o,platformIntegrations:l,builtInTypes:g})=>{this.existingConfig=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null),this.advancedExecutionControl.setValue(e.advancedExecution??false),this.enabledControl.setValue(e.enabled??true);let m=[...l,...o];this.integrationRows.set(this.buildIntegrationRows(m,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(g,e.integrations??void 0)),this.subAgentRows.set((e.subAgents??[]).map(P=>({control:new _t(P,{nonNullable:true})}))),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){By({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):pa([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes()}).pipe(U(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:o,builtInTypes:l})=>{let g=[...o,...e];this.integrationRows.set(this.buildIntegrationRows(g,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(l,t??void 0));}});}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(ue$1(t=>t.filter(e=>!e.configSchema)),ha(t=>(console.error("[agent-config-form] failed to load integration types",t),pa([]))))}buildIntegrationRows(t,e){return t.map(o=>{let l=o.name??"",g=e?.[l],m=e!=null&&l in e,P=Array.isArray(g)?g.join(", "):"";return {config:o,enabled:Hi(m),toolsControl:new _t(P,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(o=>{let l=e!=null&&o.type in e,g=e?.[o.type],m=l?Array.isArray(g)&&g.length===0?"off":"on":"default";return {type:o.type,displayName:o.displayName,description:o.description,enabledByDefault:o.enabledByDefault===true,state:Hi(m),restrictedTools:Array.isArray(g)&&g.length>0?g:null}})}toggleIntegration(t){t.enabled.update(e=>!e);}setBuiltInState(t,e){t.state.set(e);}builtInDefaultLabel(t){return t.enabledByDefault?"Platform default (enabled)":"Platform default (disabled)"}addSubAgent(){let t=this.newSubAgentControl.value.trim();t&&(this.subAgentRows.update(e=>[...e,{control:new _t(t,{nonNullable:true})}]),this.newSubAgentControl.reset(""));}removeSubAgent(t){this.subAgentRows.update(e=>e.filter(o=>o!==t));}buildSubAgentsPayload(){let t=this.subAgentRows().map(e=>e.control.value.trim()).filter(e=>e.length>0);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let o of this.integrationRows().filter(l=>l.enabled())){let l=o.config.name??"",g=o.toolsControl.value.trim();t[l]=g===""?null:g.split(",").map(m=>m.trim()).filter(m=>m.length>0);}for(let o of this.builtInRows()){let l=o.state();l==="on"?t[o.type]=o.restrictedTools??null:l==="off"&&(t[o.type]=[]);}let e=new Set([...this.integrationRows().map(o=>o.config.name??""),...this.builtInRows().map(o=>o.type)]);for(let[o,l]of Object.entries(this.existingConfig?.integrations??{}))e.has(o)||(t[o]=l);return Object.keys(t).length>0?t:void 0}submit(){if(this.form.invalid||this.isSubmitting())return;this.addSubAgent(),this.isSubmitting.set(true);let t=z$1(P({},this.existingConfig??{}),{createdOn:this.existingConfig?.createdOn,updatedOn:this.existingConfig?.updatedOn,namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,modelName:this.modelNameControl.value?.trim()||void 0,instructions:this.instructionsControl.value?.trim()||void 0,integrations:this.buildIntegrationsPayload(),advancedExecution:this.advancedExecutionControl.value,enabled:this.enabledControl.value,subAgents:this.buildSubAgentsPayload()});(this.isEditMode()?this.agentConfigController.updateAgentConfig(this.existingConfig.id??"",t):this.agentConfigController.createAgentConfig(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.exportService.exportAsYaml(t).pipe(U(this.destroyRef)).subscribe({next:e=>{let o=new Blob([e],{type:"application/yaml"}),l=URL.createObjectURL(o),g=document.createElement("a");g.href=l,g.download=`${this.existingConfig?.name??"agent"}.yaml`,g.click(),URL.revokeObjectURL(l),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=Aw({type:r,selectors:[["agentos-agent-config-form"]],decls:12,vars:4,consts:[[1,"agent-config-form"],[1,"agent-config-form__header"],["type","button","title","Back to agent configs",1,"agent-config-form__back",3,"click"],[1,"agent-config-form__back-icon"],[1,"agent-config-form__title"],[1,"agent-config-form__sibling-link",3,"routerLink"],[1,"agent-config-form__platform-badge"],[1,"agent-config-form__loading"],[1,"agent-config-form__form",3,"formGroup"],[1,"agent-config-form__form",3,"ngSubmit","formGroup"],[1,"agent-config-form__field"],["for","agent-config-name",1,"agent-config-form__label"],["aria-hidden","true"],["id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-description",1,"agent-config-form__label"],["id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-model-name",1,"agent-config-form__label"],["id","agent-config-model-name","type","text","placeholder","Optional \u2014 model alias or name to use","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-instructions",1,"agent-config-form__label"],["id","agent-config-instructions","rows","6","placeholder","Optional \u2014 system instructions for this agent",1,"agent-config-form__textarea",3,"formControl"],[1,"agent-config-form__integrations"],[1,"agent-config-form__toggle-label"],["type","checkbox",1,"agent-config-form__toggle-checkbox",3,"formControl"],[1,"agent-config-form__toggle-text"],[1,"agent-config-form__toggle-hint"],[1,"agent-config-form__label"],[1,"agent-config-form__field-hint"],[1,"agent-config-form__code"],[1,"agent-config-form__sub-agent-list"],[1,"agent-config-form__sub-agent-add"],["type","text","placeholder","e.g. *Fixer or *","autocomplete","off",1,"agent-config-form__input","agent-config-form__sub-agent-input",3,"keydown.enter","formControl"],["type","button","title","Add pattern",1,"agent-config-form__sub-agent-btn","agent-config-form__sub-agent-btn--add",3,"click","disabled"],[1,"agent-config-form__actions"],["type","submit",1,"agent-config-form__btn","agent-config-form__btn--primary",3,"disabled"],["type","button",1,"agent-config-form__btn","agent-config-form__btn--export",3,"disabled"],["type","button",1,"agent-config-form__btn",3,"click"],[1,"agent-config-form__integrations-hint"],[1,"agent-config-form__integration-row"],[1,"agent-config-form__integration-toggle"],["type","checkbox",1,"agent-config-form__integration-checkbox",3,"change","checked"],[1,"agent-config-form__integration-name"],[1,"agent-config-form__integration-type"],["type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"agent-config-form__input","agent-config-form__integration-tools",3,"formControl"],[1,"agent-config-form__integrations-separator"],[1,"agent-config-form__integration-state",3,"change","id","value"],["value","default"],["value","on"],["value","off"],[1,"agent-config-form__integration-restriction"],[1,"agent-config-form__integration-builtin-desc"],[1,"agent-config-form__sub-agent-row"],["type","text","autocomplete","off",1,"agent-config-form__input","agent-config-form__sub-agent-input",3,"formControl"],["type","button","title","Remove",1,"agent-config-form__sub-agent-btn","agent-config-form__sub-agent-btn--danger",3,"click"],["type","button",1,"agent-config-form__btn","agent-config-form__btn--export",3,"click","disabled"]],template:function(e,o){e&1&&(vs(0,"div",0)(1,"header",1)(2,"button",2),Ag("click",function(){return o.cancel()}),vs(3,"span",3),WC(4,"\u2190"),dl(),WC(5," Agent Configs "),dl(),vs(6,"h1",4),WC(7),dl(),eC(8,ge,2,1,"a",5),eC(9,se,2,0,"span",6),dl(),eC(10,de,2,0,"p",7)(11,ve,59,14,"form",8),dl()),e&2&&(XE(7),Zg(o.isEditMode()?"Edit agent config":"New agent config"),XE(),tC(o.isEditMode()?8:-1),XE(),tC(o.isPlatformMode?9:-1),XE(),tC(o.isLoading()?10:11));},dependencies:[ni,Jn,Qn,ei,Ye,wt,Zn,Xn,Cn,En,si],styles:[".agent-config-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.agent-config-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-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-accent)}.agent-config-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.agent-config-form__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-accent);text-decoration:none}.agent-config-form__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-form__platform-badge[_ngcontent-%COMP%]{display:inline-block;font-size:.75rem;font-weight:500;color:var(--color-text-secondary);background:var(--color-surface);border:1px solid var(--color-divider);border-radius:0;padding:.125rem .5rem;letter-spacing:.02em;align-self:flex-start}.agent-config-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.agent-config-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.agent-config-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.agent-config-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.agent-config-form__input[_ngcontent-%COMP%], .agent-config-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.agent-config-form__input[_ngcontent-%COMP%]:focus, .agent-config-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.agent-config-form__input[_ngcontent-%COMP%]::placeholder, .agent-config-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.agent-config-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:120px;line-height:1.5}.agent-config-form__integrations[_ngcontent-%COMP%]{border:1px solid var(--color-divider);border-radius:0;padding:1rem;margin:0;display:flex;flex-direction:column;gap:.75rem}.agent-config-form__integrations-hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__integration-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.agent-config-form__integration-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.agent-config-form__integration-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-accent);cursor:pointer}.agent-config-form__integration-name[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text)}.agent-config-form__integration-type[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);font-family:monospace}.agent-config-form__integration-tools[_ngcontent-%COMP%]{margin-left:1.5rem;font-size:.875rem}.agent-config-form__integrations-separator[_ngcontent-%COMP%]{margin:.25rem 0 0;padding-top:.5rem;border-top:1px solid var(--color-divider);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);font-family:var(--font-heading)}.agent-config-form__integration-state[_ngcontent-%COMP%]{margin-left:1.5rem;padding:.375rem .625rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.875rem;font-family:inherit;outline:none;transition:border-color .15s ease}.agent-config-form__integration-state[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.agent-config-form__integration-restriction[_ngcontent-%COMP%]{margin:0 0 0 1.5rem;font-size:.8rem;font-style:italic;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.agent-config-form__integration-builtin-desc[_ngcontent-%COMP%]{margin:0 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__field-hint[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__code[_ngcontent-%COMP%]{font-family:monospace;font-size:.85em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .3em;border-radius:0}.agent-config-form__sub-agent-list[_ngcontent-%COMP%]{list-style:none;margin:.5rem 0 0;padding:0;display:flex;flex-direction:column;gap:.375rem}.agent-config-form__sub-agent-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem}.agent-config-form__sub-agent-input[_ngcontent-%COMP%]{flex:1;min-width:0}.agent-config-form__sub-agent-add[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;margin-top:.5rem}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]{flex-shrink:0;width:2rem;height:2rem;padding:0;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text-secondary);font-size:.9rem;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s ease,border-color .15s ease,color .15s ease}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500);color:var(--color-text)}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]:disabled{opacity:.35;cursor:not-allowed}.agent-config-form__sub-agent-btn--add[_ngcontent-%COMP%]{width:2rem;height:2rem;font-size:1.25rem;font-weight:300;border-color:var(--color-accent);color:var(--color-accent)}.agent-config-form__sub-agent-btn--add[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent);color:#fff}.agent-config-form__sub-agent-btn--danger[_ngcontent-%COMP%]{border:1px solid transparent;color:var(--color-neutral-500)}.agent-config-form__sub-agent-btn--danger[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--red);color:var(--red);background:color-mix(in srgb,var(--red) 10%,transparent)}.agent-config-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.agent-config-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-accent);cursor:pointer}.agent-config-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text)}.agent-config-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.agent-config-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.agent-config-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.agent-config-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.agent-config-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.agent-config-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"]})};export{ae as AgentConfigFormComponent};
|
|
1
|
+
import {y}from'./chunk-BUPJDuFO.js';import {g,ao as V,G,w as we,d8 as M,dk as D,d5 as N,H as Hi,Q as By,S as pa,b as U,u as ue$1,a7 as ha,z as z$1,a as P,A as Aw,s as si,v as vs,l as Ag,W as WC,k as dl,n as eC,X as XE,a8 as Zg,t as tC,ac as mC,r as Tg,a9 as dC,o as bg,a3 as HI,a6 as $I,a5 as ml,q as oC,x as iC,bn as nC,aa as If,ab as wf,C as Cg}from'./main-Z5SI5ZVQ.js';import'./chunk-CK3s5ul2.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,a as wt,Z as Zn,l as Xn,C as Cn,E as En}from'./chunk-BXfg4Cn0.js';import'./chunk-DEYaa_7l.js';import'./chunk-kfNFXWlK.js';import'./chunk-McdsPwbe.js';import'./chunk-CL8NUXXa.js';var le=(r,t)=>t.config.id,ce=(r,t)=>t.type;function ge(r,t){if(r&1&&(vs(0,"a",5),WC(1,"View resolved definition \u2192"),dl()),r&2){let e=mC();Tg("routerLink",e.inspectRoute());}}function se(r,t){r&1&&(vs(0,"span",6),WC(1,"Platform level"),dl());}function de(r,t){r&1&&(vs(0,"p",7),WC(1,"Loading\u2026"),dl());}function me(r,t){if(r&1&&(vs(0,"span",41),WC(1),dl()),r&2){let e=mC().$implicit;XE(),Zg(e.config.integrationType);}}function fe(r,t){if(r&1&&(bg(0,"input",42),HI()),r&2){let e=mC().$implicit;Tg("formControl",e.toolsControl),$I();}}function pe(r,t){if(r&1){let e=dC();vs(0,"div",37)(1,"label",38)(2,"input",39),Ag("change",function(){let l=If(e).$implicit,g=mC(3);return wf(g.toggleIntegration(l))}),dl(),vs(3,"span",40),WC(4),dl(),eC(5,me,2,1,"span",41),dl(),eC(6,fe,1,1,"input",42),dl();}if(r&2){let e=t.$implicit;XE(2),Tg("checked",e.enabled()),XE(2),Zg(e.config.name),XE(),tC(e.config.integrationType?5:-1),XE(),tC(e.enabled()?6:-1);}}function _e(r,t){if(r&1&&(vs(0,"p",48),WC(1),dl()),r&2){let e=mC().$implicit;XE(),ml(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function ue(r,t){if(r&1){let e=dC();vs(0,"div",37)(1,"label",38)(2,"span",40),WC(3),dl(),vs(4,"span",41),WC(5,"built-in"),dl()(),vs(6,"select",44),Ag("change",function(l){let g=If(e).$implicit,m=mC(4);return wf(m.setBuiltInState(g,l.target.value))}),vs(7,"option",45),WC(8),dl(),vs(9,"option",46),WC(10,"Enabled"),dl(),vs(11,"option",47),WC(12,"Disabled"),dl()(),eC(13,_e,2,1,"p",48),vs(14,"p",49),WC(15),dl()();}if(r&2){let e=t.$implicit,o=mC(4);XE(),Cg("for","built-in-"+e.type),XE(2),Zg(e.displayName),XE(3),Tg("id","built-in-"+e.type)("value",e.state()),XE(2),Zg(o.builtInDefaultLabel(e)),XE(5),tC(e.state()==="on"&&e.restrictedTools?13:-1),XE(2),Zg(e.description);}}function be(r,t){if(r&1&&(vs(0,"p",43),WC(1,"Built-in integrations"),dl(),oC(2,ue,16,7,"div",37,ce)),r&2){let e=mC(3);XE(2),iC(e.builtInRows());}}function Ce(r,t){if(r&1&&(vs(0,"fieldset",20)(1,"legend",25),WC(2,"Integrations"),dl(),vs(3,"p",36),WC(4," Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration. "),dl(),oC(5,pe,7,4,"div",37,le),eC(7,be,4,0),dl()),r&2){let e=mC(2);XE(5),iC(e.integrationRows()),XE(2),tC(e.builtInRows().length>0?7:-1);}}function xe(r,t){if(r&1){let e=dC();vs(0,"li",50),bg(1,"input",51),HI(),vs(2,"button",52),Ag("click",function(){let l=If(e).$implicit,g=mC(3);return wf(g.removeSubAgent(l))}),WC(3," \u{1F5D1} "),dl()();}if(r&2){let e=t.$implicit;XE(),Tg("formControl",e.control),$I();}}function ye(r,t){if(r&1&&(vs(0,"ul",28),oC(1,xe,4,1,"li",50,nC),dl()),r&2){let e=mC(2);XE(),iC(e.subAgentRows());}}function he(r,t){if(r&1){let e=dC();vs(0,"button",53),Ag("click",function(){If(e);let l=mC(2);return wf(l.exportYaml())}),WC(1),dl();}if(r&2){let e=mC(2);Tg("disabled",e.isExporting()),XE(),ml(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function ve(r,t){if(r&1){let e=dC();vs(0,"form",9),Ag("ngSubmit",function(){If(e);let l=mC();return wf(l.submit())}),vs(1,"div",10)(2,"label",11),WC(3,"Name "),vs(4,"span",12),WC(5,"*"),dl()(),bg(6,"input",13),HI(),dl(),vs(7,"div",10)(8,"label",14),WC(9,"Description"),dl(),bg(10,"input",15),HI(),dl(),vs(11,"div",10)(12,"label",16),WC(13,"Model name"),dl(),bg(14,"input",17),HI(),dl(),vs(15,"div",10)(16,"label",18),WC(17,"Instructions"),dl(),bg(18,"textarea",19),HI(),dl(),eC(19,Ce,8,1,"fieldset",20),vs(20,"div",10)(21,"label",21),bg(22,"input",22),HI(),vs(23,"span",23),WC(24,"Advanced mode"),dl()(),vs(25,"p",24),WC(26," When enabled, this agent uses a multi-step reasoning loop instead of a single LLM call. "),dl()(),vs(27,"div",10)(28,"label",21),bg(29,"input",22),HI(),vs(30,"span",23),WC(31,"Enabled"),dl()(),vs(32,"p",24),WC(33,"Disabled agents are excluded from namespace resolution."),dl()(),vs(34,"div",10)(35,"span",25),WC(36,"Sub-agents"),dl(),vs(37,"p",26),WC(38," Glob patterns for agents this agent may delegate to. "),vs(39,"code",27),WC(40,"*"),dl(),WC(41," matches any sequence of characters (e.g.\xA0"),vs(42,"code",27),WC(43,"*Fixer"),dl(),WC(44,", "),vs(45,"code",27),WC(46,"*"),dl(),WC(47," for all). Leave empty to disable delegation. "),dl(),eC(48,ye,3,0,"ul",28),vs(49,"div",29)(50,"input",30),Ag("keydown.enter",function(){If(e);let l=mC();return wf(l.addSubAgent())}),dl(),HI(),vs(51,"button",31),Ag("click",function(){If(e);let l=mC();return wf(l.addSubAgent())}),WC(52," + "),dl()()(),vs(53,"div",32)(54,"button",33),WC(55),dl(),eC(56,he,2,2,"button",34),vs(57,"button",35),Ag("click",function(){If(e);let l=mC();return wf(l.cancel())}),WC(58,"Cancel"),dl()()();}if(r&2){let e=mC();Tg("formGroup",e.form),XE(6),Tg("formControl",e.nameControl),$I(),XE(4),Tg("formControl",e.descriptionControl),$I(),XE(4),Tg("formControl",e.modelNameControl),$I(),XE(4),Tg("formControl",e.instructionsControl),$I(),XE(),tC(e.integrationRows().length>0||e.builtInRows().length>0?19:-1),XE(3),Tg("formControl",e.advancedExecutionControl),$I(),XE(7),Tg("formControl",e.enabledControl),$I(),XE(19),tC(e.subAgentRows().length>0?48:-1),XE(2),Tg("formControl",e.newSubAgentControl),$I(),XE(),Tg("disabled",!e.newSubAgentControl.value.trim()),XE(3),Tg("disabled",e.form.invalid||e.isSubmitting()),XE(),ml(" ",e.isEditMode()?"Save changes":"Create"," "),XE(),tC(e.isEditMode()?56:-1);}}var ae=class r{route=g(V);router=g(G);destroyRef=g(we);agentConfigController=g(M);exportService=g(D);integrationConfigState=g(y);integrationTypeController=g(N);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new z({name:new _t("",{nonNullable:true,validators:[_e$1.required,_e$1.minLength(1)]}),description:new _t(null),modelName:new _t(null),instructions:new _t(null),advancedExecution:new _t(false,{nonNullable:true}),enabled:new _t(false,{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get modelNameControl(){return this.form.controls.modelName}get instructionsControl(){return this.form.controls.instructions}get advancedExecutionControl(){return this.form.controls.advancedExecution}get enabledControl(){return this.form.controls.enabled}subAgentRows=Hi([]);newSubAgentControl=new _t("",{nonNullable:true});isEditMode=Hi(false);isSubmitting=Hi(false);isLoading=Hi(false);isExporting=Hi(false);builtInRows=Hi([]);inspectRoute(){let t=this.route.snapshot.paramMap.get("agentConfigId")??"";return this.isPlatformMode?["/agentos","admin","agent-configs",t,"inspect"]:["/agentos",this.namespaceId,"agent-configs",t,"inspect"]}integrationRows=Hi([]);existingConfig=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("agentConfigId");t?(this.isEditMode.set(true),this.loadConfigAndIntegrations(t)):this.loadIntegrations(void 0);}loadConfigAndIntegrations(t){this.isLoading.set(true),By({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):pa([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes()}).pipe(U(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:o,platformIntegrations:l,builtInTypes:g})=>{this.existingConfig=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null),this.advancedExecutionControl.setValue(e.advancedExecution??false),this.enabledControl.setValue(e.enabled??true);let m=[...l,...o];this.integrationRows.set(this.buildIntegrationRows(m,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(g,e.integrations??void 0)),this.subAgentRows.set((e.subAgents??[]).map(P=>({control:new _t(P,{nonNullable:true})}))),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){By({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):pa([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes()}).pipe(U(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:o,builtInTypes:l})=>{let g=[...o,...e];this.integrationRows.set(this.buildIntegrationRows(g,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(l,t??void 0));}});}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(ue$1(t=>t.filter(e=>!e.configSchema)),ha(t=>(console.error("[agent-config-form] failed to load integration types",t),pa([]))))}buildIntegrationRows(t,e){return t.map(o=>{let l=o.name??"",g=e?.[l],m=e!=null&&l in e,P=Array.isArray(g)?g.join(", "):"";return {config:o,enabled:Hi(m),toolsControl:new _t(P,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(o=>{let l=e!=null&&o.type in e,g=e?.[o.type],m=l?Array.isArray(g)&&g.length===0?"off":"on":"default";return {type:o.type,displayName:o.displayName,description:o.description,enabledByDefault:o.enabledByDefault===true,state:Hi(m),restrictedTools:Array.isArray(g)&&g.length>0?g:null}})}toggleIntegration(t){t.enabled.update(e=>!e);}setBuiltInState(t,e){t.state.set(e);}builtInDefaultLabel(t){return t.enabledByDefault?"Platform default (enabled)":"Platform default (disabled)"}addSubAgent(){let t=this.newSubAgentControl.value.trim();t&&(this.subAgentRows.update(e=>[...e,{control:new _t(t,{nonNullable:true})}]),this.newSubAgentControl.reset(""));}removeSubAgent(t){this.subAgentRows.update(e=>e.filter(o=>o!==t));}buildSubAgentsPayload(){let t=this.subAgentRows().map(e=>e.control.value.trim()).filter(e=>e.length>0);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let o of this.integrationRows().filter(l=>l.enabled())){let l=o.config.name??"",g=o.toolsControl.value.trim();t[l]=g===""?null:g.split(",").map(m=>m.trim()).filter(m=>m.length>0);}for(let o of this.builtInRows()){let l=o.state();l==="on"?t[o.type]=o.restrictedTools??null:l==="off"&&(t[o.type]=[]);}let e=new Set([...this.integrationRows().map(o=>o.config.name??""),...this.builtInRows().map(o=>o.type)]);for(let[o,l]of Object.entries(this.existingConfig?.integrations??{}))e.has(o)||(t[o]=l);return Object.keys(t).length>0?t:void 0}submit(){if(this.form.invalid||this.isSubmitting())return;this.addSubAgent(),this.isSubmitting.set(true);let t=z$1(P({},this.existingConfig??{}),{createdOn:this.existingConfig?.createdOn,updatedOn:this.existingConfig?.updatedOn,namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,modelName:this.modelNameControl.value?.trim()||void 0,instructions:this.instructionsControl.value?.trim()||void 0,integrations:this.buildIntegrationsPayload(),advancedExecution:this.advancedExecutionControl.value,enabled:this.enabledControl.value,subAgents:this.buildSubAgentsPayload()});(this.isEditMode()?this.agentConfigController.updateAgentConfig(this.existingConfig.id??"",t):this.agentConfigController.createAgentConfig(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.exportService.exportAsYaml(t).pipe(U(this.destroyRef)).subscribe({next:e=>{let o=new Blob([e],{type:"application/yaml"}),l=URL.createObjectURL(o),g=document.createElement("a");g.href=l,g.download=`${this.existingConfig?.name??"agent"}.yaml`,g.click(),URL.revokeObjectURL(l),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=Aw({type:r,selectors:[["agentos-agent-config-form"]],decls:12,vars:4,consts:[[1,"agent-config-form"],[1,"agent-config-form__header"],["type","button","title","Back to agent configs",1,"agent-config-form__back",3,"click"],[1,"agent-config-form__back-icon"],[1,"agent-config-form__title"],[1,"agent-config-form__sibling-link",3,"routerLink"],[1,"agent-config-form__platform-badge"],[1,"agent-config-form__loading"],[1,"agent-config-form__form",3,"formGroup"],[1,"agent-config-form__form",3,"ngSubmit","formGroup"],[1,"agent-config-form__field"],["for","agent-config-name",1,"agent-config-form__label"],["aria-hidden","true"],["id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-description",1,"agent-config-form__label"],["id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-model-name",1,"agent-config-form__label"],["id","agent-config-model-name","type","text","placeholder","Optional \u2014 model alias or name to use","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-instructions",1,"agent-config-form__label"],["id","agent-config-instructions","rows","6","placeholder","Optional \u2014 system instructions for this agent",1,"agent-config-form__textarea",3,"formControl"],[1,"agent-config-form__integrations"],[1,"agent-config-form__toggle-label"],["type","checkbox",1,"agent-config-form__toggle-checkbox",3,"formControl"],[1,"agent-config-form__toggle-text"],[1,"agent-config-form__toggle-hint"],[1,"agent-config-form__label"],[1,"agent-config-form__field-hint"],[1,"agent-config-form__code"],[1,"agent-config-form__sub-agent-list"],[1,"agent-config-form__sub-agent-add"],["type","text","placeholder","e.g. *Fixer or *","autocomplete","off",1,"agent-config-form__input","agent-config-form__sub-agent-input",3,"keydown.enter","formControl"],["type","button","title","Add pattern",1,"agent-config-form__sub-agent-btn","agent-config-form__sub-agent-btn--add",3,"click","disabled"],[1,"agent-config-form__actions"],["type","submit",1,"agent-config-form__btn","agent-config-form__btn--primary",3,"disabled"],["type","button",1,"agent-config-form__btn","agent-config-form__btn--export",3,"disabled"],["type","button",1,"agent-config-form__btn",3,"click"],[1,"agent-config-form__integrations-hint"],[1,"agent-config-form__integration-row"],[1,"agent-config-form__integration-toggle"],["type","checkbox",1,"agent-config-form__integration-checkbox",3,"change","checked"],[1,"agent-config-form__integration-name"],[1,"agent-config-form__integration-type"],["type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"agent-config-form__input","agent-config-form__integration-tools",3,"formControl"],[1,"agent-config-form__integrations-separator"],[1,"agent-config-form__integration-state",3,"change","id","value"],["value","default"],["value","on"],["value","off"],[1,"agent-config-form__integration-restriction"],[1,"agent-config-form__integration-builtin-desc"],[1,"agent-config-form__sub-agent-row"],["type","text","autocomplete","off",1,"agent-config-form__input","agent-config-form__sub-agent-input",3,"formControl"],["type","button","title","Remove",1,"agent-config-form__sub-agent-btn","agent-config-form__sub-agent-btn--danger",3,"click"],["type","button",1,"agent-config-form__btn","agent-config-form__btn--export",3,"click","disabled"]],template:function(e,o){e&1&&(vs(0,"div",0)(1,"header",1)(2,"button",2),Ag("click",function(){return o.cancel()}),vs(3,"span",3),WC(4,"\u2190"),dl(),WC(5," Agent Configs "),dl(),vs(6,"h1",4),WC(7),dl(),eC(8,ge,2,1,"a",5),eC(9,se,2,0,"span",6),dl(),eC(10,de,2,0,"p",7)(11,ve,59,14,"form",8),dl()),e&2&&(XE(7),Zg(o.isEditMode()?"Edit agent config":"New agent config"),XE(),tC(o.isEditMode()?8:-1),XE(),tC(o.isPlatformMode?9:-1),XE(),tC(o.isLoading()?10:11));},dependencies:[ni,Jn,Qn,ei,Ye,wt,Zn,Xn,Cn,En,si],styles:[".agent-config-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.agent-config-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-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-accent)}.agent-config-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.agent-config-form__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-accent);text-decoration:none}.agent-config-form__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-form__platform-badge[_ngcontent-%COMP%]{display:inline-block;font-size:.75rem;font-weight:500;color:var(--color-text-secondary);background:var(--color-surface);border:1px solid var(--color-divider);border-radius:0;padding:.125rem .5rem;letter-spacing:.02em;align-self:flex-start}.agent-config-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.agent-config-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.agent-config-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.agent-config-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.agent-config-form__input[_ngcontent-%COMP%], .agent-config-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.agent-config-form__input[_ngcontent-%COMP%]:focus, .agent-config-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.agent-config-form__input[_ngcontent-%COMP%]::placeholder, .agent-config-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.agent-config-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:120px;line-height:1.5}.agent-config-form__integrations[_ngcontent-%COMP%]{border:1px solid var(--color-divider);border-radius:0;padding:1rem;margin:0;display:flex;flex-direction:column;gap:.75rem}.agent-config-form__integrations-hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__integration-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.agent-config-form__integration-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.agent-config-form__integration-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-accent);cursor:pointer}.agent-config-form__integration-name[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text)}.agent-config-form__integration-type[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);font-family:monospace}.agent-config-form__integration-tools[_ngcontent-%COMP%]{margin-left:1.5rem;font-size:.875rem}.agent-config-form__integrations-separator[_ngcontent-%COMP%]{margin:.25rem 0 0;padding-top:.5rem;border-top:1px solid var(--color-divider);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);font-family:var(--font-heading)}.agent-config-form__integration-state[_ngcontent-%COMP%]{margin-left:1.5rem;padding:.375rem .625rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.875rem;font-family:inherit;outline:none;transition:border-color .15s ease}.agent-config-form__integration-state[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.agent-config-form__integration-restriction[_ngcontent-%COMP%]{margin:0 0 0 1.5rem;font-size:.8rem;font-style:italic;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.agent-config-form__integration-builtin-desc[_ngcontent-%COMP%]{margin:0 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__field-hint[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__code[_ngcontent-%COMP%]{font-family:monospace;font-size:.85em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .3em;border-radius:0}.agent-config-form__sub-agent-list[_ngcontent-%COMP%]{list-style:none;margin:.5rem 0 0;padding:0;display:flex;flex-direction:column;gap:.375rem}.agent-config-form__sub-agent-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem}.agent-config-form__sub-agent-input[_ngcontent-%COMP%]{flex:1;min-width:0}.agent-config-form__sub-agent-add[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;margin-top:.5rem}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]{flex-shrink:0;width:2rem;height:2rem;padding:0;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text-secondary);font-size:.9rem;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s ease,border-color .15s ease,color .15s ease}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500);color:var(--color-text)}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]:disabled{opacity:.35;cursor:not-allowed}.agent-config-form__sub-agent-btn--add[_ngcontent-%COMP%]{width:2rem;height:2rem;font-size:1.25rem;font-weight:300;border-color:var(--color-accent);color:var(--color-accent)}.agent-config-form__sub-agent-btn--add[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent);color:#fff}.agent-config-form__sub-agent-btn--danger[_ngcontent-%COMP%]{border:1px solid transparent;color:var(--color-neutral-500)}.agent-config-form__sub-agent-btn--danger[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--red);color:var(--red);background:color-mix(in srgb,var(--red) 10%,transparent)}.agent-config-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.agent-config-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-accent);cursor:pointer}.agent-config-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text)}.agent-config-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.agent-config-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.agent-config-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.agent-config-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.agent-config-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.agent-config-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"]})};export{ae as AgentConfigFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {i}from'./chunk-
|
|
1
|
+
import {i}from'./chunk-DEYaa_7l.js';import {u}from'./chunk-CK3s5ul2.js';import {g as g$1,dd as $,aI as Tr,aD as Ly,bR as ga,a7 as ha,S as pa,u as ue,cD as Rd,bT as Od,a as P,Y as x}from'./main-Z5SI5ZVQ.js';var g="none",N="me",O=class p{nsController=g$1($);userState=g$1(u);refresh$=new Tr(void 0);namespaceId$=new Tr(null);vm$=Ly([this.namespaceId$,this.refresh$]).pipe(ga(([e])=>{let r=this.loadPlatformProviders().pipe(ha(()=>pa([])));return e?Ly([r,this.loadNamespaceProviders(e).pipe(ha(()=>pa([]))),this.loadUserProviders(e).pipe(ha(()=>pa([]))),this.loadUserProviders("global").pipe(ha(()=>pa([])))]).pipe(ue(([i,n,s,t])=>({platform:i,namespace:n,userOnNs:s,userGlobal:t}))):Ly([r,this.loadNamespaceProviders("").pipe(ha(()=>pa([]))),this.loadUserProviders("global").pipe(ha(()=>pa([])))]).pipe(ue(([i,n,s])=>({platform:i,namespace:n,userOnNs:[],userGlobal:s})))}),Rd({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadUserProviders(e){let r=e==="global"?g:e;return this.nsController.listAiProvider(r,N)}userGlobal$=i(this.refresh$,()=>this.loadUserProviders("global"),[]);loadPlatformProviders(){return this.nsController.listAiProvider(g)}loadNamespaceProviders(e){return e?this.nsController.listAiProvider(e):pa([])}getById(e,r){return this.nsController.getByIdAiProvider(e)}create(e,r,i){let s=this.userState.currentUser()?.id;if((r==="userOnNs"||r==="userGlobal")&&!s)throw new Error(`Cannot create ${r} provider before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(r==="namespace"){if(i===void 0||i==="")throw new Error("Cannot create namespace-scoped provider without a namespaceId");let S={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,namespaceId:i??void 0};return this.nsController.createAiProvider(S).pipe(Od(()=>this.refresh()))}if(r==="userOnNs"&&!i)throw new Error("Cannot create userOnNs provider without a namespaceId");let t={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,userId:s,namespaceId:r==="userOnNs"?i:void 0};return this.nsController.createAiProvider(t).pipe(Od(()=>this.refresh()))}update(e,r,i,n){let s=r.apiKey===null?{}:{apiKey:r.apiKey},t=P({name:r.name,apiType:r.apiType,description:r.description,baseUrl:r.baseUrl,headers:r.headers??void 0,namespaceId:n.namespaceId,userId:n.userId},s);return this.nsController.updateAiProvider(e,t).pipe(Od(()=>this.refresh()))}delete(e,r){return this.nsController.deleteAiProvider(e).pipe(Od(()=>this.refresh()))}static \u0275fac=function(r){return new(r||p)};static \u0275prov=x({token:p,factory:p.\u0275fac,providedIn:"root"})};export{O};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {i}from'./chunk-
|
|
1
|
+
import {i}from'./chunk-DEYaa_7l.js';import {u}from'./chunk-CK3s5ul2.js';import {g,d6 as U$1,aI as Tr,aD as Ly,bR as ga,a7 as ha,S as pa,u as ue,cD as Rd,z as z$1,a as P,bT as Od,Y as x}from'./main-Z5SI5ZVQ.js';var q=["ApiKeyAuthSetting","BasicAuthAuthSetting","BearerTokenAuthSetting","OAuthDiscoverableAuthSetting","OAuthMcpDiscoverableAuthSetting","OAuthCustomAuthSetting","OAuthRegisteredAuthSetting"],J={ApiKeyAuthSetting:"API Key",BasicAuthAuthSetting:"Basic Auth (username / password)",BearerTokenAuthSetting:"Bearer Token",OAuthDiscoverableAuthSetting:"OAuth \u2014 Discovery URL",OAuthMcpDiscoverableAuthSetting:"OAuth \u2014 MCP Discoverable",OAuthCustomAuthSetting:"OAuth \u2014 Custom endpoints",OAuthRegisteredAuthSetting:"OAuth \u2014 Registered app"},_="none",C="me",I={ApiKeyAuthSetting:"API_KEY",BasicAuthAuthSetting:"BASIC_AUTH",BearerTokenAuthSetting:"BEARER_TOKEN",OAuthDiscoverableAuthSetting:"OAUTH_DISCOVERABLE",OAuthMcpDiscoverableAuthSetting:"OAUTH_MCP_DISCOVERABLE",OAuthCustomAuthSetting:"OAUTH_CUSTOM",OAuthRegisteredAuthSetting:"OAUTH_REGISTERED"},U={API_KEY:"ApiKeyAuthSetting",BASIC_AUTH:"BasicAuthAuthSetting",BEARER_TOKEN:"BearerTokenAuthSetting",OAUTH_DISCOVERABLE:"OAuthDiscoverableAuthSetting",OAUTH_MCP_DISCOVERABLE:"OAuthMcpDiscoverableAuthSetting",OAUTH_CUSTOM:"OAuthCustomAuthSetting",OAUTH_REGISTERED:"OAuthRegisteredAuthSetting"};function E(n){let t=I[n.authType];return t?z$1(P({},n),{authType:t}):n}function d(n){return R(n)}function O(n){return n.map(R)}function R(n){let t=n;if(typeof t.authType=="string"){let e=U[t.authType];if(e)return z$1(P({},t),{authType:e})}return n}var v=class n{controller=g(U$1);userState=g(u);refresh$=new Tr(void 0);namespaceId$=new Tr(null);vm$=Ly([this.namespaceId$,this.refresh$]).pipe(ga(([t])=>{let e=this.loadPlatformSettings().pipe(ha(()=>pa([])));return t?Ly([e,this.loadNamespaceSettings(t).pipe(ha(()=>pa([]))),this.loadUserSettings(t).pipe(ha(()=>pa([]))),this.loadUserSettings("global").pipe(ha(()=>pa([])))]).pipe(ue(([i,s,u,p])=>({platform:i,namespace:s,userOnNs:u,userGlobal:p}))):Ly([e,this.loadNamespaceSettings("").pipe(ha(()=>pa([]))),this.loadUserSettings("global").pipe(ha(()=>pa([])))]).pipe(ue(([i,s,u])=>({platform:i,namespace:s,userOnNs:[],userGlobal:u})))}),Rd({bufferSize:1,refCount:true}));setNamespace(t){this.namespaceId$.value!==t&&this.namespaceId$.next(t);}refresh(){this.refresh$.next();}loadUserSettings(t){let e=t==="global"?_:t;return this.controller.listAuthSetting(e,C).pipe(ue(i=>O(i)))}userGlobal$=i(this.refresh$,()=>this.loadUserSettings("global"),[]);loadPlatformSettings(){return this.controller.listAuthSetting().pipe(ue(t=>O(t)))}loadNamespaceSettings(t){return t?this.controller.listAuthSetting(t).pipe(ue(e=>O(e))):pa([])}getById(t,e){return this.controller.getByIdAuthSetting(t).pipe(ue(i=>d(i)))}create(t,e,i){let u=this.userState.currentUser()?.id;if((e==="userOnNs"||e==="userGlobal")&&!u)throw new Error(`Cannot create ${e} auth setting before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(e==="namespace"&&(i===void 0||i===""))throw new Error("Cannot create namespace-scoped auth setting without a namespaceId");if(e==="userOnNs"&&!i)throw new Error("Cannot create userOnNs auth setting without a namespaceId");let p=E(z$1(P({},t),{namespaceId:e==="namespace"||e==="userOnNs"?i??void 0:void 0,userId:e==="userOnNs"||e==="userGlobal"?u:void 0}));return this.controller.createAuthSetting(p).pipe(ue(B=>d(B)),Od(()=>this.refresh()))}update(t,e,i){let s=E(z$1(P({},e),{namespaceId:i.namespaceId,userId:i.userId,authType:i.authType}));return this.controller.updateAuthSetting(t,s).pipe(ue(u=>d(u)),Od(()=>this.refresh()))}delete(t,e){return this.controller.deleteAuthSetting(t).pipe(Od(()=>this.refresh()))}static \u0275fac=function(e){return new(e||n)};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};export{J,q,v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {O}from'./chunk-
|
|
1
|
+
import {O}from'./chunk-DCcqC6CZ.js';import {g,G,w as we,d8 as M,aI as Tr,bR as ga,u as ue,b as U,A as Aw,aJ as Nb,v as vs,be as aT,l as Ag,k as dl,af as Dg,T as TC,r as Tg,bf as uT,ah as rT,n as eC,ac as mC,t as tC,a9 as dC,aa as If,ab as wf,ag as fT}from'./main-Z5SI5ZVQ.js';import {W as Wn,D as De}from'./chunk-McdsPwbe.js';import'./chunk-CL8NUXXa.js';import'./chunk-BXfg4Cn0.js';var S=()=>[];function F(n,t){if(n&1){let e=dC();vs(0,"agentos-agent-config-item",4),Ag("deleteRequested",function(o){If(e);let E=mC(2);return wf(E.deleteConfig(o))}),dl();}n&2&&Tg("config",t)("platformMode",true);}function L(n,t){if(n&1&&eC(0,F,1,2,"agentos-agent-config-item",3),n&2){let e,i=t.$implicit,o=mC();tC((e=o.resolveConfig(i.id))?0:-1,e);}}var D=class n{router=g(G);destroyRef=g(we);agentConfigController=g(M);refresh$=new Tr(void 0);configs$=this.refresh$.pipe(ga(()=>this.agentConfigController.listPlatformAgentsAgentConfig(true)));configItems$=this.configs$.pipe(ue(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.description}))));configsById=new Map;constructor(){this.configs$.pipe(U(this.destroyRef)).subscribe(t=>{this.configsById=new Map(t.map(e=>[e.id??"",e]));});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","agent-configs","new"]);}deleteConfig(t){this.agentConfigController.deleteAgentConfig(t.id??"").pipe(U(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolveConfig(t){return this.configsById.get(t)??null}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Aw({type:n,selectors:[["agentos-platform-agent-configs"]],decls:5,vars:6,consts:[["agentConfigItemTpl",""],["title","Platform Agent Configs","emptyMessage","No platform agent configs defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"config","platformMode"],[3,"deleteRequested","config","platformMode"]],template:function(e,i){if(e&1&&(vs(0,"ds-entity-list",1),aT(1,"async"),Ag("createRequested",function(){return i.openCreateForm()}),vs(2,"ds-icon-button",2),Ag("action",function(){return i.goBack()}),dl()(),Dg(3,L,1,1,"ng-template",null,0,fT)),e&2){let o=TC(4);Tg("items",uT(1,3,i.configItems$)??rT(5,S))("showCreate",true)("itemTemplate",o);}},dependencies:[Wn,O,De,Nb],styles:[".platform-agent-configs__back[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.platform-agent-configs__back[_ngcontent-%COMP%]:hover{text-decoration:underline}"]})};export{D as PlatformAgentConfigsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {g,G,ca as hB,cb as pB,H as Hi,A as Aw,v as vs,W as WC,k as dl,n as eC,y as Hg,X as XE,a8 as Zg,t as tC,ac as mC,a9 as dC,l as Ag,r as Tg,aa as If,ab as wf}from'./main-
|
|
1
|
+
import {g,G,ca as hB,cb as pB,H as Hi,A as Aw,v as vs,W as WC,k as dl,n as eC,y as Hg,X as XE,a8 as Zg,t as tC,ac as mC,a9 as dC,l as Ag,r as Tg,aa as If,ab as wf}from'./main-Z5SI5ZVQ.js';import {Z as Zn,D as De}from'./chunk-McdsPwbe.js';function k(t,r){if(t&1&&(vs(0,"span",3),WC(1),dl()),t&2){let e=mC();XE(),Zg(e.prompt().description);}}function S(t,r){if(t&1){let e=dC();vs(0,"span",6),WC(1,"Delete?"),dl(),vs(2,"ds-icon-button",7),Ag("action",function(){If(e);let m=mC();return wf(m.onDeleteConfirmed())}),dl(),vs(3,"ds-icon-button",8),Ag("action",function(){If(e);let m=mC();return wf(m.onDeleteCancelled())}),dl();}}function E(t,r){if(t&1){let e=dC();vs(0,"ds-kebab-menu",9),Ag("itemSelected",function(m){If(e);let O=mC();return wf(O.onMenuAction(m))}),dl();}if(t&2){let e=mC();Tg("items",e.menuItems);}}var I=class t{router=g(G);prompt=hB.required();namespaceId=hB(void 0);platformMode=hB(false);readOnly=hB(false);deleteRequested=pB();pendingDelete=Hi(false);menuItems=[{key:"edit",label:"Edit prompt",icon:"edit"},{key:"delete",label:"Delete prompt",icon:"delete",variant:"danger"}];onMenuAction(r){switch(r){case "edit":this.platformMode()?this.router.navigate(["/agentos","admin","prompts",this.prompt().id,"edit"]):this.router.navigate(["/agentos",this.namespaceId(),"prompts",this.prompt().id,"edit"]);break;case "delete":this.pendingDelete.set(true);break}}onDeleteConfirmed(){this.pendingDelete.set(false),this.deleteRequested.emit(this.prompt());}onDeleteCancelled(){this.pendingDelete.set(false);}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=Aw({type:t,selectors:[["agentos-prompt-item"]],inputs:{prompt:[1,"prompt"],namespaceId:[1,"namespaceId"],platformMode:[1,"platformMode"],readOnly:[1,"readOnly"]},outputs:{deleteRequested:"deleteRequested"},decls:8,vars:5,consts:[["role","listitem",1,"prompt-item"],[1,"prompt-item__body"],[1,"prompt-item__name"],[1,"prompt-item__description"],[1,"prompt-item__actions"],[3,"items"],[1,"prompt-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],[3,"itemSelected","items"]],template:function(e,o){e&1&&(vs(0,"div",0)(1,"div",1)(2,"span",2),WC(3),dl(),eC(4,k,2,1,"span",3),dl(),vs(5,"div",4),eC(6,S,4,0)(7,E,1,1,"ds-kebab-menu",5),dl()()),e&2&&(Hg("prompt-item--pending-delete",o.pendingDelete()),XE(3),Zg(o.prompt().name),XE(),tC(o.prompt().description?4:-1),XE(2),tC(o.pendingDelete()?6:o.readOnly()?-1:7));},dependencies:[Zn,De],styles:[".prompt-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:10px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));transition:background .15s ease,border-color .15s ease}.prompt-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.prompt-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.prompt-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.prompt-item__description[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.prompt-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.prompt-item[_ngcontent-%COMP%]:hover .prompt-item__actions[_ngcontent-%COMP%], .prompt-item[_ngcontent-%COMP%]:focus-within .prompt-item__actions[_ngcontent-%COMP%], .prompt-item--pending-delete[_ngcontent-%COMP%] .prompt-item__actions[_ngcontent-%COMP%]{opacity:1}.prompt-item__confirm-label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:500;color:var(--color-error, #ff3b30);margin-right:.25rem;white-space:nowrap}"]})};export{I};
|