@whoz-oss/coday-client 0.249.2 → 0.249.4
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-Tnt17Uum.js → chunk-2TapTaXG.js} +1 -1
- package/browser/{chunk-otU95DGd.js → chunk-6tHPoek7.js} +1 -1
- package/browser/{chunk-DF9JuMSS.js → chunk-B-LBXHg-.js} +1 -1
- package/browser/{chunk-DATqkmXk.js → chunk-B0kyFx_y.js} +1 -1
- package/browser/{chunk-CSWaefpi.js → chunk-B4aBp6WW.js} +1 -1
- package/browser/{chunk-DIeUX6U7.js → chunk-B6DehsQ-.js} +1 -1
- package/browser/{chunk-rdNDu_G5.js → chunk-B6HBR6l3.js} +1 -1
- package/browser/{chunk-B0QeL_YS.js → chunk-BC_2TEa6.js} +1 -1
- package/browser/{chunk-Dh70Sw4n.js → chunk-BLwyktBH.js} +1 -1
- package/browser/{chunk-ZgaZX2Mw.js → chunk-BPTzJwdV.js} +1 -1
- package/browser/{chunk-B4ZxVpmQ.js → chunk-BRKM9jBe.js} +1 -1
- package/browser/{chunk-Bb8FM5N7.js → chunk-BTNW2iz6.js} +1 -1
- package/browser/{chunk-BXRE8Jnn.js → chunk-BT_iRqki.js} +1 -1
- package/browser/{chunk-Dv3y4cq8.js → chunk-BUF2p97y.js} +1 -1
- package/browser/{chunk-6uQvW5vO.js → chunk-BWdSq8vF.js} +1 -1
- package/browser/chunk-BY3C8HLz.js +276 -0
- package/browser/{chunk-D36CcRIa.js → chunk-BYD-ZEqa.js} +1 -1
- package/browser/{chunk-hivMYdms.js → chunk-BZZR3aP2.js} +1 -1
- package/browser/{chunk-BYobt-yL.js → chunk-B_crlzIY.js} +1 -1
- package/browser/{chunk-CyUSpM0s.js → chunk-BaP2JhEB.js} +1 -1
- package/browser/{chunk-8QCOKWfy.js → chunk-Bggbx31H.js} +1 -1
- package/browser/{chunk-BXeg32ej.js → chunk-BhlAZzwj.js} +1 -1
- package/browser/{chunk-Bo7V2O_x.js → chunk-Bi0_x9sA.js} +1 -1
- package/browser/{chunk-CMgbU-FY.js → chunk-BkD_xP5e.js} +1 -1
- package/browser/{chunk-CtCrz21E.js → chunk-BlR-g_sS.js} +1 -1
- package/browser/{chunk-ChlM0KaI.js → chunk-BtVK9hVG.js} +1 -1
- package/browser/{chunk-R1YuCBfk.js → chunk-BzkpZO0i.js} +1 -1
- package/browser/{chunk-Dc58xQxP.js → chunk-C4iXIN7X.js} +1 -1
- package/browser/{chunk-BHrJwQJY.js → chunk-C7zuPRu9.js} +1 -1
- package/browser/{chunk-B1T1lhxO.js → chunk-CBe69s-2.js} +1 -1
- package/browser/{chunk-cxvtBPGk.js → chunk-CFLyg-oC.js} +1 -1
- package/browser/{chunk-DrzUXE6a.js → chunk-CSzw8H2F.js} +1 -1
- package/browser/{chunk-DWXHIgAs.js → chunk-CTYiqe0l.js} +1 -1
- package/browser/{chunk-CRujMca4.js → chunk-CWFDInt7.js} +1 -1
- package/browser/{chunk-CI20rCP1.js → chunk-CgrWMGhT.js} +1 -1
- package/browser/{chunk-CEFRpdhC.js → chunk-Cr2mSoCg.js} +1 -1
- package/browser/{chunk-BGG8qTjD.js → chunk-CsOfELwl.js} +1 -1
- package/browser/{chunk-CoVKXwLW.js → chunk-CtWA9Wcw.js} +2 -2
- package/browser/{chunk-Ims5pjdx.js → chunk-CvL11Svz.js} +1 -1
- package/browser/{chunk-CESBNo1v.js → chunk-CwUIxEoO.js} +1 -1
- package/browser/{chunk-Js79q0Hk.js → chunk-Cxcbg8Y2.js} +1 -1
- package/browser/{chunk-hpkckHAH.js → chunk-D2yqDA1u.js} +1 -1
- package/browser/{chunk-D4O2SdR-.js → chunk-DITp7n6E.js} +1 -1
- package/browser/{chunk-CujZ5wxO.js → chunk-DLXkxUg9.js} +1 -1
- package/browser/{chunk-DVw6VVSF.js → chunk-DLsoHfhP.js} +1 -1
- package/browser/chunk-DVJHLBDM.js +1 -0
- package/browser/{chunk-sQ2hJaJy.js → chunk-DVQQW6km.js} +1 -1
- package/browser/{chunk-CSLsbjtc.js → chunk-DcWLC4S7.js} +1 -1
- package/browser/{chunk-Cl7N3gK-.js → chunk-De9hRkSc.js} +1 -1
- package/browser/{chunk-DqOy3vx6.js → chunk-Dlm3_p0t.js} +1 -1
- package/browser/{chunk-tiXMntK-.js → chunk-Dlx5Rt5V.js} +1 -1
- package/browser/{chunk-Df2NmKyO.js → chunk-DoYeTXOn.js} +1 -1
- package/browser/{chunk-BngP4FHh.js → chunk-DrMoRmsm.js} +1 -1
- package/browser/{chunk-C_hps2N_.js → chunk-DvXx9y4n.js} +1 -1
- package/browser/{chunk-BbkTgcYb.js → chunk-DwJCq7KC.js} +1 -1
- package/browser/{chunk-Cvmc37VM.js → chunk-NOr0w_o_.js} +1 -1
- package/browser/{chunk-D615HDbJ.js → chunk-Pl7edkoq.js} +1 -1
- package/browser/{chunk-DxyVrxwh.js → chunk-Sc506DO8.js} +1 -1
- package/browser/{chunk-DuetvIR9.js → chunk-ZXaT_xHg.js} +1 -1
- package/browser/{chunk-DW95Jf_o.js → chunk-ZrkAX8bu.js} +1 -1
- package/browser/{chunk-CawleOYk.js → chunk-anmUJQp9.js} +1 -1
- package/browser/{chunk-B9VW5ZdD.js → chunk-cHZU18W6.js} +1 -1
- package/browser/{chunk-D8jkRlhn.js → chunk-gI_QNDKB.js} +1 -1
- package/browser/{chunk-TsE9fL5L.js → chunk-nHbbuVx2.js} +1 -1
- package/browser/{chunk-D3bTMcOe.js → chunk-p1EUiu98.js} +1 -1
- package/browser/{chunk-NZ2JSd9Y.js → chunk-spSRZfqJ.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/{main-CERDHS7N.js → main-ZCJEGFW3.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 {b as Qe}from'./chunk-
|
|
1
|
+
import {b as Qe}from'./chunk-BUF2p97y.js';import {D as D$1,i as y}from'./chunk-Pl7edkoq.js';import {g,J as dy,bT as Od,Y as x,aK as Do,aL as Wn,aN as wt,az as Qt,bv as St,br as wl,aV as w,aR as K,al as yt,aW as D,bw as on,bx as am,aS as Ut,A as Aw,by as Oi,aC as wu,aZ as YT,bz as vC,v as vs,l as Ag,o as bg,k as dl,n as eC,bA as DC,T as TC,r as Tg,X as XE,y as Hg,C as Cg,t as tC,b4 as nT,bB as Ii,c7 as QT,b$ as Ng,b_ as FC,D as Fg,I as IC,E as wC,c8 as kf}from'./main-ZCJEGFW3.js';var ae=["switch"],ie=["*"];function ne(a,s){a&1&&(vs(0,"span",11),kf(),vs(1,"svg",13),bg(2,"path",14),dl(),vs(3,"svg",15),bg(4,"path",16),dl()());}var ce=new w("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:false,hideIcon:false,disabledInteractive:false})}),b=class{source;checked;constructor(s,e){this.source=s,this.checked=e;}},se=(()=>{class a{_elementRef=g(Qt);_focusMonitor=g(St);_changeDetectorRef=g(wl);defaults=g(ce);_onChange=e=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=false;_createChangeEvent(e){return new b(this,e)}_labelId;get buttonId(){return `${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus();}_noopAnimations=K();_focused=false;name=null;id;labelPosition="after";ariaLabel=null;ariaLabelledby=null;ariaDescribedby;required=false;color;disabled=false;disableRipple=false;tabIndex=0;get checked(){return this._checked}set checked(e){this._checked=e,this._changeDetectorRef.markForCheck();}hideIcon;disabledInteractive;change=new yt;toggleChange=new yt;get inputId(){return `${this.id||this._uniqueId}-input`}constructor(){g(D).load(on);let e=g(new am("tabindex"),{optional:true}),i=this.defaults;this.tabIndex=e==null?0:parseInt(e)||0,this.color=i.color||"accent",this.id=this._uniqueId=g(Ut).getId("mat-mdc-slide-toggle-"),this.hideIcon=i.hideIcon??false,this.disabledInteractive=i.disabledInteractive??false,this._labelId=this._uniqueId+"-label";}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,true).subscribe(e=>{e==="keyboard"||e==="program"?(this._focused=true,this._changeDetectorRef.markForCheck()):e||Promise.resolve().then(()=>{this._focused=false,this._onTouched(),this._changeDetectorRef.markForCheck();});});}ngOnChanges(e){e.required&&this._validatorOnChange();}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef);}writeValue(e){this.checked=!!e;}registerOnChange(e){this._onChange=e;}registerOnTouched(e){this._onTouched=e;}validate(e){return this.required&&e.value!==true?{required:true}:null}registerOnValidatorChange(e){this._validatorOnChange=e;}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck();}toggle(){this.checked=!this.checked,this._onChange(this.checked);}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked));}_handleClick(){this.disabled||(this.toggleChange.emit(),this.defaults.disableToggleValue||(this.checked=!this.checked,this._onChange(this.checked),this.change.emit(new b(this,this.checked))));}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=Aw({type:a,selectors:[["mat-slide-toggle"]],viewQuery:function(i,t){if(i&1&&Fg(ae,5),i&2){let r;IC(r=wC())&&(t._switchElement=r.first);}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(i,t){i&2&&(Ng("id",t.id),Cg("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),FC(t.color?"mat-"+t.color:""),Hg("mat-mdc-slide-toggle-focused",t._focused)("mat-mdc-slide-toggle-checked",t.checked)("_mat-animation-noopable",t._noopAnimations));},inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],required:[2,"required","required",YT],color:"color",disabled:[2,"disabled","disabled",YT],disableRipple:[2,"disableRipple","disableRipple",YT],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:QT(e)],checked:[2,"checked","checked",YT],hideIcon:[2,"hideIcon","hideIcon",YT],disabledInteractive:[2,"disabledInteractive","disabledInteractive",YT]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[nT([{provide:D$1,useExisting:Ii(()=>a),multi:true},{provide:y,useExisting:a,multi:true}]),wu],ngContentSelectors:ie,decls:14,vars:27,consts:[["switch",""],["mat-internal-form-field","",3,"labelPosition"],["role","switch","type","button",1,"mdc-switch",3,"click","tabIndex","disabled"],[1,"mat-mdc-slide-toggle-touch-target"],[1,"mdc-switch__track"],[1,"mdc-switch__handle-track"],[1,"mdc-switch__handle"],[1,"mdc-switch__shadow"],[1,"mdc-elevation-overlay"],[1,"mdc-switch__ripple"],["mat-ripple","",1,"mat-mdc-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-switch__icons"],[1,"mdc-label",3,"click","for"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--on"],["d","M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--off"],["d","M20 13H4v-2h16v2z"]],template:function(i,t){if(i&1&&(vC(),vs(0,"div",1)(1,"button",2,0),Ag("click",function(){return t._handleClick()}),bg(3,"div",3)(4,"span",4),vs(5,"span",5)(6,"span",6)(7,"span",7),bg(8,"span",8),dl(),vs(9,"span",9),bg(10,"span",10),dl(),eC(11,ne,5,0,"span",11),dl()()(),vs(12,"label",12),Ag("click",function(ee){return ee.stopPropagation()}),DC(13),dl()()),i&2){let r=TC(2);Tg("labelPosition",t.labelPosition),XE(),Hg("mdc-switch--selected",t.checked)("mdc-switch--unselected",!t.checked)("mdc-switch--checked",t.checked)("mdc-switch--disabled",t.disabled)("mat-mdc-slide-toggle-disabled-interactive",t.disabledInteractive),Tg("tabIndex",t.disabled&&!t.disabledInteractive?-1:t.tabIndex)("disabled",t.disabled&&!t.disabledInteractive),Cg("id",t.buttonId)("name",t.name)("aria-label",t.ariaLabel)("aria-labelledby",t._getAriaLabelledBy())("aria-describedby",t.ariaDescribedby)("aria-required",t.required||null)("aria-checked",t.checked)("aria-disabled",t.disabled&&t.disabledInteractive?"true":null),XE(9),Tg("matRippleTrigger",r)("matRippleDisabled",t.disableRipple||t.disabled)("matRippleCentered",true),XE(),tC(t.hideIcon?-1:11),XE(),Tg("for",t.buttonId),Cg("id",t._labelId);}},dependencies:[Oi,Qe],styles:[`.mdc-switch {
|
|
2
2
|
align-items: center;
|
|
3
3
|
background: none;
|
|
4
4
|
border: none;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {n as ne}from'./chunk-
|
|
1
|
+
import {n as ne}from'./chunk-BC_2TEa6.js';import {g,Z as z$1,_ as Ue,A as Aw,$ as zt,a0 as jt,a1 as Vt,a2 as Nt,i as hr,p as pr,v as vs,W as WC,k as dl,n as eC,l as Ag,X as XE,y as Hg,a5 as ml,a8 as Zg,t as tC,r as Tg,a9 as dC,ai as Jg,aa as If,ac as mC,aj as KC,ab as wf,a3 as HI,ak as Xg,a6 as $I}from'./main-ZCJEGFW3.js';import {y as yt,w as wt,t as ti,Z as Zn,c as cn}from'./chunk-Pl7edkoq.js';function G(c,p){if(c&1){let t=dC();vs(0,"mat-checkbox",5),Jg("ngModelChange",function(l){If(t);let f=mC();return KC(f.checkboxChecked,l)||(f.checkboxChecked=l),wf(l)}),WC(1),dl(),HI();}if(c&2){let t=mC();Xg("ngModel",t.checkboxChecked),$I(),XE(),Zg(t.data.checkboxLabel);}}var z=class c{dialogRef=g(z$1);data=g(Ue);checkboxChecked=false;confirm(){this.dialogRef.close({confirmed:true,checkboxChecked:this.checkboxChecked});}cancel(){this.dialogRef.close({confirmed:false});}static \u0275fac=function(t){return new(t||c)};static \u0275cmp=Aw({type:c,selectors:[["app-confirm-dialog"]],decls:13,vars:8,consts:[["mat-dialog-title",""],[3,"ngModel"],["align","end"],["mat-button","",3,"click"],["mat-flat-button","",3,"click","color"],[3,"ngModelChange","ngModel"]],template:function(t,e){t&1&&(vs(0,"h2",0)(1,"mat-icon"),WC(2,"warning"),dl(),WC(3),dl(),vs(4,"mat-dialog-content")(5,"p"),WC(6),dl(),eC(7,G,2,2,"mat-checkbox",1),dl(),vs(8,"mat-dialog-actions",2)(9,"button",3),Ag("click",function(){return e.cancel()}),WC(10),dl(),vs(11,"button",4),Ag("click",function(){return e.confirm()}),WC(12),dl()()),t&2&&(XE(),Hg("destructive",!!e.data.isDestructive),XE(2),ml(" ",e.data.title,`
|
|
2
2
|
`),XE(3),Zg(e.data.message),XE(),tC(e.data.checkboxLabel?7:-1),XE(3),Zg(e.data.cancelLabel??"Cancel"),XE(),Tg("color",e.data.isDestructive?"warn":"primary"),XE(),ml(" ",e.data.confirmLabel??"Confirm"," "));},dependencies:[zt,jt,Vt,Nt,hr,pr,yt,wt,ne,ti,Zn,cn],styles:["h2[mat-dialog-title][_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}h2[mat-dialog-title][_ngcontent-%COMP%] mat-icon.destructive[_ngcontent-%COMP%]{color:var(--color-error, #f44336)}mat-dialog-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:var(--color-text-secondary);line-height:1.5}mat-dialog-content[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{display:block;margin-top:8px;font-size:.875rem}"]})};export{z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {s as se}from'./chunk-
|
|
1
|
+
import {s as se}from'./chunk-spSRZfqJ.js';import {M as Mr,z as zi,F as Fn,H as Hi,u as ut,a as ur,h as hr}from'./chunk-BLwyktBH.js';import {g,J as dy,P,Y as x,aK as Do,aL as Wn,bC as ge,bD as vt,aN as wt,br as wl,az as Qt,aV as w,aR as K,bE as X,al as yt,aS as Ut,bF as p,bG as Pt,A as Aw,aZ as YT,bz as vC,bH as Eg,b4 as nT,D as Fg,bI as lr,I as IC,E as wC,bu as kg,bJ as fe,bK as pe,bL as gr,aO as G,bs as Qn,bM as F,aQ as As,an as ce,O as Ot,bN as mt,bO as Yy,ae as Ot$1,S as pa,u as ue,bP as Zy,bQ as bd,bR as ga,aE as A,bt as Ve$1,bS as pn,bT as Od,bU as Ky,aA as sn,bV as Y,bW as Pt$1,bX as po,bY as X$1,bZ as xt,aY as ks,aC as wu,l as Ag,C as Cg,aw as fl,bA as DC,ax as pl,ac as mC,b_ as FC,y as Hg,b$ as Ng,c0 as E,c1 as ME,c2 as kt$1,bB as Ii}from'./main-ZCJEGFW3.js';import {D}from'./chunk-Pl7edkoq.js';var xe=class a{http=g(dy);projectState=g(P);getBaseUrl(){return `/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/schedulers`}listSchedulers(){return this.http.get(this.getBaseUrl())}getScheduler(o){return this.http.get(`${this.getBaseUrl()}/${o}`)}createScheduler(o){return this.http.post(this.getBaseUrl(),o)}listSchedulersForProject(o){return this.http.get(`/api/projects/${o}/schedulers`)}enableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/enable`,{})}disableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/disable`,{})}runSchedulerNowForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/run-now`,{})}deleteSchedulerForProject(o,e){return this.http.delete(`/api/projects/${o}/schedulers/${e}`)}updateSchedulerForProject(o,e,t){return this.http.put(`/api/projects/${o}/schedulers/${e}`,t)}createSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers`,e)}updateScheduler(o,e){return this.http.put(`${this.getBaseUrl()}/${o}`,e)}deleteScheduler(o){return this.http.delete(`${this.getBaseUrl()}/${o}`)}enableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/enable`,{})}disableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/disable`,{})}runSchedulerNow(o){return this.http.post(`${this.getBaseUrl()}/${o}/run-now`,{})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=x({token:a,factory:a.\u0275fac,providedIn:"root"})};var Ke=["panel"],Ue=["*"];function qe(a,o){if(a&1&&(fl(0,"div",1,0),DC(2),pl()),a&2){let e=o.id,t=mC();FC(t._classList),Hg("mat-mdc-autocomplete-visible",t.showPanel)("mat-mdc-autocomplete-hidden",!t.showPanel)("mat-autocomplete-panel-animations-enabled",!t._animationsDisabled)("mat-primary",t._color==="primary")("mat-accent",t._color==="accent")("mat-warn",t._color==="warn"),Ng("id",t.id),Cg("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby(e));}}var R=class{source;option;constructor(o,e){this.source=o,this.option=e;}},Ve=new w("mat-autocomplete-default-options",{providedIn:"root",factory:()=>({autoActiveFirstOption:false,autoSelectActiveOption:false,hideSingleSelectionIndicator:false,requireSelection:false,hasBackdrop:false})}),Ct=(()=>{class a{_changeDetectorRef=g(wl);_elementRef=g(Qt);_defaults=g(Ve);_animationsDisabled=K();_activeOptionChanges=X.EMPTY;_keyManager;showPanel=false;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=false;_latestOpeningTrigger;_setColor(e){this._color=e,this._changeDetectorRef.markForCheck();}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple=false;optionSelected=new yt;opened=new yt;closed=new yt;optionActivated=new yt;set classList(e){this._classList=e,this._elementRef.nativeElement.className="";}_classList;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties();}_hideSingleSelectionIndicator;_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck();}id=g(Ut).getId("mat-autocomplete-");inertGroups;constructor(){let e=g(p);this.inertGroups=e?.SAFARI||false,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??false;}ngAfterContentInit(){this._keyManager=new Pt(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(e=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[e]||null});}),this._setVisibility();}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe();}_setScrollTop(e){this.panel&&(this.panel.nativeElement.scrollTop=e);}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options?.length,this._changeDetectorRef.markForCheck();}_emitSelectEvent(e){let t=new R(this,e);this.optionSelected.emit(t);}_getPanelAriaLabelledby(e){if(this.ariaLabel)return null;let t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_skipPredicate(){return false}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=Aw({type:a,selectors:[["mat-autocomplete"]],contentQueries:function(t,i,n){if(t&1&&kg(n,Fn,5)(n,Hi,5),t&2){let s;IC(s=wC())&&(i.options=s),IC(s=wC())&&(i.optionGroups=s);}},viewQuery:function(t,i){if(t&1&&Fg(lr,7)(Ke,5),t&2){let n;IC(n=wC())&&(i.template=n.first),IC(n=wC())&&(i.panel=n.first);}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",YT],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",YT],requireSelection:[2,"requireSelection","requireSelection",YT],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",YT],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",YT]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[nT([{provide:zi,useExisting:a}])],ngContentSelectors:Ue,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(t,i){t&1&&(vC(),Eg(0,qe,3,17,"ng-template"));},styles:[`div.mat-mdc-autocomplete-panel {
|
|
2
2
|
width: 100%;
|
|
3
3
|
max-height: 256px;
|
|
4
4
|
visibility: hidden;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {n}from'./chunk-CfgXrte_.js';import {O}from'./chunk-
|
|
1
|
+
import {n}from'./chunk-CfgXrte_.js';import {O}from'./chunk-BkD_xP5e.js';import {S}from'./chunk-CWFDInt7.js';import {v}from'./chunk-BhlAZzwj.js';import {g,ao as V,G,w as we,H as Hi,u as ue,b as U$1,bR as ga,S as pa,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,W as WC,X as XE,a8 as Zg,a9 as dC,aa as If,ab as wf,ag as fT}from'./main-ZCJEGFW3.js';import'./chunk-CtWA9Wcw.js';import {W as Wn,D as De}from'./chunk-BLwyktBH.js';import'./chunk-BUF2p97y.js';import'./chunk-Pl7edkoq.js';import'./chunk-DVJHLBDM.js';import'./chunk-B6HBR6l3.js';var z=()=>[];function W(r,e){if(r&1&&(vs(0,"p",3),WC(1),dl()),r&2){let t=mC().$implicit;XE(),Zg(t.name);}}function U(r,e){if(r&1){let t=dC();vs(0,"agentos-ai-provider-item",5),Ag("editRequested",function(){let o=If(t),a=mC(2);return wf(a.onEdit(o))})("deleteRequested",function(){let o=If(t),a=mC(2);return wf(a.onDelete(o))})("duplicateRequested",function(){let o=If(t),a=mC(2);return wf(a.onDuplicate(o))}),dl();}if(r&2){let t=e,i=mC(2);Tg("config",t.config)("scope",t.scope)("readOnly",t.scope==="platform"||t.scope==="namespace"&&!i.isAdmin());}}function X(r,e){if(r&1&&eC(0,W,2,1,"p",3)(1,U,1,3,"agentos-ai-provider-item",4),r&2){let t,i=e.$implicit,o=mC();tC(o.isEmptyPlaceholder(i.id)?0:(t=o.resolve(i.id))?1:-1,t);}}var k=Object.freeze({platform:"Platform (read-only)",namespace:"AI Providers du namespace",userOnNs:"Mes overrides sur ce namespace",userGlobal:"Mes overrides globaux"}),F="__empty__",j=class r{route=g(V);router=g(G);destroyRef=g(we);state=g(O);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=Hi(false);listItems$=this.state.vm$.pipe(ue(e=>this.toListItems(e)));resolved=new Map;ngOnInit(){this.route.paramMap.pipe(U$1(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t);}),this.route.paramMap.pipe(ue(e=>e.get("namespaceId")??""),ga(e=>e?this.namespaceRole.isAdminOfNamespace$(e):pa(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe(e=>{let t=new Map;e.platform.forEach(i=>{i.id&&t.set(this.itemKey("platform",i.id),{config:i,scope:"platform"});}),e.namespace.forEach(i=>{i.id&&t.set(this.itemKey("namespace",i.id),{config:i,scope:"namespace"});}),e.userOnNs.forEach(i=>{i.id&&t.set(this.itemKey("userOnNs",i.id),{config:i,scope:"userOnNs"});}),e.userGlobal.forEach(i=>{i.id&&t.set(this.itemKey("userGlobal",i.id),{config:i,scope:"userGlobal"});}),this.resolved=t;});}isEmptyPlaceholder(e){return e.startsWith(F)}resolve(e){return this.resolved.get(e)??null}itemKey(e,t){return `${e}:${t}`}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:n(this.isAdmin())}});}onEdit(e){let t=e.config.id;t&&this.router.navigate(["/agentos",this.namespaceId,"ai-providers",t,"edit"],{queryParams:{scope:e.scope}});}onDelete(e){let t=e.config.id;t&&this.state.delete(t,e.scope).pipe(U$1(this.destroyRef)).subscribe({error:i=>{console.error(`[AiProvidersAllScopes] Delete failed for ${e.scope}:${t}:`,i);}});}onDuplicate(e){if(!e.config.id)return;let t=e.scope==="namespace"&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:t,template:e.config.id,templateScope:e.scope}});}toListItems(e){let t=[];return t.push(...this.sectionItems("platform",e.platform)),t.push(...this.sectionItems("namespace",e.namespace)),t.push(...this.sectionItems("userOnNs",e.userOnNs)),t.push(...this.sectionItems("userGlobal",e.userGlobal)),t}sectionItems(e,t){return t.length===0?[{id:`${F}${e}`,name:"Aucun AI Provider",groupKey:e,groupLabel:k[e]}]:t.filter(i=>!!i.id).map(i=>({id:this.itemKey(e,i.id),name:i.name,description:i.apiType,groupKey:e,groupLabel:k[e]}))}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=Aw({type:r,selectors:[["agentos-ai-providers-all-scopes"]],decls:5,vars:6,consts:[["aiProviderItemTpl",""],["title","AI Providers","emptyMessage","No AI providers available.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[1,"ai-providers-all-scopes__empty"],[3,"config","scope","readOnly"],[3,"editRequested","deleteRequested","duplicateRequested","config","scope","readOnly"]],template:function(t,i){if(t&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,X,2,1,"ng-template",null,0,fT)),t&2){let o=TC(4);Tg("items",uT(1,3,i.listItems$)??rT(5,z))("showCreate",true)("itemTemplate",o);}},dependencies:[Wn,S,De,Nb],styles:[".ai-providers-all-scopes__empty[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);padding:.5rem .25rem;margin:0;font-style:italic}"]})};export{j as AiProvidersAllScopesComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {c as ce,s as se,b as at$1,d as de}from'./chunk-NZ2JSd9Y.js';import {M as Mr,a as ur,h as hr,f as ft,z as zi,F as Fn,H as Hi$1}from'./chunk-Dh70Sw4n.js';import {W as We,Q as Qt$1}from'./chunk-Dv3y4cq8.js';import {aK as Do,aL as Wn,bC as ge,aN as wt,bD as vt,g,bM as F,br as wl,az as Qt,bs as Qn,aS as Ut,aQ as As,c3 as On,aV as w,aR as K,an as ce$1,H as Hi,bP as Zy,bQ as bd,bR as ga,bO as Yy,al as yt,ae as Ot,u as ue,bx as am,c4 as Et,ap as Vy,aA as sn,bt as Ve,c5 as Rt,bG as Pt$1,c0 as E,A as Aw,c6 as _e$1,aC as wu,aZ as YT,c7 as QT,bz as vC,v as vs,l as Ag,n as eC,k as dl,c8 as kf,o as bg,af as Dg,T as TC,X as XE,C as Cg,t as tC,r as Tg,b4 as nT,y as Hg,D as Fg,I as IC,E as wC,bu as kg,bK as pe,c2 as kt,W as WC,ac as mC,a8 as Zg,a9 as dC,aa as If,ab as wf,bA as DC,b_ as FC}from'./main-CERDHS7N.js';import {_,b as _e,d as an,E as En}from'./chunk-D615HDbJ.js';var Qe=["trigger"],Ye=["panel"],Ue=[[["mat-select-trigger"]],"*"],Xe=["mat-select-trigger","*"];function Je(a,_){if(a&1&&(vs(0,"span",4),WC(1),dl()),a&2){let e=mC();XE(),Zg(e.placeholder);}}function Ze(a,_){a&1&&DC(0);}function $e(a,_){if(a&1&&(vs(0,"span",11),WC(1),dl()),a&2){let e=mC(2);XE(),Zg(e.triggerValue);}}function et(a,_){if(a&1&&(vs(0,"span",5),eC(1,Ze,1,0)(2,$e,2,1,"span",11),dl()),a&2){let e=mC();XE(),tC(e.customTrigger?1:2);}}function tt(a,_){if(a&1){let e=dC();vs(0,"div",12,1),Ag("keydown",function(i){If(e);let n=mC();return wf(n._handleKeydown(i))}),DC(2,1),dl();}if(a&2){let e=mC();FC(e.panelClass),Hg("mat-select-panel-animations-enabled",!e._animationsDisabled)("mat-primary",e._parentFormField?.color==="primary")("mat-accent",e._parentFormField?.color==="accent")("mat-warn",e._parentFormField?.color==="warn")("mat-undefined",!e._parentFormField?.color),Cg("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby());}}var it=new w("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let a=g(pe);return ()=>kt(a)}}),nt=new w("MAT_SELECT_CONFIG"),at=new w("MatSelectTrigger"),B=class{source;value;constructor(_,e){this.source=_,this.value=e;}},Lt=(()=>{class a{_viewportRuler=g(F);_changeDetectorRef=g(wl);_elementRef=g(Qt);_dir=g(Qn,{optional:true});_idGenerator=g(Ut);_renderer=g(As);_parentFormField=g(se,{optional:true});ngControl=g(_,{self:true,optional:true});_liveAnnouncer=g(On);_defaultOptions=g(nt,{optional:true});_animationsDisabled=K();_popoverLocation;_initialized=new ce$1;_cleanupDetach;options;optionGroups;customTrigger;_positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}];_scrollOptionIntoView(e){let t=this.options.toArray()[e];if(t){let i=this.panel.nativeElement,n=ur(e,this.options,this.optionGroups),r=t._getHostElement();e===0&&n===1?i.scrollTop=0:i.scrollTop=hr(r.offsetTop,r.offsetHeight,i.scrollTop,i.offsetHeight);}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0);}_getChangeEvent(e){return new B(this,e)}_scrollStrategyFactory=g(it);_panelOpen=false;_compareWith=(e,t)=>e===t;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new ce$1;_errorStateTracker;stateChanges=new ce$1;disableAutomaticLabeling=true;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=false;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=false;get disableRipple(){return this._disableRipple()}set disableRipple(e){this._disableRipple.set(e);}_disableRipple=Hi(false);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties();}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??false;get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next();}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(_e.required)??false}set required(e){this._required=e,this.stateChanges.next();}_required;get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e;}_multiple=false;disableOptionCentering=this._defaultOptions?.disableOptionCentering??false;get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection();}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e);}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e;}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next();}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e;}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??false;optionSelectionChanges=Zy(()=>{let e=this.options;return e?e.changes.pipe(bd(e),ga(()=>Yy(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(ga(()=>this.optionSelectionChanges))});openedChange=new yt;_openedStream=this.openedChange.pipe(Ot(e=>e),ue(()=>{}));_closedStream=this.openedChange.pipe(Ot(e=>!e),ue(()=>{}));selectionChange=new yt;valueChange=new yt;constructor(){let e=g(We),t=g(an,{optional:true}),i=g(En,{optional:true}),n=g(new am("tabindex"),{optional:true}),r=g(Et,{optional:true}),d=g(at$1,{optional:true,self:true});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new Qt$1(e,d||this.ngControl,i,t,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=n==null?0:parseInt(n)||0,this._popoverLocation=r?.usePopover===false?null:"inline",this.id=this.id;}ngOnInit(){this._selectionModel=new ft(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(Vy(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges());});}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(Vy(this._destroy)).subscribe(e=>{e.added.forEach(t=>t.select()),e.removed.forEach(t=>t.deselect());}),this.options.changes.pipe(bd(null),Vy(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection();});}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),t=this.ngControl;if(e!==this._triggerAriaLabelledBy){let i=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?i.setAttribute("aria-labelledby",e):i.removeAttribute("aria-labelledby");}t&&(this._previousControl!==t.control&&(this._previousControl!==void 0&&t.disabled!==null&&t.disabled!==this.disabled&&(this.disabled=t.disabled),this._previousControl=t.control),this.updateErrorState());}ngOnChanges(e){(e.disabled||e.userAriaDescribedBy)&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval),e.panelClass&&this.panelClass instanceof Set&&(this.panelClass=Array.from(this.panelClass));}ngOnDestroy(){this._cleanupDetach?.(),this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete();}toggle(){this.panelOpen?this.close():this.open();}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._panelOpen=true,this._overlayDir.positionChange.pipe(sn(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled();}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(true)));}close(){this._panelOpen&&(this._panelOpen=false,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(false)));}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{t(),clearTimeout(i),this._cleanupDetach=void 0;};let e=this.panel.nativeElement,t=this._renderer.listen(e,"animationend",n=>{n.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay());}),i=setTimeout(()=>{this._cleanupDetach?.(),this._detachOverlay();},200);e.classList.add("mat-select-panel-exit");}_detachOverlay(){this._overlayDir.detachOverlay(),this._changeDetectorRef.markForCheck();}writeValue(e){this._assignValue(e);}registerOnChange(e){this._onChange=e;}registerOnTouched(e){this._onTouched=e;}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next();}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return "";if(this._multiple){let e=this._selectionModel.selected.map(t=>t.viewValue);return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState();}_isRtl(){return this._dir?this._dir.value==="rtl":false}_handleKeydown(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e));}_handleClosedKeydown(e){let t=e.keyCode,i=t===40||t===38||t===37||t===39,n=t===13||t===32,r=this._keyManager;if(!r.isTyping()&&n&&!Ve(e)||(this.multiple||e.altKey)&&i)e.preventDefault(),this.open();else if(!this.multiple){let d=this.selected;r.onKeydown(e);let o=this.selected;o&&d!==o&&this._liveAnnouncer.announce(o.viewValue,1e4);}}_handleOpenKeydown(e){let t=this._keyManager,i=e.keyCode,n=i===40||i===38,r=t.isTyping();if(n&&e.altKey)e.preventDefault(),this.close();else if(!r&&(i===13||i===32)&&t.activeItem&&!Ve(e))e.preventDefault(),t.activeItem._selectViaInteraction();else if(!r&&this._multiple&&i===65&&e.ctrlKey){e.preventDefault();let d=this.options.some(o=>!o.disabled&&!o.selected);this.options.forEach(o=>{o.disabled||(d?o.select():o.deselect());});}else {let d=t.activeItemIndex;t.onKeydown(e),this._multiple&&n&&e.shiftKey&&t.activeItem&&t.activeItemIndex!==d&&t.activeItem._selectViaInteraction();}}_handleOverlayKeydown(e){e.keyCode===27&&!Ve(e)&&(e.preventDefault(),this.close());}_onFocus(){this.disabled||(this._focused=true,this.stateChanges.next());}_onBlur(){this._focused=false,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next());}get empty(){return !this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next();});}_setSelectionByValue(e){if(this.options.forEach(t=>t.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)e.forEach(t=>this._selectOptionByValue(t)),this._sortValues();else {let t=this._selectOptionByValue(e);t?this._keyManager.updateActiveItem(t):this.panelOpen||this._keyManager.updateActiveItem(-1);}this._changeDetectorRef.markForCheck();}_selectOptionByValue(e){let t=this.options.find(i=>{if(this._selectionModel.isSelected(i))return false;try{return (i.value!=null||this.canSelectNullableOptions)&&this._compareWith(i.value,e)}catch(n){return false}});return t&&this._selectionModel.select(t),t}_assignValue(e){return e!==this._value||this._multiple&&Array.isArray(e)?(this.options&&this._setSelectionByValue(e),this._value=e,true):false}_skipPredicate=e=>this.panelOpen?false:e.disabled;_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof Rt?e.elementRef:e||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck();}_initKeyManager(){this._keyManager=new Pt$1(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close());}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction();});}_resetOptions(){let e=Yy(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(Vy(e)).subscribe(t=>{this._onSelect(t.source,t.isUserInput),t.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus());}),Yy(...this.options.map(t=>t._stateChanges)).pipe(Vy(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next();});}_onSelect(e,t){let i=this._selectionModel.isSelected(e);!this.canSelectNullableOptions&&e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(i!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),t&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),t&&this.focus())),i!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next();}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((t,i)=>this.sortComparator?this.sortComparator(t,i,e):e.indexOf(t)-e.indexOf(i)),this.stateChanges.next();}}_propagateChanges(e){let t;this.multiple?t=this.selected.map(i=>i.value):t=this.selected?this.selected.value:e,this._value=t,this.valueChange.emit(t),this._onChange(t),this.selectionChange.emit(this._getChangeEvent(t)),this._changeDetectorRef.markForCheck();}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let t=0;t<this.options.length;t++)if(!this.options.get(t).disabled){e=t;break}this._keyManager.setActiveItem(e);}else this._keyManager.setActiveItem(this._selectionModel.selected[0]);}_canOpen(){return !this._panelOpen&&!this.disabled&&this.options?.length>0&&!!this._overlayDir}focus(e){this._elementRef.nativeElement.focus(e);}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||null,t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||"";return this.ariaLabelledby&&(e+=" "+this.ariaLabelledby),e||(e=this._valueId),e}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){let t=this._elementRef.nativeElement;e.length?t.setAttribute("aria-describedby",e.join(" ")):t.removeAttribute("aria-describedby");}onContainerClick(e){let t=E(e);t&&(t.tagName==="MAT-OPTION"||t.classList.contains("cdk-overlay-backdrop")||t.closest(".mat-mdc-select-panel"))||(this.focus(),this.open());}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=Aw({type:a,selectors:[["mat-select"]],contentQueries:function(t,i,n){if(t&1&&kg(n,at,5)(n,Fn,5)(n,Hi$1,5),t&2){let r;IC(r=wC())&&(i.customTrigger=r.first),IC(r=wC())&&(i.options=r),IC(r=wC())&&(i.optionGroups=r);}},viewQuery:function(t,i){if(t&1&&Fg(Qe,5)(Ye,5)(_e$1,5),t&2){let n;IC(n=wC())&&(i.trigger=n.first),IC(n=wC())&&(i.panel=n.first),IC(n=wC())&&(i._overlayDir=n.first);}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:21,hostBindings:function(t,i){t&1&&Ag("keydown",function(r){return i._handleKeydown(r)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),t&2&&(Cg("id",i.id)("tabindex",i.disabled?-1:i.tabIndex)("aria-controls",i.panelOpen?i.id+"-panel":null)("aria-expanded",i.panelOpen)("aria-label",i.ariaLabel||null)("aria-required",i.required.toString())("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-activedescendant",i._getAriaActiveDescendant()),Hg("mat-mdc-select-disabled",i.disabled)("mat-mdc-select-invalid",i.errorState)("mat-mdc-select-required",i.required)("mat-mdc-select-empty",i.empty)("mat-mdc-select-multiple",i.multiple)("mat-select-open",i.panelOpen));},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",YT],disableRipple:[2,"disableRipple","disableRipple",YT],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:QT(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",YT],placeholder:"placeholder",required:[2,"required","required",YT],multiple:[2,"multiple","multiple",YT],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",YT],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",QT],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",YT]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[nT([{provide:de,useExisting:a},{provide:zi,useExisting:a}]),wu],ngContentSelectors:Xe,decls:11,vars:10,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"detach","backdropClick","overlayKeydown","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth","cdkConnectedOverlayFlexibleDimensions","cdkConnectedOverlayUsePopover"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",1,"mat-mdc-select-panel","mdc-menu-surface","mdc-menu-surface--open",3,"keydown"]],template:function(t,i){if(t&1&&(vC(Ue),vs(0,"div",2,0),Ag("click",function(){return i.open()}),vs(3,"div",3),eC(4,Je,2,1,"span",4)(5,et,3,1,"span",5),dl(),vs(6,"div",6)(7,"div",7),kf(),vs(8,"svg",8),bg(9,"path",9),dl()()()(),Dg(10,tt,3,16,"ng-template",10),Ag("detach",function(){return i.close()})("backdropClick",function(){return i.close()})("overlayKeydown",function(r){return i._handleOverlayKeydown(r)})),t&2){let n=TC(1);XE(3),Cg("id",i._valueId),XE(),tC(i.empty?4:5),XE(6),Tg("cdkConnectedOverlayDisableClose",true)("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",i._preferredOverlayOrigin||n)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayWidth",i._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",true)("cdkConnectedOverlayUsePopover",i._popoverLocation);}},dependencies:[Rt,_e$1],styles:[`@keyframes _mat-select-enter {
|
|
1
|
+
import {c as ce,s as se,b as at$1,d as de}from'./chunk-spSRZfqJ.js';import {M as Mr,a as ur,h as hr,f as ft,z as zi,F as Fn,H as Hi$1}from'./chunk-BLwyktBH.js';import {W as We,Q as Qt$1}from'./chunk-BUF2p97y.js';import {aK as Do,aL as Wn,bC as ge,aN as wt,bD as vt,g,bM as F,br as wl,az as Qt,bs as Qn,aS as Ut,aQ as As,c3 as On,aV as w,aR as K,an as ce$1,H as Hi,bP as Zy,bQ as bd,bR as ga,bO as Yy,al as yt,ae as Ot,u as ue,bx as am,c4 as Et,ap as Vy,aA as sn,bt as Ve,c5 as Rt,bG as Pt$1,c0 as E,A as Aw,c6 as _e$1,aC as wu,aZ as YT,c7 as QT,bz as vC,v as vs,l as Ag,n as eC,k as dl,c8 as kf,o as bg,af as Dg,T as TC,X as XE,C as Cg,t as tC,r as Tg,b4 as nT,y as Hg,D as Fg,I as IC,E as wC,bu as kg,bK as pe,c2 as kt,W as WC,ac as mC,a8 as Zg,a9 as dC,aa as If,ab as wf,bA as DC,b_ as FC}from'./main-ZCJEGFW3.js';import {_,b as _e,d as an,E as En}from'./chunk-Pl7edkoq.js';var Qe=["trigger"],Ye=["panel"],Ue=[[["mat-select-trigger"]],"*"],Xe=["mat-select-trigger","*"];function Je(a,_){if(a&1&&(vs(0,"span",4),WC(1),dl()),a&2){let e=mC();XE(),Zg(e.placeholder);}}function Ze(a,_){a&1&&DC(0);}function $e(a,_){if(a&1&&(vs(0,"span",11),WC(1),dl()),a&2){let e=mC(2);XE(),Zg(e.triggerValue);}}function et(a,_){if(a&1&&(vs(0,"span",5),eC(1,Ze,1,0)(2,$e,2,1,"span",11),dl()),a&2){let e=mC();XE(),tC(e.customTrigger?1:2);}}function tt(a,_){if(a&1){let e=dC();vs(0,"div",12,1),Ag("keydown",function(i){If(e);let n=mC();return wf(n._handleKeydown(i))}),DC(2,1),dl();}if(a&2){let e=mC();FC(e.panelClass),Hg("mat-select-panel-animations-enabled",!e._animationsDisabled)("mat-primary",e._parentFormField?.color==="primary")("mat-accent",e._parentFormField?.color==="accent")("mat-warn",e._parentFormField?.color==="warn")("mat-undefined",!e._parentFormField?.color),Cg("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby());}}var it=new w("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let a=g(pe);return ()=>kt(a)}}),nt=new w("MAT_SELECT_CONFIG"),at=new w("MatSelectTrigger"),B=class{source;value;constructor(_,e){this.source=_,this.value=e;}},Lt=(()=>{class a{_viewportRuler=g(F);_changeDetectorRef=g(wl);_elementRef=g(Qt);_dir=g(Qn,{optional:true});_idGenerator=g(Ut);_renderer=g(As);_parentFormField=g(se,{optional:true});ngControl=g(_,{self:true,optional:true});_liveAnnouncer=g(On);_defaultOptions=g(nt,{optional:true});_animationsDisabled=K();_popoverLocation;_initialized=new ce$1;_cleanupDetach;options;optionGroups;customTrigger;_positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}];_scrollOptionIntoView(e){let t=this.options.toArray()[e];if(t){let i=this.panel.nativeElement,n=ur(e,this.options,this.optionGroups),r=t._getHostElement();e===0&&n===1?i.scrollTop=0:i.scrollTop=hr(r.offsetTop,r.offsetHeight,i.scrollTop,i.offsetHeight);}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0);}_getChangeEvent(e){return new B(this,e)}_scrollStrategyFactory=g(it);_panelOpen=false;_compareWith=(e,t)=>e===t;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new ce$1;_errorStateTracker;stateChanges=new ce$1;disableAutomaticLabeling=true;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=false;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=false;get disableRipple(){return this._disableRipple()}set disableRipple(e){this._disableRipple.set(e);}_disableRipple=Hi(false);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties();}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??false;get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next();}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(_e.required)??false}set required(e){this._required=e,this.stateChanges.next();}_required;get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e;}_multiple=false;disableOptionCentering=this._defaultOptions?.disableOptionCentering??false;get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection();}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e);}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e;}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next();}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e;}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??false;optionSelectionChanges=Zy(()=>{let e=this.options;return e?e.changes.pipe(bd(e),ga(()=>Yy(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(ga(()=>this.optionSelectionChanges))});openedChange=new yt;_openedStream=this.openedChange.pipe(Ot(e=>e),ue(()=>{}));_closedStream=this.openedChange.pipe(Ot(e=>!e),ue(()=>{}));selectionChange=new yt;valueChange=new yt;constructor(){let e=g(We),t=g(an,{optional:true}),i=g(En,{optional:true}),n=g(new am("tabindex"),{optional:true}),r=g(Et,{optional:true}),d=g(at$1,{optional:true,self:true});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new Qt$1(e,d||this.ngControl,i,t,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=n==null?0:parseInt(n)||0,this._popoverLocation=r?.usePopover===false?null:"inline",this.id=this.id;}ngOnInit(){this._selectionModel=new ft(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(Vy(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges());});}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(Vy(this._destroy)).subscribe(e=>{e.added.forEach(t=>t.select()),e.removed.forEach(t=>t.deselect());}),this.options.changes.pipe(bd(null),Vy(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection();});}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),t=this.ngControl;if(e!==this._triggerAriaLabelledBy){let i=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?i.setAttribute("aria-labelledby",e):i.removeAttribute("aria-labelledby");}t&&(this._previousControl!==t.control&&(this._previousControl!==void 0&&t.disabled!==null&&t.disabled!==this.disabled&&(this.disabled=t.disabled),this._previousControl=t.control),this.updateErrorState());}ngOnChanges(e){(e.disabled||e.userAriaDescribedBy)&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval),e.panelClass&&this.panelClass instanceof Set&&(this.panelClass=Array.from(this.panelClass));}ngOnDestroy(){this._cleanupDetach?.(),this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete();}toggle(){this.panelOpen?this.close():this.open();}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._panelOpen=true,this._overlayDir.positionChange.pipe(sn(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled();}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(true)));}close(){this._panelOpen&&(this._panelOpen=false,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(false)));}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{t(),clearTimeout(i),this._cleanupDetach=void 0;};let e=this.panel.nativeElement,t=this._renderer.listen(e,"animationend",n=>{n.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay());}),i=setTimeout(()=>{this._cleanupDetach?.(),this._detachOverlay();},200);e.classList.add("mat-select-panel-exit");}_detachOverlay(){this._overlayDir.detachOverlay(),this._changeDetectorRef.markForCheck();}writeValue(e){this._assignValue(e);}registerOnChange(e){this._onChange=e;}registerOnTouched(e){this._onTouched=e;}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next();}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return "";if(this._multiple){let e=this._selectionModel.selected.map(t=>t.viewValue);return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState();}_isRtl(){return this._dir?this._dir.value==="rtl":false}_handleKeydown(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e));}_handleClosedKeydown(e){let t=e.keyCode,i=t===40||t===38||t===37||t===39,n=t===13||t===32,r=this._keyManager;if(!r.isTyping()&&n&&!Ve(e)||(this.multiple||e.altKey)&&i)e.preventDefault(),this.open();else if(!this.multiple){let d=this.selected;r.onKeydown(e);let o=this.selected;o&&d!==o&&this._liveAnnouncer.announce(o.viewValue,1e4);}}_handleOpenKeydown(e){let t=this._keyManager,i=e.keyCode,n=i===40||i===38,r=t.isTyping();if(n&&e.altKey)e.preventDefault(),this.close();else if(!r&&(i===13||i===32)&&t.activeItem&&!Ve(e))e.preventDefault(),t.activeItem._selectViaInteraction();else if(!r&&this._multiple&&i===65&&e.ctrlKey){e.preventDefault();let d=this.options.some(o=>!o.disabled&&!o.selected);this.options.forEach(o=>{o.disabled||(d?o.select():o.deselect());});}else {let d=t.activeItemIndex;t.onKeydown(e),this._multiple&&n&&e.shiftKey&&t.activeItem&&t.activeItemIndex!==d&&t.activeItem._selectViaInteraction();}}_handleOverlayKeydown(e){e.keyCode===27&&!Ve(e)&&(e.preventDefault(),this.close());}_onFocus(){this.disabled||(this._focused=true,this.stateChanges.next());}_onBlur(){this._focused=false,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next());}get empty(){return !this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next();});}_setSelectionByValue(e){if(this.options.forEach(t=>t.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)e.forEach(t=>this._selectOptionByValue(t)),this._sortValues();else {let t=this._selectOptionByValue(e);t?this._keyManager.updateActiveItem(t):this.panelOpen||this._keyManager.updateActiveItem(-1);}this._changeDetectorRef.markForCheck();}_selectOptionByValue(e){let t=this.options.find(i=>{if(this._selectionModel.isSelected(i))return false;try{return (i.value!=null||this.canSelectNullableOptions)&&this._compareWith(i.value,e)}catch(n){return false}});return t&&this._selectionModel.select(t),t}_assignValue(e){return e!==this._value||this._multiple&&Array.isArray(e)?(this.options&&this._setSelectionByValue(e),this._value=e,true):false}_skipPredicate=e=>this.panelOpen?false:e.disabled;_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof Rt?e.elementRef:e||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck();}_initKeyManager(){this._keyManager=new Pt$1(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close());}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction();});}_resetOptions(){let e=Yy(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(Vy(e)).subscribe(t=>{this._onSelect(t.source,t.isUserInput),t.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus());}),Yy(...this.options.map(t=>t._stateChanges)).pipe(Vy(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next();});}_onSelect(e,t){let i=this._selectionModel.isSelected(e);!this.canSelectNullableOptions&&e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(i!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),t&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),t&&this.focus())),i!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next();}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((t,i)=>this.sortComparator?this.sortComparator(t,i,e):e.indexOf(t)-e.indexOf(i)),this.stateChanges.next();}}_propagateChanges(e){let t;this.multiple?t=this.selected.map(i=>i.value):t=this.selected?this.selected.value:e,this._value=t,this.valueChange.emit(t),this._onChange(t),this.selectionChange.emit(this._getChangeEvent(t)),this._changeDetectorRef.markForCheck();}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let t=0;t<this.options.length;t++)if(!this.options.get(t).disabled){e=t;break}this._keyManager.setActiveItem(e);}else this._keyManager.setActiveItem(this._selectionModel.selected[0]);}_canOpen(){return !this._panelOpen&&!this.disabled&&this.options?.length>0&&!!this._overlayDir}focus(e){this._elementRef.nativeElement.focus(e);}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||null,t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||"";return this.ariaLabelledby&&(e+=" "+this.ariaLabelledby),e||(e=this._valueId),e}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){let t=this._elementRef.nativeElement;e.length?t.setAttribute("aria-describedby",e.join(" ")):t.removeAttribute("aria-describedby");}onContainerClick(e){let t=E(e);t&&(t.tagName==="MAT-OPTION"||t.classList.contains("cdk-overlay-backdrop")||t.closest(".mat-mdc-select-panel"))||(this.focus(),this.open());}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=Aw({type:a,selectors:[["mat-select"]],contentQueries:function(t,i,n){if(t&1&&kg(n,at,5)(n,Fn,5)(n,Hi$1,5),t&2){let r;IC(r=wC())&&(i.customTrigger=r.first),IC(r=wC())&&(i.options=r),IC(r=wC())&&(i.optionGroups=r);}},viewQuery:function(t,i){if(t&1&&Fg(Qe,5)(Ye,5)(_e$1,5),t&2){let n;IC(n=wC())&&(i.trigger=n.first),IC(n=wC())&&(i.panel=n.first),IC(n=wC())&&(i._overlayDir=n.first);}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:21,hostBindings:function(t,i){t&1&&Ag("keydown",function(r){return i._handleKeydown(r)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),t&2&&(Cg("id",i.id)("tabindex",i.disabled?-1:i.tabIndex)("aria-controls",i.panelOpen?i.id+"-panel":null)("aria-expanded",i.panelOpen)("aria-label",i.ariaLabel||null)("aria-required",i.required.toString())("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-activedescendant",i._getAriaActiveDescendant()),Hg("mat-mdc-select-disabled",i.disabled)("mat-mdc-select-invalid",i.errorState)("mat-mdc-select-required",i.required)("mat-mdc-select-empty",i.empty)("mat-mdc-select-multiple",i.multiple)("mat-select-open",i.panelOpen));},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",YT],disableRipple:[2,"disableRipple","disableRipple",YT],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:QT(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",YT],placeholder:"placeholder",required:[2,"required","required",YT],multiple:[2,"multiple","multiple",YT],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",YT],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",QT],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",YT]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[nT([{provide:de,useExisting:a},{provide:zi,useExisting:a}]),wu],ngContentSelectors:Xe,decls:11,vars:10,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"detach","backdropClick","overlayKeydown","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth","cdkConnectedOverlayFlexibleDimensions","cdkConnectedOverlayUsePopover"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",1,"mat-mdc-select-panel","mdc-menu-surface","mdc-menu-surface--open",3,"keydown"]],template:function(t,i){if(t&1&&(vC(Ue),vs(0,"div",2,0),Ag("click",function(){return i.open()}),vs(3,"div",3),eC(4,Je,2,1,"span",4)(5,et,3,1,"span",5),dl(),vs(6,"div",6)(7,"div",7),kf(),vs(8,"svg",8),bg(9,"path",9),dl()()()(),Dg(10,tt,3,16,"ng-template",10),Ag("detach",function(){return i.close()})("backdropClick",function(){return i.close()})("overlayKeydown",function(r){return i._handleOverlayKeydown(r)})),t&2){let n=TC(1);XE(3),Cg("id",i._valueId),XE(),tC(i.empty?4:5),XE(6),Tg("cdkConnectedOverlayDisableClose",true)("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",i._preferredOverlayOrigin||n)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayWidth",i._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",true)("cdkConnectedOverlayUsePopover",i._popoverLocation);}},dependencies:[Rt,_e$1],styles:[`@keyframes _mat-select-enter {
|
|
2
2
|
from {
|
|
3
3
|
opacity: 0;
|
|
4
4
|
transform: scaleY(0.8);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {v,q,J}from'./chunk-hpkckHAH.js';import {v as v$1}from'./chunk-BXeg32ej.js';import {g,ao as V,G,w as we,H as Hi,F as F$1,m as mT,cc as Hf,b as U,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,a8 as Zg,t as tC,a9 as dC,q as oC,a4 as rC,a3 as HI,o as bg,ac as mC,r as Tg,a6 as $I,x as iC,a5 as ml,cG as Xw,b_ as FC,aa as If,ab as wf}from'./main-CERDHS7N.js';import'./chunk-CoVKXwLW.js';import {k as _t,b as _e,o as z,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,A as At,m as mn,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';function le(i,t){i&1&&(vs(0,"p",5),WC(1,"Loading\u2026"),dl());}function se(i,t){if(i&1&&(vs(0,"label",23),bg(1,"input",24),HI(),vs(2,"span"),WC(3),dl()()),i&2){let e=t.$implicit,n=mC(3);XE(),Tg("formControl",n.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!n.isAdmin()),$I(),XE(2),Zg(e.label);}}function ce(i,t){if(i&1&&(vs(0,"fieldset",8)(1,"legend",22),WC(2,"Port\xE9e de la configuration"),dl(),oC(3,se,4,4,"label",23,Xw().trackByScope,true),dl()),i&2){let e=mC(2);Tg("disabled",e.isEditMode()),XE(3),iC(e.scopeOptions);}}function ue(i,t){if(i&1&&(vs(0,"option",13),WC(1),dl()),i&2){let e=t.$implicit,n=mC(2);Tg("value",e),XE(),Zg(n.authTypeLabel[e]);}}function de(i,t){i&1&&WC(0," Leave a field unchanged to keep the stored credential. ");}function pe(i,t){i&1&&(vs(0,"span",11),WC(1,"*"),dl());}function he(i,t){if(i&1&&(bg(0,"input",28),HI()),i&2){let e=mC().$implicit;FC("auth-setting-form__input"+(e.secret?" auth-setting-form__input--secret":"")),Tg("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),$I();}}function me(i,t){if(i&1&&(vs(0,"div",9)(1,"label",26),WC(2),eC(3,pe,2,0,"span",11),dl(),eC(4,he,1,7,"input",27),dl()),i&2){let e,n=t.$implicit,a=mC(3);XE(),Tg("for","as-cred-"+n.key),XE(),ml(" ",n.label," "),XE(),tC(n.required?3:-1),XE(),tC((e=a.controlForField(n.key))?4:-1,e);}}function ge(i,t){if(i&1&&(vs(0,"fieldset",18)(1,"legend",22),WC(2,"Credentials"),dl(),vs(3,"p",25),WC(4," Values are stored encrypted and masked on read. "),eC(5,de,1,0),dl(),oC(6,me,5,4,"div",9,Xw().trackByField,true),dl()),i&2){let e=mC(2);XE(5),tC(e.isEditMode()?5:-1),XE(),iC(e.credentialFields());}}function Ce(i,t){if(i&1){let e=dC();vs(0,"form",7),Ag("ngSubmit",function(){If(e);let a=mC();return wf(a.submit())}),eC(1,ce,5,1,"fieldset",8),vs(2,"div",9)(3,"label",10),WC(4,"Auth type "),vs(5,"span",11),WC(6,"*"),dl()(),vs(7,"select",12),oC(8,ue,2,2,"option",13,rC),dl(),HI(),dl(),vs(10,"div",9)(11,"label",14),WC(12,"Name "),vs(13,"span",11),WC(14,"*"),dl()(),bg(15,"input",15),HI(),dl(),vs(16,"div",9)(17,"label",16),WC(18,"Description"),dl(),bg(19,"input",17),HI(),dl(),eC(20,ge,8,1,"fieldset",18),vs(21,"div",19)(22,"button",20),WC(23),dl(),vs(24,"button",21),Ag("click",function(){If(e);let a=mC();return wf(a.cancel())}),WC(25,"Cancel"),dl()()();}if(i&2){let e=mC();Tg("formGroup",e.form),XE(),tC(e.isPlatformMode?-1:1),XE(6),Tg("formControl",e.authTypeControl),$I(),XE(),iC(e.authTypeOptions),XE(7),Tg("formControl",e.nameControl),$I(),XE(4),Tg("formControl",e.descriptionControl),$I(),XE(),tC(e.credentialFields().length>0?20:-1),XE(2),Tg("disabled",e.form.invalid||e.isSubmitting()),XE(),ml(" ",e.isEditMode()?"Save changes":"Create"," ");}}var fe=new Set(["namespace","userOnNs","userGlobal"]),F=Object.freeze({platform:"Plateforme (lecture seule)",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),ye={ApiKeyAuthSetting:[{key:"apiKey",label:"API Key",placeholder:"sk-\u2026",secret:true,required:false}],BasicAuthAuthSetting:[{key:"username",label:"Username",placeholder:"user@example.com",secret:false,required:false},{key:"password",label:"Password",placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",secret:true,required:false}],BearerTokenAuthSetting:[{key:"token",label:"Bearer token",placeholder:"eyJ\u2026",secret:true,required:false}],OAuthDiscoverableAuthSetting:[{key:"discoveryUrl",label:"Discovery URL",placeholder:"https://\u2026/.well-known/openid-configuration",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"openid profile email",secret:false,required:false}],OAuthCustomAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"openid profile email",secret:false,required:false}],OAuthRegisteredAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"openid profile email",secret:false,required:false}],OAuthMcpDiscoverableAuthSetting:[{key:"resourceUrl",label:"Resource URL",placeholder:"https://\u2026/mcp",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"openid profile email",secret:false,required:false}]},ae=class i{route=g(V);router=g(G);destroyRef=g(we);state=g(v);namespaceRole=g(v$1);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?Hi(true):F$1(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});authTypeOptions=q;authTypeLabel=J;scopeOptions=[{value:"namespace",label:F.namespace},{value:"userOnNs",label:F.userOnNs},{value:"userGlobal",label:F.userGlobal}];nameControl=new _t("",{nonNullable:true,validators:[_e.required,_e.minLength(1)]});descriptionControl=new _t(null);authTypeControl=new _t("ApiKeyAuthSetting",{nonNullable:true,validators:[_e.required]});scopeControl=new _t("namespace",{nonNullable:true});form=new z({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new _t("",{nonNullable:true});usernameControl=new _t("",{nonNullable:true});passwordControl=new _t("",{nonNullable:true});tokenControl=new _t("",{nonNullable:true});discoveryUrlControl=new _t("",{nonNullable:true});authorizationUrlControl=new _t("",{nonNullable:true});tokenUrlControl=new _t("",{nonNullable:true});clientIdControl=new _t("",{nonNullable:true});clientSecretControl=new _t("",{nonNullable:true});scopesControl=new _t("",{nonNullable:true});resourceUrlControl=new _t("",{nonNullable:true});selectedAuthType=F$1(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=mT(()=>ye[this.selectedAuthType()]);isEditMode=Hi(false);isSubmitting=Hi(false);isLoading=Hi(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Hf(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("authSettingId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let a=this.parseScope(e.get("scope"));this.scopeControl.setValue(a);let b=e.get("template");b&&this.hydrateFromTemplate(b);}parseScope(t){return t&&fe.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AuthSettingForm] Could not load auth setting '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.authTypeControl.setValue(e.authType),this.clearCredentialControls(),this.initialCredentials={},this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AuthSettingForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){switch(this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.authTypeControl.setValue(t.authType),this.clearCredentialControls(),this.initialCredentials={},t.authType){case "ApiKeyAuthSetting":{let e=t.apiKey??"";this.apiKeyControl.setValue(e),this.initialCredentials.apiKey=e;break}case "BasicAuthAuthSetting":{let e=t,n=e.username??"",a=e.password??"";this.usernameControl.setValue(n),this.passwordControl.setValue(a),this.initialCredentials.username=n,this.initialCredentials.password=a;break}case "BearerTokenAuthSetting":{let e=t.token??"";this.tokenControl.setValue(e),this.initialCredentials.token=e;break}case "OAuthDiscoverableAuthSetting":{let e=t;this.discoveryUrlControl.setValue(e.discoveryUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.discoveryUrl=e.discoveryUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthCustomAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthRegisteredAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthMcpDiscoverableAuthSetting":{let e=t;this.resourceUrlControl.setValue(e.resourceUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.resourceUrl=e.resourceUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}}}clearCredentialControls(){this.apiKeyControl.setValue(""),this.usernameControl.setValue(""),this.passwordControl.setValue(""),this.tokenControl.setValue(""),this.discoveryUrlControl.setValue(""),this.authorizationUrlControl.setValue(""),this.tokenUrlControl.setValue(""),this.clientIdControl.setValue(""),this.clientSecretControl.setValue(""),this.scopesControl.setValue(""),this.resourceUrlControl.setValue("");}credentialValue(t,e){if(!(this.isEditMode()&&e===this.initialCredentials[t]))return e||void 0}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.nameControl.value.trim(),e=this.descriptionControl.value?.trim()||void 0,n=this.authTypeControl.value,a=this.form.getRawValue().scope,b=this.isPlatformMode?null:this.namespaceId??null,w=this.buildTypedPayload(n,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,this.existingConfig):this.state.create(w,a,b)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}buildTypedPayload(t,e,n){let a={name:e,description:n};switch(t){case "ApiKeyAuthSetting":return z$1(P({},a),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case "BasicAuthAuthSetting":return z$1(P({},a),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case "BearerTokenAuthSetting":return z$1(P({},a),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case "OAuthDiscoverableAuthSetting":return z$1(P({},a),{authType:"OAuthDiscoverableAuthSetting",discoveryUrl:this.credentialValue("discoveryUrl",this.discoveryUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthCustomAuthSetting":return z$1(P({},a),{authType:"OAuthCustomAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthRegisteredAuthSetting":return z$1(P({},a),{authType:"OAuthRegisteredAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthMcpDiscoverableAuthSetting":return z$1(P({},a),{authType:"OAuthMcpDiscoverableAuthSetting",resourceUrl:this.credentialValue("resourceUrl",this.resourceUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)})}}controlForField(t){return {apiKey:this.apiKeyControl,username:this.usernameControl,password:this.passwordControl,token:this.tokenControl,discoveryUrl:this.discoveryUrlControl,authorizationUrl:this.authorizationUrlControl,tokenUrl:this.tokenUrlControl,clientId:this.clientIdControl,clientSecret:this.clientSecretControl,scopes:this.scopesControl,resourceUrl:this.resourceUrlControl}[t]}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","auth-settings"]):this.router.navigate(["/agentos",this.namespaceId,"auth-settings"]);}trackByScope(t,e){return e.value}trackByField(t,e){return e.key}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Aw({type:i,selectors:[["agentos-auth-setting-form"]],decls:10,vars:2,consts:[[1,"auth-setting-form"],[1,"auth-setting-form__header"],["type","button","title","Back to auth settings",1,"auth-setting-form__back",3,"click"],[1,"auth-setting-form__back-icon"],[1,"auth-setting-form__title"],[1,"auth-setting-form__loading"],[1,"auth-setting-form__form",3,"formGroup"],[1,"auth-setting-form__form",3,"ngSubmit","formGroup"],[1,"auth-setting-form__scope",3,"disabled"],[1,"auth-setting-form__field"],["for","as-auth-type",1,"auth-setting-form__label"],["aria-hidden","true"],["id","as-auth-type",1,"auth-setting-form__select",3,"formControl"],[3,"value"],["for","as-name",1,"auth-setting-form__label"],["id","as-name","type","text","placeholder","e.g. GitHub OAuth App","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],["for","as-description",1,"auth-setting-form__label"],["id","as-description","type","text","placeholder","Optional \u2014 short description of this auth setting","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],[1,"auth-setting-form__credentials"],[1,"auth-setting-form__actions"],["type","submit",1,"auth-setting-form__btn","auth-setting-form__btn--primary",3,"disabled"],["type","button",1,"auth-setting-form__btn",3,"click"],[1,"auth-setting-form__label"],[1,"auth-setting-form__scope-option"],["type","radio",3,"formControl","value","disabled"],[1,"auth-setting-form__credentials-hint"],[1,"auth-setting-form__label",3,"for"],[3,"id","class","type","placeholder","formControl","autocomplete"],[3,"id","type","placeholder","formControl","autocomplete"]],template:function(e,n){e&1&&(vs(0,"div",0)(1,"header",1)(2,"button",2),Ag("click",function(){return n.cancel()}),vs(3,"span",3),WC(4,"\u2190"),dl(),WC(5," Auth Settings "),dl(),vs(6,"h1",4),WC(7),dl()(),eC(8,le,2,0,"p",5)(9,Ce,26,8,"form",6),dl()),e&2&&(XE(7),Zg(n.isEditMode()?"Edit auth setting":"New auth setting"),XE(),tC(n.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,At,mn,Zn,Xn,Cn,En],styles:[".auth-setting-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:1.5rem;max-width:640px}.auth-setting-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;background:none;border:none;cursor:pointer;color:var(--color-text-secondary);font-size:.85rem;padding:0}.auth-setting-form__back[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.auth-setting-form__back-icon[_ngcontent-%COMP%]{font-size:1rem}.auth-setting-form__title[_ngcontent-%COMP%]{font-size:1.4rem;font-weight:600;color:var(--color-text);margin:0}.auth-setting-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem}.auth-setting-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.auth-setting-form__scope[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem;display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__scope[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__scope-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;font-size:.9rem;color:var(--color-text)}.auth-setting-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.auth-setting-form__label[_ngcontent-%COMP%]{font-size:.85rem;font-weight:500;color:var(--color-text-secondary)}.auth-setting-form__input[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;transition:border-color .15s ease;width:100%;box-sizing:border-box}.auth-setting-form__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__input--secret[_ngcontent-%COMP%]{font-family:monospace;letter-spacing:.05em}.auth-setting-form__select[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;cursor:pointer;transition:border-color .15s ease}.auth-setting-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__credentials[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem 1rem;display:flex;flex-direction:column;gap:.75rem;margin:0}.auth-setting-form__credentials[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__credentials-hint[_ngcontent-%COMP%]{font-size:.78rem;color:var(--color-text-secondary);margin:0}.auth-setting-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center;padding-top:.5rem}.auth-setting-form__btn[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem 1.25rem;cursor:pointer;font-size:.9rem;font-weight:500;background:var(--color-bg-secondary);color:var(--color-text);transition:background .15s ease}.auth-setting-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.auth-setting-form__btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.auth-setting-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-on-primary, #fff);border-color:var(--color-primary)}.auth-setting-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, var(--color-primary))}"]})};
|
|
1
|
+
import {v,q,J}from'./chunk-D2yqDA1u.js';import {v as v$1}from'./chunk-BhlAZzwj.js';import {g,ao as V,G,w as we,H as Hi,F as F$1,m as mT,cc as Hf,b as U,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,a8 as Zg,t as tC,a9 as dC,q as oC,a4 as rC,a3 as HI,o as bg,ac as mC,r as Tg,a6 as $I,x as iC,a5 as ml,cG as Xw,b_ as FC,aa as If,ab as wf}from'./main-ZCJEGFW3.js';import'./chunk-CtWA9Wcw.js';import {k as _t,b as _e,o as z,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,A as At,m as mn,Z as Zn,l as Xn,C as Cn,E as En}from'./chunk-Pl7edkoq.js';import'./chunk-DVJHLBDM.js';import'./chunk-B6HBR6l3.js';import'./chunk-BLwyktBH.js';import'./chunk-BUF2p97y.js';function le(i,t){i&1&&(vs(0,"p",5),WC(1,"Loading\u2026"),dl());}function se(i,t){if(i&1&&(vs(0,"label",23),bg(1,"input",24),HI(),vs(2,"span"),WC(3),dl()()),i&2){let e=t.$implicit,n=mC(3);XE(),Tg("formControl",n.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!n.isAdmin()),$I(),XE(2),Zg(e.label);}}function ce(i,t){if(i&1&&(vs(0,"fieldset",8)(1,"legend",22),WC(2,"Port\xE9e de la configuration"),dl(),oC(3,se,4,4,"label",23,Xw().trackByScope,true),dl()),i&2){let e=mC(2);Tg("disabled",e.isEditMode()),XE(3),iC(e.scopeOptions);}}function ue(i,t){if(i&1&&(vs(0,"option",13),WC(1),dl()),i&2){let e=t.$implicit,n=mC(2);Tg("value",e),XE(),Zg(n.authTypeLabel[e]);}}function de(i,t){i&1&&WC(0," Leave a field unchanged to keep the stored credential. ");}function pe(i,t){i&1&&(vs(0,"span",11),WC(1,"*"),dl());}function he(i,t){if(i&1&&(bg(0,"input",28),HI()),i&2){let e=mC().$implicit;FC("auth-setting-form__input"+(e.secret?" auth-setting-form__input--secret":"")),Tg("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),$I();}}function me(i,t){if(i&1&&(vs(0,"div",9)(1,"label",26),WC(2),eC(3,pe,2,0,"span",11),dl(),eC(4,he,1,7,"input",27),dl()),i&2){let e,n=t.$implicit,a=mC(3);XE(),Tg("for","as-cred-"+n.key),XE(),ml(" ",n.label," "),XE(),tC(n.required?3:-1),XE(),tC((e=a.controlForField(n.key))?4:-1,e);}}function ge(i,t){if(i&1&&(vs(0,"fieldset",18)(1,"legend",22),WC(2,"Credentials"),dl(),vs(3,"p",25),WC(4," Values are stored encrypted and masked on read. "),eC(5,de,1,0),dl(),oC(6,me,5,4,"div",9,Xw().trackByField,true),dl()),i&2){let e=mC(2);XE(5),tC(e.isEditMode()?5:-1),XE(),iC(e.credentialFields());}}function Ce(i,t){if(i&1){let e=dC();vs(0,"form",7),Ag("ngSubmit",function(){If(e);let a=mC();return wf(a.submit())}),eC(1,ce,5,1,"fieldset",8),vs(2,"div",9)(3,"label",10),WC(4,"Auth type "),vs(5,"span",11),WC(6,"*"),dl()(),vs(7,"select",12),oC(8,ue,2,2,"option",13,rC),dl(),HI(),dl(),vs(10,"div",9)(11,"label",14),WC(12,"Name "),vs(13,"span",11),WC(14,"*"),dl()(),bg(15,"input",15),HI(),dl(),vs(16,"div",9)(17,"label",16),WC(18,"Description"),dl(),bg(19,"input",17),HI(),dl(),eC(20,ge,8,1,"fieldset",18),vs(21,"div",19)(22,"button",20),WC(23),dl(),vs(24,"button",21),Ag("click",function(){If(e);let a=mC();return wf(a.cancel())}),WC(25,"Cancel"),dl()()();}if(i&2){let e=mC();Tg("formGroup",e.form),XE(),tC(e.isPlatformMode?-1:1),XE(6),Tg("formControl",e.authTypeControl),$I(),XE(),iC(e.authTypeOptions),XE(7),Tg("formControl",e.nameControl),$I(),XE(4),Tg("formControl",e.descriptionControl),$I(),XE(),tC(e.credentialFields().length>0?20:-1),XE(2),Tg("disabled",e.form.invalid||e.isSubmitting()),XE(),ml(" ",e.isEditMode()?"Save changes":"Create"," ");}}var fe=new Set(["namespace","userOnNs","userGlobal"]),F=Object.freeze({platform:"Plateforme (lecture seule)",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),ye={ApiKeyAuthSetting:[{key:"apiKey",label:"API Key",placeholder:"sk-\u2026",secret:true,required:false}],BasicAuthAuthSetting:[{key:"username",label:"Username",placeholder:"user@example.com",secret:false,required:false},{key:"password",label:"Password",placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",secret:true,required:false}],BearerTokenAuthSetting:[{key:"token",label:"Bearer token",placeholder:"eyJ\u2026",secret:true,required:false}],OAuthDiscoverableAuthSetting:[{key:"discoveryUrl",label:"Discovery URL",placeholder:"https://\u2026/.well-known/openid-configuration",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"openid profile email",secret:false,required:false}],OAuthCustomAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"openid profile email",secret:false,required:false}],OAuthRegisteredAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"openid profile email",secret:false,required:false}],OAuthMcpDiscoverableAuthSetting:[{key:"resourceUrl",label:"Resource URL",placeholder:"https://\u2026/mcp",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"openid profile email",secret:false,required:false}]},ae=class i{route=g(V);router=g(G);destroyRef=g(we);state=g(v);namespaceRole=g(v$1);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?Hi(true):F$1(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});authTypeOptions=q;authTypeLabel=J;scopeOptions=[{value:"namespace",label:F.namespace},{value:"userOnNs",label:F.userOnNs},{value:"userGlobal",label:F.userGlobal}];nameControl=new _t("",{nonNullable:true,validators:[_e.required,_e.minLength(1)]});descriptionControl=new _t(null);authTypeControl=new _t("ApiKeyAuthSetting",{nonNullable:true,validators:[_e.required]});scopeControl=new _t("namespace",{nonNullable:true});form=new z({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new _t("",{nonNullable:true});usernameControl=new _t("",{nonNullable:true});passwordControl=new _t("",{nonNullable:true});tokenControl=new _t("",{nonNullable:true});discoveryUrlControl=new _t("",{nonNullable:true});authorizationUrlControl=new _t("",{nonNullable:true});tokenUrlControl=new _t("",{nonNullable:true});clientIdControl=new _t("",{nonNullable:true});clientSecretControl=new _t("",{nonNullable:true});scopesControl=new _t("",{nonNullable:true});resourceUrlControl=new _t("",{nonNullable:true});selectedAuthType=F$1(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=mT(()=>ye[this.selectedAuthType()]);isEditMode=Hi(false);isSubmitting=Hi(false);isLoading=Hi(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Hf(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("authSettingId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let a=this.parseScope(e.get("scope"));this.scopeControl.setValue(a);let b=e.get("template");b&&this.hydrateFromTemplate(b);}parseScope(t){return t&&fe.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AuthSettingForm] Could not load auth setting '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.authTypeControl.setValue(e.authType),this.clearCredentialControls(),this.initialCredentials={},this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AuthSettingForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){switch(this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.authTypeControl.setValue(t.authType),this.clearCredentialControls(),this.initialCredentials={},t.authType){case "ApiKeyAuthSetting":{let e=t.apiKey??"";this.apiKeyControl.setValue(e),this.initialCredentials.apiKey=e;break}case "BasicAuthAuthSetting":{let e=t,n=e.username??"",a=e.password??"";this.usernameControl.setValue(n),this.passwordControl.setValue(a),this.initialCredentials.username=n,this.initialCredentials.password=a;break}case "BearerTokenAuthSetting":{let e=t.token??"";this.tokenControl.setValue(e),this.initialCredentials.token=e;break}case "OAuthDiscoverableAuthSetting":{let e=t;this.discoveryUrlControl.setValue(e.discoveryUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.discoveryUrl=e.discoveryUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthCustomAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthRegisteredAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthMcpDiscoverableAuthSetting":{let e=t;this.resourceUrlControl.setValue(e.resourceUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.resourceUrl=e.resourceUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}}}clearCredentialControls(){this.apiKeyControl.setValue(""),this.usernameControl.setValue(""),this.passwordControl.setValue(""),this.tokenControl.setValue(""),this.discoveryUrlControl.setValue(""),this.authorizationUrlControl.setValue(""),this.tokenUrlControl.setValue(""),this.clientIdControl.setValue(""),this.clientSecretControl.setValue(""),this.scopesControl.setValue(""),this.resourceUrlControl.setValue("");}credentialValue(t,e){if(!(this.isEditMode()&&e===this.initialCredentials[t]))return e||void 0}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.nameControl.value.trim(),e=this.descriptionControl.value?.trim()||void 0,n=this.authTypeControl.value,a=this.form.getRawValue().scope,b=this.isPlatformMode?null:this.namespaceId??null,w=this.buildTypedPayload(n,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,this.existingConfig):this.state.create(w,a,b)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}buildTypedPayload(t,e,n){let a={name:e,description:n};switch(t){case "ApiKeyAuthSetting":return z$1(P({},a),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case "BasicAuthAuthSetting":return z$1(P({},a),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case "BearerTokenAuthSetting":return z$1(P({},a),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case "OAuthDiscoverableAuthSetting":return z$1(P({},a),{authType:"OAuthDiscoverableAuthSetting",discoveryUrl:this.credentialValue("discoveryUrl",this.discoveryUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthCustomAuthSetting":return z$1(P({},a),{authType:"OAuthCustomAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthRegisteredAuthSetting":return z$1(P({},a),{authType:"OAuthRegisteredAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthMcpDiscoverableAuthSetting":return z$1(P({},a),{authType:"OAuthMcpDiscoverableAuthSetting",resourceUrl:this.credentialValue("resourceUrl",this.resourceUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)})}}controlForField(t){return {apiKey:this.apiKeyControl,username:this.usernameControl,password:this.passwordControl,token:this.tokenControl,discoveryUrl:this.discoveryUrlControl,authorizationUrl:this.authorizationUrlControl,tokenUrl:this.tokenUrlControl,clientId:this.clientIdControl,clientSecret:this.clientSecretControl,scopes:this.scopesControl,resourceUrl:this.resourceUrlControl}[t]}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","auth-settings"]):this.router.navigate(["/agentos",this.namespaceId,"auth-settings"]);}trackByScope(t,e){return e.value}trackByField(t,e){return e.key}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Aw({type:i,selectors:[["agentos-auth-setting-form"]],decls:10,vars:2,consts:[[1,"auth-setting-form"],[1,"auth-setting-form__header"],["type","button","title","Back to auth settings",1,"auth-setting-form__back",3,"click"],[1,"auth-setting-form__back-icon"],[1,"auth-setting-form__title"],[1,"auth-setting-form__loading"],[1,"auth-setting-form__form",3,"formGroup"],[1,"auth-setting-form__form",3,"ngSubmit","formGroup"],[1,"auth-setting-form__scope",3,"disabled"],[1,"auth-setting-form__field"],["for","as-auth-type",1,"auth-setting-form__label"],["aria-hidden","true"],["id","as-auth-type",1,"auth-setting-form__select",3,"formControl"],[3,"value"],["for","as-name",1,"auth-setting-form__label"],["id","as-name","type","text","placeholder","e.g. GitHub OAuth App","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],["for","as-description",1,"auth-setting-form__label"],["id","as-description","type","text","placeholder","Optional \u2014 short description of this auth setting","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],[1,"auth-setting-form__credentials"],[1,"auth-setting-form__actions"],["type","submit",1,"auth-setting-form__btn","auth-setting-form__btn--primary",3,"disabled"],["type","button",1,"auth-setting-form__btn",3,"click"],[1,"auth-setting-form__label"],[1,"auth-setting-form__scope-option"],["type","radio",3,"formControl","value","disabled"],[1,"auth-setting-form__credentials-hint"],[1,"auth-setting-form__label",3,"for"],[3,"id","class","type","placeholder","formControl","autocomplete"],[3,"id","type","placeholder","formControl","autocomplete"]],template:function(e,n){e&1&&(vs(0,"div",0)(1,"header",1)(2,"button",2),Ag("click",function(){return n.cancel()}),vs(3,"span",3),WC(4,"\u2190"),dl(),WC(5," Auth Settings "),dl(),vs(6,"h1",4),WC(7),dl()(),eC(8,le,2,0,"p",5)(9,Ce,26,8,"form",6),dl()),e&2&&(XE(7),Zg(n.isEditMode()?"Edit auth setting":"New auth setting"),XE(),tC(n.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,At,mn,Zn,Xn,Cn,En],styles:[".auth-setting-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:1.5rem;max-width:640px}.auth-setting-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;background:none;border:none;cursor:pointer;color:var(--color-text-secondary);font-size:.85rem;padding:0}.auth-setting-form__back[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.auth-setting-form__back-icon[_ngcontent-%COMP%]{font-size:1rem}.auth-setting-form__title[_ngcontent-%COMP%]{font-size:1.4rem;font-weight:600;color:var(--color-text);margin:0}.auth-setting-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem}.auth-setting-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.auth-setting-form__scope[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem;display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__scope[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__scope-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;font-size:.9rem;color:var(--color-text)}.auth-setting-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.auth-setting-form__label[_ngcontent-%COMP%]{font-size:.85rem;font-weight:500;color:var(--color-text-secondary)}.auth-setting-form__input[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;transition:border-color .15s ease;width:100%;box-sizing:border-box}.auth-setting-form__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__input--secret[_ngcontent-%COMP%]{font-family:monospace;letter-spacing:.05em}.auth-setting-form__select[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;cursor:pointer;transition:border-color .15s ease}.auth-setting-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__credentials[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem 1rem;display:flex;flex-direction:column;gap:.75rem;margin:0}.auth-setting-form__credentials[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__credentials-hint[_ngcontent-%COMP%]{font-size:.78rem;color:var(--color-text-secondary);margin:0}.auth-setting-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center;padding-top:.5rem}.auth-setting-form__btn[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem 1.25rem;cursor:pointer;font-size:.9rem;font-weight:500;background:var(--color-bg-secondary);color:var(--color-text);transition:background .15s ease}.auth-setting-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.auth-setting-form__btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.auth-setting-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-on-primary, #fff);border-color:var(--color-primary)}.auth-setting-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, var(--color-primary))}"]})};
|
|
2
2
|
export{ae as AuthSettingFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {n}from'./chunk-CfgXrte_.js';import {y}from'./chunk-
|
|
1
|
+
import {n}from'./chunk-CfgXrte_.js';import {y}from'./chunk-2TapTaXG.js';import {v}from'./chunk-BhlAZzwj.js';import {g,ao as V,G,w as we,H as Hi,u as ue,b as U$1,bR as ga,S as pa,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,W as WC,X as XE,a8 as Zg,a9 as dC,aa as If,ab as wf,ag as fT}from'./main-ZCJEGFW3.js';import {O}from'./chunk-C4iXIN7X.js';import'./chunk-CtWA9Wcw.js';import {W as Wn,D as De}from'./chunk-BLwyktBH.js';import'./chunk-BUF2p97y.js';import'./chunk-Pl7edkoq.js';import'./chunk-DVJHLBDM.js';import'./chunk-B6HBR6l3.js';var z=()=>[];function W(o,e){if(o&1&&(vs(0,"p",3),WC(1),dl()),o&2){let t=mC().$implicit;XE(),Zg(t.name);}}function U(o,e){if(o&1){let t=dC();vs(0,"agentos-integration-config-item",5),Ag("editRequested",function(){let i=If(t),r=mC(2);return wf(r.onEdit(i))})("deleteRequested",function(){let i=If(t),r=mC(2);return wf(r.onDelete(i))})("duplicateRequested",function(){let i=If(t),r=mC(2);return wf(r.onDuplicate(i))}),dl();}if(o&2){let t=e,n=mC(2);Tg("config",t.config)("scope",t.scope)("readOnly",t.scope==="platform"||t.scope==="namespace"&&!n.isAdmin());}}function X(o,e){if(o&1&&eC(0,W,2,1,"p",3)(1,U,1,3,"agentos-integration-config-item",4),o&2){let t,n=e.$implicit,i=mC();tC(i.isEmptyPlaceholder(n.id)?0:(t=i.resolve(n.id))?1:-1,t);}}var k=Object.freeze({platform:"Configurations plateforme",namespace:"Configurations du namespace",userOnNs:"Mes overrides sur ce namespace",userGlobal:"Mes overrides globaux"}),F="__empty__",j=class o{route=g(V);router=g(G);destroyRef=g(we);state=g(y);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=Hi(false);listItems$=this.state.vm$.pipe(ue(e=>this.toListItems(e)));resolved=new Map;ngOnInit(){this.route.paramMap.pipe(U$1(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t);}),this.route.paramMap.pipe(ue(e=>e.get("namespaceId")??""),ga(e=>e?this.namespaceRole.isAdminOfNamespace$(e):pa(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe(e=>{let t=new Map;e.platform.forEach(n=>{n.id&&t.set(this.itemKey("platform",n.id),{config:n,scope:"platform"});}),e.namespace.forEach(n=>{n.id&&t.set(this.itemKey("namespace",n.id),{config:n,scope:"namespace"});}),e.userOnNs.forEach(n=>{n.id&&t.set(this.itemKey("userOnNs",n.id),{config:n,scope:"userOnNs"});}),e.userGlobal.forEach(n=>{n.id&&t.set(this.itemKey("userGlobal",n.id),{config:n,scope:"userGlobal"});}),this.resolved=t;});}isEmptyPlaceholder(e){return e.startsWith(F)}resolve(e){return this.resolved.get(e)??null}itemKey(e,t){return `${e}:${t}`}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:n(this.isAdmin())}});}onEdit(e){let t=e.config.id??"";this.router.navigate(["/agentos",this.namespaceId,"integrations",t,"edit"],{queryParams:{scope:e.scope}});}onDelete(e){let t=e.config.id;t&&this.state.delete(t,e.scope).pipe(U$1(this.destroyRef)).subscribe({error:n=>{console.error(`[IntegrationsAllScopes] Delete failed for ${e.scope}:${t}:`,n);}});}onDuplicate(e){if(!e.config.id)return;let n=(e.scope==="namespace"||e.scope==="platform")&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:n,template:e.config.id,templateScope:e.scope}});}toListItems(e){let t=[];return t.push(...this.sectionItems("platform",e.platform)),t.push(...this.sectionItems("namespace",e.namespace)),t.push(...this.sectionItems("userOnNs",e.userOnNs)),t.push(...this.sectionItems("userGlobal",e.userGlobal)),t}sectionItems(e,t){return t.length===0?[{id:`${F}${e}`,name:"Aucune configuration",groupKey:e,groupLabel:k[e]}]:t.filter(n=>!!n.id).map(n=>({id:this.itemKey(e,n.id),name:n.name,description:n.integrationType,groupKey:e,groupLabel:k[e]}))}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=Aw({type:o,selectors:[["agentos-integrations-all-scopes"]],decls:5,vars:6,consts:[["integrationItemTpl",""],["title","Integrations","emptyMessage","No integrations available.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[1,"integrations-all-scopes__empty"],[3,"config","scope","readOnly"],[3,"editRequested","deleteRequested","duplicateRequested","config","scope","readOnly"]],template:function(t,n){if(t&1&&(vs(0,"ds-entity-list",1),aT(1,"async"),Ag("createRequested",function(){return n.openCreateForm()}),vs(2,"ds-icon-button",2),Ag("action",function(){return n.goBack()}),dl()(),Dg(3,X,2,1,"ng-template",null,0,fT)),t&2){let i=TC(4);Tg("items",uT(1,3,n.listItems$)??rT(5,z))("showCreate",true)("itemTemplate",i);}},dependencies:[Wn,O,De,Nb],styles:[".integrations-all-scopes__empty[_ngcontent-%COMP%]{margin:0;padding:.65rem 1rem;font-size:.85rem;font-style:italic;color:var(--color-text-secondary)}"]})};export{j as IntegrationsAllScopesComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {K as Kn,Z as Zn,D as De}from'./chunk-
|
|
1
|
+
import {K as Kn,Z as Zn,D as De}from'./chunk-BLwyktBH.js';import {ca as hB,cb as pB,H as Hi,A as Aw,v as vs,W as WC,k as dl,n as eC,X as XE,a8 as Zg,a5 as ml,t as tC,a9 as dC,l as Ag,ac as mC,r as Tg,aa as If,ab as wf}from'./main-ZCJEGFW3.js';function A(o,a){if(o&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(o,a){if(o&1){let e=dC();vs(0,"ds-kebab-menu",10),Ag("itemSelected",function(l){If(e);let O=mC();return wf(O.onMenuAction(l))}),dl();}if(o&2){let e=mC();Tg("items",e.menuItems);}}var I=class o{model=hB.required();namespaceId=hB(void 0);readOnly=hB(false);deleteRequested=pB();editRequested=pB();pendingDelete=Hi(false);menuItems=[{key:"edit",label:"Edit model",icon:"edit"},{key:"delete",label:"Delete model",icon:"delete",variant:"danger"}];get displayTitle(){return this.model().alias??this.model().apiModelName}onMenuAction(a){switch(a){case "edit":this.editRequested.emit(this.model());break;case "delete":this.pendingDelete.set(true);break}}onDeleteConfirmed(){this.pendingDelete.set(false),this.deleteRequested.emit(this.model());}onDeleteCancelled(){this.pendingDelete.set(false);}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=Aw({type:o,selectors:[["agentos-ai-model-item"]],inputs:{model:[1,"model"],namespaceId:[1,"namespaceId"],readOnly:[1,"readOnly"]},outputs:{deleteRequested:"deleteRequested",editRequested:"editRequested"},decls:12,vars:4,consts:[["role","listitem","dsBlueprint","",1,"ai-model-item"],[1,"ai-model-item__body"],[1,"ai-model-item__name"],[1,"ai-model-item__api-name"],[1,"ai-model-item__params"],[1,"ai-model-item__actions"],[3,"items"],[1,"ai-model-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],[3,"itemSelected","items"]],template:function(e,i){e&1&&(vs(0,"div",0)(1,"div",1)(2,"span",2),WC(3),dl(),vs(4,"span",3),WC(5),dl(),vs(6,"span",4)(7,"span"),WC(8),dl()()(),vs(9,"div",5),eC(10,A,4,0)(11,P,1,1,"ds-kebab-menu",6),dl()()),e&2&&(XE(3),Zg(i.displayTitle),XE(2),Zg(i.model().apiModelName),XE(3),ml("priority: ",i.model().priority),XE(2),tC(i.pendingDelete()?10:i.readOnly()?-1:11));},dependencies:[Kn,Zn,De],styles:[".ai-model-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:14px 16px;position:relative;border-radius:0;border:1px solid var(--color-divider);background:var(--color-bg);box-shadow:var(--shadow-sm);overflow:visible;transition:border-color .15s ease}.ai-model-item[_ngcontent-%COMP%]:hover{border-color:var(--color-accent)}.ai-model-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.ai-model-item__name[_ngcontent-%COMP%]{font-size:15px;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-model-item__api-name[_ngcontent-%COMP%]{font-size:13px;color:var(--color-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-model-item__params[_ngcontent-%COMP%]{display:flex;gap:.75rem;font-size:13px;color:var(--color-text-secondary)}.ai-model-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.ai-model-item[_ngcontent-%COMP%]:hover .ai-model-item__actions[_ngcontent-%COMP%], .ai-model-item[_ngcontent-%COMP%]:focus-within .ai-model-item__actions[_ngcontent-%COMP%]{opacity:1}.ai-model-item__confirm-label[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--red-deep);margin-right:.25rem;white-space:nowrap}"]})};export{I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {R}from'./chunk-
|
|
1
|
+
import {R}from'./chunk-Cxcbg8Y2.js';import {c}from'./chunk-B0kyFx_y.js';import {g,G,w as we,H as Hi,m as mT,b as U,A as Aw,v as vs,l as Ag,k as dl,af as Dg,T as TC,r as Tg,n as eC,ac as mC,t as tC,a9 as dC,aa as If,ab as wf,ag as fT}from'./main-ZCJEGFW3.js';import {W as Wn,D as De}from'./chunk-BLwyktBH.js';import'./chunk-BUF2p97y.js';import'./chunk-Pl7edkoq.js';function M(r,e){if(r&1){let t=dC();vs(0,"agentos-scheduled-prompt-item",4),Ag("enableRequested",function(n){If(t);let i=mC(2);return wf(i.enablePrompt(n))})("disableRequested",function(n){If(t);let i=mC(2);return wf(i.disablePrompt(n))})("deleteRequested",function(n){If(t);let i=mC(2);return wf(i.deletePrompt(n))}),dl();}r&2&&Tg("definition",e)("platformMode",true);}function E(r,e){if(r&1&&eC(0,M,1,2,"agentos-scheduled-prompt-item",3),r&2){let t,o=e.$implicit,n=mC();tC((t=n.resolvePrompt(o.id))?0:-1,t);}}var D=class r{router=g(G);destroyRef=g(we);state=g(c);prompts=Hi([]);promptItems=mT(()=>this.prompts().map(e=>({id:e.id??"",name:e.name,description:e.description,badges:[{label:e.enabled?"Enabled":"Disabled",variant:e.enabled?"success":"warning"}]})));constructor(){this.state.listPlatform().pipe(U(this.destroyRef)).subscribe(e=>this.prompts.set(e));}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","scheduled-prompts","new"]);}enablePrompt(e){this.state.enable(e.id??"").pipe(U(this.destroyRef)).subscribe(t=>this.patchPrompt(t));}disablePrompt(e){this.state.disable(e.id??"").pipe(U(this.destroyRef)).subscribe(t=>this.patchPrompt(t));}deletePrompt(e){let t=e.id??"";this.state.delete(t).pipe(U(this.destroyRef)).subscribe(()=>this.prompts.update(o=>o.filter(n=>n.id!==t)));}resolvePrompt(e){return this.prompts().find(t=>t.id===e)??null}patchPrompt(e){this.prompts.update(t=>t.map(o=>o.id===e.id?e:o));}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=Aw({type:r,selectors:[["agentos-platform-scheduled-prompts"]],decls:4,vars:3,consts:[["scheduledPromptItemTpl",""],["title","Platform Scheduled Prompts","emptyMessage","No platform scheduled prompts defined yet. Add one above.","cardMinWidth","420px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"definition","platformMode"],[3,"enableRequested","disableRequested","deleteRequested","definition","platformMode"]],template:function(t,o){if(t&1&&(vs(0,"ds-entity-list",1),Ag("createRequested",function(){return o.openCreateForm()}),vs(1,"ds-icon-button",2),Ag("action",function(){return o.goBack()}),dl()(),Dg(2,E,1,1,"ng-template",null,0,fT)),t&2){let n=TC(3);Tg("items",o.promptItems())("showCreate",true)("itemTemplate",n);}},dependencies:[Wn,R,De],encapsulation:2})};export{D as PlatformScheduledPromptsComponent};
|