@whoz-oss/coday-client 0.0.0-workstream-forge.93 → 0.0.0-workstream-forge.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/browser/{chunk-yQF1M2wb.js → chunk-9Na9wjEm.js} +1 -1
  2. package/browser/{chunk-GhpKMDaK.js → chunk-AB90cbB_.js} +1 -1
  3. package/browser/{chunk-g-xyqEqQ.js → chunk-B-fXjnGz.js} +1 -1
  4. package/browser/{chunk-BLyVCNMG.js → chunk-B7-BsDPf.js} +1 -1
  5. package/browser/{chunk-CIabQB0K.js → chunk-B7sy8z4M.js} +1 -1
  6. package/browser/{chunk-D4LcV5HQ.js → chunk-B9NACwUM.js} +1 -1
  7. package/browser/{chunk-BI52yvMl.js → chunk-B9bBPCOE.js} +1 -1
  8. package/browser/{chunk-CQ_FY7Nm.js → chunk-BAGLvfTc.js} +1 -1
  9. package/browser/{chunk-C1XFfqoT.js → chunk-BBgiMYAx.js} +1 -1
  10. package/browser/{chunk-D2rCay4H.js → chunk-BDPQgAAh.js} +1 -1
  11. package/browser/{chunk-CaZI6OEa.js → chunk-BJLKDKZZ.js} +1 -1
  12. package/browser/{chunk-CknzYxoU.js → chunk-BMUzpXmO.js} +1 -1
  13. package/browser/{chunk-DNkYFPsD.js → chunk-BYz2GJqY.js} +1 -1
  14. package/browser/{chunk-BVCyS-so.js → chunk-BbkpDuKm.js} +1 -1
  15. package/browser/{chunk-BZweLJbi.js → chunk-Bbxz2alX.js} +1 -1
  16. package/browser/{chunk-CSXW8eI5.js → chunk-BgIYpV8F.js} +1 -1
  17. package/browser/{chunk-B1TvJscy.js → chunk-BhUi8VTd.js} +1 -1
  18. package/browser/{chunk-CHPGjyfP.js → chunk-BhsX6u7d.js} +1 -1
  19. package/browser/{chunk-C59hhV25.js → chunk-BmcMTmtD.js} +1 -1
  20. package/browser/{chunk-DYIClc3-.js → chunk-BsG3PR--.js} +1 -1
  21. package/browser/{chunk-C-YiRSlK.js → chunk-BuCqp2zT.js} +1 -1
  22. package/browser/{chunk-rHBsGEuM.js → chunk-BvEhsGlp.js} +1 -1
  23. package/browser/{chunk-XBhSA1N4.js → chunk-C-3vHP5P.js} +1 -1
  24. package/browser/{chunk-D-WtqIw8.js → chunk-C1PnQMtv.js} +1 -1
  25. package/browser/{chunk-mPI6bYEV.js → chunk-C2_EBwWe.js} +1 -1
  26. package/browser/{chunk-BSzQsiO6.js → chunk-C3Sgc5rR.js} +1 -1
  27. package/browser/{chunk-CFkYuI2I.js → chunk-C9sVqRdl.js} +1 -1
  28. package/browser/{chunk-BQ1ZxVtl.js → chunk-CMF1Mk9-.js} +1 -1
  29. package/browser/{chunk-CjaubGFJ.js → chunk-CPWl0V02.js} +1 -1
  30. package/browser/{chunk-Boj1gYcQ.js → chunk-CPfRkt67.js} +1 -1
  31. package/browser/{chunk-Dv9t6ngX.js → chunk-CSDBfCII.js} +1 -1
  32. package/browser/{chunk-493leBy2.js → chunk-CX5D6OMW.js} +1 -1
  33. package/browser/{chunk-BI06wG8D.js → chunk-Cbvrb66H.js} +1 -1
  34. package/browser/{chunk-CwmsJkMM.js → chunk-CcfHhZEc.js} +1 -1
  35. package/browser/{chunk-D0rNl8bG.js → chunk-Cd2wDBwK.js} +1 -1
  36. package/browser/chunk-CigBS2kT.js +11 -0
  37. package/browser/{chunk-AqmhRsNI.js → chunk-CmC0cVBl.js} +1 -1
  38. package/browser/{chunk-D88hl6XI.js → chunk-CnOd7CqJ.js} +1 -1
  39. package/browser/{chunk-CDlB_MgW.js → chunk-CtPtPfVh.js} +1 -1
  40. package/browser/{chunk-CuY4DpEy.js → chunk-CxSFWP2r.js} +1 -1
  41. package/browser/{chunk-DM-taP0T.js → chunk-D-l8Hr5w.js} +1 -1
  42. package/browser/{chunk-nTJ-vUJP.js → chunk-D22tCCQt.js} +1 -1
  43. package/browser/{chunk-AcmfVMLq.js → chunk-D3d5Wakn.js} +1 -1
  44. package/browser/{chunk-BPR1B3ya.js → chunk-D6D0Z7ht.js} +1 -1
  45. package/browser/{chunk-CEcYVC8L.js → chunk-D84a_Xjq.js} +1 -1
  46. package/browser/{chunk-r4DIGFGA.js → chunk-DCpiwt2H.js} +1 -1
  47. package/browser/{chunk-CQ66t_XC.js → chunk-DGq9evlM.js} +1 -1
  48. package/browser/{chunk-CwVNlz2-.js → chunk-DL5nsVeX.js} +1 -1
  49. package/browser/{chunk--VmBz6Cf.js → chunk-DOy5wwe3.js} +1 -1
  50. package/browser/{chunk-DuMRNwed.js → chunk-DPXq5z3x.js} +1 -1
  51. package/browser/{chunk-D4pRabsj.js → chunk-DZ-pYFnN.js} +1 -1
  52. package/browser/{chunk-BUpwEWqw.js → chunk-DZdAT-59.js} +1 -1
  53. package/browser/{chunk-CGtfhng3.js → chunk-Da3C0oKy.js} +1 -1
  54. package/browser/{chunk-CBTAHjIq.js → chunk-DhTfuwxD.js} +1 -1
  55. package/browser/{chunk-CS5IaoWg.js → chunk-DjCoQGhe.js} +1 -1
  56. package/browser/{chunk-CptnPQPc.js → chunk-DlxQJ0Wq.js} +1 -1
  57. package/browser/{chunk-CJ4GIpQh.js → chunk-Dn9qyCI-.js} +1 -1
  58. package/browser/{chunk-SlCVUuti.js → chunk-DoK-l333.js} +1 -1
  59. package/browser/{chunk-BorrTujx.js → chunk-Dx5UtZ5A.js} +1 -1
  60. package/browser/{chunk-BEmAw7iX.js → chunk-DystVA5E.js} +1 -1
  61. package/browser/{chunk-CFUGnoau.js → chunk-DywMt_F6.js} +1 -1
  62. package/browser/{chunk-5Y113ccl.js → chunk-DzLzwtOe.js} +1 -1
  63. package/browser/{chunk-odhKIvc0.js → chunk-JZld8hhU.js} +1 -1
  64. package/browser/chunk-KsDoJ6rD.js +1 -0
  65. package/browser/{chunk-DfOj7Ckk.js → chunk-MAe7L4co.js} +1 -1
  66. package/browser/{chunk-DF0OFBlh.js → chunk-MHk6Nl7A.js} +1 -1
  67. package/browser/{chunk-C8OjnVE9.js → chunk-QK8tU1La.js} +1 -1
  68. package/browser/{chunk-BT_jhPai.js → chunk-SHexpzTz.js} +1 -1
  69. package/browser/{chunk-0-y9Db5v.js → chunk-ZC1xA4AE.js} +1 -1
  70. package/browser/{chunk-Cs9kJRRU.js → chunk-ZK5QaNGY.js} +1 -1
  71. package/browser/{chunk-BwDh7lEt.js → chunk-juX0bStc.js} +1 -1
  72. package/browser/index.html +1 -1
  73. package/browser/{main-R5QFX3OD.js → main-CB44G2DK.js} +1 -1
  74. package/package.json +1 -1
  75. package/browser/chunk-CfodLKpx.js +0 -10
  76. package/browser/chunk-y0Xz-lHq.js +0 -1
