@whoz-oss/coday-client 0.233.1 → 0.235.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/browser/{chunk-2OX7XSO7.js → chunk-3L5HH2LW.js} +1 -1
  2. package/browser/chunk-3SWGL6G7.js +1 -0
  3. package/browser/{chunk-GULJQNKJ.js → chunk-3WHV3A3F.js} +1 -1
  4. package/browser/{chunk-ZJ5WTNW7.js → chunk-3XEA5TTG.js} +1 -1
  5. package/browser/{chunk-NAJJT42Y.js → chunk-4QUKFJVG.js} +1 -1
  6. package/browser/{chunk-XZAGZJYJ.js → chunk-5F4OBAQR.js} +1 -1
  7. package/browser/{chunk-LVLF3D4X.js → chunk-5P3YDX4D.js} +1 -1
  8. package/browser/{chunk-V4WIZDIH.js → chunk-62SCRDTI.js} +1 -1
  9. package/browser/{chunk-5EIDKSSY.js → chunk-6OUF4MB3.js} +1 -1
  10. package/browser/{chunk-OFLO4C7X.js → chunk-6V5ZHXTF.js} +1 -1
  11. package/browser/chunk-7PHHASXE.js +1 -0
  12. package/browser/{chunk-2RRKNP4O.js → chunk-7WNGYNNF.js} +1 -1
  13. package/browser/chunk-A2IQII4O.js +1 -0
  14. package/browser/{chunk-63DV6LLE.js → chunk-AK3ITDZL.js} +1 -1
  15. package/browser/{chunk-UCATWB2P.js → chunk-B235KWLK.js} +1 -1
  16. package/browser/{chunk-OFPREK4V.js → chunk-B4YVERDA.js} +1 -1
  17. package/browser/{chunk-VZVJKZA2.js → chunk-BJ6IXKIG.js} +1 -1
  18. package/browser/{chunk-BYGLGHPS.js → chunk-BSULGZWF.js} +1 -1
  19. package/browser/{chunk-FS4CUJQH.js → chunk-C7HN2AHW.js} +1 -1
  20. package/browser/{chunk-4KS5XFO4.js → chunk-CMDN4G5T.js} +1 -1
  21. package/browser/{chunk-ALD52Y36.js → chunk-D4DYD37W.js} +1 -1
  22. package/browser/chunk-DDBWRK3B.js +1 -0
  23. package/browser/{chunk-XKAY4JO3.js → chunk-DYASMOHQ.js} +1 -1
  24. package/browser/{chunk-56F7GUQR.js → chunk-EPOMVQLK.js} +1 -1
  25. package/browser/{chunk-NQVAKMAF.js → chunk-FIDJLAO5.js} +1 -1
  26. package/browser/{chunk-55CCIZ6Y.js → chunk-FKSUXVTW.js} +1 -1
  27. package/browser/{chunk-KY2WN2WL.js → chunk-GGJJHI5J.js} +1 -1
  28. package/browser/{chunk-ZGOOG7E4.js → chunk-GVUZDCHM.js} +1 -1
  29. package/browser/{chunk-OMBUBJIY.js → chunk-HGDDIJKH.js} +1 -1
  30. package/browser/chunk-HQF5YXBC.js +1 -0
  31. package/browser/chunk-HW7FY6FY.js +1 -0
  32. package/browser/{chunk-4MIM6YHV.js → chunk-IGXPPLQW.js} +1 -1
  33. package/browser/{chunk-SBHTD5EV.js → chunk-IUKPWUMW.js} +1 -1
  34. package/browser/chunk-J3QUVW75.js +1 -0
  35. package/browser/chunk-JD6LMKJY.js +1 -0
  36. package/browser/{chunk-QAGM2FI6.js → chunk-JWECOKZF.js} +1 -1
  37. package/browser/chunk-M4ES4I34.js +1 -0
  38. package/browser/{chunk-TT5QO735.js → chunk-MGHX6XY3.js} +1 -1
  39. package/browser/{chunk-OUCM7C5E.js → chunk-OESN2OVC.js} +1 -1
  40. package/browser/chunk-OJPNIW6G.js +1 -0
  41. package/browser/chunk-OLEK57CJ.js +1 -0
  42. package/browser/{chunk-HV4YVRZD.js → chunk-PBZL7DN5.js} +1 -1
  43. package/browser/chunk-PL3BJFLT.js +1 -0
  44. package/browser/{chunk-U6DZITWN.js → chunk-QNOZT6US.js} +1 -1
  45. package/browser/{chunk-EUKRA2OA.js → chunk-QO3SLUF6.js} +1 -1
  46. package/browser/chunk-RDEFHYHJ.js +1 -0
  47. package/browser/{chunk-MHB6HAME.js → chunk-SLVL4O7X.js} +1 -1
  48. package/browser/{chunk-OJAJVOW4.js → chunk-T5DS7HZO.js} +1 -1
  49. package/browser/chunk-U26U4YUX.js +1 -0
  50. package/browser/chunk-UWESGTIU.js +1 -0
  51. package/browser/{chunk-SG2Y5LGP.js → chunk-VDPBH6I4.js} +1 -1
  52. package/browser/{chunk-MKGPVNPI.js → chunk-XZDUSWYE.js} +1 -1
  53. package/browser/{chunk-3DCEAZDI.js → chunk-YONCBD5A.js} +1 -1
  54. package/browser/{chunk-TOQLOSTJ.js → chunk-ZO272F3U.js} +1 -1
  55. package/browser/index.html +1 -1
  56. package/browser/{main-SDUET5IO.js → main-6K2RB63O.js} +1 -1
  57. package/package.json +1 -1
  58. package/browser/chunk-3PL5XB7S.js +0 -1
  59. package/browser/chunk-4WS3QONK.js +0 -1
  60. package/browser/chunk-5SWFEZKV.js +0 -1
  61. package/browser/chunk-7ZDYCVKF.js +0 -1
  62. package/browser/chunk-E5K3YORT.js +0 -1
  63. package/browser/chunk-EJX3SCU5.js +0 -1
  64. package/browser/chunk-LPBSLDC7.js +0 -1
  65. package/browser/chunk-MDHGCSE2.js +0 -1
  66. package/browser/chunk-MFNQXB7D.js +0 -1
  67. package/browser/chunk-VH7ZEMCE.js +0 -1
