@whoz-oss/coday-client 0.248.2 → 0.249.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.
- package/browser/{chunk-UF3D3UUD.js → chunk-3FDPLGME.js} +1 -1
- package/browser/{chunk-Y52DC76K.js → chunk-4KA7TIB4.js} +1 -1
- package/browser/{chunk-V63CBJL3.js → chunk-4NPMNHQN.js} +1 -1
- package/browser/{chunk-Z34N3CUS.js → chunk-4OSUCDSF.js} +1 -1
- package/browser/{chunk-WC55KAEC.js → chunk-4U47ZPZP.js} +1 -1
- package/browser/{chunk-EZSEUOCV.js → chunk-6PGRBK22.js} +2 -2
- package/browser/{chunk-RSGZ7YWF.js → chunk-7HQ3TFIP.js} +1 -1
- package/browser/{chunk-2TDFGQ4U.js → chunk-7P7KJUWV.js} +1 -1
- package/browser/{chunk-2QDRHKK5.js → chunk-7SEGP55P.js} +1 -1
- package/browser/{chunk-VVFVGWIQ.js → chunk-AKLSF437.js} +1 -1
- package/browser/{chunk-5PVR7BPQ.js → chunk-AZOMCTR7.js} +1 -1
- package/browser/chunk-AZSB2H23.js +1 -0
- package/browser/{chunk-XRGYHVGI.js → chunk-B5ZVUFND.js} +1 -1
- package/browser/{chunk-UEGZX4MW.js → chunk-BK6WNBAO.js} +1 -1
- package/browser/{chunk-B4UTEYRE.js → chunk-C7VJCZQE.js} +2 -2
- package/browser/{chunk-TFW43ZTS.js → chunk-CJQ4FDXR.js} +1 -1
- package/browser/{chunk-NMKUE2VW.js → chunk-CLTMZI2I.js} +1 -1
- package/browser/{chunk-NGMAQNX3.js → chunk-CNUJJQAG.js} +3 -3
- package/browser/{chunk-OFAUBLZA.js → chunk-DIJGQPPG.js} +1 -1
- package/browser/{chunk-LVRSSQUD.js → chunk-EMVHTOJY.js} +1 -1
- package/browser/{chunk-KB2ABAWC.js → chunk-F7UYEPIO.js} +1 -1
- package/browser/{chunk-KY3GI5KF.js → chunk-FELDR7HF.js} +1 -1
- package/browser/{chunk-Y42FQQZC.js → chunk-FL2HNVMC.js} +1 -1
- package/browser/chunk-GFK56P4B.js +3 -0
- package/browser/{chunk-PDUSJ4QD.js → chunk-IPWNT3U4.js} +1 -1
- package/browser/{chunk-MWXEF4QG.js → chunk-IWVV3FNS.js} +1 -1
- package/browser/{chunk-GTCP3EYX.js → chunk-J6NBYNRX.js} +1 -1
- package/browser/chunk-JVZA4C5U.js +1 -0
- package/browser/{chunk-H5R3SW7B.js → chunk-KHCLVVXY.js} +1 -1
- package/browser/{chunk-DFU2RM36.js → chunk-KSZNM45C.js} +1 -1
- package/browser/{chunk-J7LPPELB.js → chunk-LPIKNWWZ.js} +1 -1
- package/browser/{chunk-MK6PPMBU.js → chunk-LVZVGPMV.js} +1 -1
- package/browser/{chunk-DIN6OQ3X.js → chunk-MHOEYCWL.js} +1 -1
- package/browser/{chunk-5KKUKGZH.js → chunk-MIVM4FAD.js} +1 -1
- package/browser/{chunk-JYYG7ZUT.js → chunk-MXD6ICBN.js} +1 -1
- package/browser/{chunk-TIO4RSPY.js → chunk-NHUXMXD2.js} +1 -1
- package/browser/{chunk-TCHHDPN6.js → chunk-NLCT6PBH.js} +1 -1
- package/browser/{chunk-OIFNN56R.js → chunk-NQHQFPW5.js} +2 -2
- package/browser/{chunk-DZ2M3NQD.js → chunk-OCMS2KMG.js} +1 -1
- package/browser/{chunk-E6T6QLQT.js → chunk-OO2H5F7U.js} +3 -3
- package/browser/{chunk-YZ7HJLJI.js → chunk-P4UYIBTK.js} +1 -1
- package/browser/{chunk-C3GZ6PYA.js → chunk-P5FCG3WF.js} +1 -1
- package/browser/{chunk-WLQB3UUA.js → chunk-PGEMQVT2.js} +1 -1
- package/browser/{chunk-DPLTZQJN.js → chunk-QYUULQIF.js} +1 -1
- package/browser/{chunk-SGNDHUEQ.js → chunk-ROOPYJTV.js} +1 -1
- package/browser/{chunk-QH6RTNNU.js → chunk-RSTB4RTA.js} +1 -1
- package/browser/{chunk-6JMDCL65.js → chunk-RUXH3KF5.js} +1 -1
- package/browser/{chunk-2XANOO7Y.js → chunk-SN27D3CH.js} +1 -1
- package/browser/{chunk-RXH3NNTB.js → chunk-SVOSTUY5.js} +1 -1
- package/browser/{chunk-WAGXU26A.js → chunk-SXFAR5TU.js} +1 -1
- package/browser/{chunk-VNO76B3S.js → chunk-TTHFWEW7.js} +3 -3
- package/browser/chunk-UAC4ZZCA.js +1 -0
- package/browser/{chunk-J4UAEXFM.js → chunk-UAVOIVZW.js} +1 -1
- package/browser/{chunk-OITCRMRM.js → chunk-VN2SNJFT.js} +1 -1
- package/browser/{chunk-CRODJUF7.js → chunk-WARAZYNV.js} +1 -1
- package/browser/{chunk-BHAZO7U5.js → chunk-WNJYWSOR.js} +1 -1
- package/browser/{chunk-LYDUBL3X.js → chunk-WVXEP3PL.js} +1 -1
- package/browser/{chunk-SKBEA6VH.js → chunk-XIV35L24.js} +1 -1
- package/browser/{chunk-HT3AURU3.js → chunk-XORVTVXX.js} +1 -1
- package/browser/{chunk-CRXIMHRG.js → chunk-XXVFHAN5.js} +1 -1
- package/browser/{chunk-FIDRP4UY.js → chunk-YV2SJQAM.js} +1 -1
- package/browser/{chunk-55CLK4XC.js → chunk-Z3AHFIZF.js} +1 -1
- package/browser/{chunk-JF7QMQ4U.js → chunk-ZEQWC4IU.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/{main-TPEZWDPT.js → main-7VP3QZBV.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-5WX43L4B.js +0 -1
- package/browser/chunk-GS2CQHR7.js +0 -3
- package/browser/chunk-I2ONTIJI.js +0 -1
- package/browser/chunk-TASSC2XX.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as me,c as le}from"./chunk-2PWIGCN2.js";import{a as R}from"./chunk-SKBEA6VH.js";import{a as Oe,b as ke,c as z}from"./chunk-J4UAEXFM.js";import{a as he,b as be,g as Ce,h as fe,i as ye,j as we}from"./chunk-GTCP3EYX.js";import{a as de,b as pe,c as ge,d as ue,e as _e,x as Ee,y as Se,z as Fe}from"./chunk-VNO76B3S.js";import"./chunk-E6T6QLQT.js";import{a as te,b as ne,d as oe,e as ie,f as re,g as ae,h as se}from"./chunk-BTOJ27OO.js";import"./chunk-SPV5SLNS.js";import"./chunk-VMYKE4ZC.js";import{a as L,b as A}from"./chunk-AS2L77JV.js";import{C as ve,E as B,b as Me,c as Pe,g as W,m as V,p as xe}from"./chunk-7OGOI6WM.js";import"./chunk-TASSC2XX.js";import{O as D,Q as ce,S as I}from"./chunk-G5RWG2GK.js";import{$b as y,Bb as f,Db as d,Fb as l,Hc as $,Ka as c,Pb as N,Pc as ee,Rb as T,Tb as a,Ub as M,Vb as O,Wa as F,Zb as x,_b as v,ab as U,ca as _,cc as J,dc as Q,ga as g,ha as u,jc as X,lb as h,mb as b,mc as Z,nb as q,pb as H,qb as Y,rb as C,sb as n,ta as P,tb as o,yb as G,zb as K}from"./chunk-CHEXA6RY.js";function Re(s,i){if(s&1){let e=f();n(0,"div",9)(1,"mat-form-field",18)(2,"mat-label"),a(3),o(),n(4,"textarea",19),y("ngModelChange",function(r){let m=g(e).$index,E=l();return v(E.commands[m],r)||(E.commands[m]=r),u(r)}),o(),n(5,"mat-hint"),a(6,"Use placeholder for dynamic values"),o()(),n(7,"button",20),d("click",function(){let r=g(e).$index,m=l();return u(m.removeCommand(r))}),n(8,"mat-icon"),a(9,"delete"),o()()()}if(s&2){let e=i.$index,t=l();c(3),O("Prompt ",e+1),c(),x("ngModel",t.commands[e]),c(3),C("disabled",t.commands.length===1)}}function ze(s,i){if(s&1){let e=f();n(0,"div",10)(1,"h3"),a(2,"Save to"),o(),n(3,"div",21)(4,"label",22)(5,"input",23),y("ngModelChange",function(r){g(e);let m=l();return v(m.source,r)||(m.source=r),u(r)}),o(),n(6,"div",24)(7,"div",25)(8,"span",26),a(9,"\u{1F464}"),o(),n(10,"span",27),a(11,"Local"),o()(),n(12,"p",28),a(13,"Personal prompt in ~/.coday/... (not committed)"),o()()(),n(14,"label",22)(15,"input",29),y("ngModelChange",function(r){g(e);let m=l();return v(m.source,r)||(m.source=r),u(r)}),o(),n(16,"div",24)(17,"div",25)(18,"span",26),a(19,"\u{1F4E6}"),o(),n(20,"span",27),a(21,"Project"),o()(),n(22,"p",28),a(23,"Shared prompt in ./prompts/ (committable)"),o()()()(),n(24,"p",30),a(25,"Storage location is permanent and cannot be changed after creation"),o()()}if(s&2){let e=l();c(4),T("selected",e.source==="local"),c(),x("ngModel",e.source),c(9),T("selected",e.source==="project"),c(),x("ngModel",e.source)}}function Ue(s,i){if(s&1&&(n(0,"div",11)(1,"h3"),a(2,"Storage Location"),o(),n(3,"div",31)(4,"span",26),a(5),o(),n(6,"span",27),a(7),o()(),n(8,"p",30),a(9,"Cannot be changed after creation"),o()()),s&2){let e=l();c(3),T("badge-local",e.source==="local")("badge-project",e.source==="project"),c(2),M(e.source==="local"?"\u{1F464}":"\u{1F4E6}"),c(2),M(e.source==="local"?"Local":"Project")}}function Ne(s,i){if(s&1){let e=f();n(0,"div",12)(1,"label",32)(2,"input",33),y("ngModelChange",function(r){g(e);let m=l();return v(m.webhookEnabled,r)||(m.webhookEnabled=r),u(r)}),o(),n(3,"span"),a(4,"Enable webhook"),o()(),n(5,"p",30),a(6,"Enable webhook to trigger this prompt via HTTP POST"),o()()}if(s&2){let e=l();c(2),x("ngModel",e.webhookEnabled)}}function je(s,i){if(s&1){let e=f();n(0,"div",13)(1,"div",34)(2,"mat-icon",35),a(3,"link"),o(),n(4,"h4"),a(5,"Webhook URL"),o()(),n(6,"div",36)(7,"p",37),a(8),o(),n(9,"button",38),d("click",function(){g(e);let r=l();return u(r.copyWebhookUrl())}),n(10,"mat-icon"),a(11,"content_copy"),o(),n(12,"span"),a(13,"Copy URL"),o()()(),n(14,"p",30),a(15,"Use this URL to trigger the prompt via HTTP POST"),o()()}if(s&2){let e=l();c(8),M(e.getWebhookUrl())}}function qe(s,i){if(s&1&&(n(0,"div",14)(1,"mat-icon"),a(2,"error"),o(),n(3,"span"),a(4),o()()),s&2){let e=l();c(4),M(e.errorMessage)}}var k=class s{promptApi=_(R);dialogRef=_(te);configApi=_(z);snackBar=_(me);name="";description="";commands=[""];webhookEnabled=!1;threadLifetime="";source="local";isSaving=!1;errorMessage="";isAdmin=!1;isEditMode=!1;promptId="";data=_(ne);constructor(){this.isEditMode=this.data.mode==="edit"}ngOnInit(){this.configApi.getUserConfig().subscribe({next:i=>{this.isAdmin=i.groups?.includes("CODAY_ADMIN")??!1},error:i=>{console.error("[PROMPT_FORM] Error loading user config:",i),this.isAdmin=!1}}),this.isEditMode&&this.data.prompt&&(this.promptId=this.data.prompt.id,this.name=this.data.prompt.name,this.description=this.data.prompt.description,this.commands=[...this.data.prompt.commands],this.webhookEnabled=this.data.prompt.webhookEnabled,this.source=this.data.prompt.source)}addCommand(){this.commands.push("")}removeCommand(i){this.commands.length>1&&this.commands.splice(i,1)}trackByIndex(i){return i}normalizeName(){this.name=this.name.replace(/[\s_.,;:!?()[\]{}]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase()}validateForm(){return this.name.trim()?this.description.trim()?this.commands.filter(e=>e.trim()).length===0?(this.errorMessage="At least one command is required",!1):!0:(this.errorMessage="Description is required",!1):(this.errorMessage="Name is required",!1)}save(){if(this.errorMessage="",!this.validateForm())return;let i=this.commands.filter(e=>e.trim());if(this.isSaving=!0,this.isEditMode&&this.data.prompt){let e={name:this.name.trim(),description:this.description.trim(),commands:i,webhookEnabled:this.webhookEnabled};this.promptApi.updatePrompt(this.data.prompt.id,e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:t=>{console.error("Error updating prompt:",t),this.errorMessage=t?.error?.error||t?.message||"Failed to update prompt",this.isSaving=!1}})}else{let e={name:this.name.trim(),description:this.description.trim(),commands:i,webhookEnabled:this.webhookEnabled,source:this.source};this.promptApi.createPrompt(e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:t=>{console.error("Error creating prompt:",t),this.errorMessage=t?.error?.error||t?.message||"Failed to create prompt",this.isSaving=!1}})}}cancel(){this.dialogRef.close(!1)}getWebhookUrl(){return`${window.location.origin}/api/webhooks/${this.promptId}/execute`}copyWebhookUrl(){if(!this.webhookEnabled){this.snackBar.open("Webhook is not enabled","Close",{duration:3e3});return}if(!this.promptId){this.snackBar.open("Prompt must be saved before getting webhook URL","Close",{duration:3e3});return}let i=this.getWebhookUrl();navigator.clipboard.writeText(i).then(()=>{this.snackBar.open("Webhook URL copied to clipboard!","Close",{duration:3e3})}).catch(e=>{console.error("Failed to copy webhook URL:",e),this.snackBar.open("Failed to copy URL","Close",{duration:3e3})})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=F({type:s,selectors:[["app-prompt-form"]],decls:36,vars:11,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-prompt","required","",3,"ngModelChange","blur","ngModel"],["matInput","","placeholder","What does this prompt do?","rows","3","required","",3,"ngModelChange","ngModel"],[1,"commands-section"],[1,"section-header"],["mat-icon-button","","type","button","title","Add command",3,"click"],[1,"commands-list"],[1,"command-item"],[1,"source-section"],[1,"source-display"],[1,"webhook-section"],[1,"webhook-url-section"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"command-field"],["matInput","","placeholder","Enter command with placeholders like \\{\\{key\\}\\}","rows","2",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove command",1,"remove-btn",3,"click","disabled"],[1,"source-options"],[1,"source-option"],["type","radio","name","source","value","local",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","source","value","project",3,"ngModelChange","ngModel"],[1,"hint"],[1,"source-badge"],[1,"checkbox-label"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"webhook-url-header"],[1,"webhook-icon"],[1,"webhook-url-content"],[1,"url-text"],["mat-raised-button","","color","accent","type","button",3,"click"]],template:function(e,t){e&1&&(n(0,"h2",0),a(1),o(),n(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),a(6,"Name"),o(),n(7,"input",3),y("ngModelChange",function(m){return v(t.name,m)||(t.name=m),m}),d("blur",function(){return t.normalizeName()}),o(),n(8,"mat-hint"),a(9,"A descriptive name (spaces and punctuation will be replaced with hyphens), will be used as command name"),o()(),n(10,"mat-form-field",2)(11,"mat-label"),a(12,"Description"),o(),n(13,"textarea",4),y("ngModelChange",function(m){return v(t.description,m)||(t.description=m),m}),o(),n(14,"mat-hint"),a(15,"Explain the purpose of this prompt, helps for searchability"),o()(),n(16,"div",5)(17,"div",6)(18,"h3"),a(19,"Prompts"),o(),n(20,"button",7),d("click",function(){return t.addCommand()}),n(21,"mat-icon"),a(22,"add"),o()()(),n(23,"div",8),H(24,Re,10,3,"div",9,q),o()(),h(26,ze,26,6,"div",10),h(27,Ue,10,6,"div",11),h(28,Ne,7,1,"div",12),h(29,je,16,1,"div",13),h(30,qe,5,1,"div",14),o()(),n(31,"mat-dialog-actions",15)(32,"button",16),d("click",function(){return t.cancel()}),a(33,"Cancel"),o(),n(34,"button",17),d("click",function(){return t.save()}),a(35),o()()),e&2&&(c(),M(t.isEditMode?"Edit Prompt":"Create Prompt"),c(6),x("ngModel",t.name),c(6),x("ngModel",t.description),c(11),Y(t.commands),c(2),b(t.isEditMode?-1:26),c(),b(t.isEditMode?27:-1),c(),b(t.isAdmin?28:-1),c(),b(t.isEditMode&&t.webhookEnabled&&t.isAdmin?29:-1),c(),b(t.errorMessage?30:-1),c(2),C("disabled",t.isSaving),c(2),C("disabled",t.isSaving),c(),O(" ",t.isSaving?"Saving...":"Save"," "))},dependencies:[ee,B,Pe,Me,xe,W,ve,V,se,ie,ae,re,I,ce,D,we,ye,Ce,he,be,fe,A,L,le],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:500px}@media(max-width:768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.commands-section[_ngcontent-%COMP%] .commands-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .command-field[_ngcontent-%COMP%]{flex:1}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{margin-top:8px}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.webhook-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{width:18px;height:18px;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.95rem}.webhook-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.85rem;color:var(--color-text-secondary)}.webhook-url-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.75rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] .webhook-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;margin-bottom:.5rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] .url-text[_ngcontent-%COMP%]{flex:1;margin:0;padding:.75rem;background:var(--color-bg);border:1px solid var(--color-border);border-radius:4px;font-family:monospace;font-size:.85rem;word-break:break-all;color:var(--color-text)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap;display:flex;align-items:center;gap:.5rem}.webhook-url-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 1rem;font-size:1rem;font-weight:600}.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.75rem}@media(max-width:768px){.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-section[_ngcontent-%COMP%] .source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.thread-lifetime-disabled[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:#2196f30d;border:1px solid rgba(33,150,243,.2);border-radius:8px;margin-bottom:1rem}.thread-lifetime-disabled[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#2196f3cc;font-size:1.25rem;width:1.25rem;height:1.25rem;margin-top:2px}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;flex:1}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:.95rem;color:var(--color-text)}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{display:block;margin-top:.25rem;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-display[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-display[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1rem;font-weight:600}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500;margin-bottom:.5rem}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.1rem}.source-display[_ngcontent-%COMP%] .source-badge.badge-local[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-display[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.source-display[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}"]})};var He=()=>[],Ye=s=>({id:s});function Ge(s,i){if(s&1&&(n(0,"div",6),a(1),o()),s&2){let e=l();c(),M(e.errorMessage())}}function Ke(s,i){if(s&1){let e=f();n(0,"ds-entity-card",8),d("selected",function(r){g(e);let m=l();return u(m.onEdit(r))}),G(1,9),n(2,"button",10),d("click",function(r){return r.stopPropagation()}),n(3,"mat-icon"),a(4,"more_vert"),o()(),K(),o()}if(s&2){let e=i.$implicit;l();let t=N(11);C("id",e.id)("name",e.name)("description",e.description)("badges",e.badges??J(6,He)),c(2),C("matMenuTriggerFor",t)("matMenuTriggerData",Q(7,Ye,e.id))}}function Je(s,i){if(s&1){let e=f();n(0,"button",11),d("click",function(){g(e);let r=l().id,m=l();return u(m.onToggleWebhook(r))}),n(1,"mat-icon"),a(2),o(),a(3),o()}if(s&2){let e=l().id,t=l();c(2),M(t.isWebhookEnabled(e)?"link_off":"link"),c(),O(" ",t.isWebhookEnabled(e)?"Disable webhook":"Enable webhook"," ")}}function Qe(s,i){if(s&1){let e=f();n(0,"button",11),d("click",function(){let r=g(e).id,m=l();return u(m.onEdit(r))}),n(1,"mat-icon"),a(2,"edit"),o(),a(3," Edit "),o(),h(4,Je,4,2,"button",12),n(5,"button",13),d("click",function(){let r=g(e).id,m=l();return u(m.onDelete(r))}),n(6,"mat-icon"),a(7,"delete"),o(),a(8," Delete "),o()}if(s&2){let e=l();c(4),b(e.isAdmin()?4:-1)}}var Te="system",De=class s{promptApi=_(R);configApi=_(z);location=_($);dialog=_(oe);prompts=P([]);isLoading=P(!1);errorMessage=P(null);showOnlyMine=P(!0);isAdmin=P(!1);currentUsername=P("");promptItems=Z(()=>{let i=this.prompts(),e=this.currentUsername(),r=this.showOnlyMine()&&e?i.filter(p=>this.isMyPrompt(p)):i,E=[...new Set(r.map(p=>p.createdBy))].sort((p,w)=>p===e&&w!==e?-1:w===e&&p!==e||p===Te?1:w===Te?-1:p.localeCompare(w)),j=[];for(let p of E){let w=p===e?`${p} (you)`:p;for(let S of r.filter(Ie=>Ie.createdBy===p))j.push({id:S.id,name:S.name,description:S.description,badges:this.buildBadges(S),groupKey:p,groupLabel:w})}return j});ngOnInit(){this.configApi.getUserConfig().subscribe({next:i=>{this.isAdmin.set(i.groups?.includes("CODAY_ADMIN")??!1),this.currentUsername.set(i.username??"")},error:()=>this.isAdmin.set(!1)}),this.loadPrompts()}loadPrompts(){this.isLoading.set(!0),this.promptApi.listPrompts().subscribe({next:i=>{this.prompts.set(i.filter(e=>!e.id.startsWith("builtin"))),this.isLoading.set(!1)},error:i=>{this.errorMessage.set(i?.error?.error??"Failed to load prompts"),this.isLoading.set(!1)}})}onBack(){this.location.back()}onCreate(){this.dialog.open(k,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadPrompts()})}onEdit(i){this.promptApi.getPrompt(i).subscribe({next:e=>{this.dialog.open(k,{width:"700px",maxHeight:"90vh",data:{mode:"edit",prompt:e}}).afterClosed().subscribe(r=>{r&&this.loadPrompts()})},error:e=>this.errorMessage.set(e?.error?.error??"Failed to load prompt")})}onDelete(i){confirm("Are you sure you want to delete this prompt?")&&this.promptApi.deletePrompt(i).subscribe({next:()=>this.loadPrompts(),error:e=>this.errorMessage.set(e?.error?.error??"Failed to delete prompt")})}onToggleWebhook(i){let e=this.prompts().find(r=>r.id===i);if(!e)return;(e.webhookEnabled?this.promptApi.disableWebhook(i):this.promptApi.enableWebhook(i)).subscribe({next:()=>this.loadPrompts(),error:r=>this.errorMessage.set(r?.error?.error??"Failed to toggle webhook")})}isWebhookEnabled(i){return this.prompts().find(e=>e.id===i)?.webhookEnabled??!1}isMyPrompt(i){let e=t=>t.replace(/[.\s]+/g,"_").toLowerCase();return e(i.createdBy)===e(this.currentUsername())}buildBadges(i){let e=[];return i.source==="local"?e.push({label:"local",variant:"info"}):e.push({label:"project",variant:"success"}),i.webhookEnabled&&e.push({label:"webhook",variant:"warning"}),e}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=F({type:s,selectors:[["app-prompt-list"]],decls:13,vars:5,consts:[["promptCard",""],["cardMenu","matMenu"],[1,"prompt-list-page"],["title","Prompts","cardMinWidth","320px","contentMaxWidth","1400px","searchPlaceholder","Filter prompts\u2026","emptyMessage","No prompts found.",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","mat-icon-button","","title","Back",3,"click"],["toolbar-extras","","color","primary",1,"prompt-list__mine-toggle",3,"ngModelChange","ngModel"],[1,"prompt-list__error"],["matMenuContent",""],[3,"selected","id","name","description","badges"],["dsCardActions",""],["mat-icon-button","",3,"click","matMenuTriggerFor","matMenuTriggerData"],["mat-menu-item","",3,"click"],["mat-menu-item",""],["mat-menu-item","",1,"prompt-list__delete-item",3,"click"]],template:function(e,t){if(e&1&&(n(0,"div",2)(1,"ds-entity-list",3),d("createRequested",function(){return t.onCreate()}),n(2,"button",4),d("click",function(){return t.onBack()}),n(3,"mat-icon"),a(4,"chevron_left"),o()(),n(5,"mat-slide-toggle",5),d("ngModelChange",function(m){return t.showOnlyMine.set(m)}),a(6," Mine "),o()(),h(7,Ge,2,1,"div",6),o(),U(8,Ke,5,9,"ng-template",null,0,X),n(10,"mat-menu",null,1),U(12,Qe,9,1,"ng-template",7),o()),e&2){let r=N(9);c(),C("items",t.promptItems())("showCreate",!0)("itemTemplate",r),c(4),C("ngModel",t.showOnlyMine()),c(2),b(t.errorMessage()?7:-1)}},dependencies:[Fe,Se,Ee,I,D,A,L,ke,Oe,_e,ge,de,pe,ue,B,W,V],styles:["[_nghost-%COMP%]{display:block;width:100%;min-height:100vh;background:var(--color-bg);overflow-y:auto}.prompt-list__mine-toggle[_ngcontent-%COMP%]{flex-shrink:0;font-size:.875rem}.prompt-list__delete-item[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.prompt-list__delete-item[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:inherit}.prompt-list__error[_ngcontent-%COMP%]{margin:1rem auto;max-width:900px;padding:.75rem 1rem;background:#dc262614;border:1px solid rgba(220,38,38,.25);border-radius:8px;color:var(--color-error, #ff3b30);font-size:.875rem}"]})};export{De as PromptListComponent};
|
|
1
|
+
import{b as me,c as le}from"./chunk-2PWIGCN2.js";import{a as R}from"./chunk-XIV35L24.js";import{a as Oe,b as ke,c as z}from"./chunk-UAVOIVZW.js";import{a as Me,b as Pe,g as xe,h as ve,i as ye,j as we}from"./chunk-J6NBYNRX.js";import{a as de,b as pe,c as ge,d as ue,e as _e,x as Ee,y as Se,z as Fe}from"./chunk-TTHFWEW7.js";import"./chunk-OO2H5F7U.js";import{a as te,b as ne,d as oe,e as ie,f as re,g as ae,h as se}from"./chunk-BTOJ27OO.js";import"./chunk-SPV5SLNS.js";import"./chunk-VMYKE4ZC.js";import{a as L,b as A}from"./chunk-AS2L77JV.js";import{C as fe,E as B,b as he,c as be,g as W,m as V,p as Ce}from"./chunk-7OGOI6WM.js";import"./chunk-JVZA4C5U.js";import{O as D,Q as ce,S as I}from"./chunk-G5RWG2GK.js";import{$b as y,Bb as f,Db as d,Fb as l,Hc as $,Ka as c,Pb as N,Pc as ee,Rb as T,Tb as a,Ub as M,Vb as O,Wa as F,Zb as x,_b as v,ab as U,ca as _,cc as J,dc as Q,ga as g,ha as u,jc as X,lb as h,mb as b,mc as Z,nb as q,pb as H,qb as Y,rb as C,sb as n,ta as P,tb as o,yb as G,zb as K}from"./chunk-CHEXA6RY.js";function Re(s,i){if(s&1){let e=f();n(0,"div",9)(1,"mat-form-field",18)(2,"mat-label"),a(3),o(),n(4,"textarea",19),y("ngModelChange",function(r){let m=g(e).$index,E=l();return v(E.commands[m],r)||(E.commands[m]=r),u(r)}),o(),n(5,"mat-hint"),a(6,"Use placeholder for dynamic values"),o()(),n(7,"button",20),d("click",function(){let r=g(e).$index,m=l();return u(m.removeCommand(r))}),n(8,"mat-icon"),a(9,"delete"),o()()()}if(s&2){let e=i.$index,t=l();c(3),O("Prompt ",e+1),c(),x("ngModel",t.commands[e]),c(3),C("disabled",t.commands.length===1)}}function ze(s,i){if(s&1){let e=f();n(0,"div",10)(1,"h3"),a(2,"Save to"),o(),n(3,"div",21)(4,"label",22)(5,"input",23),y("ngModelChange",function(r){g(e);let m=l();return v(m.source,r)||(m.source=r),u(r)}),o(),n(6,"div",24)(7,"div",25)(8,"span",26),a(9,"\u{1F464}"),o(),n(10,"span",27),a(11,"Local"),o()(),n(12,"p",28),a(13,"Personal prompt in ~/.coday/... (not committed)"),o()()(),n(14,"label",22)(15,"input",29),y("ngModelChange",function(r){g(e);let m=l();return v(m.source,r)||(m.source=r),u(r)}),o(),n(16,"div",24)(17,"div",25)(18,"span",26),a(19,"\u{1F4E6}"),o(),n(20,"span",27),a(21,"Project"),o()(),n(22,"p",28),a(23,"Shared prompt in ./prompts/ (committable)"),o()()()(),n(24,"p",30),a(25,"Storage location is permanent and cannot be changed after creation"),o()()}if(s&2){let e=l();c(4),T("selected",e.source==="local"),c(),x("ngModel",e.source),c(9),T("selected",e.source==="project"),c(),x("ngModel",e.source)}}function Ue(s,i){if(s&1&&(n(0,"div",11)(1,"h3"),a(2,"Storage Location"),o(),n(3,"div",31)(4,"span",26),a(5),o(),n(6,"span",27),a(7),o()(),n(8,"p",30),a(9,"Cannot be changed after creation"),o()()),s&2){let e=l();c(3),T("badge-local",e.source==="local")("badge-project",e.source==="project"),c(2),M(e.source==="local"?"\u{1F464}":"\u{1F4E6}"),c(2),M(e.source==="local"?"Local":"Project")}}function Ne(s,i){if(s&1){let e=f();n(0,"div",12)(1,"label",32)(2,"input",33),y("ngModelChange",function(r){g(e);let m=l();return v(m.webhookEnabled,r)||(m.webhookEnabled=r),u(r)}),o(),n(3,"span"),a(4,"Enable webhook"),o()(),n(5,"p",30),a(6,"Enable webhook to trigger this prompt via HTTP POST"),o()()}if(s&2){let e=l();c(2),x("ngModel",e.webhookEnabled)}}function je(s,i){if(s&1){let e=f();n(0,"div",13)(1,"div",34)(2,"mat-icon",35),a(3,"link"),o(),n(4,"h4"),a(5,"Webhook URL"),o()(),n(6,"div",36)(7,"p",37),a(8),o(),n(9,"button",38),d("click",function(){g(e);let r=l();return u(r.copyWebhookUrl())}),n(10,"mat-icon"),a(11,"content_copy"),o(),n(12,"span"),a(13,"Copy URL"),o()()(),n(14,"p",30),a(15,"Use this URL to trigger the prompt via HTTP POST"),o()()}if(s&2){let e=l();c(8),M(e.getWebhookUrl())}}function qe(s,i){if(s&1&&(n(0,"div",14)(1,"mat-icon"),a(2,"error"),o(),n(3,"span"),a(4),o()()),s&2){let e=l();c(4),M(e.errorMessage)}}var k=class s{promptApi=_(R);dialogRef=_(te);configApi=_(z);snackBar=_(me);name="";description="";commands=[""];webhookEnabled=!1;threadLifetime="";source="local";isSaving=!1;errorMessage="";isAdmin=!1;isEditMode=!1;promptId="";data=_(ne);constructor(){this.isEditMode=this.data.mode==="edit"}ngOnInit(){this.configApi.getUserConfig().subscribe({next:i=>{this.isAdmin=i.groups?.includes("CODAY_ADMIN")??!1},error:i=>{console.error("[PROMPT_FORM] Error loading user config:",i),this.isAdmin=!1}}),this.isEditMode&&this.data.prompt&&(this.promptId=this.data.prompt.id,this.name=this.data.prompt.name,this.description=this.data.prompt.description,this.commands=[...this.data.prompt.commands],this.webhookEnabled=this.data.prompt.webhookEnabled,this.source=this.data.prompt.source)}addCommand(){this.commands.push("")}removeCommand(i){this.commands.length>1&&this.commands.splice(i,1)}trackByIndex(i){return i}normalizeName(){this.name=this.name.replace(/[\s_.,;:!?()[\]{}]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase()}validateForm(){return this.name.trim()?this.description.trim()?this.commands.filter(e=>e.trim()).length===0?(this.errorMessage="At least one command is required",!1):!0:(this.errorMessage="Description is required",!1):(this.errorMessage="Name is required",!1)}save(){if(this.errorMessage="",!this.validateForm())return;let i=this.commands.filter(e=>e.trim());if(this.isSaving=!0,this.isEditMode&&this.data.prompt){let e={name:this.name.trim(),description:this.description.trim(),commands:i,webhookEnabled:this.webhookEnabled};this.promptApi.updatePrompt(this.data.prompt.id,e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:t=>{console.error("Error updating prompt:",t),this.errorMessage=t?.error?.error||t?.message||"Failed to update prompt",this.isSaving=!1}})}else{let e={name:this.name.trim(),description:this.description.trim(),commands:i,webhookEnabled:this.webhookEnabled,source:this.source};this.promptApi.createPrompt(e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:t=>{console.error("Error creating prompt:",t),this.errorMessage=t?.error?.error||t?.message||"Failed to create prompt",this.isSaving=!1}})}}cancel(){this.dialogRef.close(!1)}getWebhookUrl(){return`${window.location.origin}/api/webhooks/${this.promptId}/execute`}copyWebhookUrl(){if(!this.webhookEnabled){this.snackBar.open("Webhook is not enabled","Close",{duration:3e3});return}if(!this.promptId){this.snackBar.open("Prompt must be saved before getting webhook URL","Close",{duration:3e3});return}let i=this.getWebhookUrl();navigator.clipboard.writeText(i).then(()=>{this.snackBar.open("Webhook URL copied to clipboard!","Close",{duration:3e3})}).catch(e=>{console.error("Failed to copy webhook URL:",e),this.snackBar.open("Failed to copy URL","Close",{duration:3e3})})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=F({type:s,selectors:[["app-prompt-form"]],decls:36,vars:11,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-prompt","required","",3,"ngModelChange","blur","ngModel"],["matInput","","placeholder","What does this prompt do?","rows","3","required","",3,"ngModelChange","ngModel"],[1,"commands-section"],[1,"section-header"],["mat-icon-button","","type","button","title","Add command",3,"click"],[1,"commands-list"],[1,"command-item"],[1,"source-section"],[1,"source-display"],[1,"webhook-section"],[1,"webhook-url-section"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"command-field"],["matInput","","placeholder","Enter command with placeholders like \\{\\{key\\}\\}","rows","2",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove command",1,"remove-btn",3,"click","disabled"],[1,"source-options"],[1,"source-option"],["type","radio","name","source","value","local",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","source","value","project",3,"ngModelChange","ngModel"],[1,"hint"],[1,"source-badge"],[1,"checkbox-label"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"webhook-url-header"],[1,"webhook-icon"],[1,"webhook-url-content"],[1,"url-text"],["mat-raised-button","","color","accent","type","button",3,"click"]],template:function(e,t){e&1&&(n(0,"h2",0),a(1),o(),n(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),a(6,"Name"),o(),n(7,"input",3),y("ngModelChange",function(m){return v(t.name,m)||(t.name=m),m}),d("blur",function(){return t.normalizeName()}),o(),n(8,"mat-hint"),a(9,"A descriptive name (spaces and punctuation will be replaced with hyphens), will be used as command name"),o()(),n(10,"mat-form-field",2)(11,"mat-label"),a(12,"Description"),o(),n(13,"textarea",4),y("ngModelChange",function(m){return v(t.description,m)||(t.description=m),m}),o(),n(14,"mat-hint"),a(15,"Explain the purpose of this prompt, helps for searchability"),o()(),n(16,"div",5)(17,"div",6)(18,"h3"),a(19,"Prompts"),o(),n(20,"button",7),d("click",function(){return t.addCommand()}),n(21,"mat-icon"),a(22,"add"),o()()(),n(23,"div",8),H(24,Re,10,3,"div",9,q),o()(),h(26,ze,26,6,"div",10),h(27,Ue,10,6,"div",11),h(28,Ne,7,1,"div",12),h(29,je,16,1,"div",13),h(30,qe,5,1,"div",14),o()(),n(31,"mat-dialog-actions",15)(32,"button",16),d("click",function(){return t.cancel()}),a(33,"Cancel"),o(),n(34,"button",17),d("click",function(){return t.save()}),a(35),o()()),e&2&&(c(),M(t.isEditMode?"Edit Prompt":"Create Prompt"),c(6),x("ngModel",t.name),c(6),x("ngModel",t.description),c(11),Y(t.commands),c(2),b(t.isEditMode?-1:26),c(),b(t.isEditMode?27:-1),c(),b(t.isAdmin?28:-1),c(),b(t.isEditMode&&t.webhookEnabled&&t.isAdmin?29:-1),c(),b(t.errorMessage?30:-1),c(2),C("disabled",t.isSaving),c(2),C("disabled",t.isSaving),c(),O(" ",t.isSaving?"Saving...":"Save"," "))},dependencies:[ee,B,be,he,Ce,W,fe,V,se,ie,ae,re,I,ce,D,we,ye,xe,Me,Pe,ve,A,L,le],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:500px}@media(max-width:768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.commands-section[_ngcontent-%COMP%] .commands-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .command-field[_ngcontent-%COMP%]{flex:1}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{margin-top:8px}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.webhook-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{width:18px;height:18px;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.95rem}.webhook-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.85rem;color:var(--color-text-secondary)}.webhook-url-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.75rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] .webhook-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;margin-bottom:.5rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] .url-text[_ngcontent-%COMP%]{flex:1;margin:0;padding:.75rem;background:var(--color-bg);border:1px solid var(--color-border);border-radius:4px;font-family:monospace;font-size:.85rem;word-break:break-all;color:var(--color-text)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap;display:flex;align-items:center;gap:.5rem}.webhook-url-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 1rem;font-size:1rem;font-weight:600}.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.75rem}@media(max-width:768px){.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-section[_ngcontent-%COMP%] .source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.thread-lifetime-disabled[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:#2196f30d;border:1px solid rgba(33,150,243,.2);border-radius:8px;margin-bottom:1rem}.thread-lifetime-disabled[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#2196f3cc;font-size:1.25rem;width:1.25rem;height:1.25rem;margin-top:2px}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;flex:1}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:.95rem;color:var(--color-text)}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{display:block;margin-top:.25rem;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-display[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-display[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1rem;font-weight:600}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500;margin-bottom:.5rem}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.1rem}.source-display[_ngcontent-%COMP%] .source-badge.badge-local[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-display[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.source-display[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}"]})};var He=()=>[],Ye=s=>({id:s});function Ge(s,i){if(s&1&&(n(0,"div",6),a(1),o()),s&2){let e=l();c(),M(e.errorMessage())}}function Ke(s,i){if(s&1){let e=f();n(0,"ds-entity-card",8),d("selected",function(r){g(e);let m=l();return u(m.onEdit(r))}),G(1,9),n(2,"button",10),d("click",function(r){return r.stopPropagation()}),n(3,"mat-icon"),a(4,"more_vert"),o()(),K(),o()}if(s&2){let e=i.$implicit;l();let t=N(11);C("id",e.id)("name",e.name)("description",e.description)("badges",e.badges??J(6,He)),c(2),C("matMenuTriggerFor",t)("matMenuTriggerData",Q(7,Ye,e.id))}}function Je(s,i){if(s&1){let e=f();n(0,"button",11),d("click",function(){g(e);let r=l().id,m=l();return u(m.onToggleWebhook(r))}),n(1,"mat-icon"),a(2),o(),a(3),o()}if(s&2){let e=l().id,t=l();c(2),M(t.isWebhookEnabled(e)?"link_off":"link"),c(),O(" ",t.isWebhookEnabled(e)?"Disable webhook":"Enable webhook"," ")}}function Qe(s,i){if(s&1){let e=f();n(0,"button",11),d("click",function(){let r=g(e).id,m=l();return u(m.onEdit(r))}),n(1,"mat-icon"),a(2,"edit"),o(),a(3," Edit "),o(),h(4,Je,4,2,"button",12),n(5,"button",13),d("click",function(){let r=g(e).id,m=l();return u(m.onDelete(r))}),n(6,"mat-icon"),a(7,"delete"),o(),a(8," Delete "),o()}if(s&2){let e=l();c(4),b(e.isAdmin()?4:-1)}}var Te="system",De=class s{promptApi=_(R);configApi=_(z);location=_($);dialog=_(oe);prompts=P([]);isLoading=P(!1);errorMessage=P(null);showOnlyMine=P(!0);isAdmin=P(!1);currentUsername=P("");promptItems=Z(()=>{let i=this.prompts(),e=this.currentUsername(),r=this.showOnlyMine()&&e?i.filter(p=>this.isMyPrompt(p)):i,E=[...new Set(r.map(p=>p.createdBy))].sort((p,w)=>p===e&&w!==e?-1:w===e&&p!==e||p===Te?1:w===Te?-1:p.localeCompare(w)),j=[];for(let p of E){let w=p===e?`${p} (you)`:p;for(let S of r.filter(Ie=>Ie.createdBy===p))j.push({id:S.id,name:S.name,description:S.description,badges:this.buildBadges(S),groupKey:p,groupLabel:w})}return j});ngOnInit(){this.configApi.getUserConfig().subscribe({next:i=>{this.isAdmin.set(i.groups?.includes("CODAY_ADMIN")??!1),this.currentUsername.set(i.username??"")},error:()=>this.isAdmin.set(!1)}),this.loadPrompts()}loadPrompts(){this.isLoading.set(!0),this.promptApi.listPrompts().subscribe({next:i=>{this.prompts.set(i.filter(e=>!e.id.startsWith("builtin"))),this.isLoading.set(!1)},error:i=>{this.errorMessage.set(i?.error?.error??"Failed to load prompts"),this.isLoading.set(!1)}})}onBack(){this.location.back()}onCreate(){this.dialog.open(k,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadPrompts()})}onEdit(i){this.promptApi.getPrompt(i).subscribe({next:e=>{this.dialog.open(k,{width:"700px",maxHeight:"90vh",data:{mode:"edit",prompt:e}}).afterClosed().subscribe(r=>{r&&this.loadPrompts()})},error:e=>this.errorMessage.set(e?.error?.error??"Failed to load prompt")})}onDelete(i){confirm("Are you sure you want to delete this prompt?")&&this.promptApi.deletePrompt(i).subscribe({next:()=>this.loadPrompts(),error:e=>this.errorMessage.set(e?.error?.error??"Failed to delete prompt")})}onToggleWebhook(i){let e=this.prompts().find(r=>r.id===i);if(!e)return;(e.webhookEnabled?this.promptApi.disableWebhook(i):this.promptApi.enableWebhook(i)).subscribe({next:()=>this.loadPrompts(),error:r=>this.errorMessage.set(r?.error?.error??"Failed to toggle webhook")})}isWebhookEnabled(i){return this.prompts().find(e=>e.id===i)?.webhookEnabled??!1}isMyPrompt(i){let e=t=>t.replace(/[.\s]+/g,"_").toLowerCase();return e(i.createdBy)===e(this.currentUsername())}buildBadges(i){let e=[];return i.source==="local"?e.push({label:"local",variant:"info"}):e.push({label:"project",variant:"success"}),i.webhookEnabled&&e.push({label:"webhook",variant:"warning"}),e}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=F({type:s,selectors:[["app-prompt-list"]],decls:13,vars:5,consts:[["promptCard",""],["cardMenu","matMenu"],[1,"prompt-list-page"],["title","Prompts","cardMinWidth","320px","contentMaxWidth","1400px","searchPlaceholder","Filter prompts\u2026","emptyMessage","No prompts found.",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","mat-icon-button","","title","Back",3,"click"],["toolbar-extras","","color","primary",1,"prompt-list__mine-toggle",3,"ngModelChange","ngModel"],[1,"prompt-list__error"],["matMenuContent",""],[3,"selected","id","name","description","badges"],["dsCardActions",""],["mat-icon-button","",3,"click","matMenuTriggerFor","matMenuTriggerData"],["mat-menu-item","",3,"click"],["mat-menu-item",""],["mat-menu-item","",1,"prompt-list__delete-item",3,"click"]],template:function(e,t){if(e&1&&(n(0,"div",2)(1,"ds-entity-list",3),d("createRequested",function(){return t.onCreate()}),n(2,"button",4),d("click",function(){return t.onBack()}),n(3,"mat-icon"),a(4,"chevron_left"),o()(),n(5,"mat-slide-toggle",5),d("ngModelChange",function(m){return t.showOnlyMine.set(m)}),a(6," Mine "),o()(),h(7,Ge,2,1,"div",6),o(),U(8,Ke,5,9,"ng-template",null,0,X),n(10,"mat-menu",null,1),U(12,Qe,9,1,"ng-template",7),o()),e&2){let r=N(9);c(),C("items",t.promptItems())("showCreate",!0)("itemTemplate",r),c(4),C("ngModel",t.showOnlyMine()),c(2),b(t.errorMessage()?7:-1)}},dependencies:[Fe,Se,Ee,I,D,A,L,ke,Oe,_e,ge,de,pe,ue,B,W,V],styles:["[_nghost-%COMP%]{display:block;width:100%;min-height:100vh;background:var(--color-bg);overflow-y:auto}.prompt-list__mine-toggle[_ngcontent-%COMP%]{flex-shrink:0;font-size:.875rem}.prompt-list__delete-item[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.prompt-list__delete-item[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:inherit}.prompt-list__error[_ngcontent-%COMP%]{margin:1rem auto;max-width:900px;padding:.75rem 1rem;background:#dc262614;border:1px solid rgba(220,38,38,.25);border-radius:8px;color:var(--color-error, #ff3b30);font-size:.875rem}"]})};export{De as PromptListComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as U,b as F}from"./chunk-Y42FQQZC.js";import{j}from"./chunk-VCUQMGKI.js";import{c as $}from"./chunk-6XX7GME4.js";import{s as B,z}from"./chunk-VNO76B3S.js";import{a as N}from"./chunk-VMYKE4ZC.js";import{Bb as v,Db as p,Fb as r,Ka as P,Lc as O,Pb as A,S as T,Tb as u,Wa as w,ab as L,ca as f,cc as R,fc as E,ga as c,gc as D,ha as m,i as S,ia as _,ja as h,jc as G,lb as k,ma as I,mb as y,pc as l,qc as H,rb as C,sb as s,t as V,ta as x,tb as a,ub as g,yb as q,zb as b}from"./chunk-CHEXA6RY.js";var Q=()=>[];function X(d,n){if(d&1){let t=v();q(0,1),s(1,"span",2),u(2,"Delete?"),a(),s(3,"ds-icon-button",3),p("action",function(){c(t);let e=r();return m(e.onDeleteConfirmed())}),a(),s(4,"ds-icon-button",4),p("action",function(){c(t);let e=r();return m(e.onDeleteCancelled())}),a(),b()}}function Y(d,n){if(d&1){let t=v();q(0,1),s(1,"button",5),p("click",function(){c(t);let e=r();return m(e.onIntegrations())}),_(),s(2,"svg",6),g(3,"path",7)(4,"path",8),a(),u(5," Integrations "),a(),h(),s(6,"button",5),p("click",function(){c(t);let e=r();return m(e.onAiProviders())}),_(),s(7,"svg",6),g(8,"rect",9)(9,"rect",10)(10,"path",11),a(),u(11," AI Providers "),a(),h(),s(12,"button",5),p("click",function(){c(t);let e=r();return m(e.onAiModels())}),_(),s(13,"svg",6),g(14,"path",12),a(),u(15," AI Models "),a(),h(),s(16,"button",5),p("click",function(){c(t);let e=r();return m(e.onAgentConfigs())}),_(),s(17,"svg",6),g(18,"path",13)(19,"circle",14)(20,"circle",15),a(),u(21," Agent Configs "),a(),h(),s(22,"button",5),p("click",function(){c(t);let e=r();return m(e.onPrompts())}),_(),s(23,"svg",6),g(24,"path",16)(25,"path",17)(26,"path",18),a(),u(27," Prompts "),a(),h(),s(28,"button",5),p("click",function(){c(t);let e=r();return m(e.onScheduledPrompts())}),_(),s(29,"svg",6),g(30,"circle",19)(31,"path",20),a(),u(32," Schedulers "),a(),h(),s(33,"button",5),p("click",function(){c(t);let e=r();return m(e.onUserGroups())}),_(),s(34,"svg",6),g(35,"circle",21)(36,"path",22)(37,"path",23),a(),u(38," User Groups "),a(),h(),s(39,"button",5),p("click",function(){c(t);let e=r();return m(e.onAuthSettings())}),_(),s(40,"svg",6),g(41,"circle",24)(42,"path",25)(43,"path",26),a(),u(44," Auth Settings "),a(),h(),s(45,"button",5),p("click",function(){c(t);let e=r();return m(e.onMembers())}),_(),s(46,"svg",6),g(47,"circle",24)(48,"path",27),a(),u(49," Members "),a(),b()}}var M=class d{namespace=H.required();selected=l();editRequested=l();integrationsRequested=l();aiProvidersRequested=l();aiModelsRequested=l();agentConfigsRequested=l();promptsRequested=l();scheduledPromptsRequested=l();userGroupsRequested=l();membersRequested=l();authSettingsRequested=l();deleteRequested=l();pendingDelete=x(!1);menuItems=[{key:"edit",label:"Edit namespace"},{key:"separator",label:"",variant:"separator"},{key:"delete",label:"Delete namespace",variant:"danger"}];onSelect(){this.selected.emit(this.namespace())}onIntegrations(){this.integrationsRequested.emit(this.namespace())}onAiProviders(){this.aiProvidersRequested.emit(this.namespace())}onAiModels(){this.aiModelsRequested.emit(this.namespace())}onAgentConfigs(){this.agentConfigsRequested.emit(this.namespace())}onPrompts(){this.promptsRequested.emit(this.namespace())}onScheduledPrompts(){this.scheduledPromptsRequested.emit(this.namespace())}onUserGroups(){this.userGroupsRequested.emit(this.namespace())}onMembers(){this.membersRequested.emit(this.namespace())}onAuthSettings(){this.authSettingsRequested.emit(this.namespace())}onMenuAction(n){switch(n){case"edit":this.editRequested.emit(this.namespace());break;case"delete":this.pendingDelete.set(!0);break}}onDeleteConfirmed(){this.pendingDelete.set(!1),this.deleteRequested.emit(this.namespace())}onDeleteCancelled(){this.pendingDelete.set(!1)}static \u0275fac=function(t){return new(t||d)};static \u0275cmp=w({type:d,selectors:[["agentos-namespace-item"]],inputs:{namespace:[1,"namespace"]},outputs:{selected:"selected",editRequested:"editRequested",integrationsRequested:"integrationsRequested",aiProvidersRequested:"aiProvidersRequested",aiModelsRequested:"aiModelsRequested",agentConfigsRequested:"agentConfigsRequested",promptsRequested:"promptsRequested",scheduledPromptsRequested:"scheduledPromptsRequested",userGroupsRequested:"userGroupsRequested",membersRequested:"membersRequested",authSettingsRequested:"authSettingsRequested",deleteRequested:"deleteRequested"},decls:3,vars:4,consts:[[3,"nameClicked","menuAction","name","menuItems"],["agentosCardChips",""],[1,"ns-confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel",3,"action"],["type","button",1,"ac-chip",3,"click"],["width","13","height","13","viewBox","0 0 24 24","fill","none","aria-hidden","true"],["d","M8 2v4M16 2v4M6 8h12v3a6 6 0 01-12 0V8z","stroke","currentColor","stroke-width","1.6","stroke-linecap","round","stroke-linejoin","round"],["d","M12 17v3","stroke","currentColor","stroke-width","1.6","stroke-linecap","round"],["x","7","y","7","width","10","height","10","rx","1.5","stroke","currentColor","stroke-width","1.6"],["x","10","y","10","width","4","height","4","rx","0.5","stroke","currentColor","stroke-width","1.4"],["d","M9 2v3M12 2v3M15 2v3M9 19v3M12 19v3M15 19v3M2 9h3M2 12h3M2 15h3M19 9h3M19 12h3M19 15h3","stroke","currentColor","stroke-width","1.4","stroke-linecap","round"],["d","M12 3l1.8 5.6L19 10l-5.2 1.6L12 17l-1.8-5.4L5 10l5.2-1.4L12 3z","stroke","currentColor","stroke-width","1.5","stroke-linejoin","round"],["d","M4 7h9M17 7h3M4 17h3M11 17h9","stroke","currentColor","stroke-width","1.6","stroke-linecap","round"],["cx","13","cy","7","r","2.2","stroke","currentColor","stroke-width","1.6"],["cx","8","cy","17","r","2.2","stroke","currentColor","stroke-width","1.6"],["d","M7 3h7l4 4v14a1 1 0 01-1 1H7a1 1 0 01-1-1V4a1 1 0 011-1z","stroke","currentColor","stroke-width","1.6","stroke-linejoin","round"],["d","M14 3v4h4","stroke","currentColor","stroke-width","1.6","stroke-linejoin","round"],["d","M9 13h6M9 17h6","stroke","currentColor","stroke-width","1.4","stroke-linecap","round"],["cx","12","cy","12","r","9","stroke","currentColor","stroke-width","1.6"],["d","M12 7v5l3 3","stroke","currentColor","stroke-width","1.6","stroke-linecap","round","stroke-linejoin","round"],["cx","9","cy","8","r","3","stroke","currentColor","stroke-width","1.6"],["d","M3 20a6 6 0 0112 0","stroke","currentColor","stroke-width","1.6","stroke-linecap","round"],["d","M16 5.5a3 3 0 010 5.5M18 20a6 6 0 00-3-5.2","stroke","currentColor","stroke-width","1.5","stroke-linecap","round"],["cx","12","cy","8","r","3.2","stroke","currentColor","stroke-width","1.6"],["d","M5 20c0-3.3 3.1-6 7-6s7 2.7 7 6","stroke","currentColor","stroke-width","1.6","stroke-linecap","round"],["d","M17 13.5l1 1.5-.8.5.8 1.5H16l-.3-1-.7.2-.7-.2-.3 1h-2l.8-1.5-.8-.5 1-1.5","stroke","currentColor","stroke-width","1.3","stroke-linejoin","round"],["d","M5 20a7 7 0 0114 0","stroke","currentColor","stroke-width","1.6","stroke-linecap","round"]],template:function(t,i){t&1&&(s(0,"agentos-action-card",0),p("nameClicked",function(){return i.onSelect()})("menuAction",function(o){return i.onMenuAction(o)}),k(1,X,5,0,"ng-container",1)(2,Y,50,0,"ng-container",1),a()),t&2&&(C("name",i.namespace().name)("menuItems",i.pendingDelete()?R(3,Q):i.menuItems),P(),y(i.pendingDelete()?1:2))},dependencies:[F,U,B],styles:[".ns-confirm-label[_ngcontent-%COMP%]{font:500 12px Inter,sans-serif;color:var(--color-error, #a5140a);white-space:nowrap;align-self:center}"],changeDetection:0})};var Z=()=>[];function ee(d,n){if(d&1){let t=v();s(0,"agentos-namespace-item",3),p("selected",function(e){c(t);let o=r(2);return m(o.navigateToHome(e.id??""))})("editRequested",function(e){c(t);let o=r(2);return m(o.navigateToEdit(e))})("deleteRequested",function(e){c(t);let o=r(2);return m(o.deleteNamespace(e))})("integrationsRequested",function(e){c(t);let o=r(2);return m(o.openIntegrations(e))})("aiProvidersRequested",function(e){c(t);let o=r(2);return m(o.openAiProviders(e))})("aiModelsRequested",function(e){c(t);let o=r(2);return m(o.openAiModels(e))})("agentConfigsRequested",function(e){c(t);let o=r(2);return m(o.openAgentConfigs(e))})("promptsRequested",function(e){c(t);let o=r(2);return m(o.openPrompts(e))})("scheduledPromptsRequested",function(e){c(t);let o=r(2);return m(o.openScheduledPrompts(e))})("userGroupsRequested",function(e){c(t);let o=r(2);return m(o.openUserGroups(e))})("membersRequested",function(e){c(t);let o=r(2);return m(o.openMembers(e))})("authSettingsRequested",function(e){c(t);let o=r(2);return m(o.openAuthSettings(e))}),a()}d&2&&C("namespace",n)}function te(d,n){if(d&1&&k(0,ee,1,1,"agentos-namespace-item",2),d&2){let t,i=n.$implicit,e=r();y((t=e.namespacesById().get(i.id))?0:-1,t)}}var W=class d{router=f($);namespaceController=f(j);destroyRef=f(I);refresh$=new S(void 0);namespaces$=this.refresh$.pipe(T(()=>this.namespaceController.listAllNamespace()));namespaceItems$=this.namespaces$.pipe(V(n=>n.map(t=>({id:t.id??"",name:t.name,description:t.description,badges:t.defaultAgentName?[{label:t.defaultAgentName,variant:"info"}]:void 0}))));namespacesById=x(new Map);constructor(){this.namespaces$.pipe(N(this.destroyRef)).subscribe(n=>{this.namespacesById.set(new Map(n.map(t=>[t.id??"",t])))})}navigateToHome(n){this.router.navigate(["/agentos/home"],{queryParams:{ns:n}})}navigateToCreate(){this.router.navigate(["/agentos/namespaces/new"])}navigateToEdit(n){this.router.navigate(["/agentos/namespaces",n.id??"","edit"])}openIntegrations(n){this.router.navigate(["/agentos",n.id,"integrations"])}openAiProviders(n){this.router.navigate(["/agentos",n.id,"ai-providers"])}openAiModels(n){this.router.navigate(["/agentos",n.id,"ai-models"])}openAgentConfigs(n){this.router.navigate(["/agentos",n.id,"agent-configs"])}openPrompts(n){this.router.navigate(["/agentos",n.id,"prompts"])}openScheduledPrompts(n){this.router.navigate(["/agentos",n.id,"scheduled-prompts"])}openUserGroups(n){this.router.navigate(["/agentos",n.id,"user-groups"])}openAuthSettings(n){this.router.navigate(["/agentos",n.id,"auth-settings"])}openMembers(n){this.router.navigate(["/agentos",n.id,"members"])}deleteNamespace(n){this.namespaceController.deleteNamespace(n.id??"").pipe(N(this.destroyRef)).subscribe(()=>this.refresh$.next())}static \u0275fac=function(t){return new(t||d)};static \u0275cmp=w({type:d,selectors:[["agentos-namespace-list"]],decls:4,vars:6,consts:[["namespaceItemTpl",""],["title","Namespaces","emptyMessage","No namespaces yet. Create one to get started.","cardMinWidth","400px",3,"itemSelected","createRequested","items","showCreate","itemTemplate"],[3,"namespace"],[3,"selected","editRequested","deleteRequested","integrationsRequested","aiProvidersRequested","aiModelsRequested","agentConfigsRequested","promptsRequested","scheduledPromptsRequested","userGroupsRequested","membersRequested","authSettingsRequested","namespace"]],template:function(t,i){if(t&1&&(s(0,"ds-entity-list",1),E(1,"async"),p("itemSelected",function(o){return i.navigateToHome(o)})("createRequested",function(){return i.navigateToCreate()}),a(),L(2,te,1,1,"ng-template",null,0,G)),t&2){let e=A(3);C("items",D(1,3,i.namespaceItems$)??R(5,Z))("showCreate",!0)("itemTemplate",e)}},dependencies:[M,z,O],styles:["[_nghost-%COMP%] .ac, [_nghost-%COMP%] .ac--clickable{background:var(--color-bg);border:1px solid var(--color-divider);box-shadow:none}[_nghost-%COMP%] .ac:hover, [_nghost-%COMP%] .ac--clickable:hover{border-color:var(--color-accent);box-shadow:none}[_nghost-%COMP%] .ac__mark{width:28px;height:28px;border-radius:0;background:var(--color-accent-900);color:var(--color-accent-100);font-family:var(--font-heading);font-weight:600;font-size:13px}[_nghost-%COMP%] .ac__name{font-family:var(--font-heading);font-weight:600;font-size:16.5px;line-height:1.15;overflow-wrap:anywhere;color:var(--color-text)}[_nghost-%COMP%] .ac__chips{gap:6px;padding:0 16px 16px}[_nghost-%COMP%] .ac-chip{border:1px solid var(--color-divider);color:var(--color-neutral-600);background:transparent;font-family:var(--font-heading);font-weight:600;font-size:11px;letter-spacing:.08em;text-transform:uppercase}[_nghost-%COMP%] .ac-chip:hover{background:var(--color-accent-100);border-color:var(--color-accent-300);color:var(--color-accent-700)}"],changeDetection:0})};export{M as a,W as b};
|
|
1
|
+
import{a as U,b as F}from"./chunk-FL2HNVMC.js";import{j}from"./chunk-VCUQMGKI.js";import{c as $}from"./chunk-6XX7GME4.js";import{s as B,z}from"./chunk-TTHFWEW7.js";import{a as N}from"./chunk-VMYKE4ZC.js";import{Bb as v,Db as p,Fb as r,Ka as P,Lc as O,Pb as A,S as T,Tb as u,Wa as w,ab as L,ca as f,cc as R,fc as E,ga as c,gc as D,ha as m,i as S,ia as _,ja as h,jc as G,lb as k,ma as I,mb as y,pc as l,qc as H,rb as C,sb as s,t as V,ta as x,tb as a,ub as g,yb as q,zb as b}from"./chunk-CHEXA6RY.js";var Q=()=>[];function X(d,n){if(d&1){let t=v();q(0,1),s(1,"span",2),u(2,"Delete?"),a(),s(3,"ds-icon-button",3),p("action",function(){c(t);let e=r();return m(e.onDeleteConfirmed())}),a(),s(4,"ds-icon-button",4),p("action",function(){c(t);let e=r();return m(e.onDeleteCancelled())}),a(),b()}}function Y(d,n){if(d&1){let t=v();q(0,1),s(1,"button",5),p("click",function(){c(t);let e=r();return m(e.onIntegrations())}),_(),s(2,"svg",6),g(3,"path",7)(4,"path",8),a(),u(5," Integrations "),a(),h(),s(6,"button",5),p("click",function(){c(t);let e=r();return m(e.onAiProviders())}),_(),s(7,"svg",6),g(8,"rect",9)(9,"rect",10)(10,"path",11),a(),u(11," AI Providers "),a(),h(),s(12,"button",5),p("click",function(){c(t);let e=r();return m(e.onAiModels())}),_(),s(13,"svg",6),g(14,"path",12),a(),u(15," AI Models "),a(),h(),s(16,"button",5),p("click",function(){c(t);let e=r();return m(e.onAgentConfigs())}),_(),s(17,"svg",6),g(18,"path",13)(19,"circle",14)(20,"circle",15),a(),u(21," Agent Configs "),a(),h(),s(22,"button",5),p("click",function(){c(t);let e=r();return m(e.onPrompts())}),_(),s(23,"svg",6),g(24,"path",16)(25,"path",17)(26,"path",18),a(),u(27," Prompts "),a(),h(),s(28,"button",5),p("click",function(){c(t);let e=r();return m(e.onScheduledPrompts())}),_(),s(29,"svg",6),g(30,"circle",19)(31,"path",20),a(),u(32," Schedulers "),a(),h(),s(33,"button",5),p("click",function(){c(t);let e=r();return m(e.onUserGroups())}),_(),s(34,"svg",6),g(35,"circle",21)(36,"path",22)(37,"path",23),a(),u(38," User Groups "),a(),h(),s(39,"button",5),p("click",function(){c(t);let e=r();return m(e.onAuthSettings())}),_(),s(40,"svg",6),g(41,"circle",24)(42,"path",25)(43,"path",26),a(),u(44," Auth Settings "),a(),h(),s(45,"button",5),p("click",function(){c(t);let e=r();return m(e.onMembers())}),_(),s(46,"svg",6),g(47,"circle",24)(48,"path",27),a(),u(49," Members "),a(),b()}}var M=class d{namespace=H.required();selected=l();editRequested=l();integrationsRequested=l();aiProvidersRequested=l();aiModelsRequested=l();agentConfigsRequested=l();promptsRequested=l();scheduledPromptsRequested=l();userGroupsRequested=l();membersRequested=l();authSettingsRequested=l();deleteRequested=l();pendingDelete=x(!1);menuItems=[{key:"edit",label:"Edit namespace"},{key:"separator",label:"",variant:"separator"},{key:"delete",label:"Delete namespace",variant:"danger"}];onSelect(){this.selected.emit(this.namespace())}onIntegrations(){this.integrationsRequested.emit(this.namespace())}onAiProviders(){this.aiProvidersRequested.emit(this.namespace())}onAiModels(){this.aiModelsRequested.emit(this.namespace())}onAgentConfigs(){this.agentConfigsRequested.emit(this.namespace())}onPrompts(){this.promptsRequested.emit(this.namespace())}onScheduledPrompts(){this.scheduledPromptsRequested.emit(this.namespace())}onUserGroups(){this.userGroupsRequested.emit(this.namespace())}onMembers(){this.membersRequested.emit(this.namespace())}onAuthSettings(){this.authSettingsRequested.emit(this.namespace())}onMenuAction(n){switch(n){case"edit":this.editRequested.emit(this.namespace());break;case"delete":this.pendingDelete.set(!0);break}}onDeleteConfirmed(){this.pendingDelete.set(!1),this.deleteRequested.emit(this.namespace())}onDeleteCancelled(){this.pendingDelete.set(!1)}static \u0275fac=function(t){return new(t||d)};static \u0275cmp=w({type:d,selectors:[["agentos-namespace-item"]],inputs:{namespace:[1,"namespace"]},outputs:{selected:"selected",editRequested:"editRequested",integrationsRequested:"integrationsRequested",aiProvidersRequested:"aiProvidersRequested",aiModelsRequested:"aiModelsRequested",agentConfigsRequested:"agentConfigsRequested",promptsRequested:"promptsRequested",scheduledPromptsRequested:"scheduledPromptsRequested",userGroupsRequested:"userGroupsRequested",membersRequested:"membersRequested",authSettingsRequested:"authSettingsRequested",deleteRequested:"deleteRequested"},decls:3,vars:4,consts:[[3,"nameClicked","menuAction","name","menuItems"],["agentosCardChips",""],[1,"ns-confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel",3,"action"],["type","button",1,"ac-chip",3,"click"],["width","13","height","13","viewBox","0 0 24 24","fill","none","aria-hidden","true"],["d","M8 2v4M16 2v4M6 8h12v3a6 6 0 01-12 0V8z","stroke","currentColor","stroke-width","1.6","stroke-linecap","round","stroke-linejoin","round"],["d","M12 17v3","stroke","currentColor","stroke-width","1.6","stroke-linecap","round"],["x","7","y","7","width","10","height","10","rx","1.5","stroke","currentColor","stroke-width","1.6"],["x","10","y","10","width","4","height","4","rx","0.5","stroke","currentColor","stroke-width","1.4"],["d","M9 2v3M12 2v3M15 2v3M9 19v3M12 19v3M15 19v3M2 9h3M2 12h3M2 15h3M19 9h3M19 12h3M19 15h3","stroke","currentColor","stroke-width","1.4","stroke-linecap","round"],["d","M12 3l1.8 5.6L19 10l-5.2 1.6L12 17l-1.8-5.4L5 10l5.2-1.4L12 3z","stroke","currentColor","stroke-width","1.5","stroke-linejoin","round"],["d","M4 7h9M17 7h3M4 17h3M11 17h9","stroke","currentColor","stroke-width","1.6","stroke-linecap","round"],["cx","13","cy","7","r","2.2","stroke","currentColor","stroke-width","1.6"],["cx","8","cy","17","r","2.2","stroke","currentColor","stroke-width","1.6"],["d","M7 3h7l4 4v14a1 1 0 01-1 1H7a1 1 0 01-1-1V4a1 1 0 011-1z","stroke","currentColor","stroke-width","1.6","stroke-linejoin","round"],["d","M14 3v4h4","stroke","currentColor","stroke-width","1.6","stroke-linejoin","round"],["d","M9 13h6M9 17h6","stroke","currentColor","stroke-width","1.4","stroke-linecap","round"],["cx","12","cy","12","r","9","stroke","currentColor","stroke-width","1.6"],["d","M12 7v5l3 3","stroke","currentColor","stroke-width","1.6","stroke-linecap","round","stroke-linejoin","round"],["cx","9","cy","8","r","3","stroke","currentColor","stroke-width","1.6"],["d","M3 20a6 6 0 0112 0","stroke","currentColor","stroke-width","1.6","stroke-linecap","round"],["d","M16 5.5a3 3 0 010 5.5M18 20a6 6 0 00-3-5.2","stroke","currentColor","stroke-width","1.5","stroke-linecap","round"],["cx","12","cy","8","r","3.2","stroke","currentColor","stroke-width","1.6"],["d","M5 20c0-3.3 3.1-6 7-6s7 2.7 7 6","stroke","currentColor","stroke-width","1.6","stroke-linecap","round"],["d","M17 13.5l1 1.5-.8.5.8 1.5H16l-.3-1-.7.2-.7-.2-.3 1h-2l.8-1.5-.8-.5 1-1.5","stroke","currentColor","stroke-width","1.3","stroke-linejoin","round"],["d","M5 20a7 7 0 0114 0","stroke","currentColor","stroke-width","1.6","stroke-linecap","round"]],template:function(t,i){t&1&&(s(0,"agentos-action-card",0),p("nameClicked",function(){return i.onSelect()})("menuAction",function(o){return i.onMenuAction(o)}),k(1,X,5,0,"ng-container",1)(2,Y,50,0,"ng-container",1),a()),t&2&&(C("name",i.namespace().name)("menuItems",i.pendingDelete()?R(3,Q):i.menuItems),P(),y(i.pendingDelete()?1:2))},dependencies:[F,U,B],styles:[".ns-confirm-label[_ngcontent-%COMP%]{font:500 12px Inter,sans-serif;color:var(--color-error, #a5140a);white-space:nowrap;align-self:center}"],changeDetection:0})};var Z=()=>[];function ee(d,n){if(d&1){let t=v();s(0,"agentos-namespace-item",3),p("selected",function(e){c(t);let o=r(2);return m(o.navigateToHome(e.id??""))})("editRequested",function(e){c(t);let o=r(2);return m(o.navigateToEdit(e))})("deleteRequested",function(e){c(t);let o=r(2);return m(o.deleteNamespace(e))})("integrationsRequested",function(e){c(t);let o=r(2);return m(o.openIntegrations(e))})("aiProvidersRequested",function(e){c(t);let o=r(2);return m(o.openAiProviders(e))})("aiModelsRequested",function(e){c(t);let o=r(2);return m(o.openAiModels(e))})("agentConfigsRequested",function(e){c(t);let o=r(2);return m(o.openAgentConfigs(e))})("promptsRequested",function(e){c(t);let o=r(2);return m(o.openPrompts(e))})("scheduledPromptsRequested",function(e){c(t);let o=r(2);return m(o.openScheduledPrompts(e))})("userGroupsRequested",function(e){c(t);let o=r(2);return m(o.openUserGroups(e))})("membersRequested",function(e){c(t);let o=r(2);return m(o.openMembers(e))})("authSettingsRequested",function(e){c(t);let o=r(2);return m(o.openAuthSettings(e))}),a()}d&2&&C("namespace",n)}function te(d,n){if(d&1&&k(0,ee,1,1,"agentos-namespace-item",2),d&2){let t,i=n.$implicit,e=r();y((t=e.namespacesById().get(i.id))?0:-1,t)}}var W=class d{router=f($);namespaceController=f(j);destroyRef=f(I);refresh$=new S(void 0);namespaces$=this.refresh$.pipe(T(()=>this.namespaceController.listAllNamespace()));namespaceItems$=this.namespaces$.pipe(V(n=>n.map(t=>({id:t.id??"",name:t.name,description:t.description,badges:t.defaultAgentName?[{label:t.defaultAgentName,variant:"info"}]:void 0}))));namespacesById=x(new Map);constructor(){this.namespaces$.pipe(N(this.destroyRef)).subscribe(n=>{this.namespacesById.set(new Map(n.map(t=>[t.id??"",t])))})}navigateToHome(n){this.router.navigate(["/agentos/home"],{queryParams:{ns:n}})}navigateToCreate(){this.router.navigate(["/agentos/namespaces/new"])}navigateToEdit(n){this.router.navigate(["/agentos/namespaces",n.id??"","edit"])}openIntegrations(n){this.router.navigate(["/agentos",n.id,"integrations"])}openAiProviders(n){this.router.navigate(["/agentos",n.id,"ai-providers"])}openAiModels(n){this.router.navigate(["/agentos",n.id,"ai-models"])}openAgentConfigs(n){this.router.navigate(["/agentos",n.id,"agent-configs"])}openPrompts(n){this.router.navigate(["/agentos",n.id,"prompts"])}openScheduledPrompts(n){this.router.navigate(["/agentos",n.id,"scheduled-prompts"])}openUserGroups(n){this.router.navigate(["/agentos",n.id,"user-groups"])}openAuthSettings(n){this.router.navigate(["/agentos",n.id,"auth-settings"])}openMembers(n){this.router.navigate(["/agentos",n.id,"members"])}deleteNamespace(n){this.namespaceController.deleteNamespace(n.id??"").pipe(N(this.destroyRef)).subscribe(()=>this.refresh$.next())}static \u0275fac=function(t){return new(t||d)};static \u0275cmp=w({type:d,selectors:[["agentos-namespace-list"]],decls:4,vars:6,consts:[["namespaceItemTpl",""],["title","Namespaces","emptyMessage","No namespaces yet. Create one to get started.","cardMinWidth","400px",3,"itemSelected","createRequested","items","showCreate","itemTemplate"],[3,"namespace"],[3,"selected","editRequested","deleteRequested","integrationsRequested","aiProvidersRequested","aiModelsRequested","agentConfigsRequested","promptsRequested","scheduledPromptsRequested","userGroupsRequested","membersRequested","authSettingsRequested","namespace"]],template:function(t,i){if(t&1&&(s(0,"ds-entity-list",1),E(1,"async"),p("itemSelected",function(o){return i.navigateToHome(o)})("createRequested",function(){return i.navigateToCreate()}),a(),L(2,te,1,1,"ng-template",null,0,G)),t&2){let e=A(3);C("items",D(1,3,i.namespaceItems$)??R(5,Z))("showCreate",!0)("itemTemplate",e)}},dependencies:[M,z,O],styles:["[_nghost-%COMP%] .ac, [_nghost-%COMP%] .ac--clickable{background:var(--color-bg);border:1px solid var(--color-divider);box-shadow:none}[_nghost-%COMP%] .ac:hover, [_nghost-%COMP%] .ac--clickable:hover{border-color:var(--color-accent);box-shadow:none}[_nghost-%COMP%] .ac__mark{width:28px;height:28px;border-radius:0;background:var(--color-accent-900);color:var(--color-accent-100);font-family:var(--font-heading);font-weight:600;font-size:13px}[_nghost-%COMP%] .ac__name{font-family:var(--font-heading);font-weight:600;font-size:16.5px;line-height:1.15;overflow-wrap:anywhere;color:var(--color-text)}[_nghost-%COMP%] .ac__chips{gap:6px;padding:0 16px 16px}[_nghost-%COMP%] .ac-chip{border:1px solid var(--color-divider);color:var(--color-neutral-600);background:transparent;font-family:var(--font-heading);font-weight:600;font-size:11px;letter-spacing:.08em;text-transform:uppercase}[_nghost-%COMP%] .ac-chip:hover{background:var(--color-accent-100);border-color:var(--color-accent-300);color:var(--color-accent-700)}"],changeDetection:0})};export{M as a,W as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-7HQ3TFIP.js";import"./chunk-XZIT26QS.js";import"./chunk-VCUQMGKI.js";import"./chunk-6XX7GME4.js";import"./chunk-TTHFWEW7.js";import"./chunk-OO2H5F7U.js";import"./chunk-SPV5SLNS.js";import"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import"./chunk-CHEXA6RY.js";export{a as UserGroupFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a}from"./chunk-
|
|
1
|
+
import{b as a}from"./chunk-4KA7TIB4.js";import"./chunk-FL2HNVMC.js";import"./chunk-VCUQMGKI.js";import"./chunk-6XX7GME4.js";import"./chunk-TTHFWEW7.js";import"./chunk-OO2H5F7U.js";import"./chunk-SPV5SLNS.js";import"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import"./chunk-CHEXA6RY.js";export{a as NamespaceListComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as y}from"./chunk-
|
|
1
|
+
import{b as y}from"./chunk-FL2HNVMC.js";import{c as k}from"./chunk-6XX7GME4.js";import"./chunk-TTHFWEW7.js";import"./chunk-OO2H5F7U.js";import"./chunk-SPV5SLNS.js";import"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import{Bb as f,Db as u,Fb as _,Ka as d,Tb as o,Wa as p,ca as r,ga as m,ha as c,pb as l,qb as g,rb as h,sb as t,tb as i}from"./chunk-CHEXA6RY.js";var M=(a,n)=>n.key;function b(a,n){if(a&1){let e=f();t(0,"agentos-action-card",6),u("nameClicked",function(){let v=m(e).$implicit,x=_();return c(x.navigateTo(v.path))}),i()}if(a&2){let e=n.$implicit;h("name",e.name)("mark",e.mark)("markIsEmoji",!0)("description",e.description)("clickable",!0)}}var C=class a{router=r(k);sections=[{key:"users",mark:"\u{1F464}",name:"Users & Groups",description:"Manage platform users, their admin rights, and namespace user groups.",path:"/agentos/admin/users"},{key:"agents",mark:"\u{1F916}",name:"Platform agents",description:"Manage agent configs shared across all namespaces.",path:"/agentos/admin/agent-configs"},{key:"integrations",mark:"\u{1F517}",name:"Platform integrations",description:"Manage integration configs shared across all namespaces.",path:"/agentos/admin/integration-configs"},{key:"authSetting",mark:"\u{1F512}",name:"Auth settings",description:"Manage auth settings shared across all namespaces.",path:"/agentos/admin/auth-settings"},{key:"ai-providers",mark:"\u{1F9E0}",name:"Platform AI providers",description:"Manage AI provider configs shared across all namespaces.",path:"/agentos/admin/ai-providers"},{key:"ai-models",mark:"\u2728",name:"Platform AI models",description:"Manage AI model configs shared across all namespaces.",path:"/agentos/admin/ai-models"},{key:"prompts",mark:"\u{1F4C4}",name:"Platform prompts",description:"Manage prompts shared across all namespaces.",path:"/agentos/admin/prompts"},{key:"case-definitions",mark:"\u23F0",name:"Platform case definitions",description:"Manage scheduled case definitions shared across all namespaces.",path:"/agentos/admin/case-definitions"}];navigateTo(n){this.router.navigate([n])}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=p({type:a,selectors:[["agentos-admin-home"]],decls:9,vars:0,consts:[[1,"admin-home"],[1,"admin-home__header"],[1,"admin-home__title"],[1,"admin-home__subtitle"],[1,"admin-home__sections"],[3,"name","mark","markIsEmoji","description","clickable"],[3,"nameClicked","name","mark","markIsEmoji","description","clickable"]],template:function(e,s){e&1&&(t(0,"div",0)(1,"header",1)(2,"h1",2),o(3,"Administration"),i(),t(4,"p",3),o(5,"Platform-level settings, visible to super-admins only."),i()(),t(6,"nav",4),l(7,b,1,5,"agentos-action-card",5,M),i()()),e&2&&(d(7),g(s.sections))},dependencies:[y],styles:[".admin-home[_ngcontent-%COMP%]{max-width:860px;margin:0 auto;padding:2rem 1rem;display:flex;flex-direction:column;gap:2rem}.admin-home__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.admin-home__title[_ngcontent-%COMP%]{margin:0;font-size:28px;font-weight:700;color:var(--color-text);font-family:var(--font-heading)}.admin-home__subtitle[_ngcontent-%COMP%]{margin:0;font-size:13px;color:var(--color-neutral-600)}.admin-home__sections[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}"],changeDetection:0})};export{C as AdminHomeComponent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as Se,f as we,h as xe}from"./chunk-GTCP3EYX.js";import{g as Re,h as Le,j as Pe,k as Ve,l as We,m as B,n as Be}from"./chunk-VNO76B3S.js";import{e as Ee,f as Fe}from"./chunk-E6T6QLQT.js";import{c as ve,d as be,l as Ce,r as Oe,t as V,u as W,v as Me}from"./chunk-SPV5SLNS.js";import{e as De,f as Ie,k as Ae,w as Te}from"./chunk-7OGOI6WM.js";import{A as ge,E as ye,K as ke,d as pe,r as me,t as ue,u as k,v as _e,x as fe,y as P}from"./chunk-G5RWG2GK.js";import{A as b,B as w,Bb as ae,Db as y,Fb as f,G as z,Gb as re,Hb as T,Ib as ne,Jb as le,Ka as d,Kb as p,Lb as m,Pa as $,Pb as oe,R as x,Rb as E,S as D,Sb as se,T as _,Tb as F,Ub as R,Wa as J,Xa as Z,_ as G,aa as C,ab as ee,bc as ce,ca as l,ga as q,h as v,ha as H,ia as j,jb as M,ka as Q,lb as I,mb as A,oa as O,oc as de,rb as te,sb as s,t as S,ta as Y,tb as h,ub as ie,va as U,xc as he,y as K,ya as X,yc as c,zc as L}from"./chunk-CHEXA6RY.js";var Ye=["trigger"],Ue=["panel"],Xe=[[["mat-select-trigger"]],"*"],$e=["mat-select-trigger","*"];function Je(r,u){if(r&1&&(s(0,"span",4),F(1),h()),r&2){let e=f();d(),R(e.placeholder)}}function Ze(r,u){r&1&&T(0)}function et(r,u){if(r&1&&(s(0,"span",11),F(1),h()),r&2){let e=f(2);d(),R(e.triggerValue)}}function tt(r,u){if(r&1&&(s(0,"span",5),I(1,Ze,1,0)(2,et,2,1,"span",11),h()),r&2){let e=f();d(),A(e.customTrigger?1:2)}}function it(r,u){if(r&1){let e=ae();s(0,"div",12,1),y("keydown",function(i){q(e);let a=f();return H(a._handleKeydown(i))}),T(2,1),h()}if(r&2){let e=f();se(e.panelClass),E("mat-select-panel-animations-enabled",!e._animationsDisabled)("mat-primary",(e._parentFormField==null?null:e._parentFormField.color)==="primary")("mat-accent",(e._parentFormField==null?null:e._parentFormField.color)==="accent")("mat-warn",(e._parentFormField==null?null:e._parentFormField.color)==="warn")("mat-undefined",!(e._parentFormField!=null&&e._parentFormField.color)),M("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby())}}var at=new C("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let r=l(Q);return()=>Ce(r)}}),rt=new C("MAT_SELECT_CONFIG"),nt=new C("MatSelectTrigger"),N=class{source;value;constructor(u,e){this.source=u,this.value=e}},Pt=(()=>{class r{_viewportRuler=l(ve);_changeDetectorRef=l(he);_elementRef=l(X);_dir=l(ge,{optional:!0});_idGenerator=l(ue);_renderer=l($);_parentFormField=l(we,{optional:!0});ngControl=l(Ie,{self:!0,optional:!0});_liveAnnouncer=l(me);_defaultOptions=l(rt,{optional:!0});_animationsDisabled=ke();_popoverLocation;_initialized=new v;_cleanupDetach;options;optionGroups;customTrigger;_positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}];_scrollOptionIntoView(e){let t=this.options.toArray()[e];if(t){let i=this.panel.nativeElement,a=Ve(e,this.options,this.optionGroups),n=t._getHostElement();e===0&&a===1?i.scrollTop=0:i.scrollTop=We(n.offsetTop,n.offsetHeight,i.scrollTop,i.offsetHeight)}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0)}_getChangeEvent(e){return new N(this,e)}_scrollStrategyFactory=l(at);_panelOpen=!1;_compareWith=(e,t)=>e===t;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new v;_errorStateTracker;stateChanges=new v;disableAutomaticLabeling=!0;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=!1;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=!1;get disableRipple(){return this._disableRipple()}set disableRipple(e){this._disableRipple.set(e)}_disableRipple=Y(!1);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??!1;get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next()}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(De.required)??!1}set required(e){this._required=e,this.stateChanges.next()}_required;get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e}_multiple=!1;disableOptionCentering=this._defaultOptions?.disableOptionCentering??!1;get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e)}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next()}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??!1;optionSelectionChanges=K(()=>{let e=this.options;return e?e.changes.pipe(x(e),D(()=>b(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(D(()=>this.optionSelectionChanges))});openedChange=new O;_openedStream=this.openedChange.pipe(w(e=>e),S(()=>{}));_closedStream=this.openedChange.pipe(w(e=>!e),S(()=>{}));selectionChange=new O;valueChange=new O;constructor(){let e=l(Ee),t=l(Ae,{optional:!0}),i=l(Te,{optional:!0}),a=l(new de("tabindex"),{optional:!0}),n=l(Oe,{optional:!0});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new Fe(e,this.ngControl,i,t,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=a==null?0:parseInt(a)||0,this._popoverLocation=n?.usePopover===!1?null:"inline",this.id=this.id}ngOnInit(){this._selectionModel=new Be(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(_(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges())})}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(_(this._destroy)).subscribe(e=>{e.added.forEach(t=>t.select()),e.removed.forEach(t=>t.deselect())}),this.options.changes.pipe(x(null),_(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),t=this.ngControl;if(e!==this._triggerAriaLabelledBy){let i=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?i.setAttribute("aria-labelledby",e):i.removeAttribute("aria-labelledby")}t&&(this._previousControl!==t.control&&(this._previousControl!==void 0&&t.disabled!==null&&t.disabled!==this.disabled&&(this.disabled=t.disabled),this._previousControl=t.control),this.updateErrorState())}ngOnChanges(e){(e.disabled||e.userAriaDescribedBy)&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval),e.panelClass&&this.panelClass instanceof Set&&(this.panelClass=Array.from(this.panelClass))}ngOnDestroy(){this._cleanupDetach?.(),this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete(),this._clearFromModal()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._applyModalPanelOwnership(),this._panelOpen=!0,this._overlayDir.positionChange.pipe(z(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!0)))}_trackedModal=null;_applyModalPanelOwnership(){let e=this._elementRef.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let t=`${this.id}-panel`;this._trackedModal&&P(this._trackedModal,"aria-owns",t),fe(e,"aria-owns",t),this._trackedModal=e}_clearFromModal(){if(!this._trackedModal)return;let e=`${this.id}-panel`;P(this._trackedModal,"aria-owns",e),this._trackedModal=null}close(){this._panelOpen&&(this._panelOpen=!1,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!1)))}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{t(),clearTimeout(i),this._cleanupDetach=void 0};let e=this.panel.nativeElement,t=this._renderer.listen(e,"animationend",a=>{a.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay())}),i=setTimeout(()=>{this._cleanupDetach?.(),this._detachOverlay()},200);e.classList.add("mat-select-panel-exit")}_detachOverlay(){this._overlayDir.detachOverlay(),this._changeDetectorRef.markForCheck()}writeValue(e){this._assignValue(e)}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){let e=this._selectionModel.selected.map(t=>t.viewValue);return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState()}_isRtl(){return this._dir?this._dir.value==="rtl":!1}_handleKeydown(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e))}_handleClosedKeydown(e){let t=e.keyCode,i=t===40||t===38||t===37||t===39,a=t===13||t===32,n=this._keyManager;if(!n.isTyping()&&a&&!k(e)||(this.multiple||e.altKey)&&i)e.preventDefault(),this.open();else if(!this.multiple){let g=this.selected;n.onKeydown(e);let o=this.selected;o&&g!==o&&this._liveAnnouncer.announce(o.viewValue,1e4)}}_handleOpenKeydown(e){let t=this._keyManager,i=e.keyCode,a=i===40||i===38,n=t.isTyping();if(a&&e.altKey)e.preventDefault(),this.close();else if(!n&&(i===13||i===32)&&t.activeItem&&!k(e))e.preventDefault(),t.activeItem._selectViaInteraction();else if(!n&&this._multiple&&i===65&&e.ctrlKey){e.preventDefault();let g=this.options.some(o=>!o.disabled&&!o.selected);this.options.forEach(o=>{o.disabled||(g?o.select():o.deselect())})}else{let g=t.activeItemIndex;t.onKeydown(e),this._multiple&&a&&e.shiftKey&&t.activeItem&&t.activeItemIndex!==g&&t.activeItem._selectViaInteraction()}}_handleOverlayKeydown(e){e.keyCode===27&&!k(e)&&(e.preventDefault(),this.close())}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next()})}_setSelectionByValue(e){if(this.options.forEach(t=>t.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)Array.isArray(e),e.forEach(t=>this._selectOptionByValue(t)),this._sortValues();else{let t=this._selectOptionByValue(e);t?this._keyManager.updateActiveItem(t):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectOptionByValue(e){let t=this.options.find(i=>{if(this._selectionModel.isSelected(i))return!1;try{return(i.value!=null||this.canSelectNullableOptions)&&this._compareWith(i.value,e)}catch(a){return!1}});return t&&this._selectionModel.select(t),t}_assignValue(e){return e!==this._value||this._multiple&&Array.isArray(e)?(this.options&&this._setSelectionByValue(e),this._value=e,!0):!1}_skipPredicate=e=>this.panelOpen?!1:e.disabled;_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof V?e.elementRef:e||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck()}_initKeyManager(){this._keyManager=new _e(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){let e=b(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(_(e)).subscribe(t=>{this._onSelect(t.source,t.isUserInput),t.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),b(...this.options.map(t=>t._stateChanges)).pipe(_(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next()})}_onSelect(e,t){let i=this._selectionModel.isSelected(e);!this.canSelectNullableOptions&&e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(i!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),t&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),t&&this.focus())),i!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((t,i)=>this.sortComparator?this.sortComparator(t,i,e):e.indexOf(t)-e.indexOf(i)),this.stateChanges.next()}}_propagateChanges(e){let t;this.multiple?t=this.selected.map(i=>i.value):t=this.selected?this.selected.value:e,this._value=t,this.valueChange.emit(t),this._onChange(t),this.selectionChange.emit(this._getChangeEvent(t)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let t=0;t<this.options.length;t++)if(!this.options.get(t).disabled){e=t;break}this._keyManager.setActiveItem(e)}else this._keyManager.setActiveItem(this._selectionModel.selected[0])}_canOpen(){return!this._panelOpen&&!this.disabled&&this.options?.length>0&&!!this._overlayDir}focus(e){this._elementRef.nativeElement.focus(e)}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||null,t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||"";return this.ariaLabelledby&&(e+=" "+this.ariaLabelledby),e||(e=this._valueId),e}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){let t=this._elementRef.nativeElement;e.length?t.setAttribute("aria-describedby",e.join(" ")):t.removeAttribute("aria-describedby")}onContainerClick(e){let t=pe(e);t&&(t.tagName==="MAT-OPTION"||t.classList.contains("cdk-overlay-backdrop")||t.closest(".mat-mdc-select-panel"))||(this.focus(),this.open())}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=J({type:r,selectors:[["mat-select"]],contentQueries:function(t,i,a){if(t&1&&ne(a,nt,5)(a,Pe,5)(a,Le,5),t&2){let n;p(n=m())&&(i.customTrigger=n.first),p(n=m())&&(i.options=n),p(n=m())&&(i.optionGroups=n)}},viewQuery:function(t,i){if(t&1&&le(Ye,5)(Ue,5)(W,5),t&2){let a;p(a=m())&&(i.trigger=a.first),p(a=m())&&(i.panel=a.first),p(a=m())&&(i._overlayDir=a.first)}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:21,hostBindings:function(t,i){t&1&&y("keydown",function(n){return i._handleKeydown(n)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),t&2&&(M("id",i.id)("tabindex",i.disabled?-1:i.tabIndex)("aria-controls",i.panelOpen?i.id+"-panel":null)("aria-expanded",i.panelOpen)("aria-label",i.ariaLabel||null)("aria-required",i.required.toString())("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-activedescendant",i._getAriaActiveDescendant()),E("mat-mdc-select-disabled",i.disabled)("mat-mdc-select-invalid",i.errorState)("mat-mdc-select-required",i.required)("mat-mdc-select-empty",i.empty)("mat-mdc-select-multiple",i.multiple)("mat-select-open",i.panelOpen))},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",c],disableRipple:[2,"disableRipple","disableRipple",c],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:L(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",c],placeholder:"placeholder",required:[2,"required","required",c],multiple:[2,"multiple","multiple",c],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",c],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",L],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",c]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[ce([{provide:Se,useExisting:r},{provide:Re,useExisting:r}]),U],ngContentSelectors:$e,decls:11,vars:10,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"detach","backdropClick","overlayKeydown","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth","cdkConnectedOverlayFlexibleDimensions","cdkConnectedOverlayUsePopover"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",1,"mat-mdc-select-panel","mdc-menu-surface","mdc-menu-surface--open",3,"keydown"]],template:function(t,i){if(t&1&&(re(Xe),s(0,"div",2,0),y("click",function(){return i.open()}),s(3,"div",3),I(4,Je,2,1,"span",4)(5,tt,3,1,"span",5),h(),s(6,"div",6)(7,"div",7),j(),s(8,"svg",8),ie(9,"path",9),h()()()(),ee(10,it,3,16,"ng-template",10),y("detach",function(){return i.close()})("backdropClick",function(){return i.close()})("overlayKeydown",function(n){return i._handleOverlayKeydown(n)})),t&2){let a=oe(1);d(3),M("id",i._valueId),d(),A(i.empty?4:5),d(6),te("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",i._preferredOverlayOrigin||a)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayWidth",i._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",!0)("cdkConnectedOverlayUsePopover",i._popoverLocation)}},dependencies:[V,W],styles:[`@keyframes _mat-select-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}@keyframes _mat-select-exit{from{opacity:1}to{opacity:0}}.mat-mdc-select{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-sys-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-sys-body-large-tracking))}div.mat-mdc-select-panel{box-shadow:var(--mat-select-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12))}.mat-mdc-select-disabled{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-disabled .mat-mdc-select-placeholder{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-trigger{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.mat-mdc-select-disabled .mat-mdc-select-trigger{-webkit-user-select:none;user-select:none;cursor:default}.mat-mdc-select-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-mdc-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-mdc-select-arrow-wrapper{height:24px;flex-shrink:0;display:inline-flex;align-items:center}.mat-form-field-appearance-fill .mdc-text-field--no-label .mat-mdc-select-arrow-wrapper{transform:none}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-invalid .mat-mdc-select-arrow,.mat-form-field-invalid:not(.mat-form-field-disabled) .mat-mdc-form-field-infix::after{color:var(--mat-select-invalid-arrow-color, var(--mat-sys-error))}.mat-mdc-select-arrow{width:10px;height:5px;position:relative;color:var(--mat-select-enabled-arrow-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--mat-select-focused-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-disabled .mat-mdc-select-arrow{color:var(--mat-select-disabled-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-select-open .mat-mdc-select-arrow{transform:rotate(180deg)}.mat-form-field-animations-enabled .mat-mdc-select-arrow{transition:transform 80ms linear}.mat-mdc-select-arrow svg{fill:currentColor;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}@media(forced-colors: active){.mat-mdc-select-arrow svg{fill:CanvasText}.mat-mdc-select-disabled .mat-mdc-select-arrow svg{fill:GrayText}}div.mat-mdc-select-panel{width:100%;max-height:275px;outline:0;overflow:auto;padding:8px 0;border-radius:4px;box-sizing:border-box;position:relative;background-color:var(--mat-select-panel-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-select-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-select-panel-above) div.mat-mdc-select-panel{border-top-left-radius:0;border-top-right-radius:0;transform-origin:top center}.mat-mdc-select-panel-above div.mat-mdc-select-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:bottom center}.mat-select-panel-animations-enabled{animation:_mat-select-enter 120ms cubic-bezier(0, 0, 0.2, 1)}.mat-select-panel-animations-enabled.mat-select-panel-exit{animation:_mat-select-exit 100ms linear}.mat-mdc-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);color:var(--mat-select-placeholder-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field:not(.mat-form-field-animations-enabled) .mat-mdc-select-placeholder,._mat-animation-noopable .mat-mdc-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-mdc-select-placeholder{color:rgba(0,0,0,0);-webkit-text-fill-color:rgba(0,0,0,0);transition:none;display:block}.mat-mdc-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mat-mdc-floating-label{max-width:calc(100% - 18px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 24px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-text-field--label-floating .mdc-notched-outline__notch{max-width:calc(100% - 24px)}.mat-mdc-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;visibility:hidden}.mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper{transform:var(--mat-select-arrow-transform, translateY(-8px))}
|
|
2
|
-
`],encapsulation:2,changeDetection:0})}return r})();var Vt=(()=>{class r{static \u0275fac=function(t){return new(t||r)};static \u0275mod=Z({type:r});static \u0275inj=G({imports:[Me,B,ye,be,
|
|
1
|
+
import{e as Ie,f as Ae,h as Te}from"./chunk-J6NBYNRX.js";import{g as Re,h as Le,j as Pe,k as Ve,l as We,m as B,n as Be}from"./chunk-TTHFWEW7.js";import{f as Ee,g as Fe}from"./chunk-OO2H5F7U.js";import{c as ve,d as be,l as Ce,r as Oe,t as V,u as W,v as Me}from"./chunk-SPV5SLNS.js";import{e as Se,f as we,k as xe,w as De}from"./chunk-7OGOI6WM.js";import{A as ge,E as ye,K as ke,d as pe,r as me,t as ue,u as k,v as _e,x as fe,y as P}from"./chunk-G5RWG2GK.js";import{A as b,B as w,Bb as ae,Db as y,Fb as f,G as z,Gb as re,Hb as T,Ib as ne,Jb as le,Ka as d,Kb as p,Lb as m,Pa as $,Pb as oe,R as x,Rb as E,S as D,Sb as se,T as _,Tb as F,Ub as R,Wa as J,Xa as Z,_ as G,aa as C,ab as ee,bc as ce,ca as l,ga as q,h as v,ha as H,ia as j,jb as M,ka as Q,lb as I,mb as A,oa as O,oc as de,rb as te,sb as s,t as S,ta as Y,tb as h,ub as ie,va as U,xc as he,y as K,ya as X,yc as c,zc as L}from"./chunk-CHEXA6RY.js";var Ye=["trigger"],Ue=["panel"],Xe=[[["mat-select-trigger"]],"*"],$e=["mat-select-trigger","*"];function Je(r,u){if(r&1&&(s(0,"span",4),F(1),h()),r&2){let e=f();d(),R(e.placeholder)}}function Ze(r,u){r&1&&T(0)}function et(r,u){if(r&1&&(s(0,"span",11),F(1),h()),r&2){let e=f(2);d(),R(e.triggerValue)}}function tt(r,u){if(r&1&&(s(0,"span",5),I(1,Ze,1,0)(2,et,2,1,"span",11),h()),r&2){let e=f();d(),A(e.customTrigger?1:2)}}function it(r,u){if(r&1){let e=ae();s(0,"div",12,1),y("keydown",function(i){q(e);let a=f();return H(a._handleKeydown(i))}),T(2,1),h()}if(r&2){let e=f();se(e.panelClass),E("mat-select-panel-animations-enabled",!e._animationsDisabled)("mat-primary",(e._parentFormField==null?null:e._parentFormField.color)==="primary")("mat-accent",(e._parentFormField==null?null:e._parentFormField.color)==="accent")("mat-warn",(e._parentFormField==null?null:e._parentFormField.color)==="warn")("mat-undefined",!(e._parentFormField!=null&&e._parentFormField.color)),M("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby())}}var at=new C("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let r=l(Q);return()=>Ce(r)}}),rt=new C("MAT_SELECT_CONFIG"),nt=new C("MatSelectTrigger"),N=class{source;value;constructor(u,e){this.source=u,this.value=e}},Pt=(()=>{class r{_viewportRuler=l(ve);_changeDetectorRef=l(he);_elementRef=l(X);_dir=l(ge,{optional:!0});_idGenerator=l(ue);_renderer=l($);_parentFormField=l(Ae,{optional:!0});ngControl=l(we,{self:!0,optional:!0});_liveAnnouncer=l(me);_defaultOptions=l(rt,{optional:!0});_animationsDisabled=ke();_popoverLocation;_initialized=new v;_cleanupDetach;options;optionGroups;customTrigger;_positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}];_scrollOptionIntoView(e){let t=this.options.toArray()[e];if(t){let i=this.panel.nativeElement,a=Ve(e,this.options,this.optionGroups),n=t._getHostElement();e===0&&a===1?i.scrollTop=0:i.scrollTop=We(n.offsetTop,n.offsetHeight,i.scrollTop,i.offsetHeight)}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0)}_getChangeEvent(e){return new N(this,e)}_scrollStrategyFactory=l(at);_panelOpen=!1;_compareWith=(e,t)=>e===t;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new v;_errorStateTracker;stateChanges=new v;disableAutomaticLabeling=!0;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=!1;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=!1;get disableRipple(){return this._disableRipple()}set disableRipple(e){this._disableRipple.set(e)}_disableRipple=Y(!1);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??!1;get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next()}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(Se.required)??!1}set required(e){this._required=e,this.stateChanges.next()}_required;get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e}_multiple=!1;disableOptionCentering=this._defaultOptions?.disableOptionCentering??!1;get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e)}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next()}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??!1;optionSelectionChanges=K(()=>{let e=this.options;return e?e.changes.pipe(x(e),D(()=>b(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(D(()=>this.optionSelectionChanges))});openedChange=new O;_openedStream=this.openedChange.pipe(w(e=>e),S(()=>{}));_closedStream=this.openedChange.pipe(w(e=>!e),S(()=>{}));selectionChange=new O;valueChange=new O;constructor(){let e=l(Ee),t=l(xe,{optional:!0}),i=l(De,{optional:!0}),a=l(new de("tabindex"),{optional:!0}),n=l(Oe,{optional:!0});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new Fe(e,this.ngControl,i,t,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=a==null?0:parseInt(a)||0,this._popoverLocation=n?.usePopover===!1?null:"inline",this.id=this.id}ngOnInit(){this._selectionModel=new Be(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(_(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges())})}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(_(this._destroy)).subscribe(e=>{e.added.forEach(t=>t.select()),e.removed.forEach(t=>t.deselect())}),this.options.changes.pipe(x(null),_(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),t=this.ngControl;if(e!==this._triggerAriaLabelledBy){let i=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?i.setAttribute("aria-labelledby",e):i.removeAttribute("aria-labelledby")}t&&(this._previousControl!==t.control&&(this._previousControl!==void 0&&t.disabled!==null&&t.disabled!==this.disabled&&(this.disabled=t.disabled),this._previousControl=t.control),this.updateErrorState())}ngOnChanges(e){(e.disabled||e.userAriaDescribedBy)&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval),e.panelClass&&this.panelClass instanceof Set&&(this.panelClass=Array.from(this.panelClass))}ngOnDestroy(){this._cleanupDetach?.(),this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete(),this._clearFromModal()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._applyModalPanelOwnership(),this._panelOpen=!0,this._overlayDir.positionChange.pipe(z(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!0)))}_trackedModal=null;_applyModalPanelOwnership(){let e=this._elementRef.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let t=`${this.id}-panel`;this._trackedModal&&P(this._trackedModal,"aria-owns",t),fe(e,"aria-owns",t),this._trackedModal=e}_clearFromModal(){if(!this._trackedModal)return;let e=`${this.id}-panel`;P(this._trackedModal,"aria-owns",e),this._trackedModal=null}close(){this._panelOpen&&(this._panelOpen=!1,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!1)))}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{t(),clearTimeout(i),this._cleanupDetach=void 0};let e=this.panel.nativeElement,t=this._renderer.listen(e,"animationend",a=>{a.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay())}),i=setTimeout(()=>{this._cleanupDetach?.(),this._detachOverlay()},200);e.classList.add("mat-select-panel-exit")}_detachOverlay(){this._overlayDir.detachOverlay(),this._changeDetectorRef.markForCheck()}writeValue(e){this._assignValue(e)}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){let e=this._selectionModel.selected.map(t=>t.viewValue);return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState()}_isRtl(){return this._dir?this._dir.value==="rtl":!1}_handleKeydown(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e))}_handleClosedKeydown(e){let t=e.keyCode,i=t===40||t===38||t===37||t===39,a=t===13||t===32,n=this._keyManager;if(!n.isTyping()&&a&&!k(e)||(this.multiple||e.altKey)&&i)e.preventDefault(),this.open();else if(!this.multiple){let g=this.selected;n.onKeydown(e);let o=this.selected;o&&g!==o&&this._liveAnnouncer.announce(o.viewValue,1e4)}}_handleOpenKeydown(e){let t=this._keyManager,i=e.keyCode,a=i===40||i===38,n=t.isTyping();if(a&&e.altKey)e.preventDefault(),this.close();else if(!n&&(i===13||i===32)&&t.activeItem&&!k(e))e.preventDefault(),t.activeItem._selectViaInteraction();else if(!n&&this._multiple&&i===65&&e.ctrlKey){e.preventDefault();let g=this.options.some(o=>!o.disabled&&!o.selected);this.options.forEach(o=>{o.disabled||(g?o.select():o.deselect())})}else{let g=t.activeItemIndex;t.onKeydown(e),this._multiple&&a&&e.shiftKey&&t.activeItem&&t.activeItemIndex!==g&&t.activeItem._selectViaInteraction()}}_handleOverlayKeydown(e){e.keyCode===27&&!k(e)&&(e.preventDefault(),this.close())}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next()})}_setSelectionByValue(e){if(this.options.forEach(t=>t.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)Array.isArray(e),e.forEach(t=>this._selectOptionByValue(t)),this._sortValues();else{let t=this._selectOptionByValue(e);t?this._keyManager.updateActiveItem(t):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectOptionByValue(e){let t=this.options.find(i=>{if(this._selectionModel.isSelected(i))return!1;try{return(i.value!=null||this.canSelectNullableOptions)&&this._compareWith(i.value,e)}catch(a){return!1}});return t&&this._selectionModel.select(t),t}_assignValue(e){return e!==this._value||this._multiple&&Array.isArray(e)?(this.options&&this._setSelectionByValue(e),this._value=e,!0):!1}_skipPredicate=e=>this.panelOpen?!1:e.disabled;_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof V?e.elementRef:e||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck()}_initKeyManager(){this._keyManager=new _e(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){let e=b(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(_(e)).subscribe(t=>{this._onSelect(t.source,t.isUserInput),t.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),b(...this.options.map(t=>t._stateChanges)).pipe(_(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next()})}_onSelect(e,t){let i=this._selectionModel.isSelected(e);!this.canSelectNullableOptions&&e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(i!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),t&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),t&&this.focus())),i!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((t,i)=>this.sortComparator?this.sortComparator(t,i,e):e.indexOf(t)-e.indexOf(i)),this.stateChanges.next()}}_propagateChanges(e){let t;this.multiple?t=this.selected.map(i=>i.value):t=this.selected?this.selected.value:e,this._value=t,this.valueChange.emit(t),this._onChange(t),this.selectionChange.emit(this._getChangeEvent(t)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let t=0;t<this.options.length;t++)if(!this.options.get(t).disabled){e=t;break}this._keyManager.setActiveItem(e)}else this._keyManager.setActiveItem(this._selectionModel.selected[0])}_canOpen(){return!this._panelOpen&&!this.disabled&&this.options?.length>0&&!!this._overlayDir}focus(e){this._elementRef.nativeElement.focus(e)}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||null,t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||"";return this.ariaLabelledby&&(e+=" "+this.ariaLabelledby),e||(e=this._valueId),e}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){let t=this._elementRef.nativeElement;e.length?t.setAttribute("aria-describedby",e.join(" ")):t.removeAttribute("aria-describedby")}onContainerClick(e){let t=pe(e);t&&(t.tagName==="MAT-OPTION"||t.classList.contains("cdk-overlay-backdrop")||t.closest(".mat-mdc-select-panel"))||(this.focus(),this.open())}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=J({type:r,selectors:[["mat-select"]],contentQueries:function(t,i,a){if(t&1&&ne(a,nt,5)(a,Pe,5)(a,Le,5),t&2){let n;p(n=m())&&(i.customTrigger=n.first),p(n=m())&&(i.options=n),p(n=m())&&(i.optionGroups=n)}},viewQuery:function(t,i){if(t&1&&le(Ye,5)(Ue,5)(W,5),t&2){let a;p(a=m())&&(i.trigger=a.first),p(a=m())&&(i.panel=a.first),p(a=m())&&(i._overlayDir=a.first)}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:21,hostBindings:function(t,i){t&1&&y("keydown",function(n){return i._handleKeydown(n)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),t&2&&(M("id",i.id)("tabindex",i.disabled?-1:i.tabIndex)("aria-controls",i.panelOpen?i.id+"-panel":null)("aria-expanded",i.panelOpen)("aria-label",i.ariaLabel||null)("aria-required",i.required.toString())("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-activedescendant",i._getAriaActiveDescendant()),E("mat-mdc-select-disabled",i.disabled)("mat-mdc-select-invalid",i.errorState)("mat-mdc-select-required",i.required)("mat-mdc-select-empty",i.empty)("mat-mdc-select-multiple",i.multiple)("mat-select-open",i.panelOpen))},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",c],disableRipple:[2,"disableRipple","disableRipple",c],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:L(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",c],placeholder:"placeholder",required:[2,"required","required",c],multiple:[2,"multiple","multiple",c],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",c],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",L],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",c]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[ce([{provide:Ie,useExisting:r},{provide:Re,useExisting:r}]),U],ngContentSelectors:$e,decls:11,vars:10,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"detach","backdropClick","overlayKeydown","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth","cdkConnectedOverlayFlexibleDimensions","cdkConnectedOverlayUsePopover"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",1,"mat-mdc-select-panel","mdc-menu-surface","mdc-menu-surface--open",3,"keydown"]],template:function(t,i){if(t&1&&(re(Xe),s(0,"div",2,0),y("click",function(){return i.open()}),s(3,"div",3),I(4,Je,2,1,"span",4)(5,tt,3,1,"span",5),h(),s(6,"div",6)(7,"div",7),j(),s(8,"svg",8),ie(9,"path",9),h()()()(),ee(10,it,3,16,"ng-template",10),y("detach",function(){return i.close()})("backdropClick",function(){return i.close()})("overlayKeydown",function(n){return i._handleOverlayKeydown(n)})),t&2){let a=oe(1);d(3),M("id",i._valueId),d(),A(i.empty?4:5),d(6),te("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",i._preferredOverlayOrigin||a)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayWidth",i._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",!0)("cdkConnectedOverlayUsePopover",i._popoverLocation)}},dependencies:[V,W],styles:[`@keyframes _mat-select-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}@keyframes _mat-select-exit{from{opacity:1}to{opacity:0}}.mat-mdc-select{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-sys-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-sys-body-large-tracking))}div.mat-mdc-select-panel{box-shadow:var(--mat-select-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12))}.mat-mdc-select-disabled{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-disabled .mat-mdc-select-placeholder{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-trigger{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.mat-mdc-select-disabled .mat-mdc-select-trigger{-webkit-user-select:none;user-select:none;cursor:default}.mat-mdc-select-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-mdc-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-mdc-select-arrow-wrapper{height:24px;flex-shrink:0;display:inline-flex;align-items:center}.mat-form-field-appearance-fill .mdc-text-field--no-label .mat-mdc-select-arrow-wrapper{transform:none}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-invalid .mat-mdc-select-arrow,.mat-form-field-invalid:not(.mat-form-field-disabled) .mat-mdc-form-field-infix::after{color:var(--mat-select-invalid-arrow-color, var(--mat-sys-error))}.mat-mdc-select-arrow{width:10px;height:5px;position:relative;color:var(--mat-select-enabled-arrow-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--mat-select-focused-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-disabled .mat-mdc-select-arrow{color:var(--mat-select-disabled-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-select-open .mat-mdc-select-arrow{transform:rotate(180deg)}.mat-form-field-animations-enabled .mat-mdc-select-arrow{transition:transform 80ms linear}.mat-mdc-select-arrow svg{fill:currentColor;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}@media(forced-colors: active){.mat-mdc-select-arrow svg{fill:CanvasText}.mat-mdc-select-disabled .mat-mdc-select-arrow svg{fill:GrayText}}div.mat-mdc-select-panel{width:100%;max-height:275px;outline:0;overflow:auto;padding:8px 0;border-radius:4px;box-sizing:border-box;position:relative;background-color:var(--mat-select-panel-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-select-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-select-panel-above) div.mat-mdc-select-panel{border-top-left-radius:0;border-top-right-radius:0;transform-origin:top center}.mat-mdc-select-panel-above div.mat-mdc-select-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:bottom center}.mat-select-panel-animations-enabled{animation:_mat-select-enter 120ms cubic-bezier(0, 0, 0.2, 1)}.mat-select-panel-animations-enabled.mat-select-panel-exit{animation:_mat-select-exit 100ms linear}.mat-mdc-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);color:var(--mat-select-placeholder-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field:not(.mat-form-field-animations-enabled) .mat-mdc-select-placeholder,._mat-animation-noopable .mat-mdc-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-mdc-select-placeholder{color:rgba(0,0,0,0);-webkit-text-fill-color:rgba(0,0,0,0);transition:none;display:block}.mat-mdc-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mat-mdc-floating-label{max-width:calc(100% - 18px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 24px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-text-field--label-floating .mdc-notched-outline__notch{max-width:calc(100% - 24px)}.mat-mdc-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;visibility:hidden}.mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper{transform:var(--mat-select-arrow-transform, translateY(-8px))}
|
|
2
|
+
`],encapsulation:2,changeDetection:0})}return r})();var Vt=(()=>{class r{static \u0275fac=function(t){return new(t||r)};static \u0275mod=Z({type:r});static \u0275inj=G({imports:[Me,B,ye,be,Te,B]})}return r})();export{Pt as a,Vt as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as oe}from"./chunk-XZIT26QS.js";import{a as B,c as j}from"./chunk-6XX7GME4.js";import{w as re}from"./chunk-VNO76B3S.js";import{a as E}from"./chunk-VMYKE4ZC.js";import{F as te,c as q,e as F,g as H,h as X,i as J,l as K,n as W,v as Y,w as Z,y as Q,z as ee}from"./chunk-7OGOI6WM.js";import{Ab as O,Bb as I,Db as f,Fb as d,Ka as l,Kc as $,Pb as A,Rb as w,Tb as s,Ub as h,Vb as k,Wa as R,a as U,ab as M,b as T,ca as C,dc as P,ga as b,ha as x,jb as V,jc as L,lb as u,m as D,ma as N,mb as g,pb as y,qb as S,rb as _,sb as a,ta as p,tb as i,ub as z}from"./chunk-CHEXA6RY.js";function ne(r,t){let e=new Map;for(let o of r)if(o.userGroupId!==t)for(let n of o.agentIds)e.has(n)||e.set(n,o.name);return e}function ie(r,t){let e=new Set(r),o=new Set(t);return{toAdd:t.filter(n=>!e.has(n)),toRemove:r.filter(n=>!o.has(n))}}function v(r){return[r.firstname,r.lastname].filter(Boolean).join(" ").trim()||r.externalId}var de=20,G=class{constructor(t,e){this.candidates=t;this.excludedExternalIds=e}search(t){let e=t.toLowerCase(),o=this.excludedExternalIds(),n=this.candidates().filter(m=>!o.has(m.externalId)).filter(m=>this.matches(m,e)).slice(0,de).map(m=>({id:m.externalId,name:v(m),description:m.email}));return D(n)}matches(t,e){return t.externalId.toLowerCase().includes(e)||t.email.toLowerCase().includes(e)||v(t).toLowerCase().includes(e)}};var se=r=>({$implicit:r}),le=(r,t)=>t.id,ce=(r,t)=>t.externalId;function pe(r,t){r&1&&(a(0,"p",6),s(1,"Loading\u2026"),i())}function ue(r,t){r&1&&(a(0,"span",13),s(1,"Name is required."),i())}function ge(r,t){r&1&&(a(0,"p",18),s(1,"No agent configs available in this namespace."),i())}function _e(r,t){r&1&&O(0)}function fe(r,t){if(r&1&&M(0,_e,1,0,"ng-container",27),r&2){let e=t.$implicit;d(3);let o=A(11);_("ngTemplateOutlet",o)("ngTemplateOutletContext",P(2,se,e))}}function be(r,t){if(r&1&&(a(0,"div",19)(1,"span",26),s(2,"Platform"),i(),y(3,fe,1,4,"ng-container",null,le),i()),r&2){let e=d(2);l(3),S(e.platformAgents())}}function xe(r,t){r&1&&O(0)}function he(r,t){if(r&1&&M(0,xe,1,0,"ng-container",27),r&2){let e=t.$implicit;d(3);let o=A(11);_("ngTemplateOutlet",o)("ngTemplateOutletContext",P(2,se,e))}}function Ce(r,t){if(r&1&&(a(0,"div",19)(1,"span",26),s(2,"Namespace"),i(),y(3,he,1,4,"ng-container",null,le),i()),r&2){let e=d(2);l(3),S(e.namespaceAgents())}}function ve(r,t){r&1&&(a(0,"p",18),s(1,"No members yet."),i())}function Me(r,t){if(r&1&&(a(0,"span",31),s(1),i()),r&2){let e=d().$implicit;l(),h(e.email)}}function ye(r,t){if(r&1){let e=I();a(0,"li",28)(1,"div",29)(2,"span",30),s(3),i(),u(4,Me,2,1,"span",31),i(),a(5,"select",32),f("change",function(n){let m=b(e).$implicit,c=d(3);return x(c.setMemberRole(m.externalId,n.target.value))}),a(6,"option",33),s(7,"Member"),i(),a(8,"option",34),s(9,"Admin"),i()(),a(10,"button",35),f("click",function(){let n=b(e).$implicit,m=d(3);return x(m.removeMember(n.externalId))}),s(11," \xD7 "),i()()}if(r&2){let e=t.$implicit;l(3),h(e.label),l(),g(e.email&&e.email!==e.label?4:-1),l(),_("value",e.role),V("aria-label","Role of "+e.label),l(5),_("title","Remove "+e.label)}}function Se(r,t){if(r&1&&(a(0,"ul",20),y(1,ye,12,5,"li",28,ce),i()),r&2){let e=d(2);l(),S(e.selectedMembers())}}function Ie(r,t){if(r&1&&(a(0,"p",22),s(1),i()),r&2){let e=d(2);l(),h(e.errorMessage())}}function Ee(r,t){if(r&1){let e=I();a(0,"form",8),f("ngSubmit",function(){b(e);let n=d();return x(n.submit())}),a(1,"div",9)(2,"label",10),s(3,"Name "),a(4,"span",11),s(5,"*"),i()(),z(6,"input",12),u(7,ue,2,0,"span",13),i(),a(8,"fieldset",14)(9,"legend",15),s(10," Deployed agents "),a(11,"span",16),s(12,"Agents this group can use"),i()(),a(13,"p",17),s(14," Pick from platform agents and this namespace's agents. An agent already deployed to another group in this namespace is unavailable here. "),i(),u(15,ge,2,0,"p",18),u(16,be,5,0,"div",19),u(17,Ce,5,0,"div",19),i(),a(18,"fieldset",14)(19,"legend",15),s(20," Members "),a(21,"span",16),s(22,"Users in this group"),i()(),a(23,"p",17),s(24,"ADMIN members can manage this group; MEMBER is read-only."),i(),u(25,ve,2,0,"p",18)(26,Se,3,0,"ul",20),a(27,"ds-autocomplete-input",21),f("itemSelected",function(n){b(e);let m=d();return x(m.onMemberSelected(n))}),i()(),u(28,Ie,2,1,"p",22),a(29,"div",23)(30,"button",24),s(31),i(),a(32,"button",25),f("click",function(){b(e);let n=d();return x(n.cancel())}),s(33,"Cancel"),i()()()}if(r&2){let e=d();_("formGroup",e.form),l(6),w("user-group-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),l(),g(e.nameControl.invalid&&e.nameControl.touched?7:-1),l(8),g(e.platformAgents().length===0&&e.namespaceAgents().length===0?15:-1),l(),g(e.platformAgents().length>0?16:-1),l(),g(e.namespaceAgents().length>0?17:-1),l(8),g(e.selectedMembers().length===0?25:26),l(2),_("dataSource",e.memberDataSource),l(),g(e.errorMessage()?28:-1),l(2),_("disabled",e.nameControl.invalid||e.isSubmitting()),l(),k(" ",e.isEditMode()?"Save changes":"Create"," ")}}function Ge(r,t){if(r&1&&(a(0,"span",39),s(1),i()),r&2){let e=d().$implicit,o=d();l(),k("in ",o.agentOwnerGroup(e))}}function Oe(r,t){if(r&1){let e=I();a(0,"label",36)(1,"input",37),f("change",function(){let n=b(e).$implicit,m=d();return x(m.toggleAgent(n))}),i(),a(2,"span",38),s(3),i(),u(4,Ge,2,1,"span",39),i()}if(r&2){let e=t.$implicit,o=d();w("user-group-form__agent--disabled",o.isAgentDisabled(e)),l(),_("checked",o.isAgentSelected(e))("disabled",o.isAgentDisabled(e)),l(2),h(e.name),l(),g(o.isAgentDisabled(e)?4:-1)}}var Ae=250,ae=class r{route=C(B);router=C(j);destroyRef=C(N);userGroupState=C(oe);namespaceId=this.route.snapshot.params.namespaceId;userGroupId=this.route.snapshot.paramMap.get("userGroupId");returnTo=this.route.snapshot.queryParamMap.get("returnTo");isEditMode=p(!1);isLoading=p(!1);isSubmitting=p(!1);errorMessage=p(null);form=new J({name:new K("",{nonNullable:!0,validators:[F.required,F.maxLength(Ae)]})});get nameControl(){return this.form.controls.name}platformAgents=p([]);namespaceAgents=p([]);takenElsewhere=p(new Map);selectedAgentIds=p(new Set);candidateUsers=p([]);selectedMembers=p([]);originalMemberExternalIds=[];memberDataSource=new G(()=>this.candidateUsers(),()=>new Set(this.selectedMembers().map(t=>t.externalId)));ngOnInit(){this.isEditMode.set(!!this.userGroupId),this.loadFormData()}loadFormData(){this.isLoading.set(!0),this.userGroupState.loadFormData(this.namespaceId).pipe(E(this.destroyRef)).subscribe({next:({namespaceAgents:t,platformAgents:e,groups:o,users:n})=>{this.namespaceAgents.set(t),this.platformAgents.set(e),this.takenElsewhere.set(ne(o,this.userGroupId)),this.candidateUsers.set(n),this.userGroupId?this.loadExistingGroup(this.userGroupId):this.isLoading.set(!1)},error:t=>{console.error("[UserGroupForm] Failed to load form data",t),this.isLoading.set(!1),this.errorMessage.set("Failed to load form data. Please try again.")}})}loadExistingGroup(t){this.userGroupState.loadExistingGroup(t).pipe(E(this.destroyRef)).subscribe({next:({group:e,members:o})=>{this.nameControl.setValue(e.name),this.selectedAgentIds.set(new Set(e.agentIds)),this.originalMemberExternalIds=o.map(n=>n.externalId),this.selectedMembers.set(o.map(n=>({externalId:n.externalId,label:v(n),email:n.email,role:n.role}))),this.isLoading.set(!1)},error:e=>{console.error("[UserGroupForm] Failed to load user group for editing",e),this.isLoading.set(!1),this.navigateBack()}})}isAgentDisabled(t){return this.takenElsewhere().has(t.id??"")}agentOwnerGroup(t){return this.takenElsewhere().get(t.id??"")}isAgentSelected(t){return this.selectedAgentIds().has(t.id??"")}toggleAgent(t){let e=t.id;if(!e||this.isAgentDisabled(t))return;let o=new Set(this.selectedAgentIds());o.has(e)?o.delete(e):o.add(e),this.selectedAgentIds.set(o)}onMemberSelected(t){this.selectedMembers().some(e=>e.externalId===t.id)||this.selectedMembers.update(e=>[...e,{externalId:t.id,label:t.name,email:t.description,role:"MEMBER"}])}removeMember(t){this.selectedMembers.update(e=>e.filter(o=>o.externalId!==t))}setMemberRole(t,e){let o=e==="ADMIN"?"ADMIN":"MEMBER";this.selectedMembers.update(n=>n.map(m=>m.externalId===t?T(U({},m),{role:o}):m))}submit(){if(this.nameControl.invalid||this.isSubmitting())return;this.isSubmitting.set(!0),this.errorMessage.set(null);let t=this.nameControl.value.trim(),e=[...this.selectedAgentIds()],o=this.selectedMembers().map(c=>c.externalId),n=this.selectedMembers().filter(c=>c.role==="ADMIN").map(c=>c.externalId);(this.isEditMode()&&this.userGroupId?this.updateGroup(this.userGroupId,t,e,o,n):this.createGroup(t,e,o,n)).pipe(E(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:c=>{this.isSubmitting.set(!1),c.status===409?this.errorMessage.set(`A user group named "${t}" already exists in this namespace.`):c.status===400||c.status===422?this.errorMessage.set(c.error?.message??"Invalid user group data."):this.errorMessage.set("An unexpected error occurred. Please try again.")}})}createGroup(t,e,o,n){return this.userGroupState.create({namespaceId:this.namespaceId,name:t,agentIds:e,memberExternalIdsToAdd:o,adminExternalIds:n})}updateGroup(t,e,o,n,m){let{toAdd:c,toRemove:me}=ie(this.originalMemberExternalIds,n);return this.userGroupState.update(t,{name:e,agentIds:o,memberExternalIdsToAdd:c,memberExternalIdsToRemove:me,adminExternalIds:m})}cancel(){this.navigateBack()}navigateBack(){this.returnTo?this.router.navigateByUrl(this.returnTo):this.router.navigate(["/agentos",this.namespaceId,"user-groups"])}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=R({type:r,selectors:[["agentos-user-group-form"]],decls:12,vars:2,consts:[["agentRow",""],[1,"user-group-form"],[1,"user-group-form__header"],["type","button","title","Back to user groups",1,"user-group-form__back",3,"click"],[1,"user-group-form__back-icon"],[1,"user-group-form__title"],[1,"user-group-form__loading"],[1,"user-group-form__form",3,"formGroup"],[1,"user-group-form__form",3,"ngSubmit","formGroup"],[1,"user-group-form__field"],["for","user-group-name",1,"user-group-form__label"],["aria-hidden","true"],["id","user-group-name","type","text","placeholder","e.g. Support team","formControlName","name","autocomplete","off",1,"user-group-form__input"],[1,"user-group-form__field-error"],[1,"user-group-form__section"],[1,"user-group-form__label"],[1,"user-group-form__label-hint"],[1,"user-group-form__section-hint"],[1,"user-group-form__empty-hint"],[1,"user-group-form__agent-group"],[1,"user-group-form__members"],["placeholder","Add a member\u2026",3,"itemSelected","dataSource"],[1,"user-group-form__error"],[1,"user-group-form__actions"],["type","submit",1,"user-group-form__btn","user-group-form__btn--primary",3,"disabled"],["type","button",1,"user-group-form__btn",3,"click"],[1,"user-group-form__agent-group-title"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"user-group-form__member"],[1,"user-group-form__member-info"],[1,"user-group-form__member-name"],[1,"user-group-form__member-email"],[1,"user-group-form__member-role",3,"change","value"],["value","MEMBER"],["value","ADMIN"],["type","button",1,"user-group-form__member-remove",3,"click","title"],[1,"user-group-form__agent"],["type","checkbox",1,"user-group-form__agent-checkbox",3,"change","checked","disabled"],[1,"user-group-form__agent-name"],[1,"user-group-form__agent-note"]],template:function(e,o){e&1&&(a(0,"div",1)(1,"header",2)(2,"button",3),f("click",function(){return o.cancel()}),a(3,"span",4),s(4,"\u2190"),i(),s(5," User Groups "),i(),a(6,"h1",5),s(7),i()(),u(8,pe,2,0,"p",6)(9,Ee,34,12,"form",7),i(),M(10,Oe,5,6,"ng-template",null,0,L)),e&2&&(l(7),h(o.isEditMode()?"Edit user group":"New user group"),l(),g(o.isLoading()?8:9))},dependencies:[$,te,W,Q,ee,q,H,X,Z,Y,re],styles:[".user-group-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.user-group-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.user-group-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.user-group-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.user-group-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.user-group-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.user-group-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.user-group-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.user-group-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.user-group-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.user-group-form__label-hint[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);margin-left:.375rem}.user-group-form__input[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.user-group-form__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.user-group-form__input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.user-group-form__input--invalid[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.user-group-form__input--invalid[_ngcontent-%COMP%]:focus{border-color:var(--color-error, #ff3b30)}.user-group-form__section[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:8px;padding:1rem;margin:0;display:flex;flex-direction:column;gap:.75rem}.user-group-form__section-hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.user-group-form__empty-hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary, #6e6e73);font-style:italic}.user-group-form__agent-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.user-group-form__agent-group-title[_ngcontent-%COMP%]{font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--color-text-secondary, #6e6e73);margin-bottom:.25rem}.user-group-form__agent[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.375rem .5rem;border-radius:6px;cursor:pointer;transition:background .15s ease}.user-group-form__agent[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .03))}.user-group-form__agent--disabled[_ngcontent-%COMP%]{cursor:not-allowed;opacity:.55}.user-group-form__agent--disabled[_ngcontent-%COMP%]:hover{background:transparent}.user-group-form__agent-checkbox[_ngcontent-%COMP%]{flex-shrink:0;accent-color:var(--color-primary, #007aff)}.user-group-form__agent-name[_ngcontent-%COMP%]{font-size:.9rem;color:var(--color-text, #1d1d1f)}.user-group-form__agent-note[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary, #6e6e73);font-style:italic}.user-group-form__members[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.375rem}.user-group-form__member[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;padding:.4rem .5rem;border-radius:8px;background:var(--color-surface-hover, rgba(0, 0, 0, .03));border:1px solid var(--color-border, rgba(0, 0, 0, .08))}.user-group-form__member-info[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.1rem;min-width:0}.user-group-form__member-name[_ngcontent-%COMP%]{font-size:.9rem;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-group-form__member-email[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-group-form__member-role[_ngcontent-%COMP%]{flex-shrink:0;padding:.3rem .5rem;border-radius:6px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.8rem;font-family:inherit;cursor:pointer}.user-group-form__member-role[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary, #007aff)}.user-group-form__member-remove[_ngcontent-%COMP%]{flex-shrink:0;width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;border-radius:50%;border:none;background:transparent;color:var(--color-text-secondary, #6e6e73);font-size:1rem;line-height:1;cursor:pointer;transition:background .15s ease,color .15s ease}.user-group-form__member-remove[_ngcontent-%COMP%]:hover{background:var(--color-error-light, rgba(255, 59, 48, .12));color:var(--color-error, #ff3b30)}.user-group-form__error[_ngcontent-%COMP%]{margin:0;padding:.625rem .875rem;border-radius:8px;background:var(--color-error-light, rgba(255, 59, 48, .08));border:1px solid var(--color-error, #ff3b30);color:var(--color-error, #ff3b30);font-size:.875rem;line-height:1.4}.user-group-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30);line-height:1.3}.user-group-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.user-group-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.user-group-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.user-group-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.user-group-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.user-group-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{ae as a};
|
|
1
|
+
import{a as oe}from"./chunk-XZIT26QS.js";import{a as B,c as j}from"./chunk-6XX7GME4.js";import{w as re}from"./chunk-TTHFWEW7.js";import{a as E}from"./chunk-VMYKE4ZC.js";import{F as te,c as q,e as F,g as H,h as X,i as J,l as K,n as W,v as Y,w as Z,y as Q,z as ee}from"./chunk-7OGOI6WM.js";import{Ab as O,Bb as I,Db as f,Fb as d,Ka as l,Kc as $,Pb as A,Rb as w,Tb as s,Ub as h,Vb as k,Wa as R,a as U,ab as M,b as T,ca as C,dc as P,ga as b,ha as x,jb as V,jc as L,lb as u,m as D,ma as N,mb as g,pb as y,qb as S,rb as _,sb as a,ta as p,tb as i,ub as z}from"./chunk-CHEXA6RY.js";function ne(r,t){let e=new Map;for(let o of r)if(o.userGroupId!==t)for(let n of o.agentIds)e.has(n)||e.set(n,o.name);return e}function ie(r,t){let e=new Set(r),o=new Set(t);return{toAdd:t.filter(n=>!e.has(n)),toRemove:r.filter(n=>!o.has(n))}}function v(r){return[r.firstname,r.lastname].filter(Boolean).join(" ").trim()||r.externalId}var de=20,G=class{constructor(t,e){this.candidates=t;this.excludedExternalIds=e}search(t){let e=t.toLowerCase(),o=this.excludedExternalIds(),n=this.candidates().filter(m=>!o.has(m.externalId)).filter(m=>this.matches(m,e)).slice(0,de).map(m=>({id:m.externalId,name:v(m),description:m.email}));return D(n)}matches(t,e){return t.externalId.toLowerCase().includes(e)||t.email.toLowerCase().includes(e)||v(t).toLowerCase().includes(e)}};var se=r=>({$implicit:r}),le=(r,t)=>t.id,ce=(r,t)=>t.externalId;function pe(r,t){r&1&&(a(0,"p",6),s(1,"Loading\u2026"),i())}function ue(r,t){r&1&&(a(0,"span",13),s(1,"Name is required."),i())}function ge(r,t){r&1&&(a(0,"p",18),s(1,"No agent configs available in this namespace."),i())}function _e(r,t){r&1&&O(0)}function fe(r,t){if(r&1&&M(0,_e,1,0,"ng-container",27),r&2){let e=t.$implicit;d(3);let o=A(11);_("ngTemplateOutlet",o)("ngTemplateOutletContext",P(2,se,e))}}function be(r,t){if(r&1&&(a(0,"div",19)(1,"span",26),s(2,"Platform"),i(),y(3,fe,1,4,"ng-container",null,le),i()),r&2){let e=d(2);l(3),S(e.platformAgents())}}function xe(r,t){r&1&&O(0)}function he(r,t){if(r&1&&M(0,xe,1,0,"ng-container",27),r&2){let e=t.$implicit;d(3);let o=A(11);_("ngTemplateOutlet",o)("ngTemplateOutletContext",P(2,se,e))}}function Ce(r,t){if(r&1&&(a(0,"div",19)(1,"span",26),s(2,"Namespace"),i(),y(3,he,1,4,"ng-container",null,le),i()),r&2){let e=d(2);l(3),S(e.namespaceAgents())}}function ve(r,t){r&1&&(a(0,"p",18),s(1,"No members yet."),i())}function Me(r,t){if(r&1&&(a(0,"span",31),s(1),i()),r&2){let e=d().$implicit;l(),h(e.email)}}function ye(r,t){if(r&1){let e=I();a(0,"li",28)(1,"div",29)(2,"span",30),s(3),i(),u(4,Me,2,1,"span",31),i(),a(5,"select",32),f("change",function(n){let m=b(e).$implicit,c=d(3);return x(c.setMemberRole(m.externalId,n.target.value))}),a(6,"option",33),s(7,"Member"),i(),a(8,"option",34),s(9,"Admin"),i()(),a(10,"button",35),f("click",function(){let n=b(e).$implicit,m=d(3);return x(m.removeMember(n.externalId))}),s(11," \xD7 "),i()()}if(r&2){let e=t.$implicit;l(3),h(e.label),l(),g(e.email&&e.email!==e.label?4:-1),l(),_("value",e.role),V("aria-label","Role of "+e.label),l(5),_("title","Remove "+e.label)}}function Se(r,t){if(r&1&&(a(0,"ul",20),y(1,ye,12,5,"li",28,ce),i()),r&2){let e=d(2);l(),S(e.selectedMembers())}}function Ie(r,t){if(r&1&&(a(0,"p",22),s(1),i()),r&2){let e=d(2);l(),h(e.errorMessage())}}function Ee(r,t){if(r&1){let e=I();a(0,"form",8),f("ngSubmit",function(){b(e);let n=d();return x(n.submit())}),a(1,"div",9)(2,"label",10),s(3,"Name "),a(4,"span",11),s(5,"*"),i()(),z(6,"input",12),u(7,ue,2,0,"span",13),i(),a(8,"fieldset",14)(9,"legend",15),s(10," Deployed agents "),a(11,"span",16),s(12,"Agents this group can use"),i()(),a(13,"p",17),s(14," Pick from platform agents and this namespace's agents. An agent already deployed to another group in this namespace is unavailable here. "),i(),u(15,ge,2,0,"p",18),u(16,be,5,0,"div",19),u(17,Ce,5,0,"div",19),i(),a(18,"fieldset",14)(19,"legend",15),s(20," Members "),a(21,"span",16),s(22,"Users in this group"),i()(),a(23,"p",17),s(24,"ADMIN members can manage this group; MEMBER is read-only."),i(),u(25,ve,2,0,"p",18)(26,Se,3,0,"ul",20),a(27,"ds-autocomplete-input",21),f("itemSelected",function(n){b(e);let m=d();return x(m.onMemberSelected(n))}),i()(),u(28,Ie,2,1,"p",22),a(29,"div",23)(30,"button",24),s(31),i(),a(32,"button",25),f("click",function(){b(e);let n=d();return x(n.cancel())}),s(33,"Cancel"),i()()()}if(r&2){let e=d();_("formGroup",e.form),l(6),w("user-group-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),l(),g(e.nameControl.invalid&&e.nameControl.touched?7:-1),l(8),g(e.platformAgents().length===0&&e.namespaceAgents().length===0?15:-1),l(),g(e.platformAgents().length>0?16:-1),l(),g(e.namespaceAgents().length>0?17:-1),l(8),g(e.selectedMembers().length===0?25:26),l(2),_("dataSource",e.memberDataSource),l(),g(e.errorMessage()?28:-1),l(2),_("disabled",e.nameControl.invalid||e.isSubmitting()),l(),k(" ",e.isEditMode()?"Save changes":"Create"," ")}}function Ge(r,t){if(r&1&&(a(0,"span",39),s(1),i()),r&2){let e=d().$implicit,o=d();l(),k("in ",o.agentOwnerGroup(e))}}function Oe(r,t){if(r&1){let e=I();a(0,"label",36)(1,"input",37),f("change",function(){let n=b(e).$implicit,m=d();return x(m.toggleAgent(n))}),i(),a(2,"span",38),s(3),i(),u(4,Ge,2,1,"span",39),i()}if(r&2){let e=t.$implicit,o=d();w("user-group-form__agent--disabled",o.isAgentDisabled(e)),l(),_("checked",o.isAgentSelected(e))("disabled",o.isAgentDisabled(e)),l(2),h(e.name),l(),g(o.isAgentDisabled(e)?4:-1)}}var Ae=250,ae=class r{route=C(B);router=C(j);destroyRef=C(N);userGroupState=C(oe);namespaceId=this.route.snapshot.params.namespaceId;userGroupId=this.route.snapshot.paramMap.get("userGroupId");returnTo=this.route.snapshot.queryParamMap.get("returnTo");isEditMode=p(!1);isLoading=p(!1);isSubmitting=p(!1);errorMessage=p(null);form=new J({name:new K("",{nonNullable:!0,validators:[F.required,F.maxLength(Ae)]})});get nameControl(){return this.form.controls.name}platformAgents=p([]);namespaceAgents=p([]);takenElsewhere=p(new Map);selectedAgentIds=p(new Set);candidateUsers=p([]);selectedMembers=p([]);originalMemberExternalIds=[];memberDataSource=new G(()=>this.candidateUsers(),()=>new Set(this.selectedMembers().map(t=>t.externalId)));ngOnInit(){this.isEditMode.set(!!this.userGroupId),this.loadFormData()}loadFormData(){this.isLoading.set(!0),this.userGroupState.loadFormData(this.namespaceId).pipe(E(this.destroyRef)).subscribe({next:({namespaceAgents:t,platformAgents:e,groups:o,users:n})=>{this.namespaceAgents.set(t),this.platformAgents.set(e),this.takenElsewhere.set(ne(o,this.userGroupId)),this.candidateUsers.set(n),this.userGroupId?this.loadExistingGroup(this.userGroupId):this.isLoading.set(!1)},error:t=>{console.error("[UserGroupForm] Failed to load form data",t),this.isLoading.set(!1),this.errorMessage.set("Failed to load form data. Please try again.")}})}loadExistingGroup(t){this.userGroupState.loadExistingGroup(t).pipe(E(this.destroyRef)).subscribe({next:({group:e,members:o})=>{this.nameControl.setValue(e.name),this.selectedAgentIds.set(new Set(e.agentIds)),this.originalMemberExternalIds=o.map(n=>n.externalId),this.selectedMembers.set(o.map(n=>({externalId:n.externalId,label:v(n),email:n.email,role:n.role}))),this.isLoading.set(!1)},error:e=>{console.error("[UserGroupForm] Failed to load user group for editing",e),this.isLoading.set(!1),this.navigateBack()}})}isAgentDisabled(t){return this.takenElsewhere().has(t.id??"")}agentOwnerGroup(t){return this.takenElsewhere().get(t.id??"")}isAgentSelected(t){return this.selectedAgentIds().has(t.id??"")}toggleAgent(t){let e=t.id;if(!e||this.isAgentDisabled(t))return;let o=new Set(this.selectedAgentIds());o.has(e)?o.delete(e):o.add(e),this.selectedAgentIds.set(o)}onMemberSelected(t){this.selectedMembers().some(e=>e.externalId===t.id)||this.selectedMembers.update(e=>[...e,{externalId:t.id,label:t.name,email:t.description,role:"MEMBER"}])}removeMember(t){this.selectedMembers.update(e=>e.filter(o=>o.externalId!==t))}setMemberRole(t,e){let o=e==="ADMIN"?"ADMIN":"MEMBER";this.selectedMembers.update(n=>n.map(m=>m.externalId===t?T(U({},m),{role:o}):m))}submit(){if(this.nameControl.invalid||this.isSubmitting())return;this.isSubmitting.set(!0),this.errorMessage.set(null);let t=this.nameControl.value.trim(),e=[...this.selectedAgentIds()],o=this.selectedMembers().map(c=>c.externalId),n=this.selectedMembers().filter(c=>c.role==="ADMIN").map(c=>c.externalId);(this.isEditMode()&&this.userGroupId?this.updateGroup(this.userGroupId,t,e,o,n):this.createGroup(t,e,o,n)).pipe(E(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:c=>{this.isSubmitting.set(!1),c.status===409?this.errorMessage.set(`A user group named "${t}" already exists in this namespace.`):c.status===400||c.status===422?this.errorMessage.set(c.error?.message??"Invalid user group data."):this.errorMessage.set("An unexpected error occurred. Please try again.")}})}createGroup(t,e,o,n){return this.userGroupState.create({namespaceId:this.namespaceId,name:t,agentIds:e,memberExternalIdsToAdd:o,adminExternalIds:n})}updateGroup(t,e,o,n,m){let{toAdd:c,toRemove:me}=ie(this.originalMemberExternalIds,n);return this.userGroupState.update(t,{name:e,agentIds:o,memberExternalIdsToAdd:c,memberExternalIdsToRemove:me,adminExternalIds:m})}cancel(){this.navigateBack()}navigateBack(){this.returnTo?this.router.navigateByUrl(this.returnTo):this.router.navigate(["/agentos",this.namespaceId,"user-groups"])}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=R({type:r,selectors:[["agentos-user-group-form"]],decls:12,vars:2,consts:[["agentRow",""],[1,"user-group-form"],[1,"user-group-form__header"],["type","button","title","Back to user groups",1,"user-group-form__back",3,"click"],[1,"user-group-form__back-icon"],[1,"user-group-form__title"],[1,"user-group-form__loading"],[1,"user-group-form__form",3,"formGroup"],[1,"user-group-form__form",3,"ngSubmit","formGroup"],[1,"user-group-form__field"],["for","user-group-name",1,"user-group-form__label"],["aria-hidden","true"],["id","user-group-name","type","text","placeholder","e.g. Support team","formControlName","name","autocomplete","off",1,"user-group-form__input"],[1,"user-group-form__field-error"],[1,"user-group-form__section"],[1,"user-group-form__label"],[1,"user-group-form__label-hint"],[1,"user-group-form__section-hint"],[1,"user-group-form__empty-hint"],[1,"user-group-form__agent-group"],[1,"user-group-form__members"],["placeholder","Add a member\u2026",3,"itemSelected","dataSource"],[1,"user-group-form__error"],[1,"user-group-form__actions"],["type","submit",1,"user-group-form__btn","user-group-form__btn--primary",3,"disabled"],["type","button",1,"user-group-form__btn",3,"click"],[1,"user-group-form__agent-group-title"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"user-group-form__member"],[1,"user-group-form__member-info"],[1,"user-group-form__member-name"],[1,"user-group-form__member-email"],[1,"user-group-form__member-role",3,"change","value"],["value","MEMBER"],["value","ADMIN"],["type","button",1,"user-group-form__member-remove",3,"click","title"],[1,"user-group-form__agent"],["type","checkbox",1,"user-group-form__agent-checkbox",3,"change","checked","disabled"],[1,"user-group-form__agent-name"],[1,"user-group-form__agent-note"]],template:function(e,o){e&1&&(a(0,"div",1)(1,"header",2)(2,"button",3),f("click",function(){return o.cancel()}),a(3,"span",4),s(4,"\u2190"),i(),s(5," User Groups "),i(),a(6,"h1",5),s(7),i()(),u(8,pe,2,0,"p",6)(9,Ee,34,12,"form",7),i(),M(10,Oe,5,6,"ng-template",null,0,L)),e&2&&(l(7),h(o.isEditMode()?"Edit user group":"New user group"),l(),g(o.isLoading()?8:9))},dependencies:[$,te,W,Q,ee,q,H,X,Z,Y,re],styles:[".user-group-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.user-group-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.user-group-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.user-group-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.user-group-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.user-group-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.user-group-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.user-group-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.user-group-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.user-group-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.user-group-form__label-hint[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);margin-left:.375rem}.user-group-form__input[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.user-group-form__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.user-group-form__input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.user-group-form__input--invalid[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.user-group-form__input--invalid[_ngcontent-%COMP%]:focus{border-color:var(--color-error, #ff3b30)}.user-group-form__section[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:8px;padding:1rem;margin:0;display:flex;flex-direction:column;gap:.75rem}.user-group-form__section-hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.user-group-form__empty-hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary, #6e6e73);font-style:italic}.user-group-form__agent-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.user-group-form__agent-group-title[_ngcontent-%COMP%]{font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--color-text-secondary, #6e6e73);margin-bottom:.25rem}.user-group-form__agent[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.375rem .5rem;border-radius:6px;cursor:pointer;transition:background .15s ease}.user-group-form__agent[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .03))}.user-group-form__agent--disabled[_ngcontent-%COMP%]{cursor:not-allowed;opacity:.55}.user-group-form__agent--disabled[_ngcontent-%COMP%]:hover{background:transparent}.user-group-form__agent-checkbox[_ngcontent-%COMP%]{flex-shrink:0;accent-color:var(--color-primary, #007aff)}.user-group-form__agent-name[_ngcontent-%COMP%]{font-size:.9rem;color:var(--color-text, #1d1d1f)}.user-group-form__agent-note[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary, #6e6e73);font-style:italic}.user-group-form__members[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.375rem}.user-group-form__member[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;padding:.4rem .5rem;border-radius:8px;background:var(--color-surface-hover, rgba(0, 0, 0, .03));border:1px solid var(--color-border, rgba(0, 0, 0, .08))}.user-group-form__member-info[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.1rem;min-width:0}.user-group-form__member-name[_ngcontent-%COMP%]{font-size:.9rem;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-group-form__member-email[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-group-form__member-role[_ngcontent-%COMP%]{flex-shrink:0;padding:.3rem .5rem;border-radius:6px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.8rem;font-family:inherit;cursor:pointer}.user-group-form__member-role[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary, #007aff)}.user-group-form__member-remove[_ngcontent-%COMP%]{flex-shrink:0;width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;border-radius:50%;border:none;background:transparent;color:var(--color-text-secondary, #6e6e73);font-size:1rem;line-height:1;cursor:pointer;transition:background .15s ease,color .15s ease}.user-group-form__member-remove[_ngcontent-%COMP%]:hover{background:var(--color-error-light, rgba(255, 59, 48, .12));color:var(--color-error, #ff3b30)}.user-group-form__error[_ngcontent-%COMP%]{margin:0;padding:.625rem .875rem;border-radius:8px;background:var(--color-error-light, rgba(255, 59, 48, .08));border:1px solid var(--color-error, #ff3b30);color:var(--color-error, #ff3b30);font-size:.875rem;line-height:1.4}.user-group-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30);line-height:1.3}.user-group-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.user-group-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.user-group-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.user-group-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.user-group-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.user-group-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{ae as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as k}from"./chunk-
|
|
1
|
+
import{a as k}from"./chunk-SXFAR5TU.js";import{d as D}from"./chunk-VCUQMGKI.js";import{c as q}from"./chunk-6XX7GME4.js";import{s as M,z as $}from"./chunk-TTHFWEW7.js";import"./chunk-OO2H5F7U.js";import"./chunk-SPV5SLNS.js";import{a as _}from"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import{Bb as b,Db as s,Fb as d,Lc as T,Pb as w,S as P,Wa as y,ab as C,ca as n,cc as R,fc as I,ga as m,gc as x,ha as l,i as f,jc as B,lb as h,ma as g,mb as A,rb as c,sb as a,t as u,tb as v}from"./chunk-CHEXA6RY.js";var S=()=>[];function V(r,e){if(r&1){let t=b();a(0,"agentos-ai-provider-item",4),s("editRequested",function(i){m(t);let p=d(2);return l(p.onEdit(i))})("deleteRequested",function(i){m(t);let p=d(2);return l(p.onDelete(i))}),v()}r&2&&c("config",e)("showBadge",!1)}function F(r,e){if(r&1&&h(0,V,1,2,"agentos-ai-provider-item",3),r&2){let t,o=e.$implicit,i=d();A((t=i.resolveProvider(o.id))?0:-1,t)}}var E=class r{router=n(q);destroyRef=n(g);aiProviderController=n(D);refresh$=new f(void 0);providers$=this.refresh$.pipe(P(()=>this.aiProviderController.listAiProvider("none")));providerItems$=this.providers$.pipe(u(e=>e.map(t=>({id:t.id??"",name:t.name,description:t.apiType}))));providersById=new Map;constructor(){this.providers$.pipe(_(this.destroyRef)).subscribe(e=>{this.providersById=new Map(e.map(t=>[t.id??"",t]))})}goBack(){this.router.navigate(["/agentos","admin"])}openCreateForm(){this.router.navigate(["/agentos","admin","ai-providers","new"])}onEdit(e){e.id&&this.router.navigate(["/agentos","admin","ai-providers",e.id,"edit"])}onDelete(e){e.id&&this.aiProviderController.deleteAiProvider(e.id).pipe(_(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolveProvider(e){return this.providersById.get(e)??null}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=y({type:r,selectors:[["agentos-platform-ai-providers"]],decls:5,vars:6,consts:[["aiProviderItemTpl",""],["title","Platform AI Providers","emptyMessage","No platform AI providers defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],["scope","namespace",3,"config","showBadge"],["scope","namespace",3,"editRequested","deleteRequested","config","showBadge"]],template:function(t,o){if(t&1&&(a(0,"ds-entity-list",1),I(1,"async"),s("createRequested",function(){return o.openCreateForm()}),a(2,"ds-icon-button",2),s("action",function(){return o.goBack()}),v()(),C(3,F,1,1,"ng-template",null,0,B)),t&2){let i=w(4);c("items",x(1,3,o.providerItems$)??R(5,S))("showCreate",!0)("itemTemplate",i)}},dependencies:[$,k,M,T],styles:[".platform-ai-providers__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-providers__back[_ngcontent-%COMP%]:hover{color:var(--color-primary, #007aff)}"],changeDetection:0})};export{E as PlatformAiProvidersComponent};
|