@@ -1 +1 @@
1
- import {v}from'./chunk-Cs9kJRRU.js';import {R}from'./chunk-CFkYuI2I.js';import {N}from'./chunk-BI52yvMl.js';import {g,ao as W,F,C as Ce,d8 as W$1,a as F$1,Q as br,G as Gi,m as mT,cd as Hf,b as U,e as xw,k as ws,n as GC,o as pl,J as Jw,X as XE,a8 as Yg,v as eC,a9 as lC,q as Rg,s as rC,cH as Kw,a3 as VI,S as Sg,a4 as nC,ac as gC,u as bg,y as oC,a6 as UI,a5 as vl,aa as If,ab as wf}from'./main-R5QFX3OD.js';import'./chunk-CfodLKpx.js';import {n as nt}from'./chunk-D88hl6XI.js';import'./chunk-odhKIvc0.js';import {o as z,k as _t,b as _e,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,a as wt,A as At,m as mn,Z as Zn,l as Xn,C as Cn,E as En}from'./chunk-D2rCay4H.js';import'./chunk-y0Xz-lHq.js';import'./chunk-5Y113ccl.js';function le(i,t){i&1&&(ws(0,"p",3),GC(1,"Loading\u2026"),pl());}function se(i,t){if(i&1&&(ws(0,"label",8),Sg(1,"input",27),VI(),ws(2,"span"),GC(3),pl()()),i&2){let e=t.$implicit,n=gC(2);XE(),bg("value",e.value)("formControl",n.scopeControl)("disabled",e.value==="namespace"&&!n.isAdmin()),UI(),XE(2),Yg(e.label);}}function ce(i,t){if(i&1&&(ws(0,"option",14),GC(1),pl()),i&2){let e=t.$implicit;bg("value",e.type),XE(),Yg(e.displayName);}}function me(i,t){if(i&1&&(ws(0,"option",14),GC(1),pl()),i&2){let e=t.$implicit;bg("value",e),XE(),Yg(e);}}function pe(i,t){if(i&1&&(ws(0,"div",9)(1,"label",28),Sg(2,"input",29),VI(),ws(3,"span",7),GC(4,"Grant automatically"),pl()(),ws(5,"p",30),GC(6),pl()()),i&2){let e=gC(2);XE(2),bg("formControl",e.autoGrantControl),UI(),XE(4),vl(" 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=lC();ws(0,"div",22)(1,"ds-json-schema-form",31),Rg("valueChange",function(s){If(e);let m=gC(2);return wf(m.onParamsChange(s))}),pl()();}if(i&2){let e=gC(2);XE(),bg("schema",t)("value",e.initialParams());}}function ge(i,t){if(i&1){let e=lC();ws(0,"button",32),Rg("click",function(){If(e);let s=gC(2);return wf(s.exportYaml())}),GC(1),pl();}if(i&2){let e=gC(2);bg("disabled",e.isExporting()),XE(),vl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function ue(i,t){if(i&1){let e=lC();ws(0,"form",5),Rg("ngSubmit",function(){If(e);let s=gC();return wf(s.submit())}),ws(1,"fieldset",6)(2,"legend",7),GC(3,"Scope"),pl(),rC(4,se,4,4,"label",8,Kw().trackByScope,true),pl(),ws(6,"div",9)(7,"label",10),GC(8,"Type "),ws(9,"span",11),GC(10,"*"),pl()(),ws(11,"select",12)(12,"option",13),GC(13,"Select type"),pl(),rC(14,ce,2,2,"option",14,Kw().trackByType,true),pl(),VI(),pl(),ws(16,"div",9)(17,"label",15),GC(18,"Name "),ws(19,"span",11),GC(20,"*"),pl()(),Sg(21,"input",16),VI(),pl(),ws(22,"div",9)(23,"label",17),GC(24,"Description"),pl(),Sg(25,"textarea",18),VI(),pl(),ws(26,"div",9)(27,"label",19),GC(28,"Auth Setting"),pl(),ws(29,"select",20)(30,"option",21),GC(31,"None"),pl(),rC(32,me,2,2,"option",14,nC),pl(),VI(),pl(),Jw(34,pe,7,2,"div",9),Jw(35,de,2,2,"div",22),ws(36,"div",23)(37,"button",24),GC(38),pl(),Jw(39,ge,2,2,"button",25),ws(40,"button",26),Rg("click",function(){If(e);let s=gC();return wf(s.cancel())}),GC(41,"Cancel"),pl()()();}if(i&2){let e,n=gC();bg("formGroup",n.form),XE(),bg("disabled",n.isEditMode()),XE(3),oC(n.scopeOptions),XE(7),bg("formControl",n.typeControl),UI(),XE(3),oC(n.integrationTypes()),XE(7),bg("formControl",n.nameControl),UI(),XE(4),bg("formControl",n.descriptionControl),UI(),XE(4),bg("formControl",n.authSettingNameControl),UI(),XE(),bg("ngValue",null),XE(2),oC(n.availableAuthSettings()),XE(2),eC(n.isAutoGrantable()?34:-1),XE(),eC((e=n.schema())?35:-1,e),XE(2),bg("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),XE(),vl(" ",n.isEditMode()?"Save changes":"Create"," "),XE(),eC(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=g(W);router=g(F);destroyRef=g(Ce);state=g(N);integrationTypeController=g(W$1);authSettingState=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=F$1(this.isPlatformMode?br(true):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new z({name:new _t("",{nonNullable:true,validators:[_e.required,_e.minLength(1)]}),description:new _t(null),type:new _t("",{nonNullable:true,validators:[_e.required]}),scope:new _t("namespace",{nonNullable:true}),autoGrant:new _t(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=Gi(false);isSubmitting=Gi(false);isLoading=Gi(false);isExporting=Gi(false);scopeOptions=[{value:"platform",label:T.platform},{value:"namespace",label:T.namespace},{value:"userOnNs",label:T.userOnNs},{value:"userGlobal",label:T.userGlobal}];authSettingNameControl=new _t(null);availableAuthSettings=Gi([]);paramsValue=Gi(null);initialParams=Gi(null);integrationTypes=F$1(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=F$1(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});scopeValue=F$1(this.form.controls.scope.valueChanges,{initialValue:this.form.controls.scope.value});schema=mT(()=>{let t=this.selectedType();return t?this.integrationTypes().find(n=>n.type===t)?.configSchema??null:null});isAutoGrantable=mT(()=>{let t=this.selectedType();return t?this.integrationTypes().find(e=>e.type===t)?.autoGrantable??false:false});autoGrantReach=mT(()=>{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(){Hf(()=>{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=xw({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&&(ws(0,"div",0)(1,"header",1)(2,"h1",2),GC(3),pl()(),Jw(4,le,2,0,"p",3)(5,ue,42,12,"form",4),pl()),e&2&&(XE(3),Yg(n.isEditMode()?"Edit integration":"New integration"),XE(),eC(n.isLoading()?4:5));},dependencies:[ni,Jn,Qn,ei,Ye,wt,At,mn,Zn,Xn,Cn,En,nt],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-ZK5QaNGY.js';import {R}from'./chunk-C9sVqRdl.js';import {N}from'./chunk-B9bBPCOE.js';import {g,ao as W,F,C as Ce,d8 as W$1,a as F$1,Q as br,G as Gi,m as mT,cd as Hf,b as U,e as xw,k as ws,n as GC,o as pl,J as Jw,X as XE,a8 as Yg,v as eC,a9 as lC,q as Rg,s as rC,cH as Kw,a3 as VI,S as Sg,a4 as nC,ac as gC,u as bg,y as oC,a6 as UI,a5 as vl,aa as If,ab as wf}from'./main-CB44G2DK.js';import'./chunk-CigBS2kT.js';import {n as nt}from'./chunk-CnOd7CqJ.js';import'./chunk-JZld8hhU.js';import {o as z,k as _t,b as _e,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,a as wt,A as At,m as mn,Z as Zn,l as Xn,C as Cn,E as En}from'./chunk-BDPQgAAh.js';import'./chunk-KsDoJ6rD.js';import'./chunk-DzLzwtOe.js';function le(i,t){i&1&&(ws(0,"p",3),GC(1,"Loading\u2026"),pl());}function se(i,t){if(i&1&&(ws(0,"label",8),Sg(1,"input",27),VI(),ws(2,"span"),GC(3),pl()()),i&2){let e=t.$implicit,n=gC(2);XE(),bg("value",e.value)("formControl",n.scopeControl)("disabled",e.value==="namespace"&&!n.isAdmin()),UI(),XE(2),Yg(e.label);}}function ce(i,t){if(i&1&&(ws(0,"option",14),GC(1),pl()),i&2){let e=t.$implicit;bg("value",e.type),XE(),Yg(e.displayName);}}function me(i,t){if(i&1&&(ws(0,"option",14),GC(1),pl()),i&2){let e=t.$implicit;bg("value",e),XE(),Yg(e);}}function pe(i,t){if(i&1&&(ws(0,"div",9)(1,"label",28),Sg(2,"input",29),VI(),ws(3,"span",7),GC(4,"Grant automatically"),pl()(),ws(5,"p",30),GC(6),pl()()),i&2){let e=gC(2);XE(2),bg("formControl",e.autoGrantControl),UI(),XE(4),vl(" 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=lC();ws(0,"div",22)(1,"ds-json-schema-form",31),Rg("valueChange",function(s){If(e);let m=gC(2);return wf(m.onParamsChange(s))}),pl()();}if(i&2){let e=gC(2);XE(),bg("schema",t)("value",e.initialParams());}}function ge(i,t){if(i&1){let e=lC();ws(0,"button",32),Rg("click",function(){If(e);let s=gC(2);return wf(s.exportYaml())}),GC(1),pl();}if(i&2){let e=gC(2);bg("disabled",e.isExporting()),XE(),vl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function ue(i,t){if(i&1){let e=lC();ws(0,"form",5),Rg("ngSubmit",function(){If(e);let s=gC();return wf(s.submit())}),ws(1,"fieldset",6)(2,"legend",7),GC(3,"Scope"),pl(),rC(4,se,4,4,"label",8,Kw().trackByScope,true),pl(),ws(6,"div",9)(7,"label",10),GC(8,"Type "),ws(9,"span",11),GC(10,"*"),pl()(),ws(11,"select",12)(12,"option",13),GC(13,"Select type"),pl(),rC(14,ce,2,2,"option",14,Kw().trackByType,true),pl(),VI(),pl(),ws(16,"div",9)(17,"label",15),GC(18,"Name "),ws(19,"span",11),GC(20,"*"),pl()(),Sg(21,"input",16),VI(),pl(),ws(22,"div",9)(23,"label",17),GC(24,"Description"),pl(),Sg(25,"textarea",18),VI(),pl(),ws(26,"div",9)(27,"label",19),GC(28,"Auth Setting"),pl(),ws(29,"select",20)(30,"option",21),GC(31,"None"),pl(),rC(32,me,2,2,"option",14,nC),pl(),VI(),pl(),Jw(34,pe,7,2,"div",9),Jw(35,de,2,2,"div",22),ws(36,"div",23)(37,"button",24),GC(38),pl(),Jw(39,ge,2,2,"button",25),ws(40,"button",26),Rg("click",function(){If(e);let s=gC();return wf(s.cancel())}),GC(41,"Cancel"),pl()()();}if(i&2){let e,n=gC();bg("formGroup",n.form),XE(),bg("disabled",n.isEditMode()),XE(3),oC(n.scopeOptions),XE(7),bg("formControl",n.typeControl),UI(),XE(3),oC(n.integrationTypes()),XE(7),bg("formControl",n.nameControl),UI(),XE(4),bg("formControl",n.descriptionControl),UI(),XE(4),bg("formControl",n.authSettingNameControl),UI(),XE(),bg("ngValue",null),XE(2),oC(n.availableAuthSettings()),XE(2),eC(n.isAutoGrantable()?34:-1),XE(),eC((e=n.schema())?35:-1,e),XE(2),bg("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),XE(),vl(" ",n.isEditMode()?"Save changes":"Create"," "),XE(),eC(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=g(W);router=g(F);destroyRef=g(Ce);state=g(N);integrationTypeController=g(W$1);authSettingState=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=F$1(this.isPlatformMode?br(true):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new z({name:new _t("",{nonNullable:true,validators:[_e.required,_e.minLength(1)]}),description:new _t(null),type:new _t("",{nonNullable:true,validators:[_e.required]}),scope:new _t("namespace",{nonNullable:true}),autoGrant:new _t(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=Gi(false);isSubmitting=Gi(false);isLoading=Gi(false);isExporting=Gi(false);scopeOptions=[{value:"platform",label:T.platform},{value:"namespace",label:T.namespace},{value:"userOnNs",label:T.userOnNs},{value:"userGlobal",label:T.userGlobal}];authSettingNameControl=new _t(null);availableAuthSettings=Gi([]);paramsValue=Gi(null);initialParams=Gi(null);integrationTypes=F$1(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=F$1(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});scopeValue=F$1(this.form.controls.scope.valueChanges,{initialValue:this.form.controls.scope.value});schema=mT(()=>{let t=this.selectedType();return t?this.integrationTypes().find(n=>n.type===t)?.configSchema??null:null});isAutoGrantable=mT(()=>{let t=this.selectedType();return t?this.integrationTypes().find(e=>e.type===t)?.autoGrantable??false:false});autoGrantReach=mT(()=>{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(){Hf(()=>{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=xw({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&&(ws(0,"div",0)(1,"header",1)(2,"h1",2),GC(3),pl()(),Jw(4,le,2,0,"p",3)(5,ue,42,12,"form",4),pl()),e&2&&(XE(3),Yg(n.isEditMode()?"Edit integration":"New integration"),XE(),eC(n.isLoading()?4:5));},dependencies:[ni,Jn,Qn,ei,Ye,wt,At,mn,Zn,Xn,Cn,En,nt],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 +1 @@
1
- import {D}from'./chunk-BVCyS-so.js';import {o}from'./chunk--VmBz6Cf.js';import {g,F,C as Ce,aJ as Tr,G as Gi,bS as Ea,cE as Dd,r as re,b as U$1,e as xw,aK as xb,J as Jw,k as ws,bf as aT,q as Rg,o as pl,af as Eg,t as CC,v as eC,X as XE,u as bg,bg as uT,ah as rT,n as GC,ac as gC,a8 as Yg,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-R5QFX3OD.js';import {$ as $n,S as Se}from'./chunk-D88hl6XI.js';import'./chunk-odhKIvc0.js';import'./chunk-D2rCay4H.js';var z=()=>[];function A(i,t){if(i&1&&(ws(0,"p",1),GC(1),pl()),i&2){let e=gC();XE(),Yg(e.errorMessage());}}function O(i,t){if(i&1){let e=lC();ws(0,"agentos-skill-item",5),Rg("deleteRequested",function(o){If(e);let j=gC(2);return wf(j.deleteSkill(o))}),pl();}i&2&&bg("skill",t)("platformMode",true);}function U(i,t){if(i&1&&Jw(0,O,1,2,"agentos-skill-item",4),i&2){let e,n=t.$implicit,o=gC();eC((e=o.resolveSkill(n.id))?0:-1,e);}}var V=class i{router=g(F);destroyRef=g(Ce);skillState=g(o);refresh$=new Tr(void 0);isLoading=Gi(true);errorMessage=Gi(null);skills$=this.refresh$.pipe(Ea(()=>(this.isLoading.set(true),this.skillState.listPlatform())),Dd({bufferSize:1,refCount:true}));skillItems$=this.skills$.pipe(re(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.description}))));skillsById=new Map;constructor(){this.skills$.pipe(U$1(this.destroyRef)).subscribe({next:t=>{this.skillsById=new Map(t.map(e=>[e.id??"",e])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","skills","new"]);}deleteSkill(t){this.errorMessage.set(null),this.skillState.delete(t.id??"").pipe(U$1(this.destroyRef)).subscribe({next:()=>this.refresh$.next(),error:e=>this.errorMessage.set(e.status===403?`Deleting "${t.name}" requires platform administrator rights.`:`Deleting "${t.name}" failed.`)});}resolveSkill(t){return this.skillsById.get(t)??null}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-platform-skills"]],decls:6,vars:8,consts:[["skillItemTpl",""],["role","alert",1,"platform-skills__error"],["title","Platform Skills","emptyMessage","No platform skills defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"skill","platformMode"],[3,"deleteRequested","skill","platformMode"]],template:function(e,n){if(e&1&&(Jw(0,A,2,1,"p",1),ws(1,"ds-entity-list",2),aT(2,"async"),Rg("createRequested",function(){return n.openCreateForm()}),ws(3,"ds-icon-button",3),Rg("action",function(){return n.goBack()}),pl()(),Eg(4,U,1,1,"ng-template",null,0,fT)),e&2){let o=CC(5);eC(n.errorMessage()?0:-1),XE(),bg("items",uT(2,5,n.skillItems$)??rT(7,z))("loading",n.isLoading())("showCreate",true)("itemTemplate",o);}},dependencies:[$n,D,Se,xb],styles:[".platform-skills[_ngcontent-%COMP%]{display:block}.platform-skills__error[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:.875rem;color:var(--color-error, var(--red, #dc2626))}"]})};export{V as PlatformSkillsComponent};
1
+ import {D}from'./chunk-BbkpDuKm.js';import {o}from'./chunk-DOy5wwe3.js';import {g,F,C as Ce,aJ as Tr,G as Gi,bS as Ea,cE as Dd,r as re,b as U$1,e as xw,aK as xb,J as Jw,k as ws,bf as aT,q as Rg,o as pl,af as Eg,t as CC,v as eC,X as XE,u as bg,bg as uT,ah as rT,n as GC,ac as gC,a8 as Yg,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-CB44G2DK.js';import {$ as $n,S as Se}from'./chunk-CnOd7CqJ.js';import'./chunk-JZld8hhU.js';import'./chunk-BDPQgAAh.js';var z=()=>[];function A(i,t){if(i&1&&(ws(0,"p",1),GC(1),pl()),i&2){let e=gC();XE(),Yg(e.errorMessage());}}function O(i,t){if(i&1){let e=lC();ws(0,"agentos-skill-item",5),Rg("deleteRequested",function(o){If(e);let j=gC(2);return wf(j.deleteSkill(o))}),pl();}i&2&&bg("skill",t)("platformMode",true);}function U(i,t){if(i&1&&Jw(0,O,1,2,"agentos-skill-item",4),i&2){let e,n=t.$implicit,o=gC();eC((e=o.resolveSkill(n.id))?0:-1,e);}}var V=class i{router=g(F);destroyRef=g(Ce);skillState=g(o);refresh$=new Tr(void 0);isLoading=Gi(true);errorMessage=Gi(null);skills$=this.refresh$.pipe(Ea(()=>(this.isLoading.set(true),this.skillState.listPlatform())),Dd({bufferSize:1,refCount:true}));skillItems$=this.skills$.pipe(re(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.description}))));skillsById=new Map;constructor(){this.skills$.pipe(U$1(this.destroyRef)).subscribe({next:t=>{this.skillsById=new Map(t.map(e=>[e.id??"",e])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","skills","new"]);}deleteSkill(t){this.errorMessage.set(null),this.skillState.delete(t.id??"").pipe(U$1(this.destroyRef)).subscribe({next:()=>this.refresh$.next(),error:e=>this.errorMessage.set(e.status===403?`Deleting "${t.name}" requires platform administrator rights.`:`Deleting "${t.name}" failed.`)});}resolveSkill(t){return this.skillsById.get(t)??null}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-platform-skills"]],decls:6,vars:8,consts:[["skillItemTpl",""],["role","alert",1,"platform-skills__error"],["title","Platform Skills","emptyMessage","No platform skills defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"skill","platformMode"],[3,"deleteRequested","skill","platformMode"]],template:function(e,n){if(e&1&&(Jw(0,A,2,1,"p",1),ws(1,"ds-entity-list",2),aT(2,"async"),Rg("createRequested",function(){return n.openCreateForm()}),ws(3,"ds-icon-button",3),Rg("action",function(){return n.goBack()}),pl()(),Eg(4,U,1,1,"ng-template",null,0,fT)),e&2){let o=CC(5);eC(n.errorMessage()?0:-1),XE(),bg("items",uT(2,5,n.skillItems$)??rT(7,z))("loading",n.isLoading())("showCreate",true)("itemTemplate",o);}},dependencies:[$n,D,Se,xb],styles:[".platform-skills[_ngcontent-%COMP%]{display:block}.platform-skills__error[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:.875rem;color:var(--color-error, var(--red, #dc2626))}"]})};export{V as PlatformSkillsComponent};
@@ -1 +1 @@
1
- import {c}from'./chunk-CfodLKpx.js';import {g,ao as W,dt as J,G as Gi,an as ue$1,cd as Hf,e as xw,$ as $t,cF as Pb,k as ws,n as GC,o as pl,J as Jw,X as XE,v as eC,bR as wd,bS as Ea,cB as on,M as By,a7 as ya,a9 as lC,q as Rg,ai as tm,a3 as VI,ac as gC,ak as em,a6 as UI,a8 as Yg,s as rC,y as oC,cg as iT,b4 as oT,bf as aT,bg as uT,b0 as Qg,bi as lT,aa as If,ab as wf,aj as KC,a5 as vl}from'./main-R5QFX3OD.js';import {t as ti,J as Jn,Y as Ye,Z as Zn,l as Xn,g as gt,c as cn,d as an}from'./chunk-D2rCay4H.js';import'./chunk-5Y113ccl.js';import'./chunk-D88hl6XI.js';import'./chunk-odhKIvc0.js';var ne=e=>({title:"By agent",rows:e}),ie=e=>({title:"By model",rows:e}),ae=(e,o)=>[e,o],oe=(e,o)=>o.title,re=(e,o)=>o.key;function se(e,o){e&1&&(ws(0,"p",2),GC(1,"Loading usage settings\u2026"),pl());}function le(e,o){if(e&1){let t=lC();ws(0,"p",3),GC(1,"Could not load usage settings. Please try again."),pl(),ws(2,"button",4),Rg("click",function(){If(t);let s=gC();return wf(s.configuration.retry())}),GC(3,"Retry usage settings"),pl();}}function me(e,o){e&1&&(ws(0,"p",2),GC(1,"Usage tracking is disabled."),pl());}function de(e,o){e&1&&(ws(0,"p",3),GC(1),pl()),e&2&&(XE(),Yg(o));}function ce(e,o){e&1&&(ws(0,"p",2),GC(1,"Loading usage\u2026"),pl());}function pe(e,o){e&1&&(ws(0,"p"),GC(1,"No recorded usage for this period."),pl());}function ge(e,o){if(e&1&&(ws(0,"small"),GC(1),pl()),e&2){let t=gC().$implicit;XE(),vl("",t.aggregate.unknownCostCount," record(s) with unknown cost");}}function ue(e,o){if(e&1&&(ws(0,"tr")(1,"th",11),GC(2),pl(),ws(3,"td"),GC(4),aT(5,"number"),pl(),ws(6,"td"),GC(7),aT(8,"number"),aT(9,"number"),pl(),ws(10,"td"),GC(11),aT(12,"number"),aT(13,"number"),pl(),ws(14,"td"),GC(15),aT(16,"number"),Jw(17,ge,2,1,"small"),pl()()),e&2){let t=o.$implicit;XE(2),Yg(t.key),XE(2),Yg(uT(5,9,t.aggregate.totalTokens)),XE(3),Qg("",uT(8,11,t.aggregate.inputTokens)," / ",uT(9,13,t.aggregate.outputTokens)),XE(4),Qg(" ",uT(12,15,t.aggregate.cacheReadTokens)," / ",uT(13,17,t.aggregate.cacheWriteTokens)," "),XE(4),Qg(" ",t.aggregate.unknownCostCount>0?"At least ":"","",lT(16,19,t.aggregate.cost,"1.2-6")," "),XE(2),eC(t.aggregate.unknownCostCount>0?17:-1);}}function _e(e,o){if(e&1&&(ws(0,"div",9)(1,"table")(2,"thead")(3,"tr")(4,"th",10),GC(5,"Name"),pl(),ws(6,"th",10),GC(7,"Tokens"),pl(),ws(8,"th",10),GC(9,"Input / output"),pl(),ws(10,"th",10),GC(11,"Cache read / write"),pl(),ws(12,"th",10),GC(13,"Estimated cost"),pl()()(),ws(14,"tbody"),rC(15,ue,18,22,"tr",null,re),pl()()()),e&2){let t=gC().$implicit;XE(15),oC(t.rows);}}function Ce(e,o){if(e&1&&(ws(0,"h2"),GC(1),pl(),Jw(2,pe,2,0,"p")(3,_e,17,0,"div",9)),e&2){let t=o.$implicit;XE(),Yg(t.title),XE(),eC(t.rows.length===0?2:3);}}function fe(e,o){if(e&1&&(rC(0,Ce,4,2,null,null,oe),ws(2,"p"),GC(3,"Unpriced usage is kept separate from known costs. Active agent runs appear here after they finish."),pl()),e&2){let t=gC(2);oC(iT(4,ae,oT(0,ne,t.agents()),oT(2,ie,t.models())));}}function ye(e,o){if(e&1){let t=lC();ws(0,"p"),GC(1,"Recorded LLM usage across this namespace. Costs are estimates in the platform currency."),pl(),ws(2,"form",5),Rg("ngSubmit",function(){If(t);let s=gC();return wf(s.load())}),ws(3,"label"),GC(4,"From (UTC)"),ws(5,"input",6),tm("ngModelChange",function(s){If(t);let d=gC();return KC(d.from,s)||(d.from=s),wf(s)}),pl(),VI(),pl(),ws(6,"label"),GC(7,"To (UTC)"),ws(8,"input",7),tm("ngModelChange",function(s){If(t);let d=gC();return KC(d.to,s)||(d.to=s),wf(s)}),pl(),VI(),pl(),ws(9,"button",8),GC(10,"Refresh"),pl()(),Jw(11,de,2,1,"p",3),Jw(12,ce,2,0,"p",2)(13,fe,4,7);}if(e&2){let t,r=gC();XE(5),em("ngModel",r.from),UI(),XE(3),em("ngModel",r.to),UI(),XE(3),eC((t=r.error())?11:-1,t),XE(),eC(r.loading()?12:r.error()?-1:13);}}var te=class e{route=g(W);api=g(J);configuration=g(c);namespaceId=this.route.snapshot.params.namespaceId;agents=Gi([]);models=Gi([]);error=Gi(null);loading=Gi(false);from=new Date(Date.now()-30*864e5).toISOString().slice(0,10);to=new Date().toISOString().slice(0,10);refresh=new ue$1;constructor(){Hf(o=>{if(!this.configuration.enabled())return;let t=this.refresh.pipe(wd(void 0),Ea(()=>{this.error.set(null),this.agents.set([]),this.models.set([]);let r=new Date(`${this.from}T00:00:00.000Z`),s=new Date(`${this.to}T23:59:59.999Z`);return !Number.isFinite(r.getTime())||!Number.isFinite(s.getTime())||r>s?(this.error.set("Select a valid date range."),this.loading.set(false),on):(this.loading.set(true),By({agents:this.api.aggregateByAgentUsageRecord(this.namespaceId,r.toISOString(),s.toISOString()),models:this.api.aggregateByModelUsageRecord(this.namespaceId,r.toISOString(),s.toISOString())}).pipe(ya(d=>(this.loading.set(false),this.error.set(d.status===403?"Namespace admin permission is required to view this report.":"Could not load usage. Please try again."),on))))})).subscribe(({agents:r,models:s})=>{this.agents.set(r),this.models.set(s),this.loading.set(false);});o(()=>t.unsubscribe());});}load(){this.configuration.enabled()&&this.refresh.next();}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=xw({type:e,selectors:[["agentos-namespace-usage"]],decls:9,vars:1,consts:[[1,"report"],["routerLink","/agentos/namespaces"],["role","status"],["role","alert"],["type","button",3,"click"],[1,"filters",3,"ngSubmit"],["type","date","name","from","required","",3,"ngModelChange","ngModel"],["type","date","name","to","required","",3,"ngModelChange","ngModel"],["type","submit"],[1,"table-wrap"],["scope","col"],["scope","row"]],template:function(t,r){t&1&&(ws(0,"section",0)(1,"a",1),GC(2,"\u2190 Namespaces"),pl(),ws(3,"h1"),GC(4,"Usage and costs"),pl(),Jw(5,se,2,0,"p",2)(6,le,4,0)(7,me,2,0,"p",2)(8,ye,14,4),pl()),t&2&&(XE(5),eC(r.configuration.state()==="loading"?5:r.configuration.state()==="error"?6:r.configuration.state()==="disabled"?7:8));},dependencies:[ti,Jn,Ye,Zn,Xn,gt,cn,an,$t,Pb],styles:["[_nghost-%COMP%]{display:block}.report[_ngcontent-%COMP%]{max-width:1100px;margin:auto;padding:1.5rem;color:var(--color-text, inherit)}a[_ngcontent-%COMP%]{color:inherit}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem;align-items:end;margin:1.5rem 0}label[_ngcontent-%COMP%]{display:grid;gap:.4rem}input[_ngcontent-%COMP%], button[_ngcontent-%COMP%]{font:inherit;color:inherit;background:transparent;border:1px solid var(--color-border, rgba(136, 136, 136, .5333333333));border-radius:.4rem;padding:.5rem .75rem}button[_ngcontent-%COMP%]{cursor:pointer}.table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table[_ngcontent-%COMP%]{border-collapse:collapse;width:100%}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{text-align:left;padding:.75rem;border-bottom:1px solid var(--color-border, rgba(136, 136, 136, .3333333333))}small[_ngcontent-%COMP%]{display:block;margin-top:.3rem}h2[_ngcontent-%COMP%]{margin-top:2rem}"]})};export{te as NamespaceUsageComponent};
1
+ import {c}from'./chunk-CigBS2kT.js';import {g,ao as W,dt as J,G as Gi,an as ue$1,cd as Hf,e as xw,$ as $t,cF as Pb,k as ws,n as GC,o as pl,J as Jw,X as XE,v as eC,bR as wd,bS as Ea,cB as on,M as By,a7 as ya,a9 as lC,q as Rg,ai as tm,a3 as VI,ac as gC,ak as em,a6 as UI,a8 as Yg,s as rC,y as oC,cg as iT,b4 as oT,bf as aT,bg as uT,b0 as Qg,bi as lT,aa as If,ab as wf,aj as KC,a5 as vl}from'./main-CB44G2DK.js';import {t as ti,J as Jn,Y as Ye,Z as Zn,l as Xn,g as gt,c as cn,d as an}from'./chunk-BDPQgAAh.js';import'./chunk-DzLzwtOe.js';import'./chunk-CnOd7CqJ.js';import'./chunk-JZld8hhU.js';var ne=e=>({title:"By agent",rows:e}),ie=e=>({title:"By model",rows:e}),ae=(e,o)=>[e,o],oe=(e,o)=>o.title,re=(e,o)=>o.key;function se(e,o){e&1&&(ws(0,"p",2),GC(1,"Loading usage settings\u2026"),pl());}function le(e,o){if(e&1){let t=lC();ws(0,"p",3),GC(1,"Could not load usage settings. Please try again."),pl(),ws(2,"button",4),Rg("click",function(){If(t);let s=gC();return wf(s.configuration.retry())}),GC(3,"Retry usage settings"),pl();}}function me(e,o){e&1&&(ws(0,"p",2),GC(1,"Usage tracking is disabled."),pl());}function de(e,o){e&1&&(ws(0,"p",3),GC(1),pl()),e&2&&(XE(),Yg(o));}function ce(e,o){e&1&&(ws(0,"p",2),GC(1,"Loading usage\u2026"),pl());}function pe(e,o){e&1&&(ws(0,"p"),GC(1,"No recorded usage for this period."),pl());}function ge(e,o){if(e&1&&(ws(0,"small"),GC(1),pl()),e&2){let t=gC().$implicit;XE(),vl("",t.aggregate.unknownCostCount," record(s) with unknown cost");}}function ue(e,o){if(e&1&&(ws(0,"tr")(1,"th",11),GC(2),pl(),ws(3,"td"),GC(4),aT(5,"number"),pl(),ws(6,"td"),GC(7),aT(8,"number"),aT(9,"number"),pl(),ws(10,"td"),GC(11),aT(12,"number"),aT(13,"number"),pl(),ws(14,"td"),GC(15),aT(16,"number"),Jw(17,ge,2,1,"small"),pl()()),e&2){let t=o.$implicit;XE(2),Yg(t.key),XE(2),Yg(uT(5,9,t.aggregate.totalTokens)),XE(3),Qg("",uT(8,11,t.aggregate.inputTokens)," / ",uT(9,13,t.aggregate.outputTokens)),XE(4),Qg(" ",uT(12,15,t.aggregate.cacheReadTokens)," / ",uT(13,17,t.aggregate.cacheWriteTokens)," "),XE(4),Qg(" ",t.aggregate.unknownCostCount>0?"At least ":"","",lT(16,19,t.aggregate.cost,"1.2-6")," "),XE(2),eC(t.aggregate.unknownCostCount>0?17:-1);}}function _e(e,o){if(e&1&&(ws(0,"div",9)(1,"table")(2,"thead")(3,"tr")(4,"th",10),GC(5,"Name"),pl(),ws(6,"th",10),GC(7,"Tokens"),pl(),ws(8,"th",10),GC(9,"Input / output"),pl(),ws(10,"th",10),GC(11,"Cache read / write"),pl(),ws(12,"th",10),GC(13,"Estimated cost"),pl()()(),ws(14,"tbody"),rC(15,ue,18,22,"tr",null,re),pl()()()),e&2){let t=gC().$implicit;XE(15),oC(t.rows);}}function Ce(e,o){if(e&1&&(ws(0,"h2"),GC(1),pl(),Jw(2,pe,2,0,"p")(3,_e,17,0,"div",9)),e&2){let t=o.$implicit;XE(),Yg(t.title),XE(),eC(t.rows.length===0?2:3);}}function fe(e,o){if(e&1&&(rC(0,Ce,4,2,null,null,oe),ws(2,"p"),GC(3,"Unpriced usage is kept separate from known costs. Active agent runs appear here after they finish."),pl()),e&2){let t=gC(2);oC(iT(4,ae,oT(0,ne,t.agents()),oT(2,ie,t.models())));}}function ye(e,o){if(e&1){let t=lC();ws(0,"p"),GC(1,"Recorded LLM usage across this namespace. Costs are estimates in the platform currency."),pl(),ws(2,"form",5),Rg("ngSubmit",function(){If(t);let s=gC();return wf(s.load())}),ws(3,"label"),GC(4,"From (UTC)"),ws(5,"input",6),tm("ngModelChange",function(s){If(t);let d=gC();return KC(d.from,s)||(d.from=s),wf(s)}),pl(),VI(),pl(),ws(6,"label"),GC(7,"To (UTC)"),ws(8,"input",7),tm("ngModelChange",function(s){If(t);let d=gC();return KC(d.to,s)||(d.to=s),wf(s)}),pl(),VI(),pl(),ws(9,"button",8),GC(10,"Refresh"),pl()(),Jw(11,de,2,1,"p",3),Jw(12,ce,2,0,"p",2)(13,fe,4,7);}if(e&2){let t,r=gC();XE(5),em("ngModel",r.from),UI(),XE(3),em("ngModel",r.to),UI(),XE(3),eC((t=r.error())?11:-1,t),XE(),eC(r.loading()?12:r.error()?-1:13);}}var te=class e{route=g(W);api=g(J);configuration=g(c);namespaceId=this.route.snapshot.params.namespaceId;agents=Gi([]);models=Gi([]);error=Gi(null);loading=Gi(false);from=new Date(Date.now()-30*864e5).toISOString().slice(0,10);to=new Date().toISOString().slice(0,10);refresh=new ue$1;constructor(){Hf(o=>{if(!this.configuration.enabled())return;let t=this.refresh.pipe(wd(void 0),Ea(()=>{this.error.set(null),this.agents.set([]),this.models.set([]);let r=new Date(`${this.from}T00:00:00.000Z`),s=new Date(`${this.to}T23:59:59.999Z`);return !Number.isFinite(r.getTime())||!Number.isFinite(s.getTime())||r>s?(this.error.set("Select a valid date range."),this.loading.set(false),on):(this.loading.set(true),By({agents:this.api.aggregateByAgentUsageRecord(this.namespaceId,r.toISOString(),s.toISOString()),models:this.api.aggregateByModelUsageRecord(this.namespaceId,r.toISOString(),s.toISOString())}).pipe(ya(d=>(this.loading.set(false),this.error.set(d.status===403?"Namespace admin permission is required to view this report.":"Could not load usage. Please try again."),on))))})).subscribe(({agents:r,models:s})=>{this.agents.set(r),this.models.set(s),this.loading.set(false);});o(()=>t.unsubscribe());});}load(){this.configuration.enabled()&&this.refresh.next();}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=xw({type:e,selectors:[["agentos-namespace-usage"]],decls:9,vars:1,consts:[[1,"report"],["routerLink","/agentos/namespaces"],["role","status"],["role","alert"],["type","button",3,"click"],[1,"filters",3,"ngSubmit"],["type","date","name","from","required","",3,"ngModelChange","ngModel"],["type","date","name","to","required","",3,"ngModelChange","ngModel"],["type","submit"],[1,"table-wrap"],["scope","col"],["scope","row"]],template:function(t,r){t&1&&(ws(0,"section",0)(1,"a",1),GC(2,"\u2190 Namespaces"),pl(),ws(3,"h1"),GC(4,"Usage and costs"),pl(),Jw(5,se,2,0,"p",2)(6,le,4,0)(7,me,2,0,"p",2)(8,ye,14,4),pl()),t&2&&(XE(5),eC(r.configuration.state()==="loading"?5:r.configuration.state()==="error"?6:r.configuration.state()==="disabled"?7:8));},dependencies:[ti,Jn,Ye,Zn,Xn,gt,cn,an,$t,Pb],styles:["[_nghost-%COMP%]{display:block}.report[_ngcontent-%COMP%]{max-width:1100px;margin:auto;padding:1.5rem;color:var(--color-text, inherit)}a[_ngcontent-%COMP%]{color:inherit}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem;align-items:end;margin:1.5rem 0}label[_ngcontent-%COMP%]{display:grid;gap:.4rem}input[_ngcontent-%COMP%], button[_ngcontent-%COMP%]{font:inherit;color:inherit;background:transparent;border:1px solid var(--color-border, rgba(136, 136, 136, .5333333333));border-radius:.4rem;padding:.5rem .75rem}button[_ngcontent-%COMP%]{cursor:pointer}.table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table[_ngcontent-%COMP%]{border-collapse:collapse;width:100%}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{text-align:left;padding:.75rem;border-bottom:1px solid var(--color-border, rgba(136, 136, 136, .3333333333))}small[_ngcontent-%COMP%]{display:block;margin-top:.3rem}h2[_ngcontent-%COMP%]{margin-top:2rem}"]})};export{te as NamespaceUsageComponent};
@@ -1,4 +1,4 @@
1
- import {x as xe}from'./chunk-CjaubGFJ.js';import {P as Pt$1,L as Lt}from'./chunk-BUpwEWqw.js';import {v as ve,n as ne}from'./chunk-BPR1B3ya.js';import {d}from'./chunk-CEcYVC8L.js';import {W,k as ke,s as se}from'./chunk-CknzYxoU.js';import {T as Tn,S as Sn,n as nt,a as ae,l as le,c as ce}from'./chunk-CSXW8eI5.js';import {$ as $n,o as ot,i as it,I as In,E as Ee,z as ze,a as Sa,D as Dn,F as Fn,g as gt$1,A as An}from'./chunk-D88hl6XI.js';import'./chunk-odhKIvc0.js';import {g,bm as Mm,R as Re,G as Gi,m as mT,e as xw,h as hr,j as Gn,k as ws,q as Rg,n as GC,o as pl,a3 as VI,J as Jw,af as Eg,ag as fT,t as CC,X as XE,u as bg,a6 as UI,v as eC,Y as z,Z as Ue,am as qm,_ as zt$1,a0 as jt$1,a1 as Vt,a2 as Nt$1,i as pr,ai as tm,aj as KC,s as rC,a8 as Yg,ak as em,y as oC,a5 as vl,ac as gC,a9 as lC,aa as If,ab as wf,bp as ml,bq as yl,ah as rT,b4 as oT,aL as wo,aM as Zn$1,br as sn,aO as wt$1,bs as Tl,bt as Qn,aT as Ut$1,al as vt$1,aW as C,bu as Ve,aZ as js,a_ as QT,b5 as nT,T as Tg,z as Ug,bv as Fg,E as EC,I as IC,az as Xt$1,bw as St,aS as K$1,aX as D$1,bx as on,by as um,bz as Oi,bA as yC,bB as vC,S as Sg,B as Pg,bC as Si,bo as tC}from'./main-R5QFX3OD.js';import {y as yt$1,w as wt,t as ti,Z as Zn,c as cn,Y as Ye,f as fn,g as gt,$ as $t$1,D}from'./chunk-D2rCay4H.js';var Pt=["button"],Ot=["*"];function Ft(l,a){if(l&1&&(ws(0,"div",2),Sg(1,"mat-pseudo-checkbox",6),pl()),l&2){let e=gC();XE(),bg("disabled",e.disabled);}}var yt=new C("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS",{providedIn:"root",factory:()=>({hideSingleSelectionIndicator:false,hideMultipleSelectionIndicator:false,disabledInteractive:false})}),vt=new C("MatButtonToggleGroup"),Dt={provide:D,useExisting:Si(()=>ie),multi:true},K=class{source;value;constructor(a,e){this.source=a,this.value=e;}},ie=(()=>{class l{_changeDetector=g(Tl);_dir=g(Qn,{optional:true});_multiple=false;_disabled=false;_disabledInteractive=false;_selectionModel;_rawValue;_controlValueAccessorChangeFn=()=>{};_onTouched=()=>{};_buttonToggles;appearance;get name(){return this._name}set name(e){this._name=e,this._markButtonsForCheck();}_name=g(Ut$1).getId("mat-button-toggle-group-");vertical=false;get value(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e.map(t=>t.value):e[0]?e[0].value:void 0}set value(e){this._setSelectionByValue(e),this.valueChange.emit(this.value);}valueChange=new vt$1;get selected(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e:e[0]||null}get multiple(){return this._multiple}set multiple(e){this._multiple=e,this._markButtonsForCheck();}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._markButtonsForCheck();}get disabledInteractive(){return this._disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e,this._markButtonsForCheck();}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}change=new vt$1;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._markButtonsForCheck();}_hideSingleSelectionIndicator;get hideMultipleSelectionIndicator(){return this._hideMultipleSelectionIndicator}set hideMultipleSelectionIndicator(e){this._hideMultipleSelectionIndicator=e,this._markButtonsForCheck();}_hideMultipleSelectionIndicator;constructor(){let e=g(yt,{optional:true});this.appearance=e&&e.appearance?e.appearance:"standard",this._hideSingleSelectionIndicator=e?.hideSingleSelectionIndicator??false,this._hideMultipleSelectionIndicator=e?.hideMultipleSelectionIndicator??false;}ngOnInit(){this._selectionModel=new gt$1(this.multiple,void 0,false);}ngAfterContentInit(){this._selectionModel.select(...this._buttonToggles.filter(e=>e.checked)),this.multiple||this._initializeTabIndex();}writeValue(e){this.value=e,this._changeDetector.markForCheck();}registerOnChange(e){this._controlValueAccessorChangeFn=e;}registerOnTouched(e){this._onTouched=e;}setDisabledState(e){this.disabled=e;}_keydown(e){if(this.multiple||this.disabled||Ve(e))return;let n=e.target.id,o=this._buttonToggles.toArray().findIndex(I=>I.buttonId===n),u=null;switch(e.keyCode){case 32:case 13:u=this._buttonToggles.get(o)||null;break;case 38:u=this._getNextButton(o,-1);break;case 37:u=this._getNextButton(o,this.dir==="ltr"?-1:1);break;case 40:u=this._getNextButton(o,1);break;case 39:u=this._getNextButton(o,this.dir==="ltr"?1:-1);break;default:return}u&&(e.preventDefault(),u._onButtonClick(),u.focus());}_emitChangeEvent(e){let t=new K(e,this.value);this._rawValue=t.value,this._controlValueAccessorChangeFn(t.value),this.change.emit(t);}_syncButtonToggle(e,t,n=false,o=false){!this.multiple&&this.selected&&!e.checked&&(this.selected.checked=false),this._selectionModel?t?this._selectionModel.select(e):this._selectionModel.deselect(e):o=true,o?Promise.resolve().then(()=>this._updateModelValue(e,n)):this._updateModelValue(e,n);}_isSelected(e){return this._selectionModel&&this._selectionModel.isSelected(e)}_isPrechecked(e){return typeof this._rawValue>"u"?false:this.multiple&&Array.isArray(this._rawValue)?this._rawValue.some(t=>e.value!=null&&t===e.value):e.value===this._rawValue}_initializeTabIndex(){if(this._buttonToggles.forEach(e=>{e.tabIndex=-1;}),this.selected)this.selected.tabIndex=0;else for(let e=0;e<this._buttonToggles.length;e++){let t=this._buttonToggles.get(e);if(!t.disabled){t.tabIndex=0;break}}}_getNextButton(e,t){let n=this._buttonToggles;for(let o=1;o<=n.length;o++){let u=(e+t*o+n.length)%n.length,I=n.get(u);if(I&&!I.disabled)return I}return null}_setSelectionByValue(e){if(this._rawValue=e,!this._buttonToggles)return;let t=this._buttonToggles.toArray();if(this.multiple&&e?(this._clearSelection(),e.forEach(n=>this._selectValue(n,t))):(this._clearSelection(),this._selectValue(e,t)),!this.multiple&&t.every(n=>n.tabIndex===-1)){for(let n of t)if(!n.disabled){n.tabIndex=0;break}}}_clearSelection(){this._selectionModel.clear(),this._buttonToggles.forEach(e=>{e.checked=false,this.multiple||(e.tabIndex=-1);});}_selectValue(e,t){for(let n of t)if(n.value===e){n.checked=true,this._selectionModel.select(n),this.multiple||(n.tabIndex=0);break}}_updateModelValue(e,t){t&&this._emitChangeEvent(e),this.valueChange.emit(this.value);}_markButtonsForCheck(){this._buttonToggles?.forEach(e=>e._markForCheck());}static \u0275fac=function(t){return new(t||l)};static \u0275dir=js({type:l,selectors:[["mat-button-toggle-group"]],contentQueries:function(t,n,o){if(t&1&&Fg(o,X,5),t&2){let u;EC(u=IC())&&(n._buttonToggles=u);}},hostAttrs:[1,"mat-button-toggle-group"],hostVars:6,hostBindings:function(t,n){t&1&&Rg("keydown",function(u){return n._keydown(u)}),t&2&&(Tg("role",n.multiple?"group":"radiogroup")("aria-disabled",n.disabled),Ug("mat-button-toggle-vertical",n.vertical)("mat-button-toggle-group-appearance-standard",n.appearance==="standard"));},inputs:{appearance:"appearance",name:"name",vertical:[2,"vertical","vertical",QT],value:"value",multiple:[2,"multiple","multiple",QT],disabled:[2,"disabled","disabled",QT],disabledInteractive:[2,"disabledInteractive","disabledInteractive",QT],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",QT],hideMultipleSelectionIndicator:[2,"hideMultipleSelectionIndicator","hideMultipleSelectionIndicator",QT]},outputs:{valueChange:"valueChange",change:"change"},exportAs:["matButtonToggleGroup"],features:[nT([Dt,{provide:vt,useExisting:l}])]})}return l})(),X=(()=>{class l{_changeDetectorRef=g(Tl);_elementRef=g(Xt$1);_focusMonitor=g(St);_idGenerator=g(Ut$1);_animationDisabled=K$1();_checked=false;ariaLabel;ariaLabelledby=null;_buttonElement;buttonToggleGroup;get buttonId(){return `${this.id}-button`}id;name;value;get tabIndex(){return this._tabIndex()}set tabIndex(e){this._tabIndex.set(e);}_tabIndex;disableRipple=false;get appearance(){return this.buttonToggleGroup?this.buttonToggleGroup.appearance:this._appearance}set appearance(e){this._appearance=e;}_appearance;get checked(){return this.buttonToggleGroup?this.buttonToggleGroup._isSelected(this):this._checked}set checked(e){e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&this.buttonToggleGroup._syncButtonToggle(this,this._checked),this._changeDetectorRef.markForCheck());}get disabled(){return this._disabled||this.buttonToggleGroup&&this.buttonToggleGroup.disabled}set disabled(e){this._disabled=e;}_disabled=false;get disabledInteractive(){return this._disabledInteractive||this.buttonToggleGroup!==null&&this.buttonToggleGroup.disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e;}_disabledInteractive;change=new vt$1;constructor(){g(D$1).load(on);let e=g(vt,{optional:true}),t=g(new um("tabindex"),{optional:true})||"",n=g(yt,{optional:true});this._tabIndex=Gi(parseInt(t)||0),this.buttonToggleGroup=e,this._appearance=n&&n.appearance?n.appearance:"standard",this._disabledInteractive=n?.disabledInteractive??false;}ngOnInit(){let e=this.buttonToggleGroup;this.id=this.id||this._idGenerator.getId("mat-button-toggle-"),e&&(e._isPrechecked(this)?this.checked=true:e._isSelected(this)!==this._checked&&e._syncButtonToggle(this,this._checked));}ngAfterViewInit(){this._animationDisabled||this._elementRef.nativeElement.classList.add("mat-button-toggle-animations-enabled"),this._focusMonitor.monitor(this._elementRef,true);}ngOnDestroy(){let e=this.buttonToggleGroup;this._focusMonitor.stopMonitoring(this._elementRef),e&&e._isSelected(this)&&e._syncButtonToggle(this,false,false,true);}focus(e){this._buttonElement.nativeElement.focus(e);}_onButtonClick(){if(this.disabled)return;let e=this.isSingleSelector()?true:!this._checked;if(e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&(this.buttonToggleGroup._syncButtonToggle(this,this._checked,true),this.buttonToggleGroup._onTouched())),this.isSingleSelector()){let t=this.buttonToggleGroup._buttonToggles.find(n=>n.tabIndex===0);t&&(t.tabIndex=-1),this.tabIndex=0;}this.change.emit(new K(this,this.value));}_markForCheck(){this._changeDetectorRef.markForCheck();}_getButtonName(){return this.isSingleSelector()?this.buttonToggleGroup.name:this.name||null}isSingleSelector(){return this.buttonToggleGroup&&!this.buttonToggleGroup.multiple}static \u0275fac=function(t){return new(t||l)};static \u0275cmp=xw({type:l,selectors:[["mat-button-toggle"]],viewQuery:function(t,n){if(t&1&&Pg(Pt,5),t&2){let o;EC(o=IC())&&(n._buttonElement=o.first);}},hostAttrs:["role","presentation",1,"mat-button-toggle"],hostVars:14,hostBindings:function(t,n){t&1&&Rg("focus",function(){return n.focus()}),t&2&&(Tg("aria-label",null)("aria-labelledby",null)("id",n.id)("name",null),Ug("mat-button-toggle-standalone",!n.buttonToggleGroup)("mat-button-toggle-checked",n.checked)("mat-button-toggle-disabled",n.disabled)("mat-button-toggle-disabled-interactive",n.disabledInteractive)("mat-button-toggle-appearance-standard",n.appearance==="standard"));},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],id:"id",name:"name",value:"value",tabIndex:"tabIndex",disableRipple:[2,"disableRipple","disableRipple",QT],appearance:"appearance",checked:[2,"checked","checked",QT],disabled:[2,"disabled","disabled",QT],disabledInteractive:[2,"disabledInteractive","disabledInteractive",QT]},outputs:{change:"change"},exportAs:["matButtonToggle"],ngContentSelectors:Ot,decls:7,vars:13,consts:[["button",""],["type","button",1,"mat-button-toggle-button","mat-focus-indicator",3,"click","id","disabled"],[1,"mat-button-toggle-checkbox-wrapper"],[1,"mat-button-toggle-label-content"],[1,"mat-button-toggle-focus-overlay"],["matRipple","",1,"mat-button-toggle-ripple",3,"matRippleTrigger","matRippleDisabled"],["state","checked","aria-hidden","true","appearance","minimal",3,"disabled"]],template:function(t,n){if(t&1&&(yC(),ws(0,"button",1,0),Rg("click",function(){return n._onButtonClick()}),Jw(2,Ft,2,1,"div",2),ws(3,"span",3),vC(4),pl()(),Sg(5,"span",4)(6,"span",5)),t&2){let o=CC(1);bg("id",n.buttonId)("disabled",n.disabled&&!n.disabledInteractive||null),Tg("role",n.isSingleSelector()?"radio":"button")("tabindex",n.disabled&&!n.disabledInteractive?-1:n.tabIndex)("aria-pressed",n.isSingleSelector()?null:n.checked)("aria-checked",n.isSingleSelector()?n.checked:null)("name",n._getButtonName())("aria-label",n.ariaLabel)("aria-labelledby",n.ariaLabelledby)("aria-disabled",n.disabled&&n.disabledInteractive?"true":null),XE(2),eC(n.buttonToggleGroup&&(!n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideSingleSelectionIndicator||n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideMultipleSelectionIndicator)?2:-1),XE(4),bg("matRippleTrigger",o)("matRippleDisabled",n.disableRipple||n.disabled);}},dependencies:[Oi,An],styles:[`.mat-button-toggle-standalone,
1
+ import {x as xe}from'./chunk-CPWl0V02.js';import {P as Pt$1,L as Lt}from'./chunk-DZdAT-59.js';import {v as ve,n as ne}from'./chunk-D6D0Z7ht.js';import {d}from'./chunk-D84a_Xjq.js';import {W,k as ke,s as se}from'./chunk-BMUzpXmO.js';import {T as Tn,S as Sn,n as nt,a as ae,l as le,c as ce}from'./chunk-BgIYpV8F.js';import {$ as $n,o as ot,i as it,I as In,E as Ee,z as ze,a as Sa,D as Dn,F as Fn,g as gt$1,A as An}from'./chunk-CnOd7CqJ.js';import'./chunk-JZld8hhU.js';import {g,bm as Mm,R as Re,G as Gi,m as mT,e as xw,h as hr,j as Gn,k as ws,q as Rg,n as GC,o as pl,a3 as VI,J as Jw,af as Eg,ag as fT,t as CC,X as XE,u as bg,a6 as UI,v as eC,Y as z,Z as Ue,am as qm,_ as zt$1,a0 as jt$1,a1 as Vt,a2 as Nt$1,i as pr,ai as tm,aj as KC,s as rC,a8 as Yg,ak as em,y as oC,a5 as vl,ac as gC,a9 as lC,aa as If,ab as wf,bp as ml,bq as yl,ah as rT,b4 as oT,aL as wo,aM as Zn$1,br as sn,aO as wt$1,bs as Tl,bt as Qn,aT as Ut$1,al as vt$1,aW as C,bu as Ve,aZ as js,a_ as QT,b5 as nT,T as Tg,z as Ug,bv as Fg,E as EC,I as IC,az as Xt$1,bw as St,aS as K$1,aX as D$1,bx as on,by as um,bz as Oi,bA as yC,bB as vC,S as Sg,B as Pg,bC as Si,bo as tC}from'./main-CB44G2DK.js';import {y as yt$1,w as wt,t as ti,Z as Zn,c as cn,Y as Ye,f as fn,g as gt,$ as $t$1,D}from'./chunk-BDPQgAAh.js';var Pt=["button"],Ot=["*"];function Ft(l,a){if(l&1&&(ws(0,"div",2),Sg(1,"mat-pseudo-checkbox",6),pl()),l&2){let e=gC();XE(),bg("disabled",e.disabled);}}var yt=new C("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS",{providedIn:"root",factory:()=>({hideSingleSelectionIndicator:false,hideMultipleSelectionIndicator:false,disabledInteractive:false})}),vt=new C("MatButtonToggleGroup"),Dt={provide:D,useExisting:Si(()=>ie),multi:true},K=class{source;value;constructor(a,e){this.source=a,this.value=e;}},ie=(()=>{class l{_changeDetector=g(Tl);_dir=g(Qn,{optional:true});_multiple=false;_disabled=false;_disabledInteractive=false;_selectionModel;_rawValue;_controlValueAccessorChangeFn=()=>{};_onTouched=()=>{};_buttonToggles;appearance;get name(){return this._name}set name(e){this._name=e,this._markButtonsForCheck();}_name=g(Ut$1).getId("mat-button-toggle-group-");vertical=false;get value(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e.map(t=>t.value):e[0]?e[0].value:void 0}set value(e){this._setSelectionByValue(e),this.valueChange.emit(this.value);}valueChange=new vt$1;get selected(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e:e[0]||null}get multiple(){return this._multiple}set multiple(e){this._multiple=e,this._markButtonsForCheck();}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._markButtonsForCheck();}get disabledInteractive(){return this._disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e,this._markButtonsForCheck();}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}change=new vt$1;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._markButtonsForCheck();}_hideSingleSelectionIndicator;get hideMultipleSelectionIndicator(){return this._hideMultipleSelectionIndicator}set hideMultipleSelectionIndicator(e){this._hideMultipleSelectionIndicator=e,this._markButtonsForCheck();}_hideMultipleSelectionIndicator;constructor(){let e=g(yt,{optional:true});this.appearance=e&&e.appearance?e.appearance:"standard",this._hideSingleSelectionIndicator=e?.hideSingleSelectionIndicator??false,this._hideMultipleSelectionIndicator=e?.hideMultipleSelectionIndicator??false;}ngOnInit(){this._selectionModel=new gt$1(this.multiple,void 0,false);}ngAfterContentInit(){this._selectionModel.select(...this._buttonToggles.filter(e=>e.checked)),this.multiple||this._initializeTabIndex();}writeValue(e){this.value=e,this._changeDetector.markForCheck();}registerOnChange(e){this._controlValueAccessorChangeFn=e;}registerOnTouched(e){this._onTouched=e;}setDisabledState(e){this.disabled=e;}_keydown(e){if(this.multiple||this.disabled||Ve(e))return;let n=e.target.id,o=this._buttonToggles.toArray().findIndex(I=>I.buttonId===n),u=null;switch(e.keyCode){case 32:case 13:u=this._buttonToggles.get(o)||null;break;case 38:u=this._getNextButton(o,-1);break;case 37:u=this._getNextButton(o,this.dir==="ltr"?-1:1);break;case 40:u=this._getNextButton(o,1);break;case 39:u=this._getNextButton(o,this.dir==="ltr"?1:-1);break;default:return}u&&(e.preventDefault(),u._onButtonClick(),u.focus());}_emitChangeEvent(e){let t=new K(e,this.value);this._rawValue=t.value,this._controlValueAccessorChangeFn(t.value),this.change.emit(t);}_syncButtonToggle(e,t,n=false,o=false){!this.multiple&&this.selected&&!e.checked&&(this.selected.checked=false),this._selectionModel?t?this._selectionModel.select(e):this._selectionModel.deselect(e):o=true,o?Promise.resolve().then(()=>this._updateModelValue(e,n)):this._updateModelValue(e,n);}_isSelected(e){return this._selectionModel&&this._selectionModel.isSelected(e)}_isPrechecked(e){return typeof this._rawValue>"u"?false:this.multiple&&Array.isArray(this._rawValue)?this._rawValue.some(t=>e.value!=null&&t===e.value):e.value===this._rawValue}_initializeTabIndex(){if(this._buttonToggles.forEach(e=>{e.tabIndex=-1;}),this.selected)this.selected.tabIndex=0;else for(let e=0;e<this._buttonToggles.length;e++){let t=this._buttonToggles.get(e);if(!t.disabled){t.tabIndex=0;break}}}_getNextButton(e,t){let n=this._buttonToggles;for(let o=1;o<=n.length;o++){let u=(e+t*o+n.length)%n.length,I=n.get(u);if(I&&!I.disabled)return I}return null}_setSelectionByValue(e){if(this._rawValue=e,!this._buttonToggles)return;let t=this._buttonToggles.toArray();if(this.multiple&&e?(this._clearSelection(),e.forEach(n=>this._selectValue(n,t))):(this._clearSelection(),this._selectValue(e,t)),!this.multiple&&t.every(n=>n.tabIndex===-1)){for(let n of t)if(!n.disabled){n.tabIndex=0;break}}}_clearSelection(){this._selectionModel.clear(),this._buttonToggles.forEach(e=>{e.checked=false,this.multiple||(e.tabIndex=-1);});}_selectValue(e,t){for(let n of t)if(n.value===e){n.checked=true,this._selectionModel.select(n),this.multiple||(n.tabIndex=0);break}}_updateModelValue(e,t){t&&this._emitChangeEvent(e),this.valueChange.emit(this.value);}_markButtonsForCheck(){this._buttonToggles?.forEach(e=>e._markForCheck());}static \u0275fac=function(t){return new(t||l)};static \u0275dir=js({type:l,selectors:[["mat-button-toggle-group"]],contentQueries:function(t,n,o){if(t&1&&Fg(o,X,5),t&2){let u;EC(u=IC())&&(n._buttonToggles=u);}},hostAttrs:[1,"mat-button-toggle-group"],hostVars:6,hostBindings:function(t,n){t&1&&Rg("keydown",function(u){return n._keydown(u)}),t&2&&(Tg("role",n.multiple?"group":"radiogroup")("aria-disabled",n.disabled),Ug("mat-button-toggle-vertical",n.vertical)("mat-button-toggle-group-appearance-standard",n.appearance==="standard"));},inputs:{appearance:"appearance",name:"name",vertical:[2,"vertical","vertical",QT],value:"value",multiple:[2,"multiple","multiple",QT],disabled:[2,"disabled","disabled",QT],disabledInteractive:[2,"disabledInteractive","disabledInteractive",QT],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",QT],hideMultipleSelectionIndicator:[2,"hideMultipleSelectionIndicator","hideMultipleSelectionIndicator",QT]},outputs:{valueChange:"valueChange",change:"change"},exportAs:["matButtonToggleGroup"],features:[nT([Dt,{provide:vt,useExisting:l}])]})}return l})(),X=(()=>{class l{_changeDetectorRef=g(Tl);_elementRef=g(Xt$1);_focusMonitor=g(St);_idGenerator=g(Ut$1);_animationDisabled=K$1();_checked=false;ariaLabel;ariaLabelledby=null;_buttonElement;buttonToggleGroup;get buttonId(){return `${this.id}-button`}id;name;value;get tabIndex(){return this._tabIndex()}set tabIndex(e){this._tabIndex.set(e);}_tabIndex;disableRipple=false;get appearance(){return this.buttonToggleGroup?this.buttonToggleGroup.appearance:this._appearance}set appearance(e){this._appearance=e;}_appearance;get checked(){return this.buttonToggleGroup?this.buttonToggleGroup._isSelected(this):this._checked}set checked(e){e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&this.buttonToggleGroup._syncButtonToggle(this,this._checked),this._changeDetectorRef.markForCheck());}get disabled(){return this._disabled||this.buttonToggleGroup&&this.buttonToggleGroup.disabled}set disabled(e){this._disabled=e;}_disabled=false;get disabledInteractive(){return this._disabledInteractive||this.buttonToggleGroup!==null&&this.buttonToggleGroup.disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e;}_disabledInteractive;change=new vt$1;constructor(){g(D$1).load(on);let e=g(vt,{optional:true}),t=g(new um("tabindex"),{optional:true})||"",n=g(yt,{optional:true});this._tabIndex=Gi(parseInt(t)||0),this.buttonToggleGroup=e,this._appearance=n&&n.appearance?n.appearance:"standard",this._disabledInteractive=n?.disabledInteractive??false;}ngOnInit(){let e=this.buttonToggleGroup;this.id=this.id||this._idGenerator.getId("mat-button-toggle-"),e&&(e._isPrechecked(this)?this.checked=true:e._isSelected(this)!==this._checked&&e._syncButtonToggle(this,this._checked));}ngAfterViewInit(){this._animationDisabled||this._elementRef.nativeElement.classList.add("mat-button-toggle-animations-enabled"),this._focusMonitor.monitor(this._elementRef,true);}ngOnDestroy(){let e=this.buttonToggleGroup;this._focusMonitor.stopMonitoring(this._elementRef),e&&e._isSelected(this)&&e._syncButtonToggle(this,false,false,true);}focus(e){this._buttonElement.nativeElement.focus(e);}_onButtonClick(){if(this.disabled)return;let e=this.isSingleSelector()?true:!this._checked;if(e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&(this.buttonToggleGroup._syncButtonToggle(this,this._checked,true),this.buttonToggleGroup._onTouched())),this.isSingleSelector()){let t=this.buttonToggleGroup._buttonToggles.find(n=>n.tabIndex===0);t&&(t.tabIndex=-1),this.tabIndex=0;}this.change.emit(new K(this,this.value));}_markForCheck(){this._changeDetectorRef.markForCheck();}_getButtonName(){return this.isSingleSelector()?this.buttonToggleGroup.name:this.name||null}isSingleSelector(){return this.buttonToggleGroup&&!this.buttonToggleGroup.multiple}static \u0275fac=function(t){return new(t||l)};static \u0275cmp=xw({type:l,selectors:[["mat-button-toggle"]],viewQuery:function(t,n){if(t&1&&Pg(Pt,5),t&2){let o;EC(o=IC())&&(n._buttonElement=o.first);}},hostAttrs:["role","presentation",1,"mat-button-toggle"],hostVars:14,hostBindings:function(t,n){t&1&&Rg("focus",function(){return n.focus()}),t&2&&(Tg("aria-label",null)("aria-labelledby",null)("id",n.id)("name",null),Ug("mat-button-toggle-standalone",!n.buttonToggleGroup)("mat-button-toggle-checked",n.checked)("mat-button-toggle-disabled",n.disabled)("mat-button-toggle-disabled-interactive",n.disabledInteractive)("mat-button-toggle-appearance-standard",n.appearance==="standard"));},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],id:"id",name:"name",value:"value",tabIndex:"tabIndex",disableRipple:[2,"disableRipple","disableRipple",QT],appearance:"appearance",checked:[2,"checked","checked",QT],disabled:[2,"disabled","disabled",QT],disabledInteractive:[2,"disabledInteractive","disabledInteractive",QT]},outputs:{change:"change"},exportAs:["matButtonToggle"],ngContentSelectors:Ot,decls:7,vars:13,consts:[["button",""],["type","button",1,"mat-button-toggle-button","mat-focus-indicator",3,"click","id","disabled"],[1,"mat-button-toggle-checkbox-wrapper"],[1,"mat-button-toggle-label-content"],[1,"mat-button-toggle-focus-overlay"],["matRipple","",1,"mat-button-toggle-ripple",3,"matRippleTrigger","matRippleDisabled"],["state","checked","aria-hidden","true","appearance","minimal",3,"disabled"]],template:function(t,n){if(t&1&&(yC(),ws(0,"button",1,0),Rg("click",function(){return n._onButtonClick()}),Jw(2,Ft,2,1,"div",2),ws(3,"span",3),vC(4),pl()(),Sg(5,"span",4)(6,"span",5)),t&2){let o=CC(1);bg("id",n.buttonId)("disabled",n.disabled&&!n.disabledInteractive||null),Tg("role",n.isSingleSelector()?"radio":"button")("tabindex",n.disabled&&!n.disabledInteractive?-1:n.tabIndex)("aria-pressed",n.isSingleSelector()?null:n.checked)("aria-checked",n.isSingleSelector()?n.checked:null)("name",n._getButtonName())("aria-label",n.ariaLabel)("aria-labelledby",n.ariaLabelledby)("aria-disabled",n.disabled&&n.disabledInteractive?"true":null),XE(2),eC(n.buttonToggleGroup&&(!n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideSingleSelectionIndicator||n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideMultipleSelectionIndicator)?2:-1),XE(4),bg("matRippleTrigger",o)("matRippleDisabled",n.disableRipple||n.disabled);}},dependencies:[Oi,An],styles:[`.mat-button-toggle-standalone,
2
2
  .mat-button-toggle-group {
3
3
  position: relative;
4
4
  display: inline-flex;
@@ -1 +1 @@
1
- import {m}from'./chunk-CfodLKpx.js';import {g,ao as W,F,C as Ce,aJ as Tr,G as Gi,bS as Ea,M as By,a7 as ya,Q as br,b as U$1,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,v as eC,s as rC,ac as gC,y as oC,a8 as Yg,u as bg,a9 as lC,aa as If,ab as wf}from'./main-R5QFX3OD.js';import {d as Kn,J as Jn,Y as Yn}from'./chunk-D88hl6XI.js';import'./chunk-odhKIvc0.js';import'./chunk-D2rCay4H.js';import'./chunk-5Y113ccl.js';var V=(e,t)=>t.key;function j(e,t){e&1&&(ws(0,"p",2),GC(1,"Loading prompts\u2026"),pl());}function z(e,t){e&1&&(ws(0,"p",3),GC(1,"No prompts available."),pl());}function A(e,t){e&1&&(ws(0,"ds-tag",11),GC(1,"Read-only"),pl());}function B(e,t){if(e&1){let n=lC();ws(0,"button",14),Rg("click",function(){If(n);let s=gC().$implicit,f=gC(2);return wf(f.edit(s))}),GC(1,"Edit"),pl(),ws(2,"button",15),Rg("click",function(){If(n);let s=gC().$implicit,f=gC(2);return wf(f.delete(s))}),GC(3,"Delete"),pl();}}function H(e,t){e&1&&(ws(0,"button",13),GC(1,"Inherited"),pl());}function J(e,t){if(e&1&&(ws(0,"tr")(1,"td",7),GC(2),pl(),ws(3,"td",8),GC(4),pl(),ws(5,"td")(6,"div",9)(7,"ds-tag",10),GC(8),pl(),Jw(9,A,2,0,"ds-tag",11),pl()(),ws(10,"td",12),Jw(11,B,4,0)(12,H,2,0,"button",13),pl()()),e&2){let n=t.$implicit;XE(2),Yg(n.prompt.name),XE(2),Yg(n.prompt.description||"\u2014"),XE(3),bg("variant",n.scope==="platform"?"neutral":"accent"),XE(),Yg(n.scope==="platform"?"Platform":"Namespace"),XE(),eC(n.scope==="platform"?9:-1),XE(2),eC(n.scope==="namespace"?11:12);}}function U(e,t){if(e&1&&(ws(0,"div",4)(1,"table",5)(2,"thead")(3,"tr")(4,"th"),GC(5,"Name"),pl(),ws(6,"th"),GC(7,"Description"),pl(),ws(8,"th"),GC(9,"Scope"),pl(),ws(10,"th")(11,"span",6),GC(12,"Actions"),pl()()()(),ws(13,"tbody"),rC(14,J,13,6,"tr",null,V),pl()()()),e&2){let n=gC();XE(14),oC(n.rows());}}var L=class e{route=g(W);router=g(F);destroyRef=g(Ce);promptState=g(m);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=Gi(true);rows=Gi([]);allPrompts$=this.refresh$.pipe(Ea(()=>(this.isLoading.set(true),By({platform:this.promptState.listPlatform().pipe(ya(()=>br([]))),namespace:this.promptState.listByNamespace(this.namespaceId)}))));constructor(){this.allPrompts$.pipe(U$1(this.destroyRef)).subscribe({next:({platform:t,namespace:n})=>{this.rows.set([...t.map((a,s)=>({key:`platform:${a.id??s}`,prompt:a,scope:"platform"})),...n.map((a,s)=>({key:`namespace:${a.id??s}`,prompt:a,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"prompts","new"]);}edit(t){t.scope==="platform"||!t.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"prompts",t.prompt.id,"edit"]);}delete(t){t.scope==="platform"||!t.prompt.id||!confirm(`Delete prompt \u201C${t.prompt.name}\u201D?`)||this.promptState.delete(t.prompt.id).pipe(U$1(this.destroyRef)).subscribe(()=>this.refresh$.next());}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=xw({type:e,selectors:[["agentos-namespace-prompts"]],decls:6,vars:1,consts:[["title","Prompts","description","Prompts available in this namespace, including prompts inherited from the platform."],["type","button",1,"prompts__new",3,"click"],["role","status",1,"prompts__status"],[1,"prompts__status"],[1,"prompts__table-wrap"],["dsTable",""],[1,"sr-only"],[1,"prompts__name"],[1,"prompts__description"],[1,"prompts__tags"],[3,"variant"],["variant","outline"],[1,"prompts__actions"],["type","button","disabled",""],["type","button",3,"click"],["type","button",1,"prompts__delete",3,"click"]],template:function(n,a){n&1&&(ws(0,"ds-section-header",0)(1,"button",1),Rg("click",function(){return a.openCreateForm()}),GC(2,"New prompt"),pl()(),Jw(3,j,2,0,"p",2)(4,z,2,0,"p",3)(5,U,16,0,"div",4)),n&2&&(XE(3),eC(a.isLoading()?3:a.rows().length===0?4:5));},dependencies:[Kn,Jn,Yn],styles:[".prompts__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}.prompts__status[_ngcontent-%COMP%]{margin:20px 8px;color:var(--color-text-secondary)}.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)}.prompts__name[_ngcontent-%COMP%]{font-weight:500}.prompts__description[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.prompts__tags[_ngcontent-%COMP%]{display:flex;gap:4px;flex-wrap:wrap}.prompts__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:4px;white-space:nowrap}.prompts__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:4px 7px;border:1px solid transparent;background:transparent;color:var(--color-accent);cursor:pointer;font:inherit}.prompts__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-100)}.prompts__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{color:var(--color-neutral-600);cursor:default}.prompts__actions[_ngcontent-%COMP%] .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}"]})};export{L as NamespacePromptsComponent};
1
+ import {m}from'./chunk-CigBS2kT.js';import {g,ao as W,F,C as Ce,aJ as Tr,G as Gi,bS as Ea,M as By,a7 as ya,Q as br,b as U$1,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,v as eC,s as rC,ac as gC,y as oC,a8 as Yg,u as bg,a9 as lC,aa as If,ab as wf}from'./main-CB44G2DK.js';import {d as Kn,J as Jn,Y as Yn}from'./chunk-CnOd7CqJ.js';import'./chunk-JZld8hhU.js';import'./chunk-BDPQgAAh.js';import'./chunk-DzLzwtOe.js';var V=(e,t)=>t.key;function j(e,t){e&1&&(ws(0,"p",2),GC(1,"Loading prompts\u2026"),pl());}function z(e,t){e&1&&(ws(0,"p",3),GC(1,"No prompts available."),pl());}function A(e,t){e&1&&(ws(0,"ds-tag",11),GC(1,"Read-only"),pl());}function B(e,t){if(e&1){let n=lC();ws(0,"button",14),Rg("click",function(){If(n);let s=gC().$implicit,f=gC(2);return wf(f.edit(s))}),GC(1,"Edit"),pl(),ws(2,"button",15),Rg("click",function(){If(n);let s=gC().$implicit,f=gC(2);return wf(f.delete(s))}),GC(3,"Delete"),pl();}}function H(e,t){e&1&&(ws(0,"button",13),GC(1,"Inherited"),pl());}function J(e,t){if(e&1&&(ws(0,"tr")(1,"td",7),GC(2),pl(),ws(3,"td",8),GC(4),pl(),ws(5,"td")(6,"div",9)(7,"ds-tag",10),GC(8),pl(),Jw(9,A,2,0,"ds-tag",11),pl()(),ws(10,"td",12),Jw(11,B,4,0)(12,H,2,0,"button",13),pl()()),e&2){let n=t.$implicit;XE(2),Yg(n.prompt.name),XE(2),Yg(n.prompt.description||"\u2014"),XE(3),bg("variant",n.scope==="platform"?"neutral":"accent"),XE(),Yg(n.scope==="platform"?"Platform":"Namespace"),XE(),eC(n.scope==="platform"?9:-1),XE(2),eC(n.scope==="namespace"?11:12);}}function U(e,t){if(e&1&&(ws(0,"div",4)(1,"table",5)(2,"thead")(3,"tr")(4,"th"),GC(5,"Name"),pl(),ws(6,"th"),GC(7,"Description"),pl(),ws(8,"th"),GC(9,"Scope"),pl(),ws(10,"th")(11,"span",6),GC(12,"Actions"),pl()()()(),ws(13,"tbody"),rC(14,J,13,6,"tr",null,V),pl()()()),e&2){let n=gC();XE(14),oC(n.rows());}}var L=class e{route=g(W);router=g(F);destroyRef=g(Ce);promptState=g(m);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=Gi(true);rows=Gi([]);allPrompts$=this.refresh$.pipe(Ea(()=>(this.isLoading.set(true),By({platform:this.promptState.listPlatform().pipe(ya(()=>br([]))),namespace:this.promptState.listByNamespace(this.namespaceId)}))));constructor(){this.allPrompts$.pipe(U$1(this.destroyRef)).subscribe({next:({platform:t,namespace:n})=>{this.rows.set([...t.map((a,s)=>({key:`platform:${a.id??s}`,prompt:a,scope:"platform"})),...n.map((a,s)=>({key:`namespace:${a.id??s}`,prompt:a,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"prompts","new"]);}edit(t){t.scope==="platform"||!t.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"prompts",t.prompt.id,"edit"]);}delete(t){t.scope==="platform"||!t.prompt.id||!confirm(`Delete prompt \u201C${t.prompt.name}\u201D?`)||this.promptState.delete(t.prompt.id).pipe(U$1(this.destroyRef)).subscribe(()=>this.refresh$.next());}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=xw({type:e,selectors:[["agentos-namespace-prompts"]],decls:6,vars:1,consts:[["title","Prompts","description","Prompts available in this namespace, including prompts inherited from the platform."],["type","button",1,"prompts__new",3,"click"],["role","status",1,"prompts__status"],[1,"prompts__status"],[1,"prompts__table-wrap"],["dsTable",""],[1,"sr-only"],[1,"prompts__name"],[1,"prompts__description"],[1,"prompts__tags"],[3,"variant"],["variant","outline"],[1,"prompts__actions"],["type","button","disabled",""],["type","button",3,"click"],["type","button",1,"prompts__delete",3,"click"]],template:function(n,a){n&1&&(ws(0,"ds-section-header",0)(1,"button",1),Rg("click",function(){return a.openCreateForm()}),GC(2,"New prompt"),pl()(),Jw(3,j,2,0,"p",2)(4,z,2,0,"p",3)(5,U,16,0,"div",4)),n&2&&(XE(3),eC(a.isLoading()?3:a.rows().length===0?4:5));},dependencies:[Kn,Jn,Yn],styles:[".prompts__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}.prompts__status[_ngcontent-%COMP%]{margin:20px 8px;color:var(--color-text-secondary)}.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)}.prompts__name[_ngcontent-%COMP%]{font-weight:500}.prompts__description[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.prompts__tags[_ngcontent-%COMP%]{display:flex;gap:4px;flex-wrap:wrap}.prompts__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:4px;white-space:nowrap}.prompts__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:4px 7px;border:1px solid transparent;background:transparent;color:var(--color-accent);cursor:pointer;font:inherit}.prompts__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-100)}.prompts__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{color:var(--color-neutral-600);cursor:default}.prompts__actions[_ngcontent-%COMP%] .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}"]})};export{L as NamespacePromptsComponent};
@@ -1 +1 @@
1
- import {S as St}from'./chunk-CptnPQPc.js';import {an as ue,g,L,ao as W,F,N as N$1,ap as Cd,e as xw,aq as a,ar as S,as as F$1,at as c,k as ws,q as Rg,J as Jw,o as pl,u as bg,X as XE,v as eC,B as Pg,E as EC,I as IC,au as tv,ae as kt,av as B,W as x,aw as hl,n as GC,ax as gl,a8 as Yg,a9 as lC,aa as If,ac as gC,ab as wf,S as Sg}from'./main-R5QFX3OD.js';import {a as at,s as st,r as rt,_ as _i}from'./chunk-DfOj7Ckk.js';import'./chunk-CGtfhng3.js';import {G as Ge}from'./chunk-C8OjnVE9.js';import'./chunk-5Y113ccl.js';import'./chunk-nTJ-vUJP.js';import'./chunk-CEcYVC8L.js';import'./chunk-CknzYxoU.js';import'./chunk-CSXW8eI5.js';import'./chunk-D88hl6XI.js';import'./chunk-odhKIvc0.js';import'./chunk-D2rCay4H.js';var T=class o{welcomeMessages=["Welcome to Coday","Bienvenue sur Coday","Bienvenido a Coday","Willkommen bei Coday","Benvenuto su Coday","Bem-vindo ao Coday","Welkom bij Coday","\u0414\u043E\u0431\u0440\u043E \u043F\u043E\u0436\u0430\u043B\u043E\u0432\u0430\u0442\u044C \u0432 Coday","Coday \u3078\u3088\u3046\u3053\u305D","\u6B22\u8FCE\u6765\u5230 Coday","Coday \uC5D0 \uC624\uC2E0 \uAC83\uC744 \uD658\uC601\uD569\uB2C8\uB2E4","\u0645\u0631\u062D\u0628\u064B\u0627 \u0628\u0643 \u0641\u064A Coday"];currentWelcomeIndex=0;currentWelcomeMessage=this.welcomeMessages[0];welcomeRotationInterval;ngOnInit(){this.startWelcomeRotation();}ngOnDestroy(){this.stopWelcomeRotation();}startWelcomeRotation(){this.welcomeRotationInterval=window.setInterval(()=>{this.currentWelcomeIndex=(this.currentWelcomeIndex+1)%this.welcomeMessages.length,this.currentWelcomeMessage=this.welcomeMessages[this.currentWelcomeIndex];},3e3);}stopWelcomeRotation(){this.welcomeRotationInterval&&(clearInterval(this.welcomeRotationInterval),this.welcomeRotationInterval=void 0);}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=xw({type:o,selectors:[["app-welcome-message"]],decls:2,vars:1,consts:[[1,"welcome-title"]],template:function(t,i){t&1&&(hl(0,"h1",0),GC(1),gl()),t&2&&(XE(),Yg(i.currentWelcomeMessage));},styles:[".welcome-title[_ngcontent-%COMP%]{font-size:clamp(1.5rem,4vw,4rem);font-weight:700;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite;margin:0;padding:0;line-height:1.2;transition:opacity .5s ease-in-out;display:block;min-height:1.2em;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0% center}50%{background-position:100% center}to{background-position:0% center}}"],changeDetection:1})};var N=class o{destroy$=new ue;isSetup=false;codayService=g(Ge);preferencesService=g(L);setup(){if(this.isSetup){console.warn("[AGENT-NOTIFICATION] Service already set up");return}console.log("[AGENT-NOTIFICATION] Setting up agent notification service"),this.codayService.isThinking$.pipe(Cd(this.destroy$),tv(),kt(([e,t])=>e===true&&t===false)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Agent stopped thinking, notifying task finished"),this.notifyTaskFinishedIfEnabled();}),this.preferencesService.browserNotificationEnabled$.pipe(Cd(this.destroy$),tv(),kt(([e,t])=>e===false&&t===true)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Browser notifications enabled, checking permission"),this.handleBrowserNotificationEnabled();}),this.isSetup=true;}notifyTaskFinishedIfEnabled(){this.preferencesService.getAgentNotificationEnabled()&&(this.preferencesService.getNotificationSoundEnabled()&&this.playCompletionSound(),this.preferencesService.getBrowserNotificationEnabled()&&this.sendBrowserNotification());}playCompletionSound(){try{let e=new(window.AudioContext||window.webkitAudioContext),t=e.createOscillator(),i=e.createGain();t.connect(i),i.connect(e.destination),t.frequency.setValueAtTime(700,e.currentTime),i.gain.setValueAtTime(.1,e.currentTime),i.gain.exponentialRampToValueAtTime(.01,e.currentTime+.08),t.start(e.currentTime),t.stop(e.currentTime+.08);let n=e.createOscillator(),r=e.createGain();n.connect(r),r.connect(e.destination);let l=e.currentTime+.11;n.frequency.setValueAtTime(950,l),r.gain.setValueAtTime(.1,l),r.gain.exponentialRampToValueAtTime(.01,l+.09),n.start(l),n.stop(l+.09),console.log("[AGENT-NOTIFICATION] Completion sound played");}catch(e){console.error("[AGENT-NOTIFICATION] Failed to play completion sound:",e);}}handleBrowserNotificationEnabled(){return B(this,null,function*(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications"),this.preferencesService.setBrowserNotificationEnabled(false);return}if(Notification.permission==="denied"){console.warn("[AGENT-NOTIFICATION] Permission denied, disabling browser notifications"),this.preferencesService.setBrowserNotificationEnabled(false);return}if(Notification.permission==="granted"){console.log("[AGENT-NOTIFICATION] Permission already granted, showing confirmation"),this.createConfirmationNotification();return}try{(yield Notification.requestPermission())==="granted"?(console.log("[AGENT-NOTIFICATION] Permission granted, showing confirmation"),this.createConfirmationNotification()):(console.log("[AGENT-NOTIFICATION] Permission denied or dismissed"),this.preferencesService.setBrowserNotificationEnabled(!1));}catch(e){console.error("[AGENT-NOTIFICATION] Error requesting permission:",e),this.preferencesService.setBrowserNotificationEnabled(false);}})}sendBrowserNotification(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications");return}if(document.hasFocus()){console.warn("[AGENT-NOTIFICATION] Document is focused, skipping browser notification");return}Notification.permission==="granted"?this.createTaskCompleteNotification():console.warn("[AGENT-NOTIFICATION] Permission not granted, cannot send notification");}createConfirmationNotification(){let e=new Notification("Coday - Notifications Enabled",{body:"You will be notified when the agent completes tasks",icon:"/favicon.ico",tag:"coday-notifications-enabled",requireInteraction:false});setTimeout(()=>e.close(),4e3),e.onclick=()=>{window.focus(),e.close();},console.log("[AGENT-NOTIFICATION] Confirmation notification sent");}createTaskCompleteNotification(){let e=new Notification("Coday - Task Complete",{body:"The agent has finished and is waiting for your input",icon:"/favicon.ico",tag:"coday-task-complete",requireInteraction:false});setTimeout(()=>e.close(),5e3),e.onclick=()=>{window.focus(),e.close();},console.log("[AGENT-NOTIFICATION] Task complete notification sent");}ngOnDestroy(){console.log("[AGENT-NOTIFICATION] Service destroyed"),this.destroy$.next(),this.destroy$.complete();}static \u0275fac=function(t){return new(t||o)};static \u0275prov=x({token:o,factory:o.\u0275fac,providedIn:"root"})};var Z=["inputSection"];function ee(o,e){if(o&1){let t=lC();ws(0,"app-thread",4),Rg("chatFocused",function(){If(t);let n=gC();return wf(n.onChatFocusedOnMobile())})("drawerStateChange",function(n){If(t);let r=gC();return wf(r.onDrawerStateChange(n))}),pl();}if(o&2){let t=gC();bg("projectName",t.projectName)("threadId",t.threadId);}}function te(o,e){if(o&1){let t=lC();ws(0,"div",5),Sg(1,"app-welcome-message"),pl(),ws(2,"div",6,0)(4,"div",7)(5,"div",8)(6,"app-chat-textarea",9),Rg("messageSubmitted",function(n){If(t);let r=gC();return wf(r.onMessageSubmitted(n))})("voiceMessageReady",function(n){If(t);let r=gC();return wf(r.onVoiceMessageReady(n))})("voiceRecordingToggled",function(n){If(t);let r=gC();return wf(r.onVoiceToggled(n))})("heightChanged",function(n){If(t);let r=gC();return wf(r.onInputHeightChanged(n))})("textareaFocused",function(){If(t);let n=gC();return wf(n.onChatFocusedOnMobile())}),pl()()()();}if(o&2){let t=gC();XE(6),bg("isDisabled",t.isSessionInitializing)("isSessionInitializing",t.isSessionInitializing)("showWelcome",true)("isThinking",false)("isStarting",t.isStartingFirstMessage);}}var K=class o{destroy$=new ue;inputSection;sidenav;projectName="";threadId=null;isSessionInitializing=false;isStartingFirstMessage=false;inputSectionHeight=80;codayService=g(Ge);titleService=g(at);preferencesService=g(L);route=g(W);router=g(F);threadApiService=g(N$1);agentNotificationService=g(N);firstMessageState=g(st);constructor(){console.log("[MAIN-APP] Using new thread-based architecture (no clientId needed)");}ngOnInit(){this.agentNotificationService.setup(),this.setupPrintHandlers(),this.route.params.pipe(Cd(this.destroy$)).subscribe(e=>{let t=e.projectName,i=e.threadId||null;console.log("[MAIN-APP] Route params updated:",{project:t,thread:i,previousProject:this.projectName,previousThread:this.threadId}),this.projectName=t,this.threadId=i,this.threadId?console.log("[MAIN-APP] Thread selected - ThreadComponent will display"):(console.log("[MAIN-APP] No thread selected - showing welcome view"),this.initializeWelcomeView());});}initializeWelcomeView(){this.codayService.setTabTitleService(this.titleService);}ngAfterViewInit(){setTimeout(()=>this.updateInputSectionHeight(),100);}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),window.removeEventListener("beforeprint",this.handleBeforePrint),window.removeEventListener("afterprint",this.handleAfterPrint);}onMessageSubmitted(e){console.log("[MAIN-APP] First message submitted from welcome view:",e),this.isSessionInitializing=true,this.isStartingFirstMessage=true,this.threadApiService.createThread().subscribe({next:t=>{console.log("[MAIN-APP] Thread created:",t.thread.id),this.firstMessageState.setPendingFirstMessage(e),this.router.navigate(["project",this.projectName,"thread",t.thread.id]);},error:t=>{console.error("[MAIN-APP] Failed to create thread:",t),this.isSessionInitializing=false,this.isStartingFirstMessage=false,alert("Failed to create conversation: "+(t.message||"Unknown error"));}});}onVoiceToggled(e){console.log("[VOICE] Recording in welcome view:",e);}onVoiceMessageReady(e){console.log("[MAIN-APP] Voice message ready from welcome view"),this.isSessionInitializing=true,this.isStartingFirstMessage=true,this.threadApiService.createThread().subscribe({next:t=>{console.log("[MAIN-APP] Thread created for voice message:",t.thread.id),this.firstMessageState.setPendingVoiceMessage(e),this.router.navigate(["project",this.projectName,"thread",t.thread.id]);},error:t=>{console.error("[MAIN-APP] Failed to create thread for voice message:",t),this.isSessionInitializing=false,this.isStartingFirstMessage=false,alert("Failed to create conversation: "+(t.message||"Unknown error"));}});}isDrawerOpen=false;onDrawerStateChange(e){this.isDrawerOpen=e;}onChatFocusedOnMobile(){window.innerWidth<1024&&this.sidenav?.close();}onInputHeightChanged(e){console.log("[MAIN-APP] Input height changed:",e),this.inputSectionHeight=e;}updateInputSectionHeight(){if(this.inputSection?.nativeElement){let e=this.inputSection.nativeElement.offsetHeight;e!==this.inputSectionHeight&&(console.log("[MAIN-APP] Input section height updated:",e),this.inputSectionHeight=e);}}setupPrintHandlers(){window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint);}handleBeforePrint=()=>{console.log("[PRINT] Before print event triggered");let e=this.preferencesService.getPrintTechnicalMessages();console.log("[PRINT] Print technical messages:",e),e?document.body.classList.add("print-include-technical"):document.body.classList.remove("print-include-technical");};handleAfterPrint=()=>{console.log("[PRINT] After print event triggered"),document.body.classList.remove("print-include-technical");};static \u0275fac=function(t){return new(t||o)};static \u0275cmp=xw({type:o,selectors:[["app-main"]],viewQuery:function(t,i){if(t&1&&Pg(Z,5)(St,5),t&2){let n;EC(n=IC())&&(i.inputSection=n.first),EC(n=IC())&&(i.sidenav=n.first);}},decls:4,vars:2,consts:[["inputSection",""],[3,"drawerOpen"],[1,"app",3,"mousedown","touchstart"],[3,"projectName","threadId"],[3,"chatFocused","drawerStateChange","projectName","threadId"],[1,"welcome-section"],[1,"input-section"],[1,"input-center"],[1,"input-glass"],[3,"messageSubmitted","voiceMessageReady","voiceRecordingToggled","heightChanged","textareaFocused","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"]],template:function(t,i){t&1&&(ws(0,"app-sidenav",1)(1,"div",2),Rg("mousedown",function(){return i.onChatFocusedOnMobile()})("touchstart",function(){return i.onChatFocusedOnMobile()}),Jw(2,ee,1,2,"app-thread",3)(3,te,7,5),pl()()),t&2&&(bg("drawerOpen",i.isDrawerOpen),XE(2),eC(i.threadId?2:3));},dependencies:[rt,_i,T,St],styles:["[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden;justify-content:center}.app[_ngcontent-%COMP%]{width:100%;max-width:100%;min-width:0;height:100%;display:flex;flex-direction:column;background:var(--color-bg);color:var(--color-text);transition:all .3s ease;position:relative;justify-content:center;overflow:hidden}.chat-wrapper[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;background:transparent;width:100%;padding:2.5rem 0 1.5rem;display:flex;justify-content:center}.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem}@media(max-width:768px){.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{padding:0 1rem}}.welcome-section[_ngcontent-%COMP%]{flex-shrink:0;text-align:center;padding:2rem 1rem;animation:_ngcontent-%COMP%_fadeInUp .8s ease-out;display:flex;justify-content:center;align-items:center;width:100%;min-width:0;overflow:hidden}@keyframes _ngcontent-%COMP%_fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.input-section[_ngcontent-%COMP%]{flex-shrink:0;position:relative;border-top:none;background:transparent;box-shadow:none;padding:2.5rem 0 2rem;overflow-y:visible;max-height:none;width:100%;z-index:10;pointer-events:none;display:flex;justify-content:center}.input-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem;display:flex;justify-content:center;align-items:end;position:relative;pointer-events:auto}@media(max-width:768px){.input-center[_ngcontent-%COMP%]{padding:0 1rem}}.input-glass[_ngcontent-%COMP%]{background:none;box-shadow:none;width:100%;min-height:64px;display:flex;align-items:stretch;gap:0;pointer-events:auto;position:relative;overflow:visible}.input-glass[_ngcontent-%COMP%] app-chat-textarea[_ngcontent-%COMP%]{width:100%;min-width:0;flex:1 1 auto;align-self:stretch;display:flex}body.dark[_nghost-%COMP%], body.dark [_nghost-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .input-glass[_ngcontent-%COMP%]{background:#24283073;border-color:#b4c8ff17;box-shadow:0 8px 32px #0000002b,0 1.5px 8px #00000012}.choice-overlay[_ngcontent-%COMP%]{z-index:10;width:100%;display:flex;justify-content:center;align-items:center}.upload-status[_ngcontent-%COMP%]{position:fixed;bottom:100px;left:50%;transform:translate(-50%);z-index:1000;display:flex;align-items:center;padding:12px 20px;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);border-radius:16px;font-size:.9em;color:var(--color-text);box-shadow:var(--glass-shadow);max-width:300px;text-align:center}.upload-status.error[_ngcontent-%COMP%]{background:#ff3b3026;color:var(--color-error);border-color:#ff3b304d}@media(max-width:768px){.welcome-section[_ngcontent-%COMP%]{padding:1.5rem 1rem}.input-section[_ngcontent-%COMP%]{padding:1.5rem .75rem 1rem}.input-center[_ngcontent-%COMP%]{padding:0 .5rem}}@media print{[_nghost-%COMP%]{display:block!important;height:auto!important;overflow:visible!important}.app[_ngcontent-%COMP%]{height:auto!important;overflow:visible!important;display:block!important}.input-section[_ngcontent-%COMP%], .welcome-section[_ngcontent-%COMP%]{display:none!important}}"],data:{animation:[a("slideIn",[S(":enter",[F$1({transform:"translateY(100%)",opacity:0}),c("300ms ease-out",F$1({transform:"translateY(0)",opacity:1}))]),S(":leave",[c("200ms ease-in",F$1({transform:"translateY(100%)",opacity:0}))])])]},changeDetection:1})};export{K as MainAppComponent};
1
+ import {S as St}from'./chunk-DlxQJ0Wq.js';import {an as ue,g,L,ao as W,F,N as N$1,ap as Cd,e as xw,aq as a,ar as S,as as F$1,at as c,k as ws,q as Rg,J as Jw,o as pl,u as bg,X as XE,v as eC,B as Pg,E as EC,I as IC,au as tv,ae as kt,av as B,W as x,aw as hl,n as GC,ax as gl,a8 as Yg,a9 as lC,aa as If,ac as gC,ab as wf,S as Sg}from'./main-CB44G2DK.js';import {a as at,s as st,r as rt,_ as _i}from'./chunk-MAe7L4co.js';import'./chunk-Da3C0oKy.js';import {G as Ge}from'./chunk-QK8tU1La.js';import'./chunk-DzLzwtOe.js';import'./chunk-D22tCCQt.js';import'./chunk-D84a_Xjq.js';import'./chunk-BMUzpXmO.js';import'./chunk-BgIYpV8F.js';import'./chunk-CnOd7CqJ.js';import'./chunk-JZld8hhU.js';import'./chunk-BDPQgAAh.js';var T=class o{welcomeMessages=["Welcome to Coday","Bienvenue sur Coday","Bienvenido a Coday","Willkommen bei Coday","Benvenuto su Coday","Bem-vindo ao Coday","Welkom bij Coday","\u0414\u043E\u0431\u0440\u043E \u043F\u043E\u0436\u0430\u043B\u043E\u0432\u0430\u0442\u044C \u0432 Coday","Coday \u3078\u3088\u3046\u3053\u305D","\u6B22\u8FCE\u6765\u5230 Coday","Coday \uC5D0 \uC624\uC2E0 \uAC83\uC744 \uD658\uC601\uD569\uB2C8\uB2E4","\u0645\u0631\u062D\u0628\u064B\u0627 \u0628\u0643 \u0641\u064A Coday"];currentWelcomeIndex=0;currentWelcomeMessage=this.welcomeMessages[0];welcomeRotationInterval;ngOnInit(){this.startWelcomeRotation();}ngOnDestroy(){this.stopWelcomeRotation();}startWelcomeRotation(){this.welcomeRotationInterval=window.setInterval(()=>{this.currentWelcomeIndex=(this.currentWelcomeIndex+1)%this.welcomeMessages.length,this.currentWelcomeMessage=this.welcomeMessages[this.currentWelcomeIndex];},3e3);}stopWelcomeRotation(){this.welcomeRotationInterval&&(clearInterval(this.welcomeRotationInterval),this.welcomeRotationInterval=void 0);}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=xw({type:o,selectors:[["app-welcome-message"]],decls:2,vars:1,consts:[[1,"welcome-title"]],template:function(t,i){t&1&&(hl(0,"h1",0),GC(1),gl()),t&2&&(XE(),Yg(i.currentWelcomeMessage));},styles:[".welcome-title[_ngcontent-%COMP%]{font-size:clamp(1.5rem,4vw,4rem);font-weight:700;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite;margin:0;padding:0;line-height:1.2;transition:opacity .5s ease-in-out;display:block;min-height:1.2em;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0% center}50%{background-position:100% center}to{background-position:0% center}}"],changeDetection:1})};var N=class o{destroy$=new ue;isSetup=false;codayService=g(Ge);preferencesService=g(L);setup(){if(this.isSetup){console.warn("[AGENT-NOTIFICATION] Service already set up");return}console.log("[AGENT-NOTIFICATION] Setting up agent notification service"),this.codayService.isThinking$.pipe(Cd(this.destroy$),tv(),kt(([e,t])=>e===true&&t===false)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Agent stopped thinking, notifying task finished"),this.notifyTaskFinishedIfEnabled();}),this.preferencesService.browserNotificationEnabled$.pipe(Cd(this.destroy$),tv(),kt(([e,t])=>e===false&&t===true)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Browser notifications enabled, checking permission"),this.handleBrowserNotificationEnabled();}),this.isSetup=true;}notifyTaskFinishedIfEnabled(){this.preferencesService.getAgentNotificationEnabled()&&(this.preferencesService.getNotificationSoundEnabled()&&this.playCompletionSound(),this.preferencesService.getBrowserNotificationEnabled()&&this.sendBrowserNotification());}playCompletionSound(){try{let e=new(window.AudioContext||window.webkitAudioContext),t=e.createOscillator(),i=e.createGain();t.connect(i),i.connect(e.destination),t.frequency.setValueAtTime(700,e.currentTime),i.gain.setValueAtTime(.1,e.currentTime),i.gain.exponentialRampToValueAtTime(.01,e.currentTime+.08),t.start(e.currentTime),t.stop(e.currentTime+.08);let n=e.createOscillator(),r=e.createGain();n.connect(r),r.connect(e.destination);let l=e.currentTime+.11;n.frequency.setValueAtTime(950,l),r.gain.setValueAtTime(.1,l),r.gain.exponentialRampToValueAtTime(.01,l+.09),n.start(l),n.stop(l+.09),console.log("[AGENT-NOTIFICATION] Completion sound played");}catch(e){console.error("[AGENT-NOTIFICATION] Failed to play completion sound:",e);}}handleBrowserNotificationEnabled(){return B(this,null,function*(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications"),this.preferencesService.setBrowserNotificationEnabled(false);return}if(Notification.permission==="denied"){console.warn("[AGENT-NOTIFICATION] Permission denied, disabling browser notifications"),this.preferencesService.setBrowserNotificationEnabled(false);return}if(Notification.permission==="granted"){console.log("[AGENT-NOTIFICATION] Permission already granted, showing confirmation"),this.createConfirmationNotification();return}try{(yield Notification.requestPermission())==="granted"?(console.log("[AGENT-NOTIFICATION] Permission granted, showing confirmation"),this.createConfirmationNotification()):(console.log("[AGENT-NOTIFICATION] Permission denied or dismissed"),this.preferencesService.setBrowserNotificationEnabled(!1));}catch(e){console.error("[AGENT-NOTIFICATION] Error requesting permission:",e),this.preferencesService.setBrowserNotificationEnabled(false);}})}sendBrowserNotification(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications");return}if(document.hasFocus()){console.warn("[AGENT-NOTIFICATION] Document is focused, skipping browser notification");return}Notification.permission==="granted"?this.createTaskCompleteNotification():console.warn("[AGENT-NOTIFICATION] Permission not granted, cannot send notification");}createConfirmationNotification(){let e=new Notification("Coday - Notifications Enabled",{body:"You will be notified when the agent completes tasks",icon:"/favicon.ico",tag:"coday-notifications-enabled",requireInteraction:false});setTimeout(()=>e.close(),4e3),e.onclick=()=>{window.focus(),e.close();},console.log("[AGENT-NOTIFICATION] Confirmation notification sent");}createTaskCompleteNotification(){let e=new Notification("Coday - Task Complete",{body:"The agent has finished and is waiting for your input",icon:"/favicon.ico",tag:"coday-task-complete",requireInteraction:false});setTimeout(()=>e.close(),5e3),e.onclick=()=>{window.focus(),e.close();},console.log("[AGENT-NOTIFICATION] Task complete notification sent");}ngOnDestroy(){console.log("[AGENT-NOTIFICATION] Service destroyed"),this.destroy$.next(),this.destroy$.complete();}static \u0275fac=function(t){return new(t||o)};static \u0275prov=x({token:o,factory:o.\u0275fac,providedIn:"root"})};var Z=["inputSection"];function ee(o,e){if(o&1){let t=lC();ws(0,"app-thread",4),Rg("chatFocused",function(){If(t);let n=gC();return wf(n.onChatFocusedOnMobile())})("drawerStateChange",function(n){If(t);let r=gC();return wf(r.onDrawerStateChange(n))}),pl();}if(o&2){let t=gC();bg("projectName",t.projectName)("threadId",t.threadId);}}function te(o,e){if(o&1){let t=lC();ws(0,"div",5),Sg(1,"app-welcome-message"),pl(),ws(2,"div",6,0)(4,"div",7)(5,"div",8)(6,"app-chat-textarea",9),Rg("messageSubmitted",function(n){If(t);let r=gC();return wf(r.onMessageSubmitted(n))})("voiceMessageReady",function(n){If(t);let r=gC();return wf(r.onVoiceMessageReady(n))})("voiceRecordingToggled",function(n){If(t);let r=gC();return wf(r.onVoiceToggled(n))})("heightChanged",function(n){If(t);let r=gC();return wf(r.onInputHeightChanged(n))})("textareaFocused",function(){If(t);let n=gC();return wf(n.onChatFocusedOnMobile())}),pl()()()();}if(o&2){let t=gC();XE(6),bg("isDisabled",t.isSessionInitializing)("isSessionInitializing",t.isSessionInitializing)("showWelcome",true)("isThinking",false)("isStarting",t.isStartingFirstMessage);}}var K=class o{destroy$=new ue;inputSection;sidenav;projectName="";threadId=null;isSessionInitializing=false;isStartingFirstMessage=false;inputSectionHeight=80;codayService=g(Ge);titleService=g(at);preferencesService=g(L);route=g(W);router=g(F);threadApiService=g(N$1);agentNotificationService=g(N);firstMessageState=g(st);constructor(){console.log("[MAIN-APP] Using new thread-based architecture (no clientId needed)");}ngOnInit(){this.agentNotificationService.setup(),this.setupPrintHandlers(),this.route.params.pipe(Cd(this.destroy$)).subscribe(e=>{let t=e.projectName,i=e.threadId||null;console.log("[MAIN-APP] Route params updated:",{project:t,thread:i,previousProject:this.projectName,previousThread:this.threadId}),this.projectName=t,this.threadId=i,this.threadId?console.log("[MAIN-APP] Thread selected - ThreadComponent will display"):(console.log("[MAIN-APP] No thread selected - showing welcome view"),this.initializeWelcomeView());});}initializeWelcomeView(){this.codayService.setTabTitleService(this.titleService);}ngAfterViewInit(){setTimeout(()=>this.updateInputSectionHeight(),100);}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),window.removeEventListener("beforeprint",this.handleBeforePrint),window.removeEventListener("afterprint",this.handleAfterPrint);}onMessageSubmitted(e){console.log("[MAIN-APP] First message submitted from welcome view:",e),this.isSessionInitializing=true,this.isStartingFirstMessage=true,this.threadApiService.createThread().subscribe({next:t=>{console.log("[MAIN-APP] Thread created:",t.thread.id),this.firstMessageState.setPendingFirstMessage(e),this.router.navigate(["project",this.projectName,"thread",t.thread.id]);},error:t=>{console.error("[MAIN-APP] Failed to create thread:",t),this.isSessionInitializing=false,this.isStartingFirstMessage=false,alert("Failed to create conversation: "+(t.message||"Unknown error"));}});}onVoiceToggled(e){console.log("[VOICE] Recording in welcome view:",e);}onVoiceMessageReady(e){console.log("[MAIN-APP] Voice message ready from welcome view"),this.isSessionInitializing=true,this.isStartingFirstMessage=true,this.threadApiService.createThread().subscribe({next:t=>{console.log("[MAIN-APP] Thread created for voice message:",t.thread.id),this.firstMessageState.setPendingVoiceMessage(e),this.router.navigate(["project",this.projectName,"thread",t.thread.id]);},error:t=>{console.error("[MAIN-APP] Failed to create thread for voice message:",t),this.isSessionInitializing=false,this.isStartingFirstMessage=false,alert("Failed to create conversation: "+(t.message||"Unknown error"));}});}isDrawerOpen=false;onDrawerStateChange(e){this.isDrawerOpen=e;}onChatFocusedOnMobile(){window.innerWidth<1024&&this.sidenav?.close();}onInputHeightChanged(e){console.log("[MAIN-APP] Input height changed:",e),this.inputSectionHeight=e;}updateInputSectionHeight(){if(this.inputSection?.nativeElement){let e=this.inputSection.nativeElement.offsetHeight;e!==this.inputSectionHeight&&(console.log("[MAIN-APP] Input section height updated:",e),this.inputSectionHeight=e);}}setupPrintHandlers(){window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint);}handleBeforePrint=()=>{console.log("[PRINT] Before print event triggered");let e=this.preferencesService.getPrintTechnicalMessages();console.log("[PRINT] Print technical messages:",e),e?document.body.classList.add("print-include-technical"):document.body.classList.remove("print-include-technical");};handleAfterPrint=()=>{console.log("[PRINT] After print event triggered"),document.body.classList.remove("print-include-technical");};static \u0275fac=function(t){return new(t||o)};static \u0275cmp=xw({type:o,selectors:[["app-main"]],viewQuery:function(t,i){if(t&1&&Pg(Z,5)(St,5),t&2){let n;EC(n=IC())&&(i.inputSection=n.first),EC(n=IC())&&(i.sidenav=n.first);}},decls:4,vars:2,consts:[["inputSection",""],[3,"drawerOpen"],[1,"app",3,"mousedown","touchstart"],[3,"projectName","threadId"],[3,"chatFocused","drawerStateChange","projectName","threadId"],[1,"welcome-section"],[1,"input-section"],[1,"input-center"],[1,"input-glass"],[3,"messageSubmitted","voiceMessageReady","voiceRecordingToggled","heightChanged","textareaFocused","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"]],template:function(t,i){t&1&&(ws(0,"app-sidenav",1)(1,"div",2),Rg("mousedown",function(){return i.onChatFocusedOnMobile()})("touchstart",function(){return i.onChatFocusedOnMobile()}),Jw(2,ee,1,2,"app-thread",3)(3,te,7,5),pl()()),t&2&&(bg("drawerOpen",i.isDrawerOpen),XE(2),eC(i.threadId?2:3));},dependencies:[rt,_i,T,St],styles:["[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden;justify-content:center}.app[_ngcontent-%COMP%]{width:100%;max-width:100%;min-width:0;height:100%;display:flex;flex-direction:column;background:var(--color-bg);color:var(--color-text);transition:all .3s ease;position:relative;justify-content:center;overflow:hidden}.chat-wrapper[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;background:transparent;width:100%;padding:2.5rem 0 1.5rem;display:flex;justify-content:center}.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem}@media(max-width:768px){.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{padding:0 1rem}}.welcome-section[_ngcontent-%COMP%]{flex-shrink:0;text-align:center;padding:2rem 1rem;animation:_ngcontent-%COMP%_fadeInUp .8s ease-out;display:flex;justify-content:center;align-items:center;width:100%;min-width:0;overflow:hidden}@keyframes _ngcontent-%COMP%_fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.input-section[_ngcontent-%COMP%]{flex-shrink:0;position:relative;border-top:none;background:transparent;box-shadow:none;padding:2.5rem 0 2rem;overflow-y:visible;max-height:none;width:100%;z-index:10;pointer-events:none;display:flex;justify-content:center}.input-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem;display:flex;justify-content:center;align-items:end;position:relative;pointer-events:auto}@media(max-width:768px){.input-center[_ngcontent-%COMP%]{padding:0 1rem}}.input-glass[_ngcontent-%COMP%]{background:none;box-shadow:none;width:100%;min-height:64px;display:flex;align-items:stretch;gap:0;pointer-events:auto;position:relative;overflow:visible}.input-glass[_ngcontent-%COMP%] app-chat-textarea[_ngcontent-%COMP%]{width:100%;min-width:0;flex:1 1 auto;align-self:stretch;display:flex}body.dark[_nghost-%COMP%], body.dark [_nghost-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .input-glass[_ngcontent-%COMP%]{background:#24283073;border-color:#b4c8ff17;box-shadow:0 8px 32px #0000002b,0 1.5px 8px #00000012}.choice-overlay[_ngcontent-%COMP%]{z-index:10;width:100%;display:flex;justify-content:center;align-items:center}.upload-status[_ngcontent-%COMP%]{position:fixed;bottom:100px;left:50%;transform:translate(-50%);z-index:1000;display:flex;align-items:center;padding:12px 20px;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);border-radius:16px;font-size:.9em;color:var(--color-text);box-shadow:var(--glass-shadow);max-width:300px;text-align:center}.upload-status.error[_ngcontent-%COMP%]{background:#ff3b3026;color:var(--color-error);border-color:#ff3b304d}@media(max-width:768px){.welcome-section[_ngcontent-%COMP%]{padding:1.5rem 1rem}.input-section[_ngcontent-%COMP%]{padding:1.5rem .75rem 1rem}.input-center[_ngcontent-%COMP%]{padding:0 .5rem}}@media print{[_nghost-%COMP%]{display:block!important;height:auto!important;overflow:visible!important}.app[_ngcontent-%COMP%]{height:auto!important;overflow:visible!important;display:block!important}.input-section[_ngcontent-%COMP%], .welcome-section[_ngcontent-%COMP%]{display:none!important}}"],data:{animation:[a("slideIn",[S(":enter",[F$1({transform:"translateY(100%)",opacity:0}),c("300ms ease-out",F$1({transform:"translateY(0)",opacity:1}))]),S(":leave",[c("200ms ease-in",F$1({transform:"translateY(100%)",opacity:0}))])])]},changeDetection:1})};export{K as MainAppComponent};
@@ -1,2 +1,2 @@
1
- import {n as ne}from'./chunk-BPR1B3ya.js';import {g,Y as z$1,Z as Ue,e as xw,_ as zt,a0 as jt,a1 as Vt,a2 as Nt,h as hr,i as pr,k as ws,n as GC,o as pl,J as Jw,q as Rg,X as XE,z as Ug,a5 as vl,a8 as Yg,v as eC,u as bg,a9 as lC,ai as tm,aa as If,ac as gC,aj as KC,ab as wf,a3 as VI,ak as em,a6 as UI}from'./main-R5QFX3OD.js';import {y as yt,w as wt,t as ti,Z as Zn,c as cn}from'./chunk-D2rCay4H.js';function G(c,p){if(c&1){let t=lC();ws(0,"mat-checkbox",5),tm("ngModelChange",function(l){If(t);let f=gC();return KC(f.checkboxChecked,l)||(f.checkboxChecked=l),wf(l)}),GC(1),pl(),VI();}if(c&2){let t=gC();em("ngModel",t.checkboxChecked),UI(),XE(),Yg(t.data.checkboxLabel);}}var z=class c{dialogRef=g(z$1);data=g(Ue);checkboxChecked=false;confirm(){this.dialogRef.close({confirmed:true,checkboxChecked:this.checkboxChecked});}cancel(){this.dialogRef.close({confirmed:false});}static \u0275fac=function(t){return new(t||c)};static \u0275cmp=xw({type:c,selectors:[["app-confirm-dialog"]],decls:13,vars:8,consts:[["mat-dialog-title",""],[3,"ngModel"],["align","end"],["mat-button","",3,"click"],["mat-flat-button","",3,"click","color"],[3,"ngModelChange","ngModel"]],template:function(t,e){t&1&&(ws(0,"h2",0)(1,"mat-icon"),GC(2,"warning"),pl(),GC(3),pl(),ws(4,"mat-dialog-content")(5,"p"),GC(6),pl(),Jw(7,G,2,2,"mat-checkbox",1),pl(),ws(8,"mat-dialog-actions",2)(9,"button",3),Rg("click",function(){return e.cancel()}),GC(10),pl(),ws(11,"button",4),Rg("click",function(){return e.confirm()}),GC(12),pl()()),t&2&&(XE(),Ug("destructive",!!e.data.isDestructive),XE(2),vl(" ",e.data.title,`
1
+ import {n as ne}from'./chunk-D6D0Z7ht.js';import {g,Y as z$1,Z as Ue,e as xw,_ as zt,a0 as jt,a1 as Vt,a2 as Nt,h as hr,i as pr,k as ws,n as GC,o as pl,J as Jw,q as Rg,X as XE,z as Ug,a5 as vl,a8 as Yg,v as eC,u as bg,a9 as lC,ai as tm,aa as If,ac as gC,aj as KC,ab as wf,a3 as VI,ak as em,a6 as UI}from'./main-CB44G2DK.js';import {y as yt,w as wt,t as ti,Z as Zn,c as cn}from'./chunk-BDPQgAAh.js';function G(c,p){if(c&1){let t=lC();ws(0,"mat-checkbox",5),tm("ngModelChange",function(l){If(t);let f=gC();return KC(f.checkboxChecked,l)||(f.checkboxChecked=l),wf(l)}),GC(1),pl(),VI();}if(c&2){let t=gC();em("ngModel",t.checkboxChecked),UI(),XE(),Yg(t.data.checkboxLabel);}}var z=class c{dialogRef=g(z$1);data=g(Ue);checkboxChecked=false;confirm(){this.dialogRef.close({confirmed:true,checkboxChecked:this.checkboxChecked});}cancel(){this.dialogRef.close({confirmed:false});}static \u0275fac=function(t){return new(t||c)};static \u0275cmp=xw({type:c,selectors:[["app-confirm-dialog"]],decls:13,vars:8,consts:[["mat-dialog-title",""],[3,"ngModel"],["align","end"],["mat-button","",3,"click"],["mat-flat-button","",3,"click","color"],[3,"ngModelChange","ngModel"]],template:function(t,e){t&1&&(ws(0,"h2",0)(1,"mat-icon"),GC(2,"warning"),pl(),GC(3),pl(),ws(4,"mat-dialog-content")(5,"p"),GC(6),pl(),Jw(7,G,2,2,"mat-checkbox",1),pl(),ws(8,"mat-dialog-actions",2)(9,"button",3),Rg("click",function(){return e.cancel()}),GC(10),pl(),ws(11,"button",4),Rg("click",function(){return e.confirm()}),GC(12),pl()()),t&2&&(XE(),Ug("destructive",!!e.data.isDestructive),XE(2),vl(" ",e.data.title,`
2
2
  `),XE(3),Yg(e.data.message),XE(),eC(e.data.checkboxLabel?7:-1),XE(3),Yg(e.data.cancelLabel??"Cancel"),XE(),bg("color",e.data.isDestructive?"warn":"primary"),XE(),vl(" ",e.data.confirmLabel??"Confirm"," "));},dependencies:[zt,jt,Vt,Nt,hr,pr,yt,wt,ne,ti,Zn,cn],styles:["h2[mat-dialog-title][_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}h2[mat-dialog-title][_ngcontent-%COMP%] mat-icon.destructive[_ngcontent-%COMP%]{color:var(--color-error, #f44336)}mat-dialog-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:var(--color-text-secondary);line-height:1.5}mat-dialog-content[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{display:block;margin-top:8px;font-size:.875rem}"]})};export{z};
@@ -1 +1 @@
1
- import {i}from'./chunk-y0Xz-lHq.js';import {l}from'./chunk-CfodLKpx.js';import {g,dj as z,aJ as Tr,aD as Ly,bS as Ea,a7 as ya,Q as br,r as re,cE as Dd,x,w,bU as Td,W as x$1}from'./main-R5QFX3OD.js';var q=["ApiKeyAuthSetting","BasicAuthAuthSetting","BearerTokenAuthSetting","OAuthDiscoverableAuthSetting","OAuthMcpDiscoverableAuthSetting","OAuthCustomAuthSetting","OAuthRegisteredAuthSetting"],J={ApiKeyAuthSetting:"API Key",BasicAuthAuthSetting:"Basic Auth (username / password)",BearerTokenAuthSetting:"Bearer Token",OAuthDiscoverableAuthSetting:"OAuth \u2014 Discovery URL",OAuthMcpDiscoverableAuthSetting:"OAuth \u2014 MCP Discoverable",OAuthCustomAuthSetting:"OAuth \u2014 Custom endpoints",OAuthRegisteredAuthSetting:"OAuth \u2014 Registered app"},E="none",C="me",I={ApiKeyAuthSetting:"API_KEY",BasicAuthAuthSetting:"BASIC_AUTH",BearerTokenAuthSetting:"BEARER_TOKEN",OAuthDiscoverableAuthSetting:"OAUTH_DISCOVERABLE",OAuthMcpDiscoverableAuthSetting:"OAUTH_MCP_DISCOVERABLE",OAuthCustomAuthSetting:"OAUTH_CUSTOM",OAuthRegisteredAuthSetting:"OAUTH_REGISTERED"},U={API_KEY:"ApiKeyAuthSetting",BASIC_AUTH:"BasicAuthAuthSetting",BEARER_TOKEN:"BearerTokenAuthSetting",OAUTH_DISCOVERABLE:"OAuthDiscoverableAuthSetting",OAUTH_MCP_DISCOVERABLE:"OAuthMcpDiscoverableAuthSetting",OAUTH_CUSTOM:"OAuthCustomAuthSetting",OAUTH_REGISTERED:"OAuthRegisteredAuthSetting"};function v(n){let t=I[n.authType];return t?x(w({},n),{authType:t}):n}function d(n){return B(n)}function O(n){return n.map(B)}function B(n){let t=n;if(typeof t.authType=="string"){let e=U[t.authType];if(e)return x(w({},t),{authType:e})}return n}var R=class n{controller=g(z);userState=g(l);refresh$=new Tr(void 0);namespaceId$=new Tr(null);vm$=Ly([this.namespaceId$,this.refresh$]).pipe(Ea(([t])=>{let e=this.loadPlatformSettings().pipe(ya(()=>br([])));return t?Ly([e,this.loadNamespaceSettings(t).pipe(ya(()=>br([]))),this.loadUserSettings(t).pipe(ya(()=>br([]))),this.loadUserSettings("global").pipe(ya(()=>br([])))]).pipe(re(([i,s,u,p])=>({platform:i,namespace:s,userOnNs:u,userGlobal:p}))):Ly([e,this.loadNamespaceSettings("").pipe(ya(()=>br([]))),this.loadUserSettings("global").pipe(ya(()=>br([])))]).pipe(re(([i,s,u])=>({platform:i,namespace:s,userOnNs:[],userGlobal:u})))}),Dd({bufferSize:1,refCount:true}));setNamespace(t){this.namespaceId$.value!==t&&this.namespaceId$.next(t);}refresh(){this.refresh$.next();}loadUserSettings(t){let e=t==="global"?E:t;return this.controller.listAuthSetting(e,C).pipe(re(i=>O(i)))}userGlobal$=i(this.refresh$,()=>this.loadUserSettings("global"),[]);loadPlatformSettings(){return this.controller.listAuthSetting(E).pipe(re(t=>O(t)))}loadNamespaceSettings(t){return t?this.controller.listAuthSetting(t).pipe(re(e=>O(e))):br([])}getById(t,e){return this.controller.getByIdAuthSetting(t).pipe(re(i=>d(i)))}create(t,e,i){let u=this.userState.currentUser()?.id;if((e==="userOnNs"||e==="userGlobal")&&!u)throw new Error(`Cannot create ${e} auth setting before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(e==="namespace"&&(i===void 0||i===""))throw new Error("Cannot create namespace-scoped auth setting without a namespaceId");if(e==="userOnNs"&&!i)throw new Error("Cannot create userOnNs auth setting without a namespaceId");let p=v(x(w({},t),{namespaceId:e==="namespace"||e==="userOnNs"?i??void 0:void 0,userId:e==="userOnNs"||e==="userGlobal"?u:void 0}));return this.controller.createAuthSetting(p).pipe(re(_=>d(_)),Td(()=>this.refresh()))}update(t,e,i){let s=v(x(w({},e),{namespaceId:i.namespaceId,userId:i.userId,authType:i.authType}));return this.controller.updateAuthSetting(t,s).pipe(re(u=>d(u)),Td(()=>this.refresh()))}delete(t,e){return this.controller.deleteAuthSetting(t).pipe(Td(()=>this.refresh()))}static \u0275fac=function(e){return new(e||n)};static \u0275prov=x$1({token:n,factory:n.\u0275fac,providedIn:"root"})};export{J,R,q};
1
+ import {i}from'./chunk-KsDoJ6rD.js';import {l}from'./chunk-CigBS2kT.js';import {g,dj as z,aJ as Tr,aD as Ly,bS as Ea,a7 as ya,Q as br,r as re,cE as Dd,x,w,bU as Td,W as x$1}from'./main-CB44G2DK.js';var q=["ApiKeyAuthSetting","BasicAuthAuthSetting","BearerTokenAuthSetting","OAuthDiscoverableAuthSetting","OAuthMcpDiscoverableAuthSetting","OAuthCustomAuthSetting","OAuthRegisteredAuthSetting"],J={ApiKeyAuthSetting:"API Key",BasicAuthAuthSetting:"Basic Auth (username / password)",BearerTokenAuthSetting:"Bearer Token",OAuthDiscoverableAuthSetting:"OAuth \u2014 Discovery URL",OAuthMcpDiscoverableAuthSetting:"OAuth \u2014 MCP Discoverable",OAuthCustomAuthSetting:"OAuth \u2014 Custom endpoints",OAuthRegisteredAuthSetting:"OAuth \u2014 Registered app"},E="none",C="me",I={ApiKeyAuthSetting:"API_KEY",BasicAuthAuthSetting:"BASIC_AUTH",BearerTokenAuthSetting:"BEARER_TOKEN",OAuthDiscoverableAuthSetting:"OAUTH_DISCOVERABLE",OAuthMcpDiscoverableAuthSetting:"OAUTH_MCP_DISCOVERABLE",OAuthCustomAuthSetting:"OAUTH_CUSTOM",OAuthRegisteredAuthSetting:"OAUTH_REGISTERED"},U={API_KEY:"ApiKeyAuthSetting",BASIC_AUTH:"BasicAuthAuthSetting",BEARER_TOKEN:"BearerTokenAuthSetting",OAUTH_DISCOVERABLE:"OAuthDiscoverableAuthSetting",OAUTH_MCP_DISCOVERABLE:"OAuthMcpDiscoverableAuthSetting",OAUTH_CUSTOM:"OAuthCustomAuthSetting",OAUTH_REGISTERED:"OAuthRegisteredAuthSetting"};function v(n){let t=I[n.authType];return t?x(w({},n),{authType:t}):n}function d(n){return B(n)}function O(n){return n.map(B)}function B(n){let t=n;if(typeof t.authType=="string"){let e=U[t.authType];if(e)return x(w({},t),{authType:e})}return n}var R=class n{controller=g(z);userState=g(l);refresh$=new Tr(void 0);namespaceId$=new Tr(null);vm$=Ly([this.namespaceId$,this.refresh$]).pipe(Ea(([t])=>{let e=this.loadPlatformSettings().pipe(ya(()=>br([])));return t?Ly([e,this.loadNamespaceSettings(t).pipe(ya(()=>br([]))),this.loadUserSettings(t).pipe(ya(()=>br([]))),this.loadUserSettings("global").pipe(ya(()=>br([])))]).pipe(re(([i,s,u,p])=>({platform:i,namespace:s,userOnNs:u,userGlobal:p}))):Ly([e,this.loadNamespaceSettings("").pipe(ya(()=>br([]))),this.loadUserSettings("global").pipe(ya(()=>br([])))]).pipe(re(([i,s,u])=>({platform:i,namespace:s,userOnNs:[],userGlobal:u})))}),Dd({bufferSize:1,refCount:true}));setNamespace(t){this.namespaceId$.value!==t&&this.namespaceId$.next(t);}refresh(){this.refresh$.next();}loadUserSettings(t){let e=t==="global"?E:t;return this.controller.listAuthSetting(e,C).pipe(re(i=>O(i)))}userGlobal$=i(this.refresh$,()=>this.loadUserSettings("global"),[]);loadPlatformSettings(){return this.controller.listAuthSetting(E).pipe(re(t=>O(t)))}loadNamespaceSettings(t){return t?this.controller.listAuthSetting(t).pipe(re(e=>O(e))):br([])}getById(t,e){return this.controller.getByIdAuthSetting(t).pipe(re(i=>d(i)))}create(t,e,i){let u=this.userState.currentUser()?.id;if((e==="userOnNs"||e==="userGlobal")&&!u)throw new Error(`Cannot create ${e} auth setting before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(e==="namespace"&&(i===void 0||i===""))throw new Error("Cannot create namespace-scoped auth setting without a namespaceId");if(e==="userOnNs"&&!i)throw new Error("Cannot create userOnNs auth setting without a namespaceId");let p=v(x(w({},t),{namespaceId:e==="namespace"||e==="userOnNs"?i??void 0:void 0,userId:e==="userOnNs"||e==="userGlobal"?u:void 0}));return this.controller.createAuthSetting(p).pipe(re(_=>d(_)),Td(()=>this.refresh()))}update(t,e,i){let s=v(x(w({},e),{namespaceId:i.namespaceId,userId:i.userId,authType:i.authType}));return this.controller.updateAuthSetting(t,s).pipe(re(u=>d(u)),Td(()=>this.refresh()))}delete(t,e){return this.controller.deleteAuthSetting(t).pipe(Td(()=>this.refresh()))}static \u0275fac=function(e){return new(e||n)};static \u0275prov=x$1({token:n,factory:n.\u0275fac,providedIn:"root"})};export{J,R,q};
@@ -1 +1 @@
1
- import {N}from'./chunk-BI52yvMl.js';import {g,F,C as Ce,d9 as D,aJ as Tr,G as Gi,bS as Ea,r as re,b as U,e as xw,aK as xb,k as ws,bf as aT,q as Rg,o as pl,af as Eg,t as CC,u as bg,bg as uT,ah as rT,cb as ZB,cc as qB,m as mT,n as GC,J as Jw,X as XE,a8 as Yg,T as Tg,a5 as vl,v as eC,ac as gC,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-R5QFX3OD.js';import'./chunk-CfodLKpx.js';import {$ as $n,S as Se,G as Gn}from'./chunk-D88hl6XI.js';import'./chunk-odhKIvc0.js';import'./chunk-D2rCay4H.js';import'./chunk-y0Xz-lHq.js';import'./chunk-5Y113ccl.js';function K(o,t){if(o&1){let e=lC();ws(0,"span",7),GC(1,"Delete?"),pl(),ws(2,"ds-icon-button",8),Rg("action",function(){If(e);let i=gC();return wf(i.onDeleteConfirmed())}),pl(),ws(3,"ds-icon-button",9),Rg("action",function(){If(e);let i=gC();return wf(i.onDeleteCancelled())}),pl();}}function Q(o,t){if(o&1){let e=lC();ws(0,"ds-icon-button",11),Rg("action",function(){If(e);let i=gC(2);return wf(i.onEdit())}),pl(),ws(1,"ds-icon-button",12),Rg("action",function(){If(e);let i=gC(2);return wf(i.onDeleteArmed())}),pl();}}function X(o,t){if(o&1){let e=lC();ws(0,"ds-icon-button",10),Rg("action",function(){If(e);let i=gC();return wf(i.onDuplicate())}),pl(),Jw(1,Q,2,0);}if(o&2){let e=gC();XE(),eC(e.readOnly()?-1:1);}}var Y=Object.freeze({platform:{label:"PLATFORM",ariaLabel:"Configuration partag\xE9e plateforme",variant:"neutral"},namespace:{label:"NS",ariaLabel:"Configuration partag\xE9e du namespace",variant:"neutral"},userOnNs:{label:"USER \xD7 NS",ariaLabel:"Configuration utilisateur sur ce namespace",variant:"info"},userGlobal:{label:"USER GLOBAL",ariaLabel:"Configuration utilisateur globale",variant:"warning"}}),h=class o{config=ZB.required();scope=ZB.required();readOnly=ZB(false);editRequested=qB();deleteRequested=qB();duplicateRequested=qB();pendingDelete=Gi(false);badge=mT(()=>Y[this.scope()]);onEdit(){this.editRequested.emit(this.config());}onDuplicate(){this.duplicateRequested.emit(this.config());}onDeleteArmed(){this.pendingDelete.set(true);}onDeleteConfirmed(){this.pendingDelete.set(false),this.deleteRequested.emit(this.config());}onDeleteCancelled(){this.pendingDelete.set(false);}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=xw({type:o,selectors:[["agentos-integration-config-item"]],inputs:{config:[1,"config"],scope:[1,"scope"],readOnly:[1,"readOnly"]},outputs:{editRequested:"editRequested",deleteRequested:"deleteRequested",duplicateRequested:"duplicateRequested"},decls:12,vars:6,consts:[["role","listitem","dsBlueprint","",1,"integration-config-item"],[1,"integration-config-item__body"],[1,"integration-config-item__heading"],[1,"integration-config-item__name"],[1,"integration-config-item__badge"],[1,"integration-config-item__type"],[1,"integration-config-item__actions"],[1,"integration-config-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],["icon","content_copy","title","Duplicate this configuration",3,"action"],["icon","edit","title","Edit integration",3,"action"],["icon","delete","variant","danger","title","Delete integration",3,"action"]],template:function(e,n){e&1&&(ws(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),GC(4),pl(),ws(5,"span",4),GC(6),pl()(),ws(7,"span",5),GC(8),pl()(),ws(9,"div",6),Jw(10,K,4,0)(11,X,2,1),pl()()),e&2&&(XE(4),Yg(n.config().name),XE(),Tg("data-variant",n.badge().variant)("aria-label",n.badge().ariaLabel),XE(),vl(" ",n.badge().label," "),XE(2),Yg(n.config().integrationType),XE(2),eC(n.pendingDelete()?10:11));},dependencies:[Gn,Se],styles:[".integration-config-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:14px 16px;position:relative;border-radius:0;border:1px solid var(--color-divider);background:var(--color-bg);box-shadow:var(--shadow-sm);overflow:visible;transition:border-color .15s ease}.integration-config-item[_ngcontent-%COMP%]:hover{border-color:var(--color-accent)}.integration-config-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.integration-config-item__heading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;min-width:0}.integration-config-item__name[_ngcontent-%COMP%]{font-size:15px;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}.integration-config-item__badge[_ngcontent-%COMP%]{flex-shrink:0;font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;border-radius:0;padding:.15rem .5rem;white-space:nowrap}.integration-config-item__badge[data-variant=neutral][_ngcontent-%COMP%]{border:1px solid var(--color-divider);color:var(--color-neutral-600);background:transparent}.integration-config-item__badge[data-variant=info][_ngcontent-%COMP%]{border:1px solid color-mix(in srgb,var(--color-info) 40%,transparent);color:var(--color-info);background:color-mix(in srgb,var(--color-info) 10%,transparent)}.integration-config-item__badge[data-variant=warning][_ngcontent-%COMP%]{border:1px solid color-mix(in srgb,var(--color-warning) 40%,transparent);color:var(--color-warning);background:color-mix(in srgb,var(--color-warning) 10%,transparent)}.integration-config-item__type[_ngcontent-%COMP%]{font-size:13px;color:var(--color-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.integration-config-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.integration-config-item[_ngcontent-%COMP%]:hover .integration-config-item__actions[_ngcontent-%COMP%], .integration-config-item[_ngcontent-%COMP%]:focus-within .integration-config-item__actions[_ngcontent-%COMP%]{opacity:1}.integration-config-item__confirm-label[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--red-deep);margin-right:.25rem;white-space:nowrap}"]})};var Z=()=>[];function ee(o,t){if(o&1){let e=lC();ws(0,"agentos-integration-config-item",4),Rg("editRequested",function(i){If(e);let x=gC(2);return wf(x.onEdit(i))})("deleteRequested",function(i){If(e);let x=gC(2);return wf(x.deleteConfig(i))}),pl();}o&2&&bg("config",t);}function te(o,t){if(o&1&&Jw(0,ee,1,1,"agentos-integration-config-item",3),o&2){let e,n=t.$implicit,i=gC();eC((e=i.resolveConfig(n.id))?0:-1,e);}}var W=class o{router=g(F);destroyRef=g(Ce);state=g(N);integrationConfigController=g(D);refresh$=new Tr(void 0);isLoading=Gi(true);configs$=this.refresh$.pipe(Ea(()=>(this.isLoading.set(true),this.state.loadPlatformConfigs())));configItems$=this.configs$.pipe(re(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.integrationType}))));configsById=new Map;constructor(){this.configs$.pipe(U(this.destroyRef)).subscribe({next:t=>{this.configsById=new Map(t.map(e=>[e.id??"",e])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","integration-configs","new"]);}deleteConfig(t){this.integrationConfigController.deleteIntegrationConfig(t.id??"").pipe(U(this.destroyRef)).subscribe(()=>this.refresh$.next());}onEdit(t){this.router.navigate(["/agentos","admin","integration-configs",t.id??"","edit"]);}resolveConfig(t){return this.configsById.get(t)??null}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=xw({type:o,selectors:[["agentos-platform-integration-configs"]],decls:5,vars:7,consts:[["integrationConfigItemTpl",""],["title","Platform Integration Configs","emptyMessage","No platform integration configs defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],["scope","platform",3,"config"],["scope","platform",3,"editRequested","deleteRequested","config"]],template:function(e,n){if(e&1&&(ws(0,"ds-entity-list",1),aT(1,"async"),Rg("createRequested",function(){return n.openCreateForm()}),ws(2,"ds-icon-button",2),Rg("action",function(){return n.goBack()}),pl()(),Eg(3,te,1,1,"ng-template",null,0,fT)),e&2){let i=CC(4);bg("items",uT(1,4,n.configItems$)??rT(6,Z))("loading",n.isLoading())("showCreate",true)("itemTemplate",i);}},dependencies:[$n,h,Se,xb],styles:[".platform-integration-configs__back[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.platform-integration-configs__back[_ngcontent-%COMP%]:hover{text-decoration:underline}"]})};export{W as PlatformIntegrationConfigsComponent};
1
+ import {N}from'./chunk-B9bBPCOE.js';import {g,F,C as Ce,d9 as D,aJ as Tr,G as Gi,bS as Ea,r as re,b as U,e as xw,aK as xb,k as ws,bf as aT,q as Rg,o as pl,af as Eg,t as CC,u as bg,bg as uT,ah as rT,cb as ZB,cc as qB,m as mT,n as GC,J as Jw,X as XE,a8 as Yg,T as Tg,a5 as vl,v as eC,ac as gC,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-CB44G2DK.js';import'./chunk-CigBS2kT.js';import {$ as $n,S as Se,G as Gn}from'./chunk-CnOd7CqJ.js';import'./chunk-JZld8hhU.js';import'./chunk-BDPQgAAh.js';import'./chunk-KsDoJ6rD.js';import'./chunk-DzLzwtOe.js';function K(o,t){if(o&1){let e=lC();ws(0,"span",7),GC(1,"Delete?"),pl(),ws(2,"ds-icon-button",8),Rg("action",function(){If(e);let i=gC();return wf(i.onDeleteConfirmed())}),pl(),ws(3,"ds-icon-button",9),Rg("action",function(){If(e);let i=gC();return wf(i.onDeleteCancelled())}),pl();}}function Q(o,t){if(o&1){let e=lC();ws(0,"ds-icon-button",11),Rg("action",function(){If(e);let i=gC(2);return wf(i.onEdit())}),pl(),ws(1,"ds-icon-button",12),Rg("action",function(){If(e);let i=gC(2);return wf(i.onDeleteArmed())}),pl();}}function X(o,t){if(o&1){let e=lC();ws(0,"ds-icon-button",10),Rg("action",function(){If(e);let i=gC();return wf(i.onDuplicate())}),pl(),Jw(1,Q,2,0);}if(o&2){let e=gC();XE(),eC(e.readOnly()?-1:1);}}var Y=Object.freeze({platform:{label:"PLATFORM",ariaLabel:"Configuration partag\xE9e plateforme",variant:"neutral"},namespace:{label:"NS",ariaLabel:"Configuration partag\xE9e du namespace",variant:"neutral"},userOnNs:{label:"USER \xD7 NS",ariaLabel:"Configuration utilisateur sur ce namespace",variant:"info"},userGlobal:{label:"USER GLOBAL",ariaLabel:"Configuration utilisateur globale",variant:"warning"}}),h=class o{config=ZB.required();scope=ZB.required();readOnly=ZB(false);editRequested=qB();deleteRequested=qB();duplicateRequested=qB();pendingDelete=Gi(false);badge=mT(()=>Y[this.scope()]);onEdit(){this.editRequested.emit(this.config());}onDuplicate(){this.duplicateRequested.emit(this.config());}onDeleteArmed(){this.pendingDelete.set(true);}onDeleteConfirmed(){this.pendingDelete.set(false),this.deleteRequested.emit(this.config());}onDeleteCancelled(){this.pendingDelete.set(false);}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=xw({type:o,selectors:[["agentos-integration-config-item"]],inputs:{config:[1,"config"],scope:[1,"scope"],readOnly:[1,"readOnly"]},outputs:{editRequested:"editRequested",deleteRequested:"deleteRequested",duplicateRequested:"duplicateRequested"},decls:12,vars:6,consts:[["role","listitem","dsBlueprint","",1,"integration-config-item"],[1,"integration-config-item__body"],[1,"integration-config-item__heading"],[1,"integration-config-item__name"],[1,"integration-config-item__badge"],[1,"integration-config-item__type"],[1,"integration-config-item__actions"],[1,"integration-config-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],["icon","content_copy","title","Duplicate this configuration",3,"action"],["icon","edit","title","Edit integration",3,"action"],["icon","delete","variant","danger","title","Delete integration",3,"action"]],template:function(e,n){e&1&&(ws(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),GC(4),pl(),ws(5,"span",4),GC(6),pl()(),ws(7,"span",5),GC(8),pl()(),ws(9,"div",6),Jw(10,K,4,0)(11,X,2,1),pl()()),e&2&&(XE(4),Yg(n.config().name),XE(),Tg("data-variant",n.badge().variant)("aria-label",n.badge().ariaLabel),XE(),vl(" ",n.badge().label," "),XE(2),Yg(n.config().integrationType),XE(2),eC(n.pendingDelete()?10:11));},dependencies:[Gn,Se],styles:[".integration-config-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:14px 16px;position:relative;border-radius:0;border:1px solid var(--color-divider);background:var(--color-bg);box-shadow:var(--shadow-sm);overflow:visible;transition:border-color .15s ease}.integration-config-item[_ngcontent-%COMP%]:hover{border-color:var(--color-accent)}.integration-config-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.integration-config-item__heading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;min-width:0}.integration-config-item__name[_ngcontent-%COMP%]{font-size:15px;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}.integration-config-item__badge[_ngcontent-%COMP%]{flex-shrink:0;font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;border-radius:0;padding:.15rem .5rem;white-space:nowrap}.integration-config-item__badge[data-variant=neutral][_ngcontent-%COMP%]{border:1px solid var(--color-divider);color:var(--color-neutral-600);background:transparent}.integration-config-item__badge[data-variant=info][_ngcontent-%COMP%]{border:1px solid color-mix(in srgb,var(--color-info) 40%,transparent);color:var(--color-info);background:color-mix(in srgb,var(--color-info) 10%,transparent)}.integration-config-item__badge[data-variant=warning][_ngcontent-%COMP%]{border:1px solid color-mix(in srgb,var(--color-warning) 40%,transparent);color:var(--color-warning);background:color-mix(in srgb,var(--color-warning) 10%,transparent)}.integration-config-item__type[_ngcontent-%COMP%]{font-size:13px;color:var(--color-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.integration-config-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.integration-config-item[_ngcontent-%COMP%]:hover .integration-config-item__actions[_ngcontent-%COMP%], .integration-config-item[_ngcontent-%COMP%]:focus-within .integration-config-item__actions[_ngcontent-%COMP%]{opacity:1}.integration-config-item__confirm-label[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--red-deep);margin-right:.25rem;white-space:nowrap}"]})};var Z=()=>[];function ee(o,t){if(o&1){let e=lC();ws(0,"agentos-integration-config-item",4),Rg("editRequested",function(i){If(e);let x=gC(2);return wf(x.onEdit(i))})("deleteRequested",function(i){If(e);let x=gC(2);return wf(x.deleteConfig(i))}),pl();}o&2&&bg("config",t);}function te(o,t){if(o&1&&Jw(0,ee,1,1,"agentos-integration-config-item",3),o&2){let e,n=t.$implicit,i=gC();eC((e=i.resolveConfig(n.id))?0:-1,e);}}var W=class o{router=g(F);destroyRef=g(Ce);state=g(N);integrationConfigController=g(D);refresh$=new Tr(void 0);isLoading=Gi(true);configs$=this.refresh$.pipe(Ea(()=>(this.isLoading.set(true),this.state.loadPlatformConfigs())));configItems$=this.configs$.pipe(re(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.integrationType}))));configsById=new Map;constructor(){this.configs$.pipe(U(this.destroyRef)).subscribe({next:t=>{this.configsById=new Map(t.map(e=>[e.id??"",e])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","integration-configs","new"]);}deleteConfig(t){this.integrationConfigController.deleteIntegrationConfig(t.id??"").pipe(U(this.destroyRef)).subscribe(()=>this.refresh$.next());}onEdit(t){this.router.navigate(["/agentos","admin","integration-configs",t.id??"","edit"]);}resolveConfig(t){return this.configsById.get(t)??null}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=xw({type:o,selectors:[["agentos-platform-integration-configs"]],decls:5,vars:7,consts:[["integrationConfigItemTpl",""],["title","Platform Integration Configs","emptyMessage","No platform integration configs defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],["scope","platform",3,"config"],["scope","platform",3,"editRequested","deleteRequested","config"]],template:function(e,n){if(e&1&&(ws(0,"ds-entity-list",1),aT(1,"async"),Rg("createRequested",function(){return n.openCreateForm()}),ws(2,"ds-icon-button",2),Rg("action",function(){return n.goBack()}),pl()(),Eg(3,te,1,1,"ng-template",null,0,fT)),e&2){let i=CC(4);bg("items",uT(1,4,n.configItems$)??rT(6,Z))("loading",n.isLoading())("showCreate",true)("itemTemplate",i);}},dependencies:[$n,h,Se,xb],styles:[".platform-integration-configs__back[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.platform-integration-configs__back[_ngcontent-%COMP%]:hover{text-decoration:underline}"]})};export{W as PlatformIntegrationConfigsComponent};
@@ -1,4 +1,4 @@
1
- import {s as se}from'./chunk-CSXW8eI5.js';import {b as Fr,Q as Qi,F as Fn,K as Ki,h as ht,w as wr,k as kr}from'./chunk-D88hl6XI.js';import {g,D as py,P,W as x,aL as wo,aM as Zn,bD as ge,bE as vt,aO as wt,bs as Tl,az as Xt,aW as C,aS as K,bF as J,al as vt$1,aT as Ut,bG as p,bH as Pt,e as xw,a_ as QT,bA as yC,bI as Ig,b5 as nT,B as Pg,bJ as dr,E as EC,I as IC,bv as Fg,bK as fe,bL as pe,bM as mr,aP as G,bt as Qn,bN as F,aR as Fs,an as ue,O as Ot,bO as mt,bP as Wy,ae as kt$1,Q as br,r as re,bQ as Gy,bR as wd,bS as Ea,aF as R$1,bu as Ve$1,bT as pn,bU as Td,bV as Zy,aA as an,bW as Y,bX as Pt$1,bY as po,bZ as X,b_ as xt,aZ as js,aC as Tu,q as Rg,T as Tg,aw as hl,bB as vC,ax as gl,ac as gC,b$ as kC,z as Ug,c0 as xg,c1 as E,c2 as ME,c3 as kt$2,bC as Si}from'./main-R5QFX3OD.js';import {D}from'./chunk-D2rCay4H.js';var xe=class a{http=g(py);projectState=g(P);getBaseUrl(){return `/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/schedulers`}listSchedulers(){return this.http.get(this.getBaseUrl())}getScheduler(o){return this.http.get(`${this.getBaseUrl()}/${o}`)}createScheduler(o){return this.http.post(this.getBaseUrl(),o)}listSchedulersForProject(o){return this.http.get(`/api/projects/${o}/schedulers`)}enableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/enable`,{})}disableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/disable`,{})}runSchedulerNowForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/run-now`,{})}deleteSchedulerForProject(o,e){return this.http.delete(`/api/projects/${o}/schedulers/${e}`)}updateSchedulerForProject(o,e,t){return this.http.put(`/api/projects/${o}/schedulers/${e}`,t)}createSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers`,e)}updateScheduler(o,e){return this.http.put(`${this.getBaseUrl()}/${o}`,e)}deleteScheduler(o){return this.http.delete(`${this.getBaseUrl()}/${o}`)}enableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/enable`,{})}disableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/disable`,{})}runSchedulerNow(o){return this.http.post(`${this.getBaseUrl()}/${o}/run-now`,{})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=x({token:a,factory:a.\u0275fac,providedIn:"root"})};var Ke=["panel"],Ue=["*"];function qe(a,o){if(a&1&&(hl(0,"div",1,0),vC(2),gl()),a&2){let e=o.id,t=gC();kC(t._classList),Ug("mat-mdc-autocomplete-visible",t.showPanel)("mat-mdc-autocomplete-hidden",!t.showPanel)("mat-autocomplete-panel-animations-enabled",!t._animationsDisabled)("mat-primary",t._color==="primary")("mat-accent",t._color==="accent")("mat-warn",t._color==="warn"),xg("id",t.id),Tg("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby(e));}}var R=class{source;option;constructor(o,e){this.source=o,this.option=e;}},Ve=new C("mat-autocomplete-default-options",{providedIn:"root",factory:()=>({autoActiveFirstOption:false,autoSelectActiveOption:false,hideSingleSelectionIndicator:false,requireSelection:false,hasBackdrop:false})}),Ct=(()=>{class a{_changeDetectorRef=g(Tl);_elementRef=g(Xt);_defaults=g(Ve);_animationsDisabled=K();_activeOptionChanges=J.EMPTY;_keyManager;showPanel=false;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=false;_latestOpeningTrigger;_setColor(e){this._color=e,this._changeDetectorRef.markForCheck();}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple=false;optionSelected=new vt$1;opened=new vt$1;closed=new vt$1;optionActivated=new vt$1;set classList(e){this._classList=e,this._elementRef.nativeElement.className="";}_classList;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties();}_hideSingleSelectionIndicator;_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck();}id=g(Ut).getId("mat-autocomplete-");inertGroups;constructor(){let e=g(p);this.inertGroups=e?.SAFARI||false,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??false;}ngAfterContentInit(){this._keyManager=new Pt(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(e=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[e]||null});}),this._setVisibility();}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe();}_setScrollTop(e){this.panel&&(this.panel.nativeElement.scrollTop=e);}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options?.length,this._changeDetectorRef.markForCheck();}_emitSelectEvent(e){let t=new R(this,e);this.optionSelected.emit(t);}_getPanelAriaLabelledby(e){if(this.ariaLabel)return null;let t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_skipPredicate(){return false}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=xw({type:a,selectors:[["mat-autocomplete"]],contentQueries:function(t,i,n){if(t&1&&Fg(n,Fn,5)(n,Ki,5),t&2){let s;EC(s=IC())&&(i.options=s),EC(s=IC())&&(i.optionGroups=s);}},viewQuery:function(t,i){if(t&1&&Pg(dr,7)(Ke,5),t&2){let n;EC(n=IC())&&(i.template=n.first),EC(n=IC())&&(i.panel=n.first);}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",QT],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",QT],requireSelection:[2,"requireSelection","requireSelection",QT],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",QT],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",QT]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[nT([{provide:Qi,useExisting:a}])],ngContentSelectors:Ue,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(t,i){t&1&&(yC(),Ig(0,qe,3,17,"ng-template"));},styles:[`div.mat-mdc-autocomplete-panel {
1
+ import {s as se}from'./chunk-BgIYpV8F.js';import {b as Fr,Q as Qi,F as Fn,K as Ki,h as ht,w as wr,k as kr}from'./chunk-CnOd7CqJ.js';import {g,D as py,P,W as x,aL as wo,aM as Zn,bD as ge,bE as vt,aO as wt,bs as Tl,az as Xt,aW as C,aS as K,bF as J,al as vt$1,aT as Ut,bG as p,bH as Pt,e as xw,a_ as QT,bA as yC,bI as Ig,b5 as nT,B as Pg,bJ as dr,E as EC,I as IC,bv as Fg,bK as fe,bL as pe,bM as mr,aP as G,bt as Qn,bN as F,aR as Fs,an as ue,O as Ot,bO as mt,bP as Wy,ae as kt$1,Q as br,r as re,bQ as Gy,bR as wd,bS as Ea,aF as R$1,bu as Ve$1,bT as pn,bU as Td,bV as Zy,aA as an,bW as Y,bX as Pt$1,bY as po,bZ as X,b_ as xt,aZ as js,aC as Tu,q as Rg,T as Tg,aw as hl,bB as vC,ax as gl,ac as gC,b$ as kC,z as Ug,c0 as xg,c1 as E,c2 as ME,c3 as kt$2,bC as Si}from'./main-CB44G2DK.js';import {D}from'./chunk-BDPQgAAh.js';var xe=class a{http=g(py);projectState=g(P);getBaseUrl(){return `/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/schedulers`}listSchedulers(){return this.http.get(this.getBaseUrl())}getScheduler(o){return this.http.get(`${this.getBaseUrl()}/${o}`)}createScheduler(o){return this.http.post(this.getBaseUrl(),o)}listSchedulersForProject(o){return this.http.get(`/api/projects/${o}/schedulers`)}enableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/enable`,{})}disableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/disable`,{})}runSchedulerNowForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/run-now`,{})}deleteSchedulerForProject(o,e){return this.http.delete(`/api/projects/${o}/schedulers/${e}`)}updateSchedulerForProject(o,e,t){return this.http.put(`/api/projects/${o}/schedulers/${e}`,t)}createSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers`,e)}updateScheduler(o,e){return this.http.put(`${this.getBaseUrl()}/${o}`,e)}deleteScheduler(o){return this.http.delete(`${this.getBaseUrl()}/${o}`)}enableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/enable`,{})}disableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/disable`,{})}runSchedulerNow(o){return this.http.post(`${this.getBaseUrl()}/${o}/run-now`,{})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=x({token:a,factory:a.\u0275fac,providedIn:"root"})};var Ke=["panel"],Ue=["*"];function qe(a,o){if(a&1&&(hl(0,"div",1,0),vC(2),gl()),a&2){let e=o.id,t=gC();kC(t._classList),Ug("mat-mdc-autocomplete-visible",t.showPanel)("mat-mdc-autocomplete-hidden",!t.showPanel)("mat-autocomplete-panel-animations-enabled",!t._animationsDisabled)("mat-primary",t._color==="primary")("mat-accent",t._color==="accent")("mat-warn",t._color==="warn"),xg("id",t.id),Tg("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby(e));}}var R=class{source;option;constructor(o,e){this.source=o,this.option=e;}},Ve=new C("mat-autocomplete-default-options",{providedIn:"root",factory:()=>({autoActiveFirstOption:false,autoSelectActiveOption:false,hideSingleSelectionIndicator:false,requireSelection:false,hasBackdrop:false})}),Ct=(()=>{class a{_changeDetectorRef=g(Tl);_elementRef=g(Xt);_defaults=g(Ve);_animationsDisabled=K();_activeOptionChanges=J.EMPTY;_keyManager;showPanel=false;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=false;_latestOpeningTrigger;_setColor(e){this._color=e,this._changeDetectorRef.markForCheck();}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple=false;optionSelected=new vt$1;opened=new vt$1;closed=new vt$1;optionActivated=new vt$1;set classList(e){this._classList=e,this._elementRef.nativeElement.className="";}_classList;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties();}_hideSingleSelectionIndicator;_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck();}id=g(Ut).getId("mat-autocomplete-");inertGroups;constructor(){let e=g(p);this.inertGroups=e?.SAFARI||false,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??false;}ngAfterContentInit(){this._keyManager=new Pt(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(e=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[e]||null});}),this._setVisibility();}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe();}_setScrollTop(e){this.panel&&(this.panel.nativeElement.scrollTop=e);}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options?.length,this._changeDetectorRef.markForCheck();}_emitSelectEvent(e){let t=new R(this,e);this.optionSelected.emit(t);}_getPanelAriaLabelledby(e){if(this.ariaLabel)return null;let t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_skipPredicate(){return false}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=xw({type:a,selectors:[["mat-autocomplete"]],contentQueries:function(t,i,n){if(t&1&&Fg(n,Fn,5)(n,Ki,5),t&2){let s;EC(s=IC())&&(i.options=s),EC(s=IC())&&(i.optionGroups=s);}},viewQuery:function(t,i){if(t&1&&Pg(dr,7)(Ke,5),t&2){let n;EC(n=IC())&&(i.template=n.first),EC(n=IC())&&(i.panel=n.first);}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",QT],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",QT],requireSelection:[2,"requireSelection","requireSelection",QT],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",QT],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",QT]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[nT([{provide:Qi,useExisting:a}])],ngContentSelectors:Ue,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(t,i){t&1&&(yC(),Ig(0,qe,3,17,"ng-template"));},styles:[`div.mat-mdc-autocomplete-panel {
2
2
  width: 100%;
3
3
  max-height: 256px;
4
4
  visibility: hidden;
@@ -1 +1 @@
1
- import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk--VmBz6Cf.js';import {s,d}from'./chunk-CfodLKpx.js';import {g,ao as W$1,F,C as Ce,G as Gi,m as mT,b as U,M as By,a7 as ya,Q as br,e as xw,$ as $t,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,v as eC,ac as gC,u as bg,a9 as lC,a8 as Yg,z as Ug,a5 as vl,T as Tg,s as rC,y as oC,S as Sg,bf as aT,bg as uT,a4 as nC,aa as If,ab as wf,bj as aE}from'./main-R5QFX3OD.js';import'./chunk-5Y113ccl.js';import'./chunk-D88hl6XI.js';import'./chunk-odhKIvc0.js';import'./chunk-D2rCay4H.js';var J=(e,n)=>n.name+n.grant;function K(e,n){if(e&1&&(ws(0,"a",5),GC(1,"Edit skill \u2192"),pl()),e&2){let i=gC();bg("routerLink",i.editRoute());}}function q(e,n){e&1&&(ws(0,"span",6),GC(1,"Platform level"),pl());}function Q(e,n){e&1&&(ws(0,"p",7),GC(1,"Loading\u2026"),pl());}function W(e,n){e&1&&(ws(0,"p",8),GC(1,"Failed to load skill."),pl());}function X(e,n){if(e&1&&(ws(0,"dt",13),GC(1,"Created by"),pl(),ws(2,"dd",15),GC(3),pl()),e&2){let i=gC(2);XE(3),Yg(i.createdBy);}}function Y(e,n){if(e&1&&(ws(0,"dt",13),GC(1,"Last updated"),pl(),ws(2,"dd",15),GC(3),pl()),e&2){let i=gC(2);XE(3),Yg(i.updatedOn);}}function Z(e,n){if(e&1&&(Jw(0,X,4,1),Jw(1,Y,4,1)),e&2){let i=gC();eC(i.createdBy?0:-1),XE(),eC(i.updatedOn?1:-1);}}function ee(e,n){if(e&1&&(ws(0,"span",17),GC(1),pl()),e&2){let i=gC(2);XE(),vl("(",i.consumers().length,")");}}function te(e,n){e&1&&(ws(0,"p",18),GC(1," A platform skill is offered to every namespace. Open it from a namespace to see which of its agents use it. "),pl());}function ne(e,n){e&1&&(ws(0,"p",18),GC(1,"Loading\u2026"),pl());}function ie(e,n){e&1&&(ws(0,"p",8),GC(1," The agent configs could not be read, so it is unknown whether any agent uses this skill. "),pl());}function oe(e,n){e&1&&(ws(0,"p",18),GC(1,"No agent references this skill."),pl());}function le(e,n){e&1&&(ws(0,"span",16),GC(1,"platform agent"),pl());}function ae(e,n){e&1&&(ws(0,"span",16),GC(1,"via *"),pl());}function re(e,n){if(e&1&&(ws(0,"li",24)(1,"span",26),GC(2),pl(),Jw(3,le,2,0,"span",16),Jw(4,ae,2,0,"span",16),pl()),e&2){let i=n.$implicit;XE(2),Yg(i.name),XE(),eC(i.platform?3:-1),XE(),eC(i.grant==="all"?4:-1);}}function se(e,n){if(e&1&&(ws(0,"ul",23),rC(1,re,5,3,"li",24,J),pl(),ws(3,"p",25),GC(4," An agent listed "),ws(5,"code"),GC(6,"via *"),pl(),GC(7," takes the whole catalogue and keeps working without this skill. The others name it, so deleting the skill leaves their selector resolving to nothing. "),pl()),e&2){let i=gC(2);XE(),oC(i.consumers());}}function ce(e,n){if(e&1&&(Sg(0,"div",21),aT(1,"agentosMarkdown")),e&2){let i=gC();bg("innerHTML",uT(1,1,i.body),aE);}}function de(e,n){e&1&&(ws(0,"p",18),GC(1,"No resources bundled with this skill."),pl());}function pe(e,n){if(e&1&&(ws(0,"pre",30),GC(1),pl()),e&2){let i=gC().$implicit,a=gC(3);XE(),Yg(a.resourceContent(i));}}function me(e,n){if(e&1){let i=lC();ws(0,"li",27)(1,"button",28),Rg("click",function(){let s=If(i).$implicit,g=gC(3);return wf(g.toggleResource(s))}),ws(2,"span",29),GC(3),pl(),ws(4,"span",20),GC(5,"\u25BC"),pl()(),Jw(6,pe,2,1,"pre",30),pl();}if(e&2){let i=n.$implicit,a=gC(3);XE(),Tg("aria-expanded",a.isResourceExpanded(i)),XE(2),Yg(i),XE(),Ug("skill-inspect__chevron--open",a.isResourceExpanded(i)),XE(2),eC(a.isResourceExpanded(i)?6:-1);}}function _e(e,n){if(e&1&&(ws(0,"ul",22),rC(1,me,7,5,"li",27,nC),pl()),e&2){let i=gC(2);XE(),oC(i.resourcePaths());}}function ge(e,n){if(e&1){let i=lC();ws(0,"div",9)(1,"section",10)(2,"h2",11),GC(3,"General"),pl(),ws(4,"dl",12)(5,"dt",13),GC(6,"Name"),pl(),ws(7,"dd",14),GC(8),pl(),ws(9,"dt",13),GC(10,"Description"),pl(),ws(11,"dd",15),GC(12),pl(),ws(13,"dt",13),GC(14,"Scope"),pl(),ws(15,"dd",15),GC(16),pl(),ws(17,"dt",13),GC(18,"Storage"),pl(),ws(19,"dd",15)(20,"span",16),GC(21),pl()(),Jw(22,Z,2,2),pl()(),ws(23,"section",10)(24,"h2",11),GC(25," Used by "),Jw(26,ee,2,1,"span",17),pl(),Jw(27,te,2,0,"p",18)(28,ne,2,0,"p",18)(29,ie,2,0,"p",8)(30,oe,2,0,"p",18)(31,se,8,0),pl(),ws(32,"section",10)(33,"button",19),Rg("click",function(){If(i);let s=gC();return wf(s.toggleBody())}),ws(34,"h2",11),GC(35,"Body"),pl(),ws(36,"span",20),GC(37,"\u25BC"),pl()(),Jw(38,ce,2,3,"div",21),pl(),ws(39,"section",10)(40,"h2",11),GC(41," Resources "),ws(42,"span",17),GC(43),pl()(),Jw(44,de,2,0,"p",18)(45,_e,3,0,"ul",22),pl()();}if(e&2){let i=n,a=gC();XE(8),Yg(i.name),XE(4),Yg(i.description),XE(4),Yg(i.namespaceId?"Namespace":"Platform"),XE(4),Ug("skill-inspect__badge--readonly",a.isFilesystemBacked()),XE(),vl(" ",a.isFilesystemBacked()?"SKILL.md file (read-only)":"Database"," "),XE(),eC(a.isFilesystemBacked()?-1:22),XE(4),eC(!a.isPlatformMode&&!a.consumersLoading()&&!a.consumersUnavailable()?26:-1),XE(),eC(a.isPlatformMode?27:a.consumersLoading()?28:a.consumersUnavailable()?29:a.consumers().length===0?30:31),XE(6),Tg("aria-expanded",!a.bodyCollapsed()),XE(3),Ug("skill-inspect__chevron--open",!a.bodyCollapsed()),XE(2),eC(a.bodyCollapsed()?-1:38),XE(5),vl("(",a.resourcePaths().length,")"),XE(),eC(a.resourcePaths().length===0?44:45);}}var G=class e{route=g(W$1);router=g(F);destroyRef=g(Ce);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;skillId=this.route.snapshot.params.skillId;isPlatformMode=!this.namespaceId;isLoading=Gi(true);hasError=Gi(false);skill=Gi(null);bodyCollapsed=Gi(false);expandedResources=Gi(new Set);resourcePaths=mT(()=>Object.keys(this.skill()?.resources??{}).sort());isFilesystemBacked=mT(()=>this.skill()?.readOnly===true);consumers=Gi([]);consumersUnavailable=Gi(false);consumersLoading=Gi(false);ngOnInit(){this.skillState.getById(this.skillId).pipe(U(this.destroyRef)).subscribe({next:n=>{this.skill.set(n),this.isLoading.set(false),this.loadConsumers(n.name);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}loadConsumers(n){this.namespaceId&&(this.consumersLoading.set(true),By({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(ya(()=>br([])))}).pipe(U(this.destroyRef)).subscribe({next:({namespace:i,platform:a})=>{let s=[...this.toConsumers(i,n,false),...this.toConsumers(a,n,true)];this.consumers.set([...s.filter(g=>g.grant==="named"),...s.filter(g=>g.grant==="all")]),this.consumersLoading.set(false);},error:()=>{this.consumersUnavailable.set(true),this.consumersLoading.set(false);}}));}toConsumers(n,i,a$1){return n.map(s=>({config:s,grant:a(s.skillSelectors,i)})).filter(s=>s.grant!=="none").map(({config:s,grant:g})=>({name:s.name,grant:g,platform:a$1}))}toggleBody(){this.bodyCollapsed.update(n=>!n);}toggleResource(n){this.expandedResources.update(i=>{let a=new Set(i);return a.has(n)?a.delete(n):a.add(n),a});}isResourceExpanded(n){return this.expandedResources().has(n)}resourceContent(n){return this.skill()?.resources?.[n]??""}editRoute(){return this.isPlatformMode?["/agentos","admin","skills",this.skillId,"edit"]:["/agentos",this.namespaceId,"skills",this.skillId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(i){return new(i||e)};static \u0275cmp=xw({type:e,selectors:[["agentos-skill-inspect"]],decls:13,vars:3,consts:[[1,"skill-inspect"],[1,"skill-inspect__header"],["type","button","title","Back to skills",1,"skill-inspect__back",3,"click"],[1,"skill-inspect__back-icon"],[1,"skill-inspect__title"],[1,"skill-inspect__sibling-link",3,"routerLink"],[1,"skill-inspect__platform-badge"],[1,"skill-inspect__loading"],["role","alert",1,"skill-inspect__error"],[1,"skill-inspect__content"],[1,"skill-inspect__section"],[1,"skill-inspect__section-title"],[1,"skill-inspect__dl"],[1,"skill-inspect__dt"],[1,"skill-inspect__dd","skill-inspect__dd--mono"],[1,"skill-inspect__dd"],[1,"skill-inspect__badge"],[1,"skill-inspect__count"],[1,"skill-inspect__empty"],["type","button",1,"skill-inspect__collapsible",3,"click"],[1,"skill-inspect__chevron"],[1,"skill-inspect__body",3,"innerHTML"],[1,"skill-inspect__resources"],[1,"skill-inspect__consumers"],[1,"skill-inspect__consumer"],[1,"skill-inspect__consumers-hint"],[1,"skill-inspect__consumer-name"],[1,"skill-inspect__resource"],["type","button",1,"skill-inspect__resource-header",3,"click"],[1,"skill-inspect__resource-path"],[1,"skill-inspect__resource-content"]],template:function(i,a){if(i&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return a.back()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5," Skills "),pl(),ws(6,"h1",4),GC(7,"Skill"),pl(),Jw(8,K,2,1,"a",5),Jw(9,q,2,0,"span",6),pl(),Jw(10,Q,2,0,"p",7)(11,W,2,0,"p",8)(12,ge,46,15,"div",9),pl()),i&2){let s;XE(8),eC(a.skill()&&!a.isFilesystemBacked()?8:-1),XE(),eC(a.isPlatformMode?9:-1),XE(),eC(a.isLoading()?10:a.hasError()?11:(s=a.skill())?12:-1,s);}},dependencies:[$t,d],styles:[".skill-inspect[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.skill-inspect__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.skill-inspect__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.skill-inspect__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.skill-inspect__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.skill-inspect__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.skill-inspect__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-primary, #007aff);text-decoration:none}.skill-inspect__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.skill-inspect__platform-badge[_ngcontent-%COMP%]{align-self:flex-start;font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;padding:.15rem .5rem;border:1px solid var(--color-divider, rgba(0, 0, 0, .12));color:var(--color-neutral-600, #6e6e73)}.skill-inspect__loading[_ngcontent-%COMP%], .skill-inspect__error[_ngcontent-%COMP%], .skill-inspect__empty[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--color-text-secondary, #6e6e73)}.skill-inspect__error[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.skill-inspect__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.skill-inspect__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1.25rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:10px}.skill-inspect__section-title[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f)}.skill-inspect__count[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;margin-left:.25rem}.skill-inspect__dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.5rem 1.25rem;margin:0}.skill-inspect__dt[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);align-self:center}.skill-inspect__dd[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);align-self:center;word-break:break-word}.skill-inspect__dd--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.875rem}.skill-inspect__consumers[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.375rem}.skill-inspect__consumer[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem}.skill-inspect__consumer-name[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500}.skill-inspect__consumers-hint[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.skill-inspect__badge[_ngcontent-%COMP%]{display:inline-block;padding:.2em .6em;border-radius:4px;font-size:.75rem;font-weight:500;background:var(--color-surface-muted, rgba(0, 0, 0, .06));color:var(--color-text-secondary, #6e6e73)}.skill-inspect__badge--readonly[_ngcontent-%COMP%]{background:var(--color-surface-muted, rgba(0, 0, 0, .06));color:var(--color-text, #1d1d1f);border:1px solid var(--color-divider, rgba(0, 0, 0, .12))}.skill-inspect__collapsible[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;background:none;border:none;padding:0;cursor:pointer;font-family:inherit;text-align:left}.skill-inspect__chevron[_ngcontent-%COMP%]{font-size:.7rem;color:var(--color-text-secondary, #6e6e73);transition:transform .15s ease;flex-shrink:0}.skill-inspect__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.skill-inspect__body[_ngcontent-%COMP%]{font-size:.9375rem;line-height:1.6;color:var(--color-text, #1d1d1f);max-height:520px;overflow-y:auto;padding:.875rem 1rem;border-radius:6px;background:var(--color-surface-muted, rgba(0, 0, 0, .04));word-break:break-word}.skill-inspect__body[_ngcontent-%COMP%] [_ngcontent-%COMP%]:first-child{margin-top:0}.skill-inspect__body[_ngcontent-%COMP%] [_ngcontent-%COMP%]:last-child{margin-bottom:0}.skill-inspect__body[_ngcontent-%COMP%] pre[_ngcontent-%COMP%], .skill-inspect__body[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:var(--font-code, monospace);font-size:.8125rem}.skill-inspect__body[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{padding:.75rem;border-radius:6px;background:var(--color-code-bg, rgba(0, 0, 0, .06));overflow-x:auto}.skill-inspect__resources[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.skill-inspect__resource[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .08));border-radius:6px;overflow:hidden}.skill-inspect__resource-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.75rem;width:100%;background:none;border:none;padding:.625rem .875rem;cursor:pointer;font-family:inherit;text-align:left}.skill-inspect__resource-header[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04))}.skill-inspect__resource-path[_ngcontent-%COMP%]{font-family:var(--font-code, monospace);font-size:.8125rem;color:var(--color-text, #1d1d1f);word-break:break-all}.skill-inspect__resource-content[_ngcontent-%COMP%]{margin:0;padding:.875rem;font-family:var(--font-code, monospace);font-size:.8125rem;color:var(--color-text, #1d1d1f);background:var(--color-surface-muted, rgba(0, 0, 0, .04));white-space:pre-wrap;word-break:break-word;max-height:320px;overflow-y:auto}"]})};export{G as SkillInspectComponent};
1
+ import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-DOy5wwe3.js';import {s,d}from'./chunk-CigBS2kT.js';import {g,ao as W$1,F,C as Ce,G as Gi,m as mT,b as U,M as By,a7 as ya,Q as br,e as xw,$ as $t,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,v as eC,ac as gC,u as bg,a9 as lC,a8 as Yg,z as Ug,a5 as vl,T as Tg,s as rC,y as oC,S as Sg,bf as aT,bg as uT,a4 as nC,aa as If,ab as wf,bj as aE}from'./main-CB44G2DK.js';import'./chunk-DzLzwtOe.js';import'./chunk-CnOd7CqJ.js';import'./chunk-JZld8hhU.js';import'./chunk-BDPQgAAh.js';var J=(e,n)=>n.name+n.grant;function K(e,n){if(e&1&&(ws(0,"a",5),GC(1,"Edit skill \u2192"),pl()),e&2){let i=gC();bg("routerLink",i.editRoute());}}function q(e,n){e&1&&(ws(0,"span",6),GC(1,"Platform level"),pl());}function Q(e,n){e&1&&(ws(0,"p",7),GC(1,"Loading\u2026"),pl());}function W(e,n){e&1&&(ws(0,"p",8),GC(1,"Failed to load skill."),pl());}function X(e,n){if(e&1&&(ws(0,"dt",13),GC(1,"Created by"),pl(),ws(2,"dd",15),GC(3),pl()),e&2){let i=gC(2);XE(3),Yg(i.createdBy);}}function Y(e,n){if(e&1&&(ws(0,"dt",13),GC(1,"Last updated"),pl(),ws(2,"dd",15),GC(3),pl()),e&2){let i=gC(2);XE(3),Yg(i.updatedOn);}}function Z(e,n){if(e&1&&(Jw(0,X,4,1),Jw(1,Y,4,1)),e&2){let i=gC();eC(i.createdBy?0:-1),XE(),eC(i.updatedOn?1:-1);}}function ee(e,n){if(e&1&&(ws(0,"span",17),GC(1),pl()),e&2){let i=gC(2);XE(),vl("(",i.consumers().length,")");}}function te(e,n){e&1&&(ws(0,"p",18),GC(1," A platform skill is offered to every namespace. Open it from a namespace to see which of its agents use it. "),pl());}function ne(e,n){e&1&&(ws(0,"p",18),GC(1,"Loading\u2026"),pl());}function ie(e,n){e&1&&(ws(0,"p",8),GC(1," The agent configs could not be read, so it is unknown whether any agent uses this skill. "),pl());}function oe(e,n){e&1&&(ws(0,"p",18),GC(1,"No agent references this skill."),pl());}function le(e,n){e&1&&(ws(0,"span",16),GC(1,"platform agent"),pl());}function ae(e,n){e&1&&(ws(0,"span",16),GC(1,"via *"),pl());}function re(e,n){if(e&1&&(ws(0,"li",24)(1,"span",26),GC(2),pl(),Jw(3,le,2,0,"span",16),Jw(4,ae,2,0,"span",16),pl()),e&2){let i=n.$implicit;XE(2),Yg(i.name),XE(),eC(i.platform?3:-1),XE(),eC(i.grant==="all"?4:-1);}}function se(e,n){if(e&1&&(ws(0,"ul",23),rC(1,re,5,3,"li",24,J),pl(),ws(3,"p",25),GC(4," An agent listed "),ws(5,"code"),GC(6,"via *"),pl(),GC(7," takes the whole catalogue and keeps working without this skill. The others name it, so deleting the skill leaves their selector resolving to nothing. "),pl()),e&2){let i=gC(2);XE(),oC(i.consumers());}}function ce(e,n){if(e&1&&(Sg(0,"div",21),aT(1,"agentosMarkdown")),e&2){let i=gC();bg("innerHTML",uT(1,1,i.body),aE);}}function de(e,n){e&1&&(ws(0,"p",18),GC(1,"No resources bundled with this skill."),pl());}function pe(e,n){if(e&1&&(ws(0,"pre",30),GC(1),pl()),e&2){let i=gC().$implicit,a=gC(3);XE(),Yg(a.resourceContent(i));}}function me(e,n){if(e&1){let i=lC();ws(0,"li",27)(1,"button",28),Rg("click",function(){let s=If(i).$implicit,g=gC(3);return wf(g.toggleResource(s))}),ws(2,"span",29),GC(3),pl(),ws(4,"span",20),GC(5,"\u25BC"),pl()(),Jw(6,pe,2,1,"pre",30),pl();}if(e&2){let i=n.$implicit,a=gC(3);XE(),Tg("aria-expanded",a.isResourceExpanded(i)),XE(2),Yg(i),XE(),Ug("skill-inspect__chevron--open",a.isResourceExpanded(i)),XE(2),eC(a.isResourceExpanded(i)?6:-1);}}function _e(e,n){if(e&1&&(ws(0,"ul",22),rC(1,me,7,5,"li",27,nC),pl()),e&2){let i=gC(2);XE(),oC(i.resourcePaths());}}function ge(e,n){if(e&1){let i=lC();ws(0,"div",9)(1,"section",10)(2,"h2",11),GC(3,"General"),pl(),ws(4,"dl",12)(5,"dt",13),GC(6,"Name"),pl(),ws(7,"dd",14),GC(8),pl(),ws(9,"dt",13),GC(10,"Description"),pl(),ws(11,"dd",15),GC(12),pl(),ws(13,"dt",13),GC(14,"Scope"),pl(),ws(15,"dd",15),GC(16),pl(),ws(17,"dt",13),GC(18,"Storage"),pl(),ws(19,"dd",15)(20,"span",16),GC(21),pl()(),Jw(22,Z,2,2),pl()(),ws(23,"section",10)(24,"h2",11),GC(25," Used by "),Jw(26,ee,2,1,"span",17),pl(),Jw(27,te,2,0,"p",18)(28,ne,2,0,"p",18)(29,ie,2,0,"p",8)(30,oe,2,0,"p",18)(31,se,8,0),pl(),ws(32,"section",10)(33,"button",19),Rg("click",function(){If(i);let s=gC();return wf(s.toggleBody())}),ws(34,"h2",11),GC(35,"Body"),pl(),ws(36,"span",20),GC(37,"\u25BC"),pl()(),Jw(38,ce,2,3,"div",21),pl(),ws(39,"section",10)(40,"h2",11),GC(41," Resources "),ws(42,"span",17),GC(43),pl()(),Jw(44,de,2,0,"p",18)(45,_e,3,0,"ul",22),pl()();}if(e&2){let i=n,a=gC();XE(8),Yg(i.name),XE(4),Yg(i.description),XE(4),Yg(i.namespaceId?"Namespace":"Platform"),XE(4),Ug("skill-inspect__badge--readonly",a.isFilesystemBacked()),XE(),vl(" ",a.isFilesystemBacked()?"SKILL.md file (read-only)":"Database"," "),XE(),eC(a.isFilesystemBacked()?-1:22),XE(4),eC(!a.isPlatformMode&&!a.consumersLoading()&&!a.consumersUnavailable()?26:-1),XE(),eC(a.isPlatformMode?27:a.consumersLoading()?28:a.consumersUnavailable()?29:a.consumers().length===0?30:31),XE(6),Tg("aria-expanded",!a.bodyCollapsed()),XE(3),Ug("skill-inspect__chevron--open",!a.bodyCollapsed()),XE(2),eC(a.bodyCollapsed()?-1:38),XE(5),vl("(",a.resourcePaths().length,")"),XE(),eC(a.resourcePaths().length===0?44:45);}}var G=class e{route=g(W$1);router=g(F);destroyRef=g(Ce);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;skillId=this.route.snapshot.params.skillId;isPlatformMode=!this.namespaceId;isLoading=Gi(true);hasError=Gi(false);skill=Gi(null);bodyCollapsed=Gi(false);expandedResources=Gi(new Set);resourcePaths=mT(()=>Object.keys(this.skill()?.resources??{}).sort());isFilesystemBacked=mT(()=>this.skill()?.readOnly===true);consumers=Gi([]);consumersUnavailable=Gi(false);consumersLoading=Gi(false);ngOnInit(){this.skillState.getById(this.skillId).pipe(U(this.destroyRef)).subscribe({next:n=>{this.skill.set(n),this.isLoading.set(false),this.loadConsumers(n.name);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}loadConsumers(n){this.namespaceId&&(this.consumersLoading.set(true),By({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(ya(()=>br([])))}).pipe(U(this.destroyRef)).subscribe({next:({namespace:i,platform:a})=>{let s=[...this.toConsumers(i,n,false),...this.toConsumers(a,n,true)];this.consumers.set([...s.filter(g=>g.grant==="named"),...s.filter(g=>g.grant==="all")]),this.consumersLoading.set(false);},error:()=>{this.consumersUnavailable.set(true),this.consumersLoading.set(false);}}));}toConsumers(n,i,a$1){return n.map(s=>({config:s,grant:a(s.skillSelectors,i)})).filter(s=>s.grant!=="none").map(({config:s,grant:g})=>({name:s.name,grant:g,platform:a$1}))}toggleBody(){this.bodyCollapsed.update(n=>!n);}toggleResource(n){this.expandedResources.update(i=>{let a=new Set(i);return a.has(n)?a.delete(n):a.add(n),a});}isResourceExpanded(n){return this.expandedResources().has(n)}resourceContent(n){return this.skill()?.resources?.[n]??""}editRoute(){return this.isPlatformMode?["/agentos","admin","skills",this.skillId,"edit"]:["/agentos",this.namespaceId,"skills",this.skillId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(i){return new(i||e)};static \u0275cmp=xw({type:e,selectors:[["agentos-skill-inspect"]],decls:13,vars:3,consts:[[1,"skill-inspect"],[1,"skill-inspect__header"],["type","button","title","Back to skills",1,"skill-inspect__back",3,"click"],[1,"skill-inspect__back-icon"],[1,"skill-inspect__title"],[1,"skill-inspect__sibling-link",3,"routerLink"],[1,"skill-inspect__platform-badge"],[1,"skill-inspect__loading"],["role","alert",1,"skill-inspect__error"],[1,"skill-inspect__content"],[1,"skill-inspect__section"],[1,"skill-inspect__section-title"],[1,"skill-inspect__dl"],[1,"skill-inspect__dt"],[1,"skill-inspect__dd","skill-inspect__dd--mono"],[1,"skill-inspect__dd"],[1,"skill-inspect__badge"],[1,"skill-inspect__count"],[1,"skill-inspect__empty"],["type","button",1,"skill-inspect__collapsible",3,"click"],[1,"skill-inspect__chevron"],[1,"skill-inspect__body",3,"innerHTML"],[1,"skill-inspect__resources"],[1,"skill-inspect__consumers"],[1,"skill-inspect__consumer"],[1,"skill-inspect__consumers-hint"],[1,"skill-inspect__consumer-name"],[1,"skill-inspect__resource"],["type","button",1,"skill-inspect__resource-header",3,"click"],[1,"skill-inspect__resource-path"],[1,"skill-inspect__resource-content"]],template:function(i,a){if(i&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return a.back()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5," Skills "),pl(),ws(6,"h1",4),GC(7,"Skill"),pl(),Jw(8,K,2,1,"a",5),Jw(9,q,2,0,"span",6),pl(),Jw(10,Q,2,0,"p",7)(11,W,2,0,"p",8)(12,ge,46,15,"div",9),pl()),i&2){let s;XE(8),eC(a.skill()&&!a.isFilesystemBacked()?8:-1),XE(),eC(a.isPlatformMode?9:-1),XE(),eC(a.isLoading()?10:a.hasError()?11:(s=a.skill())?12:-1,s);}},dependencies:[$t,d],styles:[".skill-inspect[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.skill-inspect__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.skill-inspect__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.skill-inspect__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.skill-inspect__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.skill-inspect__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.skill-inspect__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-primary, #007aff);text-decoration:none}.skill-inspect__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.skill-inspect__platform-badge[_ngcontent-%COMP%]{align-self:flex-start;font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;padding:.15rem .5rem;border:1px solid var(--color-divider, rgba(0, 0, 0, .12));color:var(--color-neutral-600, #6e6e73)}.skill-inspect__loading[_ngcontent-%COMP%], .skill-inspect__error[_ngcontent-%COMP%], .skill-inspect__empty[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--color-text-secondary, #6e6e73)}.skill-inspect__error[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.skill-inspect__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.skill-inspect__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1.25rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:10px}.skill-inspect__section-title[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f)}.skill-inspect__count[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;margin-left:.25rem}.skill-inspect__dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.5rem 1.25rem;margin:0}.skill-inspect__dt[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);align-self:center}.skill-inspect__dd[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);align-self:center;word-break:break-word}.skill-inspect__dd--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.875rem}.skill-inspect__consumers[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.375rem}.skill-inspect__consumer[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem}.skill-inspect__consumer-name[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500}.skill-inspect__consumers-hint[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.skill-inspect__badge[_ngcontent-%COMP%]{display:inline-block;padding:.2em .6em;border-radius:4px;font-size:.75rem;font-weight:500;background:var(--color-surface-muted, rgba(0, 0, 0, .06));color:var(--color-text-secondary, #6e6e73)}.skill-inspect__badge--readonly[_ngcontent-%COMP%]{background:var(--color-surface-muted, rgba(0, 0, 0, .06));color:var(--color-text, #1d1d1f);border:1px solid var(--color-divider, rgba(0, 0, 0, .12))}.skill-inspect__collapsible[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;background:none;border:none;padding:0;cursor:pointer;font-family:inherit;text-align:left}.skill-inspect__chevron[_ngcontent-%COMP%]{font-size:.7rem;color:var(--color-text-secondary, #6e6e73);transition:transform .15s ease;flex-shrink:0}.skill-inspect__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.skill-inspect__body[_ngcontent-%COMP%]{font-size:.9375rem;line-height:1.6;color:var(--color-text, #1d1d1f);max-height:520px;overflow-y:auto;padding:.875rem 1rem;border-radius:6px;background:var(--color-surface-muted, rgba(0, 0, 0, .04));word-break:break-word}.skill-inspect__body[_ngcontent-%COMP%] [_ngcontent-%COMP%]:first-child{margin-top:0}.skill-inspect__body[_ngcontent-%COMP%] [_ngcontent-%COMP%]:last-child{margin-bottom:0}.skill-inspect__body[_ngcontent-%COMP%] pre[_ngcontent-%COMP%], .skill-inspect__body[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:var(--font-code, monospace);font-size:.8125rem}.skill-inspect__body[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{padding:.75rem;border-radius:6px;background:var(--color-code-bg, rgba(0, 0, 0, .06));overflow-x:auto}.skill-inspect__resources[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.skill-inspect__resource[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .08));border-radius:6px;overflow:hidden}.skill-inspect__resource-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.75rem;width:100%;background:none;border:none;padding:.625rem .875rem;cursor:pointer;font-family:inherit;text-align:left}.skill-inspect__resource-header[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04))}.skill-inspect__resource-path[_ngcontent-%COMP%]{font-family:var(--font-code, monospace);font-size:.8125rem;color:var(--color-text, #1d1d1f);word-break:break-all}.skill-inspect__resource-content[_ngcontent-%COMP%]{margin:0;padding:.875rem;font-family:var(--font-code, monospace);font-size:.8125rem;color:var(--color-text, #1d1d1f);background:var(--color-surface-muted, rgba(0, 0, 0, .04));white-space:pre-wrap;word-break:break-word;max-height:320px;overflow-y:auto}"]})};export{G as SkillInspectComponent};
@@ -1,4 +1,4 @@
1
- import {dy as A,dz as z$1}from'./main-R5QFX3OD.js';var ut=z$1(Xe=>{"use strict";(function(i){var n=/\S/,t=/\"/g,e=/\n/g,r=/\r/g,a=/\\/g,s=/\u2028/,u=/\u2029/;i.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},i.scan=function(h,g){var S=h.length,U=0,R=1,q=2,E=U,$=null,ee=null,B="",I=[],J=!1,O=0,C=0,L="{{",b="}}";function te(){B.length>0&&(I.push({tag:"_t",text:new String(B)}),B="");}function ge(){for(var A=!0,k=C;k<I.length;k++)if(A=i.tags[I[k].tag]<i.tags._v||I[k].tag=="_t"&&I[k].text.match(n)===null,!A)return !1;return A}function be(A,k){if(te(),A&&ge())for(var _=C,ie;_<I.length;_++)I[_].text&&((ie=I[_+1])&&ie.tag==">"&&(ie.indent=I[_].text.toString()),I.splice(_,1));else k||I.push({tag:`
1
+ import {dy as A,dz as z$1}from'./main-CB44G2DK.js';var ut=z$1(Xe=>{"use strict";(function(i){var n=/\S/,t=/\"/g,e=/\n/g,r=/\r/g,a=/\\/g,s=/\u2028/,u=/\u2029/;i.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},i.scan=function(h,g){var S=h.length,U=0,R=1,q=2,E=U,$=null,ee=null,B="",I=[],J=!1,O=0,C=0,L="{{",b="}}";function te(){B.length>0&&(I.push({tag:"_t",text:new String(B)}),B="");}function ge(){for(var A=!0,k=C;k<I.length;k++)if(A=i.tags[I[k].tag]<i.tags._v||I[k].tag=="_t"&&I[k].text.match(n)===null,!A)return !1;return A}function be(A,k){if(te(),A&&ge())for(var _=C,ie;_<I.length;_++)I[_].text&&((ie=I[_+1])&&ie.tag==">"&&(ie.indent=I[_].text.toString()),I.splice(_,1));else k||I.push({tag:`
2
2
  `});J=!1,C=I.length;}function ne(A,k){var _="="+b,ie=A.indexOf(_,k),De=f(A.substring(A.indexOf("=",k)+1,ie)).split(" ");return L=De[0],b=De[De.length-1],ie+_.length-1}for(g&&(g=g.split(" "),L=g[0],b=g[1]),O=0;O<S;O++)E==U?v(L,h,O)?(--O,te(),E=R):h.charAt(O)==`
3
3
  `?be(J):B+=h.charAt(O):E==R?(O+=L.length-1,ee=i.tags[h.charAt(O+1)],$=ee?h.charAt(O+1):"_v",$=="="?(O=ne(h,O),E=U):(ee&&O++,E=q),J=O):v(b,h,O)?(I.push({tag:$,n:f(B),otag:L,ctag:b,i:$=="/"?J-L.length:O+b.length}),B="",O+=b.length-1,E=U,$=="{"&&(b=="}}"?O++:d(I[I.length-1]))):B+=h.charAt(O);return be(J,!0),I};function d(l){l.n.substr(l.n.length-1)==="}"&&(l.n=l.n.substring(0,l.n.length-1));}function f(l){return l.trim?l.trim():l.replace(/^\s*|\s*$/g,"")}function v(l,h,g){if(h.charAt(g)!=l.charAt(0))return !1;for(var S=1,U=l.length;S<U;S++)if(h.charAt(g+S)!=l.charAt(S))return !1;return !0}var y={_t:!0,"\n":!0,$:!0,"/":!0};function o(l,h,g,S){var U=[],R=null,q=null,E=null;for(q=g[g.length-1];l.length>0;){if(E=l.shift(),q&&q.tag=="<"&&!(E.tag in y))throw new Error("Illegal content in < super tag.");if(i.tags[E.tag]<=i.tags.$||c(E,S))g.push(E),E.nodes=o(l,E.tag,g,S);else if(E.tag=="/"){if(g.length===0)throw new Error("Closing tag without opener: /"+E.n);if(R=g.pop(),E.n!=R.n&&!m(E.n,R.n,S))throw new Error("Nesting error: "+R.n+" vs. "+E.n);return R.end=E.i,U}else E.tag==`
4
4
  `&&(E.last=l.length==0||l[0].tag==`
@@ -1 +1 @@
1
- import {g,dl as de,W as x}from'./main-R5QFX3OD.js';var c=class r{api=g(de);getById(e){return this.api.getByIdScheduledPrompt(e)}listPlatform(){return this.api.searchScheduledPrompt({namespaceId:null,userId:null})}listByNamespace(e){return this.api.searchScheduledPrompt({namespaceId:e,userId:null})}search(e){return this.api.searchScheduledPrompt(e)}listEffective(e){return this.api.resolveEffectiveScheduledPrompt(e)}create(e){return this.api.createScheduledPrompt(e)}update(e,t){return this.api.updateScheduledPrompt(e,t)}enable(e){return this.api.enableScheduledPrompt(e)}disable(e){return this.api.disableScheduledPrompt(e)}delete(e){return this.api.deleteScheduledPrompt(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=x({token:r,factory:r.\u0275fac,providedIn:"root"})};export{c};
1
+ import {g,dl as de,W as x}from'./main-CB44G2DK.js';var c=class r{api=g(de);getById(e){return this.api.getByIdScheduledPrompt(e)}listPlatform(){return this.api.searchScheduledPrompt({namespaceId:null,userId:null})}listByNamespace(e){return this.api.searchScheduledPrompt({namespaceId:e,userId:null})}search(e){return this.api.searchScheduledPrompt(e)}listEffective(e){return this.api.resolveEffectiveScheduledPrompt(e)}create(e){return this.api.createScheduledPrompt(e)}update(e,t){return this.api.updateScheduledPrompt(e,t)}enable(e){return this.api.enableScheduledPrompt(e)}disable(e){return this.api.disableScheduledPrompt(e)}delete(e){return this.api.deleteScheduledPrompt(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=x({token:r,factory:r.\u0275fac,providedIn:"root"})};export{c};