@@ -1 +1 @@
1
- import{a as ee}from"./chunk-5EIDKSSY.js";import{b as R}from"./chunk-VH7ZEMCE.js";import{a as G,c as J}from"./chunk-COLWSJEP.js";import{a as P}from"./chunk-PUWEEZSA.js";import{F as Z,c as $,e as _,g as L,h as B,i as N,l as u,n as q,r as I,s as j,t as U,u as H,v as K,w as Q,x as W,y as X,z as Y}from"./chunk-ZJV25K6M.js";import{Bb as E,D as A,Db as C,Fb as s,Ka as a,Rb as O,Tb as o,Ub as v,Vb as F,Wa as D,a as V,b as T,ca as b,ga as x,ha as h,lb as c,m as k,ma as z,mb as f,nb as w,pb as M,qb as S,rb as m,sb as n,ta as y,tb as r,ub as g}from"./chunk-3DOXTB6J.js";var re=(i,t)=>t.id;function oe(i,t){i&1&&(n(0,"p",5),o(1,"Loading\u2026"),r())}function ne(i,t){i&1&&(n(0,"span",12),o(1,"Name is required."),r())}function ie(i,t){if(i&1&&(n(0,"p",31),o(1),r(),n(2,"span",26),o(3,"Agent Config cannot be changed after creation."),r()),i&2){let e=s(3);a(),v(e.resolveAgentConfigName(e.agentConfigIdControl.value))}}function ae(i,t){if(i&1&&(n(0,"option",33),o(1),r()),i&2){let e=t.$implicit;m("ngValue",e.id),a(),v(e.name)}}function le(i,t){if(i&1&&(n(0,"select",32)(1,"option",33),o(2,"\u2014 None \u2014"),r(),M(3,ae,2,2,"option",33,re),r(),n(5,"span",26),o(6,"Optional. Links this prompt to an agent as a starter. Immutable after creation."),r()),i&2){let e=s(3);m("formControl",e.agentConfigIdControl),a(),m("ngValue",null),a(2),S(e.availableAgentConfigs())}}function me(i,t){if(i&1&&(n(0,"div",8)(1,"label",30),o(2,"Agent Config"),r(),c(3,ie,4,1)(4,le,7,2),r()),i&2){let e=s(2);a(3),f(e.isEditMode()&&e.agentConfigIdControl.value?3:e.isEditMode()?-1:4)}}function pe(i,t){i&1&&(n(0,"p",19),o(1,"No parameters defined."),r())}function de(i,t){i&1&&(n(0,"span",12),o(1,"Parameter name is required."),r())}function se(i,t){if(i&1){let e=E();n(0,"div",20)(1,"div",34)(2,"div",35)(3,"label",36),o(4,"Name "),n(5,"span",10),o(6,"*"),r()(),g(7,"input",37),c(8,de,2,0,"span",12),r(),n(9,"div",35)(10,"label",36),o(11,"Description"),r(),g(12,"input",38),r(),n(13,"div",35)(14,"label",36),o(15,"Default value"),r(),g(16,"input",39),r()(),n(17,"button",40),C("click",function(){let p=x(e).$index,d=s(2);return h(d.removeParameter(p))}),o(18," \xD7 "),r()()}if(i&2){let e=t.$implicit,l=t.$index;m("formGroupName",l),a(3),m("for","param-name-"+l),a(4),O("prompt-form__input--invalid",e.controls.name.invalid&&e.controls.name.touched),m("id","param-name-"+l),a(),f(e.controls.name.invalid&&e.controls.name.touched?8:-1),a(2),m("for","param-desc-"+l),a(2),m("id","param-desc-"+l),a(2),m("for","param-default-"+l),a(2),m("id","param-default-"+l)}}function ce(i,t){i&1&&(n(0,"span",12),o(1,"Content entry must not be blank."),r())}function fe(i,t){if(i&1){let e=E();n(0,"div",22)(1,"span",41),o(2),r(),n(3,"div",42),g(4,"textarea",43),c(5,ce,2,0,"span",12),r(),n(6,"button",44),C("click",function(){let p=x(e).$index,d=s(2);return h(d.removeContentEntry(p))}),o(7," \xD7 "),r()()}if(i&2){let e=t.$implicit,l=t.$index,p=s(2);a(2),v(l+1),a(2),O("prompt-form__textarea--invalid",e.invalid&&e.touched),m("formControlName",l),a(),f(e.invalid&&e.touched?5:-1),a(),m("disabled",p.contentArray.length===1)}}function _e(i,t){if(i&1&&(n(0,"p",23),o(1),r()),i&2){let e=s(2);a(),v(e.errorMessage())}}function ue(i,t){i&1&&(n(0,"span",12),o(1,"Invalid JSON."),r())}function ge(i,t){if(i&1){let e=E();n(0,"form",7),C("ngSubmit",function(){x(e);let p=s();return h(p.submit())}),n(1,"div",8)(2,"label",9),o(3,"Name "),n(4,"span",10),o(5,"*"),r()(),g(6,"input",11),c(7,ne,2,0,"span",12),r(),n(8,"div",8)(9,"label",13),o(10,"Description"),r(),g(11,"input",14),r(),c(12,me,5,1,"div",8),n(13,"fieldset",15)(14,"legend",16),o(15," Parameters "),n(16,"span",17),o(17,"Named placeholders used in content"),r()(),n(18,"p",18),o(19," Each parameter must have a name and a default value. Use "),n(20,"code"),o(21),r(),o(22," in content entries to reference them. "),r(),c(23,pe,2,0,"p",19),M(24,se,19,10,"div",20,w),n(26,"button",21),C("click",function(){x(e);let p=s();return h(p.addParameter())}),o(27,"+ Add parameter"),r()(),n(28,"fieldset",15)(29,"legend",16),o(30," Content "),n(31,"span",10),o(32,"*"),r(),n(33,"span",17),o(34,"Ordered list of text commands"),r()(),n(35,"p",18),o(36," Each content entry is a command. Use "),n(37,"code"),o(38,"@AgentName"),r(),o(39," to target an agent, "),n(40,"code"),o(41,"/promptName param1 param2"),r(),o(42," to call another prompt, and "),n(43,"code"),o(44),r(),o(45," for parameter placeholders. "),r(),M(46,fe,8,6,"div",22,w),n(48,"button",21),C("click",function(){x(e);let p=s();return h(p.addContentEntry())}),o(49,"+ Add content entry"),r()(),c(50,_e,2,1,"p",23),n(51,"div",8)(52,"label",24),o(53,"External Metadata"),r(),g(54,"textarea",25),c(55,ue,2,0,"span",12),n(56,"span",26),o(57,"Optional. Opaque JSON object stored as-is. Leave empty to clear."),r()(),n(58,"div",27)(59,"button",28),o(60),r(),n(61,"button",29),C("click",function(){x(e);let p=s();return h(p.cancel())}),o(62,"Cancel"),r()()()}if(i&2){let e=s();m("formGroup",e.form),a(6),O("prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),m("formControl",e.nameControl),a(),f(e.nameControl.invalid&&e.nameControl.touched?7:-1),a(4),m("formControl",e.descriptionControl),a(),f(e.availableAgentConfigs().length>0?12:-1),a(),m("formArrayName","parameters"),a(8),v(e.paramPlaceholderSyntax),a(2),f(e.parametersArray.length===0?23:-1),a(),S(e.parametersArray.controls),a(4),m("formArrayName","content"),a(16),v(e.paramPlaceholderSyntax),a(2),S(e.contentArray.controls),a(4),f(e.errorMessage()?50:-1),a(4),m("formControl",e.externalMetadataJsonControl),a(),f(e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?55:-1),a(4),m("disabled",e.form.invalid||e.isSubmitting()),a(),F(" ",e.isEditMode()?"Save changes":"Create"," ")}}var te=class i{route=b(G);router=b(J);destroyRef=b(z);promptState=b(ee);agentConfigController=b(R);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new N({name:new u("",{nonNullable:!0,validators:[_.required,_.minLength(1)]}),description:new u(null),agentConfigId:new u(null),externalMetadataJson:new u("",{nonNullable:!0,validators:[Ce]}),content:new I([this.createContentControl()],{validators:[_.required]}),parameters:new I([])});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}get contentArray(){return this.form.controls.content}get parametersArray(){return this.form.controls.parameters}isEditMode=y(!1);isSubmitting=y(!1);isLoading=y(!1);errorMessage=y(null);paramPlaceholderSyntax="{{paramName}}";agentConfigs=y([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("promptId");t&&(this.isEditMode.set(!0),this.loadPrompt(t)),this.isPlatformMode?this.loadPlatformAgentConfigs():this.namespaceId&&this.loadAgentConfigs(this.namespaceId)}loadPrompt(t){this.isLoading.set(!0),this.promptState.getById(t).pipe(P(this.destroyRef)).subscribe({next:e=>{this.existingPrompt=e,this.hydrateForm(e),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),this.navigateBack()}})}loadAgentConfigs(t){this.agentConfigController.listByParentAgentConfig(t).pipe(P(this.destroyRef),A(()=>k([]))).subscribe(e=>this.agentConfigs.set(e))}loadPlatformAgentConfigs(){this.agentConfigController.listPlatformAgentsAgentConfig().pipe(P(this.destroyRef),A(()=>k([]))).subscribe(t=>this.agentConfigs.set(t))}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId??null),this.contentArray.clear(),(t.content.length>0?t.content:[""]).forEach(l=>this.contentArray.push(this.createContentControl(l))),this.parametersArray.clear(),(t.parameters??[]).forEach(l=>this.parametersArray.push(this.createParameterGroup(l))),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"")}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}createContentControl(t=""){return new u(t,{nonNullable:!0,validators:[_.required,_.pattern(/\S/)]})}addContentEntry(){this.contentArray.push(this.createContentControl())}removeContentEntry(t){this.contentArray.length>1&&this.contentArray.removeAt(t)}createParameterGroup(t){return new N({name:new u(t?.name??"",{nonNullable:!0,validators:[_.required,_.minLength(1)]}),description:new u(t?.description??null),defaultValue:new u(t?.defaultValue??"",{nonNullable:!0,validators:[_.required]})})}addParameter(){this.parametersArray.push(this.createParameterGroup())}removeParameter(t){this.parametersArray.removeAt(t)}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(!0);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=T(V({},this.existingPrompt??{}),{namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,content:this.contentArray.controls.map(d=>d.value.trim()),parameters:this.parametersArray.controls.map(d=>({name:d.controls.name.value.trim(),description:d.controls.description.value?.trim()||void 0,defaultValue:d.controls.defaultValue.value.trim()}))});t||(e.agentConfigId=this.agentConfigIdControl.value||null);let l=this.externalMetadataJsonControl.value.trim();e.externalMetadata=l?JSON.parse(l):null;let p=t?this.promptState.update(this.existingPrompt.id,e):this.promptState.create(e);this.errorMessage.set(null),p.pipe(P(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:d=>{this.isSubmitting.set(!1),d.status===409?this.errorMessage.set(`A prompt named "${e.name}" already exists in this scope.`):d.status===400?this.errorMessage.set(d.error?.message??"Invalid prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.")}})}cancel(){this.navigateBack()}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","prompts"]):this.router.navigate(["/agentos",this.namespaceId,"prompts"])}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=D({type:i,selectors:[["agentos-prompt-form"]],decls:10,vars:3,consts:[[1,"prompt-form"],[1,"prompt-form__header"],["type","button","title","Back to prompts",1,"prompt-form__back",3,"click"],[1,"prompt-form__back-icon"],[1,"prompt-form__title"],[1,"prompt-form__loading"],[1,"prompt-form__form",3,"formGroup"],[1,"prompt-form__form",3,"ngSubmit","formGroup"],[1,"prompt-form__field"],["for","prompt-name",1,"prompt-form__label"],["aria-hidden","true"],["id","prompt-name","type","text","placeholder","e.g. Summarise meeting notes","autocomplete","off",1,"prompt-form__input",3,"formControl"],[1,"prompt-form__field-error"],["for","prompt-description",1,"prompt-form__label"],["id","prompt-description","type","text","placeholder","Optional \u2014 short description of this prompt","autocomplete","off",1,"prompt-form__input",3,"formControl"],[1,"prompt-form__section",3,"formArrayName"],[1,"prompt-form__label"],[1,"prompt-form__label-hint"],[1,"prompt-form__section-hint"],[1,"prompt-form__empty-hint"],[1,"prompt-form__param-row",3,"formGroupName"],["type","button",1,"prompt-form__add-btn",3,"click"],[1,"prompt-form__content-row"],[1,"prompt-form__error"],["for","prompt-external-metadata",1,"prompt-form__label"],["id","prompt-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",1,"prompt-form__textarea","prompt-form__textarea--code",3,"formControl"],[1,"prompt-form__field-hint"],[1,"prompt-form__actions"],["type","submit",1,"prompt-form__btn","prompt-form__btn--primary",3,"disabled"],["type","button",1,"prompt-form__btn",3,"click"],["for","prompt-agent-config",1,"prompt-form__label"],[1,"prompt-form__readonly-value"],["id","prompt-agent-config",1,"prompt-form__select",3,"formControl"],[3,"ngValue"],[1,"prompt-form__param-fields"],[1,"prompt-form__field","prompt-form__field--inline"],[1,"prompt-form__label",3,"for"],["type","text","placeholder","e.g. language","formControlName","name","autocomplete","off",1,"prompt-form__input",3,"id"],["type","text","placeholder","Optional","formControlName","description","autocomplete","off",1,"prompt-form__input",3,"id"],["type","text","placeholder","e.g. English","formControlName","defaultValue","autocomplete","off",1,"prompt-form__input",3,"id"],["type","button","title","Remove this parameter",1,"prompt-form__remove-btn",3,"click"],[1,"prompt-form__content-index"],[1,"prompt-form__content-field"],["rows","4","placeholder","Enter a command\u2026",1,"prompt-form__textarea",3,"formControlName"],["type","button","title","Remove this entry",1,"prompt-form__remove-btn",3,"click","disabled"]],template:function(e,l){e&1&&(n(0,"div",0)(1,"header",1)(2,"button",2),C("click",function(){return l.cancel()}),n(3,"span",3),o(4,"\u2190"),r(),o(5),r(),n(6,"h1",4),o(7),r()(),c(8,oe,2,0,"p",5)(9,ge,63,17,"form",6),r()),e&2&&(a(5),F(" ",l.isPlatformMode?"Platform prompts":"Prompts"," "),a(2),v(l.isEditMode()?"Edit prompt":"New prompt"),a(),f(l.isLoading()?8:9))},dependencies:[Z,q,X,Y,$,W,L,B,j,Q,K,U,H],styles:[".prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.prompt-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.prompt-form__field--inline[_ngcontent-%COMP%]{flex:1}.prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.prompt-form__label-hint[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary);margin-left:.375rem}.prompt-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;cursor:pointer;appearance:auto;transition:border-color .15s ease}.prompt-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.prompt-form__field-hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.prompt-form__readonly-value[_ngcontent-%COMP%]{margin:0;padding:.5rem .875rem;border-radius:0;background:var(--color-bg-hover);border:1px solid var(--color-divider);color:var(--color-text);font-size:.9375rem}.prompt-form__input[_ngcontent-%COMP%], .prompt-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.prompt-form__input[_ngcontent-%COMP%]:focus, .prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.prompt-form__input[_ngcontent-%COMP%]::placeholder, .prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.prompt-form__textarea--code[_ngcontent-%COMP%]{font-family:monospace;font-size:.85rem;resize:vertical}.prompt-form__section[_ngcontent-%COMP%]{border:1px solid var(--color-divider);border-radius:0;padding:1rem;margin:0;display:flex;flex-direction:column;gap:.75rem}.prompt-form__section-hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.prompt-form__empty-hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.prompt-form__content-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-start}.prompt-form__content-field[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.25rem}.prompt-form__content-index[_ngcontent-%COMP%]{flex-shrink:0;width:1.5rem;padding-top:.6rem;font-size:.8rem;font-weight:600;color:var(--color-text-secondary);text-align:right;-webkit-user-select:none;user-select:none}.prompt-form__param-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-end;padding:.75rem;border-radius:0;background:var(--color-bg-hover)}.prompt-form__param-fields[_ngcontent-%COMP%]{flex:1;display:flex;gap:.75rem;flex-wrap:wrap}.prompt-form__add-btn[_ngcontent-%COMP%]{align-self:flex-start;padding:.4rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-accent);font-size:.875rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.prompt-form__add-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);border-color:var(--color-accent)}.prompt-form__remove-btn[_ngcontent-%COMP%]{flex-shrink:0;width:1.75rem;height:1.75rem;display:flex;align-items:center;justify-content:center;border-radius:0;border:1px solid transparent;background:transparent;color:var(--color-neutral-500);font-size:1rem;line-height:1;cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease}.prompt-form__remove-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:color-mix(in srgb,var(--red) 10%,transparent);color:var(--red);border-color:var(--red)}.prompt-form__remove-btn[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.prompt-form__error[_ngcontent-%COMP%]{margin:0;padding:.625rem .875rem;border-radius:0;background:color-mix(in srgb,var(--red) 10%,transparent);border:1px solid var(--red);color:var(--red);font-size:.875rem;line-height:1.4}.prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--red);line-height:1.3}.prompt-form__input--invalid[_ngcontent-%COMP%], .prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--red)}.prompt-form__input--invalid[_ngcontent-%COMP%]:focus, .prompt-form__textarea--invalid[_ngcontent-%COMP%]:focus{border-color:var(--red)}.prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.prompt-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}.prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"],changeDetection:0})};function Ce(i){let t=i.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return{invalidJson:!0}}}export{te as PromptFormComponent};
1
+ import{a as ee}from"./chunk-6OUF4MB3.js";import{b as R}from"./chunk-DDBWRK3B.js";import{a as G,c as J}from"./chunk-COLWSJEP.js";import{a as P}from"./chunk-PUWEEZSA.js";import{F as Z,c as $,e as _,g as L,h as B,i as N,l as u,n as q,r as I,s as j,t as U,u as H,v as K,w as Q,x as W,y as X,z as Y}from"./chunk-ZJV25K6M.js";import{Bb as E,D as A,Db as C,Fb as s,Ka as a,Rb as O,Tb as o,Ub as v,Vb as F,Wa as D,a as V,b as T,ca as b,ga as x,ha as h,lb as c,m as k,ma as z,mb as f,nb as w,pb as M,qb as S,rb as m,sb as n,ta as y,tb as r,ub as g}from"./chunk-3DOXTB6J.js";var re=(i,t)=>t.id;function oe(i,t){i&1&&(n(0,"p",5),o(1,"Loading\u2026"),r())}function ne(i,t){i&1&&(n(0,"span",12),o(1,"Name is required."),r())}function ie(i,t){if(i&1&&(n(0,"p",31),o(1),r(),n(2,"span",26),o(3,"Agent Config cannot be changed after creation."),r()),i&2){let e=s(3);a(),v(e.resolveAgentConfigName(e.agentConfigIdControl.value))}}function ae(i,t){if(i&1&&(n(0,"option",33),o(1),r()),i&2){let e=t.$implicit;m("ngValue",e.id),a(),v(e.name)}}function le(i,t){if(i&1&&(n(0,"select",32)(1,"option",33),o(2,"\u2014 None \u2014"),r(),M(3,ae,2,2,"option",33,re),r(),n(5,"span",26),o(6,"Optional. Links this prompt to an agent as a starter. Immutable after creation."),r()),i&2){let e=s(3);m("formControl",e.agentConfigIdControl),a(),m("ngValue",null),a(2),S(e.availableAgentConfigs())}}function me(i,t){if(i&1&&(n(0,"div",8)(1,"label",30),o(2,"Agent Config"),r(),c(3,ie,4,1)(4,le,7,2),r()),i&2){let e=s(2);a(3),f(e.isEditMode()&&e.agentConfigIdControl.value?3:e.isEditMode()?-1:4)}}function pe(i,t){i&1&&(n(0,"p",19),o(1,"No parameters defined."),r())}function de(i,t){i&1&&(n(0,"span",12),o(1,"Parameter name is required."),r())}function se(i,t){if(i&1){let e=E();n(0,"div",20)(1,"div",34)(2,"div",35)(3,"label",36),o(4,"Name "),n(5,"span",10),o(6,"*"),r()(),g(7,"input",37),c(8,de,2,0,"span",12),r(),n(9,"div",35)(10,"label",36),o(11,"Description"),r(),g(12,"input",38),r(),n(13,"div",35)(14,"label",36),o(15,"Default value"),r(),g(16,"input",39),r()(),n(17,"button",40),C("click",function(){let p=x(e).$index,d=s(2);return h(d.removeParameter(p))}),o(18," \xD7 "),r()()}if(i&2){let e=t.$implicit,l=t.$index;m("formGroupName",l),a(3),m("for","param-name-"+l),a(4),O("prompt-form__input--invalid",e.controls.name.invalid&&e.controls.name.touched),m("id","param-name-"+l),a(),f(e.controls.name.invalid&&e.controls.name.touched?8:-1),a(2),m("for","param-desc-"+l),a(2),m("id","param-desc-"+l),a(2),m("for","param-default-"+l),a(2),m("id","param-default-"+l)}}function ce(i,t){i&1&&(n(0,"span",12),o(1,"Content entry must not be blank."),r())}function fe(i,t){if(i&1){let e=E();n(0,"div",22)(1,"span",41),o(2),r(),n(3,"div",42),g(4,"textarea",43),c(5,ce,2,0,"span",12),r(),n(6,"button",44),C("click",function(){let p=x(e).$index,d=s(2);return h(d.removeContentEntry(p))}),o(7," \xD7 "),r()()}if(i&2){let e=t.$implicit,l=t.$index,p=s(2);a(2),v(l+1),a(2),O("prompt-form__textarea--invalid",e.invalid&&e.touched),m("formControlName",l),a(),f(e.invalid&&e.touched?5:-1),a(),m("disabled",p.contentArray.length===1)}}function _e(i,t){if(i&1&&(n(0,"p",23),o(1),r()),i&2){let e=s(2);a(),v(e.errorMessage())}}function ue(i,t){i&1&&(n(0,"span",12),o(1,"Invalid JSON."),r())}function ge(i,t){if(i&1){let e=E();n(0,"form",7),C("ngSubmit",function(){x(e);let p=s();return h(p.submit())}),n(1,"div",8)(2,"label",9),o(3,"Name "),n(4,"span",10),o(5,"*"),r()(),g(6,"input",11),c(7,ne,2,0,"span",12),r(),n(8,"div",8)(9,"label",13),o(10,"Description"),r(),g(11,"input",14),r(),c(12,me,5,1,"div",8),n(13,"fieldset",15)(14,"legend",16),o(15," Parameters "),n(16,"span",17),o(17,"Named placeholders used in content"),r()(),n(18,"p",18),o(19," Each parameter must have a name and a default value. Use "),n(20,"code"),o(21),r(),o(22," in content entries to reference them. "),r(),c(23,pe,2,0,"p",19),M(24,se,19,10,"div",20,w),n(26,"button",21),C("click",function(){x(e);let p=s();return h(p.addParameter())}),o(27,"+ Add parameter"),r()(),n(28,"fieldset",15)(29,"legend",16),o(30," Content "),n(31,"span",10),o(32,"*"),r(),n(33,"span",17),o(34,"Ordered list of text commands"),r()(),n(35,"p",18),o(36," Each content entry is a command. Use "),n(37,"code"),o(38,"@AgentName"),r(),o(39," to target an agent, "),n(40,"code"),o(41,"/promptName param1 param2"),r(),o(42," to call another prompt, and "),n(43,"code"),o(44),r(),o(45," for parameter placeholders. "),r(),M(46,fe,8,6,"div",22,w),n(48,"button",21),C("click",function(){x(e);let p=s();return h(p.addContentEntry())}),o(49,"+ Add content entry"),r()(),c(50,_e,2,1,"p",23),n(51,"div",8)(52,"label",24),o(53,"External Metadata"),r(),g(54,"textarea",25),c(55,ue,2,0,"span",12),n(56,"span",26),o(57,"Optional. Opaque JSON object stored as-is. Leave empty to clear."),r()(),n(58,"div",27)(59,"button",28),o(60),r(),n(61,"button",29),C("click",function(){x(e);let p=s();return h(p.cancel())}),o(62,"Cancel"),r()()()}if(i&2){let e=s();m("formGroup",e.form),a(6),O("prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),m("formControl",e.nameControl),a(),f(e.nameControl.invalid&&e.nameControl.touched?7:-1),a(4),m("formControl",e.descriptionControl),a(),f(e.availableAgentConfigs().length>0?12:-1),a(),m("formArrayName","parameters"),a(8),v(e.paramPlaceholderSyntax),a(2),f(e.parametersArray.length===0?23:-1),a(),S(e.parametersArray.controls),a(4),m("formArrayName","content"),a(16),v(e.paramPlaceholderSyntax),a(2),S(e.contentArray.controls),a(4),f(e.errorMessage()?50:-1),a(4),m("formControl",e.externalMetadataJsonControl),a(),f(e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?55:-1),a(4),m("disabled",e.form.invalid||e.isSubmitting()),a(),F(" ",e.isEditMode()?"Save changes":"Create"," ")}}var te=class i{route=b(G);router=b(J);destroyRef=b(z);promptState=b(ee);agentConfigController=b(R);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new N({name:new u("",{nonNullable:!0,validators:[_.required,_.minLength(1)]}),description:new u(null),agentConfigId:new u(null),externalMetadataJson:new u("",{nonNullable:!0,validators:[Ce]}),content:new I([this.createContentControl()],{validators:[_.required]}),parameters:new I([])});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}get contentArray(){return this.form.controls.content}get parametersArray(){return this.form.controls.parameters}isEditMode=y(!1);isSubmitting=y(!1);isLoading=y(!1);errorMessage=y(null);paramPlaceholderSyntax="{{paramName}}";agentConfigs=y([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("promptId");t&&(this.isEditMode.set(!0),this.loadPrompt(t)),this.isPlatformMode?this.loadPlatformAgentConfigs():this.namespaceId&&this.loadAgentConfigs(this.namespaceId)}loadPrompt(t){this.isLoading.set(!0),this.promptState.getById(t).pipe(P(this.destroyRef)).subscribe({next:e=>{this.existingPrompt=e,this.hydrateForm(e),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),this.navigateBack()}})}loadAgentConfigs(t){this.agentConfigController.listByParentAgentConfig(t).pipe(P(this.destroyRef),A(()=>k([]))).subscribe(e=>this.agentConfigs.set(e))}loadPlatformAgentConfigs(){this.agentConfigController.listPlatformAgentsAgentConfig().pipe(P(this.destroyRef),A(()=>k([]))).subscribe(t=>this.agentConfigs.set(t))}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId??null),this.contentArray.clear(),(t.content.length>0?t.content:[""]).forEach(l=>this.contentArray.push(this.createContentControl(l))),this.parametersArray.clear(),(t.parameters??[]).forEach(l=>this.parametersArray.push(this.createParameterGroup(l))),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"")}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}createContentControl(t=""){return new u(t,{nonNullable:!0,validators:[_.required,_.pattern(/\S/)]})}addContentEntry(){this.contentArray.push(this.createContentControl())}removeContentEntry(t){this.contentArray.length>1&&this.contentArray.removeAt(t)}createParameterGroup(t){return new N({name:new u(t?.name??"",{nonNullable:!0,validators:[_.required,_.minLength(1)]}),description:new u(t?.description??null),defaultValue:new u(t?.defaultValue??"",{nonNullable:!0,validators:[_.required]})})}addParameter(){this.parametersArray.push(this.createParameterGroup())}removeParameter(t){this.parametersArray.removeAt(t)}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(!0);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=T(V({},this.existingPrompt??{}),{namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,content:this.contentArray.controls.map(d=>d.value.trim()),parameters:this.parametersArray.controls.map(d=>({name:d.controls.name.value.trim(),description:d.controls.description.value?.trim()||void 0,defaultValue:d.controls.defaultValue.value.trim()}))});t||(e.agentConfigId=this.agentConfigIdControl.value||null);let l=this.externalMetadataJsonControl.value.trim();e.externalMetadata=l?JSON.parse(l):null;let p=t?this.promptState.update(this.existingPrompt.id,e):this.promptState.create(e);this.errorMessage.set(null),p.pipe(P(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:d=>{this.isSubmitting.set(!1),d.status===409?this.errorMessage.set(`A prompt named "${e.name}" already exists in this scope.`):d.status===400?this.errorMessage.set(d.error?.message??"Invalid prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.")}})}cancel(){this.navigateBack()}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","prompts"]):this.router.navigate(["/agentos",this.namespaceId,"prompts"])}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=D({type:i,selectors:[["agentos-prompt-form"]],decls:10,vars:3,consts:[[1,"prompt-form"],[1,"prompt-form__header"],["type","button","title","Back to prompts",1,"prompt-form__back",3,"click"],[1,"prompt-form__back-icon"],[1,"prompt-form__title"],[1,"prompt-form__loading"],[1,"prompt-form__form",3,"formGroup"],[1,"prompt-form__form",3,"ngSubmit","formGroup"],[1,"prompt-form__field"],["for","prompt-name",1,"prompt-form__label"],["aria-hidden","true"],["id","prompt-name","type","text","placeholder","e.g. Summarise meeting notes","autocomplete","off",1,"prompt-form__input",3,"formControl"],[1,"prompt-form__field-error"],["for","prompt-description",1,"prompt-form__label"],["id","prompt-description","type","text","placeholder","Optional \u2014 short description of this prompt","autocomplete","off",1,"prompt-form__input",3,"formControl"],[1,"prompt-form__section",3,"formArrayName"],[1,"prompt-form__label"],[1,"prompt-form__label-hint"],[1,"prompt-form__section-hint"],[1,"prompt-form__empty-hint"],[1,"prompt-form__param-row",3,"formGroupName"],["type","button",1,"prompt-form__add-btn",3,"click"],[1,"prompt-form__content-row"],[1,"prompt-form__error"],["for","prompt-external-metadata",1,"prompt-form__label"],["id","prompt-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",1,"prompt-form__textarea","prompt-form__textarea--code",3,"formControl"],[1,"prompt-form__field-hint"],[1,"prompt-form__actions"],["type","submit",1,"prompt-form__btn","prompt-form__btn--primary",3,"disabled"],["type","button",1,"prompt-form__btn",3,"click"],["for","prompt-agent-config",1,"prompt-form__label"],[1,"prompt-form__readonly-value"],["id","prompt-agent-config",1,"prompt-form__select",3,"formControl"],[3,"ngValue"],[1,"prompt-form__param-fields"],[1,"prompt-form__field","prompt-form__field--inline"],[1,"prompt-form__label",3,"for"],["type","text","placeholder","e.g. language","formControlName","name","autocomplete","off",1,"prompt-form__input",3,"id"],["type","text","placeholder","Optional","formControlName","description","autocomplete","off",1,"prompt-form__input",3,"id"],["type","text","placeholder","e.g. English","formControlName","defaultValue","autocomplete","off",1,"prompt-form__input",3,"id"],["type","button","title","Remove this parameter",1,"prompt-form__remove-btn",3,"click"],[1,"prompt-form__content-index"],[1,"prompt-form__content-field"],["rows","4","placeholder","Enter a command\u2026",1,"prompt-form__textarea",3,"formControlName"],["type","button","title","Remove this entry",1,"prompt-form__remove-btn",3,"click","disabled"]],template:function(e,l){e&1&&(n(0,"div",0)(1,"header",1)(2,"button",2),C("click",function(){return l.cancel()}),n(3,"span",3),o(4,"\u2190"),r(),o(5),r(),n(6,"h1",4),o(7),r()(),c(8,oe,2,0,"p",5)(9,ge,63,17,"form",6),r()),e&2&&(a(5),F(" ",l.isPlatformMode?"Platform prompts":"Prompts"," "),a(2),v(l.isEditMode()?"Edit prompt":"New prompt"),a(),f(l.isLoading()?8:9))},dependencies:[Z,q,X,Y,$,W,L,B,j,Q,K,U,H],styles:[".prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.prompt-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.prompt-form__field--inline[_ngcontent-%COMP%]{flex:1}.prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.prompt-form__label-hint[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary);margin-left:.375rem}.prompt-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;cursor:pointer;appearance:auto;transition:border-color .15s ease}.prompt-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.prompt-form__field-hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.prompt-form__readonly-value[_ngcontent-%COMP%]{margin:0;padding:.5rem .875rem;border-radius:0;background:var(--color-bg-hover);border:1px solid var(--color-divider);color:var(--color-text);font-size:.9375rem}.prompt-form__input[_ngcontent-%COMP%], .prompt-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.prompt-form__input[_ngcontent-%COMP%]:focus, .prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.prompt-form__input[_ngcontent-%COMP%]::placeholder, .prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.prompt-form__textarea--code[_ngcontent-%COMP%]{font-family:monospace;font-size:.85rem;resize:vertical}.prompt-form__section[_ngcontent-%COMP%]{border:1px solid var(--color-divider);border-radius:0;padding:1rem;margin:0;display:flex;flex-direction:column;gap:.75rem}.prompt-form__section-hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.prompt-form__empty-hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.prompt-form__content-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-start}.prompt-form__content-field[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.25rem}.prompt-form__content-index[_ngcontent-%COMP%]{flex-shrink:0;width:1.5rem;padding-top:.6rem;font-size:.8rem;font-weight:600;color:var(--color-text-secondary);text-align:right;-webkit-user-select:none;user-select:none}.prompt-form__param-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-end;padding:.75rem;border-radius:0;background:var(--color-bg-hover)}.prompt-form__param-fields[_ngcontent-%COMP%]{flex:1;display:flex;gap:.75rem;flex-wrap:wrap}.prompt-form__add-btn[_ngcontent-%COMP%]{align-self:flex-start;padding:.4rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-accent);font-size:.875rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.prompt-form__add-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);border-color:var(--color-accent)}.prompt-form__remove-btn[_ngcontent-%COMP%]{flex-shrink:0;width:1.75rem;height:1.75rem;display:flex;align-items:center;justify-content:center;border-radius:0;border:1px solid transparent;background:transparent;color:var(--color-neutral-500);font-size:1rem;line-height:1;cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease}.prompt-form__remove-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:color-mix(in srgb,var(--red) 10%,transparent);color:var(--red);border-color:var(--red)}.prompt-form__remove-btn[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.prompt-form__error[_ngcontent-%COMP%]{margin:0;padding:.625rem .875rem;border-radius:0;background:color-mix(in srgb,var(--red) 10%,transparent);border:1px solid var(--red);color:var(--red);font-size:.875rem;line-height:1.4}.prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--red);line-height:1.3}.prompt-form__input--invalid[_ngcontent-%COMP%], .prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--red)}.prompt-form__input--invalid[_ngcontent-%COMP%]:focus, .prompt-form__textarea--invalid[_ngcontent-%COMP%]:focus{border-color:var(--red)}.prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.prompt-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}.prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"],changeDetection:0})};function Ce(i){let t=i.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return{invalidJson:!0}}}export{te as PromptFormComponent};
@@ -0,0 +1 @@
1
+ import{a as E}from"./chunk-A2IQII4O.js";import{c as $}from"./chunk-HW7FY6FY.js";import"./chunk-JIYGZGAO.js";import"./chunk-FIDJLAO5.js";import"./chunk-DDBWRK3B.js";import{c as B}from"./chunk-COLWSJEP.js";import{z as q}from"./chunk-2X6HKQMK.js";import"./chunk-EGMTTOHU.js";import"./chunk-TQXOFKZO.js";import{a as g}from"./chunk-PUWEEZSA.js";import"./chunk-WXFL4OGQ.js";import"./chunk-ZJV25K6M.js";import"./chunk-GO5IXCK2.js";import{Bb as b,Db as a,Fb as m,Lc as I,Pb as w,S as _,Tb as D,Wa as S,ab as C,ca as s,cc as R,fc as P,ga as l,gc as x,ha as u,i as f,jc as T,lb as v,ma as y,mb as A,rb as d,sb as r,t as h,tb as c}from"./chunk-3DOXTB6J.js";var M=()=>[];function V(i,t){if(i&1){let e=b();r(0,"agentos-auth-setting-item",4),a("editRequested",function(n){l(e);let p=m(2);return u(p.onEdit(n))})("deleteRequested",function(n){l(e);let p=m(2);return u(p.onDelete(n))}),c()}i&2&&d("config",t)("showBadge",!1)}function F(i,t){if(i&1&&v(0,V,1,2,"agentos-auth-setting-item",3),i&2){let e,o=t.$implicit,n=m();A((e=n.resolveSetting(o.id))?0:-1,e)}}var k=class i{router=s(B);destroyRef=s(y);state=s($);refresh$=new f(void 0);settings$=this.refresh$.pipe(_(()=>this.state.loadPlatformSettings()));settingItems$=this.settings$.pipe(h(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.authType}))));settingsById=new Map;constructor(){this.settings$.pipe(g(this.destroyRef)).subscribe(t=>{this.settingsById=new Map(t.map(e=>[e.id??"",e]))})}goBack(){this.router.navigate(["/agentos","admin"])}openCreateForm(){this.router.navigate(["/agentos","admin","auth-settings","new"])}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","auth-settings",t.id,"edit"])}onDelete(t){t.id&&this.state.delete(t.id,"platform").pipe(g(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolveSetting(t){return this.settingsById.get(t)??null}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=S({type:i,selectors:[["agentos-platform-auth-settings"]],decls:6,vars:6,consts:[["authSettingItemTpl",""],["title","Platform Auth Settings","emptyMessage","No platform auth settings defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","type","button",1,"platform-auth-settings__back",3,"click"],["scope","namespace",3,"config","showBadge"],["scope","namespace",3,"editRequested","deleteRequested","config","showBadge"]],template:function(e,o){if(e&1&&(r(0,"ds-entity-list",1),P(1,"async"),a("createRequested",function(){return o.openCreateForm()}),r(2,"button",2),a("click",function(){return o.goBack()}),D(3,"\u2190 Admin"),c()(),C(4,F,1,1,"ng-template",null,0,T)),e&2){let n=w(5);d("items",x(1,3,o.settingItems$)??R(5,M))("showCreate",!0)("itemTemplate",n)}},dependencies:[q,E,I],encapsulation:2,changeDetection:0})};export{k as PlatformAuthSettingsComponent};
@@ -1 +1 @@
1
- import{a as G}from"./chunk-AIC4U2MU.js";import{a as K}from"./chunk-2RRKNP4O.js";import{a as B}from"./chunk-OGFIIHAP.js";import{a as V}from"./chunk-EUKRA2OA.js";import"./chunk-JIYGZGAO.js";import"./chunk-NQVAKMAF.js";import"./chunk-VH7ZEMCE.js";import{a as N,c as D}from"./chunk-COLWSJEP.js";import{s as $,z as L}from"./chunk-2X6HKQMK.js";import"./chunk-EGMTTOHU.js";import"./chunk-TQXOFKZO.js";import{a as d}from"./chunk-PUWEEZSA.js";import"./chunk-WXFL4OGQ.js";import"./chunk-ZJV25K6M.js";import"./chunk-GO5IXCK2.js";import{Bb as b,Db as u,Fb as s,Ka as A,Lc as q,Pb as S,S as g,Tb as x,Ub as E,Wa as I,ab as P,ca as n,cc as w,fc as O,ga as l,gc as M,ha as c,jc as T,lb as C,m as f,ma as y,mb as R,rb as v,sb as p,t as _,ta as h,tb as m}from"./chunk-3DOXTB6J.js";var z=()=>[];function W(r,e){if(r&1&&(p(0,"p",3),x(1),m()),r&2){let t=s().$implicit;A(),E(t.name)}}function U(r,e){if(r&1){let t=b();p(0,"agentos-ai-provider-item",5),u("editRequested",function(){let o=l(t),a=s(2);return c(a.onEdit(o))})("deleteRequested",function(){let o=l(t),a=s(2);return c(a.onDelete(o))})("duplicateRequested",function(){let o=l(t),a=s(2);return c(a.onDuplicate(o))}),m()}if(r&2){let t=e,i=s(2);v("config",t.config)("scope",t.scope)("readOnly",t.scope==="platform"||t.scope==="namespace"&&!i.isAdmin())}}function X(r,e){if(r&1&&C(0,W,2,1,"p",3)(1,U,1,3,"agentos-ai-provider-item",4),r&2){let t,i=e.$implicit,o=s();R(o.isEmptyPlaceholder(i.id)?0:(t=o.resolve(i.id))?1:-1,t)}}var k=Object.freeze({platform:"Platform (read-only)",namespace:"AI Providers du namespace",userOnNs:"Mes overrides sur ce namespace",userGlobal:"Mes overrides globaux"}),F="__empty__",j=class r{route=n(N);router=n(D);destroyRef=n(y);state=n(K);namespaceRole=n(V);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=h(!1);listItems$=this.state.vm$.pipe(_(e=>this.toListItems(e)));resolved=new Map;ngOnInit(){this.route.paramMap.pipe(d(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t)}),this.route.paramMap.pipe(_(e=>e.get("namespaceId")??""),g(e=>e?this.namespaceRole.isAdminOfNamespace$(e):f(!1)),d(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(d(this.destroyRef)).subscribe(e=>{let t=new Map;e.platform.forEach(i=>{i.id&&t.set(this.itemKey("platform",i.id),{config:i,scope:"platform"})}),e.namespace.forEach(i=>{i.id&&t.set(this.itemKey("namespace",i.id),{config:i,scope:"namespace"})}),e.userOnNs.forEach(i=>{i.id&&t.set(this.itemKey("userOnNs",i.id),{config:i,scope:"userOnNs"})}),e.userGlobal.forEach(i=>{i.id&&t.set(this.itemKey("userGlobal",i.id),{config:i,scope:"userGlobal"})}),this.resolved=t})}isEmptyPlaceholder(e){return e.startsWith(F)}resolve(e){return this.resolved.get(e)??null}itemKey(e,t){return`${e}:${t}`}goBack(){this.router.navigate(["/agentos","namespaces"])}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:G(this.isAdmin())}})}onEdit(e){let t=e.config.id;t&&this.router.navigate(["/agentos",this.namespaceId,"ai-providers",t,"edit"],{queryParams:{scope:e.scope}})}onDelete(e){let t=e.config.id;t&&this.state.delete(t,e.scope).pipe(d(this.destroyRef)).subscribe({error:i=>{console.error(`[AiProvidersAllScopes] Delete failed for ${e.scope}:${t}:`,i)}})}onDuplicate(e){if(!e.config.id)return;let t=e.scope==="namespace"&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:t,template:e.config.id,templateScope:e.scope}})}toListItems(e){let t=[];return t.push(...this.sectionItems("platform",e.platform)),t.push(...this.sectionItems("namespace",e.namespace)),t.push(...this.sectionItems("userOnNs",e.userOnNs)),t.push(...this.sectionItems("userGlobal",e.userGlobal)),t}sectionItems(e,t){return t.length===0?[{id:`${F}${e}`,name:"Aucun AI Provider",groupKey:e,groupLabel:k[e]}]:t.filter(i=>!!i.id).map(i=>({id:this.itemKey(e,i.id),name:i.name,description:i.apiType,groupKey:e,groupLabel:k[e]}))}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=I({type:r,selectors:[["agentos-ai-providers-all-scopes"]],decls:5,vars:6,consts:[["aiProviderItemTpl",""],["title","AI Providers","emptyMessage","No AI providers available.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[1,"ai-providers-all-scopes__empty"],[3,"config","scope","readOnly"],[3,"editRequested","deleteRequested","duplicateRequested","config","scope","readOnly"]],template:function(t,i){if(t&1&&(p(0,"ds-entity-list",1),O(1,"async"),u("createRequested",function(){return i.openCreateForm()}),p(2,"ds-icon-button",2),u("action",function(){return i.goBack()}),m()(),P(3,X,2,1,"ng-template",null,0,T)),t&2){let o=S(4);v("items",M(1,3,i.listItems$)??w(5,z))("showCreate",!0)("itemTemplate",o)}},dependencies:[L,B,$,q],styles:[".ai-providers-all-scopes__empty[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);padding:.5rem .25rem;margin:0;font-style:italic}"],changeDetection:0})};export{j as AiProvidersAllScopesComponent};
1
+ import{a as G}from"./chunk-AIC4U2MU.js";import{a as K}from"./chunk-7WNGYNNF.js";import{a as B}from"./chunk-OGFIIHAP.js";import{a as V}from"./chunk-QO3SLUF6.js";import"./chunk-JIYGZGAO.js";import"./chunk-FIDJLAO5.js";import"./chunk-DDBWRK3B.js";import{a as N,c as D}from"./chunk-COLWSJEP.js";import{s as $,z as L}from"./chunk-2X6HKQMK.js";import"./chunk-EGMTTOHU.js";import"./chunk-TQXOFKZO.js";import{a as d}from"./chunk-PUWEEZSA.js";import"./chunk-WXFL4OGQ.js";import"./chunk-ZJV25K6M.js";import"./chunk-GO5IXCK2.js";import{Bb as b,Db as u,Fb as s,Ka as A,Lc as q,Pb as S,S as g,Tb as x,Ub as E,Wa as I,ab as P,ca as n,cc as w,fc as O,ga as l,gc as M,ha as c,jc as T,lb as C,m as f,ma as y,mb as R,rb as v,sb as p,t as _,ta as h,tb as m}from"./chunk-3DOXTB6J.js";var z=()=>[];function W(r,e){if(r&1&&(p(0,"p",3),x(1),m()),r&2){let t=s().$implicit;A(),E(t.name)}}function U(r,e){if(r&1){let t=b();p(0,"agentos-ai-provider-item",5),u("editRequested",function(){let o=l(t),a=s(2);return c(a.onEdit(o))})("deleteRequested",function(){let o=l(t),a=s(2);return c(a.onDelete(o))})("duplicateRequested",function(){let o=l(t),a=s(2);return c(a.onDuplicate(o))}),m()}if(r&2){let t=e,i=s(2);v("config",t.config)("scope",t.scope)("readOnly",t.scope==="platform"||t.scope==="namespace"&&!i.isAdmin())}}function X(r,e){if(r&1&&C(0,W,2,1,"p",3)(1,U,1,3,"agentos-ai-provider-item",4),r&2){let t,i=e.$implicit,o=s();R(o.isEmptyPlaceholder(i.id)?0:(t=o.resolve(i.id))?1:-1,t)}}var k=Object.freeze({platform:"Platform (read-only)",namespace:"AI Providers du namespace",userOnNs:"Mes overrides sur ce namespace",userGlobal:"Mes overrides globaux"}),F="__empty__",j=class r{route=n(N);router=n(D);destroyRef=n(y);state=n(K);namespaceRole=n(V);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=h(!1);listItems$=this.state.vm$.pipe(_(e=>this.toListItems(e)));resolved=new Map;ngOnInit(){this.route.paramMap.pipe(d(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t)}),this.route.paramMap.pipe(_(e=>e.get("namespaceId")??""),g(e=>e?this.namespaceRole.isAdminOfNamespace$(e):f(!1)),d(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(d(this.destroyRef)).subscribe(e=>{let t=new Map;e.platform.forEach(i=>{i.id&&t.set(this.itemKey("platform",i.id),{config:i,scope:"platform"})}),e.namespace.forEach(i=>{i.id&&t.set(this.itemKey("namespace",i.id),{config:i,scope:"namespace"})}),e.userOnNs.forEach(i=>{i.id&&t.set(this.itemKey("userOnNs",i.id),{config:i,scope:"userOnNs"})}),e.userGlobal.forEach(i=>{i.id&&t.set(this.itemKey("userGlobal",i.id),{config:i,scope:"userGlobal"})}),this.resolved=t})}isEmptyPlaceholder(e){return e.startsWith(F)}resolve(e){return this.resolved.get(e)??null}itemKey(e,t){return`${e}:${t}`}goBack(){this.router.navigate(["/agentos","namespaces"])}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:G(this.isAdmin())}})}onEdit(e){let t=e.config.id;t&&this.router.navigate(["/agentos",this.namespaceId,"ai-providers",t,"edit"],{queryParams:{scope:e.scope}})}onDelete(e){let t=e.config.id;t&&this.state.delete(t,e.scope).pipe(d(this.destroyRef)).subscribe({error:i=>{console.error(`[AiProvidersAllScopes] Delete failed for ${e.scope}:${t}:`,i)}})}onDuplicate(e){if(!e.config.id)return;let t=e.scope==="namespace"&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:t,template:e.config.id,templateScope:e.scope}})}toListItems(e){let t=[];return t.push(...this.sectionItems("platform",e.platform)),t.push(...this.sectionItems("namespace",e.namespace)),t.push(...this.sectionItems("userOnNs",e.userOnNs)),t.push(...this.sectionItems("userGlobal",e.userGlobal)),t}sectionItems(e,t){return t.length===0?[{id:`${F}${e}`,name:"Aucun AI Provider",groupKey:e,groupLabel:k[e]}]:t.filter(i=>!!i.id).map(i=>({id:this.itemKey(e,i.id),name:i.name,description:i.apiType,groupKey:e,groupLabel:k[e]}))}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=I({type:r,selectors:[["agentos-ai-providers-all-scopes"]],decls:5,vars:6,consts:[["aiProviderItemTpl",""],["title","AI Providers","emptyMessage","No AI providers available.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[1,"ai-providers-all-scopes__empty"],[3,"config","scope","readOnly"],[3,"editRequested","deleteRequested","duplicateRequested","config","scope","readOnly"]],template:function(t,i){if(t&1&&(p(0,"ds-entity-list",1),O(1,"async"),u("createRequested",function(){return i.openCreateForm()}),p(2,"ds-icon-button",2),u("action",function(){return i.goBack()}),m()(),P(3,X,2,1,"ng-template",null,0,T)),t&2){let o=S(4);v("items",M(1,3,i.listItems$)??w(5,z))("showCreate",!0)("itemTemplate",o)}},dependencies:[L,B,$,q],styles:[".ai-providers-all-scopes__empty[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);padding:.5rem .25rem;margin:0;font-style:italic}"],changeDetection:0})};export{j as AiProvidersAllScopesComponent};
@@ -1 +1 @@
1
- import{a as h}from"./chunk-NQVAKMAF.js";import{j as b}from"./chunk-VH7ZEMCE.js";import{b as u}from"./chunk-PUWEEZSA.js";import{D as p,P as f,S as m,Z as l,ca as a,m as r,t as c}from"./chunk-3DOXTB6J.js";var v=class i{userState=a(h);permissions=a(b);currentUser$=u(this.userState.currentUser);cache=new Map;isAdminOfNamespace$(e){if(!e)return r(!1);let t=this.cache.get(e);if(t)return t;let o=this.currentUser$.pipe(m(s=>s?s.isAdmin?r(!0):this.permissions.listNamespaceUsers(e).pipe(c(d=>d.some(n=>n.id===s.id&&n.role==="ADMIN")),p(()=>r(!1))):r(!1)),f({bufferSize:1,refCount:!1}));return this.cache.set(e,o),o}static \u0275fac=function(t){return new(t||i)};static \u0275prov=l({token:i,factory:i.\u0275fac,providedIn:"root"})};export{v as a};
1
+ import{a as h}from"./chunk-FIDJLAO5.js";import{k as b}from"./chunk-DDBWRK3B.js";import{b as u}from"./chunk-PUWEEZSA.js";import{D as p,P as f,S as m,Z as l,ca as a,m as r,t as c}from"./chunk-3DOXTB6J.js";var v=class i{userState=a(h);permissions=a(b);currentUser$=u(this.userState.currentUser);cache=new Map;isAdminOfNamespace$(e){if(!e)return r(!1);let t=this.cache.get(e);if(t)return t;let o=this.currentUser$.pipe(m(s=>s?s.isAdmin?r(!0):this.permissions.listNamespaceUsers(e).pipe(c(d=>d.some(n=>n.id===s.id&&n.role==="ADMIN")),p(()=>r(!1))):r(!1)),f({bufferSize:1,refCount:!1}));return this.cache.set(e,o),o}static \u0275fac=function(t){return new(t||i)};static \u0275prov=l({token:i,factory:i.\u0275fac,providedIn:"root"})};export{v as a};
@@ -0,0 +1 @@
1
+ import{a as Ne}from"./chunk-GVUZDCHM.js";import{a as ze}from"./chunk-GGJJHI5J.js";import{a as ke}from"./chunk-3WHV3A3F.js";import{a as Te,b as He,c as Ue}from"./chunk-AK3ITDZL.js";import{a as we,b as Fe,c as Ee}from"./chunk-B235KWLK.js";import{a as Oe}from"./chunk-C7HN2AHW.js";import{a as Me}from"./chunk-T5DS7HZO.js";import{a as Q}from"./chunk-6TRRS6GZ.js";import{a as ee,b as te,c as ne,d as oe,e as ae,f as re,g as ie,h as me,i as pe,j as de,k as ce,l as le,m as ge,n as he,o as ue,p as fe,q as Ce,r as be,s as ve,t as _e,u as xe}from"./chunk-OESN2OVC.js";import{a as se}from"./chunk-TBHL5APT.js";import{a as X,b as Z,c as $}from"./chunk-R727IQCN.js";import"./chunk-6OUF4MB3.js";import{a as Ae}from"./chunk-3L5HH2LW.js";import"./chunk-VDPBH6I4.js";import{a as H}from"./chunk-FIDJLAO5.js";import{a as Y,b as q,c as J,d as K}from"./chunk-UNIVHWT7.js";import{a as Se,b as Ie}from"./chunk-OLEK57CJ.js";import{a as Pe,b as ye}from"./chunk-DLB34U6L.js";import{l as F}from"./chunk-DDBWRK3B.js";import"./chunk-3A3LFDQO.js";import{c as w}from"./chunk-COLWSJEP.js";import{s as T}from"./chunk-2X6HKQMK.js";import"./chunk-EGMTTOHU.js";import"./chunk-TQXOFKZO.js";import{a as E}from"./chunk-PUWEEZSA.js";import"./chunk-WXFL4OGQ.js";import"./chunk-ZJV25K6M.js";import"./chunk-GO5IXCK2.js";import{Bb as M,Db as c,Fb as C,Ka as p,Rb as k,Tb as r,Ub as x,Wa as h,ca as g,ga as A,ha as P,lb as s,ma as y,mb as l,mc as O,rb as v,sb as n,ta as b,tb as o,ub as f,vb as S,wb as I,xb as _}from"./chunk-3DOXTB6J.js";var t=()=>!0;var Re=[{path:"",loadComponent:()=>import("./chunk-WMFFMGRT.js").then(e=>e.AgentosShellComponent),children:[{path:"home",canActivate:[t],loadComponent:()=>import("./chunk-B4YVERDA.js").then(e=>e.CaseShellComponent)},{path:"",loadComponent:()=>import("./chunk-3SWGL6G7.js").then(e=>e.LayoutComponent),children:[{path:"namespaces/new",canActivate:[t],loadComponent:()=>import("./chunk-CMDN4G5T.js").then(e=>e.NamespaceFormComponent)},{path:"namespaces/:namespaceId/edit",canActivate:[t],loadComponent:()=>import("./chunk-CMDN4G5T.js").then(e=>e.NamespaceFormComponent)},{path:"namespaces",canActivate:[t],loadComponent:()=>import("./chunk-MGHX6XY3.js").then(e=>e.NamespaceListComponent)},{path:"admin",canActivate:[t],loadComponent:()=>import("./chunk-JD6LMKJY.js").then(e=>e.AdminHomeComponent)},{path:"admin/users/new",canActivate:[t],loadComponent:()=>import("./chunk-4QUKFJVG.js").then(e=>e.UserFormComponent)},{path:"admin/users/:userId/edit",canActivate:[t],loadComponent:()=>import("./chunk-4QUKFJVG.js").then(e=>e.UserFormComponent)},{path:"admin/users",canActivate:[t],loadComponent:()=>import("./chunk-D4DYD37W.js").then(e=>e.AdminUsersGroupsComponent)},{path:"admin/integration-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-U26U4YUX.js").then(e=>e.IntegrationFormComponent)},{path:"admin/integration-configs/:integrationId/edit",canActivate:[t],loadComponent:()=>import("./chunk-U26U4YUX.js").then(e=>e.IntegrationFormComponent)},{path:"admin/integration-configs",canActivate:[t],loadComponent:()=>import("./chunk-YONCBD5A.js").then(e=>e.PlatformIntegrationConfigsComponent)},{path:"admin/scheduled-prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-IUKPWUMW.js").then(e=>e.ScheduledPromptFormComponent)},{path:"admin/scheduled-prompts/:scheduledPromptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-IUKPWUMW.js").then(e=>e.ScheduledPromptFormComponent)},{path:"admin/scheduled-prompts",canActivate:[t],loadComponent:()=>import("./chunk-JWECOKZF.js").then(e=>e.PlatformScheduledPromptsComponent)},{path:"admin/prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-PBZL7DN5.js").then(e=>e.PromptFormComponent)},{path:"admin/prompts/:promptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-PBZL7DN5.js").then(e=>e.PromptFormComponent)},{path:"admin/prompts",canActivate:[t],loadComponent:()=>import("./chunk-5F4OBAQR.js").then(e=>e.PlatformPromptsComponent)},{path:"admin/ai-providers/new",canActivate:[t],loadComponent:()=>import("./chunk-XZDUSWYE.js").then(e=>e.AiProviderFormComponent)},{path:"admin/ai-providers/:aiProviderId/edit",canActivate:[t],loadComponent:()=>import("./chunk-XZDUSWYE.js").then(e=>e.AiProviderFormComponent)},{path:"admin/ai-providers",canActivate:[t],loadComponent:()=>import("./chunk-3XEA5TTG.js").then(e=>e.PlatformAiProvidersComponent)},{path:"admin/auth-settings/new",canActivate:[t],loadComponent:()=>import("./chunk-UWESGTIU.js").then(e=>e.AuthSettingFormComponent)},{path:"admin/auth-settings/:authSettingId/edit",canActivate:[t],loadComponent:()=>import("./chunk-UWESGTIU.js").then(e=>e.AuthSettingFormComponent)},{path:"admin/auth-settings",canActivate:[t],loadComponent:()=>import("./chunk-PL3BJFLT.js").then(e=>e.PlatformAuthSettingsComponent)},{path:"admin/ai-models/new",canActivate:[t],loadComponent:()=>import("./chunk-6V5ZHXTF.js").then(e=>e.AiModelFormComponent)},{path:"admin/ai-models/:modelId/edit",canActivate:[t],loadComponent:()=>import("./chunk-6V5ZHXTF.js").then(e=>e.AiModelFormComponent)},{path:"admin/ai-models",canActivate:[t],loadComponent:()=>import("./chunk-ZO272F3U.js").then(e=>e.PlatformAiModelsComponent)},{path:"admin/agent-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-M4ES4I34.js").then(e=>e.AgentConfigFormComponent)},{path:"admin/agent-configs/:agentConfigId/edit",canActivate:[t],loadComponent:()=>import("./chunk-M4ES4I34.js").then(e=>e.AgentConfigFormComponent)},{path:"admin/agent-configs/:agentConfigId/inspect",canActivate:[t],loadComponent:()=>import("./chunk-BSULGZWF.js").then(e=>e.AgentConfigInspectComponent)},{path:"admin/agent-configs",canActivate:[t],loadComponent:()=>import("./chunk-BJ6IXKIG.js").then(e=>e.PlatformAgentConfigsComponent)},{path:"me",canActivate:[t],loadComponent:()=>import("./chunk-OJPNIW6G.js").then(e=>e.UserProfileComponent)},{path:"user",canActivate:[t],loadComponent:()=>import("./chunk-OJPNIW6G.js").then(e=>e.UserProfileComponent)},{path:":namespaceId/auth-settings/new",canActivate:[t],loadComponent:()=>import("./chunk-UWESGTIU.js").then(e=>e.AuthSettingFormComponent)},{path:":namespaceId/auth-settings/:authSettingId/edit",canActivate:[t],loadComponent:()=>import("./chunk-UWESGTIU.js").then(e=>e.AuthSettingFormComponent)},{path:":namespaceId/auth-settings",canActivate:[t],loadComponent:()=>import("./chunk-HQF5YXBC.js").then(e=>e.AuthSettingsAllScopesComponent)},{path:":namespaceId/integrations/new",canActivate:[t],loadComponent:()=>import("./chunk-U26U4YUX.js").then(e=>e.IntegrationFormComponent)},{path:":namespaceId/integrations/:integrationId/edit",canActivate:[t],loadComponent:()=>import("./chunk-U26U4YUX.js").then(e=>e.IntegrationFormComponent)},{path:":namespaceId/integrations",canActivate:[t],loadComponent:()=>import("./chunk-EPOMVQLK.js").then(e=>e.IntegrationsAllScopesComponent)},{path:":namespaceId/ai-providers/new",canActivate:[t],loadComponent:()=>import("./chunk-XZDUSWYE.js").then(e=>e.AiProviderFormComponent)},{path:":namespaceId/ai-providers/:aiProviderId/edit",canActivate:[t],loadComponent:()=>import("./chunk-XZDUSWYE.js").then(e=>e.AiProviderFormComponent)},{path:":namespaceId/ai-providers",canActivate:[t],loadComponent:()=>import("./chunk-QNOZT6US.js").then(e=>e.AiProvidersAllScopesComponent)},{path:":namespaceId/ai-models/new",canActivate:[t],loadComponent:()=>import("./chunk-6V5ZHXTF.js").then(e=>e.AiModelFormComponent)},{path:":namespaceId/ai-models/:modelId/edit",canActivate:[t],loadComponent:()=>import("./chunk-6V5ZHXTF.js").then(e=>e.AiModelFormComponent)},{path:":namespaceId/ai-models",canActivate:[t],loadComponent:()=>import("./chunk-62SCRDTI.js").then(e=>e.NamespaceAiModelsComponent)},{path:":namespaceId/scheduled-prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-IUKPWUMW.js").then(e=>e.ScheduledPromptFormComponent)},{path:":namespaceId/scheduled-prompts/:scheduledPromptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-IUKPWUMW.js").then(e=>e.ScheduledPromptFormComponent)},{path:":namespaceId/scheduled-prompts",canActivate:[t],loadComponent:()=>import("./chunk-DYASMOHQ.js").then(e=>e.ScheduledPromptListComponent)},{path:":namespaceId/prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-PBZL7DN5.js").then(e=>e.PromptFormComponent)},{path:":namespaceId/prompts/:promptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-PBZL7DN5.js").then(e=>e.PromptFormComponent)},{path:":namespaceId/prompts",canActivate:[t],loadComponent:()=>import("./chunk-HGDDIJKH.js").then(e=>e.NamespacePromptsComponent)},{path:":namespaceId/agent-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-M4ES4I34.js").then(e=>e.AgentConfigFormComponent)},{path:":namespaceId/agent-configs/:agentConfigId/edit",canActivate:[t],loadComponent:()=>import("./chunk-M4ES4I34.js").then(e=>e.AgentConfigFormComponent)},{path:":namespaceId/agent-configs/:agentConfigId/inspect",canActivate:[t],loadComponent:()=>import("./chunk-BSULGZWF.js").then(e=>e.AgentConfigInspectComponent)},{path:":namespaceId/agent-configs",canActivate:[t],loadComponent:()=>import("./chunk-5P3YDX4D.js").then(e=>e.NamespaceAgentConfigsComponent)},{path:":namespaceId/user-groups/new",canActivate:[t],loadComponent:()=>import("./chunk-IGXPPLQW.js").then(e=>e.UserGroupFormComponent)},{path:":namespaceId/user-groups/:userGroupId/edit",canActivate:[t],loadComponent:()=>import("./chunk-IGXPPLQW.js").then(e=>e.UserGroupFormComponent)},{path:":namespaceId/user-groups",canActivate:[t],loadComponent:()=>import("./chunk-SLVL4O7X.js").then(e=>e.NamespaceUserGroupsComponent)},{path:"",redirectTo:"namespaces",pathMatch:"full"}]}]}];function B(e,i){e&1&&_(0,"span",1)}function R(e,i){e&1&&_(0,"span",2)}function j(e,i){e&1&&_(0,"span",3)}var u=class e{pluginService=g(F);online=b(null);ngOnInit(){this.pluginService.getAllPlugins().subscribe({next:()=>this.online.set(!0),error:()=>this.online.set(!1)})}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=h({type:e,selectors:[["agentos-backend-status"]],decls:4,vars:1,consts:[[1,"backend-status"],["title","AgentOS online",1,"dot","dot--online"],["title","AgentOS offline",1,"dot","dot--offline"],["title","Checking\u2026",1,"dot","dot--checking"]],template:function(a,m){if(a&1&&(S(0,"div",0),s(1,B,1,0,"span",1)(2,R,1,0,"span",2)(3,j,1,0,"span",3),I()),a&2){let d;p(),l((d=m.online())===!0?1:d===!1?2:3)}},styles:[".backend-status[_ngcontent-%COMP%]{display:flex;align-items:center}.dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;flex-shrink:0}.dot--online[_ngcontent-%COMP%]{background:var(--color-success, #34c759)}.dot--offline[_ngcontent-%COMP%]{background:var(--color-error, #ff3b30)}.dot--checking[_ngcontent-%COMP%]{background:var(--color-text-secondary, #6e6e73);opacity:.5;animation:_ngcontent-%COMP%_pulse 1.2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:.5}50%{opacity:1}}"]})};function G(e,i){if(e&1){let a=M();n(0,"button",9),c("click",function(){A(a);let d=C();return P(d.navigateToAdmin())}),n(1,"span",10),r(2,"\u2699\uFE0F"),o()()}}function L(e,i){if(e&1&&(n(0,"span",7),r(1),o()),e&2){let a=C();p(),x(a.userInitials)}}function V(e,i){e&1&&(n(0,"span",8),r(1,"\u25EF"),o())}var z=class e{router=g(w);userState=g(H);destroyRef=g(y);currentUser=this.userState.currentUser;navigateHome(){this.router.navigate(["/agentos/home"])}isAdmin=O(()=>this.userState.currentUser()?.isAdmin===!0);navigateToAdmin(){this.router.navigate(["/agentos/admin"])}ngOnInit(){this.currentUser()||this.userState.loadMe().pipe(E(this.destroyRef)).subscribe()}get userInitials(){let i=this.currentUser();if(!i)return"";let a=i.firstname?.[0]??"",m=i.lastname?.[0]??"";return(a+m).toUpperCase()||i.email?.[0]?.toUpperCase()||"?"}get isOnProfilePage(){return this.router.url.startsWith("/agentos/me")}toggleProfile(){this.isOnProfilePage?window.history.length>1?window.history.back():this.router.navigate(["/agentos"]):this.router.navigate(["/agentos/me"])}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=h({type:e,selectors:[["agentos-header"]],decls:11,vars:5,consts:[[1,"header"],["type","button","title","Home",1,"header__brand",3,"click"],["src","CODAY-Logo.png","alt","Coday",1,"header__logo-img"],[1,"header__logo-text"],[1,"header__nav"],["type","button","title","Admin",1,"header__admin-btn"],["type","button",1,"header__user-btn",3,"click","title"],[1,"header__user-initials"],[1,"header__user-icon"],["type","button","title","Admin",1,"header__admin-btn",3,"click"],[1,"header__admin-icon"]],template:function(a,m){a&1&&(n(0,"header",0)(1,"button",1),c("click",function(){return m.navigateHome()}),f(2,"img",2),n(3,"span",3),r(4,"Coday"),o()(),n(5,"nav",4),f(6,"agentos-backend-status"),s(7,G,3,0,"button",5),n(8,"button",6),c("click",function(){return m.toggleProfile()}),s(9,L,2,1,"span",7)(10,V,2,0,"span",8),o()()()),a&2&&(p(7),l(m.isAdmin()?7:-1),p(),k("header__user-btn--active",m.isOnProfilePage),v("title",m.isOnProfilePage?"Back":"My profile"),p(),l(m.userInitials?9:10))},dependencies:[u],styles:[".header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:0 1.5rem;height:56px;background:var(--glass-bg, rgba(255, 255, 255, .72));border-bottom:1px solid var(--glass-border, rgba(255, 255, 255, .18));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));position:sticky;top:0;z-index:100}.header__brand[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;background:none;border:none;padding:0;cursor:pointer;border-radius:6px;transition:opacity .15s ease}.header__brand[_ngcontent-%COMP%]:hover{opacity:.7}.header__logo-img[_ngcontent-%COMP%]{width:32px;height:32px;object-fit:contain}.header__logo-text[_ngcontent-%COMP%]{font-size:1rem;font-weight:700;letter-spacing:-.01em;color:var(--color-text, #1d1d1f)}.header__nav[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.header__admin-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-bg-secondary, rgba(0, 0, 0, .04));cursor:pointer;transition:background .15s ease,border-color .15s ease;padding:0;font-family:inherit;font-size:1rem;line-height:1}.header__admin-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .08));border-color:var(--color-primary, #007aff)}.header__admin-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.header__user-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-bg-secondary, rgba(0, 0, 0, .04));cursor:pointer;transition:background .15s ease,border-color .15s ease;padding:0;font-family:inherit}.header__user-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .08));border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%] .header__user-initials[_ngcontent-%COMP%], .header__user-btn--active[_ngcontent-%COMP%] .header__user-icon[_ngcontent-%COMP%]{color:#fff}.header__user-initials[_ngcontent-%COMP%]{font-size:.75rem;font-weight:600;color:var(--color-text, #1d1d1f);line-height:1;letter-spacing:.02em}.header__user-icon[_ngcontent-%COMP%]{font-size:1rem;color:var(--color-text-secondary, #6e6e73);line-height:1}"]})};function W(e,i){if(e&1&&(n(0,"p",11),r(1," Last action: "),n(2,"strong"),r(3),o()()),e&2){let a=C();p(3),x(a.lastAction())}}var D=class e{lastAction=b(null);onSend(){this.lastAction.set("send")}onStop(){this.lastAction.set("stop")}onAttach(){this.lastAction.set("attach")}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=h({type:e,selectors:[["agentos-hello"]],decls:35,vars:2,consts:[[1,"hello-agentos"],[1,"card"],[1,"badge"],[1,"principles"],[1,"demo"],[1,"demo-label"],[1,"demo-buttons"],["icon","send","variant","primary","title","Send",3,"action"],["icon","stop","variant","danger","title","Stop",3,"action"],["icon","attach_file","variant","default","title","Attach",3,"action"],["icon","mic","variant","default","title","Record",3,"action","disabled"],[1,"demo-feedback"]],template:function(a,m){a&1&&(n(0,"div",0)(1,"div",1)(2,"div",2),r(3,"AgentOS UI"),o(),n(4,"h1"),r(5,"Hello AgentOS"),o(),n(6,"p"),r(7," This component lives in "),n(8,"code"),r(9,"libs/agentos-ui"),o(),r(10," \u2014 isolated from Coday internals, ready to be published as "),n(11,"code"),r(12,"@whoz-oss/agentos-ui"),o(),r(13,". "),o(),f(14,"agentos-backend-status"),n(15,"ul",3)(16,"li"),r(17,"\u2726 No imports from Coday app"),o(),n(18,"li"),r(19,"\u2726 CSS custom properties as host contract"),o(),n(20,"li"),r(21,"\u2726 Standalone Angular components"),o(),n(22,"li"),r(23,"\u2726 Signals-first reactive state"),o()(),n(24,"div",4)(25,"p",5),r(26,"ds-icon-button from "),n(27,"code"),r(28,"@whoz-oss/design-system"),o()(),n(29,"div",6)(30,"ds-icon-button",7),c("action",function(){return m.onSend()}),o(),n(31,"ds-icon-button",8),c("action",function(){return m.onStop()}),o(),n(32,"ds-icon-button",9),c("action",function(){return m.onAttach()}),o(),n(33,"ds-icon-button",10),c("action",function(){return m.onAttach()}),o()(),s(34,W,4,1,"p",11),o()()()),a&2&&(p(33),v("disabled",!0),p(),l(m.lastAction()?34:-1))},dependencies:[T,u],styles:['@charset "UTF-8";.hello-agentos[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:2rem}.card[_ngcontent-%COMP%]{background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));box-shadow:var(--glass-shadow, 0 8px 32px 0 rgba(31, 38, 135, .15));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));border-radius:20px;padding:3rem;max-width:480px;width:100%;text-align:center}.badge[_ngcontent-%COMP%]{display:inline-block;background:var(--color-primary, #007aff);color:var(--color-text-inverse, #ffffff);font-size:.75rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;padding:.25rem .75rem;border-radius:100px;margin-bottom:1.5rem}h1[_ngcontent-%COMP%]{color:var(--color-text, #1d1d1f);font-size:2rem;font-weight:700;margin:0 0 1rem;letter-spacing:-.02em}p[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);line-height:1.6;margin:0 0 1.5rem}p[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--color-code-bg, rgba(142, 142, 147, .12));color:var(--color-code-text, #ff375f);padding:.125rem .375rem;border-radius:6px;font-size:.875em;border:1px solid var(--color-border, rgba(0, 0, 0, .1))}.principles[_ngcontent-%COMP%]{list-style:none;margin:0 0 1.5rem;padding:0;text-align:left;display:flex;flex-direction:column;gap:.5rem}.principles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;padding:.5rem .75rem;background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-radius:8px;border:1px solid var(--color-border-light, rgba(40, 40, 40, .08))}.demo[_ngcontent-%COMP%]{border-top:1px solid var(--color-border-light, rgba(40, 40, 40, .08));padding-top:1.25rem}.demo[_ngcontent-%COMP%] .demo-label[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.8rem;margin:0 0 .75rem}.demo[_ngcontent-%COMP%] .demo-label[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--color-code-bg, rgba(142, 142, 147, .12));color:var(--color-code-text, #ff375f);padding:.125rem .375rem;border-radius:6px;font-size:.875em;border:1px solid var(--color-border, rgba(0, 0, 0, .1))}.demo[_ngcontent-%COMP%] .demo-buttons[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center;justify-content:center;padding:.75rem;background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-radius:12px;border:1px solid var(--color-border-light, rgba(40, 40, 40, .08))}.demo[_ngcontent-%COMP%] .demo-feedback[_ngcontent-%COMP%]{margin:.75rem 0 0;font-size:.85rem;color:var(--color-text-secondary, #6e6e73)}.demo[_ngcontent-%COMP%] .demo-feedback[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--color-primary, #007aff)}']})};export{Re as AGENTOS_ROUTES,Pe as ActionCardChipsDirective,ye as ActionCardComponent,Ue as AdminUsersGroupsComponent,Q as AgentosShellComponent,J as AgentosThemeService,Z as AgentosUserPreferencesService,u as BackendStatusComponent,Ce as CaseChatComponent,_e as CaseDrawerComponent,be as CaseHomeComponent,ve as CaseItemComponent,xe as CaseShellComponent,X as ENTER_KEY_BEHAVIORS,le as ExchangeContentViewerComponent,ue as ExchangeDrawerComponent,he as ExchangeFileListComponent,ge as ExchangeItemComponent,fe as ExchangeShellComponent,ee as ExchangeStateService,z as HeaderComponent,D as HelloAgentosComponent,Ae as LayoutComponent,te as MAX_VIEWABLE_SIZE,se as MarkdownPipe,Se as NamespaceItemComponent,Ie as NamespaceListComponent,we as NamespaceSelectComponent,ze as NamespaceUserGroupsComponent,q as THEME_MODES,K as THEME_PORT,Y as THEME_VARIANTS,$ as USER_PREFERENCES_PORT,Me as UserAdminStateService,ke as UserFormComponent,Ne as UserGroupFormComponent,Fe as UserGroupItemComponent,Ee as UserGroupListComponent,Oe as UserGroupStateService,Te as UserItemComponent,He as UserListComponent,H as UserStateService,t as agentosReadyGuard,pe as canViewFile,re as detectFormat,ce as exchangeMutationScope,ae as formatDate,oe as formatSize,ne as getFileIcon,ie as isFormatViewable,me as isViewable,de as reindentJson};
@@ -1 +1 @@
1
- import{a}from"./chunk-KY2WN2WL.js";import"./chunk-UCATWB2P.js";import"./chunk-FS4CUJQH.js";import"./chunk-VH7ZEMCE.js";import"./chunk-COLWSJEP.js";import"./chunk-2X6HKQMK.js";import"./chunk-EGMTTOHU.js";import"./chunk-TQXOFKZO.js";import"./chunk-PUWEEZSA.js";import"./chunk-WXFL4OGQ.js";import"./chunk-ZJV25K6M.js";import"./chunk-GO5IXCK2.js";import"./chunk-3DOXTB6J.js";export{a as NamespaceUserGroupsComponent};
1
+ import{a}from"./chunk-GGJJHI5J.js";import"./chunk-B235KWLK.js";import"./chunk-C7HN2AHW.js";import"./chunk-DDBWRK3B.js";import"./chunk-COLWSJEP.js";import"./chunk-2X6HKQMK.js";import"./chunk-EGMTTOHU.js";import"./chunk-TQXOFKZO.js";import"./chunk-PUWEEZSA.js";import"./chunk-WXFL4OGQ.js";import"./chunk-ZJV25K6M.js";import"./chunk-GO5IXCK2.js";import"./chunk-3DOXTB6J.js";export{a as NamespaceUserGroupsComponent};
@@ -1 +1 @@
1
- import{n as p}from"./chunk-VH7ZEMCE.js";import{V as s,Z as d,a as n,ca as u,ta as a}from"./chunk-3DOXTB6J.js";var c=class o{userController=u(p);users=a([]);isLoading=a(!1);loadAll(){return this.isLoading.set(!0),this.userController.listAllUser().pipe(s({next:e=>{this.users.set(e),this.isLoading.set(!1)},error:()=>this.isLoading.set(!1)}))}createUser(e){return this.userController.createUser(e).pipe(s(()=>{this.loadAll().subscribe()}))}updateUser(e,r){let t=this.users().find(i=>i.id===e);if(!t)throw new Error(`Cannot update: user ${e} not found in state`);let U=n(n({},t),r);return this.userController.updateUser(e,U).pipe(s(i=>{this.users.update(b=>b.map(l=>l.id===i.id?i:l))}))}deleteUser(e){return this.userController.deleteUser(e).pipe(s(()=>{this.users.update(r=>r.filter(t=>t.id!==e))}))}static \u0275fac=function(r){return new(r||o)};static \u0275prov=d({token:o,factory:o.\u0275fac,providedIn:"root"})};export{c as a};
1
+ import{o as p}from"./chunk-DDBWRK3B.js";import{V as s,Z as d,a as n,ca as u,ta as a}from"./chunk-3DOXTB6J.js";var c=class o{userController=u(p);users=a([]);isLoading=a(!1);loadAll(){return this.isLoading.set(!0),this.userController.listAllUser().pipe(s({next:e=>{this.users.set(e),this.isLoading.set(!1)},error:()=>this.isLoading.set(!1)}))}createUser(e){return this.userController.createUser(e).pipe(s(()=>{this.loadAll().subscribe()}))}updateUser(e,r){let t=this.users().find(i=>i.id===e);if(!t)throw new Error(`Cannot update: user ${e} not found in state`);let U=n(n({},t),r);return this.userController.updateUser(e,U).pipe(s(i=>{this.users.update(b=>b.map(l=>l.id===i.id?i:l))}))}deleteUser(e){return this.userController.deleteUser(e).pipe(s(()=>{this.users.update(r=>r.filter(t=>t.id!==e))}))}static \u0275fac=function(r){return new(r||o)};static \u0275prov=d({token:o,factory:o.\u0275fac,providedIn:"root"})};export{c as a};
@@ -0,0 +1 @@
1
+ import{a as te}from"./chunk-QO3SLUF6.js";import{a as ee}from"./chunk-7PHHASXE.js";import"./chunk-JIYGZGAO.js";import"./chunk-FIDJLAO5.js";import{e as B,i as G}from"./chunk-DDBWRK3B.js";import{a as D,c as L}from"./chunk-COLWSJEP.js";import{v as Z}from"./chunk-2X6HKQMK.js";import"./chunk-EGMTTOHU.js";import"./chunk-TQXOFKZO.js";import{a as u,c as O}from"./chunk-PUWEEZSA.js";import"./chunk-WXFL4OGQ.js";import{F as X,c as z,e as P,g as $,h as j,i as q,l as _,n as U,p as W,s as J,w as Y,x as H,y as K,z as Q}from"./chunk-ZJV25K6M.js";import"./chunk-GO5IXCK2.js";import{Bb as M,Db as f,Fb as p,Ka as a,Tb as l,Ub as C,Vb as N,Wa as V,ca as d,ga as h,ha as b,kb as k,lb as v,m as F,ma as T,mb as y,mc as R,ob as A,pb as x,qb as S,rb as c,sb as i,ta as g,tb as o,ua as w,ub as I}from"./chunk-3DOXTB6J.js";function ie(r,t){r&1&&(i(0,"p",5),l(1,"Loading\u2026"),o())}function re(r,t){if(r&1&&(i(0,"label",10),I(1,"input",29),i(2,"span"),l(3),o()()),r&2){let e=t.$implicit,n=p(2);a(),c("value",e.value)("formControl",n.scopeControl)("disabled",e.value==="namespace"&&!n.isAdmin()),a(2),C(e.label)}}function ae(r,t){if(r&1&&(i(0,"option",16),l(1),o()),r&2){let e=t.$implicit;c("value",e.type),a(),C(e.displayName)}}function le(r,t){if(r&1&&(i(0,"option",16),l(1),o()),r&2){let e=t.$implicit;c("value",e),a(),C(e)}}function se(r,t){if(r&1){let e=M();i(0,"div",24)(1,"ds-json-schema-form",30),f("valueChange",function(s){h(e);let m=p(2);return b(m.onParamsChange(s))}),o()()}if(r&2){let e=p(2);a(),c("schema",t)("value",e.initialParams())}}function ce(r,t){if(r&1){let e=M();i(0,"button",31),f("click",function(){h(e);let s=p(2);return b(s.exportYaml())}),l(1),o()}if(r&2){let e=p(2);c("disabled",e.isExporting()),a(),N(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ")}}function me(r,t){if(r&1){let e=M();i(0,"form",7),f("ngSubmit",function(){h(e);let s=p();return b(s.submit())}),i(1,"fieldset",8)(2,"legend",9),l(3,"Scope"),o(),x(4,re,4,4,"label",10,k().trackByScope,!0),o(),i(6,"div",11)(7,"label",12),l(8,"Type "),i(9,"span",13),l(10,"*"),o()(),i(11,"select",14)(12,"option",15),l(13,"Select type"),o(),x(14,ae,2,2,"option",16,k().trackByType,!0),o()(),i(16,"div",11)(17,"label",17),l(18,"Name "),i(19,"span",13),l(20,"*"),o()(),I(21,"input",18),o(),i(22,"div",11)(23,"label",19),l(24,"Description"),o(),I(25,"textarea",20),o(),i(26,"div",11)(27,"label",21),l(28,"Auth Setting"),o(),i(29,"select",22)(30,"option",23),l(31,"None"),o(),x(32,le,2,2,"option",16,A),o()(),v(34,se,2,2,"div",24),i(35,"div",25)(36,"button",26),l(37),o(),v(38,ce,2,2,"button",27),i(39,"button",28),f("click",function(){h(e);let s=p();return b(s.cancel())}),l(40,"Cancel"),o()()()}if(r&2){let e,n=p();c("formGroup",n.form),a(),c("disabled",n.isEditMode()),a(3),S(n.scopeOptions),a(7),c("formControl",n.typeControl),a(3),S(n.integrationTypes()),a(7),c("formControl",n.nameControl),a(4),c("formControl",n.descriptionControl),a(4),c("formControl",n.authSettingNameControl),a(),c("ngValue",null),a(2),S(n.availableAuthSettings()),a(2),y((e=n.schema())?34:-1,e),a(2),c("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),a(),N(" ",n.isEditMode()?"Save changes":"Create"," "),a(),y(n.isEditMode()?38:-1)}}var pe=new Set(["platform","namespace","userOnNs","userGlobal"]),E=Object.freeze({platform:"Configuration plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),ne=class r{route=d(D);router=d(L);destroyRef=d(T);state=d(ee);integrationTypeController=d(G);authSettingController=d(B);namespaceRole=d(te);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=O(this.isPlatformMode?F(!0):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new q({name:new _("",{nonNullable:!0,validators:[P.required,P.minLength(1)]}),description:new _(null),type:new _("",{nonNullable:!0,validators:[P.required]}),scope:new _("namespace",{nonNullable:!0})});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}isEditMode=g(!1);isSubmitting=g(!1);isLoading=g(!1);isExporting=g(!1);scopeOptions=[{value:"platform",label:E.platform},{value:"namespace",label:E.namespace},{value:"userOnNs",label:E.userOnNs},{value:"userGlobal",label:E.userGlobal}];authSettingNameControl=new _(null);availableAuthSettings=g([]);paramsValue=g(null);initialParams=g(null);integrationTypes=O(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=O(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});schema=R(()=>{let t=this.selectedType();return t?this.integrationTypes().find(n=>n.type===t)?.configSchema??null:null});existingConfig=null;constructor(){w(()=>{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(!0),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(oe=>{this.loadAuthSettingsForScope(oe)});let m=e.get("template");m&&this.hydrateFromTemplate(m)}parseScope(t){return t&&pe.has(t)?t:"namespace"}deriveScopeFromConfig(t){return!t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(!0),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(!1)},error:()=>{this.isLoading.set(!1),console.warn(`[IntegrationForm] Could not load config '${t}' \u2014 navigating back`),this.navigateBack()}})}hydrateFromTemplate(t){this.isLoading.set(!0),this.state.getById(t).pipe(u(this.destroyRef)).subscribe({next:e=>{this.applyConfigToForm(e),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})},error:e=>{console.warn(`[IntegrationForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})}})}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)}loadAuthSettingsForScope(t){let e;switch(t){case"platform":e=this.authSettingController.listAuthSetting();break;case"namespace":e=this.authSettingController.listAuthSetting(this.namespaceId);break;case"userOnNs":e=this.authSettingController.listAuthSetting(this.namespaceId,"me");break;case"userGlobal":e=this.authSettingController.listAuthSetting("none","me");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(!0);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},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(!1)})}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(!0),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(!1)},error:()=>this.isExporting.set(!1)}))}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||r)};static \u0275cmp=V({type:r,selectors:[["agentos-integration-form"]],decls:10,vars:2,consts:[[1,"integration-form"],[1,"integration-form__header"],["type","button","title","Back to integrations",1,"integration-form__back",3,"click"],[1,"integration-form__back-icon"],[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"],[3,"valueChange","schema","value"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"click","disabled"]],template:function(e,n){e&1&&(i(0,"div",0)(1,"header",1)(2,"button",2),f("click",function(){return n.cancel()}),i(3,"span",3),l(4,"\u2190"),o(),l(5," Integrations "),o(),i(6,"h1",4),l(7),o()(),v(8,ie,2,0,"p",5)(9,me,41,11,"form",6),o()),e&2&&(a(7),C(n.isEditMode()?"Edit integration":"New integration"),a(),y(n.isLoading()?8:9))},dependencies:[X,U,K,Q,z,H,W,$,j,J,Y,Z],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__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.integration-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.integration-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.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__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)}"],changeDetection:0})};export{ne as IntegrationFormComponent};
@@ -0,0 +1 @@
1
+ import{a as te,b as ie,c as ne}from"./chunk-HW7FY6FY.js";import{a as ee}from"./chunk-QO3SLUF6.js";import"./chunk-JIYGZGAO.js";import"./chunk-FIDJLAO5.js";import"./chunk-DDBWRK3B.js";import{a as q,c as B}from"./chunk-COLWSJEP.js";import{a as k,c as T}from"./chunk-PUWEEZSA.js";import{F as Z,c as L,e as x,g as K,h as G,i as $,l as c,n as H,p as j,s as Y,w as J,x as Q,y as W,z as X}from"./chunk-ZJV25K6M.js";import{Bb as N,Db as v,Fb as d,Ka as l,Sb as R,Tb as s,Ub as A,Vb as I,Wa as E,a as p,b as h,ca as C,ga as V,ha as O,kb as U,lb as m,ma as F,mb as g,mc as z,ob as D,pb as S,qb as b,rb as u,sb as r,ta as f,tb as o,ua as w,ub as _}from"./chunk-3DOXTB6J.js";function re(i,t){i&1&&(r(0,"p",5),s(1,"Loading\u2026"),o())}function ae(i,t){if(i&1&&(r(0,"label",23),_(1,"input",24),r(2,"span"),s(3),o()()),i&2){let e=t.$implicit,n=d(3);l(),u("formControl",n.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!n.isAdmin()),l(2),A(e.label)}}function le(i,t){if(i&1&&(r(0,"fieldset",8)(1,"legend",22),s(2,"Port\xE9e de la configuration"),o(),S(3,ae,4,4,"label",23,U().trackByScope,!0),o()),i&2){let e=d(2);u("disabled",e.isEditMode()),l(3),b(e.scopeOptions)}}function se(i,t){if(i&1&&(r(0,"option",13),s(1),o()),i&2){let e=t.$implicit,n=d(2);u("value",e),l(),A(n.authTypeLabel[e])}}function ce(i,t){i&1&&s(0," Leave a field unchanged to keep the stored credential. ")}function ue(i,t){i&1&&(r(0,"span",11),s(1,"*"),o())}function de(i,t){if(i&1&&_(0,"input",28),i&2){let e=d().$implicit;R("auth-setting-form__input"+(e.secret?" auth-setting-form__input--secret":"")),u("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off")}}function pe(i,t){if(i&1&&(r(0,"div",9)(1,"label",26),s(2),m(3,ue,2,0,"span",11),o(),m(4,de,1,7,"input",27),o()),i&2){let e,n=t.$implicit,a=d(3);l(),u("for","as-cred-"+n.key),l(),I(" ",n.label," "),l(),g(n.required?3:-1),l(),g((e=a.controlForField(n.key))?4:-1,e)}}function he(i,t){if(i&1&&(r(0,"fieldset",18)(1,"legend",22),s(2,"Credentials"),o(),r(3,"p",25),s(4," Values are stored encrypted and masked on read. "),m(5,ce,1,0),o(),S(6,pe,5,4,"div",9,U().trackByField,!0),o()),i&2){let e=d(2);l(5),g(e.isEditMode()?5:-1),l(),b(e.credentialFields())}}function me(i,t){if(i&1){let e=N();r(0,"form",7),v("ngSubmit",function(){V(e);let a=d();return O(a.submit())}),m(1,le,5,1,"fieldset",8),r(2,"div",9)(3,"label",10),s(4,"Auth type "),r(5,"span",11),s(6,"*"),o()(),r(7,"select",12),S(8,se,2,2,"option",13,D),o()(),r(10,"div",9)(11,"label",14),s(12,"Name "),r(13,"span",11),s(14,"*"),o()(),_(15,"input",15),o(),r(16,"div",9)(17,"label",16),s(18,"Description"),o(),_(19,"input",17),o(),m(20,he,8,1,"fieldset",18),r(21,"div",19)(22,"button",20),s(23),o(),r(24,"button",21),v("click",function(){V(e);let a=d();return O(a.cancel())}),s(25,"Cancel"),o()()()}if(i&2){let e=d();u("formGroup",e.form),l(),g(e.isPlatformMode?-1:1),l(6),u("formControl",e.authTypeControl),l(),b(e.authTypeOptions),l(7),u("formControl",e.nameControl),l(4),u("formControl",e.descriptionControl),l(),g(e.credentialFields().length>0?20:-1),l(2),u("disabled",e.form.invalid||e.isSubmitting()),l(),I(" ",e.isEditMode()?"Save changes":"Create"," ")}}var ge=new Set(["namespace","userOnNs","userGlobal"]),M=Object.freeze({platform:"Plateforme (lecture seule)",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),Ce={ApiKeyAuthSetting:[{key:"apiKey",label:"API Key",placeholder:"sk-\u2026",secret:!0,required:!1}],BasicAuthAuthSetting:[{key:"username",label:"Username",placeholder:"user@example.com",secret:!1,required:!1},{key:"password",label:"Password",placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",secret:!0,required:!1}],BearerTokenAuthSetting:[{key:"token",label:"Bearer token",placeholder:"eyJ\u2026",secret:!0,required:!1}],OAuthDiscoverableAuthSetting:[{key:"discoveryUrl",label:"Discovery URL",placeholder:"https://\u2026/.well-known/openid-configuration",secret:!1,required:!1},{key:"clientId",label:"Client ID",placeholder:"",secret:!1,required:!1},{key:"clientSecret",label:"Client secret",placeholder:"",secret:!0,required:!1},{key:"scopes",label:"Scopes",placeholder:"openid profile email",secret:!1,required:!1}],OAuthCustomAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:!1,required:!1},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:!1,required:!1},{key:"clientId",label:"Client ID",placeholder:"",secret:!1,required:!1},{key:"clientSecret",label:"Client secret",placeholder:"",secret:!0,required:!1},{key:"scopes",label:"Scopes",placeholder:"openid profile email",secret:!1,required:!1}],OAuthRegisteredAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:!1,required:!1},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:!1,required:!1},{key:"clientId",label:"Client ID",placeholder:"",secret:!1,required:!1},{key:"clientSecret",label:"Client secret",placeholder:"",secret:!0,required:!1},{key:"scopes",label:"Scopes",placeholder:"openid profile email",secret:!1,required:!1}],OAuthMcpDiscoverableAuthSetting:[{key:"resourceUrl",label:"Resource URL",placeholder:"https://\u2026/mcp",secret:!1,required:!1},{key:"clientId",label:"Client ID",placeholder:"",secret:!1,required:!1},{key:"clientSecret",label:"Client secret",placeholder:"",secret:!0,required:!1},{key:"scopes",label:"Scopes",placeholder:"openid profile email",secret:!1,required:!1}]},oe=class i{route=C(q);router=C(B);destroyRef=C(F);state=C(ne);namespaceRole=C(ee);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?f(!0):T(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:!1});authTypeOptions=te;authTypeLabel=ie;scopeOptions=[{value:"namespace",label:M.namespace},{value:"userOnNs",label:M.userOnNs},{value:"userGlobal",label:M.userGlobal}];nameControl=new c("",{nonNullable:!0,validators:[x.required,x.minLength(1)]});descriptionControl=new c(null);authTypeControl=new c("ApiKeyAuthSetting",{nonNullable:!0,validators:[x.required]});scopeControl=new c("namespace",{nonNullable:!0});form=new $({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new c("",{nonNullable:!0});usernameControl=new c("",{nonNullable:!0});passwordControl=new c("",{nonNullable:!0});tokenControl=new c("",{nonNullable:!0});discoveryUrlControl=new c("",{nonNullable:!0});authorizationUrlControl=new c("",{nonNullable:!0});tokenUrlControl=new c("",{nonNullable:!0});clientIdControl=new c("",{nonNullable:!0});clientSecretControl=new c("",{nonNullable:!0});scopesControl=new c("",{nonNullable:!0});resourceUrlControl=new c("",{nonNullable:!0});selectedAuthType=T(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=z(()=>Ce[this.selectedAuthType()]);isEditMode=f(!1);isSubmitting=f(!1);isLoading=f(!1);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||w(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs")})}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("authSettingId");if(n){this.isEditMode.set(!0),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let a=this.parseScope(e.get("scope"));this.scopeControl.setValue(a);let y=e.get("template");y&&this.hydrateFromTemplate(y)}parseScope(t){return t&&ge.has(t)?t:"namespace"}deriveScopeFromConfig(t){return!t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(!0),this.state.getById(t).pipe(k(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),console.warn(`[AuthSettingForm] Could not load auth setting '${t}' \u2014 navigating back`),this.navigateBack()}})}hydrateFromTemplate(t){this.isLoading.set(!0),this.state.getById(t).pipe(k(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.authTypeControl.setValue(e.authType),this.clearCredentialControls(),this.initialCredentials={},this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})},error:e=>{console.warn(`[AuthSettingForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})}})}applyConfigToForm(t){switch(this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.authTypeControl.setValue(t.authType),this.clearCredentialControls(),this.initialCredentials={},t.authType){case"ApiKeyAuthSetting":{let e=t.apiKey??"";this.apiKeyControl.setValue(e),this.initialCredentials.apiKey=e;break}case"BasicAuthAuthSetting":{let e=t,n=e.username??"",a=e.password??"";this.usernameControl.setValue(n),this.passwordControl.setValue(a),this.initialCredentials.username=n,this.initialCredentials.password=a;break}case"BearerTokenAuthSetting":{let e=t.token??"";this.tokenControl.setValue(e),this.initialCredentials.token=e;break}case"OAuthDiscoverableAuthSetting":{let e=t;this.discoveryUrlControl.setValue(e.discoveryUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.discoveryUrl=e.discoveryUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case"OAuthCustomAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case"OAuthRegisteredAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case"OAuthMcpDiscoverableAuthSetting":{let e=t;this.resourceUrlControl.setValue(e.resourceUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.resourceUrl=e.resourceUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}}}clearCredentialControls(){this.apiKeyControl.setValue(""),this.usernameControl.setValue(""),this.passwordControl.setValue(""),this.tokenControl.setValue(""),this.discoveryUrlControl.setValue(""),this.authorizationUrlControl.setValue(""),this.tokenUrlControl.setValue(""),this.clientIdControl.setValue(""),this.clientSecretControl.setValue(""),this.scopesControl.setValue(""),this.resourceUrlControl.setValue("")}credentialValue(t,e){if(!(this.isEditMode()&&e===this.initialCredentials[t]))return e||void 0}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(!0);let t=this.nameControl.value.trim(),e=this.descriptionControl.value?.trim()||void 0,n=this.authTypeControl.value,a=this.form.getRawValue().scope,y=this.isPlatformMode?null:this.namespaceId??null,P=this.buildTypedPayload(n,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,P,this.existingConfig):this.state.create(P,a,y)).pipe(k(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}buildTypedPayload(t,e,n){let a={name:e,description:n};switch(t){case"ApiKeyAuthSetting":return h(p({},a),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case"BasicAuthAuthSetting":return h(p({},a),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case"BearerTokenAuthSetting":return h(p({},a),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case"OAuthDiscoverableAuthSetting":return h(p({},a),{authType:"OAuthDiscoverableAuthSetting",discoveryUrl:this.credentialValue("discoveryUrl",this.discoveryUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case"OAuthCustomAuthSetting":return h(p({},a),{authType:"OAuthCustomAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case"OAuthRegisteredAuthSetting":return h(p({},a),{authType:"OAuthRegisteredAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case"OAuthMcpDiscoverableAuthSetting":return h(p({},a),{authType:"OAuthMcpDiscoverableAuthSetting",resourceUrl:this.credentialValue("resourceUrl",this.resourceUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)})}}controlForField(t){return{apiKey:this.apiKeyControl,username:this.usernameControl,password:this.passwordControl,token:this.tokenControl,discoveryUrl:this.discoveryUrlControl,authorizationUrl:this.authorizationUrlControl,tokenUrl:this.tokenUrlControl,clientId:this.clientIdControl,clientSecret:this.clientSecretControl,scopes:this.scopesControl,resourceUrl:this.resourceUrlControl}[t]}cancel(){this.navigateBack()}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","auth-settings"]):this.router.navigate(["/agentos",this.namespaceId,"auth-settings"])}trackByScope(t,e){return e.value}trackByField(t,e){return e.key}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["agentos-auth-setting-form"]],decls:10,vars:2,consts:[[1,"auth-setting-form"],[1,"auth-setting-form__header"],["type","button","title","Back to auth settings",1,"auth-setting-form__back",3,"click"],[1,"auth-setting-form__back-icon"],[1,"auth-setting-form__title"],[1,"auth-setting-form__loading"],[1,"auth-setting-form__form",3,"formGroup"],[1,"auth-setting-form__form",3,"ngSubmit","formGroup"],[1,"auth-setting-form__scope",3,"disabled"],[1,"auth-setting-form__field"],["for","as-auth-type",1,"auth-setting-form__label"],["aria-hidden","true"],["id","as-auth-type",1,"auth-setting-form__select",3,"formControl"],[3,"value"],["for","as-name",1,"auth-setting-form__label"],["id","as-name","type","text","placeholder","e.g. GitHub OAuth App","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],["for","as-description",1,"auth-setting-form__label"],["id","as-description","type","text","placeholder","Optional \u2014 short description of this auth setting","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],[1,"auth-setting-form__credentials"],[1,"auth-setting-form__actions"],["type","submit",1,"auth-setting-form__btn","auth-setting-form__btn--primary",3,"disabled"],["type","button",1,"auth-setting-form__btn",3,"click"],[1,"auth-setting-form__label"],[1,"auth-setting-form__scope-option"],["type","radio",3,"formControl","value","disabled"],[1,"auth-setting-form__credentials-hint"],[1,"auth-setting-form__label",3,"for"],[3,"id","class","type","placeholder","formControl","autocomplete"],[3,"id","type","placeholder","formControl","autocomplete"]],template:function(e,n){e&1&&(r(0,"div",0)(1,"header",1)(2,"button",2),v("click",function(){return n.cancel()}),r(3,"span",3),s(4,"\u2190"),o(),s(5," Auth Settings "),o(),r(6,"h1",4),s(7),o()(),m(8,re,2,0,"p",5)(9,me,26,8,"form",6),o()),e&2&&(l(7),A(n.isEditMode()?"Edit auth setting":"New auth setting"),l(),g(n.isLoading()?8:9))},dependencies:[Z,H,W,X,L,Q,j,K,G,Y,J],styles:[".auth-setting-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:1.5rem;max-width:640px}.auth-setting-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;background:none;border:none;cursor:pointer;color:var(--color-text-secondary);font-size:.85rem;padding:0}.auth-setting-form__back[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.auth-setting-form__back-icon[_ngcontent-%COMP%]{font-size:1rem}.auth-setting-form__title[_ngcontent-%COMP%]{font-size:1.4rem;font-weight:600;color:var(--color-text);margin:0}.auth-setting-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem}.auth-setting-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.auth-setting-form__scope[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem;display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__scope[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__scope-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;font-size:.9rem;color:var(--color-text)}.auth-setting-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.auth-setting-form__label[_ngcontent-%COMP%]{font-size:.85rem;font-weight:500;color:var(--color-text-secondary)}.auth-setting-form__input[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;transition:border-color .15s ease;width:100%;box-sizing:border-box}.auth-setting-form__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__input--secret[_ngcontent-%COMP%]{font-family:monospace;letter-spacing:.05em}.auth-setting-form__select[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;cursor:pointer;transition:border-color .15s ease}.auth-setting-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__credentials[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem 1rem;display:flex;flex-direction:column;gap:.75rem;margin:0}.auth-setting-form__credentials[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__credentials-hint[_ngcontent-%COMP%]{font-size:.78rem;color:var(--color-text-secondary);margin:0}.auth-setting-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center;padding-top:.5rem}.auth-setting-form__btn[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem 1.25rem;cursor:pointer;font-size:.9rem;font-weight:500;background:var(--color-bg-secondary);color:var(--color-text);transition:background .15s ease}.auth-setting-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.auth-setting-form__btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.auth-setting-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-on-primary, #fff);border-color:var(--color-primary)}.auth-setting-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, var(--color-primary))}"],changeDetection:0})};export{oe as AuthSettingFormComponent};
@@ -1 +1 @@
1
- import{i as $}from"./chunk-VH7ZEMCE.js";import{Bb as M,Eb as _,Fb as s,Ka as h,P as T,Qb as O,Rb as E,Tb as p,Wa as V,Z as w,ca as k,ga as m,ha as d,i as g,ia as u,ja as C,lb as x,mb as f,pc as v,qc as c,ta as N,vb as i,wb as o,xb as l}from"./chunk-3DOXTB6J.js";var b=class{_namespaces$=new g([]);_selected$=new g(null);namespaces$=this._namespaces$.asObservable();selectedNamespace$=this._selected$.asObservable();constructor(t){t.subscribe(e=>{this._namespaces$.next(e),this._selected$.getValue()===null&&e.length>0&&this._selected$.next(e[0]??null)})}selectNamespace(t){let e=this._namespaces$.getValue().find(r=>r.id===t)??null;this._selected$.next(e)}};var S=class n{namespaceApi=k($);_initialized$=new g(!1);initialized$=this._initialized$.asObservable();activeNamespaceId=N(null);state=null;get namespaces$(){return this.getState().namespaces$}get selectedNamespace$(){return this.getState().selectedNamespace$}init(){if(this._initialized$.getValue())return;console.log("init 2");let t=this.namespaceApi.listAllNamespace().pipe(T(1));this.state=new b(t),t.subscribe({next:()=>this._initialized$.next(!0),error:()=>{this._initialized$.next(!0)}})}selectNamespace(t){this.activeNamespaceId.set(t),this.getState().selectNamespace(t)}getState(){return this.state||(this.state=new b(new g([]).asObservable())),this.state}static \u0275fac=function(e){return new(e||n)};static \u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"})};function L(n,t){if(n&1){let e=M();i(0,"button",2),_("click",function(){m(e);let a=s(2);return d(a.onNavigate("/agentos/admin"))}),u(),i(1,"svg",3),l(2,"path",15),o(),p(3," Administration "),o()}}function U(n,t){n&1&&(i(0,"span",14),p(1,"On"),o())}function z(n,t){n&1&&(u(),i(0,"svg",3),l(1,"circle",16)(2,"path",17),o(),p(3," Light mode "))}function A(n,t){n&1&&(u(),i(0,"svg",3),l(1,"path",18),o(),p(2," Dark mode "))}function I(n,t){if(n&1){let e=M();i(0,"div",0),_("click",function(a){m(e);let y=s();return d(y.onClose(a))})("keyup.escape",function(a){m(e);let y=s();return d(y.onClose(a))}),o(),i(1,"div",1)(2,"button",2),_("click",function(){m(e);let a=s();return d(a.onNavigate("/agentos/user"))}),u(),i(3,"svg",3),l(4,"circle",4)(5,"path",5),o(),p(6," User settings "),o(),x(7,L,4,0,"button",6),C(),l(8,"div",7),i(9,"button",2),_("click",function(){m(e);let a=s();return d(a.onNavigate("/agentos/namespaces"))}),u(),i(10,"svg",3),l(11,"rect",8)(12,"rect",9)(13,"rect",10)(14,"rect",11),o(),p(15," Namespaces "),o(),C(),i(16,"button",2),_("click",function(){m(e);let a=s();return d(a.onLogsToggle())}),u(),i(17,"svg",3),l(18,"polyline",12)(19,"line",13),o(),p(20," Technical logs "),x(21,U,2,0,"span",14),o(),C(),l(22,"div",7),i(23,"button",2),_("click",function(){m(e);let a=s();return d(a.onThemeToggle())}),x(24,z,4,0)(25,A,3,0),o()()}if(n&2){let e=s();h(),O("top",e.variant()==="compact"?e.fixedTop():null,"px")("left",e.variant()==="compact"?e.fixedLeft():null,"px"),E("shell-user-menu__overlay--topbar",e.variant()==="topbar")("shell-user-menu__overlay--mobile",e.variant()==="mobile")("shell-user-menu__overlay--compact",e.variant()==="compact"),h(6),f(e.isAdmin()?7:-1),h(9),E("shell-user-menu__item--active",e.showTechnical()),h(5),f(e.showTechnical()?21:-1),h(3),f(e.isDark()?24:25)}}var D=class n{open=c.required();isAdmin=c.required();isDark=c.required();themeVariant=c.required();showTechnical=c.required();variant=c("desktop");fixedTop=c(0);fixedLeft=c(0);navigateTo=v();themeToggled=v();themeVariantChanged=v();logsToggled=v();closed=v();onNavigate(t){this.navigateTo.emit(t)}onThemeToggle(){this.themeToggled.emit()}onThemeVariantChange(t){this.themeVariantChanged.emit(t)}onLogsToggle(){this.logsToggled.emit()}onClose(t){t.stopPropagation(),this.closed.emit(t)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=V({type:n,selectors:[["agentos-shell-user-menu"]],inputs:{open:[1,"open"],isAdmin:[1,"isAdmin"],isDark:[1,"isDark"],themeVariant:[1,"themeVariant"],showTechnical:[1,"showTechnical"],variant:[1,"variant"],fixedTop:[1,"fixedTop"],fixedLeft:[1,"fixedLeft"]},outputs:{navigateTo:"navigateTo",themeToggled:"themeToggled",themeVariantChanged:"themeVariantChanged",logsToggled:"logsToggled",closed:"closed"},decls:1,vars:1,consts:[["role","presentation","tabindex","-1",1,"shell-user-menu__backdrop",3,"click","keyup.escape"],[1,"shell-user-menu__overlay"],["type","button",1,"shell-user-menu__item",3,"click"],["width","15","height","15","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round","aria-hidden","true"],["cx","12","cy","8","r","4"],["d","M20 21a8 8 0 0 0-16 0"],["type","button",1,"shell-user-menu__item"],[1,"shell-user-menu__separator"],["width","7","height","7","x","3","y","3"],["width","7","height","7","x","14","y","3"],["width","7","height","7","x","14","y","14"],["width","7","height","7","x","3","y","14"],["points","4 17 10 11 4 5"],["x1","12","x2","20","y1","19","y2","19"],[1,"shell-user-menu__item-badge"],["d","M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1 1 0 0 1 1.52 0C14.5 3.8 17 5 19 5a1 1 0 0 1 1 1z"],["cx","12","cy","12","r","4"],["d","M12 2v2M12 20v2m-7.07-14.07 1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2m-4.93-7.07-1.41 1.41M6.34 17.66l-1.41 1.41"],["d","M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"]],template:function(e,r){e&1&&x(0,I,26,15),e&2&&f(r.open()?0:-1)},styles:[".shell-user-menu__backdrop[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:199}.shell-user-menu__overlay[_ngcontent-%COMP%]{position:absolute;bottom:calc(100% + 6px);right:0;min-width:226px;z-index:200;background:var(--color-bg);border:1px solid var(--color-divider);box-shadow:var(--shadow-lg)}.shell-user-menu__overlay--topbar[_ngcontent-%COMP%]{bottom:auto;top:calc(100% + 6px)}.shell-user-menu__overlay--mobile[_ngcontent-%COMP%]{position:absolute;top:calc(100% + 4px);right:16px;left:auto;z-index:300}.shell-user-menu__overlay--compact[_ngcontent-%COMP%]{position:fixed;bottom:auto;right:auto;z-index:500;transform:translateY(-100%)}.shell-user-menu__item[_ngcontent-%COMP%]{appearance:none;background:transparent;border:none;margin:0;font:inherit;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;display:flex;align-items:center;gap:10px;width:100%;padding:8px 12px;font-size:13.5px;color:var(--color-text);text-align:left;transition:background .1s}.shell-user-menu__item[_ngcontent-%COMP%]:hover{background:color-mix(in srgb,var(--color-text) 6%,transparent)}.shell-user-menu__item[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{color:var(--color-neutral-600);flex-shrink:0}.shell-user-menu__item--active[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--color-accent) 10%,transparent);color:var(--color-accent-700)}.shell-user-menu__item--active[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{color:var(--color-accent-700)}.shell-user-menu__item-badge[_ngcontent-%COMP%]{margin-left:auto;font-size:10px;font-family:var(--font-heading);font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--color-accent-700);border:1px solid var(--color-accent-300);padding:1px 5px}.shell-user-menu__separator[_ngcontent-%COMP%]{height:1px;background:var(--color-divider);margin:4px;border:none}"],changeDetection:0})};export{S as a,D as b};
1
+ import{j as $}from"./chunk-DDBWRK3B.js";import{Bb as M,Eb as _,Fb as s,Ka as h,P as T,Qb as O,Rb as E,Tb as p,Wa as V,Z as w,ca as k,ga as m,ha as d,i as g,ia as u,ja as C,lb as x,mb as f,pc as v,qc as c,ta as N,vb as i,wb as o,xb as l}from"./chunk-3DOXTB6J.js";var b=class{_namespaces$=new g([]);_selected$=new g(null);namespaces$=this._namespaces$.asObservable();selectedNamespace$=this._selected$.asObservable();constructor(t){t.subscribe(e=>{this._namespaces$.next(e),this._selected$.getValue()===null&&e.length>0&&this._selected$.next(e[0]??null)})}selectNamespace(t){let e=this._namespaces$.getValue().find(r=>r.id===t)??null;this._selected$.next(e)}};var S=class n{namespaceApi=k($);_initialized$=new g(!1);initialized$=this._initialized$.asObservable();activeNamespaceId=N(null);state=null;get namespaces$(){return this.getState().namespaces$}get selectedNamespace$(){return this.getState().selectedNamespace$}init(){if(this._initialized$.getValue())return;console.log("init 2");let t=this.namespaceApi.listAllNamespace().pipe(T(1));this.state=new b(t),t.subscribe({next:()=>this._initialized$.next(!0),error:()=>{this._initialized$.next(!0)}})}selectNamespace(t){this.activeNamespaceId.set(t),this.getState().selectNamespace(t)}getState(){return this.state||(this.state=new b(new g([]).asObservable())),this.state}static \u0275fac=function(e){return new(e||n)};static \u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"})};function L(n,t){if(n&1){let e=M();i(0,"button",2),_("click",function(){m(e);let a=s(2);return d(a.onNavigate("/agentos/admin"))}),u(),i(1,"svg",3),l(2,"path",15),o(),p(3," Administration "),o()}}function U(n,t){n&1&&(i(0,"span",14),p(1,"On"),o())}function z(n,t){n&1&&(u(),i(0,"svg",3),l(1,"circle",16)(2,"path",17),o(),p(3," Light mode "))}function A(n,t){n&1&&(u(),i(0,"svg",3),l(1,"path",18),o(),p(2," Dark mode "))}function I(n,t){if(n&1){let e=M();i(0,"div",0),_("click",function(a){m(e);let y=s();return d(y.onClose(a))})("keyup.escape",function(a){m(e);let y=s();return d(y.onClose(a))}),o(),i(1,"div",1)(2,"button",2),_("click",function(){m(e);let a=s();return d(a.onNavigate("/agentos/user"))}),u(),i(3,"svg",3),l(4,"circle",4)(5,"path",5),o(),p(6," User settings "),o(),x(7,L,4,0,"button",6),C(),l(8,"div",7),i(9,"button",2),_("click",function(){m(e);let a=s();return d(a.onNavigate("/agentos/namespaces"))}),u(),i(10,"svg",3),l(11,"rect",8)(12,"rect",9)(13,"rect",10)(14,"rect",11),o(),p(15," Namespaces "),o(),C(),i(16,"button",2),_("click",function(){m(e);let a=s();return d(a.onLogsToggle())}),u(),i(17,"svg",3),l(18,"polyline",12)(19,"line",13),o(),p(20," Technical logs "),x(21,U,2,0,"span",14),o(),C(),l(22,"div",7),i(23,"button",2),_("click",function(){m(e);let a=s();return d(a.onThemeToggle())}),x(24,z,4,0)(25,A,3,0),o()()}if(n&2){let e=s();h(),O("top",e.variant()==="compact"?e.fixedTop():null,"px")("left",e.variant()==="compact"?e.fixedLeft():null,"px"),E("shell-user-menu__overlay--topbar",e.variant()==="topbar")("shell-user-menu__overlay--mobile",e.variant()==="mobile")("shell-user-menu__overlay--compact",e.variant()==="compact"),h(6),f(e.isAdmin()?7:-1),h(9),E("shell-user-menu__item--active",e.showTechnical()),h(5),f(e.showTechnical()?21:-1),h(3),f(e.isDark()?24:25)}}var D=class n{open=c.required();isAdmin=c.required();isDark=c.required();themeVariant=c.required();showTechnical=c.required();variant=c("desktop");fixedTop=c(0);fixedLeft=c(0);navigateTo=v();themeToggled=v();themeVariantChanged=v();logsToggled=v();closed=v();onNavigate(t){this.navigateTo.emit(t)}onThemeToggle(){this.themeToggled.emit()}onThemeVariantChange(t){this.themeVariantChanged.emit(t)}onLogsToggle(){this.logsToggled.emit()}onClose(t){t.stopPropagation(),this.closed.emit(t)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=V({type:n,selectors:[["agentos-shell-user-menu"]],inputs:{open:[1,"open"],isAdmin:[1,"isAdmin"],isDark:[1,"isDark"],themeVariant:[1,"themeVariant"],showTechnical:[1,"showTechnical"],variant:[1,"variant"],fixedTop:[1,"fixedTop"],fixedLeft:[1,"fixedLeft"]},outputs:{navigateTo:"navigateTo",themeToggled:"themeToggled",themeVariantChanged:"themeVariantChanged",logsToggled:"logsToggled",closed:"closed"},decls:1,vars:1,consts:[["role","presentation","tabindex","-1",1,"shell-user-menu__backdrop",3,"click","keyup.escape"],[1,"shell-user-menu__overlay"],["type","button",1,"shell-user-menu__item",3,"click"],["width","15","height","15","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round","aria-hidden","true"],["cx","12","cy","8","r","4"],["d","M20 21a8 8 0 0 0-16 0"],["type","button",1,"shell-user-menu__item"],[1,"shell-user-menu__separator"],["width","7","height","7","x","3","y","3"],["width","7","height","7","x","14","y","3"],["width","7","height","7","x","14","y","14"],["width","7","height","7","x","3","y","14"],["points","4 17 10 11 4 5"],["x1","12","x2","20","y1","19","y2","19"],[1,"shell-user-menu__item-badge"],["d","M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1 1 0 0 1 1.52 0C14.5 3.8 17 5 19 5a1 1 0 0 1 1 1z"],["cx","12","cy","12","r","4"],["d","M12 2v2M12 20v2m-7.07-14.07 1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2m-4.93-7.07-1.41 1.41M6.34 17.66l-1.41 1.41"],["d","M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"]],template:function(e,r){e&1&&x(0,I,26,15),e&2&&f(r.open()?0:-1)},styles:[".shell-user-menu__backdrop[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:199}.shell-user-menu__overlay[_ngcontent-%COMP%]{position:absolute;bottom:calc(100% + 6px);right:0;min-width:226px;z-index:200;background:var(--color-bg);border:1px solid var(--color-divider);box-shadow:var(--shadow-lg)}.shell-user-menu__overlay--topbar[_ngcontent-%COMP%]{bottom:auto;top:calc(100% + 6px)}.shell-user-menu__overlay--mobile[_ngcontent-%COMP%]{position:absolute;top:calc(100% + 4px);right:16px;left:auto;z-index:300}.shell-user-menu__overlay--compact[_ngcontent-%COMP%]{position:fixed;bottom:auto;right:auto;z-index:500;transform:translateY(-100%)}.shell-user-menu__item[_ngcontent-%COMP%]{appearance:none;background:transparent;border:none;margin:0;font:inherit;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;display:flex;align-items:center;gap:10px;width:100%;padding:8px 12px;font-size:13.5px;color:var(--color-text);text-align:left;transition:background .1s}.shell-user-menu__item[_ngcontent-%COMP%]:hover{background:color-mix(in srgb,var(--color-text) 6%,transparent)}.shell-user-menu__item[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{color:var(--color-neutral-600);flex-shrink:0}.shell-user-menu__item--active[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--color-accent) 10%,transparent);color:var(--color-accent-700)}.shell-user-menu__item--active[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{color:var(--color-accent-700)}.shell-user-menu__item-badge[_ngcontent-%COMP%]{margin-left:auto;font-size:10px;font-family:var(--font-heading);font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--color-accent-700);border:1px solid var(--color-accent-300);padding:1px 5px}.shell-user-menu__separator[_ngcontent-%COMP%]{height:1px;background:var(--color-divider);margin:4px;border:none}"],changeDetection:0})};export{S as a,D as b};
@@ -1 +1 @@
1
- import{a as ne}from"./chunk-2RRKNP4O.js";import{a as ie}from"./chunk-EUKRA2OA.js";import"./chunk-JIYGZGAO.js";import"./chunk-NQVAKMAF.js";import{p as L}from"./chunk-VH7ZEMCE.js";import{a as K,c as G}from"./chunk-COLWSJEP.js";import{a as A,c as B}from"./chunk-PUWEEZSA.js";import{F as oe,c as z,e as _,g as $,h as q,i as S,l as p,n as j,p as H,r as J,s as Q,t as W,u as X,v as Y,w as Z,x as ee,y as re,z as te}from"./chunk-ZJV25K6M.js";import{Bb as k,Db as f,Fb as m,Ka as l,Tb as i,Ub as P,Vb as U,Wa as I,ca as v,ga as g,ha as h,kb as V,lb as M,ma as N,mb as O,nb as R,ob as D,pb as C,qb as x,rb as d,sb as o,ta as y,tb as t,ua as T,ub as u}from"./chunk-3DOXTB6J.js";function de(n,r){n&1&&(o(0,"p",5),i(1,"Loading\u2026"),t())}function pe(n,r){if(n&1&&(o(0,"label",30),u(1,"input",31),o(2,"span"),i(3),t()()),n&2){let e=r.$implicit,a=m(3);l(),d("formControl",a.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!a.isAdmin()),l(2),P(e.label)}}function me(n,r){if(n&1&&(o(0,"fieldset",8)(1,"legend",24),i(2,"Port\xE9e de la configuration"),t(),C(3,pe,4,4,"label",30,V().trackByScope,!0),t()),n&2){let e=m(2);d("disabled",e.isEditMode()),l(3),x(e.scopeOptions)}}function ce(n,r){if(n&1&&(o(0,"option",13),i(1),t()),n&2){let e=r.$implicit;d("value",e),l(),P(e)}}function ue(n,r){if(n&1){let e=k();o(0,"div",26),u(1,"input",32)(2,"input",33),o(3,"button",34),f("click",function(){let s=g(e).$index,c=m(2);return h(c.removeHeader(s))}),i(4," \xD7 "),t()()}if(n&2){let e=r.$index;d("formGroupName",e)}}function ve(n,r){if(n&1){let e=k();o(0,"form",7),f("ngSubmit",function(){g(e);let s=m();return h(s.submit())}),M(1,me,5,1,"fieldset",8),o(2,"div",9)(3,"label",10),i(4,"API type "),o(5,"span",11),i(6,"*"),t()(),o(7,"select",12),C(8,ce,2,2,"option",13,D),t()(),o(10,"div",9)(11,"label",14),i(12,"Name "),o(13,"span",11),i(14,"*"),t()(),u(15,"input",15),t(),o(16,"div",9)(17,"label",16),i(18,"Description"),t(),u(19,"input",17),t(),o(20,"div",9)(21,"label",18),i(22,"Base URL"),t(),u(23,"input",19),t(),o(24,"div",9)(25,"label",20),i(26,"API key"),t(),u(27,"input",21),t(),o(28,"div",22)(29,"div",23)(30,"span",24),i(31,"Custom headers"),t(),o(32,"button",25),f("click",function(){g(e);let s=m();return h(s.addHeader())}),i(33,"+ Add header"),t()(),C(34,ue,5,1,"div",26,R),t(),o(36,"div",27)(37,"button",28),i(38),t(),o(39,"button",29),f("click",function(){g(e);let s=m();return h(s.cancel())}),i(40,"Cancel"),t()()()}if(n&2){let e=m();d("formGroup",e.form),l(),O(e.isPlatformMode?-1:1),l(6),d("formControl",e.apiTypeControl),l(),x(e.apiTypeOptions),l(7),d("formControl",e.nameControl),l(4),d("formControl",e.descriptionControl),l(4),d("formControl",e.baseUrlControl),l(4),d("formControl",e.apiKeyControl),l(),d("formArrayName","headers"),l(6),x(e.headersArray.controls),l(3),d("disabled",e.form.invalid||e.isSubmitting()),l(),U(" ",e.isEditMode()?"Save changes":"Create"," ")}}var fe=new Set(["namespace","userOnNs","userGlobal"]),E=Object.freeze({platform:"Configuration de niveau plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),ae=class n{route=v(K);router=v(G);destroyRef=v(N);state=v(ne);namespaceRole=v(ie);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?y(!0):B(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:!1});apiTypeOptions=Object.values(L);scopeOptions=[{value:"namespace",label:E.namespace},{value:"userOnNs",label:E.userOnNs},{value:"userGlobal",label:E.userGlobal}];form=new S({name:new p("",{nonNullable:!0,validators:[_.required,_.minLength(1)]}),description:new p(null),apiType:new p("OpenAI",{nonNullable:!0,validators:[_.required]}),baseUrl:new p("",{nonNullable:!0}),apiKey:new p("",{nonNullable:!0}),scope:new p("namespace",{nonNullable:!0}),headers:new J([],{validators:[]})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get apiTypeControl(){return this.form.controls.apiType}get baseUrlControl(){return this.form.controls.baseUrl}get apiKeyControl(){return this.form.controls.apiKey}get scopeControl(){return this.form.controls.scope}get headersArray(){return this.form.controls.headers}addHeader(){this.headersArray.push(new S({key:new p("",{nonNullable:!0,validators:[_.required]}),value:new p("",{nonNullable:!0})}))}removeHeader(r){this.headersArray.removeAt(r)}isEditMode=y(!1);isSubmitting=y(!1);isLoading=y(!1);existingConfig=null;initialApiKey="";constructor(){this.isPlatformMode||T(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs")})}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let r=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,a=r.get("aiProviderId"),s=this.isPlatformMode?"namespace":this.parseScope(e.get("scope"));if(a){this.isEditMode.set(!0),this.scopeControl.disable(),this.apiTypeControl.disable(),this.loadConfig(a);return}this.scopeControl.setValue(s);let c=e.get("template");c&&this.hydrateFromTemplate(c)}parseScope(r){return r&&fe.has(r)?r:"namespace"}deriveScopeFromConfig(r){return!r.userId?"namespace":r.namespaceId?"userOnNs":"userGlobal"}loadConfig(r){this.isLoading.set(!0),this.state.getById(r).pipe(A(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),console.warn(`[AiProviderForm] Could not load provider '${r}' \u2014 navigating back`),this.navigateBack()}})}hydrateFromTemplate(r){this.isLoading.set(!0),this.state.getById(r).pipe(A(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.apiTypeControl.setValue(e.apiType),this.baseUrlControl.setValue(e.baseUrl??""),this.apiKeyControl.setValue(""),this.initialApiKey="",this.apiKeyControl.markAsTouched(),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})},error:e=>{console.warn(`[AiProviderForm] Could not hydrate from template ${r}:`,e),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})}})}applyConfigToForm(r){this.nameControl.setValue(r.name),this.descriptionControl.setValue(r.description??null),this.apiTypeControl.setValue(r.apiType),this.baseUrlControl.setValue(r.baseUrl??"");let e=r.apiKey??"";this.apiKeyControl.setValue(e),this.initialApiKey=e,this.headersArray.clear();for(let[a,s]of Object.entries(r.headers??{}))this.headersArray.push(new S({key:new p(a,{nonNullable:!0,validators:[_.required]}),value:new p(s,{nonNullable:!0})}))}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(!0);let r=this.descriptionControl.value?.trim(),e=this.baseUrlControl.value.trim(),a=this.apiKeyControl.value,s=this.isEditMode()&&a===this.initialApiKey?null:a,c=this.headersArray.controls.filter(b=>b.controls.key.value.trim()).map(b=>[b.controls.key.value.trim(),b.controls.value.value]),le=c.length>0?Object.fromEntries(c):null,w={name:this.nameControl.value.trim(),apiType:this.apiTypeControl.value,description:r||null,baseUrl:e||null,apiKey:s,headers:le},F=this.form.getRawValue().scope,se=this.isPlatformMode?null:this.namespaceId??null;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,F,this.existingConfig):this.state.create(w,F,se)).pipe(A(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-providers"]):this.router.navigate(["/agentos",this.namespaceId,"ai-providers"])}trackByScope(r,e){return e.value}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=I({type:n,selectors:[["agentos-ai-provider-form"]],decls:10,vars:2,consts:[[1,"ai-provider-form"],[1,"ai-provider-form__header"],["type","button","title","Back to AI providers",1,"ai-provider-form__back",3,"click"],[1,"ai-provider-form__back-icon"],[1,"ai-provider-form__title"],[1,"ai-provider-form__loading"],[1,"ai-provider-form__form",3,"formGroup"],[1,"ai-provider-form__form",3,"ngSubmit","formGroup"],[1,"ai-provider-form__scope",3,"disabled"],[1,"ai-provider-form__field"],["for","llm-api-type",1,"ai-provider-form__label"],["aria-hidden","true"],["id","llm-api-type",1,"ai-provider-form__select",3,"formControl"],[3,"value"],["for","llm-name",1,"ai-provider-form__label"],["id","llm-name","type","text","placeholder","e.g. OpenAI prod","autocomplete","off",1,"ai-provider-form__input",3,"formControl"],["for","llm-description",1,"ai-provider-form__label"],["id","llm-description","type","text","placeholder","Optional \u2014 short description of this provider","autocomplete","off",1,"ai-provider-form__input",3,"formControl"],["for","llm-base-url",1,"ai-provider-form__label"],["id","llm-base-url","type","url","placeholder","Optional \u2014 leave empty for default endpoint","autocomplete","off",1,"ai-provider-form__input",3,"formControl"],["for","llm-api-key",1,"ai-provider-form__label"],["id","llm-api-key","type","password","placeholder","sk-\u2026","autocomplete","new-password",1,"ai-provider-form__input","ai-provider-form__input--secret",3,"formControl"],[1,"ai-provider-form__headers",3,"formArrayName"],[1,"ai-provider-form__headers-title"],[1,"ai-provider-form__label"],["type","button",1,"ai-provider-form__headers-add",3,"click"],[1,"ai-provider-form__header-row",3,"formGroupName"],[1,"ai-provider-form__actions"],["type","submit",1,"ai-provider-form__btn","ai-provider-form__btn--primary",3,"disabled"],["type","button",1,"ai-provider-form__btn",3,"click"],[1,"ai-provider-form__scope-option"],["type","radio",3,"formControl","value","disabled"],["type","text","placeholder","Header name","formControlName","key","autocomplete","off",1,"ai-provider-form__input"],["type","text","placeholder","Value","formControlName","value","autocomplete","off",1,"ai-provider-form__input"],["type","button","title","Remove header","aria-label","Remove header",1,"ai-provider-form__header-remove",3,"click"]],template:function(e,a){e&1&&(o(0,"div",0)(1,"header",1)(2,"button",2),f("click",function(){return a.cancel()}),o(3,"span",3),i(4,"\u2190"),t(),i(5," AI Providers "),t(),o(6,"h1",4),i(7),t()(),M(8,de,2,0,"p",5)(9,ve,41,10,"form",6),t()),e&2&&(l(7),P(a.isEditMode()?"Edit AI provider":"New AI provider"),l(),O(a.isLoading()?8:9))},dependencies:[oe,j,re,te,z,ee,H,$,q,Q,Z,Y,W,X],styles:[".ai-provider-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:480px;margin:0 auto;padding:2rem 1rem}.ai-provider-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-divider);border-radius:0;padding:.75rem 1rem;margin:0}.ai-provider-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.ai-provider-form__scope-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;font-size:.85rem;color:var(--color-text);cursor:pointer}.ai-provider-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.ai-provider-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.ai-provider-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.ai-provider-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.ai-provider-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.ai-provider-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.ai-provider-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.ai-provider-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.ai-provider-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.ai-provider-form__input[_ngcontent-%COMP%], .ai-provider-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}.ai-provider-form__input[_ngcontent-%COMP%]:focus, .ai-provider-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.ai-provider-form__input[_ngcontent-%COMP%]::placeholder, .ai-provider-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.ai-provider-form__input--secret[_ngcontent-%COMP%]{font-family:monospace;letter-spacing:.05em}.ai-provider-form__headers[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.ai-provider-form__headers-title[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}.ai-provider-form__headers-add[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.8125rem;color:var(--color-accent)}.ai-provider-form__headers-add[_ngcontent-%COMP%]:hover{text-decoration:underline}.ai-provider-form__header-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr auto;gap:.5rem;align-items:center}.ai-provider-form__header-remove[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;background:none;border:1px solid transparent;border-radius:0;cursor:pointer;font-size:1rem;color:var(--color-neutral-500);transition:background .15s ease,color .15s ease,border-color .15s ease;flex-shrink:0}.ai-provider-form__header-remove[_ngcontent-%COMP%]:hover{color:var(--red);background:color-mix(in srgb,var(--red) 10%,transparent);border-color:var(--red)}.ai-provider-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.ai-provider-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}.ai-provider-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.ai-provider-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.ai-provider-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.ai-provider-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"],changeDetection:0})};export{ae as AiProviderFormComponent};
1
+ import{a as ne}from"./chunk-7WNGYNNF.js";import{a as ie}from"./chunk-QO3SLUF6.js";import"./chunk-JIYGZGAO.js";import"./chunk-FIDJLAO5.js";import{q as L}from"./chunk-DDBWRK3B.js";import{a as K,c as G}from"./chunk-COLWSJEP.js";import{a as A,c as B}from"./chunk-PUWEEZSA.js";import{F as oe,c as z,e as _,g as $,h as q,i as S,l as p,n as j,p as H,r as J,s as Q,t as W,u as X,v as Y,w as Z,x as ee,y as re,z as te}from"./chunk-ZJV25K6M.js";import{Bb as k,Db as f,Fb as m,Ka as l,Tb as i,Ub as P,Vb as U,Wa as I,ca as v,ga as g,ha as h,kb as V,lb as M,ma as N,mb as O,nb as R,ob as D,pb as C,qb as x,rb as d,sb as o,ta as y,tb as t,ua as T,ub as u}from"./chunk-3DOXTB6J.js";function de(n,r){n&1&&(o(0,"p",5),i(1,"Loading\u2026"),t())}function pe(n,r){if(n&1&&(o(0,"label",30),u(1,"input",31),o(2,"span"),i(3),t()()),n&2){let e=r.$implicit,a=m(3);l(),d("formControl",a.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!a.isAdmin()),l(2),P(e.label)}}function me(n,r){if(n&1&&(o(0,"fieldset",8)(1,"legend",24),i(2,"Port\xE9e de la configuration"),t(),C(3,pe,4,4,"label",30,V().trackByScope,!0),t()),n&2){let e=m(2);d("disabled",e.isEditMode()),l(3),x(e.scopeOptions)}}function ce(n,r){if(n&1&&(o(0,"option",13),i(1),t()),n&2){let e=r.$implicit;d("value",e),l(),P(e)}}function ue(n,r){if(n&1){let e=k();o(0,"div",26),u(1,"input",32)(2,"input",33),o(3,"button",34),f("click",function(){let s=g(e).$index,c=m(2);return h(c.removeHeader(s))}),i(4," \xD7 "),t()()}if(n&2){let e=r.$index;d("formGroupName",e)}}function ve(n,r){if(n&1){let e=k();o(0,"form",7),f("ngSubmit",function(){g(e);let s=m();return h(s.submit())}),M(1,me,5,1,"fieldset",8),o(2,"div",9)(3,"label",10),i(4,"API type "),o(5,"span",11),i(6,"*"),t()(),o(7,"select",12),C(8,ce,2,2,"option",13,D),t()(),o(10,"div",9)(11,"label",14),i(12,"Name "),o(13,"span",11),i(14,"*"),t()(),u(15,"input",15),t(),o(16,"div",9)(17,"label",16),i(18,"Description"),t(),u(19,"input",17),t(),o(20,"div",9)(21,"label",18),i(22,"Base URL"),t(),u(23,"input",19),t(),o(24,"div",9)(25,"label",20),i(26,"API key"),t(),u(27,"input",21),t(),o(28,"div",22)(29,"div",23)(30,"span",24),i(31,"Custom headers"),t(),o(32,"button",25),f("click",function(){g(e);let s=m();return h(s.addHeader())}),i(33,"+ Add header"),t()(),C(34,ue,5,1,"div",26,R),t(),o(36,"div",27)(37,"button",28),i(38),t(),o(39,"button",29),f("click",function(){g(e);let s=m();return h(s.cancel())}),i(40,"Cancel"),t()()()}if(n&2){let e=m();d("formGroup",e.form),l(),O(e.isPlatformMode?-1:1),l(6),d("formControl",e.apiTypeControl),l(),x(e.apiTypeOptions),l(7),d("formControl",e.nameControl),l(4),d("formControl",e.descriptionControl),l(4),d("formControl",e.baseUrlControl),l(4),d("formControl",e.apiKeyControl),l(),d("formArrayName","headers"),l(6),x(e.headersArray.controls),l(3),d("disabled",e.form.invalid||e.isSubmitting()),l(),U(" ",e.isEditMode()?"Save changes":"Create"," ")}}var fe=new Set(["namespace","userOnNs","userGlobal"]),E=Object.freeze({platform:"Configuration de niveau plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),ae=class n{route=v(K);router=v(G);destroyRef=v(N);state=v(ne);namespaceRole=v(ie);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?y(!0):B(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:!1});apiTypeOptions=Object.values(L);scopeOptions=[{value:"namespace",label:E.namespace},{value:"userOnNs",label:E.userOnNs},{value:"userGlobal",label:E.userGlobal}];form=new S({name:new p("",{nonNullable:!0,validators:[_.required,_.minLength(1)]}),description:new p(null),apiType:new p("OpenAI",{nonNullable:!0,validators:[_.required]}),baseUrl:new p("",{nonNullable:!0}),apiKey:new p("",{nonNullable:!0}),scope:new p("namespace",{nonNullable:!0}),headers:new J([],{validators:[]})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get apiTypeControl(){return this.form.controls.apiType}get baseUrlControl(){return this.form.controls.baseUrl}get apiKeyControl(){return this.form.controls.apiKey}get scopeControl(){return this.form.controls.scope}get headersArray(){return this.form.controls.headers}addHeader(){this.headersArray.push(new S({key:new p("",{nonNullable:!0,validators:[_.required]}),value:new p("",{nonNullable:!0})}))}removeHeader(r){this.headersArray.removeAt(r)}isEditMode=y(!1);isSubmitting=y(!1);isLoading=y(!1);existingConfig=null;initialApiKey="";constructor(){this.isPlatformMode||T(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs")})}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let r=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,a=r.get("aiProviderId"),s=this.isPlatformMode?"namespace":this.parseScope(e.get("scope"));if(a){this.isEditMode.set(!0),this.scopeControl.disable(),this.apiTypeControl.disable(),this.loadConfig(a);return}this.scopeControl.setValue(s);let c=e.get("template");c&&this.hydrateFromTemplate(c)}parseScope(r){return r&&fe.has(r)?r:"namespace"}deriveScopeFromConfig(r){return!r.userId?"namespace":r.namespaceId?"userOnNs":"userGlobal"}loadConfig(r){this.isLoading.set(!0),this.state.getById(r).pipe(A(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),console.warn(`[AiProviderForm] Could not load provider '${r}' \u2014 navigating back`),this.navigateBack()}})}hydrateFromTemplate(r){this.isLoading.set(!0),this.state.getById(r).pipe(A(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.apiTypeControl.setValue(e.apiType),this.baseUrlControl.setValue(e.baseUrl??""),this.apiKeyControl.setValue(""),this.initialApiKey="",this.apiKeyControl.markAsTouched(),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})},error:e=>{console.warn(`[AiProviderForm] Could not hydrate from template ${r}:`,e),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})}})}applyConfigToForm(r){this.nameControl.setValue(r.name),this.descriptionControl.setValue(r.description??null),this.apiTypeControl.setValue(r.apiType),this.baseUrlControl.setValue(r.baseUrl??"");let e=r.apiKey??"";this.apiKeyControl.setValue(e),this.initialApiKey=e,this.headersArray.clear();for(let[a,s]of Object.entries(r.headers??{}))this.headersArray.push(new S({key:new p(a,{nonNullable:!0,validators:[_.required]}),value:new p(s,{nonNullable:!0})}))}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(!0);let r=this.descriptionControl.value?.trim(),e=this.baseUrlControl.value.trim(),a=this.apiKeyControl.value,s=this.isEditMode()&&a===this.initialApiKey?null:a,c=this.headersArray.controls.filter(b=>b.controls.key.value.trim()).map(b=>[b.controls.key.value.trim(),b.controls.value.value]),le=c.length>0?Object.fromEntries(c):null,w={name:this.nameControl.value.trim(),apiType:this.apiTypeControl.value,description:r||null,baseUrl:e||null,apiKey:s,headers:le},F=this.form.getRawValue().scope,se=this.isPlatformMode?null:this.namespaceId??null;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,F,this.existingConfig):this.state.create(w,F,se)).pipe(A(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-providers"]):this.router.navigate(["/agentos",this.namespaceId,"ai-providers"])}trackByScope(r,e){return e.value}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=I({type:n,selectors:[["agentos-ai-provider-form"]],decls:10,vars:2,consts:[[1,"ai-provider-form"],[1,"ai-provider-form__header"],["type","button","title","Back to AI providers",1,"ai-provider-form__back",3,"click"],[1,"ai-provider-form__back-icon"],[1,"ai-provider-form__title"],[1,"ai-provider-form__loading"],[1,"ai-provider-form__form",3,"formGroup"],[1,"ai-provider-form__form",3,"ngSubmit","formGroup"],[1,"ai-provider-form__scope",3,"disabled"],[1,"ai-provider-form__field"],["for","llm-api-type",1,"ai-provider-form__label"],["aria-hidden","true"],["id","llm-api-type",1,"ai-provider-form__select",3,"formControl"],[3,"value"],["for","llm-name",1,"ai-provider-form__label"],["id","llm-name","type","text","placeholder","e.g. OpenAI prod","autocomplete","off",1,"ai-provider-form__input",3,"formControl"],["for","llm-description",1,"ai-provider-form__label"],["id","llm-description","type","text","placeholder","Optional \u2014 short description of this provider","autocomplete","off",1,"ai-provider-form__input",3,"formControl"],["for","llm-base-url",1,"ai-provider-form__label"],["id","llm-base-url","type","url","placeholder","Optional \u2014 leave empty for default endpoint","autocomplete","off",1,"ai-provider-form__input",3,"formControl"],["for","llm-api-key",1,"ai-provider-form__label"],["id","llm-api-key","type","password","placeholder","sk-\u2026","autocomplete","new-password",1,"ai-provider-form__input","ai-provider-form__input--secret",3,"formControl"],[1,"ai-provider-form__headers",3,"formArrayName"],[1,"ai-provider-form__headers-title"],[1,"ai-provider-form__label"],["type","button",1,"ai-provider-form__headers-add",3,"click"],[1,"ai-provider-form__header-row",3,"formGroupName"],[1,"ai-provider-form__actions"],["type","submit",1,"ai-provider-form__btn","ai-provider-form__btn--primary",3,"disabled"],["type","button",1,"ai-provider-form__btn",3,"click"],[1,"ai-provider-form__scope-option"],["type","radio",3,"formControl","value","disabled"],["type","text","placeholder","Header name","formControlName","key","autocomplete","off",1,"ai-provider-form__input"],["type","text","placeholder","Value","formControlName","value","autocomplete","off",1,"ai-provider-form__input"],["type","button","title","Remove header","aria-label","Remove header",1,"ai-provider-form__header-remove",3,"click"]],template:function(e,a){e&1&&(o(0,"div",0)(1,"header",1)(2,"button",2),f("click",function(){return a.cancel()}),o(3,"span",3),i(4,"\u2190"),t(),i(5," AI Providers "),t(),o(6,"h1",4),i(7),t()(),M(8,de,2,0,"p",5)(9,ve,41,10,"form",6),t()),e&2&&(l(7),P(a.isEditMode()?"Edit AI provider":"New AI provider"),l(),O(a.isLoading()?8:9))},dependencies:[oe,j,re,te,z,ee,H,$,q,Q,Z,Y,W,X],styles:[".ai-provider-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:480px;margin:0 auto;padding:2rem 1rem}.ai-provider-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-divider);border-radius:0;padding:.75rem 1rem;margin:0}.ai-provider-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.ai-provider-form__scope-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;font-size:.85rem;color:var(--color-text);cursor:pointer}.ai-provider-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.ai-provider-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.ai-provider-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.ai-provider-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.ai-provider-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.ai-provider-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.ai-provider-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.ai-provider-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.ai-provider-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.ai-provider-form__input[_ngcontent-%COMP%], .ai-provider-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}.ai-provider-form__input[_ngcontent-%COMP%]:focus, .ai-provider-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.ai-provider-form__input[_ngcontent-%COMP%]::placeholder, .ai-provider-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.ai-provider-form__input--secret[_ngcontent-%COMP%]{font-family:monospace;letter-spacing:.05em}.ai-provider-form__headers[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.ai-provider-form__headers-title[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}.ai-provider-form__headers-add[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.8125rem;color:var(--color-accent)}.ai-provider-form__headers-add[_ngcontent-%COMP%]:hover{text-decoration:underline}.ai-provider-form__header-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr auto;gap:.5rem;align-items:center}.ai-provider-form__header-remove[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;background:none;border:1px solid transparent;border-radius:0;cursor:pointer;font-size:1rem;color:var(--color-neutral-500);transition:background .15s ease,color .15s ease,border-color .15s ease;flex-shrink:0}.ai-provider-form__header-remove[_ngcontent-%COMP%]:hover{color:var(--red);background:color-mix(in srgb,var(--red) 10%,transparent);border-color:var(--red)}.ai-provider-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.ai-provider-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}.ai-provider-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.ai-provider-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.ai-provider-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.ai-provider-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"],changeDetection:0})};export{ae as AiProviderFormComponent};
@@ -1 +1 @@
1
- import{a as D}from"./chunk-P7QBEYDF.js";import{g as $}from"./chunk-VH7ZEMCE.js";import{c as M}from"./chunk-COLWSJEP.js";import{s as k,z as E}from"./chunk-2X6HKQMK.js";import"./chunk-EGMTTOHU.js";import"./chunk-TQXOFKZO.js";import{a as d}from"./chunk-PUWEEZSA.js";import"./chunk-WXFL4OGQ.js";import"./chunk-ZJV25K6M.js";import"./chunk-GO5IXCK2.js";import{Bb as R,Db as s,Fb as g,Lc as B,Pb as w,S as u,Wa as I,ab as h,ca as r,cc as P,fc as x,ga as m,gc as T,ha as p,i as _,jc as q,lb as v,ma as y,mb as b,rb as l,sb as a,t as C,tb as c}from"./chunk-3DOXTB6J.js";var V=()=>[];function F(i,e){if(i&1){let t=R();a(0,"agentos-integration-config-item",4),s("editRequested",function(n){m(t);let f=g(2);return p(f.onEdit(n))})("deleteRequested",function(n){m(t);let f=g(2);return p(f.deleteConfig(n))}),c()}i&2&&l("config",e)}function L(i,e){if(i&1&&v(0,F,1,1,"agentos-integration-config-item",3),i&2){let t,o=e.$implicit,n=g();b((t=n.resolveConfig(o.id))?0:-1,t)}}var S=class i{router=r(M);destroyRef=r(y);integrationConfigController=r($);refresh$=new _(void 0);configs$=this.refresh$.pipe(u(()=>this.integrationConfigController.listIntegrationConfig()));configItems$=this.configs$.pipe(C(e=>e.map(t=>({id:t.id??"",name:t.name,description:t.integrationType}))));configsById=new Map;constructor(){this.configs$.pipe(d(this.destroyRef)).subscribe(e=>{this.configsById=new Map(e.map(t=>[t.id??"",t]))})}goBack(){this.router.navigate(["/agentos","admin"])}openCreateForm(){this.router.navigate(["/agentos","admin","integration-configs","new"])}deleteConfig(e){this.integrationConfigController.deleteIntegrationConfig(e.id??"").pipe(d(this.destroyRef)).subscribe(()=>this.refresh$.next())}onEdit(e){this.router.navigate(["/agentos","admin","integration-configs",e.id??"","edit"])}resolveConfig(e){return this.configsById.get(e)??null}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["agentos-platform-integration-configs"]],decls:5,vars:6,consts:[["integrationConfigItemTpl",""],["title","Platform Integration Configs","emptyMessage","No platform integration configs defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],["scope","platform",3,"config"],["scope","platform",3,"editRequested","deleteRequested","config"]],template:function(t,o){if(t&1&&(a(0,"ds-entity-list",1),x(1,"async"),s("createRequested",function(){return o.openCreateForm()}),a(2,"ds-icon-button",2),s("action",function(){return o.goBack()}),c()(),h(3,L,1,1,"ng-template",null,0,q)),t&2){let n=w(4);l("items",T(1,3,o.configItems$)??P(5,V))("showCreate",!0)("itemTemplate",n)}},dependencies:[E,D,k,B],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}"],changeDetection:0})};export{S as PlatformIntegrationConfigsComponent};
1
+ import{a as D}from"./chunk-P7QBEYDF.js";import{h as $}from"./chunk-DDBWRK3B.js";import{c as M}from"./chunk-COLWSJEP.js";import{s as k,z as E}from"./chunk-2X6HKQMK.js";import"./chunk-EGMTTOHU.js";import"./chunk-TQXOFKZO.js";import{a as d}from"./chunk-PUWEEZSA.js";import"./chunk-WXFL4OGQ.js";import"./chunk-ZJV25K6M.js";import"./chunk-GO5IXCK2.js";import{Bb as R,Db as s,Fb as g,Lc as B,Pb as w,S as u,Wa as I,ab as h,ca as r,cc as P,fc as x,ga as m,gc as T,ha as p,i as _,jc as q,lb as v,ma as y,mb as b,rb as l,sb as a,t as C,tb as c}from"./chunk-3DOXTB6J.js";var V=()=>[];function F(i,e){if(i&1){let t=R();a(0,"agentos-integration-config-item",4),s("editRequested",function(n){m(t);let f=g(2);return p(f.onEdit(n))})("deleteRequested",function(n){m(t);let f=g(2);return p(f.deleteConfig(n))}),c()}i&2&&l("config",e)}function L(i,e){if(i&1&&v(0,F,1,1,"agentos-integration-config-item",3),i&2){let t,o=e.$implicit,n=g();b((t=n.resolveConfig(o.id))?0:-1,t)}}var S=class i{router=r(M);destroyRef=r(y);integrationConfigController=r($);refresh$=new _(void 0);configs$=this.refresh$.pipe(u(()=>this.integrationConfigController.listIntegrationConfig()));configItems$=this.configs$.pipe(C(e=>e.map(t=>({id:t.id??"",name:t.name,description:t.integrationType}))));configsById=new Map;constructor(){this.configs$.pipe(d(this.destroyRef)).subscribe(e=>{this.configsById=new Map(e.map(t=>[t.id??"",t]))})}goBack(){this.router.navigate(["/agentos","admin"])}openCreateForm(){this.router.navigate(["/agentos","admin","integration-configs","new"])}deleteConfig(e){this.integrationConfigController.deleteIntegrationConfig(e.id??"").pipe(d(this.destroyRef)).subscribe(()=>this.refresh$.next())}onEdit(e){this.router.navigate(["/agentos","admin","integration-configs",e.id??"","edit"])}resolveConfig(e){return this.configsById.get(e)??null}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=I({type:i,selectors:[["agentos-platform-integration-configs"]],decls:5,vars:6,consts:[["integrationConfigItemTpl",""],["title","Platform Integration Configs","emptyMessage","No platform integration configs defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],["scope","platform",3,"config"],["scope","platform",3,"editRequested","deleteRequested","config"]],template:function(t,o){if(t&1&&(a(0,"ds-entity-list",1),x(1,"async"),s("createRequested",function(){return o.openCreateForm()}),a(2,"ds-icon-button",2),s("action",function(){return o.goBack()}),c()(),h(3,L,1,1,"ng-template",null,0,q)),t&2){let n=w(4);l("items",T(1,3,o.configItems$)??P(5,V))("showCreate",!0)("itemTemplate",n)}},dependencies:[E,D,k,B],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}"],changeDetection:0})};export{S as PlatformIntegrationConfigsComponent};
@@ -1 +1 @@
1
- import{a as S}from"./chunk-6AFOV467.js";import{c as $,d as k}from"./chunk-VH7ZEMCE.js";import{c as B}from"./chunk-COLWSJEP.js";import{s as E,z as D}from"./chunk-2X6HKQMK.js";import"./chunk-EGMTTOHU.js";import"./chunk-TQXOFKZO.js";import{a as f}from"./chunk-PUWEEZSA.js";import"./chunk-WXFL4OGQ.js";import"./chunk-ZJV25K6M.js";import"./chunk-GO5IXCK2.js";import{Bb as P,Db as l,Fb as d,Lc as q,Pb as I,S as y,Wa as C,ab as A,ca as n,cc as w,fc as R,ga as m,gc as x,ha as p,i as u,jc as T,lb as b,ma as g,mb as h,rb as c,sb as a,t as M,tb as _,u as v}from"./chunk-3DOXTB6J.js";var N=()=>[];function V(r,t){if(r&1){let o=P();a(0,"agentos-ai-model-item",4),l("editRequested",function(e){m(o);let s=d(2);return p(s.onEdit(e))})("deleteRequested",function(e){m(o);let s=d(2);return p(s.deleteModel(e))}),_()}r&2&&c("model",t)}function F(r,t){if(r&1&&b(0,V,1,1,"agentos-ai-model-item",3),r&2){let o,i=t.$implicit,e=d();h((o=e.resolveModel(i.id))?0:-1,o)}}var L=class r{router=n(B);destroyRef=n(g);aiModelController=n($);aiProviderController=n(k);refresh$=new u(void 0);data$=this.refresh$.pipe(y(()=>v([this.aiModelController.listPlatformLevelAiModel(),this.aiProviderController.listAiProvider("none")])));modelItems$=this.data$.pipe(M(([t,o])=>{let i=new Map(o.map(e=>[e.id??"",e.name]));return t.map(e=>({id:e.id??"",name:e.alias??e.apiModelName,description:e.apiModelName,groupKey:e.aiProviderId,groupLabel:i.get(e.aiProviderId)??e.aiProviderId}))}));modelsById=new Map;constructor(){this.data$.pipe(f(this.destroyRef)).subscribe(([t])=>{this.modelsById=new Map(t.map(o=>[o.id??"",o]))})}goBack(){this.router.navigate(["/agentos","admin"])}openCreateForm(){this.router.navigate(["/agentos","admin","ai-models","new"])}deleteModel(t){this.aiModelController.deleteAiModel(t.id??"").pipe(f(this.destroyRef)).subscribe(()=>this.refresh$.next())}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","ai-models",t.id,"edit"])}resolveModel(t){return this.modelsById.get(t)??null}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=C({type:r,selectors:[["agentos-platform-ai-models"]],decls:5,vars:6,consts:[["aiModelItemTpl",""],["title","Platform AI Models","emptyMessage","No platform AI models defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"model"],[3,"editRequested","deleteRequested","model"]],template:function(o,i){if(o&1&&(a(0,"ds-entity-list",1),R(1,"async"),l("createRequested",function(){return i.openCreateForm()}),a(2,"ds-icon-button",2),l("action",function(){return i.goBack()}),_()(),A(3,F,1,1,"ng-template",null,0,T)),o&2){let e=I(4);c("items",x(1,3,i.modelItems$)??w(5,N))("showCreate",!0)("itemTemplate",e)}},dependencies:[D,S,E,q],styles:[".platform-ai-models__back[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;font-family:inherit;font-size:.875rem;color:var(--color-text-secondary, #6e6e73);padding:.25rem .5rem;border-radius:4px;transition:color .15s ease}.platform-ai-models__back[_ngcontent-%COMP%]:hover{color:var(--color-primary, #007aff)}"],changeDetection:0})};export{L as PlatformAiModelsComponent};
1
+ import{a as S}from"./chunk-6AFOV467.js";import{c as $,d as k}from"./chunk-DDBWRK3B.js";import{c as B}from"./chunk-COLWSJEP.js";import{s as E,z as D}from"./chunk-2X6HKQMK.js";import"./chunk-EGMTTOHU.js";import"./chunk-TQXOFKZO.js";import{a as f}from"./chunk-PUWEEZSA.js";import"./chunk-WXFL4OGQ.js";import"./chunk-ZJV25K6M.js";import"./chunk-GO5IXCK2.js";import{Bb as P,Db as l,Fb as d,Lc as q,Pb as I,S as y,Wa as C,ab as A,ca as n,cc as w,fc as R,ga as m,gc as x,ha as p,i as u,jc as T,lb as b,ma as g,mb as h,rb as c,sb as a,t as M,tb as _,u as v}from"./chunk-3DOXTB6J.js";var N=()=>[];function V(r,t){if(r&1){let o=P();a(0,"agentos-ai-model-item",4),l("editRequested",function(e){m(o);let s=d(2);return p(s.onEdit(e))})("deleteRequested",function(e){m(o);let s=d(2);return p(s.deleteModel(e))}),_()}r&2&&c("model",t)}function F(r,t){if(r&1&&b(0,V,1,1,"agentos-ai-model-item",3),r&2){let o,i=t.$implicit,e=d();h((o=e.resolveModel(i.id))?0:-1,o)}}var L=class r{router=n(B);destroyRef=n(g);aiModelController=n($);aiProviderController=n(k);refresh$=new u(void 0);data$=this.refresh$.pipe(y(()=>v([this.aiModelController.listPlatformLevelAiModel(),this.aiProviderController.listAiProvider("none")])));modelItems$=this.data$.pipe(M(([t,o])=>{let i=new Map(o.map(e=>[e.id??"",e.name]));return t.map(e=>({id:e.id??"",name:e.alias??e.apiModelName,description:e.apiModelName,groupKey:e.aiProviderId,groupLabel:i.get(e.aiProviderId)??e.aiProviderId}))}));modelsById=new Map;constructor(){this.data$.pipe(f(this.destroyRef)).subscribe(([t])=>{this.modelsById=new Map(t.map(o=>[o.id??"",o]))})}goBack(){this.router.navigate(["/agentos","admin"])}openCreateForm(){this.router.navigate(["/agentos","admin","ai-models","new"])}deleteModel(t){this.aiModelController.deleteAiModel(t.id??"").pipe(f(this.destroyRef)).subscribe(()=>this.refresh$.next())}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","ai-models",t.id,"edit"])}resolveModel(t){return this.modelsById.get(t)??null}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=C({type:r,selectors:[["agentos-platform-ai-models"]],decls:5,vars:6,consts:[["aiModelItemTpl",""],["title","Platform AI Models","emptyMessage","No platform AI models defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"model"],[3,"editRequested","deleteRequested","model"]],template:function(o,i){if(o&1&&(a(0,"ds-entity-list",1),R(1,"async"),l("createRequested",function(){return i.openCreateForm()}),a(2,"ds-icon-button",2),l("action",function(){return i.goBack()}),_()(),A(3,F,1,1,"ng-template",null,0,T)),o&2){let e=I(4);c("items",x(1,3,i.modelItems$)??w(5,N))("showCreate",!0)("itemTemplate",e)}},dependencies:[D,S,E,q],styles:[".platform-ai-models__back[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;font-family:inherit;font-size:.875rem;color:var(--color-text-secondary, #6e6e73);padding:.25rem .5rem;border-radius:4px;transition:color .15s ease}.platform-ai-models__back[_ngcontent-%COMP%]:hover{color:var(--color-primary, #007aff)}"],changeDetection:0})};export{L as PlatformAiModelsComponent};
@@ -31,5 +31,5 @@
31
31
  <style>:root{--color-bg:#f5f6f8;--color-bg-solid:#f5f6f8;--color-bg-secondary:rgba(255, 255, 255, .7);--color-bg-secondary-rgb:255 255 255;--color-text:#1d1d1f;--color-text-secondary:#6e6e73;--color-text-inverse:#ffffff;--color-text-tertiary:#a1a1a6;--color-primary:#007aff;--color-primary-hover:#0051d5;--color-accent:#8b5cf6;--color-link:#007aff;--color-border:rgba(0, 0, 0, .1);--color-border-light:rgba(40, 40, 40, .08);--color-input-bg:rgba(255, 255, 255, .8);--color-bg-hover:rgba(0, 0, 0, .04);--color-success:#34c759;--color-success-bg:#e3f5e1;--color-error:#ff3b30;--color-warning:#ff9500;--color-info:#5ac8fa;--color-message-user:rgba(0, 122, 255, .1);--color-message-ai:rgba(255, 255, 255, .8);--color-code-bg:rgba(142, 142, 147, .12);--color-code-text:#ff375f;--glass-bg:rgba(255, 255, 255, .72);--glass-border:rgba(255, 255, 255, .18);--glass-shadow:0 8px 32px 0 rgba(31, 38, 135, .15);--glass-backdrop-blur:blur(20px);--color-modal-bg:#ffffff;--color-surface:#ffffff;--color-modal-border:rgba(0, 0, 0, .12);--color-modal-shadow:0 8px 40px rgba(0, 0, 0, .18), 0 2px 8px rgba(0, 0, 0, .1);--color-shadow:rgba(0, 0, 0, .08);--color-overlay:rgba(0, 0, 0, .4);--color-surface-hover:var(--color-bg-hover);--color-surface-secondary:rgba(0, 0, 0, .03);--color-surface-muted:rgba(0, 0, 0, .05);--color-divider:rgba(0, 0, 0, .1)}@media print{html,body,app-root{height:auto!important;max-height:none!important;min-height:auto!important;overflow:visible!important;position:static!important}body{background:#fff!important;color:#000!important;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif!important;font-size:11pt;line-height:1.6;padding:1rem!important}*{animation:none!important;transition:none!important;box-shadow:none!important;text-shadow:none!important}}*{box-sizing:border-box}html{color-scheme:light}html{--mat-sys-background:light-dark(#faf9fd, #121316);--mat-sys-error:light-dark(#ba1a1a, #ffb4ab);--mat-sys-error-container:light-dark(#ffdad6, #93000a);--mat-sys-inverse-on-surface:light-dark(#f2f0f4, #2f3033);--mat-sys-inverse-primary:light-dark(#abc7ff, #005cbb);--mat-sys-inverse-surface:light-dark(#2f3033, #e3e2e6);--mat-sys-on-background:light-dark(#1a1b1f, #e3e2e6);--mat-sys-on-error:light-dark(#ffffff, #690005);--mat-sys-on-error-container:light-dark(#93000a, #ffdad6);--mat-sys-on-primary:light-dark(#ffffff, #002f65);--mat-sys-on-primary-container:light-dark(#00458f, #d7e3ff);--mat-sys-on-primary-fixed:light-dark(#001b3f, #001b3f);--mat-sys-on-primary-fixed-variant:light-dark(#00458f, #00458f);--mat-sys-on-secondary:light-dark(#ffffff, #283041);--mat-sys-on-secondary-container:light-dark(#3e4759, #dae2f9);--mat-sys-on-secondary-fixed:light-dark(#131c2b, #131c2b);--mat-sys-on-secondary-fixed-variant:light-dark(#3e4759, #3e4759);--mat-sys-on-surface:light-dark(#1a1b1f, #e3e2e6);--mat-sys-on-surface-variant:light-dark(#44474e, #e0e2ec);--mat-sys-on-tertiary:light-dark(#ffffff, #002f65);--mat-sys-on-tertiary-container:light-dark(#00458f, #d7e3ff);--mat-sys-on-tertiary-fixed:light-dark(#001b3f, #001b3f);--mat-sys-on-tertiary-fixed-variant:light-dark(#00458f, #00458f);--mat-sys-outline:light-dark(#74777f, #8e9099);--mat-sys-outline-variant:light-dark(#c4c6d0, #44474e);--mat-sys-primary:light-dark(#005cbb, #abc7ff);--mat-sys-primary-container:light-dark(#d7e3ff, #00458f);--mat-sys-primary-fixed:light-dark(#d7e3ff, #d7e3ff);--mat-sys-primary-fixed-dim:light-dark(#abc7ff, #abc7ff);--mat-sys-scrim:light-dark(#000000, #000000);--mat-sys-secondary:light-dark(#565e71, #bec6dc);--mat-sys-secondary-container:light-dark(#dae2f9, #3e4759);--mat-sys-secondary-fixed:light-dark(#dae2f9, #dae2f9);--mat-sys-secondary-fixed-dim:light-dark(#bec6dc, #bec6dc);--mat-sys-shadow:light-dark(#000000, #000000);--mat-sys-surface:light-dark(#faf9fd, #121316);--mat-sys-surface-bright:light-dark(#faf9fd, #38393c);--mat-sys-surface-container:light-dark(#efedf0, #1f2022);--mat-sys-surface-container-high:light-dark(#e9e7eb, #292a2c);--mat-sys-surface-container-highest:light-dark(#e3e2e6, #343537);--mat-sys-surface-container-low:light-dark(#f4f3f6, #1a1b1f);--mat-sys-surface-container-lowest:light-dark(#ffffff, #0d0e11);--mat-sys-surface-dim:light-dark(#dbd9dd, #121316);--mat-sys-surface-tint:light-dark(#005cbb, #abc7ff);--mat-sys-surface-variant:light-dark(#e0e2ec, #44474e);--mat-sys-tertiary:light-dark(#005cbb, #abc7ff);--mat-sys-tertiary-container:light-dark(#d7e3ff, #00458f);--mat-sys-tertiary-fixed:light-dark(#d7e3ff, #d7e3ff);--mat-sys-tertiary-fixed-dim:light-dark(#abc7ff, #abc7ff);--mat-sys-neutral-variant20:#2d3038;--mat-sys-neutral10:#1a1b1f;--mat-sys-level0:0px 0px 0px 0px rgba(0, 0, 0, .2), 0px 0px 0px 0px rgba(0, 0, 0, .14), 0px 0px 0px 0px rgba(0, 0, 0, .12);--mat-sys-level1:0px 2px 1px -1px rgba(0, 0, 0, .2), 0px 1px 1px 0px rgba(0, 0, 0, .14), 0px 1px 3px 0px rgba(0, 0, 0, .12);--mat-sys-level2:0px 3px 3px -2px rgba(0, 0, 0, .2), 0px 3px 4px 0px rgba(0, 0, 0, .14), 0px 1px 8px 0px rgba(0, 0, 0, .12);--mat-sys-level3:0px 3px 5px -1px rgba(0, 0, 0, .2), 0px 6px 10px 0px rgba(0, 0, 0, .14), 0px 1px 18px 0px rgba(0, 0, 0, .12);--mat-sys-level4:0px 5px 5px -3px rgba(0, 0, 0, .2), 0px 8px 10px 1px rgba(0, 0, 0, .14), 0px 3px 14px 2px rgba(0, 0, 0, .12);--mat-sys-level5:0px 7px 8px -4px rgba(0, 0, 0, .2), 0px 12px 17px 2px rgba(0, 0, 0, .14), 0px 5px 22px 4px rgba(0, 0, 0, .12);--mat-sys-body-large:400 1rem / 1.5rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-large-line-height:1.5rem;--mat-sys-body-large-size:1rem;--mat-sys-body-large-tracking:.031rem;--mat-sys-body-large-weight:400;--mat-sys-body-medium:400 .875rem / 1.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-medium-line-height:1.25rem;--mat-sys-body-medium-size:.875rem;--mat-sys-body-medium-tracking:.016rem;--mat-sys-body-medium-weight:400;--mat-sys-body-small:400 .75rem / 1rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-small-line-height:1rem;--mat-sys-body-small-size:.75rem;--mat-sys-body-small-tracking:.025rem;--mat-sys-body-small-weight:400;--mat-sys-display-large:400 3.562rem / 4rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-large-line-height:4rem;--mat-sys-display-large-size:3.562rem;--mat-sys-display-large-tracking:-.016rem;--mat-sys-display-large-weight:400;--mat-sys-display-medium:400 2.812rem / 3.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-medium-line-height:3.25rem;--mat-sys-display-medium-size:2.812rem;--mat-sys-display-medium-tracking:0;--mat-sys-display-medium-weight:400;--mat-sys-display-small:400 2.25rem / 2.75rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-small-line-height:2.75rem;--mat-sys-display-small-size:2.25rem;--mat-sys-display-small-tracking:0;--mat-sys-display-small-weight:400;--mat-sys-headline-large:400 2rem / 2.5rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-large-line-height:2.5rem;--mat-sys-headline-large-size:2rem;--mat-sys-headline-large-tracking:0;--mat-sys-headline-large-weight:400;--mat-sys-headline-medium:400 1.75rem / 2.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-medium-line-height:2.25rem;--mat-sys-headline-medium-size:1.75rem;--mat-sys-headline-medium-tracking:0;--mat-sys-headline-medium-weight:400;--mat-sys-headline-small:400 1.5rem / 2rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-small-line-height:2rem;--mat-sys-headline-small-size:1.5rem;--mat-sys-headline-small-tracking:0;--mat-sys-headline-small-weight:400;--mat-sys-label-large:500 .875rem / 1.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-large-line-height:1.25rem;--mat-sys-label-large-size:.875rem;--mat-sys-label-large-tracking:.006rem;--mat-sys-label-large-weight:500;--mat-sys-label-large-weight-prominent:700;--mat-sys-label-medium:500 .75rem / 1rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-medium-line-height:1rem;--mat-sys-label-medium-size:.75rem;--mat-sys-label-medium-tracking:.031rem;--mat-sys-label-medium-weight:500;--mat-sys-label-medium-weight-prominent:700;--mat-sys-label-small:500 .688rem / 1rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-small-line-height:1rem;--mat-sys-label-small-size:.688rem;--mat-sys-label-small-tracking:.031rem;--mat-sys-label-small-weight:500;--mat-sys-title-large:400 1.375rem / 1.75rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-large-line-height:1.75rem;--mat-sys-title-large-size:1.375rem;--mat-sys-title-large-tracking:0;--mat-sys-title-large-weight:400;--mat-sys-title-medium:500 1rem / 1.5rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-medium-line-height:1.5rem;--mat-sys-title-medium-size:1rem;--mat-sys-title-medium-tracking:.009rem;--mat-sys-title-medium-weight:500;--mat-sys-title-small:500 .875rem / 1.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-small-line-height:1.25rem;--mat-sys-title-small-size:.875rem;--mat-sys-title-small-tracking:.006rem;--mat-sys-title-small-weight:500;--mat-sys-corner-extra-large:28px;--mat-sys-corner-extra-large-top:28px 28px 0 0;--mat-sys-corner-extra-small:4px;--mat-sys-corner-extra-small-top:4px 4px 0 0;--mat-sys-corner-full:9999px;--mat-sys-corner-large:16px;--mat-sys-corner-large-end:0 16px 16px 0;--mat-sys-corner-large-start:16px 0 0 16px;--mat-sys-corner-large-top:16px 16px 0 0;--mat-sys-corner-medium:12px;--mat-sys-corner-none:0;--mat-sys-corner-small:8px;--mat-sys-dragged-state-layer-opacity:.16;--mat-sys-focus-state-layer-opacity:.12;--mat-sys-hover-state-layer-opacity:.08;--mat-sys-pressed-state-layer-opacity:.12;--mat-snack-bar-container-shape:transparent;--mat-snack-bar-container-color:transparent;--mat-snack-bar-supporting-text-color:var(--color-text)}html,body{margin:0;padding:0;width:100%;height:100%}body{background:var(--color-bg);color:var(--color-text);font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,Segoe UI,Helvetica Neue,Arial,sans-serif;transition:background .3s ease,color .3s ease;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;padding:0!important}</style><link rel="stylesheet" href="styles-HDA2O7OH.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles-HDA2O7OH.css"></noscript></head>
32
32
  <body>
33
33
  <app-root></app-root>
34
- <link rel="modulepreload" href="chunk-VH7ZEMCE.js"><link rel="modulepreload" href="chunk-QVW2GZXC.js"><link rel="modulepreload" href="chunk-QR2CLZRO.js"><link rel="modulepreload" href="chunk-BZA46IMY.js"><link rel="modulepreload" href="chunk-26GNTYMR.js"><link rel="modulepreload" href="chunk-COLWSJEP.js"><link rel="modulepreload" href="chunk-YKT74LKI.js"><link rel="modulepreload" href="chunk-KTYUC4CA.js"><link rel="modulepreload" href="chunk-TQXOFKZO.js"><link rel="modulepreload" href="chunk-PUWEEZSA.js"><script src="polyfills-2FSRUXKO.js" type="module"></script><script src="main-SDUET5IO.js" type="module"></script></body>
34
+ <link rel="modulepreload" href="chunk-DDBWRK3B.js"><link rel="modulepreload" href="chunk-QVW2GZXC.js"><link rel="modulepreload" href="chunk-QR2CLZRO.js"><link rel="modulepreload" href="chunk-BZA46IMY.js"><link rel="modulepreload" href="chunk-26GNTYMR.js"><link rel="modulepreload" href="chunk-COLWSJEP.js"><link rel="modulepreload" href="chunk-YKT74LKI.js"><link rel="modulepreload" href="chunk-KTYUC4CA.js"><link rel="modulepreload" href="chunk-TQXOFKZO.js"><link rel="modulepreload" href="chunk-PUWEEZSA.js"><script src="polyfills-2FSRUXKO.js" type="module"></script><script src="main-6K2RB63O.js" type="module"></script></body>
35
35
  </html>