@whoz-oss/coday-client 0.0.0-workstream-forge.154 → 0.0.0-workstream-forge.155
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-r5HbmmrD.js → chunk-0-_NaMm2.js} +1 -1
- package/browser/{chunk-Df7mJsQ6.js → chunk-B8g-L-f4.js} +1 -1
- package/browser/{chunk-BRszTcK-.js → chunk-B8qNGdT2.js} +1 -1
- package/browser/{chunk-DNDdgYmz.js → chunk-BCA25pxf.js} +1 -1
- package/browser/{chunk-D5ESKDZR.js → chunk-BHX-lnSw.js} +1 -1
- package/browser/{chunk-DnN3Mm5v.js → chunk-BJfbnIDb.js} +1 -1
- package/browser/{chunk-Bc3SNqlK.js → chunk-BO-1BSJ7.js} +1 -1
- package/browser/{chunk-9y4dM3ki.js → chunk-BSqKTrmi.js} +1 -1
- package/browser/{chunk-BKq9X9td.js → chunk-BURmPWM6.js} +1 -1
- package/browser/{chunk-qIGXV1-U.js → chunk-Bbp6L-j5.js} +1 -1
- package/browser/{chunk-BIgUiQGB.js → chunk-Bm1wN4Ny.js} +1 -1
- package/browser/{chunk-n4et00To.js → chunk-Bo0Ey4Kz.js} +1 -1
- package/browser/{chunk-CnZuoUqd.js → chunk-BqN54aoJ.js} +1 -1
- package/browser/{chunk-Bg6AQkpr.js → chunk-BqeRYaSk.js} +1 -1
- package/browser/chunk-BtHSpru4.js +1 -0
- package/browser/{chunk-CnrXSi8P.js → chunk-BvRIJji6.js} +1 -1
- package/browser/{chunk-CG4sKh_P.js → chunk-Bw_L4TgR.js} +1 -1
- package/browser/{chunk-I27PvijE.js → chunk-BxPIUr1d.js} +1 -1
- package/browser/{chunk-BnvP57SF.js → chunk-Bz_-XlVi.js} +1 -1
- package/browser/{chunk-B1DXVe16.js → chunk-C-h37sKv.js} +1 -1
- package/browser/{chunk-By4LFtM_.js → chunk-C9YHn6bP.js} +1 -1
- package/browser/{chunk-jIZDPZfC.js → chunk-CHprdgzv.js} +1 -1
- package/browser/{chunk-CAeXtkSE.js → chunk-CIPnlfXl.js} +1 -1
- package/browser/{chunk-BCgozR50.js → chunk-CMivw_-z.js} +1 -1
- package/browser/{chunk-CZ-gVBgG.js → chunk-CU1TvHtl.js} +1 -1
- package/browser/{chunk-BOyKxHWc.js → chunk-CXJCUISu.js} +1 -1
- package/browser/{chunk-BSpVHkUr.js → chunk-Cb8eN6UQ.js} +1 -1
- package/browser/{chunk-D8WIbHtX.js → chunk-Ct_vl5Mr.js} +1 -1
- package/browser/{chunk-Bz9ytfN0.js → chunk-D1EGHCm3.js} +25 -25
- package/browser/chunk-D55Q654U.js +1 -0
- package/browser/{chunk-Bthk1YeI.js → chunk-D5zzEPKF.js} +1 -1
- package/browser/{chunk-VEEK6UGK.js → chunk-DMxdvp-4.js} +1 -1
- package/browser/{chunk-N1XfZ8fV.js → chunk-DNUtdX2q.js} +1 -1
- package/browser/{chunk-yAW15cnp.js → chunk-D_EcbmmN.js} +1 -1
- package/browser/{chunk-D3xgHc6n.js → chunk-DfRDiWN8.js} +1 -1
- package/browser/{chunk-CUJUFerZ.js → chunk-DpMuQqxo.js} +1 -1
- package/browser/{chunk-BswGUEXP.js → chunk-DqEtXijf.js} +1 -1
- package/browser/{chunk-DRDMJT4u.js → chunk-DrDGJBfk.js} +1 -1
- package/browser/{chunk-BzDiiTCF.js → chunk-EfdhHMyl.js} +1 -1
- package/browser/{chunk-DnQq_HEf.js → chunk-GWLm1eV3.js} +1 -1
- package/browser/{chunk-BxaiE50q.js → chunk-KNg-4TZO.js} +1 -1
- package/browser/{chunk-Cm9NbeOx.js → chunk-SGQ_UGtC.js} +1 -1
- package/browser/{chunk-DlyzCxRs.js → chunk-SnmDdJE9.js} +1 -1
- package/browser/{chunk-DyPx2k7Y.js → chunk-Vb2IMeLm.js} +1 -1
- package/browser/{chunk-C76R0iN8.js → chunk-l8k46GQz.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/{main-QSAMSEVG.js → main-GRB5KOIR.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-Buyrfz0K.js +0 -1
- package/browser/chunk-C0dQg7yj.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {O as O$1}from'./chunk-BCgozR50.js';import {R}from'./chunk-Df7mJsQ6.js';import {O}from'./chunk-DyPx2k7Y.js';import {p,f as It,aB as Pn,F as Me$1,d as ie,M as Mi,a2 as F,as as Ms,aA as j,U,D as Df,z as za,K as dc,b as bf,r as r_,h as hT,y as yb,a as pT,e as yT,N as NT,v as vT,k as bT,q as gv,u as uc,I as Iv,A as Af,l as lc,L as sS,O as tv,Q as cS,o as ig,s as sg,a4 as dT}from'./main-QSAMSEVG.js';import {l,I,B,$,v as vt,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,c as bt,L as Ln,W as Wn,V as Vn,y as yn,r as qe}from'./chunk-Bz9ytfN0.js';import'./chunk-C0dQg7yj.js';var D=(r,i)=>i.value,se=(r,i)=>i.label;function de(r,i){r&1&&(za(0,"p",4),r_(1,"Loading\u2026"),bf());}function _e(r,i){if(r&1){let e=bT();za(0,"button",19),dc("click",function(){let d=ig(e).$implicit,_=NT(2);return sg(_.setThemeVariant(d.value))}),za(1,"span",20),r_(2),bf(),za(3,"span",21),r_(4),bf()();}if(r&2){let e=i.$implicit,a=NT(2);gv("user-profile__theme-variant--active",a.themeVariant()===e.value),uc("aria-pressed",a.themeVariant()===e.value),yb(2),Iv(e.label),yb(2),Iv(e.description);}}function ce(r,i){if(r&1){let e=bT();za(0,"button",22),dc("click",function(){let d=ig(e).$implicit,_=NT(2);return sg(_.setTheme(d.value))}),r_(1),bf();}if(r&2){let e=i.$implicit,a=NT(2);gv("user-profile__segmented-option--active",a.themeMode()===e.value),uc("aria-pressed",a.themeMode()===e.value),yb(),Af(" ",e.label," ");}}function pe(r,i){if(r&1){let e=bT();za(0,"button",22),dc("click",function(){let d=ig(e).$implicit,_=NT(2);return sg(_.setEnterKeyBehavior(d.value))}),r_(1),bf();}if(r&2){let e=i.$implicit,a=NT(2);gv("user-profile__segmented-option--active",a.enterKeyBehavior()===e.value),uc("aria-pressed",a.enterKeyBehavior()===e.value),yb(),Af(" ",e.label," ");}}function me(r,i){if(r&1){let e=bT();za(0,"button",22),dc("click",function(){let d=ig(e).$implicit,_=NT(2);return sg(_.setShowTechnical(d.value))}),r_(1),bf();}if(r&2){let e=i.$implicit,a=NT(2);gv("user-profile__segmented-option--active",a.showTechnical()===e.value),uc("aria-pressed",a.showTechnical()===e.value),yb(),Af(" ",e.label," ");}}function ue(r,i){if(r&1&&(za(0,"option",33),r_(1),bf()),r&2){let e=i.$implicit;tv("value",e.value),yb(),Iv(e.label);}}function fe(r,i){if(r&1){let e=bT();za(0,"form",23),dc("ngSubmit",function(){ig(e);let d=NT(2);return sg(d.save())}),za(1,"div",5)(2,"h2",6),r_(3,"Identity"),bf(),za(4,"div",7)(5,"span",8),r_(6,"Email"),bf(),za(7,"span",24),r_(8),bf()(),za(9,"div",7)(10,"span",8),r_(11,"External ID"),bf(),za(12,"span",24),r_(13),bf()()(),za(14,"div",5)(15,"h2",6),r_(16,"Profile"),bf(),za(17,"div",7)(18,"label",25),r_(19,"First name"),bf(),lc(20,"input",26),sS(),bf(),za(21,"div",7)(22,"label",27),r_(23,"Last name"),bf(),lc(24,"input",28),sS(),bf(),za(25,"div",7)(26,"label",29),r_(27,"Bio"),bf(),lc(28,"textarea",30),sS(),bf(),za(29,"div",7)(30,"label",31),r_(31,"Language"),bf(),za(32,"select",32),yT(33,ue,2,2,"option",33,D),bf(),sS(),bf()(),za(35,"div",34)(36,"button",35),r_(37),bf(),za(38,"button",36),dc("click",function(){ig(e);let d=NT(2);return sg(d.cancelEditing())}),r_(39,"Cancel"),bf()()();}if(r&2){let e=NT(),a=NT();tv("formGroup",a.form),yb(8),Iv(e.email),yb(5),Iv(e.externalId),yb(7),cS(),yb(4),cS(),yb(4),cS(),yb(4),cS(),yb(),vT(a.languageOptions),yb(3),tv("disabled",a.isSaving()),yb(),Af(" ",a.isSaving()?"Saving\u2026":"Save changes"," ");}}function ge(r,i){r&1&&(za(0,"p",44),r_(1," No global configuration yet. Create one from the Integrations / AI Providers / Auth Settings pages of your namespaces. "),bf());}function Ce(r,i){if(r&1){let e=bT();za(0,"span",51),r_(1,"Delete?"),bf(),za(2,"button",52),dc("click",function(){ig(e);let d=NT().$implicit,_=NT(6);return sg(_.confirmDelete(d))}),r_(3," Confirm "),bf(),za(4,"button",53),dc("click",function(){ig(e);let d=NT(7);return sg(d.cancelDelete())}),r_(5," Cancel "),bf();}}function ve(r,i){if(r&1){let e=bT();za(0,"button",53),dc("click",function(){ig(e);let d=NT().$implicit,_=NT(6);return sg(_.armDelete(d))}),r_(1," Delete "),bf();}}function xe(r,i){if(r&1&&(za(0,"li",47)(1,"span",48),r_(2),bf(),za(3,"span",49),r_(4),bf(),hT(5,Ce,6,0)(6,ve,2,0,"button",50),bf()),r&2){let e=i.$implicit,a=NT(6);yb(2),Iv(e.name),yb(2),Iv(e.subtitle),yb(),pT(a.isPendingDelete(e)?5:6);}}function be(r,i){if(r&1&&(za(0,"h3",45),r_(1,"Integrations"),bf(),za(2,"ul",46),yT(3,xe,7,3,"li",47,dT().trackEntry,true),bf()),r&2){let e=NT(5);yb(3),vT(e.recap().integrations);}}function ye(r,i){if(r&1){let e=bT();za(0,"span",51),r_(1,"Delete?"),bf(),za(2,"button",52),dc("click",function(){ig(e);let d=NT().$implicit,_=NT(6);return sg(_.confirmDelete(d))}),r_(3," Confirm "),bf(),za(4,"button",53),dc("click",function(){ig(e);let d=NT(7);return sg(d.cancelDelete())}),r_(5," Cancel "),bf();}}function he(r,i){if(r&1){let e=bT();za(0,"button",53),dc("click",function(){ig(e);let d=NT().$implicit,_=NT(6);return sg(_.armDelete(d))}),r_(1," Delete "),bf();}}function Se(r,i){if(r&1&&(za(0,"li",47)(1,"span",48),r_(2),bf(),za(3,"span",49),r_(4),bf(),hT(5,ye,6,0)(6,he,2,0,"button",50),bf()),r&2){let e=i.$implicit,a=NT(6);yb(2),Iv(e.name),yb(2),Iv(e.subtitle),yb(),pT(a.isPendingDelete(e)?5:6);}}function Ee(r,i){if(r&1&&(za(0,"h3",45),r_(1,"AI Providers"),bf(),za(2,"ul",46),yT(3,Se,7,3,"li",47,dT().trackEntry,true),bf()),r&2){let e=NT(5);yb(3),vT(e.recap().aiProviders);}}function Pe(r,i){if(r&1){let e=bT();za(0,"span",51),r_(1,"Delete?"),bf(),za(2,"button",52),dc("click",function(){ig(e);let d=NT().$implicit,_=NT(6);return sg(_.confirmDelete(d))}),r_(3," Confirm "),bf(),za(4,"button",53),dc("click",function(){ig(e);let d=NT(7);return sg(d.cancelDelete())}),r_(5," Cancel "),bf();}}function we(r,i){if(r&1){let e=bT();za(0,"button",53),dc("click",function(){ig(e);let d=NT().$implicit,_=NT(6);return sg(_.armDelete(d))}),r_(1," Delete "),bf();}}function ke(r,i){if(r&1&&(za(0,"li",47)(1,"span",48),r_(2),bf(),za(3,"span",49),r_(4),bf(),hT(5,Pe,6,0)(6,we,2,0,"button",50),bf()),r&2){let e=i.$implicit,a=NT(6);yb(2),Iv(e.name),yb(2),Iv(e.subtitle),yb(),pT(a.isPendingDelete(e)?5:6);}}function Me(r,i){if(r&1&&(za(0,"h3",45),r_(1,"My global auth settings"),bf(),za(2,"ul",46),yT(3,ke,7,3,"li",47,dT().trackEntry,true),bf()),r&2){let e=NT(5);yb(3),vT(e.recap().authSettings);}}function Oe(r,i){if(r&1&&(hT(0,be,5,0),hT(1,Ee,5,0),hT(2,Me,5,0)),r&2){let e=NT(4);pT(e.recap().integrations.length>0?0:-1),yb(),pT(e.recap().aiProviders.length>0?1:-1),yb(),pT(e.recap().authSettings.length>0?2:-1);}}function Te(r,i){if(r&1&&hT(0,ge,2,0,"p",44)(1,Oe,3,3),r&2){let e=NT(3);pT(e.recap().total===0?0:1);}}function Ue(r,i){if(r&1){let e=bT();za(0,"div",18)(1,"div",5)(2,"h2",6),r_(3,"Identity"),bf(),za(4,"div",7)(5,"span",8),r_(6,"Email"),bf(),za(7,"span",37),r_(8),bf()(),za(9,"div",7)(10,"span",8),r_(11,"External ID"),bf(),za(12,"span",37),r_(13),bf()()(),za(14,"div",5)(15,"h2",6),r_(16,"Profile"),bf(),za(17,"div",7)(18,"span",8),r_(19,"First name"),bf(),za(20,"span",37),r_(21),bf()(),za(22,"div",7)(23,"span",8),r_(24,"Last name"),bf(),za(25,"span",37),r_(26),bf()(),za(27,"div",38)(28,"span",8),r_(29,"Bio"),bf(),za(30,"span",37),r_(31),bf()(),za(32,"div",7)(33,"span",8),r_(34,"Language"),bf(),za(35,"span",37),r_(36),bf()()(),za(37,"div",34)(38,"button",39),dc("click",function(){ig(e);let d=NT(2);return sg(d.startEditing())}),r_(39," Edit profile "),bf()(),za(40,"div",40)(41,"button",41),dc("click",function(){ig(e);let d=NT(2);return sg(d.toggleOverrides())}),za(42,"span",42),r_(43,"\u25B6"),bf(),r_(44," My global user configurations "),za(45,"span",43),r_(46),bf()(),hT(47,Te,2,1),bf()();}if(r&2){let e=NT(),a=NT();yb(8),Iv(e.email),yb(5),Iv(e.externalId),yb(8),Iv(e.firstname||"\u2014"),yb(5),Iv(e.lastname||"\u2014"),yb(5),Iv(e.bio||"\u2014"),yb(5),Iv(e.preferredLanguage||"\u2014"),yb(5),uc("aria-expanded",a.isOverridesExpanded()),yb(),gv("user-profile__overrides-arrow--open",a.isOverridesExpanded()),yb(4),Af("(",a.recap().total,")"),yb(),pT(a.isOverridesExpanded()?47:-1);}}function Ve(r,i){if(r&1&&(za(0,"div",5)(1,"h2",6),r_(2,"Appearance"),bf(),za(3,"div",7)(4,"span",8),r_(5,"Skin"),bf(),za(6,"div",9),yT(7,_e,5,5,"button",10,D),bf()(),za(9,"div",7)(10,"span",8),r_(11,"Mode"),bf(),za(12,"div",11),yT(13,ce,2,4,"button",12,D),bf()()(),za(15,"div",5)(16,"h2",6),r_(17,"Composer"),bf(),za(18,"div",7)(19,"span",8),r_(20,"Enter key"),bf(),za(21,"div",13)(22,"div",14),yT(23,pe,2,4,"button",12,D),bf(),za(25,"p",15),r_(26,'In "New line" mode, press Ctrl or Cmd + Enter to send.'),bf()()()(),za(27,"div",5)(28,"h2",6),r_(29,"Case chat"),bf(),za(30,"div",7)(31,"span",8),r_(32,"Technical logs"),bf(),za(33,"div",13)(34,"div",16),yT(35,me,2,4,"button",12,se),bf(),za(37,"p",15),r_(38,"Show system log lines (agent status, tool selection...) in the case chat."),bf()()()(),hT(39,fe,40,5,"form",17)(40,Ue,48,11,"div",18)),r&2){let e=NT();yb(7),vT(e.themeVariantOptions),yb(6),vT(e.themeOptions),yb(10),vT(e.enterKeyOptions),yb(12),vT(e.showTechnicalOptions),yb(4),pT(e.isEditing()?39:40);}}function De(r,i){r&1&&(za(0,"p",4),r_(1,"Unable to load profile."),bf());}var le=class r{userState=p(l);router=p(It);location=p(Pn);destroyRef=p(Me$1);integrationState=p(O);providerState=p(O$1);authSettingState=p(R);themePort=p(I);preferencesPort=p(B);isEditing=ie(false);isLoading=ie(false);isSaving=ie(false);isOverridesExpanded=ie(false);currentUser=this.userState.currentUser;theme=this.themePort.theme;themeMode=Mi(()=>this.themePort.theme().mode);themeOptions=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}];themeVariant=Mi(()=>this.themePort.theme().variant);themeVariantOptions=[{value:"industry",label:"Industry",description:"Bleu acier, Barlow"},{value:"terminal",label:"Terminal",description:"Ambre CRT, JetBrains Mono"}];enterKeyBehavior=this.preferencesPort.enterKeyBehavior;enterKeyOptions=[{value:"send",label:"Send"},{value:"newline",label:"New line"}];showTechnical=this.preferencesPort.showTechnical;showTechnicalOptions=[{value:true,label:"Shown"},{value:false,label:"Hidden"}];languageOptions=[{value:"",label:"No preference (English fallback)"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"},{value:"pt",label:"Portuguese"},{value:"it",label:"Italian"},{value:"nl",label:"Dutch"},{value:"pl",label:"Polish"},{value:"ja",label:"Japanese"},{value:"zh",label:"Chinese"}];form=new $({firstname:new vt("",{nonNullable:true}),lastname:new vt("",{nonNullable:true}),bio:new vt("",{nonNullable:true}),preferredLanguage:new vt("",{nonNullable:true})});recap=F(Ms([this.integrationState.userGlobal$,this.providerState.userGlobal$,this.authSettingState.userGlobal$]).pipe(j(([i,e,a])=>{let d=i.map(g=>({category:"integration",id:g.id??"",name:g.name,subtitle:g.integrationType})),_=e.map(g=>({category:"aiProvider",id:g.id??"",name:g.name,subtitle:g.apiType})),I=a.map(g=>({category:"authSetting",id:g.id??"",name:g.name,subtitle:g.authType}));return {integrations:d,aiProviders:_,authSettings:I,total:d.length+_.length+I.length}})),{initialValue:{integrations:[],aiProviders:[],authSettings:[],total:0}});ngOnInit(){if(this.currentUser()){this.syncFormFromState();return}this.isLoading.set(true),this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:()=>{this.syncFormFromState(),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}startEditing(){this.syncFormFromState(),this.isEditing.set(true);}cancelEditing(){this.isEditing.set(false);}setTheme(i){this.themePort.setTheme({variant:this.themePort.theme().variant,mode:i});}setThemeVariant(i){this.themePort.setTheme({variant:i,mode:this.themePort.theme().mode});}setEnterKeyBehavior(i){this.preferencesPort.setEnterKeyBehavior(i);}setShowTechnical(i){this.preferencesPort.setShowTechnical(i);}save(){if(this.isSaving())return;this.isSaving.set(true);let i=this.form.controls.preferredLanguage.value.trim();this.userState.updateMe({firstname:this.form.controls.firstname.value.trim()||void 0,lastname:this.form.controls.lastname.value.trim()||void 0,bio:this.form.controls.bio.value.trim()||void 0,preferredLanguage:i||void 0}).pipe(U(this.destroyRef)).subscribe({next:()=>{this.isSaving.set(false),this.isEditing.set(false);},error:()=>this.isSaving.set(false)});}toggleOverrides(){this.isOverridesExpanded.update(i=>!i),this.pendingDeleteKey.set(null);}pendingDeleteKey=ie(null);isPendingDelete(i){return this.pendingDeleteKey()===this.entryKey(i)}armDelete(i){i.id&&this.pendingDeleteKey.set(this.entryKey(i));}cancelDelete(){this.pendingDeleteKey.set(null);}confirmDelete(i){if(!i.id)return;this.pendingDeleteKey.set(null),(i.category==="integration"?this.integrationState.delete(i.id,"userGlobal"):i.category==="authSetting"?this.authSettingState.delete(i.id,"userGlobal"):this.providerState.delete(i.id,"userGlobal")).pipe(U(this.destroyRef)).subscribe({error:a=>{console.error(`[UserProfile] Delete failed for ${i.category}:${i.id}:`,a);}});}entryKey(i){return `${i.category}:${i.id}`}goBack(){window.history.length>1?this.location.back():this.router.navigate(["/agentos"]);}trackEntry(i,e){return this.entryKey(e)}syncFormFromState(){let i=this.currentUser();i&&this.form.setValue({firstname:i.firstname??"",lastname:i.lastname??"",bio:i.bio??"",preferredLanguage:i.preferredLanguage??""});}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=Df({type:r,selectors:[["agentos-user-profile"]],decls:8,vars:1,consts:[[1,"user-profile"],[1,"user-profile__header"],["icon","arrow_back","title","Back",3,"action"],[1,"user-profile__title"],[1,"user-profile__loading"],[1,"user-profile__section"],[1,"user-profile__section-title"],[1,"user-profile__field"],[1,"user-profile__label"],[1,"user-profile__theme-variants"],["type","button",1,"user-profile__theme-variant",3,"user-profile__theme-variant--active"],["role","group","aria-label","Color mode",1,"user-profile__segmented"],["type","button",1,"user-profile__segmented-option",3,"user-profile__segmented-option--active"],[1,"user-profile__field-control"],["role","group","aria-label","Enter key behavior",1,"user-profile__segmented"],[1,"user-profile__hint"],["role","group","aria-label","Technical logs",1,"user-profile__segmented"],[1,"user-profile__form",3,"formGroup"],[1,"user-profile__view"],["type","button",1,"user-profile__theme-variant",3,"click"],[1,"user-profile__theme-variant-name"],[1,"user-profile__theme-variant-desc"],["type","button",1,"user-profile__segmented-option",3,"click"],[1,"user-profile__form",3,"ngSubmit","formGroup"],[1,"user-profile__value","user-profile__value--readonly"],["for","up-firstname",1,"user-profile__label"],["id","up-firstname","type","text","placeholder","Your first name","formControlName","firstname","autocomplete","given-name",1,"user-profile__input"],["for","up-lastname",1,"user-profile__label"],["id","up-lastname","type","text","placeholder","Your last name","formControlName","lastname","autocomplete","family-name",1,"user-profile__input"],["for","up-bio",1,"user-profile__label"],["id","up-bio","placeholder","A short description about yourself","formControlName","bio","rows","4",1,"user-profile__input","user-profile__input--textarea"],["for","up-preferredLanguage",1,"user-profile__label"],["id","up-preferredLanguage","formControlName","preferredLanguage",1,"user-profile__input","user-profile__select"],[3,"value"],[1,"user-profile__actions"],["type","submit",1,"user-profile__btn","user-profile__btn--primary",3,"disabled"],["type","button",1,"user-profile__btn",3,"click"],[1,"user-profile__value"],[1,"user-profile__field","user-profile__field--bio"],["type","button",1,"user-profile__btn","user-profile__btn--primary",3,"click"],[1,"user-profile__overrides"],["type","button",1,"user-profile__overrides-toggle",3,"click"],[1,"user-profile__overrides-arrow"],[1,"user-profile__overrides-count"],[1,"user-profile__overrides-empty"],[1,"user-profile__overrides-subtitle"],[1,"user-profile__overrides-list"],[1,"user-profile__overrides-row"],[1,"user-profile__overrides-name"],[1,"user-profile__overrides-subtitle-text"],["type","button",1,"user-profile__overrides-delete"],[1,"user-profile__overrides-confirm-label"],["type","button",1,"user-profile__overrides-delete","user-profile__overrides-delete--confirm",3,"click"],["type","button",1,"user-profile__overrides-delete",3,"click"]],template:function(e,a){if(e&1&&(za(0,"div",0)(1,"header",1)(2,"ds-icon-button",2),dc("action",function(){return a.goBack()}),bf(),za(3,"h1",3),r_(4,"My profile"),bf()(),hT(5,de,2,0,"p",4)(6,Ve,41,1)(7,De,2,0,"p",4),bf()),e&2){let d;yb(5),pT(a.isLoading()?5:(d=a.currentUser())?6:7,d);}},dependencies:[Kn,zn,Zn,Xn,Ye,bt,Ln,Wn,Vn,yn,qe],styles:[`.user-profile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.user-profile__header[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:.5rem}.user-profile__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.user-profile__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.user-profile__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.user-profile__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.user-profile__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.user-profile__view[_ngcontent-%COMP%], .user-profile__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem}.user-profile__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.user-profile__section-title[_ngcontent-%COMP%]{margin:0;font-family:var(--font-heading);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);border-bottom:1px solid var(--color-divider);padding-bottom:.5rem}.user-profile__field[_ngcontent-%COMP%]{display:grid;grid-template-columns:140px 1fr;align-items:baseline;gap:.75rem}.user-profile__field--bio[_ngcontent-%COMP%]{align-items:start}.user-profile__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text-secondary);white-space:nowrap}.user-profile__value[_ngcontent-%COMP%]{font-size:.9375rem;color:var(--color-text);word-break:break-word;white-space:pre-wrap}.user-profile__value--readonly[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.875rem}.user-profile__segmented[_ngcontent-%COMP%]{display:inline-flex;justify-self:start;border:1px solid var(--color-divider);overflow:hidden}.user-profile__segmented-option[_ngcontent-%COMP%]{padding:.4rem .85rem;background:transparent;border:none;border-right:1px solid var(--color-divider);color:var(--color-text-secondary);font-size:.875rem;cursor:pointer;transition:background .15s ease,color .15s ease}.user-profile__segmented-option[_ngcontent-%COMP%]:last-child{border-right:none}.user-profile__segmented-option[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.user-profile__segmented-option--active[_ngcontent-%COMP%]{background:var(--color-accent);color:#fff}.user-profile__segmented-option--active[_ngcontent-%COMP%]:hover{background:var(--color-accent-700)}.user-profile__field-control[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:.4rem}.user-profile__hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary)}.user-profile__select[_ngcontent-%COMP%]{appearance:none;cursor:pointer;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right .75rem center;padding-right:2.25rem}.user-profile__input[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;border-radius:0;transition:border-color .15s ease;resize:none}.user-profile__input[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.user-profile__input[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.user-profile__input--textarea[_ngcontent-%COMP%]{line-height:1.5;resize:vertical}.user-profile__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.user-profile__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;border-radius:0;transition:background .15s ease,border-color .15s ease}.user-profile__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.user-profile__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.user-profile__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.user-profile__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}.user-profile__theme-variants[_ngcontent-%COMP%]{display:flex;gap:8px;justify-self:start}.user-profile__theme-variant[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:3px;padding:10px 16px;border:1px solid var(--color-divider);background:transparent;cursor:pointer;min-width:120px;transition:background .12s,border-color .12s}.user-profile__theme-variant[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.user-profile__theme-variant--active[_ngcontent-%COMP%]{border-color:var(--color-accent);background:color-mix(in srgb,var(--color-accent) 8%,transparent)}.user-profile__theme-variant-name[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:13px;font-weight:600;color:var(--color-text)}.user-profile__theme-variant-desc[_ngcontent-%COMP%]{font-size:11px;color:var(--color-text-secondary);font-family:var(--font-body)}.user-profile__overrides[_ngcontent-%COMP%]{margin-top:1rem;padding-top:1rem;border-top:1px solid var(--color-divider)}.user-profile__overrides-toggle[_ngcontent-%COMP%]{background:transparent;border:none;padding:.25rem 0;font-size:.85rem;color:var(--color-text-secondary);cursor:pointer;display:flex;align-items:center;gap:.4rem}.user-profile__overrides-toggle[_ngcontent-%COMP%]:hover{color:var(--color-text)}.user-profile__overrides-arrow[_ngcontent-%COMP%]{display:inline-block;font-size:.65rem;transition:transform .15s ease}.user-profile__overrides-arrow--open[_ngcontent-%COMP%]{transform:rotate(90deg)}.user-profile__overrides-count[_ngcontent-%COMP%]{color:var(--color-text-tertiary)}.user-profile__overrides-empty[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary);font-style:italic;padding:.5rem 0 0;margin:0}.user-profile__overrides-subtitle[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);margin:.75rem 0 .25rem}.user-profile__overrides-list[_ngcontent-%COMP%]{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:.25rem}.user-profile__overrides-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.4rem .5rem;font-size:.85rem;border-radius:0}.user-profile__overrides-row[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.user-profile__overrides-name[_ngcontent-%COMP%]{flex:1;color:var(--color-text);font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-profile__overrides-subtitle-text[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);font-family:var(--font-heading)}.user-profile__overrides-confirm-label[_ngcontent-%COMP%]{font-size:11px;font-family:var(--font-heading);font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--red-deep);white-space:nowrap}.user-profile__overrides-delete[_ngcontent-%COMP%]{background:transparent;border:1px solid transparent;font-size:11px;font-family:var(--font-heading);font-weight:600;color:var(--color-neutral-500);cursor:pointer;padding:3px 8px;border-radius:0;transition:color .12s,background .12s,border-color .12s}.user-profile__overrides-delete[_ngcontent-%COMP%]:hover{color:var(--red);background:color-mix(in srgb,var(--red) 10%,transparent);border-color:var(--red)}.user-profile__overrides-delete--confirm[_ngcontent-%COMP%]{border-color:var(--red);background:var(--red);color:#fff}.user-profile__overrides-delete--confirm[_ngcontent-%COMP%]:hover{background:var(--red-deep);border-color:var(--red-deep)}`]})};
|
|
1
|
+
import {O as O$1}from'./chunk-CMivw_-z.js';import {R}from'./chunk-B8g-L-f4.js';import {O}from'./chunk-Vb2IMeLm.js';import {p,f as It,aB as Pn,F as Me$1,d as ie,M as Mi,a2 as F,as as Ms,aA as j,U,D as Df,z as za,K as dc,b as bf,r as r_,h as hT,y as yb,a as pT,e as yT,N as NT,v as vT,k as bT,q as gv,u as uc,I as Iv,A as Af,l as lc,L as sS,O as tv,Q as cS,o as ig,s as sg,a4 as dT}from'./main-GRB5KOIR.js';import {l,I,B,$,v as vt,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,c as bt,L as Ln,W as Wn,V as Vn,y as yn,r as qe}from'./chunk-D1EGHCm3.js';import'./chunk-BtHSpru4.js';var D=(r,i)=>i.value,se=(r,i)=>i.label;function de(r,i){r&1&&(za(0,"p",4),r_(1,"Loading\u2026"),bf());}function _e(r,i){if(r&1){let e=bT();za(0,"button",19),dc("click",function(){let d=ig(e).$implicit,_=NT(2);return sg(_.setThemeVariant(d.value))}),za(1,"span",20),r_(2),bf(),za(3,"span",21),r_(4),bf()();}if(r&2){let e=i.$implicit,a=NT(2);gv("user-profile__theme-variant--active",a.themeVariant()===e.value),uc("aria-pressed",a.themeVariant()===e.value),yb(2),Iv(e.label),yb(2),Iv(e.description);}}function ce(r,i){if(r&1){let e=bT();za(0,"button",22),dc("click",function(){let d=ig(e).$implicit,_=NT(2);return sg(_.setTheme(d.value))}),r_(1),bf();}if(r&2){let e=i.$implicit,a=NT(2);gv("user-profile__segmented-option--active",a.themeMode()===e.value),uc("aria-pressed",a.themeMode()===e.value),yb(),Af(" ",e.label," ");}}function pe(r,i){if(r&1){let e=bT();za(0,"button",22),dc("click",function(){let d=ig(e).$implicit,_=NT(2);return sg(_.setEnterKeyBehavior(d.value))}),r_(1),bf();}if(r&2){let e=i.$implicit,a=NT(2);gv("user-profile__segmented-option--active",a.enterKeyBehavior()===e.value),uc("aria-pressed",a.enterKeyBehavior()===e.value),yb(),Af(" ",e.label," ");}}function me(r,i){if(r&1){let e=bT();za(0,"button",22),dc("click",function(){let d=ig(e).$implicit,_=NT(2);return sg(_.setShowTechnical(d.value))}),r_(1),bf();}if(r&2){let e=i.$implicit,a=NT(2);gv("user-profile__segmented-option--active",a.showTechnical()===e.value),uc("aria-pressed",a.showTechnical()===e.value),yb(),Af(" ",e.label," ");}}function ue(r,i){if(r&1&&(za(0,"option",33),r_(1),bf()),r&2){let e=i.$implicit;tv("value",e.value),yb(),Iv(e.label);}}function fe(r,i){if(r&1){let e=bT();za(0,"form",23),dc("ngSubmit",function(){ig(e);let d=NT(2);return sg(d.save())}),za(1,"div",5)(2,"h2",6),r_(3,"Identity"),bf(),za(4,"div",7)(5,"span",8),r_(6,"Email"),bf(),za(7,"span",24),r_(8),bf()(),za(9,"div",7)(10,"span",8),r_(11,"External ID"),bf(),za(12,"span",24),r_(13),bf()()(),za(14,"div",5)(15,"h2",6),r_(16,"Profile"),bf(),za(17,"div",7)(18,"label",25),r_(19,"First name"),bf(),lc(20,"input",26),sS(),bf(),za(21,"div",7)(22,"label",27),r_(23,"Last name"),bf(),lc(24,"input",28),sS(),bf(),za(25,"div",7)(26,"label",29),r_(27,"Bio"),bf(),lc(28,"textarea",30),sS(),bf(),za(29,"div",7)(30,"label",31),r_(31,"Language"),bf(),za(32,"select",32),yT(33,ue,2,2,"option",33,D),bf(),sS(),bf()(),za(35,"div",34)(36,"button",35),r_(37),bf(),za(38,"button",36),dc("click",function(){ig(e);let d=NT(2);return sg(d.cancelEditing())}),r_(39,"Cancel"),bf()()();}if(r&2){let e=NT(),a=NT();tv("formGroup",a.form),yb(8),Iv(e.email),yb(5),Iv(e.externalId),yb(7),cS(),yb(4),cS(),yb(4),cS(),yb(4),cS(),yb(),vT(a.languageOptions),yb(3),tv("disabled",a.isSaving()),yb(),Af(" ",a.isSaving()?"Saving\u2026":"Save changes"," ");}}function ge(r,i){r&1&&(za(0,"p",44),r_(1," No global configuration yet. Create one from the Integrations / AI Providers / Auth Settings pages of your namespaces. "),bf());}function Ce(r,i){if(r&1){let e=bT();za(0,"span",51),r_(1,"Delete?"),bf(),za(2,"button",52),dc("click",function(){ig(e);let d=NT().$implicit,_=NT(6);return sg(_.confirmDelete(d))}),r_(3," Confirm "),bf(),za(4,"button",53),dc("click",function(){ig(e);let d=NT(7);return sg(d.cancelDelete())}),r_(5," Cancel "),bf();}}function ve(r,i){if(r&1){let e=bT();za(0,"button",53),dc("click",function(){ig(e);let d=NT().$implicit,_=NT(6);return sg(_.armDelete(d))}),r_(1," Delete "),bf();}}function xe(r,i){if(r&1&&(za(0,"li",47)(1,"span",48),r_(2),bf(),za(3,"span",49),r_(4),bf(),hT(5,Ce,6,0)(6,ve,2,0,"button",50),bf()),r&2){let e=i.$implicit,a=NT(6);yb(2),Iv(e.name),yb(2),Iv(e.subtitle),yb(),pT(a.isPendingDelete(e)?5:6);}}function be(r,i){if(r&1&&(za(0,"h3",45),r_(1,"Integrations"),bf(),za(2,"ul",46),yT(3,xe,7,3,"li",47,dT().trackEntry,true),bf()),r&2){let e=NT(5);yb(3),vT(e.recap().integrations);}}function ye(r,i){if(r&1){let e=bT();za(0,"span",51),r_(1,"Delete?"),bf(),za(2,"button",52),dc("click",function(){ig(e);let d=NT().$implicit,_=NT(6);return sg(_.confirmDelete(d))}),r_(3," Confirm "),bf(),za(4,"button",53),dc("click",function(){ig(e);let d=NT(7);return sg(d.cancelDelete())}),r_(5," Cancel "),bf();}}function he(r,i){if(r&1){let e=bT();za(0,"button",53),dc("click",function(){ig(e);let d=NT().$implicit,_=NT(6);return sg(_.armDelete(d))}),r_(1," Delete "),bf();}}function Se(r,i){if(r&1&&(za(0,"li",47)(1,"span",48),r_(2),bf(),za(3,"span",49),r_(4),bf(),hT(5,ye,6,0)(6,he,2,0,"button",50),bf()),r&2){let e=i.$implicit,a=NT(6);yb(2),Iv(e.name),yb(2),Iv(e.subtitle),yb(),pT(a.isPendingDelete(e)?5:6);}}function Ee(r,i){if(r&1&&(za(0,"h3",45),r_(1,"AI Providers"),bf(),za(2,"ul",46),yT(3,Se,7,3,"li",47,dT().trackEntry,true),bf()),r&2){let e=NT(5);yb(3),vT(e.recap().aiProviders);}}function Pe(r,i){if(r&1){let e=bT();za(0,"span",51),r_(1,"Delete?"),bf(),za(2,"button",52),dc("click",function(){ig(e);let d=NT().$implicit,_=NT(6);return sg(_.confirmDelete(d))}),r_(3," Confirm "),bf(),za(4,"button",53),dc("click",function(){ig(e);let d=NT(7);return sg(d.cancelDelete())}),r_(5," Cancel "),bf();}}function we(r,i){if(r&1){let e=bT();za(0,"button",53),dc("click",function(){ig(e);let d=NT().$implicit,_=NT(6);return sg(_.armDelete(d))}),r_(1," Delete "),bf();}}function ke(r,i){if(r&1&&(za(0,"li",47)(1,"span",48),r_(2),bf(),za(3,"span",49),r_(4),bf(),hT(5,Pe,6,0)(6,we,2,0,"button",50),bf()),r&2){let e=i.$implicit,a=NT(6);yb(2),Iv(e.name),yb(2),Iv(e.subtitle),yb(),pT(a.isPendingDelete(e)?5:6);}}function Me(r,i){if(r&1&&(za(0,"h3",45),r_(1,"My global auth settings"),bf(),za(2,"ul",46),yT(3,ke,7,3,"li",47,dT().trackEntry,true),bf()),r&2){let e=NT(5);yb(3),vT(e.recap().authSettings);}}function Oe(r,i){if(r&1&&(hT(0,be,5,0),hT(1,Ee,5,0),hT(2,Me,5,0)),r&2){let e=NT(4);pT(e.recap().integrations.length>0?0:-1),yb(),pT(e.recap().aiProviders.length>0?1:-1),yb(),pT(e.recap().authSettings.length>0?2:-1);}}function Te(r,i){if(r&1&&hT(0,ge,2,0,"p",44)(1,Oe,3,3),r&2){let e=NT(3);pT(e.recap().total===0?0:1);}}function Ue(r,i){if(r&1){let e=bT();za(0,"div",18)(1,"div",5)(2,"h2",6),r_(3,"Identity"),bf(),za(4,"div",7)(5,"span",8),r_(6,"Email"),bf(),za(7,"span",37),r_(8),bf()(),za(9,"div",7)(10,"span",8),r_(11,"External ID"),bf(),za(12,"span",37),r_(13),bf()()(),za(14,"div",5)(15,"h2",6),r_(16,"Profile"),bf(),za(17,"div",7)(18,"span",8),r_(19,"First name"),bf(),za(20,"span",37),r_(21),bf()(),za(22,"div",7)(23,"span",8),r_(24,"Last name"),bf(),za(25,"span",37),r_(26),bf()(),za(27,"div",38)(28,"span",8),r_(29,"Bio"),bf(),za(30,"span",37),r_(31),bf()(),za(32,"div",7)(33,"span",8),r_(34,"Language"),bf(),za(35,"span",37),r_(36),bf()()(),za(37,"div",34)(38,"button",39),dc("click",function(){ig(e);let d=NT(2);return sg(d.startEditing())}),r_(39," Edit profile "),bf()(),za(40,"div",40)(41,"button",41),dc("click",function(){ig(e);let d=NT(2);return sg(d.toggleOverrides())}),za(42,"span",42),r_(43,"\u25B6"),bf(),r_(44," My global user configurations "),za(45,"span",43),r_(46),bf()(),hT(47,Te,2,1),bf()();}if(r&2){let e=NT(),a=NT();yb(8),Iv(e.email),yb(5),Iv(e.externalId),yb(8),Iv(e.firstname||"\u2014"),yb(5),Iv(e.lastname||"\u2014"),yb(5),Iv(e.bio||"\u2014"),yb(5),Iv(e.preferredLanguage||"\u2014"),yb(5),uc("aria-expanded",a.isOverridesExpanded()),yb(),gv("user-profile__overrides-arrow--open",a.isOverridesExpanded()),yb(4),Af("(",a.recap().total,")"),yb(),pT(a.isOverridesExpanded()?47:-1);}}function Ve(r,i){if(r&1&&(za(0,"div",5)(1,"h2",6),r_(2,"Appearance"),bf(),za(3,"div",7)(4,"span",8),r_(5,"Skin"),bf(),za(6,"div",9),yT(7,_e,5,5,"button",10,D),bf()(),za(9,"div",7)(10,"span",8),r_(11,"Mode"),bf(),za(12,"div",11),yT(13,ce,2,4,"button",12,D),bf()()(),za(15,"div",5)(16,"h2",6),r_(17,"Composer"),bf(),za(18,"div",7)(19,"span",8),r_(20,"Enter key"),bf(),za(21,"div",13)(22,"div",14),yT(23,pe,2,4,"button",12,D),bf(),za(25,"p",15),r_(26,'In "New line" mode, press Ctrl or Cmd + Enter to send.'),bf()()()(),za(27,"div",5)(28,"h2",6),r_(29,"Case chat"),bf(),za(30,"div",7)(31,"span",8),r_(32,"Technical logs"),bf(),za(33,"div",13)(34,"div",16),yT(35,me,2,4,"button",12,se),bf(),za(37,"p",15),r_(38,"Show system log lines (agent status, tool selection...) in the case chat."),bf()()()(),hT(39,fe,40,5,"form",17)(40,Ue,48,11,"div",18)),r&2){let e=NT();yb(7),vT(e.themeVariantOptions),yb(6),vT(e.themeOptions),yb(10),vT(e.enterKeyOptions),yb(12),vT(e.showTechnicalOptions),yb(4),pT(e.isEditing()?39:40);}}function De(r,i){r&1&&(za(0,"p",4),r_(1,"Unable to load profile."),bf());}var le=class r{userState=p(l);router=p(It);location=p(Pn);destroyRef=p(Me$1);integrationState=p(O);providerState=p(O$1);authSettingState=p(R);themePort=p(I);preferencesPort=p(B);isEditing=ie(false);isLoading=ie(false);isSaving=ie(false);isOverridesExpanded=ie(false);currentUser=this.userState.currentUser;theme=this.themePort.theme;themeMode=Mi(()=>this.themePort.theme().mode);themeOptions=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}];themeVariant=Mi(()=>this.themePort.theme().variant);themeVariantOptions=[{value:"industry",label:"Industry",description:"Bleu acier, Barlow"},{value:"terminal",label:"Terminal",description:"Ambre CRT, JetBrains Mono"}];enterKeyBehavior=this.preferencesPort.enterKeyBehavior;enterKeyOptions=[{value:"send",label:"Send"},{value:"newline",label:"New line"}];showTechnical=this.preferencesPort.showTechnical;showTechnicalOptions=[{value:true,label:"Shown"},{value:false,label:"Hidden"}];languageOptions=[{value:"",label:"No preference (English fallback)"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"},{value:"pt",label:"Portuguese"},{value:"it",label:"Italian"},{value:"nl",label:"Dutch"},{value:"pl",label:"Polish"},{value:"ja",label:"Japanese"},{value:"zh",label:"Chinese"}];form=new $({firstname:new vt("",{nonNullable:true}),lastname:new vt("",{nonNullable:true}),bio:new vt("",{nonNullable:true}),preferredLanguage:new vt("",{nonNullable:true})});recap=F(Ms([this.integrationState.userGlobal$,this.providerState.userGlobal$,this.authSettingState.userGlobal$]).pipe(j(([i,e,a])=>{let d=i.map(g=>({category:"integration",id:g.id??"",name:g.name,subtitle:g.integrationType})),_=e.map(g=>({category:"aiProvider",id:g.id??"",name:g.name,subtitle:g.apiType})),I=a.map(g=>({category:"authSetting",id:g.id??"",name:g.name,subtitle:g.authType}));return {integrations:d,aiProviders:_,authSettings:I,total:d.length+_.length+I.length}})),{initialValue:{integrations:[],aiProviders:[],authSettings:[],total:0}});ngOnInit(){if(this.currentUser()){this.syncFormFromState();return}this.isLoading.set(true),this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:()=>{this.syncFormFromState(),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}startEditing(){this.syncFormFromState(),this.isEditing.set(true);}cancelEditing(){this.isEditing.set(false);}setTheme(i){this.themePort.setTheme({variant:this.themePort.theme().variant,mode:i});}setThemeVariant(i){this.themePort.setTheme({variant:i,mode:this.themePort.theme().mode});}setEnterKeyBehavior(i){this.preferencesPort.setEnterKeyBehavior(i);}setShowTechnical(i){this.preferencesPort.setShowTechnical(i);}save(){if(this.isSaving())return;this.isSaving.set(true);let i=this.form.controls.preferredLanguage.value.trim();this.userState.updateMe({firstname:this.form.controls.firstname.value.trim()||void 0,lastname:this.form.controls.lastname.value.trim()||void 0,bio:this.form.controls.bio.value.trim()||void 0,preferredLanguage:i||void 0}).pipe(U(this.destroyRef)).subscribe({next:()=>{this.isSaving.set(false),this.isEditing.set(false);},error:()=>this.isSaving.set(false)});}toggleOverrides(){this.isOverridesExpanded.update(i=>!i),this.pendingDeleteKey.set(null);}pendingDeleteKey=ie(null);isPendingDelete(i){return this.pendingDeleteKey()===this.entryKey(i)}armDelete(i){i.id&&this.pendingDeleteKey.set(this.entryKey(i));}cancelDelete(){this.pendingDeleteKey.set(null);}confirmDelete(i){if(!i.id)return;this.pendingDeleteKey.set(null),(i.category==="integration"?this.integrationState.delete(i.id,"userGlobal"):i.category==="authSetting"?this.authSettingState.delete(i.id,"userGlobal"):this.providerState.delete(i.id,"userGlobal")).pipe(U(this.destroyRef)).subscribe({error:a=>{console.error(`[UserProfile] Delete failed for ${i.category}:${i.id}:`,a);}});}entryKey(i){return `${i.category}:${i.id}`}goBack(){window.history.length>1?this.location.back():this.router.navigate(["/agentos"]);}trackEntry(i,e){return this.entryKey(e)}syncFormFromState(){let i=this.currentUser();i&&this.form.setValue({firstname:i.firstname??"",lastname:i.lastname??"",bio:i.bio??"",preferredLanguage:i.preferredLanguage??""});}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=Df({type:r,selectors:[["agentos-user-profile"]],decls:8,vars:1,consts:[[1,"user-profile"],[1,"user-profile__header"],["icon","arrow_back","title","Back",3,"action"],[1,"user-profile__title"],[1,"user-profile__loading"],[1,"user-profile__section"],[1,"user-profile__section-title"],[1,"user-profile__field"],[1,"user-profile__label"],[1,"user-profile__theme-variants"],["type","button",1,"user-profile__theme-variant",3,"user-profile__theme-variant--active"],["role","group","aria-label","Color mode",1,"user-profile__segmented"],["type","button",1,"user-profile__segmented-option",3,"user-profile__segmented-option--active"],[1,"user-profile__field-control"],["role","group","aria-label","Enter key behavior",1,"user-profile__segmented"],[1,"user-profile__hint"],["role","group","aria-label","Technical logs",1,"user-profile__segmented"],[1,"user-profile__form",3,"formGroup"],[1,"user-profile__view"],["type","button",1,"user-profile__theme-variant",3,"click"],[1,"user-profile__theme-variant-name"],[1,"user-profile__theme-variant-desc"],["type","button",1,"user-profile__segmented-option",3,"click"],[1,"user-profile__form",3,"ngSubmit","formGroup"],[1,"user-profile__value","user-profile__value--readonly"],["for","up-firstname",1,"user-profile__label"],["id","up-firstname","type","text","placeholder","Your first name","formControlName","firstname","autocomplete","given-name",1,"user-profile__input"],["for","up-lastname",1,"user-profile__label"],["id","up-lastname","type","text","placeholder","Your last name","formControlName","lastname","autocomplete","family-name",1,"user-profile__input"],["for","up-bio",1,"user-profile__label"],["id","up-bio","placeholder","A short description about yourself","formControlName","bio","rows","4",1,"user-profile__input","user-profile__input--textarea"],["for","up-preferredLanguage",1,"user-profile__label"],["id","up-preferredLanguage","formControlName","preferredLanguage",1,"user-profile__input","user-profile__select"],[3,"value"],[1,"user-profile__actions"],["type","submit",1,"user-profile__btn","user-profile__btn--primary",3,"disabled"],["type","button",1,"user-profile__btn",3,"click"],[1,"user-profile__value"],[1,"user-profile__field","user-profile__field--bio"],["type","button",1,"user-profile__btn","user-profile__btn--primary",3,"click"],[1,"user-profile__overrides"],["type","button",1,"user-profile__overrides-toggle",3,"click"],[1,"user-profile__overrides-arrow"],[1,"user-profile__overrides-count"],[1,"user-profile__overrides-empty"],[1,"user-profile__overrides-subtitle"],[1,"user-profile__overrides-list"],[1,"user-profile__overrides-row"],[1,"user-profile__overrides-name"],[1,"user-profile__overrides-subtitle-text"],["type","button",1,"user-profile__overrides-delete"],[1,"user-profile__overrides-confirm-label"],["type","button",1,"user-profile__overrides-delete","user-profile__overrides-delete--confirm",3,"click"],["type","button",1,"user-profile__overrides-delete",3,"click"]],template:function(e,a){if(e&1&&(za(0,"div",0)(1,"header",1)(2,"ds-icon-button",2),dc("action",function(){return a.goBack()}),bf(),za(3,"h1",3),r_(4,"My profile"),bf()(),hT(5,de,2,0,"p",4)(6,Ve,41,1)(7,De,2,0,"p",4),bf()),e&2){let d;yb(5),pT(a.isLoading()?5:(d=a.currentUser())?6:7,d);}},dependencies:[Kn,zn,Zn,Xn,Ye,bt,Ln,Wn,Vn,yn,qe],styles:[`.user-profile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.user-profile__header[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:.5rem}.user-profile__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.user-profile__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.user-profile__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.user-profile__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.user-profile__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.user-profile__view[_ngcontent-%COMP%], .user-profile__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem}.user-profile__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.user-profile__section-title[_ngcontent-%COMP%]{margin:0;font-family:var(--font-heading);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);border-bottom:1px solid var(--color-divider);padding-bottom:.5rem}.user-profile__field[_ngcontent-%COMP%]{display:grid;grid-template-columns:140px 1fr;align-items:baseline;gap:.75rem}.user-profile__field--bio[_ngcontent-%COMP%]{align-items:start}.user-profile__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text-secondary);white-space:nowrap}.user-profile__value[_ngcontent-%COMP%]{font-size:.9375rem;color:var(--color-text);word-break:break-word;white-space:pre-wrap}.user-profile__value--readonly[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.875rem}.user-profile__segmented[_ngcontent-%COMP%]{display:inline-flex;justify-self:start;border:1px solid var(--color-divider);overflow:hidden}.user-profile__segmented-option[_ngcontent-%COMP%]{padding:.4rem .85rem;background:transparent;border:none;border-right:1px solid var(--color-divider);color:var(--color-text-secondary);font-size:.875rem;cursor:pointer;transition:background .15s ease,color .15s ease}.user-profile__segmented-option[_ngcontent-%COMP%]:last-child{border-right:none}.user-profile__segmented-option[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.user-profile__segmented-option--active[_ngcontent-%COMP%]{background:var(--color-accent);color:#fff}.user-profile__segmented-option--active[_ngcontent-%COMP%]:hover{background:var(--color-accent-700)}.user-profile__field-control[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:.4rem}.user-profile__hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary)}.user-profile__select[_ngcontent-%COMP%]{appearance:none;cursor:pointer;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right .75rem center;padding-right:2.25rem}.user-profile__input[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;border-radius:0;transition:border-color .15s ease;resize:none}.user-profile__input[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.user-profile__input[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.user-profile__input--textarea[_ngcontent-%COMP%]{line-height:1.5;resize:vertical}.user-profile__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.user-profile__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;border-radius:0;transition:background .15s ease,border-color .15s ease}.user-profile__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.user-profile__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.user-profile__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.user-profile__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}.user-profile__theme-variants[_ngcontent-%COMP%]{display:flex;gap:8px;justify-self:start}.user-profile__theme-variant[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:3px;padding:10px 16px;border:1px solid var(--color-divider);background:transparent;cursor:pointer;min-width:120px;transition:background .12s,border-color .12s}.user-profile__theme-variant[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.user-profile__theme-variant--active[_ngcontent-%COMP%]{border-color:var(--color-accent);background:color-mix(in srgb,var(--color-accent) 8%,transparent)}.user-profile__theme-variant-name[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:13px;font-weight:600;color:var(--color-text)}.user-profile__theme-variant-desc[_ngcontent-%COMP%]{font-size:11px;color:var(--color-text-secondary);font-family:var(--font-body)}.user-profile__overrides[_ngcontent-%COMP%]{margin-top:1rem;padding-top:1rem;border-top:1px solid var(--color-divider)}.user-profile__overrides-toggle[_ngcontent-%COMP%]{background:transparent;border:none;padding:.25rem 0;font-size:.85rem;color:var(--color-text-secondary);cursor:pointer;display:flex;align-items:center;gap:.4rem}.user-profile__overrides-toggle[_ngcontent-%COMP%]:hover{color:var(--color-text)}.user-profile__overrides-arrow[_ngcontent-%COMP%]{display:inline-block;font-size:.65rem;transition:transform .15s ease}.user-profile__overrides-arrow--open[_ngcontent-%COMP%]{transform:rotate(90deg)}.user-profile__overrides-count[_ngcontent-%COMP%]{color:var(--color-text-tertiary)}.user-profile__overrides-empty[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary);font-style:italic;padding:.5rem 0 0;margin:0}.user-profile__overrides-subtitle[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);margin:.75rem 0 .25rem}.user-profile__overrides-list[_ngcontent-%COMP%]{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:.25rem}.user-profile__overrides-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.4rem .5rem;font-size:.85rem;border-radius:0}.user-profile__overrides-row[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.user-profile__overrides-name[_ngcontent-%COMP%]{flex:1;color:var(--color-text);font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-profile__overrides-subtitle-text[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);font-family:var(--font-heading)}.user-profile__overrides-confirm-label[_ngcontent-%COMP%]{font-size:11px;font-family:var(--font-heading);font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--red-deep);white-space:nowrap}.user-profile__overrides-delete[_ngcontent-%COMP%]{background:transparent;border:1px solid transparent;font-size:11px;font-family:var(--font-heading);font-weight:600;color:var(--color-neutral-500);cursor:pointer;padding:3px 8px;border-radius:0;transition:color .12s,background .12s,border-color .12s}.user-profile__overrides-delete[_ngcontent-%COMP%]:hover{color:var(--red);background:color-mix(in srgb,var(--red) 10%,transparent);border-color:var(--red)}.user-profile__overrides-delete--confirm[_ngcontent-%COMP%]{border-color:var(--red);background:var(--red);color:#fff}.user-profile__overrides-delete--confirm[_ngcontent-%COMP%]:hover{background:var(--red-deep);border-color:var(--red-deep)}`]})};
|
|
2
2
|
export{le as UserProfileComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {p as p$1}from'./chunk-
|
|
1
|
+
import {p as p$1}from'./chunk-D1EGHCm3.js';import {p,$ as $t,x as jD,C as y,D as Df,S as Sf,r as r_,T as Tf,y as yb,I as Iv}from'./main-GRB5KOIR.js';var A=class r{route=p($t);http=p(jD);config=p(y);message="Authentication in progress\u2026";ngOnInit(){let e=this.route.snapshot.queryParamMap.get("code"),t=this.route.snapshot.queryParamMap.get("state"),o=this.route.snapshot.queryParamMap.get("error"),i=this.route.snapshot.queryParamMap.get("error_description");if(o){console.warn("[AgentOS OAuth Callback] OAuth error:",o,i),this.notifyParentAndClose({success:false,error:i||o});return}if(!e){console.error("[AgentOS OAuth Callback] Missing authorization code"),this.message="OAuth callback error: missing authorization code.",this.notifyParentAndClose({success:false,error:"Missing authorization code"});return}this.http.post(`${this.config.basePath}/api/oauth/callback`,{code:e,state:t}).subscribe({next:()=>{console.log("[AgentOS OAuth Callback] Backend callback resolved"),this.notifyParentAndClose({success:true});},error:a=>{console.error("[AgentOS OAuth Callback] Backend callback failed:",a),this.notifyParentAndClose({success:false,error:a?.error?.message||a?.message||"Token exchange failed"});}});}notifyParentAndClose(e){if(this.message=e.success?"Authentication complete. You can close this window.":`Authentication failed: ${e.error??"unknown error"}. You can close this window.`,window.opener)try{window.opener.postMessage(e,window.location.origin);}catch(t){console.error("[AgentOS OAuth Callback] postMessage failed:",t),localStorage.setItem(p$1,JSON.stringify(e));}else console.warn("[AgentOS OAuth Callback] No window.opener \u2014 localStorage fallback"),localStorage.setItem(p$1,JSON.stringify(e));setTimeout(()=>window.close(),1e3);}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=Df({type:r,selectors:[["agentos-oauth-callback"]],decls:2,vars:1,consts:[[2,"font-family","sans-serif","padding","2rem","text-align","center"]],template:function(t,o){t&1&&(Sf(0,"p",0),r_(1),Tf()),t&2&&(yb(),Iv(o.message));},encapsulation:2,changeDetection:1})};export{A as OAuthCallbackComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {i,O,h as vi,x as xi,P,M}from'./chunk-Bz9ytfN0.js';import {p,f as It,F as Me,ap as N,aj as k,a7 as De,d as ie,a8 as Ae,U as U$1,D as Df,as as Ms,z as za,K as dc,b as bf,r as r_,h as hT,y as yb,O as tv,a as pT,N as NT,I as Iv,e as yT,v as vT,k as bT,o as ig,s as sg,A as Af,u as uc}from'./main-QSAMSEVG.js';var z=(o,t)=>t.key;function j(o,t){if(o&1&&(za(0,"p",3),r_(1),bf()),o&2){let e=NT();yb(),Iv(e.deletion.error());}}function B(o,t){o&1&&(za(0,"p",4),r_(1,"Loading AI models\u2026"),bf());}function K(o,t){o&1&&(za(0,"p",5),r_(1,"No platform AI models defined yet."),bf());}function H(o,t){o&1&&(za(0,"p",4),r_(1,"No AI models match the current filter."),bf());}function U(o,t){if(o&1){let e=bT();za(0,"button",21),dc("click",function(){ig(e);let a=NT().$implicit,c=NT(2);return sg(c.edit(a))}),r_(1,"Edit"),bf();}if(o&2){let e=NT().$implicit;uc("aria-label","Edit "+e.title);}}function G(o,t){if(o&1){let e=bT();za(0,"tr",9)(1,"td",12),r_(2),bf(),za(3,"td",13),r_(4),bf(),za(5,"td",14),r_(6),bf(),za(7,"td",15),r_(8),bf(),za(9,"td",16),r_(10),bf(),za(11,"td",17)(12,"div",18),hT(13,U,2,1,"button",19),za(14,"agentos-row-delete-action",20),dc("deleteRequested",function(){let a=ig(e).$implicit,c=NT(2);return sg(c.deletion.request(a.key))})("deleteConfirmed",function(){let a=ig(e).$implicit,c=NT(2);return sg(c.confirmDelete(a))})("deleteCancelled",function(){ig(e);let a=NT(2);return sg(a.deletion.cancel())}),bf()()()();}if(o&2){let e=t.$implicit,l=NT(2);yb(2),Iv(e.title),yb(2),Iv(e.providerName),yb(2),Af(" ",e.model.apiModelName," "),yb(2),Iv(e.model.priority),yb(2),Af(" ",e.model.reasoningEffort?e.model.reasoningEffort.toLowerCase():"\u2014"," "),yb(3),pT(l.deletion.confirmingId()!==e.key?13:-1),yb(),tv("rowKey",e.key)("rowLabel",e.title)("state",l.deletion);}}function J(o,t){if(o&1&&(za(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),r_(5,"Name"),bf(),za(6,"th",10),r_(7,"Provider"),bf(),za(8,"th",10),r_(9,"API model name"),bf(),za(10,"th",10),r_(11,"Priority"),bf(),za(12,"th",10),r_(13,"Reasoning effort"),bf(),za(14,"th",10)(15,"span",11),r_(16,"Actions"),bf()()()(),za(17,"tbody",8),yT(18,G,15,9,"tr",9,z),bf()()()),o&2){let e=NT();yb(18),vT(e.rowFilter.filteredRows());}}var V=class o{router=p(It);destroyRef=p(Me);aiModelController=p(N);aiProviderController=p(k);refresh$=new De(void 0);isLoading=ie(true);deletion=i();rows=ie([]);rowFilter=O(this.rows,t=>[t.title,t.model.apiModelName,t.providerName].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(Ae(()=>(this.isLoading.set(true),Ms([this.aiModelController.listPlatformLevelAiModel(),this.aiProviderController.listAiProvider("none")]))),U$1(this.destroyRef)).subscribe({next:([t,e])=>{let l=new Map(e.map(a=>[a.id??"",a.name]));this.rows.set(t.map((a,c)=>({key:a.id??`model:${c}`,model:a,title:a.alias??a.apiModelName,providerName:l.get(a.aiProviderId)??a.aiProviderId}))),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","ai-models","new"]);}edit(t){t.model.id&&this.router.navigate(["/agentos","admin","ai-models",t.model.id,"edit"]);}confirmDelete(t){t.model.id&&this.deletion.execute(t.key,{request$:this.aiModelController.deleteAiModel(t.model.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${t.title}" failed. Try again.`});}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=Df({type:o,selectors:[["agentos-platform-ai-models"]],decls:9,vars:3,consts:[["title","Platform AI models","description","AI models shared across every namespace."],["label","Filter AI models","placeholder","Filter AI models\u2026",3,"queryChange","query"],["type","button",1,"settings-table__new",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform AI models"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Provider"],["role","cell","data-label","API model name",1,"settings-table__secondary"],["role","cell","data-label","Priority"],["role","cell","data-label","Reasoning effort"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(e,l){e&1&&(za(0,"ds-section-header",0)(1,"agentos-table-filter",1),dc("queryChange",function(c){return l.rowFilter.query.set(c)}),bf(),za(2,"button",2),dc("click",function(){return l.openCreateForm()}),r_(3,"New AI model"),bf()(),hT(4,j,2,1,"p",3),hT(5,B,2,0,"p",4)(6,K,2,0,"p",5)(7,H,2,0,"p",4)(8,J,20,0,"div",6)),e&2&&(yb(),tv("query",l.rowFilter.query()),yb(3),pT(l.deletion.error()?4:-1),yb(),pT(l.isLoading()?5:l.rows().length===0?6:l.rowFilter.filteredRows().length===0?7:8));},dependencies:[vi,xi,P,M],styles:['.settings-table__new[_ngcontent-%COMP%]{padding:7px 12px;border:1px solid var(--color-accent);border-radius:0;background:var(--color-accent);color:var(--color-bg);cursor:pointer;font-family:var(--font-heading);font-size:14px;font-weight:600;white-space:nowrap}.settings-table__new[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}.settings-table__toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:0 0 1rem}.settings-table__toolbar[_ngcontent-%COMP%] agentos-table-filter[_ngcontent-%COMP%]{margin:0;flex:0 1 240px;min-width:80px}.settings-table__toolbar[_ngcontent-%COMP%] .settings-table__new[_ngcontent-%COMP%]{margin-left:auto}.settings-table__toolbar-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-left:auto}.settings-table__toolbar-actions[_ngcontent-%COMP%] agentos-table-filter[_ngcontent-%COMP%]{flex:0 1 240px;min-width:80px}.settings-table__toolbar-actions[_ngcontent-%COMP%] .settings-table__new[_ngcontent-%COMP%]{margin-left:0;white-space:nowrap}.settings-table__status[_ngcontent-%COMP%]{margin:20px 8px;color:var(--color-text-secondary)}.settings-table__error[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:.875rem;color:var(--color-error)}.settings-table__wrap[_ngcontent-%COMP%]{overflow-x:auto}table.ds-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;font-size:14px}table.ds-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid var(--color-divider);color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-align:left;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid color-mix(in srgb,var(--color-text) 8%,transparent)}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.settings-table__name[_ngcontent-%COMP%]{font-weight:500}.settings-table__secondary[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.settings-table__stacked[_ngcontent-%COMP%]{display:block}.settings-table__tags[_ngcontent-%COMP%]{display:flex;gap:4px;flex-wrap:wrap}.settings-table__actions[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:4px;white-space:nowrap}.settings-table__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:4px 7px;border:1px solid transparent;background:transparent;color:var(--color-accent);cursor:pointer;font:inherit}.settings-table__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-100)}.settings-table__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-accent);outline-offset:1px}.settings-table__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{color:var(--color-neutral-600);cursor:default}.settings-table__actions[_ngcontent-%COMP%] .settings-table__delete[_ngcontent-%COMP%]{color:var(--color-error)}@media(max-width:760px){.settings-table__toolbar[_ngcontent-%COMP%]{flex-direction:column;align-items:stretch;gap:12px}.settings-table__toolbar-actions[_ngcontent-%COMP%]{flex-direction:column;align-items:stretch;width:100%;margin-left:0}.settings-table__toolbar-actions[_ngcontent-%COMP%] agentos-table-filter[_ngcontent-%COMP%]{flex:none;width:100%;min-width:0}.settings-table__toolbar-actions[_ngcontent-%COMP%] .settings-table__new[_ngcontent-%COMP%]{width:100%;min-height:44px}}@media(max-width:760px){table.ds-table[_ngcontent-%COMP%]{position:relative;display:block;width:100%}table.ds-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:14px;padding-top:12px}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%], table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{display:flex;flex-direction:column;padding:12px;background:var(--color-surface);border:1px solid var(--color-divider)}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(88px,30%) minmax(0,1fr);align-items:baseline;gap:4px 12px;padding:5px 0;border-bottom:0;overflow-wrap:anywhere;white-space:normal}table.ds-table[_ngcontent-%COMP%] td[data-label][_ngcontent-%COMP%]:before{content:attr(data-label);content:attr(data-label) / "";color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[data-title][_ngcontent-%COMP%]{display:block;margin-bottom:4px;padding:0 0 6px;border-bottom:0;font-size:15px}table.ds-table[_ngcontent-%COMP%] td[data-title][_ngcontent-%COMP%]:before{display:none}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:4px;margin-top:6px;padding:10px 0 0;border-top:1px solid var(--color-divider);text-align:right}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%]:before{display:none}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%] .settings-table__actions[_ngcontent-%COMP%]{flex-wrap:wrap;width:100%;white-space:normal}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%] button[_ngcontent-%COMP%]{min-width:44px;min-height:44px;padding:0 12px}}.settings-table__confirm-label[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:13px}.sr-only[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}']})};export{V as PlatformAiModelsComponent};
|
|
1
|
+
import {i,O,h as vi,x as xi,P,M}from'./chunk-D1EGHCm3.js';import {p,f as It,F as Me,ap as N,aj as k,a7 as De,d as ie,a8 as Ae,U as U$1,D as Df,as as Ms,z as za,K as dc,b as bf,r as r_,h as hT,y as yb,O as tv,a as pT,N as NT,I as Iv,e as yT,v as vT,k as bT,o as ig,s as sg,A as Af,u as uc}from'./main-GRB5KOIR.js';var z=(o,t)=>t.key;function j(o,t){if(o&1&&(za(0,"p",3),r_(1),bf()),o&2){let e=NT();yb(),Iv(e.deletion.error());}}function B(o,t){o&1&&(za(0,"p",4),r_(1,"Loading AI models\u2026"),bf());}function K(o,t){o&1&&(za(0,"p",5),r_(1,"No platform AI models defined yet."),bf());}function H(o,t){o&1&&(za(0,"p",4),r_(1,"No AI models match the current filter."),bf());}function U(o,t){if(o&1){let e=bT();za(0,"button",21),dc("click",function(){ig(e);let a=NT().$implicit,c=NT(2);return sg(c.edit(a))}),r_(1,"Edit"),bf();}if(o&2){let e=NT().$implicit;uc("aria-label","Edit "+e.title);}}function G(o,t){if(o&1){let e=bT();za(0,"tr",9)(1,"td",12),r_(2),bf(),za(3,"td",13),r_(4),bf(),za(5,"td",14),r_(6),bf(),za(7,"td",15),r_(8),bf(),za(9,"td",16),r_(10),bf(),za(11,"td",17)(12,"div",18),hT(13,U,2,1,"button",19),za(14,"agentos-row-delete-action",20),dc("deleteRequested",function(){let a=ig(e).$implicit,c=NT(2);return sg(c.deletion.request(a.key))})("deleteConfirmed",function(){let a=ig(e).$implicit,c=NT(2);return sg(c.confirmDelete(a))})("deleteCancelled",function(){ig(e);let a=NT(2);return sg(a.deletion.cancel())}),bf()()()();}if(o&2){let e=t.$implicit,l=NT(2);yb(2),Iv(e.title),yb(2),Iv(e.providerName),yb(2),Af(" ",e.model.apiModelName," "),yb(2),Iv(e.model.priority),yb(2),Af(" ",e.model.reasoningEffort?e.model.reasoningEffort.toLowerCase():"\u2014"," "),yb(3),pT(l.deletion.confirmingId()!==e.key?13:-1),yb(),tv("rowKey",e.key)("rowLabel",e.title)("state",l.deletion);}}function J(o,t){if(o&1&&(za(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),r_(5,"Name"),bf(),za(6,"th",10),r_(7,"Provider"),bf(),za(8,"th",10),r_(9,"API model name"),bf(),za(10,"th",10),r_(11,"Priority"),bf(),za(12,"th",10),r_(13,"Reasoning effort"),bf(),za(14,"th",10)(15,"span",11),r_(16,"Actions"),bf()()()(),za(17,"tbody",8),yT(18,G,15,9,"tr",9,z),bf()()()),o&2){let e=NT();yb(18),vT(e.rowFilter.filteredRows());}}var V=class o{router=p(It);destroyRef=p(Me);aiModelController=p(N);aiProviderController=p(k);refresh$=new De(void 0);isLoading=ie(true);deletion=i();rows=ie([]);rowFilter=O(this.rows,t=>[t.title,t.model.apiModelName,t.providerName].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(Ae(()=>(this.isLoading.set(true),Ms([this.aiModelController.listPlatformLevelAiModel(),this.aiProviderController.listAiProvider("none")]))),U$1(this.destroyRef)).subscribe({next:([t,e])=>{let l=new Map(e.map(a=>[a.id??"",a.name]));this.rows.set(t.map((a,c)=>({key:a.id??`model:${c}`,model:a,title:a.alias??a.apiModelName,providerName:l.get(a.aiProviderId)??a.aiProviderId}))),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","ai-models","new"]);}edit(t){t.model.id&&this.router.navigate(["/agentos","admin","ai-models",t.model.id,"edit"]);}confirmDelete(t){t.model.id&&this.deletion.execute(t.key,{request$:this.aiModelController.deleteAiModel(t.model.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${t.title}" failed. Try again.`});}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=Df({type:o,selectors:[["agentos-platform-ai-models"]],decls:9,vars:3,consts:[["title","Platform AI models","description","AI models shared across every namespace."],["label","Filter AI models","placeholder","Filter AI models\u2026",3,"queryChange","query"],["type","button",1,"settings-table__new",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform AI models"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Provider"],["role","cell","data-label","API model name",1,"settings-table__secondary"],["role","cell","data-label","Priority"],["role","cell","data-label","Reasoning effort"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(e,l){e&1&&(za(0,"ds-section-header",0)(1,"agentos-table-filter",1),dc("queryChange",function(c){return l.rowFilter.query.set(c)}),bf(),za(2,"button",2),dc("click",function(){return l.openCreateForm()}),r_(3,"New AI model"),bf()(),hT(4,j,2,1,"p",3),hT(5,B,2,0,"p",4)(6,K,2,0,"p",5)(7,H,2,0,"p",4)(8,J,20,0,"div",6)),e&2&&(yb(),tv("query",l.rowFilter.query()),yb(3),pT(l.deletion.error()?4:-1),yb(),pT(l.isLoading()?5:l.rows().length===0?6:l.rowFilter.filteredRows().length===0?7:8));},dependencies:[vi,xi,P,M],styles:['.settings-table__new[_ngcontent-%COMP%]{padding:7px 12px;border:1px solid var(--color-accent);border-radius:0;background:var(--color-accent);color:var(--color-bg);cursor:pointer;font-family:var(--font-heading);font-size:14px;font-weight:600;white-space:nowrap}.settings-table__new[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}.settings-table__toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:0 0 1rem}.settings-table__toolbar[_ngcontent-%COMP%] agentos-table-filter[_ngcontent-%COMP%]{margin:0;flex:0 1 240px;min-width:80px}.settings-table__toolbar[_ngcontent-%COMP%] .settings-table__new[_ngcontent-%COMP%]{margin-left:auto}.settings-table__toolbar-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-left:auto}.settings-table__toolbar-actions[_ngcontent-%COMP%] agentos-table-filter[_ngcontent-%COMP%]{flex:0 1 240px;min-width:80px}.settings-table__toolbar-actions[_ngcontent-%COMP%] .settings-table__new[_ngcontent-%COMP%]{margin-left:0;white-space:nowrap}.settings-table__status[_ngcontent-%COMP%]{margin:20px 8px;color:var(--color-text-secondary)}.settings-table__error[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:.875rem;color:var(--color-error)}.settings-table__wrap[_ngcontent-%COMP%]{overflow-x:auto}table.ds-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;font-size:14px}table.ds-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid var(--color-divider);color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-align:left;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid color-mix(in srgb,var(--color-text) 8%,transparent)}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.settings-table__name[_ngcontent-%COMP%]{font-weight:500}.settings-table__secondary[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.settings-table__stacked[_ngcontent-%COMP%]{display:block}.settings-table__tags[_ngcontent-%COMP%]{display:flex;gap:4px;flex-wrap:wrap}.settings-table__actions[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:4px;white-space:nowrap}.settings-table__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:4px 7px;border:1px solid transparent;background:transparent;color:var(--color-accent);cursor:pointer;font:inherit}.settings-table__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-100)}.settings-table__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-accent);outline-offset:1px}.settings-table__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{color:var(--color-neutral-600);cursor:default}.settings-table__actions[_ngcontent-%COMP%] .settings-table__delete[_ngcontent-%COMP%]{color:var(--color-error)}@media(max-width:760px){.settings-table__toolbar[_ngcontent-%COMP%]{flex-direction:column;align-items:stretch;gap:12px}.settings-table__toolbar-actions[_ngcontent-%COMP%]{flex-direction:column;align-items:stretch;width:100%;margin-left:0}.settings-table__toolbar-actions[_ngcontent-%COMP%] agentos-table-filter[_ngcontent-%COMP%]{flex:none;width:100%;min-width:0}.settings-table__toolbar-actions[_ngcontent-%COMP%] .settings-table__new[_ngcontent-%COMP%]{width:100%;min-height:44px}}@media(max-width:760px){table.ds-table[_ngcontent-%COMP%]{position:relative;display:block;width:100%}table.ds-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:14px;padding-top:12px}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%], table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{display:flex;flex-direction:column;padding:12px;background:var(--color-surface);border:1px solid var(--color-divider)}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(88px,30%) minmax(0,1fr);align-items:baseline;gap:4px 12px;padding:5px 0;border-bottom:0;overflow-wrap:anywhere;white-space:normal}table.ds-table[_ngcontent-%COMP%] td[data-label][_ngcontent-%COMP%]:before{content:attr(data-label);content:attr(data-label) / "";color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[data-title][_ngcontent-%COMP%]{display:block;margin-bottom:4px;padding:0 0 6px;border-bottom:0;font-size:15px}table.ds-table[_ngcontent-%COMP%] td[data-title][_ngcontent-%COMP%]:before{display:none}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:4px;margin-top:6px;padding:10px 0 0;border-top:1px solid var(--color-divider);text-align:right}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%]:before{display:none}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%] .settings-table__actions[_ngcontent-%COMP%]{flex-wrap:wrap;width:100%;white-space:normal}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%] button[_ngcontent-%COMP%]{min-width:44px;min-height:44px;padding:0 12px}}.settings-table__confirm-label[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:13px}.sr-only[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}']})};export{V as PlatformAiModelsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {i,O,h as vi,x as xi,C as Ci,P,M}from'./chunk-Bz9ytfN0.js';import {c}from'./chunk-DRDMJT4u.js';import {p,$ as $t,f as It,F as Me,d as ie,ae as pw,af as Wn,U as U$1,J as x,H as w,ab as Ee,ag as Se,D as Df,a3 as _,z as za,K as dc,b as bf,r as r_,h as hT,y as yb,O as tv,a as pT,N as NT,I as Iv,e as yT,v as vT,k as bT,o as ig,s as sg}from'./main-QSAMSEVG.js';var U=(n,t)=>t.key;function B(n,t){if(n&1&&(za(0,"p",3),r_(1),bf()),n&2){let e=NT();yb(),Iv(e.deletion.error());}}function W(n,t){n&1&&(za(0,"p",4),r_(1,"Loading scheduled prompts\u2026"),bf());}function H(n,t){n&1&&(za(0,"p",5),r_(1,"No scheduled prompts available."),bf());}function J(n,t){n&1&&(za(0,"p",4),r_(1,"No scheduled prompts match the current filter."),bf());}function Y(n,t){if(n&1&&(za(0,"span",14),r_(1),bf()),n&2){let e=NT().$implicit;yb(),Iv(e.prompt.description);}}function G(n,t){n&1&&(za(0,"ds-tag",20),r_(1,"Read-only"),bf());}function Q(n,t){if(n&1){let e=bT();za(0,"button",24),dc("click",function(){ig(e);let l=NT(2).$implicit,c=NT(2);return sg(c.toggle(l))}),r_(1),bf(),za(2,"button",24),dc("click",function(){ig(e);let l=NT(2).$implicit,c=NT(2);return sg(c.edit(l))}),r_(3,"Edit"),bf();}if(n&2){let e=NT(2).$implicit;yb(),Iv(e.prompt.enabled?"Disable":"Enable");}}function X(n,t){if(n&1){let e=bT();hT(0,Q,4,1),za(1,"agentos-row-delete-action",23),dc("deleteRequested",function(){ig(e);let l=NT().$implicit,c=NT(2);return sg(c.deletion.request(l.key))})("deleteConfirmed",function(){ig(e);let l=NT().$implicit,c=NT(2);return sg(c.confirmDelete(l))})("deleteCancelled",function(){ig(e);let l=NT(3);return sg(l.deletion.cancel())}),bf();}if(n&2){let e=NT().$implicit,o=NT(2);pT(o.deletion.confirmingId()!==e.key?0:-1),yb(),tv("rowKey",e.key)("rowLabel",e.prompt.name)("state",o.deletion);}}function Z(n,t){n&1&&(za(0,"button",22),r_(1,"Inherited"),bf());}function ee(n,t){if(n&1&&(za(0,"tr",9)(1,"td",12)(2,"span",13),r_(3),bf(),hT(4,Y,2,1,"span",14),bf(),za(5,"td",15),r_(6),bf(),za(7,"td",16)(8,"ds-tag",17),r_(9),bf()(),za(10,"td",18)(11,"div",19)(12,"ds-tag",17),r_(13),bf(),hT(14,G,2,0,"ds-tag",20),bf()(),za(15,"td",21),hT(16,X,2,4)(17,Z,2,0,"button",22),bf()()),n&2){let e=t.$implicit,o=NT(2);yb(3),Iv(e.prompt.name),yb(),pT(e.prompt.description?4:-1),yb(2),Iv(o.scheduleLabel(e.prompt)),yb(2),tv("variant",e.prompt.enabled?"accent":"outline"),yb(),Iv(e.prompt.enabled?"Enabled":"Disabled"),yb(3),tv("variant",e.scope==="platform"?"neutral":"accent"),yb(),Iv(e.scope==="platform"?"Platform":"Namespace"),yb(),pT(e.scope==="platform"?14:-1),yb(2),pT(e.scope==="namespace"?16:17);}}function te(n,t){if(n&1&&(za(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),r_(5,"Name"),bf(),za(6,"th",10),r_(7,"Schedule"),bf(),za(8,"th",10),r_(9,"Status"),bf(),za(10,"th",10),r_(11,"Scope"),bf(),za(12,"th",10)(13,"span",11),r_(14,"Actions"),bf()()()(),za(15,"tbody",8),yT(16,ee,18,9,"tr",9,U),bf()()()),n&2){let e=NT();yb(16),vT(e.rowFilter.filteredRows());}}var K=class n{route=p($t);router=p(It);destroyRef=p(Me);state=p(c);namespaceId=this.route.snapshot.params.namespaceId;rows=ie([]);isLoading=ie(true);deletion=i();rowFilter=O(this.rows,t=>[t.prompt.name,t.prompt.description,this.scheduleLabel(t.prompt),t.prompt.enabled?"Enabled":"Disabled",t.scope].filter(Boolean).join(" "));constructor(){pw({platform:this.state.listPlatform().pipe(Wn(()=>_([]))),namespace:this.state.listByNamespace(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({platform:t,namespace:e})=>{this.rows.set([...t.map((o,l)=>({key:`platform:${o.id??l}`,prompt:o,scope:"platform"})),...e.map((o,l)=>({key:`namespace:${o.id??l}`,prompt:o,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts","new"]);}edit(t){t.scope==="platform"||!t.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts",t.prompt.id,"edit"]);}toggle(t){if(t.scope==="platform")return;(t.prompt.enabled?this.state.disable(t.prompt.id??""):this.state.enable(t.prompt.id??"")).pipe(U$1(this.destroyRef)).subscribe(o=>this.rows.update(l=>l.map(c=>c.key===t.key?x(w({},c),{prompt:o}):c)));}confirmDelete(t){t.scope==="platform"||!t.prompt.id||this.deletion.execute(t.key,{request$:this.state.delete(t.prompt.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.rows.update(e=>e.filter(o=>o.key!==t.key)),errorMessage:`Deleting "${t.prompt.name}" failed. Try again.`});}scheduleLabel(t){let e=t.recurrence,o=e.unit===Ee.WEEK?"week":"month",l=e.unit===Ee.WEEK&&e.days?.length?` (${e.days.map(c=>Se[c]??c).join(", ")})`:"";return `Every ${o}${l} at ${e.timeUtc} UTC`}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Df({type:n,selectors:[["agentos-scheduled-prompt-list"]],decls:9,vars:3,consts:[["title","Scheduled prompts","description","Scheduled prompts for this namespace, including schedules inherited from the platform."],["label","Filter scheduled prompts","placeholder","Filter scheduled prompts\u2026",3,"queryChange","query"],["type","button",1,"scheduled-prompts__new",3,"click"],["role","alert",1,"scheduled-prompts__error"],["role","status",1,"scheduled-prompts__status"],[1,"scheduled-prompts__status"],[1,"scheduled-prompts__table-wrap"],["dsTable","","role","table","aria-label","Scheduled prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"scheduled-prompts__name"],[1,"scheduled-prompts__description"],["role","cell","data-label","Schedule"],["role","cell","data-label","Status"],[3,"variant"],["role","cell","data-label","Scope"],[1,"scheduled-prompts__tags"],["variant","outline"],["role","cell","data-label","Actions","data-actions","",1,"scheduled-prompts__actions"],["type","button","disabled",""],["deleteClass","scheduled-prompts__delete",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(e,o){e&1&&(za(0,"ds-section-header",0)(1,"agentos-table-filter",1),dc("queryChange",function(c){return o.rowFilter.query.set(c)}),bf(),za(2,"button",2),dc("click",function(){return o.openCreateForm()}),r_(3," New scheduled prompt "),bf()(),hT(4,B,2,1,"p",3),hT(5,W,2,0,"p",4)(6,H,2,0,"p",5)(7,J,2,0,"p",4)(8,te,18,0,"div",6)),e&2&&(yb(),tv("query",o.rowFilter.query()),yb(3),pT(o.deletion.error()?4:-1),yb(),pT(o.isLoading()?5:o.rows().length===0?6:o.rowFilter.filteredRows().length===0?7:8));},dependencies:[vi,xi,Ci,P,M],styles:['.scheduled-prompts__new[_ngcontent-%COMP%]{white-space:nowrap;padding:7px 12px;border:1px solid var(--color-accent);border-radius:0;background:var(--color-accent);color:var(--color-bg);cursor:pointer;font-family:var(--font-heading);font-size:14px;font-weight:600}.scheduled-prompts__status[_ngcontent-%COMP%]{margin:20px 8px;color:var(--color-text-secondary)}.scheduled-prompts__error[_ngcontent-%COMP%]{margin:0 0 .75rem;color:var(--color-error)}.scheduled-prompts__table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table.ds-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;font-size:14px}table.ds-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid var(--color-divider);color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-align:left;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid color-mix(in srgb,var(--color-text) 8%,transparent)}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.scheduled-prompts__name[_ngcontent-%COMP%]{display:block;font-weight:500}.scheduled-prompts__description[_ngcontent-%COMP%]{display:block;color:var(--color-text-secondary);font-size:12px}.scheduled-prompts__tags[_ngcontent-%COMP%]{display:flex;gap:4px;flex-wrap:wrap}.scheduled-prompts__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:4px;white-space:nowrap}.scheduled-prompts__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:4px 7px;border:1px solid transparent;background:transparent;color:var(--color-accent);cursor:pointer;font:inherit}.scheduled-prompts__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-100)}.scheduled-prompts__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{color:var(--color-neutral-600);cursor:default}.scheduled-prompts__actions[_ngcontent-%COMP%] .scheduled-prompts__delete[_ngcontent-%COMP%]{color:var(--color-error)}.sr-only[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:760px){table.ds-table[_ngcontent-%COMP%]{position:relative;display:block;width:100%}table.ds-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:14px;padding-top:12px}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%], table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{display:flex;flex-direction:column;padding:12px;background:var(--color-surface);border:1px solid var(--color-divider)}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(88px,30%) minmax(0,1fr);align-items:baseline;gap:4px 12px;padding:5px 0;border-bottom:0;overflow-wrap:anywhere;white-space:normal}table.ds-table[_ngcontent-%COMP%] td[data-label][_ngcontent-%COMP%]:before{content:attr(data-label);content:attr(data-label) / "";color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[data-title][_ngcontent-%COMP%]{display:block;margin-bottom:4px;padding:0 0 6px;border-bottom:0;font-size:15px}table.ds-table[_ngcontent-%COMP%] td[data-title][_ngcontent-%COMP%]:before{display:none}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:4px;margin-top:6px;padding:10px 0 0;border-top:1px solid var(--color-divider);text-align:right}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%]:before{display:none}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%] .settings-table__actions[_ngcontent-%COMP%]{flex-wrap:wrap;width:100%;white-space:normal}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%] button[_ngcontent-%COMP%]{min-width:44px;min-height:44px;padding:0 12px}}']})};export{K as ScheduledPromptListComponent};
|
|
1
|
+
import {i,O,h as vi,x as xi,C as Ci,P,M}from'./chunk-D1EGHCm3.js';import {c}from'./chunk-DrDGJBfk.js';import {p,$ as $t,f as It,F as Me,d as ie,ae as pw,af as Wn,U as U$1,J as x,H as w,ab as Ee,ag as Se,D as Df,a3 as _,z as za,K as dc,b as bf,r as r_,h as hT,y as yb,O as tv,a as pT,N as NT,I as Iv,e as yT,v as vT,k as bT,o as ig,s as sg}from'./main-GRB5KOIR.js';var U=(n,t)=>t.key;function B(n,t){if(n&1&&(za(0,"p",3),r_(1),bf()),n&2){let e=NT();yb(),Iv(e.deletion.error());}}function W(n,t){n&1&&(za(0,"p",4),r_(1,"Loading scheduled prompts\u2026"),bf());}function H(n,t){n&1&&(za(0,"p",5),r_(1,"No scheduled prompts available."),bf());}function J(n,t){n&1&&(za(0,"p",4),r_(1,"No scheduled prompts match the current filter."),bf());}function Y(n,t){if(n&1&&(za(0,"span",14),r_(1),bf()),n&2){let e=NT().$implicit;yb(),Iv(e.prompt.description);}}function G(n,t){n&1&&(za(0,"ds-tag",20),r_(1,"Read-only"),bf());}function Q(n,t){if(n&1){let e=bT();za(0,"button",24),dc("click",function(){ig(e);let l=NT(2).$implicit,c=NT(2);return sg(c.toggle(l))}),r_(1),bf(),za(2,"button",24),dc("click",function(){ig(e);let l=NT(2).$implicit,c=NT(2);return sg(c.edit(l))}),r_(3,"Edit"),bf();}if(n&2){let e=NT(2).$implicit;yb(),Iv(e.prompt.enabled?"Disable":"Enable");}}function X(n,t){if(n&1){let e=bT();hT(0,Q,4,1),za(1,"agentos-row-delete-action",23),dc("deleteRequested",function(){ig(e);let l=NT().$implicit,c=NT(2);return sg(c.deletion.request(l.key))})("deleteConfirmed",function(){ig(e);let l=NT().$implicit,c=NT(2);return sg(c.confirmDelete(l))})("deleteCancelled",function(){ig(e);let l=NT(3);return sg(l.deletion.cancel())}),bf();}if(n&2){let e=NT().$implicit,o=NT(2);pT(o.deletion.confirmingId()!==e.key?0:-1),yb(),tv("rowKey",e.key)("rowLabel",e.prompt.name)("state",o.deletion);}}function Z(n,t){n&1&&(za(0,"button",22),r_(1,"Inherited"),bf());}function ee(n,t){if(n&1&&(za(0,"tr",9)(1,"td",12)(2,"span",13),r_(3),bf(),hT(4,Y,2,1,"span",14),bf(),za(5,"td",15),r_(6),bf(),za(7,"td",16)(8,"ds-tag",17),r_(9),bf()(),za(10,"td",18)(11,"div",19)(12,"ds-tag",17),r_(13),bf(),hT(14,G,2,0,"ds-tag",20),bf()(),za(15,"td",21),hT(16,X,2,4)(17,Z,2,0,"button",22),bf()()),n&2){let e=t.$implicit,o=NT(2);yb(3),Iv(e.prompt.name),yb(),pT(e.prompt.description?4:-1),yb(2),Iv(o.scheduleLabel(e.prompt)),yb(2),tv("variant",e.prompt.enabled?"accent":"outline"),yb(),Iv(e.prompt.enabled?"Enabled":"Disabled"),yb(3),tv("variant",e.scope==="platform"?"neutral":"accent"),yb(),Iv(e.scope==="platform"?"Platform":"Namespace"),yb(),pT(e.scope==="platform"?14:-1),yb(2),pT(e.scope==="namespace"?16:17);}}function te(n,t){if(n&1&&(za(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),r_(5,"Name"),bf(),za(6,"th",10),r_(7,"Schedule"),bf(),za(8,"th",10),r_(9,"Status"),bf(),za(10,"th",10),r_(11,"Scope"),bf(),za(12,"th",10)(13,"span",11),r_(14,"Actions"),bf()()()(),za(15,"tbody",8),yT(16,ee,18,9,"tr",9,U),bf()()()),n&2){let e=NT();yb(16),vT(e.rowFilter.filteredRows());}}var K=class n{route=p($t);router=p(It);destroyRef=p(Me);state=p(c);namespaceId=this.route.snapshot.params.namespaceId;rows=ie([]);isLoading=ie(true);deletion=i();rowFilter=O(this.rows,t=>[t.prompt.name,t.prompt.description,this.scheduleLabel(t.prompt),t.prompt.enabled?"Enabled":"Disabled",t.scope].filter(Boolean).join(" "));constructor(){pw({platform:this.state.listPlatform().pipe(Wn(()=>_([]))),namespace:this.state.listByNamespace(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({platform:t,namespace:e})=>{this.rows.set([...t.map((o,l)=>({key:`platform:${o.id??l}`,prompt:o,scope:"platform"})),...e.map((o,l)=>({key:`namespace:${o.id??l}`,prompt:o,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts","new"]);}edit(t){t.scope==="platform"||!t.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts",t.prompt.id,"edit"]);}toggle(t){if(t.scope==="platform")return;(t.prompt.enabled?this.state.disable(t.prompt.id??""):this.state.enable(t.prompt.id??"")).pipe(U$1(this.destroyRef)).subscribe(o=>this.rows.update(l=>l.map(c=>c.key===t.key?x(w({},c),{prompt:o}):c)));}confirmDelete(t){t.scope==="platform"||!t.prompt.id||this.deletion.execute(t.key,{request$:this.state.delete(t.prompt.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.rows.update(e=>e.filter(o=>o.key!==t.key)),errorMessage:`Deleting "${t.prompt.name}" failed. Try again.`});}scheduleLabel(t){let e=t.recurrence,o=e.unit===Ee.WEEK?"week":"month",l=e.unit===Ee.WEEK&&e.days?.length?` (${e.days.map(c=>Se[c]??c).join(", ")})`:"";return `Every ${o}${l} at ${e.timeUtc} UTC`}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Df({type:n,selectors:[["agentos-scheduled-prompt-list"]],decls:9,vars:3,consts:[["title","Scheduled prompts","description","Scheduled prompts for this namespace, including schedules inherited from the platform."],["label","Filter scheduled prompts","placeholder","Filter scheduled prompts\u2026",3,"queryChange","query"],["type","button",1,"scheduled-prompts__new",3,"click"],["role","alert",1,"scheduled-prompts__error"],["role","status",1,"scheduled-prompts__status"],[1,"scheduled-prompts__status"],[1,"scheduled-prompts__table-wrap"],["dsTable","","role","table","aria-label","Scheduled prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"scheduled-prompts__name"],[1,"scheduled-prompts__description"],["role","cell","data-label","Schedule"],["role","cell","data-label","Status"],[3,"variant"],["role","cell","data-label","Scope"],[1,"scheduled-prompts__tags"],["variant","outline"],["role","cell","data-label","Actions","data-actions","",1,"scheduled-prompts__actions"],["type","button","disabled",""],["deleteClass","scheduled-prompts__delete",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(e,o){e&1&&(za(0,"ds-section-header",0)(1,"agentos-table-filter",1),dc("queryChange",function(c){return o.rowFilter.query.set(c)}),bf(),za(2,"button",2),dc("click",function(){return o.openCreateForm()}),r_(3," New scheduled prompt "),bf()(),hT(4,B,2,1,"p",3),hT(5,W,2,0,"p",4)(6,H,2,0,"p",5)(7,J,2,0,"p",4)(8,te,18,0,"div",6)),e&2&&(yb(),tv("query",o.rowFilter.query()),yb(3),pT(o.deletion.error()?4:-1),yb(),pT(o.isLoading()?5:o.rows().length===0?6:o.rowFilter.filteredRows().length===0?7:8));},dependencies:[vi,xi,Ci,P,M],styles:['.scheduled-prompts__new[_ngcontent-%COMP%]{white-space:nowrap;padding:7px 12px;border:1px solid var(--color-accent);border-radius:0;background:var(--color-accent);color:var(--color-bg);cursor:pointer;font-family:var(--font-heading);font-size:14px;font-weight:600}.scheduled-prompts__status[_ngcontent-%COMP%]{margin:20px 8px;color:var(--color-text-secondary)}.scheduled-prompts__error[_ngcontent-%COMP%]{margin:0 0 .75rem;color:var(--color-error)}.scheduled-prompts__table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table.ds-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;font-size:14px}table.ds-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid var(--color-divider);color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-align:left;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid color-mix(in srgb,var(--color-text) 8%,transparent)}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.scheduled-prompts__name[_ngcontent-%COMP%]{display:block;font-weight:500}.scheduled-prompts__description[_ngcontent-%COMP%]{display:block;color:var(--color-text-secondary);font-size:12px}.scheduled-prompts__tags[_ngcontent-%COMP%]{display:flex;gap:4px;flex-wrap:wrap}.scheduled-prompts__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:4px;white-space:nowrap}.scheduled-prompts__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:4px 7px;border:1px solid transparent;background:transparent;color:var(--color-accent);cursor:pointer;font:inherit}.scheduled-prompts__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-100)}.scheduled-prompts__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{color:var(--color-neutral-600);cursor:default}.scheduled-prompts__actions[_ngcontent-%COMP%] .scheduled-prompts__delete[_ngcontent-%COMP%]{color:var(--color-error)}.sr-only[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:760px){table.ds-table[_ngcontent-%COMP%]{position:relative;display:block;width:100%}table.ds-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:14px;padding-top:12px}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%], table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{display:flex;flex-direction:column;padding:12px;background:var(--color-surface);border:1px solid var(--color-divider)}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(88px,30%) minmax(0,1fr);align-items:baseline;gap:4px 12px;padding:5px 0;border-bottom:0;overflow-wrap:anywhere;white-space:normal}table.ds-table[_ngcontent-%COMP%] td[data-label][_ngcontent-%COMP%]:before{content:attr(data-label);content:attr(data-label) / "";color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[data-title][_ngcontent-%COMP%]{display:block;margin-bottom:4px;padding:0 0 6px;border-bottom:0;font-size:15px}table.ds-table[_ngcontent-%COMP%] td[data-title][_ngcontent-%COMP%]:before{display:none}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:4px;margin-top:6px;padding:10px 0 0;border-top:1px solid var(--color-divider);text-align:right}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%]:before{display:none}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%] .settings-table__actions[_ngcontent-%COMP%]{flex-wrap:wrap;width:100%;white-space:normal}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%] button[_ngcontent-%COMP%]{min-width:44px;min-height:44px;padding:0 12px}}']})};export{K as ScheduledPromptListComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {O}from'./chunk-DyPx2k7Y.js';import {p,f as It,F as Me,a6 as D,a7 as De,d as ie,a8 as Ae,U as U$1,D as Df,z as za,K as dc,b as bf,r as r_,h as hT,y as yb,O as tv,a as pT,N as NT,I as Iv,e as yT,v as vT,k as bT,u as uc,o as ig,s as sg}from'./main-QSAMSEVG.js';import {i,O as O$1,h as vi,x as xi,P,M}from'./chunk-Bz9ytfN0.js';import'./chunk-C0dQg7yj.js';var N=(e,t)=>t.id??t.name;function z(e,t){if(e&1&&(za(0,"p",3),r_(1),bf()),e&2){let n=NT();yb(),Iv(n.deletion.error());}}function j(e,t){e&1&&(za(0,"p",4),r_(1,"Loading integrations\u2026"),bf());}function A(e,t){e&1&&(za(0,"p",5),r_(1,"No platform integrations defined yet."),bf());}function K(e,t){e&1&&(za(0,"p",4),r_(1,"No integrations match the current filter."),bf());}function B(e,t){if(e&1){let n=bT();za(0,"button",18),dc("click",function(){ig(n);let c=NT().$implicit,d=NT(2);return sg(d.edit(c))}),r_(1,"Edit"),bf();}if(e&2){let n=NT().$implicit;uc("aria-label","Edit "+n.name);}}function H(e,t){if(e&1){let n=bT();za(0,"agentos-row-delete-action",19),dc("deleteRequested",function(){ig(n);let c=NT().$implicit,d=NT(2);return sg(d.deletion.request(c.id))})("deleteConfirmed",function(){ig(n);let c=NT().$implicit,d=NT(2);return sg(d.confirmDelete(c))})("deleteCancelled",function(){ig(n);let c=NT(3);return sg(c.deletion.cancel())}),bf();}if(e&2){let n=NT().$implicit,a=NT(2);tv("rowKey",n.id)("rowLabel",n.name)("state",a.deletion);}}function U(e,t){if(e&1&&(za(0,"tr",9)(1,"td",12),r_(2),bf(),za(3,"td",13),r_(4),bf(),za(5,"td",14)(6,"div",15),hT(7,B,2,1,"button",16),hT(8,H,1,3,"agentos-row-delete-action",17),bf()()()),e&2){let n=t.$implicit,a=NT(2);yb(2),Iv(n.name),yb(2),Iv(n.integrationType),yb(3),pT(a.deletion.confirmingId()!==n.id?7:-1),yb(),pT(n.id?8:-1);}}function G(e,t){if(e&1&&(za(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),r_(5,"Name"),bf(),za(6,"th",10),r_(7,"Type"),bf(),za(8,"th",10)(9,"span",11),r_(10,"Actions"),bf()()()(),za(11,"tbody",8),yT(12,U,9,4,"tr",9,N),bf()()()),e&2){let n=NT();yb(12),vT(n.rowFilter.filteredRows());}}var V=class e{router=p(It);destroyRef=p(Me);state=p(O);integrationConfigController=p(D);refresh$=new De(void 0);isLoading=ie(true);deletion=i();configs=ie([]);rowFilter=O$1(this.configs,t=>[t.name,t.integrationType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(Ae(()=>(this.isLoading.set(true),this.state.loadPlatformConfigs())),U$1(this.destroyRef)).subscribe({next:t=>{this.configs.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","integration-configs","new"]);}edit(t){this.router.navigate(["/agentos","admin","integration-configs",t.id??"","edit"]);}confirmDelete(t){t.id&&this.deletion.execute(t.id,{request$:this.integrationConfigController.deleteIntegrationConfig(t.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${t.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=Df({type:e,selectors:[["agentos-platform-integration-configs"]],decls:9,vars:3,consts:[["title","Platform integrations","description","Integration configurations shared across every namespace."],["label","Filter integrations","placeholder","Filter integrations\u2026",3,"queryChange","query"],["type","button",1,"settings-table__new",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform integrations"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Type",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,a){n&1&&(za(0,"ds-section-header",0)(1,"agentos-table-filter",1),dc("queryChange",function(d){return a.rowFilter.query.set(d)}),bf(),za(2,"button",2),dc("click",function(){return a.openCreateForm()}),r_(3,"New integration"),bf()(),hT(4,z,2,1,"p",3),hT(5,j,2,0,"p",4)(6,A,2,0,"p",5)(7,K,2,0,"p",4)(8,G,14,0,"div",6)),n&2&&(yb(),tv("query",a.rowFilter.query()),yb(3),pT(a.deletion.error()?4:-1),yb(),pT(a.isLoading()?5:a.configs().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[vi,xi,P,M],styles:['.settings-table__new[_ngcontent-%COMP%]{padding:7px 12px;border:1px solid var(--color-accent);border-radius:0;background:var(--color-accent);color:var(--color-bg);cursor:pointer;font-family:var(--font-heading);font-size:14px;font-weight:600;white-space:nowrap}.settings-table__new[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}.settings-table__toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:0 0 1rem}.settings-table__toolbar[_ngcontent-%COMP%] agentos-table-filter[_ngcontent-%COMP%]{margin:0;flex:0 1 240px;min-width:80px}.settings-table__toolbar[_ngcontent-%COMP%] .settings-table__new[_ngcontent-%COMP%]{margin-left:auto}.settings-table__toolbar-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-left:auto}.settings-table__toolbar-actions[_ngcontent-%COMP%] agentos-table-filter[_ngcontent-%COMP%]{flex:0 1 240px;min-width:80px}.settings-table__toolbar-actions[_ngcontent-%COMP%] .settings-table__new[_ngcontent-%COMP%]{margin-left:0;white-space:nowrap}.settings-table__status[_ngcontent-%COMP%]{margin:20px 8px;color:var(--color-text-secondary)}.settings-table__error[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:.875rem;color:var(--color-error)}.settings-table__wrap[_ngcontent-%COMP%]{overflow-x:auto}table.ds-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;font-size:14px}table.ds-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid var(--color-divider);color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-align:left;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid color-mix(in srgb,var(--color-text) 8%,transparent)}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.settings-table__name[_ngcontent-%COMP%]{font-weight:500}.settings-table__secondary[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.settings-table__stacked[_ngcontent-%COMP%]{display:block}.settings-table__tags[_ngcontent-%COMP%]{display:flex;gap:4px;flex-wrap:wrap}.settings-table__actions[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:4px;white-space:nowrap}.settings-table__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:4px 7px;border:1px solid transparent;background:transparent;color:var(--color-accent);cursor:pointer;font:inherit}.settings-table__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-100)}.settings-table__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-accent);outline-offset:1px}.settings-table__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{color:var(--color-neutral-600);cursor:default}.settings-table__actions[_ngcontent-%COMP%] .settings-table__delete[_ngcontent-%COMP%]{color:var(--color-error)}@media(max-width:760px){.settings-table__toolbar[_ngcontent-%COMP%]{flex-direction:column;align-items:stretch;gap:12px}.settings-table__toolbar-actions[_ngcontent-%COMP%]{flex-direction:column;align-items:stretch;width:100%;margin-left:0}.settings-table__toolbar-actions[_ngcontent-%COMP%] agentos-table-filter[_ngcontent-%COMP%]{flex:none;width:100%;min-width:0}.settings-table__toolbar-actions[_ngcontent-%COMP%] .settings-table__new[_ngcontent-%COMP%]{width:100%;min-height:44px}}@media(max-width:760px){table.ds-table[_ngcontent-%COMP%]{position:relative;display:block;width:100%}table.ds-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:14px;padding-top:12px}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%], table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{display:flex;flex-direction:column;padding:12px;background:var(--color-surface);border:1px solid var(--color-divider)}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(88px,30%) minmax(0,1fr);align-items:baseline;gap:4px 12px;padding:5px 0;border-bottom:0;overflow-wrap:anywhere;white-space:normal}table.ds-table[_ngcontent-%COMP%] td[data-label][_ngcontent-%COMP%]:before{content:attr(data-label);content:attr(data-label) / "";color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[data-title][_ngcontent-%COMP%]{display:block;margin-bottom:4px;padding:0 0 6px;border-bottom:0;font-size:15px}table.ds-table[_ngcontent-%COMP%] td[data-title][_ngcontent-%COMP%]:before{display:none}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:4px;margin-top:6px;padding:10px 0 0;border-top:1px solid var(--color-divider);text-align:right}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%]:before{display:none}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%] .settings-table__actions[_ngcontent-%COMP%]{flex-wrap:wrap;width:100%;white-space:normal}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%] button[_ngcontent-%COMP%]{min-width:44px;min-height:44px;padding:0 12px}}.settings-table__confirm-label[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:13px}.sr-only[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}']})};export{V as PlatformIntegrationConfigsComponent};
|
|
1
|
+
import {O}from'./chunk-Vb2IMeLm.js';import {p,f as It,F as Me,a6 as D,a7 as De,d as ie,a8 as Ae,U as U$1,D as Df,z as za,K as dc,b as bf,r as r_,h as hT,y as yb,O as tv,a as pT,N as NT,I as Iv,e as yT,v as vT,k as bT,u as uc,o as ig,s as sg}from'./main-GRB5KOIR.js';import {i,O as O$1,h as vi,x as xi,P,M}from'./chunk-D1EGHCm3.js';import'./chunk-BtHSpru4.js';var N=(e,t)=>t.id??t.name;function z(e,t){if(e&1&&(za(0,"p",3),r_(1),bf()),e&2){let n=NT();yb(),Iv(n.deletion.error());}}function j(e,t){e&1&&(za(0,"p",4),r_(1,"Loading integrations\u2026"),bf());}function A(e,t){e&1&&(za(0,"p",5),r_(1,"No platform integrations defined yet."),bf());}function K(e,t){e&1&&(za(0,"p",4),r_(1,"No integrations match the current filter."),bf());}function B(e,t){if(e&1){let n=bT();za(0,"button",18),dc("click",function(){ig(n);let c=NT().$implicit,d=NT(2);return sg(d.edit(c))}),r_(1,"Edit"),bf();}if(e&2){let n=NT().$implicit;uc("aria-label","Edit "+n.name);}}function H(e,t){if(e&1){let n=bT();za(0,"agentos-row-delete-action",19),dc("deleteRequested",function(){ig(n);let c=NT().$implicit,d=NT(2);return sg(d.deletion.request(c.id))})("deleteConfirmed",function(){ig(n);let c=NT().$implicit,d=NT(2);return sg(d.confirmDelete(c))})("deleteCancelled",function(){ig(n);let c=NT(3);return sg(c.deletion.cancel())}),bf();}if(e&2){let n=NT().$implicit,a=NT(2);tv("rowKey",n.id)("rowLabel",n.name)("state",a.deletion);}}function U(e,t){if(e&1&&(za(0,"tr",9)(1,"td",12),r_(2),bf(),za(3,"td",13),r_(4),bf(),za(5,"td",14)(6,"div",15),hT(7,B,2,1,"button",16),hT(8,H,1,3,"agentos-row-delete-action",17),bf()()()),e&2){let n=t.$implicit,a=NT(2);yb(2),Iv(n.name),yb(2),Iv(n.integrationType),yb(3),pT(a.deletion.confirmingId()!==n.id?7:-1),yb(),pT(n.id?8:-1);}}function G(e,t){if(e&1&&(za(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),r_(5,"Name"),bf(),za(6,"th",10),r_(7,"Type"),bf(),za(8,"th",10)(9,"span",11),r_(10,"Actions"),bf()()()(),za(11,"tbody",8),yT(12,U,9,4,"tr",9,N),bf()()()),e&2){let n=NT();yb(12),vT(n.rowFilter.filteredRows());}}var V=class e{router=p(It);destroyRef=p(Me);state=p(O);integrationConfigController=p(D);refresh$=new De(void 0);isLoading=ie(true);deletion=i();configs=ie([]);rowFilter=O$1(this.configs,t=>[t.name,t.integrationType].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(Ae(()=>(this.isLoading.set(true),this.state.loadPlatformConfigs())),U$1(this.destroyRef)).subscribe({next:t=>{this.configs.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos","admin","integration-configs","new"]);}edit(t){this.router.navigate(["/agentos","admin","integration-configs",t.id??"","edit"]);}confirmDelete(t){t.id&&this.deletion.execute(t.id,{request$:this.integrationConfigController.deleteIntegrationConfig(t.id).pipe(U$1(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:`Deleting "${t.name}" failed. Try again.`});}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=Df({type:e,selectors:[["agentos-platform-integration-configs"]],decls:9,vars:3,consts:[["title","Platform integrations","description","Integration configurations shared across every namespace."],["label","Filter integrations","placeholder","Filter integrations\u2026",3,"queryChange","query"],["type","button",1,"settings-table__new",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Platform integrations"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Type",1,"settings-table__secondary"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(n,a){n&1&&(za(0,"ds-section-header",0)(1,"agentos-table-filter",1),dc("queryChange",function(d){return a.rowFilter.query.set(d)}),bf(),za(2,"button",2),dc("click",function(){return a.openCreateForm()}),r_(3,"New integration"),bf()(),hT(4,z,2,1,"p",3),hT(5,j,2,0,"p",4)(6,A,2,0,"p",5)(7,K,2,0,"p",4)(8,G,14,0,"div",6)),n&2&&(yb(),tv("query",a.rowFilter.query()),yb(3),pT(a.deletion.error()?4:-1),yb(),pT(a.isLoading()?5:a.configs().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[vi,xi,P,M],styles:['.settings-table__new[_ngcontent-%COMP%]{padding:7px 12px;border:1px solid var(--color-accent);border-radius:0;background:var(--color-accent);color:var(--color-bg);cursor:pointer;font-family:var(--font-heading);font-size:14px;font-weight:600;white-space:nowrap}.settings-table__new[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-accent);outline-offset:2px}.settings-table__toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:0 0 1rem}.settings-table__toolbar[_ngcontent-%COMP%] agentos-table-filter[_ngcontent-%COMP%]{margin:0;flex:0 1 240px;min-width:80px}.settings-table__toolbar[_ngcontent-%COMP%] .settings-table__new[_ngcontent-%COMP%]{margin-left:auto}.settings-table__toolbar-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-left:auto}.settings-table__toolbar-actions[_ngcontent-%COMP%] agentos-table-filter[_ngcontent-%COMP%]{flex:0 1 240px;min-width:80px}.settings-table__toolbar-actions[_ngcontent-%COMP%] .settings-table__new[_ngcontent-%COMP%]{margin-left:0;white-space:nowrap}.settings-table__status[_ngcontent-%COMP%]{margin:20px 8px;color:var(--color-text-secondary)}.settings-table__error[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:.875rem;color:var(--color-error)}.settings-table__wrap[_ngcontent-%COMP%]{overflow-x:auto}table.ds-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;font-size:14px}table.ds-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid var(--color-divider);color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-align:left;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid color-mix(in srgb,var(--color-text) 8%,transparent)}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.settings-table__name[_ngcontent-%COMP%]{font-weight:500}.settings-table__secondary[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.settings-table__stacked[_ngcontent-%COMP%]{display:block}.settings-table__tags[_ngcontent-%COMP%]{display:flex;gap:4px;flex-wrap:wrap}.settings-table__actions[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:4px;white-space:nowrap}.settings-table__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:4px 7px;border:1px solid transparent;background:transparent;color:var(--color-accent);cursor:pointer;font:inherit}.settings-table__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-100)}.settings-table__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-accent);outline-offset:1px}.settings-table__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{color:var(--color-neutral-600);cursor:default}.settings-table__actions[_ngcontent-%COMP%] .settings-table__delete[_ngcontent-%COMP%]{color:var(--color-error)}@media(max-width:760px){.settings-table__toolbar[_ngcontent-%COMP%]{flex-direction:column;align-items:stretch;gap:12px}.settings-table__toolbar-actions[_ngcontent-%COMP%]{flex-direction:column;align-items:stretch;width:100%;margin-left:0}.settings-table__toolbar-actions[_ngcontent-%COMP%] agentos-table-filter[_ngcontent-%COMP%]{flex:none;width:100%;min-width:0}.settings-table__toolbar-actions[_ngcontent-%COMP%] .settings-table__new[_ngcontent-%COMP%]{width:100%;min-height:44px}}@media(max-width:760px){table.ds-table[_ngcontent-%COMP%]{position:relative;display:block;width:100%}table.ds-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:14px;padding-top:12px}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%], table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{display:flex;flex-direction:column;padding:12px;background:var(--color-surface);border:1px solid var(--color-divider)}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(88px,30%) minmax(0,1fr);align-items:baseline;gap:4px 12px;padding:5px 0;border-bottom:0;overflow-wrap:anywhere;white-space:normal}table.ds-table[_ngcontent-%COMP%] td[data-label][_ngcontent-%COMP%]:before{content:attr(data-label);content:attr(data-label) / "";color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[data-title][_ngcontent-%COMP%]{display:block;margin-bottom:4px;padding:0 0 6px;border-bottom:0;font-size:15px}table.ds-table[_ngcontent-%COMP%] td[data-title][_ngcontent-%COMP%]:before{display:none}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:4px;margin-top:6px;padding:10px 0 0;border-top:1px solid var(--color-divider);text-align:right}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%]:before{display:none}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%] .settings-table__actions[_ngcontent-%COMP%]{flex-wrap:wrap;width:100%;white-space:normal}table.ds-table[_ngcontent-%COMP%] td[data-actions][_ngcontent-%COMP%] button[_ngcontent-%COMP%]{min-width:44px;min-height:44px;padding:0 12px}}.settings-table__confirm-label[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:13px}.sr-only[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}']})};export{V as PlatformIntegrationConfigsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {e}from'./chunk-C6dIhkYp.js';import {O as O$1}from'./chunk-
|
|
1
|
+
import {e}from'./chunk-C6dIhkYp.js';import {O as O$1}from'./chunk-Vb2IMeLm.js';import {p,$ as $t,F as Me,d as ie,U,D as Df,z as za,r as r_,b as bf,h as hT,y as yb,a as pT,N as NT,I as Iv}from'./main-GRB5KOIR.js';import {C as Ci}from'./chunk-D1EGHCm3.js';import'./chunk-BtHSpru4.js';function S(a,e){a&1&&(za(0,"p",2),r_(1,"Loading integration\u2026"),bf());}function I(a,e){a&1&&(za(0,"p",3),r_(1,"Failed to load this integration configuration."),bf());}function O(a,e){a&1&&(za(0,"ds-tag",8),r_(1,"YAML"),bf(),za(2,"ds-tag",9),r_(3,"Read-only"),bf());}function b(a,e){if(a&1&&(za(0,"section",4)(1,"div",5)(2,"h2"),r_(3,"General"),bf(),hT(4,O,4,0),bf(),za(5,"dl")(6,"dt"),r_(7,"Name"),bf(),za(8,"dd"),r_(9),bf(),za(10,"dt"),r_(11,"Type"),bf(),za(12,"dd",6),r_(13),bf(),za(14,"dt"),r_(15,"Description"),bf(),za(16,"dd"),r_(17),bf(),za(18,"dt"),r_(19,"Scope"),bf(),za(20,"dd"),r_(21),bf(),za(22,"dt"),r_(23,"Source"),bf(),za(24,"dd"),r_(25),bf(),za(26,"dt"),r_(27,"Auto grant"),bf(),za(28,"dd"),r_(29),bf(),za(30,"dt"),r_(31,"Auth setting"),bf(),za(32,"dd"),r_(33),bf()()(),za(34,"section",4)(35,"h2"),r_(36,"Parameters"),bf(),za(37,"p",7),r_(38,"Sensitive values are always redacted."),bf(),za(39,"pre"),r_(40),bf()()),a&2){let o=e,r=NT();yb(4),pT(r.source()==="FILESYSTEM"?4:-1),yb(5),Iv(o.name),yb(4),Iv(o.integrationType),yb(4),Iv(o.description||"\u2014"),yb(4),Iv(r.scopeOf(o)),yb(4),Iv(r.source()),yb(4),Iv(o.autoGrant?"Enabled":"Disabled"),yb(4),Iv(o.authSettingName||"None"),yb(7),Iv(r.parameters());}}var h="\u2022\u2022\u2022\u2022\u2022\u2022",M=/(?:api[-_]?key|token|secret|password|passphrase|credential|private[-_]?key|client[-_]?secret|authorization|cookie)/i,E=class a{route=p($t);destroyRef=p(Me);state=p(O$1);integrationId=this.route.snapshot.params.integrationId;isLoading=ie(true);hasError=ie(false);config=ie(null);source=ie("NEO4J");parameters=ie("{}");ngOnInit(){this.state.getById(this.integrationId).pipe(U(this.destroyRef)).subscribe({next:e$1=>{this.config.set(e$1),this.source.set(e(e$1)),this.parameters.set(JSON.stringify(this.redact(e$1.parameters),null,2)),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}scopeOf(e){let o=e.userId?e.namespaceId?"userOnNs":"userGlobal":e.namespaceId?"namespace":"platform";return {platform:"Platform",namespace:"Namespace",userOnNs:"Personal on namespace",userGlobal:"Personal global"}[o]}redact(e,o=""){return M.test(o)?h:e===null||typeof e=="boolean"||typeof e=="number"?e:typeof e=="string"?this.containsCredential(e)?h:e:Array.isArray(e)?e.map(r=>this.redact(r,o)):typeof e=="object"?Object.fromEntries(Object.entries(e).map(([r,g])=>[r,this.redact(g,r)])):String(e??"")}containsCredential(e){return /^(?:bearer\s+|basic\s+|sk[-_]|gh[opusr]_|xox[baprs]-|-----begin (?:rsa |ec |openssh )?private key-----)/i.test(e.trim())}static \u0275fac=function(o){return new(o||a)};static \u0275cmp=Df({type:a,selectors:[["agentos-integration-config-view"]],decls:7,vars:1,consts:[[1,"integration-view"],[1,"integration-view__header"],["role","status",1,"integration-view__status"],[1,"integration-view__error"],[1,"integration-view__section"],[1,"integration-view__section-title"],[1,"integration-view__mono"],[1,"integration-view__hint"],["variant","neutral"],["variant","outline"]],template:function(o,r){if(o&1&&(za(0,"div",0)(1,"header",1)(2,"h1"),r_(3,"Integration configuration"),bf()(),hT(4,S,2,0,"p",2)(5,I,2,0,"p",3)(6,b,41,9),bf()),o&2){let g;yb(4),pT(r.isLoading()?4:r.hasError()?5:(g=r.config())?6:-1,g);}},dependencies:[Ci],styles:[".integration-view[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:24px;max-width:760px;margin:0 auto;padding:24px 8px}.integration-view__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.integration-view__header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0;color:var(--color-text);font-family:var(--font-heading);font-size:24px}.integration-view__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;padding:20px;border:1px solid var(--color-divider)}.integration-view__section-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.integration-view__section[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;color:var(--color-text);font-family:var(--font-heading);font-size:16px}.integration-view[_ngcontent-%COMP%] dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:8px 20px;margin:0}.integration-view[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:13px;font-weight:600}.integration-view[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0;color:var(--color-text);overflow-wrap:anywhere}.integration-view__mono[_ngcontent-%COMP%], .integration-view[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{font-family:monospace}.integration-view__hint[_ngcontent-%COMP%], .integration-view__status[_ngcontent-%COMP%]{margin:0;color:var(--color-text-secondary)}.integration-view__error[_ngcontent-%COMP%]{margin:0;color:var(--color-error)}.integration-view[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{max-height:440px;margin:0;padding:14px;overflow:auto;background:var(--color-bg-hover);color:var(--color-text);font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere}@media(max-width:600px){.integration-view[_ngcontent-%COMP%] dl[_ngcontent-%COMP%]{grid-template-columns:1fr;gap:4px}.integration-view[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin-bottom:8px}}"]})};export{E as IntegrationConfigViewComponent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {v}from'./chunk-CZ-gVBgG.js';import {R,q,J}from'./chunk-Df7mJsQ6.js';import {p,$ as $t,f as It,F as Me,d as ie,a2 as F,M as Mi,j as Sg,U,J as x,H as w,D as Df,z as za,K as dc,r as r_,b as bf,h as hT,y as yb,I as Iv,a as pT,k as bT,e as yT,a5 as mT,L as sS,l as lc,N as NT,O as tv,Q as cS,v as vT,A as Af,a4 as dT,o as ig,s as sg,m as WT,u as uc}from'./main-QSAMSEVG.js';import {v as vt,a as ve,$,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,c as bt,e as fn,L as Ln,W as Wn,b as pn,V as Vn}from'./chunk-Bz9ytfN0.js';import'./chunk-C0dQg7yj.js';function se(i,t){i&1&&(za(0,"p",5),r_(1,"Loading\u2026"),bf());}function ce(i,t){if(i&1&&(za(0,"label",23),lc(1,"input",24),sS(),za(2,"span"),r_(3),bf()()),i&2){let e=t.$implicit,o=NT(3);yb(),tv("formControl",o.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!o.isAdmin()),cS(),yb(2),Iv(e.label);}}function de(i,t){if(i&1&&(za(0,"fieldset",8)(1,"legend",22),r_(2,"Configuration scope"),bf(),yT(3,ce,4,4,"label",23,dT().trackByScope,true),bf()),i&2){let e=NT(2);tv("disabled",e.isEditMode()),yb(3),vT(e.scopeOptions);}}function ue(i,t){if(i&1&&(za(0,"option",13),r_(1),bf()),i&2){let e=t.$implicit,o=NT(2);tv("value",e),yb(),Iv(o.authTypeLabel[e]);}}function pe(i,t){i&1&&r_(0," Leave a field unchanged to keep the stored credential. ");}function he(i,t){i&1&&(za(0,"span",11),r_(1,"*"),bf());}function me(i,t){if(i&1&&(za(0,"p",28),r_(1),bf()),i&2){let e=NT(2).$implicit;tv("id","as-hint-"+e.key),yb(),Iv(e.hint);}}function ge(i,t){if(i&1&&(lc(0,"input",27),sS(),hT(1,me,2,2,"p",28)),i&2){let e=NT().$implicit;WT("auth-setting-form__input"+(e.secret?" auth-setting-form__input--secret":"")),tv("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),uc("aria-describedby",e.hint?"as-hint-"+e.key:null),cS(),yb(),pT(e.hint?1:-1);}}function Ce(i,t){if(i&1&&(za(0,"div",9)(1,"label",26),r_(2),hT(3,he,2,0,"span",11),bf(),hT(4,ge,2,9),bf()),i&2){let e,o=t.$implicit,l=NT(3);yb(),tv("for","as-cred-"+o.key),yb(),Af(" ",o.label," "),yb(),pT(o.required?3:-1),yb(),pT((e=l.controlForField(o.key))?4:-1,e);}}function fe(i,t){if(i&1&&(za(0,"fieldset",18)(1,"legend",22),r_(2,"Credentials"),bf(),za(3,"p",25),r_(4," Values are stored encrypted and masked on read. "),hT(5,pe,1,0),bf(),yT(6,Ce,5,4,"div",9,dT().trackByField,true),bf()),i&2){let e=NT(2);yb(5),pT(e.isEditMode()?5:-1),yb(),vT(e.credentialFields());}}function ye(i,t){if(i&1){let e=bT();za(0,"form",7),dc("ngSubmit",function(){ig(e);let l=NT();return sg(l.submit())}),hT(1,de,5,1,"fieldset",8),za(2,"div",9)(3,"label",10),r_(4,"Auth type "),za(5,"span",11),r_(6,"*"),bf()(),za(7,"select",12),yT(8,ue,2,2,"option",13,mT),bf(),sS(),bf(),za(10,"div",9)(11,"label",14),r_(12,"Name "),za(13,"span",11),r_(14,"*"),bf()(),lc(15,"input",15),sS(),bf(),za(16,"div",9)(17,"label",16),r_(18,"Description"),bf(),lc(19,"input",17),sS(),bf(),hT(20,fe,8,1,"fieldset",18),za(21,"div",19)(22,"button",20),r_(23),bf(),za(24,"button",21),dc("click",function(){ig(e);let l=NT();return sg(l.cancel())}),r_(25,"Cancel"),bf()()();}if(i&2){let e=NT();tv("formGroup",e.form),yb(),pT(e.isPlatformMode?-1:1),yb(6),tv("formControl",e.authTypeControl),cS(),yb(),vT(e.authTypeOptions),yb(7),tv("formControl",e.nameControl),cS(),yb(4),tv("formControl",e.descriptionControl),cS(),yb(),pT(e.credentialFields().length>0?20:-1),yb(2),tv("disabled",e.form.invalid||e.isSubmitting()),yb(),Af(" ",e.isEditMode()?"Save changes":"Create"," ");}}var _e=new Set(["namespace","userOnNs","userGlobal"]),P=Object.freeze({platform:"Platform (read-only)",namespace:"Namespace configuration",userOnNs:"Personal \u2014 this namespace only",userGlobal:"Personal \u2014 all namespaces"}),Se={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:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",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:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",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:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthMcpDiscoverableAuthSetting:[{key:"resourceUrl",label:"Resource URL",placeholder:"https://mcp.example.com",hint:"Use the base URL exactly as documented by your provider \u2014 do not append a path suffix. Examples: https://mcp.hubspot.com (HubSpot), https://mcp.atlassian.com/v1/mcp (Atlassian).",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",hint:"Leave empty to let the server register an OAuth client automatically (RFC 7591 dynamic registration). Fill in only if you have a pre-registered client ID from your provider.",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Leave empty in most cases \u2014 the MCP server declares the required scopes itself. Fill in only if your provider explicitly requires client-declared scopes.",secret:false,required:false}]},le=class i{route=p($t);router=p(It);destroyRef=p(Me);state=p(R);namespaceRole=p(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?ie(true):F(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});authTypeOptions=q;authTypeLabel=J;scopeOptions=[{value:"namespace",label:P.namespace},{value:"userOnNs",label:P.userOnNs},{value:"userGlobal",label:P.userGlobal}];nameControl=new vt("",{nonNullable:true,validators:[ve.required,ve.minLength(1)]});descriptionControl=new vt(null);authTypeControl=new vt("ApiKeyAuthSetting",{nonNullable:true,validators:[ve.required]});scopeControl=new vt("namespace",{nonNullable:true});form=new $({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new vt("",{nonNullable:true});usernameControl=new vt("",{nonNullable:true});passwordControl=new vt("",{nonNullable:true});tokenControl=new vt("",{nonNullable:true});discoveryUrlControl=new vt("",{nonNullable:true});authorizationUrlControl=new vt("",{nonNullable:true});tokenUrlControl=new vt("",{nonNullable:true});clientIdControl=new vt("",{nonNullable:true});clientSecretControl=new vt("",{nonNullable:true});scopesControl=new vt("",{nonNullable:true});resourceUrlControl=new vt("",{nonNullable:true});selectedAuthType=F(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=Mi(()=>Se[this.selectedAuthType()]);isEditMode=ie(false);isSubmitting=ie(false);isLoading=ie(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Sg(()=>{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,o=t.get("authSettingId");if(o){this.isEditMode.set(true),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(o);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let l=this.parseScope(e.get("scope"));this.scopeControl.setValue(l);let v=e.get("template");v&&this.hydrateFromTemplate(v);}parseScope(t){return t&&_e.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,o=e.username??"",l=e.password??"";this.usernameControl.setValue(o),this.passwordControl.setValue(l),this.initialCredentials.username=o,this.initialCredentials.password=l;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,o=this.authTypeControl.value,l=this.form.getRawValue().scope,v=this.isPlatformMode?null:this.namespaceId??null,w=this.buildTypedPayload(o,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,this.existingConfig):this.state.create(w,l,v)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}buildTypedPayload(t,e,o){let l={name:e,description:o};switch(t){case "ApiKeyAuthSetting":return x(w({},l),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case "BasicAuthAuthSetting":return x(w({},l),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case "BearerTokenAuthSetting":return x(w({},l),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case "OAuthDiscoverableAuthSetting":return x(w({},l),{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 x(w({},l),{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 x(w({},l),{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 x(w({},l),{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=Df({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","type","placeholder","formControl","autocomplete"],[1,"auth-setting-form__field-hint",3,"id"]],template:function(e,o){e&1&&(za(0,"div",0)(1,"header",1)(2,"button",2),dc("click",function(){return o.cancel()}),za(3,"span",3),r_(4,"\u2190"),bf(),r_(5," Auth Settings "),bf(),za(6,"h1",4),r_(7),bf()(),hT(8,se,2,0,"p",5)(9,ye,26,8,"form",6),bf()),e&2&&(yb(7),Iv(o.isEditMode()?"Edit auth setting":"New auth setting"),yb(),pT(o.isLoading()?8:9));},dependencies:[Kn,zn,Zn,Xn,Ye,bt,fn,Ln,Wn,pn,Vn],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__field-hint[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);margin:0;line-height:1.4}.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}from'./chunk-CU1TvHtl.js';import {R,q,J}from'./chunk-B8g-L-f4.js';import {p,$ as $t,f as It,F as Me,d as ie,a2 as F,M as Mi,j as Sg,U,J as x,H as w,D as Df,z as za,K as dc,r as r_,b as bf,h as hT,y as yb,I as Iv,a as pT,k as bT,e as yT,a5 as mT,L as sS,l as lc,N as NT,O as tv,Q as cS,v as vT,A as Af,a4 as dT,o as ig,s as sg,m as WT,u as uc}from'./main-GRB5KOIR.js';import {v as vt,a as ve,$,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,c as bt,e as fn,L as Ln,W as Wn,b as pn,V as Vn}from'./chunk-D1EGHCm3.js';import'./chunk-BtHSpru4.js';function se(i,t){i&1&&(za(0,"p",5),r_(1,"Loading\u2026"),bf());}function ce(i,t){if(i&1&&(za(0,"label",23),lc(1,"input",24),sS(),za(2,"span"),r_(3),bf()()),i&2){let e=t.$implicit,o=NT(3);yb(),tv("formControl",o.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!o.isAdmin()),cS(),yb(2),Iv(e.label);}}function de(i,t){if(i&1&&(za(0,"fieldset",8)(1,"legend",22),r_(2,"Configuration scope"),bf(),yT(3,ce,4,4,"label",23,dT().trackByScope,true),bf()),i&2){let e=NT(2);tv("disabled",e.isEditMode()),yb(3),vT(e.scopeOptions);}}function ue(i,t){if(i&1&&(za(0,"option",13),r_(1),bf()),i&2){let e=t.$implicit,o=NT(2);tv("value",e),yb(),Iv(o.authTypeLabel[e]);}}function pe(i,t){i&1&&r_(0," Leave a field unchanged to keep the stored credential. ");}function he(i,t){i&1&&(za(0,"span",11),r_(1,"*"),bf());}function me(i,t){if(i&1&&(za(0,"p",28),r_(1),bf()),i&2){let e=NT(2).$implicit;tv("id","as-hint-"+e.key),yb(),Iv(e.hint);}}function ge(i,t){if(i&1&&(lc(0,"input",27),sS(),hT(1,me,2,2,"p",28)),i&2){let e=NT().$implicit;WT("auth-setting-form__input"+(e.secret?" auth-setting-form__input--secret":"")),tv("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),uc("aria-describedby",e.hint?"as-hint-"+e.key:null),cS(),yb(),pT(e.hint?1:-1);}}function Ce(i,t){if(i&1&&(za(0,"div",9)(1,"label",26),r_(2),hT(3,he,2,0,"span",11),bf(),hT(4,ge,2,9),bf()),i&2){let e,o=t.$implicit,l=NT(3);yb(),tv("for","as-cred-"+o.key),yb(),Af(" ",o.label," "),yb(),pT(o.required?3:-1),yb(),pT((e=l.controlForField(o.key))?4:-1,e);}}function fe(i,t){if(i&1&&(za(0,"fieldset",18)(1,"legend",22),r_(2,"Credentials"),bf(),za(3,"p",25),r_(4," Values are stored encrypted and masked on read. "),hT(5,pe,1,0),bf(),yT(6,Ce,5,4,"div",9,dT().trackByField,true),bf()),i&2){let e=NT(2);yb(5),pT(e.isEditMode()?5:-1),yb(),vT(e.credentialFields());}}function ye(i,t){if(i&1){let e=bT();za(0,"form",7),dc("ngSubmit",function(){ig(e);let l=NT();return sg(l.submit())}),hT(1,de,5,1,"fieldset",8),za(2,"div",9)(3,"label",10),r_(4,"Auth type "),za(5,"span",11),r_(6,"*"),bf()(),za(7,"select",12),yT(8,ue,2,2,"option",13,mT),bf(),sS(),bf(),za(10,"div",9)(11,"label",14),r_(12,"Name "),za(13,"span",11),r_(14,"*"),bf()(),lc(15,"input",15),sS(),bf(),za(16,"div",9)(17,"label",16),r_(18,"Description"),bf(),lc(19,"input",17),sS(),bf(),hT(20,fe,8,1,"fieldset",18),za(21,"div",19)(22,"button",20),r_(23),bf(),za(24,"button",21),dc("click",function(){ig(e);let l=NT();return sg(l.cancel())}),r_(25,"Cancel"),bf()()();}if(i&2){let e=NT();tv("formGroup",e.form),yb(),pT(e.isPlatformMode?-1:1),yb(6),tv("formControl",e.authTypeControl),cS(),yb(),vT(e.authTypeOptions),yb(7),tv("formControl",e.nameControl),cS(),yb(4),tv("formControl",e.descriptionControl),cS(),yb(),pT(e.credentialFields().length>0?20:-1),yb(2),tv("disabled",e.form.invalid||e.isSubmitting()),yb(),Af(" ",e.isEditMode()?"Save changes":"Create"," ");}}var _e=new Set(["namespace","userOnNs","userGlobal"]),P=Object.freeze({platform:"Platform (read-only)",namespace:"Namespace configuration",userOnNs:"Personal \u2014 this namespace only",userGlobal:"Personal \u2014 all namespaces"}),Se={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:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",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:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",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:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthMcpDiscoverableAuthSetting:[{key:"resourceUrl",label:"Resource URL",placeholder:"https://mcp.example.com",hint:"Use the base URL exactly as documented by your provider \u2014 do not append a path suffix. Examples: https://mcp.hubspot.com (HubSpot), https://mcp.atlassian.com/v1/mcp (Atlassian).",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",hint:"Leave empty to let the server register an OAuth client automatically (RFC 7591 dynamic registration). Fill in only if you have a pre-registered client ID from your provider.",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Leave empty in most cases \u2014 the MCP server declares the required scopes itself. Fill in only if your provider explicitly requires client-declared scopes.",secret:false,required:false}]},le=class i{route=p($t);router=p(It);destroyRef=p(Me);state=p(R);namespaceRole=p(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?ie(true):F(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});authTypeOptions=q;authTypeLabel=J;scopeOptions=[{value:"namespace",label:P.namespace},{value:"userOnNs",label:P.userOnNs},{value:"userGlobal",label:P.userGlobal}];nameControl=new vt("",{nonNullable:true,validators:[ve.required,ve.minLength(1)]});descriptionControl=new vt(null);authTypeControl=new vt("ApiKeyAuthSetting",{nonNullable:true,validators:[ve.required]});scopeControl=new vt("namespace",{nonNullable:true});form=new $({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new vt("",{nonNullable:true});usernameControl=new vt("",{nonNullable:true});passwordControl=new vt("",{nonNullable:true});tokenControl=new vt("",{nonNullable:true});discoveryUrlControl=new vt("",{nonNullable:true});authorizationUrlControl=new vt("",{nonNullable:true});tokenUrlControl=new vt("",{nonNullable:true});clientIdControl=new vt("",{nonNullable:true});clientSecretControl=new vt("",{nonNullable:true});scopesControl=new vt("",{nonNullable:true});resourceUrlControl=new vt("",{nonNullable:true});selectedAuthType=F(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=Mi(()=>Se[this.selectedAuthType()]);isEditMode=ie(false);isSubmitting=ie(false);isLoading=ie(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Sg(()=>{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,o=t.get("authSettingId");if(o){this.isEditMode.set(true),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(o);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let l=this.parseScope(e.get("scope"));this.scopeControl.setValue(l);let v=e.get("template");v&&this.hydrateFromTemplate(v);}parseScope(t){return t&&_e.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,o=e.username??"",l=e.password??"";this.usernameControl.setValue(o),this.passwordControl.setValue(l),this.initialCredentials.username=o,this.initialCredentials.password=l;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,o=this.authTypeControl.value,l=this.form.getRawValue().scope,v=this.isPlatformMode?null:this.namespaceId??null,w=this.buildTypedPayload(o,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,this.existingConfig):this.state.create(w,l,v)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}buildTypedPayload(t,e,o){let l={name:e,description:o};switch(t){case "ApiKeyAuthSetting":return x(w({},l),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case "BasicAuthAuthSetting":return x(w({},l),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case "BearerTokenAuthSetting":return x(w({},l),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case "OAuthDiscoverableAuthSetting":return x(w({},l),{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 x(w({},l),{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 x(w({},l),{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 x(w({},l),{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=Df({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","type","placeholder","formControl","autocomplete"],[1,"auth-setting-form__field-hint",3,"id"]],template:function(e,o){e&1&&(za(0,"div",0)(1,"header",1)(2,"button",2),dc("click",function(){return o.cancel()}),za(3,"span",3),r_(4,"\u2190"),bf(),r_(5," Auth Settings "),bf(),za(6,"h1",4),r_(7),bf()(),hT(8,se,2,0,"p",5)(9,ye,26,8,"form",6),bf()),e&2&&(yb(7),Iv(o.isEditMode()?"Edit auth setting":"New auth setting"),yb(),pT(o.isLoading()?8:9));},dependencies:[Kn,zn,Zn,Xn,Ye,bt,fn,Ln,Wn,pn,Vn],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__field-hint[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);margin:0;line-height:1.4}.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{le as AuthSettingFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {v}from'./chunk-CZ-gVBgG.js';import {R}from'./chunk-Df7mJsQ6.js';import {O}from'./chunk-DyPx2k7Y.js';import {p,$ as $t,f as It,F as Me,a1 as W,a2 as F,a3 as _,d as ie,M as Mi,j as Sg,U,D as Df,z as za,r as r_,b as bf,h as hT,y as yb,I as Iv,a as pT,k as bT,K as dc,e as yT,a4 as dT,L as sS,l as lc,a5 as mT,N as NT,O as tv,v as vT,Q as cS,A as Af,o as ig,s as sg}from'./main-QSAMSEVG.js';import {$,v as vt,a as ve,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,F as Ft,c as bt,e as fn,L as Ln,W as Wn,b as pn,V as Vn,g as St}from'./chunk-Bz9ytfN0.js';import'./chunk-C0dQg7yj.js';function le(i,t){i&1&&(za(0,"p",3),r_(1,"Loading\u2026"),bf());}function se(i,t){if(i&1&&(za(0,"label",8),lc(1,"input",27),sS(),za(2,"span"),r_(3),bf()()),i&2){let e=t.$implicit,n=NT(2);yb(),tv("value",e.value)("formControl",n.scopeControl)("disabled",e.value==="namespace"&&!n.isAdmin()),cS(),yb(2),Iv(e.label);}}function ce(i,t){if(i&1&&(za(0,"option",14),r_(1),bf()),i&2){let e=t.$implicit;tv("value",e.type),yb(),Iv(e.displayName);}}function me(i,t){if(i&1&&(za(0,"option",14),r_(1),bf()),i&2){let e=t.$implicit;tv("value",e),yb(),Iv(e);}}function pe(i,t){if(i&1&&(za(0,"div",9)(1,"label",28),lc(2,"input",29),sS(),za(3,"span",7),r_(4,"Grant automatically"),bf()(),za(5,"p",30),r_(6),bf()()),i&2){let e=NT(2);yb(2),tv("formControl",e.autoGrantControl),cS(),yb(4),Af(" Give this integration to ",e.autoGrantReach(),", without each agent having to declare it. An agent can still opt out by mapping this configuration to an empty tool list. ");}}function de(i,t){if(i&1){let e=bT();za(0,"div",22)(1,"ds-json-schema-form",31),dc("valueChange",function(s){ig(e);let m=NT(2);return sg(m.onParamsChange(s))}),bf()();}if(i&2){let e=NT(2);yb(),tv("schema",t)("value",e.initialParams());}}function ge(i,t){if(i&1){let e=bT();za(0,"button",32),dc("click",function(){ig(e);let s=NT(2);return sg(s.exportYaml())}),r_(1),bf();}if(i&2){let e=NT(2);tv("disabled",e.isExporting()),yb(),Af(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function ue(i,t){if(i&1){let e=bT();za(0,"form",5),dc("ngSubmit",function(){ig(e);let s=NT();return sg(s.submit())}),za(1,"fieldset",6)(2,"legend",7),r_(3,"Scope"),bf(),yT(4,se,4,4,"label",8,dT().trackByScope,true),bf(),za(6,"div",9)(7,"label",10),r_(8,"Type "),za(9,"span",11),r_(10,"*"),bf()(),za(11,"select",12)(12,"option",13),r_(13,"Select type"),bf(),yT(14,ce,2,2,"option",14,dT().trackByType,true),bf(),sS(),bf(),za(16,"div",9)(17,"label",15),r_(18,"Name "),za(19,"span",11),r_(20,"*"),bf()(),lc(21,"input",16),sS(),bf(),za(22,"div",9)(23,"label",17),r_(24,"Description"),bf(),lc(25,"textarea",18),sS(),bf(),za(26,"div",9)(27,"label",19),r_(28,"Auth Setting"),bf(),za(29,"select",20)(30,"option",21),r_(31,"None"),bf(),yT(32,me,2,2,"option",14,mT),bf(),sS(),bf(),hT(34,pe,7,2,"div",9),hT(35,de,2,2,"div",22),za(36,"div",23)(37,"button",24),r_(38),bf(),hT(39,ge,2,2,"button",25),za(40,"button",26),dc("click",function(){ig(e);let s=NT();return sg(s.cancel())}),r_(41,"Cancel"),bf()()();}if(i&2){let e,n=NT();tv("formGroup",n.form),yb(),tv("disabled",n.isEditMode()),yb(3),vT(n.scopeOptions),yb(7),tv("formControl",n.typeControl),cS(),yb(3),vT(n.integrationTypes()),yb(7),tv("formControl",n.nameControl),cS(),yb(4),tv("formControl",n.descriptionControl),cS(),yb(4),tv("formControl",n.authSettingNameControl),cS(),yb(),tv("ngValue",null),yb(2),vT(n.availableAuthSettings()),yb(2),pT(n.isAutoGrantable()?34:-1),yb(),pT((e=n.schema())?35:-1,e),yb(2),tv("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),yb(),Af(" ",n.isEditMode()?"Save changes":"Create"," "),yb(),pT(n.isEditMode()?39:-1);}}var fe=new Set(["platform","namespace","userOnNs","userGlobal"]),T=Object.freeze({platform:"Configuration plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),re=class i{route=p($t);router=p(It);destroyRef=p(Me);state=p(O);integrationTypeController=p(W);authSettingState=p(R);namespaceRole=p(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=F(this.isPlatformMode?_(true):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new $({name:new vt("",{nonNullable:true,validators:[ve.required,ve.minLength(1)]}),description:new vt(null),type:new vt("",{nonNullable:true,validators:[ve.required]}),scope:new vt("namespace",{nonNullable:true}),autoGrant:new vt(false,{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}get autoGrantControl(){return this.form.controls.autoGrant}isEditMode=ie(false);isSubmitting=ie(false);isLoading=ie(false);isExporting=ie(false);scopeOptions=[{value:"platform",label:T.platform},{value:"namespace",label:T.namespace},{value:"userOnNs",label:T.userOnNs},{value:"userGlobal",label:T.userGlobal}];authSettingNameControl=new vt(null);availableAuthSettings=ie([]);paramsValue=ie(null);initialParams=ie(null);integrationTypes=F(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=F(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});scopeValue=F(this.form.controls.scope.valueChanges,{initialValue:this.form.controls.scope.value});schema=Mi(()=>{let t=this.selectedType();return t?this.integrationTypes().find(n=>n.type===t)?.configSchema??null:null});isAutoGrantable=Mi(()=>{let t=this.selectedType();return t?this.integrationTypes().find(e=>e.type===t)?.autoGrantable??false:false});autoGrantReach=Mi(()=>{switch(this.scopeValue()){case "platform":return "every agent of this environment";case "namespace":return "every agent of this namespace";default:return "your own runs"}});existingConfig=null;constructor(){Sg(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&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("integrationId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable(),this.loadAuthSettingsForScope("platform");return}let s=this.parseScope(e.get("scope"));this.scopeControl.setValue(s),this.loadAuthSettingsForScope(s),this.scopeControl.valueChanges.pipe(U(this.destroyRef)).subscribe(ae=>{this.loadAuthSettingsForScope(ae);});let m=e.get("template");m&&this.hydrateFromTemplate(m);}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;let n=this.deriveScopeFromConfig(e);this.scopeControl.setValue(n),this.applyConfigToForm(e),this.loadAuthSettingsForScope(n),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[IntegrationForm] Could not load config '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.applyConfigToForm(e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[IntegrationForm] 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){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.typeControl.setValue(t.integrationType),this.initialParams.set(t.parameters),this.paramsValue.set(t.parameters),this.authSettingNameControl.setValue(t.authSettingName??null),this.autoGrantControl.setValue(t.autoGrant??false);}loadAuthSettingsForScope(t){let e;switch(t){case "platform":e=this.authSettingState.loadPlatformSettings();break;case "namespace":e=this.authSettingState.loadNamespaceSettings(this.namespaceId);break;case "userOnNs":e=this.authSettingState.loadUserSettings(this.namespaceId);break;case "userGlobal":e=this.authSettingState.loadUserSettings("global");break}e.pipe(U(this.destroyRef)).subscribe({next:n=>{let s=n.map(m=>m.name).filter(Boolean);this.availableAuthSettings.set([...new Set(s)]);},error:()=>this.availableAuthSettings.set([])});}onParamsChange(t){this.paramsValue.set(t);}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.descriptionControl.value?.trim(),e={name:this.nameControl.value.trim(),description:t||null,integrationType:this.typeControl.value,parameters:this.paramsValue(),authSettingName:this.authSettingNameControl.value||null,autoGrant:this.isAutoGrantable()&&this.autoGrantControl.value},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,e,n,this.existingConfig):this.state.create(e,n,this.namespaceId??null)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.state.exportAsYaml(t).pipe(U(this.destroyRef)).subscribe({next:e=>{let n=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(n),m=document.createElement("a");m.href=s,m.download=`${this.existingConfig?.name??"integration"}.yaml`,m.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"]);}trackByType(t,e){return e.type}trackByScope(t,e){return e.value}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Df({type:i,selectors:[["agentos-integration-form"]],decls:6,vars:2,consts:[[1,"integration-form"],[1,"integration-form__header"],[1,"integration-form__title"],[1,"integration-form__loading"],[1,"integration-form__form",3,"formGroup"],[1,"integration-form__form",3,"ngSubmit","formGroup"],[1,"integration-form__field","integration-form__scope",3,"disabled"],[1,"integration-form__label"],[1,"integration-form__scope-option"],[1,"integration-form__field"],["for","integration-type",1,"integration-form__label"],["aria-hidden","true"],["id","integration-type",1,"integration-form__select",3,"formControl"],["value","","disabled",""],[3,"value"],["for","integration-name",1,"integration-form__label"],["id","integration-name","type","text","placeholder","Integration name","autocomplete","off",1,"integration-form__input",3,"formControl"],["for","integration-description",1,"integration-form__label"],["id","integration-description","placeholder","Optional description","rows","3",1,"integration-form__textarea",3,"formControl"],["for","integration-auth-setting",1,"integration-form__label"],["id","integration-auth-setting",1,"integration-form__select",3,"formControl"],[3,"ngValue"],[1,"integration-form__schema-form"],[1,"integration-form__actions"],["type","submit",1,"integration-form__btn","integration-form__btn--primary",3,"disabled"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"disabled"],["type","button",1,"integration-form__btn",3,"click"],["type","radio",3,"value","formControl","disabled"],[1,"integration-form__checkbox-row"],["type","checkbox",3,"formControl"],[1,"integration-form__hint"],[3,"valueChange","schema","value"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"click","disabled"]],template:function(e,n){e&1&&(za(0,"div",0)(1,"header",1)(2,"h1",2),r_(3),bf()(),hT(4,le,2,0,"p",3)(5,ue,42,12,"form",4),bf()),e&2&&(yb(3),Iv(n.isEditMode()?"Edit integration":"New integration"),yb(),pT(n.isLoading()?4:5));},dependencies:[Kn,zn,Zn,Xn,Ye,Ft,bt,fn,Ln,Wn,pn,Vn,St],styles:[".integration-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.integration-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.integration-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.integration-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.integration-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.integration-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-divider);border-radius:0;padding:.75rem 1rem;background:transparent;margin:0}.integration-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.integration-form__scope-option[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--color-text);cursor:pointer}.integration-form__scope-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin:0}.integration-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.integration-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.integration-form__input[_ngcontent-%COMP%], .integration-form__textarea[_ngcontent-%COMP%], .integration-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.integration-form__input[_ngcontent-%COMP%]:focus, .integration-form__textarea[_ngcontent-%COMP%]:focus, .integration-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.integration-form__input[_ngcontent-%COMP%]::placeholder, .integration-form__textarea[_ngcontent-%COMP%]::placeholder, .integration-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.integration-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:4.5rem;line-height:1.5}.integration-form__select[_ngcontent-%COMP%]{cursor:pointer}.integration-form__select[_ngcontent-%COMP%] option[disabled][_ngcontent-%COMP%]{color:var(--color-text-secondary)}.integration-form__checkbox-row[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;cursor:pointer}.integration-form__checkbox-row[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{margin:0}.integration-form__hint[_ngcontent-%COMP%]{margin:0;font-size:.8125rem;line-height:1.4;color:var(--color-text-secondary)}.integration-form__schema-form[_ngcontent-%COMP%]{padding:1rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface)}.integration-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.integration-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.integration-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.integration-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.integration-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.integration-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}.integration-form__btn--export[_ngcontent-%COMP%]{border-color:var(--color-divider);color:var(--color-text-secondary)}.integration-form__btn--export[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--color-accent);color:var(--color-accent)}"]})};export{re as IntegrationFormComponent};
|
|
1
|
+
import {v}from'./chunk-CU1TvHtl.js';import {R}from'./chunk-B8g-L-f4.js';import {O}from'./chunk-Vb2IMeLm.js';import {p,$ as $t,f as It,F as Me,a1 as W,a2 as F,a3 as _,d as ie,M as Mi,j as Sg,U,D as Df,z as za,r as r_,b as bf,h as hT,y as yb,I as Iv,a as pT,k as bT,K as dc,e as yT,a4 as dT,L as sS,l as lc,a5 as mT,N as NT,O as tv,v as vT,Q as cS,A as Af,o as ig,s as sg}from'./main-GRB5KOIR.js';import {$,v as vt,a as ve,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,F as Ft,c as bt,e as fn,L as Ln,W as Wn,b as pn,V as Vn,g as St}from'./chunk-D1EGHCm3.js';import'./chunk-BtHSpru4.js';function le(i,t){i&1&&(za(0,"p",3),r_(1,"Loading\u2026"),bf());}function se(i,t){if(i&1&&(za(0,"label",8),lc(1,"input",27),sS(),za(2,"span"),r_(3),bf()()),i&2){let e=t.$implicit,n=NT(2);yb(),tv("value",e.value)("formControl",n.scopeControl)("disabled",e.value==="namespace"&&!n.isAdmin()),cS(),yb(2),Iv(e.label);}}function ce(i,t){if(i&1&&(za(0,"option",14),r_(1),bf()),i&2){let e=t.$implicit;tv("value",e.type),yb(),Iv(e.displayName);}}function me(i,t){if(i&1&&(za(0,"option",14),r_(1),bf()),i&2){let e=t.$implicit;tv("value",e),yb(),Iv(e);}}function pe(i,t){if(i&1&&(za(0,"div",9)(1,"label",28),lc(2,"input",29),sS(),za(3,"span",7),r_(4,"Grant automatically"),bf()(),za(5,"p",30),r_(6),bf()()),i&2){let e=NT(2);yb(2),tv("formControl",e.autoGrantControl),cS(),yb(4),Af(" Give this integration to ",e.autoGrantReach(),", without each agent having to declare it. An agent can still opt out by mapping this configuration to an empty tool list. ");}}function de(i,t){if(i&1){let e=bT();za(0,"div",22)(1,"ds-json-schema-form",31),dc("valueChange",function(s){ig(e);let m=NT(2);return sg(m.onParamsChange(s))}),bf()();}if(i&2){let e=NT(2);yb(),tv("schema",t)("value",e.initialParams());}}function ge(i,t){if(i&1){let e=bT();za(0,"button",32),dc("click",function(){ig(e);let s=NT(2);return sg(s.exportYaml())}),r_(1),bf();}if(i&2){let e=NT(2);tv("disabled",e.isExporting()),yb(),Af(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function ue(i,t){if(i&1){let e=bT();za(0,"form",5),dc("ngSubmit",function(){ig(e);let s=NT();return sg(s.submit())}),za(1,"fieldset",6)(2,"legend",7),r_(3,"Scope"),bf(),yT(4,se,4,4,"label",8,dT().trackByScope,true),bf(),za(6,"div",9)(7,"label",10),r_(8,"Type "),za(9,"span",11),r_(10,"*"),bf()(),za(11,"select",12)(12,"option",13),r_(13,"Select type"),bf(),yT(14,ce,2,2,"option",14,dT().trackByType,true),bf(),sS(),bf(),za(16,"div",9)(17,"label",15),r_(18,"Name "),za(19,"span",11),r_(20,"*"),bf()(),lc(21,"input",16),sS(),bf(),za(22,"div",9)(23,"label",17),r_(24,"Description"),bf(),lc(25,"textarea",18),sS(),bf(),za(26,"div",9)(27,"label",19),r_(28,"Auth Setting"),bf(),za(29,"select",20)(30,"option",21),r_(31,"None"),bf(),yT(32,me,2,2,"option",14,mT),bf(),sS(),bf(),hT(34,pe,7,2,"div",9),hT(35,de,2,2,"div",22),za(36,"div",23)(37,"button",24),r_(38),bf(),hT(39,ge,2,2,"button",25),za(40,"button",26),dc("click",function(){ig(e);let s=NT();return sg(s.cancel())}),r_(41,"Cancel"),bf()()();}if(i&2){let e,n=NT();tv("formGroup",n.form),yb(),tv("disabled",n.isEditMode()),yb(3),vT(n.scopeOptions),yb(7),tv("formControl",n.typeControl),cS(),yb(3),vT(n.integrationTypes()),yb(7),tv("formControl",n.nameControl),cS(),yb(4),tv("formControl",n.descriptionControl),cS(),yb(4),tv("formControl",n.authSettingNameControl),cS(),yb(),tv("ngValue",null),yb(2),vT(n.availableAuthSettings()),yb(2),pT(n.isAutoGrantable()?34:-1),yb(),pT((e=n.schema())?35:-1,e),yb(2),tv("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),yb(),Af(" ",n.isEditMode()?"Save changes":"Create"," "),yb(),pT(n.isEditMode()?39:-1);}}var fe=new Set(["platform","namespace","userOnNs","userGlobal"]),T=Object.freeze({platform:"Configuration plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),re=class i{route=p($t);router=p(It);destroyRef=p(Me);state=p(O);integrationTypeController=p(W);authSettingState=p(R);namespaceRole=p(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=F(this.isPlatformMode?_(true):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new $({name:new vt("",{nonNullable:true,validators:[ve.required,ve.minLength(1)]}),description:new vt(null),type:new vt("",{nonNullable:true,validators:[ve.required]}),scope:new vt("namespace",{nonNullable:true}),autoGrant:new vt(false,{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}get autoGrantControl(){return this.form.controls.autoGrant}isEditMode=ie(false);isSubmitting=ie(false);isLoading=ie(false);isExporting=ie(false);scopeOptions=[{value:"platform",label:T.platform},{value:"namespace",label:T.namespace},{value:"userOnNs",label:T.userOnNs},{value:"userGlobal",label:T.userGlobal}];authSettingNameControl=new vt(null);availableAuthSettings=ie([]);paramsValue=ie(null);initialParams=ie(null);integrationTypes=F(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=F(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});scopeValue=F(this.form.controls.scope.valueChanges,{initialValue:this.form.controls.scope.value});schema=Mi(()=>{let t=this.selectedType();return t?this.integrationTypes().find(n=>n.type===t)?.configSchema??null:null});isAutoGrantable=Mi(()=>{let t=this.selectedType();return t?this.integrationTypes().find(e=>e.type===t)?.autoGrantable??false:false});autoGrantReach=Mi(()=>{switch(this.scopeValue()){case "platform":return "every agent of this environment";case "namespace":return "every agent of this namespace";default:return "your own runs"}});existingConfig=null;constructor(){Sg(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&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("integrationId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable(),this.loadAuthSettingsForScope("platform");return}let s=this.parseScope(e.get("scope"));this.scopeControl.setValue(s),this.loadAuthSettingsForScope(s),this.scopeControl.valueChanges.pipe(U(this.destroyRef)).subscribe(ae=>{this.loadAuthSettingsForScope(ae);});let m=e.get("template");m&&this.hydrateFromTemplate(m);}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;let n=this.deriveScopeFromConfig(e);this.scopeControl.setValue(n),this.applyConfigToForm(e),this.loadAuthSettingsForScope(n),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[IntegrationForm] Could not load config '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.applyConfigToForm(e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[IntegrationForm] 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){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.typeControl.setValue(t.integrationType),this.initialParams.set(t.parameters),this.paramsValue.set(t.parameters),this.authSettingNameControl.setValue(t.authSettingName??null),this.autoGrantControl.setValue(t.autoGrant??false);}loadAuthSettingsForScope(t){let e;switch(t){case "platform":e=this.authSettingState.loadPlatformSettings();break;case "namespace":e=this.authSettingState.loadNamespaceSettings(this.namespaceId);break;case "userOnNs":e=this.authSettingState.loadUserSettings(this.namespaceId);break;case "userGlobal":e=this.authSettingState.loadUserSettings("global");break}e.pipe(U(this.destroyRef)).subscribe({next:n=>{let s=n.map(m=>m.name).filter(Boolean);this.availableAuthSettings.set([...new Set(s)]);},error:()=>this.availableAuthSettings.set([])});}onParamsChange(t){this.paramsValue.set(t);}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.descriptionControl.value?.trim(),e={name:this.nameControl.value.trim(),description:t||null,integrationType:this.typeControl.value,parameters:this.paramsValue(),authSettingName:this.authSettingNameControl.value||null,autoGrant:this.isAutoGrantable()&&this.autoGrantControl.value},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,e,n,this.existingConfig):this.state.create(e,n,this.namespaceId??null)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.state.exportAsYaml(t).pipe(U(this.destroyRef)).subscribe({next:e=>{let n=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(n),m=document.createElement("a");m.href=s,m.download=`${this.existingConfig?.name??"integration"}.yaml`,m.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"]);}trackByType(t,e){return e.type}trackByScope(t,e){return e.value}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Df({type:i,selectors:[["agentos-integration-form"]],decls:6,vars:2,consts:[[1,"integration-form"],[1,"integration-form__header"],[1,"integration-form__title"],[1,"integration-form__loading"],[1,"integration-form__form",3,"formGroup"],[1,"integration-form__form",3,"ngSubmit","formGroup"],[1,"integration-form__field","integration-form__scope",3,"disabled"],[1,"integration-form__label"],[1,"integration-form__scope-option"],[1,"integration-form__field"],["for","integration-type",1,"integration-form__label"],["aria-hidden","true"],["id","integration-type",1,"integration-form__select",3,"formControl"],["value","","disabled",""],[3,"value"],["for","integration-name",1,"integration-form__label"],["id","integration-name","type","text","placeholder","Integration name","autocomplete","off",1,"integration-form__input",3,"formControl"],["for","integration-description",1,"integration-form__label"],["id","integration-description","placeholder","Optional description","rows","3",1,"integration-form__textarea",3,"formControl"],["for","integration-auth-setting",1,"integration-form__label"],["id","integration-auth-setting",1,"integration-form__select",3,"formControl"],[3,"ngValue"],[1,"integration-form__schema-form"],[1,"integration-form__actions"],["type","submit",1,"integration-form__btn","integration-form__btn--primary",3,"disabled"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"disabled"],["type","button",1,"integration-form__btn",3,"click"],["type","radio",3,"value","formControl","disabled"],[1,"integration-form__checkbox-row"],["type","checkbox",3,"formControl"],[1,"integration-form__hint"],[3,"valueChange","schema","value"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"click","disabled"]],template:function(e,n){e&1&&(za(0,"div",0)(1,"header",1)(2,"h1",2),r_(3),bf()(),hT(4,le,2,0,"p",3)(5,ue,42,12,"form",4),bf()),e&2&&(yb(3),Iv(n.isEditMode()?"Edit integration":"New integration"),yb(),pT(n.isLoading()?4:5));},dependencies:[Kn,zn,Zn,Xn,Ye,Ft,bt,fn,Ln,Wn,pn,Vn,St],styles:[".integration-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.integration-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.integration-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.integration-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.integration-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.integration-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-divider);border-radius:0;padding:.75rem 1rem;background:transparent;margin:0}.integration-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.integration-form__scope-option[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--color-text);cursor:pointer}.integration-form__scope-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin:0}.integration-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.integration-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.integration-form__input[_ngcontent-%COMP%], .integration-form__textarea[_ngcontent-%COMP%], .integration-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.integration-form__input[_ngcontent-%COMP%]:focus, .integration-form__textarea[_ngcontent-%COMP%]:focus, .integration-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.integration-form__input[_ngcontent-%COMP%]::placeholder, .integration-form__textarea[_ngcontent-%COMP%]::placeholder, .integration-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.integration-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:4.5rem;line-height:1.5}.integration-form__select[_ngcontent-%COMP%]{cursor:pointer}.integration-form__select[_ngcontent-%COMP%] option[disabled][_ngcontent-%COMP%]{color:var(--color-text-secondary)}.integration-form__checkbox-row[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;cursor:pointer}.integration-form__checkbox-row[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{margin:0}.integration-form__hint[_ngcontent-%COMP%]{margin:0;font-size:.8125rem;line-height:1.4;color:var(--color-text-secondary)}.integration-form__schema-form[_ngcontent-%COMP%]{padding:1rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface)}.integration-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.integration-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.integration-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.integration-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.integration-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.integration-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}.integration-form__btn--export[_ngcontent-%COMP%]{border-color:var(--color-divider);color:var(--color-text-secondary)}.integration-form__btn--export[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--color-accent);color:var(--color-accent)}"]})};export{re as IntegrationFormComponent};
|