@whoz-oss/coday-client 3.9.0 → 3.10.1
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-Bvcyyhin.js → chunk-1LsZyzCe.js} +1 -1
- package/browser/{chunk-BBNGaNSQ.js → chunk-3cJY-y-K.js} +1 -1
- package/browser/{chunk-BqwbhmTv.js → chunk-538NlE7s.js} +1 -1
- package/browser/{chunk-o11j4fXC.js → chunk-7IDkwdi0.js} +1 -1
- package/browser/{chunk-DtyQxOGY.js → chunk-B1Tv2Ebu.js} +1 -1
- package/browser/{chunk-Cb6Ow6sh.js → chunk-B3QJ8PhL.js} +1 -1
- package/browser/{chunk-CzUty-6c.js → chunk-B5rsaW2b.js} +1 -1
- package/browser/{chunk-D96l2x9x.js → chunk-B8YsdH5W.js} +1 -1
- package/browser/{chunk-o_Mx4pTm.js → chunk-BA23pyYd.js} +1 -1
- package/browser/{chunk-un-hRvRu.js → chunk-BDkp40LI.js} +2 -2
- package/browser/{chunk-DQCU5W5q.js → chunk-BGILLpeT.js} +1 -1
- package/browser/{chunk-BOXLI6gF.js → chunk-BJ4jWcd_.js} +1 -1
- package/browser/{chunk-d21dDnf1.js → chunk-BM08gUt6.js} +1 -1
- package/browser/{chunk-wQ_oBBPt.js → chunk-BPt7wScV.js} +1 -1
- package/browser/{chunk-B2iRFdFJ.js → chunk-BTvzcZ1s.js} +1 -1
- package/browser/{chunk-oOY1Inho.js → chunk-BWbwxWKa.js} +1 -1
- package/browser/{chunk-Dme7pjfi.js → chunk-BkVtgsRG.js} +1 -1
- package/browser/{chunk-CNcYG6BV.js → chunk-Bpth0xKt.js} +2 -2
- package/browser/{chunk-BG4JKw5_.js → chunk-BsaBLbYE.js} +1 -1
- package/browser/{chunk-5XHYcbGo.js → chunk-BuSLhs6I.js} +1 -1
- package/browser/{chunk-DIxu51Hh.js → chunk-C1xOKACR.js} +1 -1
- package/browser/{chunk-cv9YWzbk.js → chunk-C2OedcEU.js} +1 -1
- package/browser/{chunk-BpEEgZu9.js → chunk-C2fhkSx5.js} +1 -1
- package/browser/chunk-C2rlLV-W.js +141 -0
- package/browser/{chunk-CrBT2ZUM.js → chunk-CE3CVQYJ.js} +1 -1
- package/browser/{chunk-DtAxhHGX.js → chunk-CFQpQly7.js} +1 -1
- package/browser/{chunk-D-LwrT3E.js → chunk-CFU4PT4-.js} +1 -1
- package/browser/{chunk-CxGE3g5u.js → chunk-CJdqLI4x.js} +1 -1
- package/browser/{chunk-C1wHBjuB.js → chunk-CPUMKiuB.js} +1 -1
- package/browser/{chunk-Cl-ElXn6.js → chunk-CQXNmLda.js} +1 -1
- package/browser/{chunk-XQn3o7oZ.js → chunk-CRoK_gKa.js} +1 -1
- package/browser/{chunk-nl8QJQnq.js → chunk-CUmZcEGx.js} +1 -1
- package/browser/{chunk-77GVmUXR.js → chunk-CX02zIUT.js} +1 -1
- package/browser/{chunk-oPJSjG7x.js → chunk-CaZlpLSd.js} +1 -1
- package/browser/{chunk-B7BIF7sz.js → chunk-CbXRaZ5e.js} +1 -1
- package/browser/{chunk-B0LvuAXc.js → chunk-CeTOubPL.js} +1 -1
- package/browser/{chunk-DAFm0061.js → chunk-CgurnF00.js} +1 -1
- package/browser/{chunk-CPToRp8s.js → chunk-CkfpO0Ui.js} +1 -1
- package/browser/chunk-CmUHL9Tg.js +1 -0
- package/browser/{chunk-TadC20N5.js → chunk-CqkMIKRg.js} +5 -5
- package/browser/{chunk-Bwdu-UGv.js → chunk-Ct1RBakr.js} +1 -1
- package/browser/{chunk-CQ-Ef6xQ.js → chunk-D73z8OGT.js} +1 -1
- package/browser/{chunk-CEJ_YacT.js → chunk-DAEEDI2g.js} +1 -1
- package/browser/{chunk-Dvbxvqz6.js → chunk-DAOnyJ7c.js} +1 -1
- package/browser/{chunk-Ch6jC06D.js → chunk-DB97l2cM.js} +1 -1
- package/browser/{chunk-0ZSGvAyj.js → chunk-DDdQkLim.js} +1 -1
- package/browser/{chunk-DOdmh9PT.js → chunk-Db48BeGH.js} +1 -1
- package/browser/{chunk-BwBCMaNS.js → chunk-DbmrZGxd.js} +1 -1
- package/browser/{chunk-DBUUBA4K.js → chunk-DfnvTJ7R.js} +1 -1
- package/browser/{chunk-BWgVTD24.js → chunk-DhYK3aRa.js} +1 -1
- package/browser/{chunk-CoiRNvlt.js → chunk-Dk3h998A.js} +1 -1
- package/browser/{chunk-CrHpC9ft.js → chunk-DkFy_8tW.js} +1 -1
- package/browser/{chunk-edD4_hyt.js → chunk-DngVvVw1.js} +1 -1
- package/browser/{chunk-Ch9XL-zC.js → chunk-DqfT0kg4.js} +1 -1
- package/browser/{chunk-Bc-vgtN0.js → chunk-Dx68TWlI.js} +1 -1
- package/browser/{chunk-DGUy5aAe.js → chunk-DxhQHX1Y.js} +1 -1
- package/browser/{chunk-BT5tw1Ak.js → chunk-DzZlI93U.js} +1 -1
- package/browser/{chunk-CIufGyU7.js → chunk-IM1UfDv7.js} +1 -1
- package/browser/{chunk-CAbLeq_f.js → chunk-LlG18Htx.js} +1 -1
- package/browser/{chunk-Tchjlkx-.js → chunk-O1wALPze.js} +1 -1
- package/browser/{chunk-93bKnqaP.js → chunk-TngDHyxp.js} +1 -1
- package/browser/{chunk-hsFrAldX.js → chunk-TxtSVoMY.js} +1 -1
- package/browser/{chunk-DoAR8Ei-.js → chunk-ZtJnIW3b.js} +1 -1
- package/browser/{chunk-CGGfBx2m.js → chunk-_aUM9QLW.js} +1 -1
- package/browser/{chunk-eoPDscq-.js → chunk-b_e1R_FV.js} +1 -1
- package/browser/{chunk-BrqXE5Wf.js → chunk-zmM38Yul.js} +2 -2
- package/browser/index.html +1 -1
- package/browser/{main-IVH4VEHC.js → main-MX6O2FH4.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-D4MXjzi7.js +0 -1
- package/browser/chunk-Dv7J-V0c.js +0 -141
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {v}from'./chunk-wQ_oBBPt.js';import {R,q,J}from'./chunk-0ZSGvAyj.js';import {g,ao as V,G,w as we,H as Hi,F,m as mT,cd as Hf,b as U,z as z$1,a as P$1,A as Aw,v as vs,k as Ag,W as WC,j as fl,n as eC,X as XE,a8 as Zg,t as tC,a9 as dC,q as oC,a4 as rC,a3 as HI,o as bg,ac as mC,r as Tg,a6 as $I,x as iC,a5 as yl,cH as Xw,aa as If,ab as wf,b$ as FC,C as Cg}from'./main-IVH4VEHC.js';import'./chunk-un-hRvRu.js';import {k as _t,b as _e$1,o as z,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,A as At,m as mn,Z as Zn,l as Xn,C as Cn,E as En}from'./chunk-CxGE3g5u.js';import'./chunk-D4MXjzi7.js';import'./chunk-Dme7pjfi.js';import'./chunk-CAbLeq_f.js';import'./chunk-nl8QJQnq.js';function se(i,t){i&1&&(vs(0,"p",5),WC(1,"Loading\u2026"),fl());}function ce(i,t){if(i&1&&(vs(0,"label",23),bg(1,"input",24),HI(),vs(2,"span"),WC(3),fl()()),i&2){let e=t.$implicit,o=mC(3);XE(),Tg("formControl",o.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!o.isAdmin()),$I(),XE(2),Zg(e.label);}}function de(i,t){if(i&1&&(vs(0,"fieldset",8)(1,"legend",22),WC(2,"Configuration scope"),fl(),oC(3,ce,4,4,"label",23,Xw().trackByScope,true),fl()),i&2){let e=mC(2);Tg("disabled",e.isEditMode()),XE(3),iC(e.scopeOptions);}}function ue(i,t){if(i&1&&(vs(0,"option",13),WC(1),fl()),i&2){let e=t.$implicit,o=mC(2);Tg("value",e),XE(),Zg(o.authTypeLabel[e]);}}function pe(i,t){i&1&&WC(0," Leave a field unchanged to keep the stored credential. ");}function he(i,t){i&1&&(vs(0,"span",11),WC(1,"*"),fl());}function me(i,t){if(i&1&&(vs(0,"p",28),WC(1),fl()),i&2){let e=mC(2).$implicit;Tg("id","as-hint-"+e.key),XE(),Zg(e.hint);}}function ge(i,t){if(i&1&&(bg(0,"input",27),HI(),eC(1,me,2,2,"p",28)),i&2){let e=mC().$implicit;FC("auth-setting-form__input"+(e.secret?" auth-setting-form__input--secret":"")),Tg("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),Cg("aria-describedby",e.hint?"as-hint-"+e.key:null),$I(),XE(),tC(e.hint?1:-1);}}function Ce(i,t){if(i&1&&(vs(0,"div",9)(1,"label",26),WC(2),eC(3,he,2,0,"span",11),fl(),eC(4,ge,2,9),fl()),i&2){let e,o=t.$implicit,l=mC(3);XE(),Tg("for","as-cred-"+o.key),XE(),yl(" ",o.label," "),XE(),tC(o.required?3:-1),XE(),tC((e=l.controlForField(o.key))?4:-1,e);}}function fe(i,t){if(i&1&&(vs(0,"fieldset",18)(1,"legend",22),WC(2,"Credentials"),fl(),vs(3,"p",25),WC(4," Values are stored encrypted and masked on read. "),eC(5,pe,1,0),fl(),oC(6,Ce,5,4,"div",9,Xw().trackByField,true),fl()),i&2){let e=mC(2);XE(5),tC(e.isEditMode()?5:-1),XE(),iC(e.credentialFields());}}function ye(i,t){if(i&1){let e=dC();vs(0,"form",7),Ag("ngSubmit",function(){If(e);let l=mC();return wf(l.submit())}),eC(1,de,5,1,"fieldset",8),vs(2,"div",9)(3,"label",10),WC(4,"Auth type "),vs(5,"span",11),WC(6,"*"),fl()(),vs(7,"select",12),oC(8,ue,2,2,"option",13,rC),fl(),HI(),fl(),vs(10,"div",9)(11,"label",14),WC(12,"Name "),vs(13,"span",11),WC(14,"*"),fl()(),bg(15,"input",15),HI(),fl(),vs(16,"div",9)(17,"label",16),WC(18,"Description"),fl(),bg(19,"input",17),HI(),fl(),eC(20,fe,8,1,"fieldset",18),vs(21,"div",19)(22,"button",20),WC(23),fl(),vs(24,"button",21),Ag("click",function(){If(e);let l=mC();return wf(l.cancel())}),WC(25,"Cancel"),fl()()();}if(i&2){let e=mC();Tg("formGroup",e.form),XE(),tC(e.isPlatformMode?-1:1),XE(6),Tg("formControl",e.authTypeControl),$I(),XE(),iC(e.authTypeOptions),XE(7),Tg("formControl",e.nameControl),$I(),XE(4),Tg("formControl",e.descriptionControl),$I(),XE(),tC(e.credentialFields().length>0?20:-1),XE(2),Tg("disabled",e.form.invalid||e.isSubmitting()),XE(),yl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var _e=new Set(["namespace","userOnNs","userGlobal"]),P=Object.freeze({platform:"Platform (read-only)",namespace:"Namespace configuration",userOnNs:"Personal \u2014 this namespace only",userGlobal:"Personal \u2014 all namespaces"}),Se={ApiKeyAuthSetting:[{key:"apiKey",label:"API Key",placeholder:"sk-\u2026",secret:true,required:false}],BasicAuthAuthSetting:[{key:"username",label:"Username",placeholder:"user@example.com",secret:false,required:false},{key:"password",label:"Password",placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",secret:true,required:false}],BearerTokenAuthSetting:[{key:"token",label:"Bearer token",placeholder:"eyJ\u2026",secret:true,required:false}],OAuthDiscoverableAuthSetting:[{key:"discoveryUrl",label:"Discovery URL",placeholder:"https://\u2026/.well-known/openid-configuration",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthCustomAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthRegisteredAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthMcpDiscoverableAuthSetting:[{key:"resourceUrl",label:"Resource URL",placeholder:"https://mcp.example.com",hint:"Use the base URL exactly as documented by your provider \u2014 do not append a path suffix. Examples: https://mcp.hubspot.com (HubSpot), https://mcp.atlassian.com/v1/mcp (Atlassian).",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",hint:"Leave empty to let the server register an OAuth client automatically (RFC 7591 dynamic registration). Fill in only if you have a pre-registered client ID from your provider.",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Leave empty in most cases \u2014 the MCP server declares the required scopes itself. Fill in only if your provider explicitly requires client-declared scopes.",secret:false,required:false}]},le=class i{route=g(V);router=g(G);destroyRef=g(we);state=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?Hi(true):F(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});authTypeOptions=q;authTypeLabel=J;scopeOptions=[{value:"namespace",label:P.namespace},{value:"userOnNs",label:P.userOnNs},{value:"userGlobal",label:P.userGlobal}];nameControl=new _t("",{nonNullable:true,validators:[_e$1.required,_e$1.minLength(1)]});descriptionControl=new _t(null);authTypeControl=new _t("ApiKeyAuthSetting",{nonNullable:true,validators:[_e$1.required]});scopeControl=new _t("namespace",{nonNullable:true});form=new z({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new _t("",{nonNullable:true});usernameControl=new _t("",{nonNullable:true});passwordControl=new _t("",{nonNullable:true});tokenControl=new _t("",{nonNullable:true});discoveryUrlControl=new _t("",{nonNullable:true});authorizationUrlControl=new _t("",{nonNullable:true});tokenUrlControl=new _t("",{nonNullable:true});clientIdControl=new _t("",{nonNullable:true});clientSecretControl=new _t("",{nonNullable:true});scopesControl=new _t("",{nonNullable:true});resourceUrlControl=new _t("",{nonNullable:true});selectedAuthType=F(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=mT(()=>Se[this.selectedAuthType()]);isEditMode=Hi(false);isSubmitting=Hi(false);isLoading=Hi(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Hf(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,o=t.get("authSettingId");if(o){this.isEditMode.set(true),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(o);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let l=this.parseScope(e.get("scope"));this.scopeControl.setValue(l);let v=e.get("template");v&&this.hydrateFromTemplate(v);}parseScope(t){return t&&_e.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AuthSettingForm] Could not load auth setting '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.authTypeControl.setValue(e.authType),this.clearCredentialControls(),this.initialCredentials={},this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AuthSettingForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){switch(this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.authTypeControl.setValue(t.authType),this.clearCredentialControls(),this.initialCredentials={},t.authType){case "ApiKeyAuthSetting":{let e=t.apiKey??"";this.apiKeyControl.setValue(e),this.initialCredentials.apiKey=e;break}case "BasicAuthAuthSetting":{let e=t,o=e.username??"",l=e.password??"";this.usernameControl.setValue(o),this.passwordControl.setValue(l),this.initialCredentials.username=o,this.initialCredentials.password=l;break}case "BearerTokenAuthSetting":{let e=t.token??"";this.tokenControl.setValue(e),this.initialCredentials.token=e;break}case "OAuthDiscoverableAuthSetting":{let e=t;this.discoveryUrlControl.setValue(e.discoveryUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.discoveryUrl=e.discoveryUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthCustomAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthRegisteredAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthMcpDiscoverableAuthSetting":{let e=t;this.resourceUrlControl.setValue(e.resourceUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.resourceUrl=e.resourceUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}}}clearCredentialControls(){this.apiKeyControl.setValue(""),this.usernameControl.setValue(""),this.passwordControl.setValue(""),this.tokenControl.setValue(""),this.discoveryUrlControl.setValue(""),this.authorizationUrlControl.setValue(""),this.tokenUrlControl.setValue(""),this.clientIdControl.setValue(""),this.clientSecretControl.setValue(""),this.scopesControl.setValue(""),this.resourceUrlControl.setValue("");}credentialValue(t,e){if(!(this.isEditMode()&&e===this.initialCredentials[t]))return e||void 0}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.nameControl.value.trim(),e=this.descriptionControl.value?.trim()||void 0,o=this.authTypeControl.value,l=this.form.getRawValue().scope,v=this.isPlatformMode?null:this.namespaceId??null,w=this.buildTypedPayload(o,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,this.existingConfig):this.state.create(w,l,v)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}buildTypedPayload(t,e,o){let l={name:e,description:o};switch(t){case "ApiKeyAuthSetting":return z$1(P$1({},l),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case "BasicAuthAuthSetting":return z$1(P$1({},l),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case "BearerTokenAuthSetting":return z$1(P$1({},l),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case "OAuthDiscoverableAuthSetting":return z$1(P$1({},l),{authType:"OAuthDiscoverableAuthSetting",discoveryUrl:this.credentialValue("discoveryUrl",this.discoveryUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthCustomAuthSetting":return z$1(P$1({},l),{authType:"OAuthCustomAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthRegisteredAuthSetting":return z$1(P$1({},l),{authType:"OAuthRegisteredAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthMcpDiscoverableAuthSetting":return z$1(P$1({},l),{authType:"OAuthMcpDiscoverableAuthSetting",resourceUrl:this.credentialValue("resourceUrl",this.resourceUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)})}}controlForField(t){return {apiKey:this.apiKeyControl,username:this.usernameControl,password:this.passwordControl,token:this.tokenControl,discoveryUrl:this.discoveryUrlControl,authorizationUrl:this.authorizationUrlControl,tokenUrl:this.tokenUrlControl,clientId:this.clientIdControl,clientSecret:this.clientSecretControl,scopes:this.scopesControl,resourceUrl:this.resourceUrlControl}[t]}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","auth-settings"]):this.router.navigate(["/agentos",this.namespaceId,"auth-settings"]);}trackByScope(t,e){return e.value}trackByField(t,e){return e.key}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Aw({type:i,selectors:[["agentos-auth-setting-form"]],decls:10,vars:2,consts:[[1,"auth-setting-form"],[1,"auth-setting-form__header"],["type","button","title","Back to auth settings",1,"auth-setting-form__back",3,"click"],[1,"auth-setting-form__back-icon"],[1,"auth-setting-form__title"],[1,"auth-setting-form__loading"],[1,"auth-setting-form__form",3,"formGroup"],[1,"auth-setting-form__form",3,"ngSubmit","formGroup"],[1,"auth-setting-form__scope",3,"disabled"],[1,"auth-setting-form__field"],["for","as-auth-type",1,"auth-setting-form__label"],["aria-hidden","true"],["id","as-auth-type",1,"auth-setting-form__select",3,"formControl"],[3,"value"],["for","as-name",1,"auth-setting-form__label"],["id","as-name","type","text","placeholder","e.g. GitHub OAuth App","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],["for","as-description",1,"auth-setting-form__label"],["id","as-description","type","text","placeholder","Optional \u2014 short description of this auth setting","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],[1,"auth-setting-form__credentials"],[1,"auth-setting-form__actions"],["type","submit",1,"auth-setting-form__btn","auth-setting-form__btn--primary",3,"disabled"],["type","button",1,"auth-setting-form__btn",3,"click"],[1,"auth-setting-form__label"],[1,"auth-setting-form__scope-option"],["type","radio",3,"formControl","value","disabled"],[1,"auth-setting-form__credentials-hint"],[1,"auth-setting-form__label",3,"for"],[3,"id","type","placeholder","formControl","autocomplete"],[1,"auth-setting-form__field-hint",3,"id"]],template:function(e,o){e&1&&(vs(0,"div",0)(1,"header",1)(2,"button",2),Ag("click",function(){return o.cancel()}),vs(3,"span",3),WC(4,"\u2190"),fl(),WC(5," Auth Settings "),fl(),vs(6,"h1",4),WC(7),fl()(),eC(8,se,2,0,"p",5)(9,ye,26,8,"form",6),fl()),e&2&&(XE(7),Zg(o.isEditMode()?"Edit auth setting":"New auth setting"),XE(),tC(o.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,At,mn,Zn,Xn,Cn,En],styles:[".auth-setting-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:1.5rem;max-width:640px}.auth-setting-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;background:none;border:none;cursor:pointer;color:var(--color-text-secondary);font-size:.85rem;padding:0}.auth-setting-form__back[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.auth-setting-form__back-icon[_ngcontent-%COMP%]{font-size:1rem}.auth-setting-form__title[_ngcontent-%COMP%]{font-size:1.4rem;font-weight:600;color:var(--color-text);margin:0}.auth-setting-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem}.auth-setting-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.auth-setting-form__scope[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem;display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__scope[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__scope-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;font-size:.9rem;color:var(--color-text)}.auth-setting-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.auth-setting-form__field-hint[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);margin:0;line-height:1.4}.auth-setting-form__label[_ngcontent-%COMP%]{font-size:.85rem;font-weight:500;color:var(--color-text-secondary)}.auth-setting-form__input[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;transition:border-color .15s ease;width:100%;box-sizing:border-box}.auth-setting-form__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__input--secret[_ngcontent-%COMP%]{font-family:monospace;letter-spacing:.05em}.auth-setting-form__select[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;cursor:pointer;transition:border-color .15s ease}.auth-setting-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__credentials[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem 1rem;display:flex;flex-direction:column;gap:.75rem;margin:0}.auth-setting-form__credentials[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__credentials-hint[_ngcontent-%COMP%]{font-size:.78rem;color:var(--color-text-secondary);margin:0}.auth-setting-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center;padding-top:.5rem}.auth-setting-form__btn[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem 1.25rem;cursor:pointer;font-size:.9rem;font-weight:500;background:var(--color-bg-secondary);color:var(--color-text);transition:background .15s ease}.auth-setting-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.auth-setting-form__btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.auth-setting-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-on-primary, #fff);border-color:var(--color-primary)}.auth-setting-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, var(--color-primary))}"]})};
|
|
1
|
+
import {v}from'./chunk-BPt7wScV.js';import {R,q,J}from'./chunk-DDdQkLim.js';import {g,ao as V,G,w as we,H as Hi,F,m as mT,cd as Hf,b as U,z as z$1,a as P$1,A as Aw,v as vs,k as Ag,W as WC,j as fl,n as eC,X as XE,a8 as Zg,t as tC,a9 as dC,q as oC,a4 as rC,a3 as HI,o as bg,ac as mC,r as Tg,a6 as $I,x as iC,a5 as yl,cH as Xw,aa as If,ab as wf,b$ as FC,C as Cg}from'./main-MX6O2FH4.js';import'./chunk-BDkp40LI.js';import {k as _t,b as _e$1,o as z,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,A as At,m as mn,Z as Zn,l as Xn,C as Cn,E as En}from'./chunk-CJdqLI4x.js';import'./chunk-CmUHL9Tg.js';import'./chunk-BkVtgsRG.js';import'./chunk-LlG18Htx.js';import'./chunk-CUmZcEGx.js';function se(i,t){i&1&&(vs(0,"p",5),WC(1,"Loading\u2026"),fl());}function ce(i,t){if(i&1&&(vs(0,"label",23),bg(1,"input",24),HI(),vs(2,"span"),WC(3),fl()()),i&2){let e=t.$implicit,o=mC(3);XE(),Tg("formControl",o.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!o.isAdmin()),$I(),XE(2),Zg(e.label);}}function de(i,t){if(i&1&&(vs(0,"fieldset",8)(1,"legend",22),WC(2,"Configuration scope"),fl(),oC(3,ce,4,4,"label",23,Xw().trackByScope,true),fl()),i&2){let e=mC(2);Tg("disabled",e.isEditMode()),XE(3),iC(e.scopeOptions);}}function ue(i,t){if(i&1&&(vs(0,"option",13),WC(1),fl()),i&2){let e=t.$implicit,o=mC(2);Tg("value",e),XE(),Zg(o.authTypeLabel[e]);}}function pe(i,t){i&1&&WC(0," Leave a field unchanged to keep the stored credential. ");}function he(i,t){i&1&&(vs(0,"span",11),WC(1,"*"),fl());}function me(i,t){if(i&1&&(vs(0,"p",28),WC(1),fl()),i&2){let e=mC(2).$implicit;Tg("id","as-hint-"+e.key),XE(),Zg(e.hint);}}function ge(i,t){if(i&1&&(bg(0,"input",27),HI(),eC(1,me,2,2,"p",28)),i&2){let e=mC().$implicit;FC("auth-setting-form__input"+(e.secret?" auth-setting-form__input--secret":"")),Tg("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),Cg("aria-describedby",e.hint?"as-hint-"+e.key:null),$I(),XE(),tC(e.hint?1:-1);}}function Ce(i,t){if(i&1&&(vs(0,"div",9)(1,"label",26),WC(2),eC(3,he,2,0,"span",11),fl(),eC(4,ge,2,9),fl()),i&2){let e,o=t.$implicit,l=mC(3);XE(),Tg("for","as-cred-"+o.key),XE(),yl(" ",o.label," "),XE(),tC(o.required?3:-1),XE(),tC((e=l.controlForField(o.key))?4:-1,e);}}function fe(i,t){if(i&1&&(vs(0,"fieldset",18)(1,"legend",22),WC(2,"Credentials"),fl(),vs(3,"p",25),WC(4," Values are stored encrypted and masked on read. "),eC(5,pe,1,0),fl(),oC(6,Ce,5,4,"div",9,Xw().trackByField,true),fl()),i&2){let e=mC(2);XE(5),tC(e.isEditMode()?5:-1),XE(),iC(e.credentialFields());}}function ye(i,t){if(i&1){let e=dC();vs(0,"form",7),Ag("ngSubmit",function(){If(e);let l=mC();return wf(l.submit())}),eC(1,de,5,1,"fieldset",8),vs(2,"div",9)(3,"label",10),WC(4,"Auth type "),vs(5,"span",11),WC(6,"*"),fl()(),vs(7,"select",12),oC(8,ue,2,2,"option",13,rC),fl(),HI(),fl(),vs(10,"div",9)(11,"label",14),WC(12,"Name "),vs(13,"span",11),WC(14,"*"),fl()(),bg(15,"input",15),HI(),fl(),vs(16,"div",9)(17,"label",16),WC(18,"Description"),fl(),bg(19,"input",17),HI(),fl(),eC(20,fe,8,1,"fieldset",18),vs(21,"div",19)(22,"button",20),WC(23),fl(),vs(24,"button",21),Ag("click",function(){If(e);let l=mC();return wf(l.cancel())}),WC(25,"Cancel"),fl()()();}if(i&2){let e=mC();Tg("formGroup",e.form),XE(),tC(e.isPlatformMode?-1:1),XE(6),Tg("formControl",e.authTypeControl),$I(),XE(),iC(e.authTypeOptions),XE(7),Tg("formControl",e.nameControl),$I(),XE(4),Tg("formControl",e.descriptionControl),$I(),XE(),tC(e.credentialFields().length>0?20:-1),XE(2),Tg("disabled",e.form.invalid||e.isSubmitting()),XE(),yl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var _e=new Set(["namespace","userOnNs","userGlobal"]),P=Object.freeze({platform:"Platform (read-only)",namespace:"Namespace configuration",userOnNs:"Personal \u2014 this namespace only",userGlobal:"Personal \u2014 all namespaces"}),Se={ApiKeyAuthSetting:[{key:"apiKey",label:"API Key",placeholder:"sk-\u2026",secret:true,required:false}],BasicAuthAuthSetting:[{key:"username",label:"Username",placeholder:"user@example.com",secret:false,required:false},{key:"password",label:"Password",placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",secret:true,required:false}],BearerTokenAuthSetting:[{key:"token",label:"Bearer token",placeholder:"eyJ\u2026",secret:true,required:false}],OAuthDiscoverableAuthSetting:[{key:"discoveryUrl",label:"Discovery URL",placeholder:"https://\u2026/.well-known/openid-configuration",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthCustomAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthRegisteredAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthMcpDiscoverableAuthSetting:[{key:"resourceUrl",label:"Resource URL",placeholder:"https://mcp.example.com",hint:"Use the base URL exactly as documented by your provider \u2014 do not append a path suffix. Examples: https://mcp.hubspot.com (HubSpot), https://mcp.atlassian.com/v1/mcp (Atlassian).",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",hint:"Leave empty to let the server register an OAuth client automatically (RFC 7591 dynamic registration). Fill in only if you have a pre-registered client ID from your provider.",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Leave empty in most cases \u2014 the MCP server declares the required scopes itself. Fill in only if your provider explicitly requires client-declared scopes.",secret:false,required:false}]},le=class i{route=g(V);router=g(G);destroyRef=g(we);state=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?Hi(true):F(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});authTypeOptions=q;authTypeLabel=J;scopeOptions=[{value:"namespace",label:P.namespace},{value:"userOnNs",label:P.userOnNs},{value:"userGlobal",label:P.userGlobal}];nameControl=new _t("",{nonNullable:true,validators:[_e$1.required,_e$1.minLength(1)]});descriptionControl=new _t(null);authTypeControl=new _t("ApiKeyAuthSetting",{nonNullable:true,validators:[_e$1.required]});scopeControl=new _t("namespace",{nonNullable:true});form=new z({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new _t("",{nonNullable:true});usernameControl=new _t("",{nonNullable:true});passwordControl=new _t("",{nonNullable:true});tokenControl=new _t("",{nonNullable:true});discoveryUrlControl=new _t("",{nonNullable:true});authorizationUrlControl=new _t("",{nonNullable:true});tokenUrlControl=new _t("",{nonNullable:true});clientIdControl=new _t("",{nonNullable:true});clientSecretControl=new _t("",{nonNullable:true});scopesControl=new _t("",{nonNullable:true});resourceUrlControl=new _t("",{nonNullable:true});selectedAuthType=F(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=mT(()=>Se[this.selectedAuthType()]);isEditMode=Hi(false);isSubmitting=Hi(false);isLoading=Hi(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Hf(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,o=t.get("authSettingId");if(o){this.isEditMode.set(true),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(o);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let l=this.parseScope(e.get("scope"));this.scopeControl.setValue(l);let v=e.get("template");v&&this.hydrateFromTemplate(v);}parseScope(t){return t&&_e.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AuthSettingForm] Could not load auth setting '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.authTypeControl.setValue(e.authType),this.clearCredentialControls(),this.initialCredentials={},this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AuthSettingForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){switch(this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.authTypeControl.setValue(t.authType),this.clearCredentialControls(),this.initialCredentials={},t.authType){case "ApiKeyAuthSetting":{let e=t.apiKey??"";this.apiKeyControl.setValue(e),this.initialCredentials.apiKey=e;break}case "BasicAuthAuthSetting":{let e=t,o=e.username??"",l=e.password??"";this.usernameControl.setValue(o),this.passwordControl.setValue(l),this.initialCredentials.username=o,this.initialCredentials.password=l;break}case "BearerTokenAuthSetting":{let e=t.token??"";this.tokenControl.setValue(e),this.initialCredentials.token=e;break}case "OAuthDiscoverableAuthSetting":{let e=t;this.discoveryUrlControl.setValue(e.discoveryUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.discoveryUrl=e.discoveryUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthCustomAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthRegisteredAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthMcpDiscoverableAuthSetting":{let e=t;this.resourceUrlControl.setValue(e.resourceUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.resourceUrl=e.resourceUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}}}clearCredentialControls(){this.apiKeyControl.setValue(""),this.usernameControl.setValue(""),this.passwordControl.setValue(""),this.tokenControl.setValue(""),this.discoveryUrlControl.setValue(""),this.authorizationUrlControl.setValue(""),this.tokenUrlControl.setValue(""),this.clientIdControl.setValue(""),this.clientSecretControl.setValue(""),this.scopesControl.setValue(""),this.resourceUrlControl.setValue("");}credentialValue(t,e){if(!(this.isEditMode()&&e===this.initialCredentials[t]))return e||void 0}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.nameControl.value.trim(),e=this.descriptionControl.value?.trim()||void 0,o=this.authTypeControl.value,l=this.form.getRawValue().scope,v=this.isPlatformMode?null:this.namespaceId??null,w=this.buildTypedPayload(o,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,this.existingConfig):this.state.create(w,l,v)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}buildTypedPayload(t,e,o){let l={name:e,description:o};switch(t){case "ApiKeyAuthSetting":return z$1(P$1({},l),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case "BasicAuthAuthSetting":return z$1(P$1({},l),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case "BearerTokenAuthSetting":return z$1(P$1({},l),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case "OAuthDiscoverableAuthSetting":return z$1(P$1({},l),{authType:"OAuthDiscoverableAuthSetting",discoveryUrl:this.credentialValue("discoveryUrl",this.discoveryUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthCustomAuthSetting":return z$1(P$1({},l),{authType:"OAuthCustomAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthRegisteredAuthSetting":return z$1(P$1({},l),{authType:"OAuthRegisteredAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthMcpDiscoverableAuthSetting":return z$1(P$1({},l),{authType:"OAuthMcpDiscoverableAuthSetting",resourceUrl:this.credentialValue("resourceUrl",this.resourceUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)})}}controlForField(t){return {apiKey:this.apiKeyControl,username:this.usernameControl,password:this.passwordControl,token:this.tokenControl,discoveryUrl:this.discoveryUrlControl,authorizationUrl:this.authorizationUrlControl,tokenUrl:this.tokenUrlControl,clientId:this.clientIdControl,clientSecret:this.clientSecretControl,scopes:this.scopesControl,resourceUrl:this.resourceUrlControl}[t]}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","auth-settings"]):this.router.navigate(["/agentos",this.namespaceId,"auth-settings"]);}trackByScope(t,e){return e.value}trackByField(t,e){return e.key}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Aw({type:i,selectors:[["agentos-auth-setting-form"]],decls:10,vars:2,consts:[[1,"auth-setting-form"],[1,"auth-setting-form__header"],["type","button","title","Back to auth settings",1,"auth-setting-form__back",3,"click"],[1,"auth-setting-form__back-icon"],[1,"auth-setting-form__title"],[1,"auth-setting-form__loading"],[1,"auth-setting-form__form",3,"formGroup"],[1,"auth-setting-form__form",3,"ngSubmit","formGroup"],[1,"auth-setting-form__scope",3,"disabled"],[1,"auth-setting-form__field"],["for","as-auth-type",1,"auth-setting-form__label"],["aria-hidden","true"],["id","as-auth-type",1,"auth-setting-form__select",3,"formControl"],[3,"value"],["for","as-name",1,"auth-setting-form__label"],["id","as-name","type","text","placeholder","e.g. GitHub OAuth App","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],["for","as-description",1,"auth-setting-form__label"],["id","as-description","type","text","placeholder","Optional \u2014 short description of this auth setting","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],[1,"auth-setting-form__credentials"],[1,"auth-setting-form__actions"],["type","submit",1,"auth-setting-form__btn","auth-setting-form__btn--primary",3,"disabled"],["type","button",1,"auth-setting-form__btn",3,"click"],[1,"auth-setting-form__label"],[1,"auth-setting-form__scope-option"],["type","radio",3,"formControl","value","disabled"],[1,"auth-setting-form__credentials-hint"],[1,"auth-setting-form__label",3,"for"],[3,"id","type","placeholder","formControl","autocomplete"],[1,"auth-setting-form__field-hint",3,"id"]],template:function(e,o){e&1&&(vs(0,"div",0)(1,"header",1)(2,"button",2),Ag("click",function(){return o.cancel()}),vs(3,"span",3),WC(4,"\u2190"),fl(),WC(5," Auth Settings "),fl(),vs(6,"h1",4),WC(7),fl()(),eC(8,se,2,0,"p",5)(9,ye,26,8,"form",6),fl()),e&2&&(XE(7),Zg(o.isEditMode()?"Edit auth setting":"New auth setting"),XE(),tC(o.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,At,mn,Zn,Xn,Cn,En],styles:[".auth-setting-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:1.5rem;max-width:640px}.auth-setting-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;background:none;border:none;cursor:pointer;color:var(--color-text-secondary);font-size:.85rem;padding:0}.auth-setting-form__back[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.auth-setting-form__back-icon[_ngcontent-%COMP%]{font-size:1rem}.auth-setting-form__title[_ngcontent-%COMP%]{font-size:1.4rem;font-weight:600;color:var(--color-text);margin:0}.auth-setting-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem}.auth-setting-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.auth-setting-form__scope[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem;display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__scope[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__scope-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;font-size:.9rem;color:var(--color-text)}.auth-setting-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.auth-setting-form__field-hint[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);margin:0;line-height:1.4}.auth-setting-form__label[_ngcontent-%COMP%]{font-size:.85rem;font-weight:500;color:var(--color-text-secondary)}.auth-setting-form__input[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;transition:border-color .15s ease;width:100%;box-sizing:border-box}.auth-setting-form__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__input--secret[_ngcontent-%COMP%]{font-family:monospace;letter-spacing:.05em}.auth-setting-form__select[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;cursor:pointer;transition:border-color .15s ease}.auth-setting-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__credentials[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem 1rem;display:flex;flex-direction:column;gap:.75rem;margin:0}.auth-setting-form__credentials[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__credentials-hint[_ngcontent-%COMP%]{font-size:.78rem;color:var(--color-text-secondary);margin:0}.auth-setting-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center;padding-top:.5rem}.auth-setting-form__btn[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem 1.25rem;cursor:pointer;font-size:.9rem;font-weight:500;background:var(--color-bg-secondary);color:var(--color-text);transition:background .15s ease}.auth-setting-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.auth-setting-form__btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.auth-setting-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-on-primary, #fff);border-color:var(--color-primary)}.auth-setting-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, var(--color-primary))}"]})};
|
|
2
2
|
export{le as AuthSettingFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {I}from'./chunk-
|
|
1
|
+
import {I}from'./chunk-BTvzcZ1s.js';import {g,G,w as we,de as M,dd as $,aJ as Tr,H as Hi,bS as ma,aD as Ly,u as ue,b as U,A as Aw,aK as Nb,v as vs,bf as aT,k as Ag,j as fl,af as Dg,T as TC,r as Tg,bg as uT,ah as rT,n as eC,ac as mC,t as tC,a9 as dC,aa as If,ab as wf,ag as fT}from'./main-MX6O2FH4.js';import {W as Wn,S as Se}from'./chunk-LlG18Htx.js';import'./chunk-CUmZcEGx.js';import'./chunk-CJdqLI4x.js';var V=()=>[];function F(n,t){if(n&1){let o=dC();vs(0,"agentos-ai-model-item",4),Ag("editRequested",function(e){If(o);let s=mC(2);return wf(s.onEdit(e))})("deleteRequested",function(e){If(o);let s=mC(2);return wf(s.deleteModel(e))}),fl();}n&2&&Tg("model",t);}function O(n,t){if(n&1&&eC(0,F,1,1,"agentos-ai-model-item",3),n&2){let o,i=t.$implicit,e=mC();tC((o=e.resolveModel(i.id))?0:-1,o);}}var S=class n{router=g(G);destroyRef=g(we);aiModelController=g(M);aiProviderController=g($);refresh$=new Tr(void 0);isLoading=Hi(true);data$=this.refresh$.pipe(ma(()=>(this.isLoading.set(true),Ly([this.aiModelController.listPlatformLevelAiModel(),this.aiProviderController.listAiProvider("none")]))));modelItems$=this.data$.pipe(ue(([t,o])=>{let i=new Map(o.map(e=>[e.id??"",e.name]));return t.map(e=>({id:e.id??"",name:e.alias??e.apiModelName,description:e.apiModelName,groupKey:e.aiProviderId,groupLabel:i.get(e.aiProviderId)??e.aiProviderId}))}));modelsById=new Map;constructor(){this.data$.pipe(U(this.destroyRef)).subscribe({next:([t])=>{this.modelsById=new Map(t.map(o=>[o.id??"",o])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","ai-models","new"]);}deleteModel(t){this.aiModelController.deleteAiModel(t.id??"").pipe(U(this.destroyRef)).subscribe(()=>this.refresh$.next());}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","ai-models",t.id,"edit"]);}resolveModel(t){return this.modelsById.get(t)??null}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=Aw({type:n,selectors:[["agentos-platform-ai-models"]],decls:5,vars:7,consts:[["aiModelItemTpl",""],["title","Platform AI Models","emptyMessage","No platform AI models defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"model"],[3,"editRequested","deleteRequested","model"]],template:function(o,i){if(o&1&&(vs(0,"ds-entity-list",1),aT(1,"async"),Ag("createRequested",function(){return i.openCreateForm()}),vs(2,"ds-icon-button",2),Ag("action",function(){return i.goBack()}),fl()(),Dg(3,O,1,1,"ng-template",null,0,fT)),o&2){let e=TC(4);Tg("items",uT(1,4,i.modelItems$)??rT(6,V))("loading",i.isLoading())("showCreate",true)("itemTemplate",e);}},dependencies:[Wn,I,Se,Nb],styles:[".platform-ai-models__back[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;font-family:inherit;font-size:.875rem;color:var(--color-text-secondary, #6e6e73);padding:.25rem .5rem;border-radius:4px;transition:color .15s ease}.platform-ai-models__back[_ngcontent-%COMP%]:hover{color:var(--color-primary, #007aff)}"]})};export{S as PlatformAiModelsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {cb as mB,cc as gB,g,G as G$1,P,m as mT,A as Aw,h as hr,i as Gn,v as vs,k as Ag,n as eC,W as WC,j as fl,b$ as FC,y as Hg,C as Cg,X as XE,t as tC,a8 as Zg,a5 as yl,r as Tg,a9 as dC,aa as If,ac as mC,ab as wf,o as bg}from'./main-IVH4VEHC.js';import {v as ve,n as ne}from'./chunk-CPToRp8s.js';import {V as Ve,n as ne$1}from'./chunk-nl8QJQnq.js';import {y as yt,w as wt}from'./chunk-CxGE3g5u.js';function L(a,e){if(a&1){let n=dC();vs(0,"div",1)(1,"mat-checkbox",21),Ag("click",function(r){return r.stopPropagation()})("change",function(r){If(n);let i=mC();return wf(i.selectionChanged.emit({id:i.task().id,selected:r.checked}))}),fl()();}if(a&2){let n=mC();XE(),Tg("checked",n.selected()),Cg("aria-label","Select task: "+n.task().name);}}function Y(a,e){a&1&&(vs(0,"mat-icon",2),WC(1,"star"),fl());}function W(a,e){a&1&&bg(0,"span",6);}function U(a,e){if(a&1&&(vs(0,"div",7)(1,"mat-icon",22),WC(2,"folder"),fl(),vs(3,"span"),WC(4),fl()()),a&2){let n=mC();XE(4),Zg(n.projectName());}}function B(a,e){if(a&1&&(vs(0,"p",9),WC(1),fl()),a&2){let n=mC();XE(),Zg(n.task().summary);}}function $(a,e){a&1&&(vs(0,"p",10),WC(1,"No summary yet"),fl());}function H(a,e){if(a&1){let n=dC();vs(0,"button",23),Ag("click",function(r){If(n);let i=mC();return wf(i.onOpenDirect(r))}),vs(1,"mat-icon"),WC(2,"open_in_new"),fl()();}}function F(a,e){if(a&1){let n=dC();vs(0,"button",24),Ag("click",function(r){If(n);let i=mC();return wf(i.onStop(r))}),vs(1,"mat-icon"),WC(2,"stop_circle"),fl()();}}function G(a,e){if(a&1){let n=dC();vs(0,"button",25),Ag("click",function(r){If(n);let i=mC();return wf(i.onMarkDone(r))}),vs(1,"mat-icon"),WC(2,"check_circle_outline"),fl()();}}function K(a,e){if(a&1){let n=dC();vs(0,"button",26),Ag("click",function(r){If(n);let i=mC();return wf(i.onMarkActive(r))}),vs(1,"mat-icon"),WC(2,"replay"),fl()();}}function J(a,e){if(a&1){let n=dC();vs(0,"button",27),Ag("click",function(r){If(n);let i=mC();return wf(i.onCloseTask(r))}),vs(1,"mat-icon"),WC(2,"close_fullscreen"),fl()();}}var A=class a{task=mB.required();projectNameOverride=mB(null);showProject=mB(false);previewMode=mB(false);selectable=mB(false);selected=mB(false);stopRequested=gB();deleteRequested=gB();starToggled=gB();closeTaskRequested=gB();markDoneRequested=gB();markActiveRequested=gB();previewRequested=gB();selectionChanged=gB();router=g(G$1);projectState=g(P);projectName=mT(()=>this.projectNameOverride()??this.projectState.getSelectedProjectId());statusLabel=mT(()=>Q[this.task().status]);statusIcon=mT(()=>X[this.task().status]);isWorktree=mT(()=>!!this.task().worktreeProject);navigate(){if(this.previewMode()){this.previewRequested.emit(this.task().id);return}let e=this.projectName();e&&(this.projectState.selectProject(e),this.router.navigate(["project",e,"thread",this.task().id]));}onStop(e){e.stopPropagation(),this.stopRequested.emit(this.task().id);}onDelete(e){e.stopPropagation(),this.deleteRequested.emit(this.task().id);}onStarToggle(e){e.stopPropagation(),this.starToggled.emit(this.task().id);}onCloseTask(e){e.stopPropagation(),this.closeTaskRequested.emit(this.task().id);}onMarkDone(e){e.stopPropagation(),this.markDoneRequested.emit(this.task().id);}onMarkActive(e){e.stopPropagation(),this.markActiveRequested.emit(this.task().id);}onOpenDirect(e){e.stopPropagation();let n=this.projectName();n&&(this.projectState.selectProject(n),this.router.navigate(["project",n,"thread",this.task().id]));}formatRelativeTime(e){let n=Date.now()-new Date(e).getTime(),t=Math.floor(n/6e4);if(t<1)return "just now";if(t<60)return `${t} min ago`;let r=Math.floor(t/60);if(r<24)return `${r}h ago`;let i=Math.floor(r/24);return i===1?"yesterday":i<7?`${i} days ago`:new Date(e).toLocaleDateString("en",{day:"numeric",month:"short"})}static \u0275fac=function(n){return new(n||a)};static \u0275cmp=Aw({type:a,selectors:[["app-task-card"]],inputs:{task:[1,"task"],projectNameOverride:[1,"projectNameOverride"],showProject:[1,"showProject"],previewMode:[1,"previewMode"],selectable:[1,"selectable"],selected:[1,"selected"]},outputs:{stopRequested:"stopRequested",deleteRequested:"deleteRequested",starToggled:"starToggled",closeTaskRequested:"closeTaskRequested",markDoneRequested:"markDoneRequested",markActiveRequested:"markActiveRequested",previewRequested:"previewRequested",selectionChanged:"selectionChanged"},decls:29,vars:25,consts:[["role","button","tabindex","0",1,"task-card",3,"click","keydown.enter","keydown.space"],[1,"selection-checkbox"],["aria-label","Starred",1,"starred-indicator"],[1,"status-badge"],[1,"status-icon"],[1,"status-label"],["aria-hidden","true",1,"pulse-ring"],[1,"task-project"],[1,"task-name"],[1,"task-summary"],[1,"task-summary","empty"],[1,"task-footer"],[1,"task-time"],[1,"task-actions"],["mat-icon-button","","matTooltip","Open full view","aria-label","Open task in full view",1,"action-btn","open-btn"],["mat-icon-button","","matTooltip","Stop agent","aria-label","Stop agent",1,"action-btn","stop-btn"],["mat-icon-button","","matTooltip","Mark as done","aria-label","Mark as done",1,"action-btn","mark-done-btn"],["mat-icon-button","","matTooltip","Mark as active","aria-label","Mark as active",1,"action-btn","mark-active-btn"],["mat-icon-button","",1,"action-btn","star-btn",3,"click","matTooltip"],["mat-icon-button","","matTooltip","Close task (removes worktree)","aria-label","Close task",1,"action-btn","close-task-btn"],["mat-icon-button","","matTooltip","Delete task","aria-label","Delete task",1,"action-btn","delete-btn",3,"click"],[3,"click","change","checked"],[1,"project-icon"],["mat-icon-button","","matTooltip","Open full view","aria-label","Open task in full view",1,"action-btn","open-btn",3,"click"],["mat-icon-button","","matTooltip","Stop agent","aria-label","Stop agent",1,"action-btn","stop-btn",3,"click"],["mat-icon-button","","matTooltip","Mark as done","aria-label","Mark as done",1,"action-btn","mark-done-btn",3,"click"],["mat-icon-button","","matTooltip","Mark as active","aria-label","Mark as active",1,"action-btn","mark-active-btn",3,"click"],["mat-icon-button","","matTooltip","Close task (removes worktree)","aria-label","Close task",1,"action-btn","close-task-btn",3,"click"]],template:function(n,t){n&1&&(vs(0,"article",0),Ag("click",function(){return t.navigate()})("keydown.enter",function(){return t.navigate()})("keydown.space",function(i){return t.navigate(),i.preventDefault()}),eC(1,L,2,2,"div",1),eC(2,Y,2,0,"mat-icon",2),vs(3,"div",3)(4,"mat-icon",4),WC(5),fl(),vs(6,"span",5),WC(7),fl(),eC(8,W,1,0,"span",6),fl(),eC(9,U,5,1,"div",7),vs(10,"h3",8),WC(11),fl(),eC(12,B,2,1,"p",9)(13,$,2,0,"p",10),vs(14,"footer",11)(15,"span",12),WC(16),fl(),vs(17,"div",13),eC(18,H,3,0,"button",14),eC(19,F,3,0,"button",15),eC(20,G,3,0,"button",16)(21,K,3,0,"button",17),vs(22,"button",18),Ag("click",function(i){return t.onStarToggle(i)}),vs(23,"mat-icon"),WC(24),fl()(),eC(25,J,3,0,"button",19),vs(26,"button",20),Ag("click",function(i){return t.onDelete(i)}),vs(27,"mat-icon"),WC(28,"delete_outline"),fl()()()()()),n&2&&(FC("status-"+t.task().status),Hg("is-active",t.task().isActive)("is-selected",t.selected()),Cg("aria-label","Open task: "+t.task().name),XE(),tC(t.selectable()?1:-1),XE(),tC(t.task().starring.length>0?2:-1),XE(3),Zg(t.statusIcon()),XE(2),Zg(t.statusLabel()),XE(),tC(t.task().status==="waiting-you"?8:-1),XE(),tC(t.showProject()&&t.projectName()?9:-1),XE(2),yl(" ",t.task().name||"Unnamed task"," "),XE(),tC(t.task().summary?12:13),XE(4),Zg(t.formatRelativeTime(t.task().modifiedDate)),XE(2),tC(t.previewMode()?18:-1),XE(),tC(t.task().status==="in-progress"?19:-1),XE(),tC(t.task().status!=="done"?20:21),XE(2),Hg("starred",t.task().starring.length>0),Tg("matTooltip",t.task().starring.length>0?"Unstar":"Star"),Cg("aria-label",t.task().starring.length>0?"Unstar task":"Star task"),XE(2),Zg(t.task().starring.length>0?"star":"star_border"),XE(),tC(t.isWorktree()?25:-1));},dependencies:[ve,ne,yt,wt,hr,Gn,Ve,ne$1],styles:['.glass-panel[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow)}.glass-interactive[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-interactive[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-interactive[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-card[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);border-radius:20px;padding:1.5rem}.glass-button[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-button[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-button[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-button[_ngcontent-%COMP%]{border-radius:12px;padding:.75rem 1.5rem;font-weight:600;cursor:pointer}.glass-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed;transform:none}.glass-button[_ngcontent-%COMP%]:disabled:hover{transform:none}.smooth-theme-transition[_ngcontent-%COMP%]{transition:background .3s ease,color .3s ease,border-color .3s ease,box-shadow .3s ease}[_nghost-%COMP%]{display:block}.task-card[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);border-radius:16px;padding:1.25rem;cursor:pointer;position:relative;overflow:hidden;transition:transform .2s cubic-bezier(.4,0,.2,1),box-shadow .2s cubic-bezier(.4,0,.2,1),border-color .2s ease;outline:none;display:flex;flex-direction:column;gap:.5rem;min-height:160px}.task-card[_ngcontent-%COMP%]:hover, .task-card[_ngcontent-%COMP%]:focus-visible{transform:translateY(-3px);box-shadow:0 16px 48px #00000026}.task-card[_ngcontent-%COMP%]:active{transform:translateY(-1px)}.task-card[_ngcontent-%COMP%]:before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;border-radius:16px 0 0 16px;background:var(--status-color, var(--color-text-secondary))}.task-card.status-waiting-you[_ngcontent-%COMP%]{--status-color: var(--color-error);border-color:#ff3b3040}.task-card.status-in-progress[_ngcontent-%COMP%]{--status-color: var(--color-warning);border-color:#ff950033}.task-card.status-done[_ngcontent-%COMP%]{--status-color: var(--color-success)}.task-card.status-paused[_ngcontent-%COMP%]{--status-color: var(--color-text-secondary)}.task-card.status-error[_ngcontent-%COMP%]{--status-color: var(--color-error)}.task-card.is-active[_ngcontent-%COMP%]{box-shadow:var(--glass-shadow),0 0 0 2px rgba(var(--color-primary),.3)}.selection-checkbox[_ngcontent-%COMP%]{position:absolute;right:.875rem;top:1.125rem;z-index:2}.task-card.is-selected[_ngcontent-%COMP%]{border-color:var(--color-primary);box-shadow:var(--glass-shadow),0 0 0 2px var(--color-primary)}.task-card.is-selected[_ngcontent-%COMP%]:before{background:var(--color-primary)}.starred-indicator[_ngcontent-%COMP%]{position:absolute;top:.75rem;right:.75rem;font-size:1rem;width:1rem;height:1rem;color:#f5a623;pointer-events:none}.status-badge[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;position:relative}.status-badge[_ngcontent-%COMP%] .status-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem;color:var(--status-color, var(--color-text-secondary))}.status-in-progress[_ngcontent-%COMP%] .status-badge[_ngcontent-%COMP%] .status-icon[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_spin 2s linear infinite}.status-badge[_ngcontent-%COMP%] .status-label[_ngcontent-%COMP%]{font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--status-color, var(--color-text-secondary))}.status-badge[_ngcontent-%COMP%] .pulse-ring[_ngcontent-%COMP%]{position:absolute;left:-2px;top:-2px;width:20px;height:20px;border-radius:50%;border:2px solid var(--color-error);animation:_ngcontent-%COMP%_pulse 1.5s ease-out infinite;pointer-events:none}.task-project[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;font-size:.72rem;font-weight:600;color:var(--color-primary);opacity:.8;text-transform:uppercase;letter-spacing:.04em}.task-project[_ngcontent-%COMP%] .project-icon[_ngcontent-%COMP%]{font-size:.75rem;width:.75rem;height:.75rem}.task-name[_ngcontent-%COMP%]{margin:0;font-size:.95rem;font-weight:600;color:var(--color-text);line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.task-summary[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4;flex:1;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.task-summary.empty[_ngcontent-%COMP%]{font-style:italic;opacity:.6}.task-footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-top:auto;padding-top:.25rem}.task-time[_ngcontent-%COMP%]{font-size:.72rem;color:var(--color-text-secondary);opacity:.8}.task-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.task-card[_ngcontent-%COMP%]:hover .task-actions[_ngcontent-%COMP%], .task-card[_ngcontent-%COMP%]:focus-within .task-actions[_ngcontent-%COMP%]{opacity:1}.task-actions[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]{width:28px;height:28px;display:flex!important;align-items:center!important;justify-content:center!important;padding:0!important}.task-actions[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem;display:flex;align-items:center;justify-content:center}.task-actions[_ngcontent-%COMP%] .stop-btn[_ngcontent-%COMP%]{color:var(--color-error)}.task-actions[_ngcontent-%COMP%] .mark-done-btn[_ngcontent-%COMP%]{color:var(--color-success)}.task-actions[_ngcontent-%COMP%] .star-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.task-actions[_ngcontent-%COMP%] .star-btn.starred[_ngcontent-%COMP%]{color:#f5a623}.task-actions[_ngcontent-%COMP%] .delete-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.task-actions[_ngcontent-%COMP%] .delete-btn[_ngcontent-%COMP%]:hover{color:var(--color-error)}.task-actions[_ngcontent-%COMP%] .open-btn[_ngcontent-%COMP%]{color:var(--color-primary)}.task-actions[_ngcontent-%COMP%] .open-btn[_ngcontent-%COMP%]:hover{color:var(--color-primary-hover)}@media(max-width:600px){.task-actions[_ngcontent-%COMP%]{opacity:1}.task-actions[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]{width:36px;height:36px}.task-actions[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes _ngcontent-%COMP%_pulse{0%{transform:scale(.8);opacity:1}to{transform:scale(2.2);opacity:0}}']})},Q={"waiting-you":"Waiting for you","in-progress":"In progress\u2026",done:"Done",paused:"Paused",error:"Error"},X={"waiting-you":"mark_unread_chat_alt","in-progress":"pending",done:"check_circle",paused:"pause_circle",error:"error"};var bt=300*1e3,kt={"waiting-you":0,"in-progress":1,done:2,paused:3,error:4};export{A,bt as b,kt as k};
|
|
1
|
+
import {cb as mB,cc as gB,g,G as G$1,P,m as mT,A as Aw,h as hr,i as Gn,v as vs,k as Ag,n as eC,W as WC,j as fl,b$ as FC,y as Hg,C as Cg,X as XE,t as tC,a8 as Zg,a5 as yl,r as Tg,a9 as dC,aa as If,ac as mC,ab as wf,o as bg}from'./main-MX6O2FH4.js';import {v as ve,n as ne}from'./chunk-CkfpO0Ui.js';import {V as Ve,n as ne$1}from'./chunk-CUmZcEGx.js';import {y as yt,w as wt}from'./chunk-CJdqLI4x.js';function L(a,e){if(a&1){let n=dC();vs(0,"div",1)(1,"mat-checkbox",21),Ag("click",function(r){return r.stopPropagation()})("change",function(r){If(n);let i=mC();return wf(i.selectionChanged.emit({id:i.task().id,selected:r.checked}))}),fl()();}if(a&2){let n=mC();XE(),Tg("checked",n.selected()),Cg("aria-label","Select task: "+n.task().name);}}function Y(a,e){a&1&&(vs(0,"mat-icon",2),WC(1,"star"),fl());}function W(a,e){a&1&&bg(0,"span",6);}function U(a,e){if(a&1&&(vs(0,"div",7)(1,"mat-icon",22),WC(2,"folder"),fl(),vs(3,"span"),WC(4),fl()()),a&2){let n=mC();XE(4),Zg(n.projectName());}}function B(a,e){if(a&1&&(vs(0,"p",9),WC(1),fl()),a&2){let n=mC();XE(),Zg(n.task().summary);}}function $(a,e){a&1&&(vs(0,"p",10),WC(1,"No summary yet"),fl());}function H(a,e){if(a&1){let n=dC();vs(0,"button",23),Ag("click",function(r){If(n);let i=mC();return wf(i.onOpenDirect(r))}),vs(1,"mat-icon"),WC(2,"open_in_new"),fl()();}}function F(a,e){if(a&1){let n=dC();vs(0,"button",24),Ag("click",function(r){If(n);let i=mC();return wf(i.onStop(r))}),vs(1,"mat-icon"),WC(2,"stop_circle"),fl()();}}function G(a,e){if(a&1){let n=dC();vs(0,"button",25),Ag("click",function(r){If(n);let i=mC();return wf(i.onMarkDone(r))}),vs(1,"mat-icon"),WC(2,"check_circle_outline"),fl()();}}function K(a,e){if(a&1){let n=dC();vs(0,"button",26),Ag("click",function(r){If(n);let i=mC();return wf(i.onMarkActive(r))}),vs(1,"mat-icon"),WC(2,"replay"),fl()();}}function J(a,e){if(a&1){let n=dC();vs(0,"button",27),Ag("click",function(r){If(n);let i=mC();return wf(i.onCloseTask(r))}),vs(1,"mat-icon"),WC(2,"close_fullscreen"),fl()();}}var A=class a{task=mB.required();projectNameOverride=mB(null);showProject=mB(false);previewMode=mB(false);selectable=mB(false);selected=mB(false);stopRequested=gB();deleteRequested=gB();starToggled=gB();closeTaskRequested=gB();markDoneRequested=gB();markActiveRequested=gB();previewRequested=gB();selectionChanged=gB();router=g(G$1);projectState=g(P);projectName=mT(()=>this.projectNameOverride()??this.projectState.getSelectedProjectId());statusLabel=mT(()=>Q[this.task().status]);statusIcon=mT(()=>X[this.task().status]);isWorktree=mT(()=>!!this.task().worktreeProject);navigate(){if(this.previewMode()){this.previewRequested.emit(this.task().id);return}let e=this.projectName();e&&(this.projectState.selectProject(e),this.router.navigate(["project",e,"thread",this.task().id]));}onStop(e){e.stopPropagation(),this.stopRequested.emit(this.task().id);}onDelete(e){e.stopPropagation(),this.deleteRequested.emit(this.task().id);}onStarToggle(e){e.stopPropagation(),this.starToggled.emit(this.task().id);}onCloseTask(e){e.stopPropagation(),this.closeTaskRequested.emit(this.task().id);}onMarkDone(e){e.stopPropagation(),this.markDoneRequested.emit(this.task().id);}onMarkActive(e){e.stopPropagation(),this.markActiveRequested.emit(this.task().id);}onOpenDirect(e){e.stopPropagation();let n=this.projectName();n&&(this.projectState.selectProject(n),this.router.navigate(["project",n,"thread",this.task().id]));}formatRelativeTime(e){let n=Date.now()-new Date(e).getTime(),t=Math.floor(n/6e4);if(t<1)return "just now";if(t<60)return `${t} min ago`;let r=Math.floor(t/60);if(r<24)return `${r}h ago`;let i=Math.floor(r/24);return i===1?"yesterday":i<7?`${i} days ago`:new Date(e).toLocaleDateString("en",{day:"numeric",month:"short"})}static \u0275fac=function(n){return new(n||a)};static \u0275cmp=Aw({type:a,selectors:[["app-task-card"]],inputs:{task:[1,"task"],projectNameOverride:[1,"projectNameOverride"],showProject:[1,"showProject"],previewMode:[1,"previewMode"],selectable:[1,"selectable"],selected:[1,"selected"]},outputs:{stopRequested:"stopRequested",deleteRequested:"deleteRequested",starToggled:"starToggled",closeTaskRequested:"closeTaskRequested",markDoneRequested:"markDoneRequested",markActiveRequested:"markActiveRequested",previewRequested:"previewRequested",selectionChanged:"selectionChanged"},decls:29,vars:25,consts:[["role","button","tabindex","0",1,"task-card",3,"click","keydown.enter","keydown.space"],[1,"selection-checkbox"],["aria-label","Starred",1,"starred-indicator"],[1,"status-badge"],[1,"status-icon"],[1,"status-label"],["aria-hidden","true",1,"pulse-ring"],[1,"task-project"],[1,"task-name"],[1,"task-summary"],[1,"task-summary","empty"],[1,"task-footer"],[1,"task-time"],[1,"task-actions"],["mat-icon-button","","matTooltip","Open full view","aria-label","Open task in full view",1,"action-btn","open-btn"],["mat-icon-button","","matTooltip","Stop agent","aria-label","Stop agent",1,"action-btn","stop-btn"],["mat-icon-button","","matTooltip","Mark as done","aria-label","Mark as done",1,"action-btn","mark-done-btn"],["mat-icon-button","","matTooltip","Mark as active","aria-label","Mark as active",1,"action-btn","mark-active-btn"],["mat-icon-button","",1,"action-btn","star-btn",3,"click","matTooltip"],["mat-icon-button","","matTooltip","Close task (removes worktree)","aria-label","Close task",1,"action-btn","close-task-btn"],["mat-icon-button","","matTooltip","Delete task","aria-label","Delete task",1,"action-btn","delete-btn",3,"click"],[3,"click","change","checked"],[1,"project-icon"],["mat-icon-button","","matTooltip","Open full view","aria-label","Open task in full view",1,"action-btn","open-btn",3,"click"],["mat-icon-button","","matTooltip","Stop agent","aria-label","Stop agent",1,"action-btn","stop-btn",3,"click"],["mat-icon-button","","matTooltip","Mark as done","aria-label","Mark as done",1,"action-btn","mark-done-btn",3,"click"],["mat-icon-button","","matTooltip","Mark as active","aria-label","Mark as active",1,"action-btn","mark-active-btn",3,"click"],["mat-icon-button","","matTooltip","Close task (removes worktree)","aria-label","Close task",1,"action-btn","close-task-btn",3,"click"]],template:function(n,t){n&1&&(vs(0,"article",0),Ag("click",function(){return t.navigate()})("keydown.enter",function(){return t.navigate()})("keydown.space",function(i){return t.navigate(),i.preventDefault()}),eC(1,L,2,2,"div",1),eC(2,Y,2,0,"mat-icon",2),vs(3,"div",3)(4,"mat-icon",4),WC(5),fl(),vs(6,"span",5),WC(7),fl(),eC(8,W,1,0,"span",6),fl(),eC(9,U,5,1,"div",7),vs(10,"h3",8),WC(11),fl(),eC(12,B,2,1,"p",9)(13,$,2,0,"p",10),vs(14,"footer",11)(15,"span",12),WC(16),fl(),vs(17,"div",13),eC(18,H,3,0,"button",14),eC(19,F,3,0,"button",15),eC(20,G,3,0,"button",16)(21,K,3,0,"button",17),vs(22,"button",18),Ag("click",function(i){return t.onStarToggle(i)}),vs(23,"mat-icon"),WC(24),fl()(),eC(25,J,3,0,"button",19),vs(26,"button",20),Ag("click",function(i){return t.onDelete(i)}),vs(27,"mat-icon"),WC(28,"delete_outline"),fl()()()()()),n&2&&(FC("status-"+t.task().status),Hg("is-active",t.task().isActive)("is-selected",t.selected()),Cg("aria-label","Open task: "+t.task().name),XE(),tC(t.selectable()?1:-1),XE(),tC(t.task().starring.length>0?2:-1),XE(3),Zg(t.statusIcon()),XE(2),Zg(t.statusLabel()),XE(),tC(t.task().status==="waiting-you"?8:-1),XE(),tC(t.showProject()&&t.projectName()?9:-1),XE(2),yl(" ",t.task().name||"Unnamed task"," "),XE(),tC(t.task().summary?12:13),XE(4),Zg(t.formatRelativeTime(t.task().modifiedDate)),XE(2),tC(t.previewMode()?18:-1),XE(),tC(t.task().status==="in-progress"?19:-1),XE(),tC(t.task().status!=="done"?20:21),XE(2),Hg("starred",t.task().starring.length>0),Tg("matTooltip",t.task().starring.length>0?"Unstar":"Star"),Cg("aria-label",t.task().starring.length>0?"Unstar task":"Star task"),XE(2),Zg(t.task().starring.length>0?"star":"star_border"),XE(),tC(t.isWorktree()?25:-1));},dependencies:[ve,ne,yt,wt,hr,Gn,Ve,ne$1],styles:['.glass-panel[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow)}.glass-interactive[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-interactive[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-interactive[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-card[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);border-radius:20px;padding:1.5rem}.glass-button[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-button[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-button[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-button[_ngcontent-%COMP%]{border-radius:12px;padding:.75rem 1.5rem;font-weight:600;cursor:pointer}.glass-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed;transform:none}.glass-button[_ngcontent-%COMP%]:disabled:hover{transform:none}.smooth-theme-transition[_ngcontent-%COMP%]{transition:background .3s ease,color .3s ease,border-color .3s ease,box-shadow .3s ease}[_nghost-%COMP%]{display:block}.task-card[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);border-radius:16px;padding:1.25rem;cursor:pointer;position:relative;overflow:hidden;transition:transform .2s cubic-bezier(.4,0,.2,1),box-shadow .2s cubic-bezier(.4,0,.2,1),border-color .2s ease;outline:none;display:flex;flex-direction:column;gap:.5rem;min-height:160px}.task-card[_ngcontent-%COMP%]:hover, .task-card[_ngcontent-%COMP%]:focus-visible{transform:translateY(-3px);box-shadow:0 16px 48px #00000026}.task-card[_ngcontent-%COMP%]:active{transform:translateY(-1px)}.task-card[_ngcontent-%COMP%]:before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;border-radius:16px 0 0 16px;background:var(--status-color, var(--color-text-secondary))}.task-card.status-waiting-you[_ngcontent-%COMP%]{--status-color: var(--color-error);border-color:#ff3b3040}.task-card.status-in-progress[_ngcontent-%COMP%]{--status-color: var(--color-warning);border-color:#ff950033}.task-card.status-done[_ngcontent-%COMP%]{--status-color: var(--color-success)}.task-card.status-paused[_ngcontent-%COMP%]{--status-color: var(--color-text-secondary)}.task-card.status-error[_ngcontent-%COMP%]{--status-color: var(--color-error)}.task-card.is-active[_ngcontent-%COMP%]{box-shadow:var(--glass-shadow),0 0 0 2px rgba(var(--color-primary),.3)}.selection-checkbox[_ngcontent-%COMP%]{position:absolute;right:.875rem;top:1.125rem;z-index:2}.task-card.is-selected[_ngcontent-%COMP%]{border-color:var(--color-primary);box-shadow:var(--glass-shadow),0 0 0 2px var(--color-primary)}.task-card.is-selected[_ngcontent-%COMP%]:before{background:var(--color-primary)}.starred-indicator[_ngcontent-%COMP%]{position:absolute;top:.75rem;right:.75rem;font-size:1rem;width:1rem;height:1rem;color:#f5a623;pointer-events:none}.status-badge[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;position:relative}.status-badge[_ngcontent-%COMP%] .status-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem;color:var(--status-color, var(--color-text-secondary))}.status-in-progress[_ngcontent-%COMP%] .status-badge[_ngcontent-%COMP%] .status-icon[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_spin 2s linear infinite}.status-badge[_ngcontent-%COMP%] .status-label[_ngcontent-%COMP%]{font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--status-color, var(--color-text-secondary))}.status-badge[_ngcontent-%COMP%] .pulse-ring[_ngcontent-%COMP%]{position:absolute;left:-2px;top:-2px;width:20px;height:20px;border-radius:50%;border:2px solid var(--color-error);animation:_ngcontent-%COMP%_pulse 1.5s ease-out infinite;pointer-events:none}.task-project[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;font-size:.72rem;font-weight:600;color:var(--color-primary);opacity:.8;text-transform:uppercase;letter-spacing:.04em}.task-project[_ngcontent-%COMP%] .project-icon[_ngcontent-%COMP%]{font-size:.75rem;width:.75rem;height:.75rem}.task-name[_ngcontent-%COMP%]{margin:0;font-size:.95rem;font-weight:600;color:var(--color-text);line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.task-summary[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4;flex:1;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.task-summary.empty[_ngcontent-%COMP%]{font-style:italic;opacity:.6}.task-footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-top:auto;padding-top:.25rem}.task-time[_ngcontent-%COMP%]{font-size:.72rem;color:var(--color-text-secondary);opacity:.8}.task-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.task-card[_ngcontent-%COMP%]:hover .task-actions[_ngcontent-%COMP%], .task-card[_ngcontent-%COMP%]:focus-within .task-actions[_ngcontent-%COMP%]{opacity:1}.task-actions[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]{width:28px;height:28px;display:flex!important;align-items:center!important;justify-content:center!important;padding:0!important}.task-actions[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem;display:flex;align-items:center;justify-content:center}.task-actions[_ngcontent-%COMP%] .stop-btn[_ngcontent-%COMP%]{color:var(--color-error)}.task-actions[_ngcontent-%COMP%] .mark-done-btn[_ngcontent-%COMP%]{color:var(--color-success)}.task-actions[_ngcontent-%COMP%] .star-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.task-actions[_ngcontent-%COMP%] .star-btn.starred[_ngcontent-%COMP%]{color:#f5a623}.task-actions[_ngcontent-%COMP%] .delete-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.task-actions[_ngcontent-%COMP%] .delete-btn[_ngcontent-%COMP%]:hover{color:var(--color-error)}.task-actions[_ngcontent-%COMP%] .open-btn[_ngcontent-%COMP%]{color:var(--color-primary)}.task-actions[_ngcontent-%COMP%] .open-btn[_ngcontent-%COMP%]:hover{color:var(--color-primary-hover)}@media(max-width:600px){.task-actions[_ngcontent-%COMP%]{opacity:1}.task-actions[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]{width:36px;height:36px}.task-actions[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes _ngcontent-%COMP%_pulse{0%{transform:scale(.8);opacity:1}to{transform:scale(2.2);opacity:0}}']})},Q={"waiting-you":"Waiting for you","in-progress":"In progress\u2026",done:"Done",paused:"Paused",error:"Error"},X={"waiting-you":"mark_unread_chat_alt","in-progress":"pending",done:"check_circle",paused:"pause_circle",error:"error"};var bt=300*1e3,kt={"waiting-you":0,"in-progress":1,done:2,paused:3,error:4};export{A,bt as b,kt as k};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {c as ce,s as se,b as at$1,d as de}from'./chunk-D96l2x9x.js';import {a as Dr,b as gr,_ as _r,g as gt,z as zi,F as Fn,H as Hi$1}from'./chunk-CAbLeq_f.js';import {W as We,Q as Qt$1}from'./chunk-nl8QJQnq.js';import {aK as Do,aL as qn,bD as ge,aN as wt,bE as vt,g,bN as F,bs as Cl,az as Qt,bt as Qn,aS as Ut,aQ as As,c4 as On,aV as w,aR as K,an as ce$1,H as Hi,bQ as Zy,bR as bd,bS as ma,bP as Yy,al as yt,ae as Ot,u as ue,by as am,c5 as Et,ap as Vy,aA as sn,bu as Ve,c6 as Rt,bH as Pt$1,c1 as E,A as Aw,c7 as _e$1,aC as Cu,aZ as YT,c8 as QT,bA as vC,v as vs,k as Ag,n as eC,j as fl,c9 as kf,o as bg,af as Dg,T as TC,X as XE,C as Cg,t as tC,r as Tg,b4 as nT,y as Hg,D as Fg,I as IC,E as wC,bv as kg,bL as pe,c3 as kt,W as WC,ac as mC,a8 as Zg,a9 as dC,aa as If,ab as wf,bB as DC,b$ as FC}from'./main-IVH4VEHC.js';import {_,b as _e,d as an,E as En}from'./chunk-CxGE3g5u.js';var Qe=["trigger"],Ye=["panel"],Ue=[[["mat-select-trigger"]],"*"],Xe=["mat-select-trigger","*"];function Je(a,_){if(a&1&&(vs(0,"span",4),WC(1),fl()),a&2){let e=mC();XE(),Zg(e.placeholder);}}function Ze(a,_){a&1&&DC(0);}function $e(a,_){if(a&1&&(vs(0,"span",11),WC(1),fl()),a&2){let e=mC(2);XE(),Zg(e.triggerValue);}}function et(a,_){if(a&1&&(vs(0,"span",5),eC(1,Ze,1,0)(2,$e,2,1,"span",11),fl()),a&2){let e=mC();XE(),tC(e.customTrigger?1:2);}}function tt(a,_){if(a&1){let e=dC();vs(0,"div",12,1),Ag("keydown",function(i){If(e);let n=mC();return wf(n._handleKeydown(i))}),DC(2,1),fl();}if(a&2){let e=mC();FC(e.panelClass),Hg("mat-select-panel-animations-enabled",!e._animationsDisabled)("mat-primary",e._parentFormField?.color==="primary")("mat-accent",e._parentFormField?.color==="accent")("mat-warn",e._parentFormField?.color==="warn")("mat-undefined",!e._parentFormField?.color),Cg("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby());}}var it=new w("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let a=g(pe);return ()=>kt(a)}}),nt=new w("MAT_SELECT_CONFIG"),at=new w("MatSelectTrigger"),B=class{source;value;constructor(_,e){this.source=_,this.value=e;}},Lt=(()=>{class a{_viewportRuler=g(F);_changeDetectorRef=g(Cl);_elementRef=g(Qt);_dir=g(Qn,{optional:true});_idGenerator=g(Ut);_renderer=g(As);_parentFormField=g(se,{optional:true});ngControl=g(_,{self:true,optional:true});_liveAnnouncer=g(On);_defaultOptions=g(nt,{optional:true});_animationsDisabled=K();_popoverLocation;_initialized=new ce$1;_cleanupDetach;options;optionGroups;customTrigger;_positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}];_scrollOptionIntoView(e){let t=this.options.toArray()[e];if(t){let i=this.panel.nativeElement,n=gr(e,this.options,this.optionGroups),r=t._getHostElement();e===0&&n===1?i.scrollTop=0:i.scrollTop=_r(r.offsetTop,r.offsetHeight,i.scrollTop,i.offsetHeight);}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0);}_getChangeEvent(e){return new B(this,e)}_scrollStrategyFactory=g(it);_panelOpen=false;_compareWith=(e,t)=>e===t;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new ce$1;_errorStateTracker;stateChanges=new ce$1;disableAutomaticLabeling=true;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=false;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=false;get disableRipple(){return this._disableRipple()}set disableRipple(e){this._disableRipple.set(e);}_disableRipple=Hi(false);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties();}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??false;get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next();}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(_e.required)??false}set required(e){this._required=e,this.stateChanges.next();}_required;get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e;}_multiple=false;disableOptionCentering=this._defaultOptions?.disableOptionCentering??false;get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection();}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e);}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e;}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next();}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e;}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??false;optionSelectionChanges=Zy(()=>{let e=this.options;return e?e.changes.pipe(bd(e),ma(()=>Yy(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(ma(()=>this.optionSelectionChanges))});openedChange=new yt;_openedStream=this.openedChange.pipe(Ot(e=>e),ue(()=>{}));_closedStream=this.openedChange.pipe(Ot(e=>!e),ue(()=>{}));selectionChange=new yt;valueChange=new yt;constructor(){let e=g(We),t=g(an,{optional:true}),i=g(En,{optional:true}),n=g(new am("tabindex"),{optional:true}),r=g(Et,{optional:true}),d=g(at$1,{optional:true,self:true});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new Qt$1(e,d||this.ngControl,i,t,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=n==null?0:parseInt(n)||0,this._popoverLocation=r?.usePopover===false?null:"inline",this.id=this.id;}ngOnInit(){this._selectionModel=new gt(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(Vy(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges());});}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(Vy(this._destroy)).subscribe(e=>{e.added.forEach(t=>t.select()),e.removed.forEach(t=>t.deselect());}),this.options.changes.pipe(bd(null),Vy(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection();});}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),t=this.ngControl;if(e!==this._triggerAriaLabelledBy){let i=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?i.setAttribute("aria-labelledby",e):i.removeAttribute("aria-labelledby");}t&&(this._previousControl!==t.control&&(this._previousControl!==void 0&&t.disabled!==null&&t.disabled!==this.disabled&&(this.disabled=t.disabled),this._previousControl=t.control),this.updateErrorState());}ngOnChanges(e){(e.disabled||e.userAriaDescribedBy)&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval),e.panelClass&&this.panelClass instanceof Set&&(this.panelClass=Array.from(this.panelClass));}ngOnDestroy(){this._cleanupDetach?.(),this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete();}toggle(){this.panelOpen?this.close():this.open();}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._panelOpen=true,this._overlayDir.positionChange.pipe(sn(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled();}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(true)));}close(){this._panelOpen&&(this._panelOpen=false,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(false)));}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{t(),clearTimeout(i),this._cleanupDetach=void 0;};let e=this.panel.nativeElement,t=this._renderer.listen(e,"animationend",n=>{n.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay());}),i=setTimeout(()=>{this._cleanupDetach?.(),this._detachOverlay();},200);e.classList.add("mat-select-panel-exit");}_detachOverlay(){this._overlayDir.detachOverlay(),this._changeDetectorRef.markForCheck();}writeValue(e){this._assignValue(e);}registerOnChange(e){this._onChange=e;}registerOnTouched(e){this._onTouched=e;}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next();}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return "";if(this._multiple){let e=this._selectionModel.selected.map(t=>t.viewValue);return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState();}_isRtl(){return this._dir?this._dir.value==="rtl":false}_handleKeydown(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e));}_handleClosedKeydown(e){let t=e.keyCode,i=t===40||t===38||t===37||t===39,n=t===13||t===32,r=this._keyManager;if(!r.isTyping()&&n&&!Ve(e)||(this.multiple||e.altKey)&&i)e.preventDefault(),this.open();else if(!this.multiple){let d=this.selected;r.onKeydown(e);let o=this.selected;o&&d!==o&&this._liveAnnouncer.announce(o.viewValue,1e4);}}_handleOpenKeydown(e){let t=this._keyManager,i=e.keyCode,n=i===40||i===38,r=t.isTyping();if(n&&e.altKey)e.preventDefault(),this.close();else if(!r&&(i===13||i===32)&&t.activeItem&&!Ve(e))e.preventDefault(),t.activeItem._selectViaInteraction();else if(!r&&this._multiple&&i===65&&e.ctrlKey){e.preventDefault();let d=this.options.some(o=>!o.disabled&&!o.selected);this.options.forEach(o=>{o.disabled||(d?o.select():o.deselect());});}else {let d=t.activeItemIndex;t.onKeydown(e),this._multiple&&n&&e.shiftKey&&t.activeItem&&t.activeItemIndex!==d&&t.activeItem._selectViaInteraction();}}_handleOverlayKeydown(e){e.keyCode===27&&!Ve(e)&&(e.preventDefault(),this.close());}_onFocus(){this.disabled||(this._focused=true,this.stateChanges.next());}_onBlur(){this._focused=false,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next());}get empty(){return !this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next();});}_setSelectionByValue(e){if(this.options.forEach(t=>t.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)e.forEach(t=>this._selectOptionByValue(t)),this._sortValues();else {let t=this._selectOptionByValue(e);t?this._keyManager.updateActiveItem(t):this.panelOpen||this._keyManager.updateActiveItem(-1);}this._changeDetectorRef.markForCheck();}_selectOptionByValue(e){let t=this.options.find(i=>{if(this._selectionModel.isSelected(i))return false;try{return (i.value!=null||this.canSelectNullableOptions)&&this._compareWith(i.value,e)}catch(n){return false}});return t&&this._selectionModel.select(t),t}_assignValue(e){return e!==this._value||this._multiple&&Array.isArray(e)?(this.options&&this._setSelectionByValue(e),this._value=e,true):false}_skipPredicate=e=>this.panelOpen?false:e.disabled;_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof Rt?e.elementRef:e||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck();}_initKeyManager(){this._keyManager=new Pt$1(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close());}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction();});}_resetOptions(){let e=Yy(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(Vy(e)).subscribe(t=>{this._onSelect(t.source,t.isUserInput),t.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus());}),Yy(...this.options.map(t=>t._stateChanges)).pipe(Vy(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next();});}_onSelect(e,t){let i=this._selectionModel.isSelected(e);!this.canSelectNullableOptions&&e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(i!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),t&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),t&&this.focus())),i!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next();}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((t,i)=>this.sortComparator?this.sortComparator(t,i,e):e.indexOf(t)-e.indexOf(i)),this.stateChanges.next();}}_propagateChanges(e){let t;this.multiple?t=this.selected.map(i=>i.value):t=this.selected?this.selected.value:e,this._value=t,this.valueChange.emit(t),this._onChange(t),this.selectionChange.emit(this._getChangeEvent(t)),this._changeDetectorRef.markForCheck();}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let t=0;t<this.options.length;t++)if(!this.options.get(t).disabled){e=t;break}this._keyManager.setActiveItem(e);}else this._keyManager.setActiveItem(this._selectionModel.selected[0]);}_canOpen(){return !this._panelOpen&&!this.disabled&&this.options?.length>0&&!!this._overlayDir}focus(e){this._elementRef.nativeElement.focus(e);}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||null,t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||"";return this.ariaLabelledby&&(e+=" "+this.ariaLabelledby),e||(e=this._valueId),e}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){let t=this._elementRef.nativeElement;e.length?t.setAttribute("aria-describedby",e.join(" ")):t.removeAttribute("aria-describedby");}onContainerClick(e){let t=E(e);t&&(t.tagName==="MAT-OPTION"||t.classList.contains("cdk-overlay-backdrop")||t.closest(".mat-mdc-select-panel"))||(this.focus(),this.open());}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=Aw({type:a,selectors:[["mat-select"]],contentQueries:function(t,i,n){if(t&1&&kg(n,at,5)(n,Fn,5)(n,Hi$1,5),t&2){let r;IC(r=wC())&&(i.customTrigger=r.first),IC(r=wC())&&(i.options=r),IC(r=wC())&&(i.optionGroups=r);}},viewQuery:function(t,i){if(t&1&&Fg(Qe,5)(Ye,5)(_e$1,5),t&2){let n;IC(n=wC())&&(i.trigger=n.first),IC(n=wC())&&(i.panel=n.first),IC(n=wC())&&(i._overlayDir=n.first);}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:21,hostBindings:function(t,i){t&1&&Ag("keydown",function(r){return i._handleKeydown(r)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),t&2&&(Cg("id",i.id)("tabindex",i.disabled?-1:i.tabIndex)("aria-controls",i.panelOpen?i.id+"-panel":null)("aria-expanded",i.panelOpen)("aria-label",i.ariaLabel||null)("aria-required",i.required.toString())("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-activedescendant",i._getAriaActiveDescendant()),Hg("mat-mdc-select-disabled",i.disabled)("mat-mdc-select-invalid",i.errorState)("mat-mdc-select-required",i.required)("mat-mdc-select-empty",i.empty)("mat-mdc-select-multiple",i.multiple)("mat-select-open",i.panelOpen));},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",YT],disableRipple:[2,"disableRipple","disableRipple",YT],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:QT(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",YT],placeholder:"placeholder",required:[2,"required","required",YT],multiple:[2,"multiple","multiple",YT],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",YT],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",QT],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",YT]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[nT([{provide:de,useExisting:a},{provide:zi,useExisting:a}]),Cu],ngContentSelectors:Xe,decls:11,vars:10,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"detach","backdropClick","overlayKeydown","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth","cdkConnectedOverlayFlexibleDimensions","cdkConnectedOverlayUsePopover"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",1,"mat-mdc-select-panel","mdc-menu-surface","mdc-menu-surface--open",3,"keydown"]],template:function(t,i){if(t&1&&(vC(Ue),vs(0,"div",2,0),Ag("click",function(){return i.open()}),vs(3,"div",3),eC(4,Je,2,1,"span",4)(5,et,3,1,"span",5),fl(),vs(6,"div",6)(7,"div",7),kf(),vs(8,"svg",8),bg(9,"path",9),fl()()()(),Dg(10,tt,3,16,"ng-template",10),Ag("detach",function(){return i.close()})("backdropClick",function(){return i.close()})("overlayKeydown",function(r){return i._handleOverlayKeydown(r)})),t&2){let n=TC(1);XE(3),Cg("id",i._valueId),XE(),tC(i.empty?4:5),XE(6),Tg("cdkConnectedOverlayDisableClose",true)("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",i._preferredOverlayOrigin||n)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayWidth",i._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",true)("cdkConnectedOverlayUsePopover",i._popoverLocation);}},dependencies:[Rt,_e$1],styles:[`@keyframes _mat-select-enter {
|
|
1
|
+
import {c as ce,s as se,b as at$1,d as de}from'./chunk-B8YsdH5W.js';import {a as Dr,b as gr,_ as _r,g as gt,z as zi,F as Fn,H as Hi$1}from'./chunk-LlG18Htx.js';import {W as We,Q as Qt$1}from'./chunk-CUmZcEGx.js';import {aL as Do,aM as qn,bD as ge,aO as wt,bE as vt,g,bN as F,bs as Cl,az as Qt,bt as Qn,aT as Ut,aR as As,c4 as On,aW as w,aS as K,an as ce$1,H as Hi,bQ as Zy,bR as bd,bS as ma,bP as Yy,al as yt,ae as Ot,u as ue,by as am,c5 as Et,ap as Vy,aA as sn,bu as Ve,c6 as Rt,bH as Pt$1,c1 as E,A as Aw,c7 as _e$1,aC as Cu,a_ as YT,c8 as QT,bA as vC,v as vs,k as Ag,n as eC,j as fl,c9 as kf,o as bg,af as Dg,T as TC,X as XE,C as Cg,t as tC,r as Tg,b5 as nT,y as Hg,D as Fg,I as IC,E as wC,bv as kg,bL as pe,c3 as kt,W as WC,ac as mC,a8 as Zg,a9 as dC,aa as If,ab as wf,bB as DC,b$ as FC}from'./main-MX6O2FH4.js';import {_,b as _e,d as an,E as En}from'./chunk-CJdqLI4x.js';var Qe=["trigger"],Ye=["panel"],Ue=[[["mat-select-trigger"]],"*"],Xe=["mat-select-trigger","*"];function Je(a,_){if(a&1&&(vs(0,"span",4),WC(1),fl()),a&2){let e=mC();XE(),Zg(e.placeholder);}}function Ze(a,_){a&1&&DC(0);}function $e(a,_){if(a&1&&(vs(0,"span",11),WC(1),fl()),a&2){let e=mC(2);XE(),Zg(e.triggerValue);}}function et(a,_){if(a&1&&(vs(0,"span",5),eC(1,Ze,1,0)(2,$e,2,1,"span",11),fl()),a&2){let e=mC();XE(),tC(e.customTrigger?1:2);}}function tt(a,_){if(a&1){let e=dC();vs(0,"div",12,1),Ag("keydown",function(i){If(e);let n=mC();return wf(n._handleKeydown(i))}),DC(2,1),fl();}if(a&2){let e=mC();FC(e.panelClass),Hg("mat-select-panel-animations-enabled",!e._animationsDisabled)("mat-primary",e._parentFormField?.color==="primary")("mat-accent",e._parentFormField?.color==="accent")("mat-warn",e._parentFormField?.color==="warn")("mat-undefined",!e._parentFormField?.color),Cg("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby());}}var it=new w("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let a=g(pe);return ()=>kt(a)}}),nt=new w("MAT_SELECT_CONFIG"),at=new w("MatSelectTrigger"),B=class{source;value;constructor(_,e){this.source=_,this.value=e;}},Lt=(()=>{class a{_viewportRuler=g(F);_changeDetectorRef=g(Cl);_elementRef=g(Qt);_dir=g(Qn,{optional:true});_idGenerator=g(Ut);_renderer=g(As);_parentFormField=g(se,{optional:true});ngControl=g(_,{self:true,optional:true});_liveAnnouncer=g(On);_defaultOptions=g(nt,{optional:true});_animationsDisabled=K();_popoverLocation;_initialized=new ce$1;_cleanupDetach;options;optionGroups;customTrigger;_positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}];_scrollOptionIntoView(e){let t=this.options.toArray()[e];if(t){let i=this.panel.nativeElement,n=gr(e,this.options,this.optionGroups),r=t._getHostElement();e===0&&n===1?i.scrollTop=0:i.scrollTop=_r(r.offsetTop,r.offsetHeight,i.scrollTop,i.offsetHeight);}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0);}_getChangeEvent(e){return new B(this,e)}_scrollStrategyFactory=g(it);_panelOpen=false;_compareWith=(e,t)=>e===t;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new ce$1;_errorStateTracker;stateChanges=new ce$1;disableAutomaticLabeling=true;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=false;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=false;get disableRipple(){return this._disableRipple()}set disableRipple(e){this._disableRipple.set(e);}_disableRipple=Hi(false);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties();}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??false;get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next();}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(_e.required)??false}set required(e){this._required=e,this.stateChanges.next();}_required;get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e;}_multiple=false;disableOptionCentering=this._defaultOptions?.disableOptionCentering??false;get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection();}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e);}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e;}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next();}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e;}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??false;optionSelectionChanges=Zy(()=>{let e=this.options;return e?e.changes.pipe(bd(e),ma(()=>Yy(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(ma(()=>this.optionSelectionChanges))});openedChange=new yt;_openedStream=this.openedChange.pipe(Ot(e=>e),ue(()=>{}));_closedStream=this.openedChange.pipe(Ot(e=>!e),ue(()=>{}));selectionChange=new yt;valueChange=new yt;constructor(){let e=g(We),t=g(an,{optional:true}),i=g(En,{optional:true}),n=g(new am("tabindex"),{optional:true}),r=g(Et,{optional:true}),d=g(at$1,{optional:true,self:true});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new Qt$1(e,d||this.ngControl,i,t,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=n==null?0:parseInt(n)||0,this._popoverLocation=r?.usePopover===false?null:"inline",this.id=this.id;}ngOnInit(){this._selectionModel=new gt(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(Vy(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges());});}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(Vy(this._destroy)).subscribe(e=>{e.added.forEach(t=>t.select()),e.removed.forEach(t=>t.deselect());}),this.options.changes.pipe(bd(null),Vy(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection();});}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),t=this.ngControl;if(e!==this._triggerAriaLabelledBy){let i=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?i.setAttribute("aria-labelledby",e):i.removeAttribute("aria-labelledby");}t&&(this._previousControl!==t.control&&(this._previousControl!==void 0&&t.disabled!==null&&t.disabled!==this.disabled&&(this.disabled=t.disabled),this._previousControl=t.control),this.updateErrorState());}ngOnChanges(e){(e.disabled||e.userAriaDescribedBy)&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval),e.panelClass&&this.panelClass instanceof Set&&(this.panelClass=Array.from(this.panelClass));}ngOnDestroy(){this._cleanupDetach?.(),this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete();}toggle(){this.panelOpen?this.close():this.open();}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._panelOpen=true,this._overlayDir.positionChange.pipe(sn(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled();}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(true)));}close(){this._panelOpen&&(this._panelOpen=false,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(false)));}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{t(),clearTimeout(i),this._cleanupDetach=void 0;};let e=this.panel.nativeElement,t=this._renderer.listen(e,"animationend",n=>{n.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay());}),i=setTimeout(()=>{this._cleanupDetach?.(),this._detachOverlay();},200);e.classList.add("mat-select-panel-exit");}_detachOverlay(){this._overlayDir.detachOverlay(),this._changeDetectorRef.markForCheck();}writeValue(e){this._assignValue(e);}registerOnChange(e){this._onChange=e;}registerOnTouched(e){this._onTouched=e;}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next();}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return "";if(this._multiple){let e=this._selectionModel.selected.map(t=>t.viewValue);return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState();}_isRtl(){return this._dir?this._dir.value==="rtl":false}_handleKeydown(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e));}_handleClosedKeydown(e){let t=e.keyCode,i=t===40||t===38||t===37||t===39,n=t===13||t===32,r=this._keyManager;if(!r.isTyping()&&n&&!Ve(e)||(this.multiple||e.altKey)&&i)e.preventDefault(),this.open();else if(!this.multiple){let d=this.selected;r.onKeydown(e);let o=this.selected;o&&d!==o&&this._liveAnnouncer.announce(o.viewValue,1e4);}}_handleOpenKeydown(e){let t=this._keyManager,i=e.keyCode,n=i===40||i===38,r=t.isTyping();if(n&&e.altKey)e.preventDefault(),this.close();else if(!r&&(i===13||i===32)&&t.activeItem&&!Ve(e))e.preventDefault(),t.activeItem._selectViaInteraction();else if(!r&&this._multiple&&i===65&&e.ctrlKey){e.preventDefault();let d=this.options.some(o=>!o.disabled&&!o.selected);this.options.forEach(o=>{o.disabled||(d?o.select():o.deselect());});}else {let d=t.activeItemIndex;t.onKeydown(e),this._multiple&&n&&e.shiftKey&&t.activeItem&&t.activeItemIndex!==d&&t.activeItem._selectViaInteraction();}}_handleOverlayKeydown(e){e.keyCode===27&&!Ve(e)&&(e.preventDefault(),this.close());}_onFocus(){this.disabled||(this._focused=true,this.stateChanges.next());}_onBlur(){this._focused=false,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next());}get empty(){return !this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next();});}_setSelectionByValue(e){if(this.options.forEach(t=>t.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)e.forEach(t=>this._selectOptionByValue(t)),this._sortValues();else {let t=this._selectOptionByValue(e);t?this._keyManager.updateActiveItem(t):this.panelOpen||this._keyManager.updateActiveItem(-1);}this._changeDetectorRef.markForCheck();}_selectOptionByValue(e){let t=this.options.find(i=>{if(this._selectionModel.isSelected(i))return false;try{return (i.value!=null||this.canSelectNullableOptions)&&this._compareWith(i.value,e)}catch(n){return false}});return t&&this._selectionModel.select(t),t}_assignValue(e){return e!==this._value||this._multiple&&Array.isArray(e)?(this.options&&this._setSelectionByValue(e),this._value=e,true):false}_skipPredicate=e=>this.panelOpen?false:e.disabled;_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof Rt?e.elementRef:e||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck();}_initKeyManager(){this._keyManager=new Pt$1(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close());}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction();});}_resetOptions(){let e=Yy(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(Vy(e)).subscribe(t=>{this._onSelect(t.source,t.isUserInput),t.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus());}),Yy(...this.options.map(t=>t._stateChanges)).pipe(Vy(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next();});}_onSelect(e,t){let i=this._selectionModel.isSelected(e);!this.canSelectNullableOptions&&e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(i!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),t&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),t&&this.focus())),i!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next();}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((t,i)=>this.sortComparator?this.sortComparator(t,i,e):e.indexOf(t)-e.indexOf(i)),this.stateChanges.next();}}_propagateChanges(e){let t;this.multiple?t=this.selected.map(i=>i.value):t=this.selected?this.selected.value:e,this._value=t,this.valueChange.emit(t),this._onChange(t),this.selectionChange.emit(this._getChangeEvent(t)),this._changeDetectorRef.markForCheck();}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let t=0;t<this.options.length;t++)if(!this.options.get(t).disabled){e=t;break}this._keyManager.setActiveItem(e);}else this._keyManager.setActiveItem(this._selectionModel.selected[0]);}_canOpen(){return !this._panelOpen&&!this.disabled&&this.options?.length>0&&!!this._overlayDir}focus(e){this._elementRef.nativeElement.focus(e);}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||null,t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||"";return this.ariaLabelledby&&(e+=" "+this.ariaLabelledby),e||(e=this._valueId),e}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){let t=this._elementRef.nativeElement;e.length?t.setAttribute("aria-describedby",e.join(" ")):t.removeAttribute("aria-describedby");}onContainerClick(e){let t=E(e);t&&(t.tagName==="MAT-OPTION"||t.classList.contains("cdk-overlay-backdrop")||t.closest(".mat-mdc-select-panel"))||(this.focus(),this.open());}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=Aw({type:a,selectors:[["mat-select"]],contentQueries:function(t,i,n){if(t&1&&kg(n,at,5)(n,Fn,5)(n,Hi$1,5),t&2){let r;IC(r=wC())&&(i.customTrigger=r.first),IC(r=wC())&&(i.options=r),IC(r=wC())&&(i.optionGroups=r);}},viewQuery:function(t,i){if(t&1&&Fg(Qe,5)(Ye,5)(_e$1,5),t&2){let n;IC(n=wC())&&(i.trigger=n.first),IC(n=wC())&&(i.panel=n.first),IC(n=wC())&&(i._overlayDir=n.first);}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:21,hostBindings:function(t,i){t&1&&Ag("keydown",function(r){return i._handleKeydown(r)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),t&2&&(Cg("id",i.id)("tabindex",i.disabled?-1:i.tabIndex)("aria-controls",i.panelOpen?i.id+"-panel":null)("aria-expanded",i.panelOpen)("aria-label",i.ariaLabel||null)("aria-required",i.required.toString())("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-activedescendant",i._getAriaActiveDescendant()),Hg("mat-mdc-select-disabled",i.disabled)("mat-mdc-select-invalid",i.errorState)("mat-mdc-select-required",i.required)("mat-mdc-select-empty",i.empty)("mat-mdc-select-multiple",i.multiple)("mat-select-open",i.panelOpen));},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",YT],disableRipple:[2,"disableRipple","disableRipple",YT],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:QT(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",YT],placeholder:"placeholder",required:[2,"required","required",YT],multiple:[2,"multiple","multiple",YT],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",YT],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",QT],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",YT]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[nT([{provide:de,useExisting:a},{provide:zi,useExisting:a}]),Cu],ngContentSelectors:Xe,decls:11,vars:10,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"detach","backdropClick","overlayKeydown","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth","cdkConnectedOverlayFlexibleDimensions","cdkConnectedOverlayUsePopover"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",1,"mat-mdc-select-panel","mdc-menu-surface","mdc-menu-surface--open",3,"keydown"]],template:function(t,i){if(t&1&&(vC(Ue),vs(0,"div",2,0),Ag("click",function(){return i.open()}),vs(3,"div",3),eC(4,Je,2,1,"span",4)(5,et,3,1,"span",5),fl(),vs(6,"div",6)(7,"div",7),kf(),vs(8,"svg",8),bg(9,"path",9),fl()()()(),Dg(10,tt,3,16,"ng-template",10),Ag("detach",function(){return i.close()})("backdropClick",function(){return i.close()})("overlayKeydown",function(r){return i._handleOverlayKeydown(r)})),t&2){let n=TC(1);XE(3),Cg("id",i._valueId),XE(),tC(i.empty?4:5),XE(6),Tg("cdkConnectedOverlayDisableClose",true)("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",i._preferredOverlayOrigin||n)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayWidth",i._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",true)("cdkConnectedOverlayUsePopover",i._popoverLocation);}},dependencies:[Rt,_e$1],styles:[`@keyframes _mat-select-enter {
|
|
2
2
|
from {
|
|
3
3
|
opacity: 0;
|
|
4
4
|
transform: scaleY(0.8);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {n as ne}from'./chunk-
|
|
1
|
+
import {n as ne}from'./chunk-CkfpO0Ui.js';import {g,Z as z$1,_ as Ue,A as Aw,$ as zt,a0 as jt,a1 as Vt,a2 as Nt,h as hr,e as pr,v as vs,W as WC,j as fl,n as eC,k as Ag,X as XE,y as Hg,a5 as yl,a8 as Zg,t as tC,r as Tg,a9 as dC,ai as Jg,aa as If,ac as mC,aj as KC,ab as wf,a3 as HI,ak as Xg,a6 as $I}from'./main-MX6O2FH4.js';import {y as yt,w as wt,t as ti,Z as Zn,c as cn}from'./chunk-CJdqLI4x.js';function G(c,p){if(c&1){let t=dC();vs(0,"mat-checkbox",5),Jg("ngModelChange",function(l){If(t);let f=mC();return KC(f.checkboxChecked,l)||(f.checkboxChecked=l),wf(l)}),WC(1),fl(),HI();}if(c&2){let t=mC();Xg("ngModel",t.checkboxChecked),$I(),XE(),Zg(t.data.checkboxLabel);}}var z=class c{dialogRef=g(z$1);data=g(Ue);checkboxChecked=false;confirm(){this.dialogRef.close({confirmed:true,checkboxChecked:this.checkboxChecked});}cancel(){this.dialogRef.close({confirmed:false});}static \u0275fac=function(t){return new(t||c)};static \u0275cmp=Aw({type:c,selectors:[["app-confirm-dialog"]],decls:13,vars:8,consts:[["mat-dialog-title",""],[3,"ngModel"],["align","end"],["mat-button","",3,"click"],["mat-flat-button","",3,"click","color"],[3,"ngModelChange","ngModel"]],template:function(t,e){t&1&&(vs(0,"h2",0)(1,"mat-icon"),WC(2,"warning"),fl(),WC(3),fl(),vs(4,"mat-dialog-content")(5,"p"),WC(6),fl(),eC(7,G,2,2,"mat-checkbox",1),fl(),vs(8,"mat-dialog-actions",2)(9,"button",3),Ag("click",function(){return e.cancel()}),WC(10),fl(),vs(11,"button",4),Ag("click",function(){return e.confirm()}),WC(12),fl()()),t&2&&(XE(),Hg("destructive",!!e.data.isDestructive),XE(2),yl(" ",e.data.title,`
|
|
2
2
|
`),XE(3),Zg(e.data.message),XE(),tC(e.data.checkboxLabel?7:-1),XE(3),Zg(e.data.cancelLabel??"Cancel"),XE(),Tg("color",e.data.isDestructive?"warn":"primary"),XE(),yl(" ",e.data.confirmLabel??"Confirm"," "));},dependencies:[zt,jt,Vt,Nt,hr,pr,yt,wt,ne,ti,Zn,cn],styles:["h2[mat-dialog-title][_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}h2[mat-dialog-title][_ngcontent-%COMP%] mat-icon.destructive[_ngcontent-%COMP%]{color:var(--color-error, #f44336)}mat-dialog-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:var(--color-text-secondary);line-height:1.5}mat-dialog-content[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{display:block;margin-top:8px;font-size:.875rem}"]})};export{z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {N as Ne,u as ui$1,a as me,f as fi$1,Y as Yt,V as Ve$1,n as ne}from'./chunk-nl8QJQnq.js';import {g,az as Qt,aQ as As,aY as ks,al as yt$1,A as Aw,o as bg,v as vs,q as oC,j as fl,T as TC,r as Tg,X as XE,x as iC,D as Fg,I as IC,E as wC,i as Gn$1,k as Ag,W as WC,b$ as FC,C as Cg,a8 as Zg,O as Ot,w as we,cK as yB,cb as mB,H as Hi$1,m as mT,b as U,bA as vC,bB as DC,ad as Vg,y as Hg,aw as pl,b5 as Sg,ax as hl,n as eC,t as tC,cc as gB,cr as vB,cd as Hf,cv as Lg,cw as CC,ce as Sb,af as Dg,an as ce,cL as Id,cM as Nd,bS as ma,S as ha,cJ as Rg,c0 as Ng,cN as Rn$1,aK as Do$1,aL as qn$1,br as sn,bD as ge,aN as wt$1,bE as vt,bs as Cl,bL as pe,aR as K,cO as is,a as P,aS as Ut,cP as Bt,bR as bd,bP as Yy,bu as Ve,c2 as ME,z as z$1,aZ as YT,bI as Eg,b4 as nT,aV as w,bv as kg,aU as U$1,bw as St,aW as D,bx as on,bz as Oi$1,bF as X,cQ as q,cR as X$1,ac as mC,a9 as dC,aa as If,ab as wf,a5 as yl,cS as Yt$1,cT as Gp,bM as mr,aO as G,ae as Ot$1,aA as sn$1,bW as Y,cU as pi,cV as yg,aC as Cu,by as am,cB as on$1,c8 as QT,ah as rT,a4 as rC,c9 as kf,bt as Qn$2,ap as Vy,bX as Pt,bZ as X$2,b_ as xt,cW as YI,cD as Ce,a3 as HI,a6 as $I,bo as nC,c3 as kt,bJ as dr,a_ as XC,b3 as oT,a$ as Yg,ch as Mg,cX as yr,cY as tt$1,aX as ft$1,cz as Xr,ag as fT}from'./main-IVH4VEHC.js';import {w as wt,j as Yn$1,k as _t$1,n as ni,l as Xn$1,E as En$1,z as ze,Q as Qn$1,e as ei,Y as Ye,f as fn,a as wt$2,A as At,Z as Zn$1,C as Cn}from'./chunk-CxGE3g5u.js';var ii=[[["mat-icon"],["","matMenuItemIcon",""]],"*"],oi=["mat-icon, [matMenuItemIcon]","*"];function ai(n,i){n&1&&(kf(),vs(0,"svg",2),bg(1,"polygon",3),fl());}var ri=["*"];function si(n,i){if(n&1){let e=dC();pl(0,"div",0),Rg("click",function(){If(e);let o=mC();return wf(o.closed.emit("click"))})("animationstart",function(o){If(e);let a=mC();return wf(a._onAnimationStart(o.animationName))})("animationend",function(o){If(e);let a=mC();return wf(a._onAnimationDone(o.animationName))})("animationcancel",function(o){If(e);let a=mC();return wf(a._onAnimationDone(o.animationName))}),pl(1,"div",1),DC(2),hl()();}if(n&2){let e=mC();FC(e._classList),Hg("mat-menu-panel-animations-disabled",e._animationsDisabled)("mat-menu-panel-exit-animation",e._panelAnimationState==="void")("mat-menu-panel-animating",e._isAnimating()),Ng("id",e.panelId),Cg("aria-label",e.ariaLabel||null)("aria-labelledby",e.ariaLabelledby||null)("aria-describedby",e.ariaDescribedby||null);}}var pt=new w("MAT_MENU_PANEL"),Be=(()=>{class n{_elementRef=g(Qt);_document=g(U$1);_focusMonitor=g(St);_parentMenu=g(pt,{optional:true});_changeDetectorRef=g(Cl);role="menuitem";disabled=false;disableRipple=false;_hovered=new ce;_focused=new ce;_highlighted=false;_triggersSubmenu=false;constructor(){g(D).load(on),this._parentMenu?.addItem?.(this);}focus(e,t){this._focusMonitor&&e?this._focusMonitor.focusVia(this._getHostElement(),e,t):this._getHostElement().focus(t),this._focused.next(this);}ngAfterViewInit(){this._focusMonitor&&this._focusMonitor.monitor(this._elementRef,false);}ngOnDestroy(){this._focusMonitor&&this._focusMonitor.stopMonitoring(this._elementRef),this._parentMenu&&this._parentMenu.removeItem&&this._parentMenu.removeItem(this),this._hovered.complete(),this._focused.complete();}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._elementRef.nativeElement}_checkDisabled(e){this.disabled&&(e.preventDefault(),e.stopPropagation());}_handleMouseEnter(){this._hovered.next(this);}getLabel(){let e=this._elementRef.nativeElement.cloneNode(true),t=e.querySelectorAll("mat-icon, .material-icons");for(let o=0;o<t.length;o++)t[o].remove();return e.textContent?.trim()||""}_setHighlighted(e){this._highlighted=e,this._changeDetectorRef.markForCheck();}_setTriggersSubmenu(e){this._triggersSubmenu=e,this._changeDetectorRef.markForCheck();}_hasFocus(){return this._document&&this._document.activeElement===this._getHostElement()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=Aw({type:n,selectors:[["","mat-menu-item",""]],hostAttrs:[1,"mat-mdc-menu-item","mat-focus-indicator"],hostVars:8,hostBindings:function(t,o){t&1&&Ag("click",function(m){return o._checkDisabled(m)})("mouseenter",function(){return o._handleMouseEnter()}),t&2&&(Cg("role",o.role)("tabindex",o._getTabIndex())("aria-disabled",o.disabled)("disabled",o.disabled||null),Hg("mat-mdc-menu-item-highlighted",o._highlighted)("mat-mdc-menu-item-submenu-trigger",o._triggersSubmenu));},inputs:{role:"role",disabled:[2,"disabled","disabled",YT],disableRipple:[2,"disableRipple","disableRipple",YT]},exportAs:["matMenuItem"],ngContentSelectors:oi,decls:5,vars:3,consts:[[1,"mat-mdc-menu-item-text"],["matRipple","",1,"mat-mdc-menu-ripple",3,"matRippleDisabled","matRippleTrigger"],["viewBox","0 0 5 10","focusable","false","aria-hidden","true",1,"mat-mdc-menu-submenu-icon"],["points","0,0 5,5 0,10"]],template:function(t,o){t&1&&(vC(ii),DC(0),vs(1,"span",0),DC(2,1),fl(),bg(3,"div",1),eC(4,ai,2,0,":svg:svg",2)),t&2&&(XE(3),Tg("matRippleDisabled",o.disableRipple||o.disabled)("matRippleTrigger",o._getHostElement()),XE(),tC(o._triggersSubmenu?4:-1));},dependencies:[Oi$1],encapsulation:2})}return n})();var Sn=new w("MatMenuContent"),ya=(()=>{class n{_template=g(dr);_appRef=g(yr);_injector=g(pe);_viewContainerRef=g(mr);_document=g(U$1);_changeDetectorRef=g(Cl);_portal;_outlet;_attached=new ce;attach(e={}){this._portal||(this._portal=new Y(this._template,this._viewContainerRef)),this.detach(),this._outlet||(this._outlet=new tt$1(this._document.createElement("div"),this._appRef,this._injector));let t=this._template.elementRef.nativeElement;t.parentNode.insertBefore(this._outlet.outletElement,t),this._changeDetectorRef.markForCheck(),this._portal.attach(this._outlet,e),this._attached.next();}detach(){this._portal?.isAttached&&this._portal.detach();}ngOnDestroy(){this.detach(),this._outlet?.dispose();}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ks({type:n,selectors:[["ng-template","matMenuContent",""]],features:[nT([{provide:Sn,useExisting:n}])]})}return n})(),li=new w("mat-menu-default-options",{providedIn:"root",factory:()=>({overlapTrigger:false,xPosition:"after",yPosition:"below",backdropClass:"cdk-overlay-transparent-backdrop"})}),mt="_mat-menu-enter",et="_mat-menu-exit",De=(()=>{class n{_elementRef=g(Qt);_changeDetectorRef=g(Cl);_injector=g(pe);_keyManager;_xPosition;_yPosition;_firstItemFocusRef;_exitFallbackTimeout;_animationsDisabled=K();_allItems;_directDescendantItems=new is;_classList={};_panelAnimationState="void";_animationDone=new ce;_isAnimating=Hi$1(false);parentMenu;direction;overlayPanelClass;backdropClass;ariaLabel;ariaLabelledby;ariaDescribedby;get xPosition(){return this._xPosition}set xPosition(e){this._xPosition=e,this.setPositionClasses();}get yPosition(){return this._yPosition}set yPosition(e){this._yPosition=e,this.setPositionClasses();}templateRef;items;lazyContent;overlapTrigger=false;hasBackdrop;get panelClass(){return this._previousPanelClass}set panelClass(e){let t=this._previousPanelClass,o=P({},this._classList);t&&t.length&&t.split(" ").forEach(a=>{o[a]=false;}),this._previousPanelClass=e,e&&e.length&&(e.split(" ").forEach(a=>{o[a]=true;}),this._elementRef.nativeElement.className=""),this._classList=o;}_previousPanelClass="";get classList(){return this.panelClass}set classList(e){this.panelClass=e;}closed=new yt$1;close=this.closed;panelId=g(Ut).getId("mat-menu-panel-");constructor(){let e=g(li);this.overlayPanelClass=e.overlayPanelClass||"",this._xPosition=e.xPosition,this._yPosition=e.yPosition,this.backdropClass=e.backdropClass,this.overlapTrigger=e.overlapTrigger,this.hasBackdrop=e.hasBackdrop;}ngOnInit(){this.setPositionClasses();}ngAfterContentInit(){this._updateDirectDescendants(),this._keyManager=new Bt(this._directDescendantItems).withWrap().withTypeAhead().withHomeAndEnd(),this._keyManager.tabOut.subscribe(()=>this.closed.emit("tab")),this._directDescendantItems.changes.pipe(bd(this._directDescendantItems),ma(e=>Yy(...e.map(t=>t._focused)))).subscribe(e=>this._keyManager.updateActiveItem(e)),this._directDescendantItems.changes.subscribe(e=>{let t=this._keyManager;if(this._panelAnimationState==="enter"&&t.activeItem?._hasFocus()){let o=e.toArray(),a=Math.max(0,Math.min(o.length-1,t.activeItemIndex||0));o[a]&&!o[a].disabled?t.setActiveItem(a):t.setNextItemActive();}});}ngOnDestroy(){this._keyManager?.destroy(),this._directDescendantItems.destroy(),this.closed.complete(),this._firstItemFocusRef?.destroy(),clearTimeout(this._exitFallbackTimeout);}_hovered(){return this._directDescendantItems.changes.pipe(bd(this._directDescendantItems),ma(t=>Yy(...t.map(o=>o._hovered))))}addItem(e){}removeItem(e){}_handleKeydown(e){let t=e.keyCode,o=this._keyManager;switch(t){case 27:Ve(e)||(e.preventDefault(),this.closed.emit("keydown"));break;case 37:this.parentMenu&&this.direction==="ltr"&&this.closed.emit("keydown");break;case 39:this.parentMenu&&this.direction==="rtl"&&this.closed.emit("keydown");break;default:(t===38||t===40)&&o.setFocusOrigin("keyboard"),o.onKeydown(e);return}}focusFirstItem(e="program"){this._firstItemFocusRef?.destroy(),this._firstItemFocusRef=ME(()=>{let t=this._resolvePanel();if(!t||!t.contains(document.activeElement)){let o=this._keyManager;o.setFocusOrigin(e).setFirstItemActive(),!o.activeItem&&t&&t.focus();}},{injector:this._injector});}resetActiveItem(){this._keyManager.setActiveItem(-1);}setElevation(e){}setPositionClasses(e=this.xPosition,t=this.yPosition){this._classList=z$1(P({},this._classList),{"mat-menu-before":e==="before","mat-menu-after":e==="after","mat-menu-above":t==="above","mat-menu-below":t==="below"}),this._changeDetectorRef.markForCheck();}_onAnimationDone(e){let t=e===et;(t||e===mt)&&(t&&(clearTimeout(this._exitFallbackTimeout),this._exitFallbackTimeout=void 0),this._animationDone.next(t?"void":"enter"),this._isAnimating.set(false));}_onAnimationStart(e){(e===mt||e===et)&&this._isAnimating.set(true);}_setIsOpen(e){if(this._panelAnimationState=e?"enter":"void",e){if(this._keyManager.activeItemIndex===0){let t=this._resolvePanel();t&&(t.scrollTop=0);}}else this._animationsDisabled||(this._exitFallbackTimeout=setTimeout(()=>this._onAnimationDone(et),200));this._animationsDisabled&&setTimeout(()=>{this._onAnimationDone(e?mt:et);}),this._changeDetectorRef.markForCheck();}_updateDirectDescendants(){this._allItems.changes.pipe(bd(this._allItems)).subscribe(e=>{this._directDescendantItems.reset(e.filter(t=>t._parentMenu===this)),this._directDescendantItems.notifyOnChanges();});}_resolvePanel(){let e=null;return this._directDescendantItems.length&&(e=this._directDescendantItems.first._getHostElement().closest('[role="menu"]')),e}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=Aw({type:n,selectors:[["mat-menu"]],contentQueries:function(t,o,a){if(t&1&&kg(a,Sn,5)(a,Be,5)(a,Be,4),t&2){let m;IC(m=wC())&&(o.lazyContent=m.first),IC(m=wC())&&(o._allItems=m),IC(m=wC())&&(o.items=m);}},viewQuery:function(t,o){if(t&1&&Fg(dr,5),t&2){let a;IC(a=wC())&&(o.templateRef=a.first);}},hostVars:3,hostBindings:function(t,o){t&2&&Cg("aria-label",null)("aria-labelledby",null)("aria-describedby",null);},inputs:{backdropClass:"backdropClass",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],xPosition:"xPosition",yPosition:"yPosition",overlapTrigger:[2,"overlapTrigger","overlapTrigger",YT],hasBackdrop:[2,"hasBackdrop","hasBackdrop",e=>e==null?null:YT(e)],panelClass:[0,"class","panelClass"],classList:"classList"},outputs:{closed:"closed",close:"close"},exportAs:["matMenu"],features:[nT([{provide:pt,useExisting:n}])],ngContentSelectors:ri,decls:1,vars:0,consts:[["tabindex","-1","role","menu",1,"mat-mdc-menu-panel",3,"click","animationstart","animationend","animationcancel","id"],[1,"mat-mdc-menu-content"]],template:function(t,o){t&1&&(vC(),Eg(0,si,3,12,"ng-template"));},styles:[`mat-menu {
|
|
1
|
+
import {N as Ne,u as ui$1,a as me,f as fi$1,Y as Yt,V as Ve$1,n as ne}from'./chunk-CUmZcEGx.js';import {g,az as Qt,aR as As,aZ as ks,al as yt$1,A as Aw,o as bg,v as vs,q as oC,j as fl,T as TC,r as Tg,X as XE,x as iC,D as Fg,I as IC,E as wC,i as Gn$1,k as Ag,W as WC,b$ as FC,C as Cg,a8 as Zg,O as Ot,w as we,cK as yB,cb as mB,H as Hi$1,m as mT,b as U,bA as vC,bB as DC,ad as Vg,y as Hg,aw as pl,b6 as Sg,ax as hl,n as eC,t as tC,cc as gB,cr as vB,cd as Hf,cv as Lg,cw as CC,ce as Sb,af as Dg,an as ce,cL as Id,cM as Nd,bS as ma,S as ha,cJ as Rg,c0 as Ng,cN as Rn$1,aL as Do$1,aM as qn$1,br as sn,bD as ge,aO as wt$1,bE as vt,bs as Cl,bL as pe,aS as K,cO as is,a as P,aT as Ut,cP as Bt,bR as bd,bP as Yy,bu as Ve,c2 as ME,z as z$1,a_ as YT,bI as Eg,b5 as nT,aW as w,bv as kg,aV as U$1,bw as St,aX as D,bx as on,bz as Oi$1,bF as X,cQ as q,cR as X$1,ac as mC,a9 as dC,aa as If,ab as wf,a5 as yl,cS as Yt$1,cT as Gp,bM as mr,aP as G,ae as Ot$1,aA as sn$1,bW as Y,cU as pi,cV as yg,aC as Cu,by as am,cB as on$1,c8 as QT,ah as rT,a4 as rC,c9 as kf,bt as Qn$2,ap as Vy,bX as Pt,bZ as X$2,b_ as xt,cW as YI,cD as Ce,a3 as HI,a6 as $I,bo as nC,c3 as kt,bJ as dr,a$ as XC,b4 as oT,b0 as Yg,ch as Mg,cX as yr,cY as tt$1,aY as ft$1,cz as Xr,ag as fT}from'./main-MX6O2FH4.js';import {w as wt,j as Yn$1,k as _t$1,n as ni,l as Xn$1,E as En$1,z as ze,Q as Qn$1,e as ei,Y as Ye,f as fn,a as wt$2,A as At,Z as Zn$1,C as Cn}from'./chunk-CJdqLI4x.js';var ii=[[["mat-icon"],["","matMenuItemIcon",""]],"*"],oi=["mat-icon, [matMenuItemIcon]","*"];function ai(n,i){n&1&&(kf(),vs(0,"svg",2),bg(1,"polygon",3),fl());}var ri=["*"];function si(n,i){if(n&1){let e=dC();pl(0,"div",0),Rg("click",function(){If(e);let o=mC();return wf(o.closed.emit("click"))})("animationstart",function(o){If(e);let a=mC();return wf(a._onAnimationStart(o.animationName))})("animationend",function(o){If(e);let a=mC();return wf(a._onAnimationDone(o.animationName))})("animationcancel",function(o){If(e);let a=mC();return wf(a._onAnimationDone(o.animationName))}),pl(1,"div",1),DC(2),hl()();}if(n&2){let e=mC();FC(e._classList),Hg("mat-menu-panel-animations-disabled",e._animationsDisabled)("mat-menu-panel-exit-animation",e._panelAnimationState==="void")("mat-menu-panel-animating",e._isAnimating()),Ng("id",e.panelId),Cg("aria-label",e.ariaLabel||null)("aria-labelledby",e.ariaLabelledby||null)("aria-describedby",e.ariaDescribedby||null);}}var pt=new w("MAT_MENU_PANEL"),Be=(()=>{class n{_elementRef=g(Qt);_document=g(U$1);_focusMonitor=g(St);_parentMenu=g(pt,{optional:true});_changeDetectorRef=g(Cl);role="menuitem";disabled=false;disableRipple=false;_hovered=new ce;_focused=new ce;_highlighted=false;_triggersSubmenu=false;constructor(){g(D).load(on),this._parentMenu?.addItem?.(this);}focus(e,t){this._focusMonitor&&e?this._focusMonitor.focusVia(this._getHostElement(),e,t):this._getHostElement().focus(t),this._focused.next(this);}ngAfterViewInit(){this._focusMonitor&&this._focusMonitor.monitor(this._elementRef,false);}ngOnDestroy(){this._focusMonitor&&this._focusMonitor.stopMonitoring(this._elementRef),this._parentMenu&&this._parentMenu.removeItem&&this._parentMenu.removeItem(this),this._hovered.complete(),this._focused.complete();}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._elementRef.nativeElement}_checkDisabled(e){this.disabled&&(e.preventDefault(),e.stopPropagation());}_handleMouseEnter(){this._hovered.next(this);}getLabel(){let e=this._elementRef.nativeElement.cloneNode(true),t=e.querySelectorAll("mat-icon, .material-icons");for(let o=0;o<t.length;o++)t[o].remove();return e.textContent?.trim()||""}_setHighlighted(e){this._highlighted=e,this._changeDetectorRef.markForCheck();}_setTriggersSubmenu(e){this._triggersSubmenu=e,this._changeDetectorRef.markForCheck();}_hasFocus(){return this._document&&this._document.activeElement===this._getHostElement()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=Aw({type:n,selectors:[["","mat-menu-item",""]],hostAttrs:[1,"mat-mdc-menu-item","mat-focus-indicator"],hostVars:8,hostBindings:function(t,o){t&1&&Ag("click",function(m){return o._checkDisabled(m)})("mouseenter",function(){return o._handleMouseEnter()}),t&2&&(Cg("role",o.role)("tabindex",o._getTabIndex())("aria-disabled",o.disabled)("disabled",o.disabled||null),Hg("mat-mdc-menu-item-highlighted",o._highlighted)("mat-mdc-menu-item-submenu-trigger",o._triggersSubmenu));},inputs:{role:"role",disabled:[2,"disabled","disabled",YT],disableRipple:[2,"disableRipple","disableRipple",YT]},exportAs:["matMenuItem"],ngContentSelectors:oi,decls:5,vars:3,consts:[[1,"mat-mdc-menu-item-text"],["matRipple","",1,"mat-mdc-menu-ripple",3,"matRippleDisabled","matRippleTrigger"],["viewBox","0 0 5 10","focusable","false","aria-hidden","true",1,"mat-mdc-menu-submenu-icon"],["points","0,0 5,5 0,10"]],template:function(t,o){t&1&&(vC(ii),DC(0),vs(1,"span",0),DC(2,1),fl(),bg(3,"div",1),eC(4,ai,2,0,":svg:svg",2)),t&2&&(XE(3),Tg("matRippleDisabled",o.disableRipple||o.disabled)("matRippleTrigger",o._getHostElement()),XE(),tC(o._triggersSubmenu?4:-1));},dependencies:[Oi$1],encapsulation:2})}return n})();var Sn=new w("MatMenuContent"),ya=(()=>{class n{_template=g(dr);_appRef=g(yr);_injector=g(pe);_viewContainerRef=g(mr);_document=g(U$1);_changeDetectorRef=g(Cl);_portal;_outlet;_attached=new ce;attach(e={}){this._portal||(this._portal=new Y(this._template,this._viewContainerRef)),this.detach(),this._outlet||(this._outlet=new tt$1(this._document.createElement("div"),this._appRef,this._injector));let t=this._template.elementRef.nativeElement;t.parentNode.insertBefore(this._outlet.outletElement,t),this._changeDetectorRef.markForCheck(),this._portal.attach(this._outlet,e),this._attached.next();}detach(){this._portal?.isAttached&&this._portal.detach();}ngOnDestroy(){this.detach(),this._outlet?.dispose();}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ks({type:n,selectors:[["ng-template","matMenuContent",""]],features:[nT([{provide:Sn,useExisting:n}])]})}return n})(),li=new w("mat-menu-default-options",{providedIn:"root",factory:()=>({overlapTrigger:false,xPosition:"after",yPosition:"below",backdropClass:"cdk-overlay-transparent-backdrop"})}),mt="_mat-menu-enter",et="_mat-menu-exit",De=(()=>{class n{_elementRef=g(Qt);_changeDetectorRef=g(Cl);_injector=g(pe);_keyManager;_xPosition;_yPosition;_firstItemFocusRef;_exitFallbackTimeout;_animationsDisabled=K();_allItems;_directDescendantItems=new is;_classList={};_panelAnimationState="void";_animationDone=new ce;_isAnimating=Hi$1(false);parentMenu;direction;overlayPanelClass;backdropClass;ariaLabel;ariaLabelledby;ariaDescribedby;get xPosition(){return this._xPosition}set xPosition(e){this._xPosition=e,this.setPositionClasses();}get yPosition(){return this._yPosition}set yPosition(e){this._yPosition=e,this.setPositionClasses();}templateRef;items;lazyContent;overlapTrigger=false;hasBackdrop;get panelClass(){return this._previousPanelClass}set panelClass(e){let t=this._previousPanelClass,o=P({},this._classList);t&&t.length&&t.split(" ").forEach(a=>{o[a]=false;}),this._previousPanelClass=e,e&&e.length&&(e.split(" ").forEach(a=>{o[a]=true;}),this._elementRef.nativeElement.className=""),this._classList=o;}_previousPanelClass="";get classList(){return this.panelClass}set classList(e){this.panelClass=e;}closed=new yt$1;close=this.closed;panelId=g(Ut).getId("mat-menu-panel-");constructor(){let e=g(li);this.overlayPanelClass=e.overlayPanelClass||"",this._xPosition=e.xPosition,this._yPosition=e.yPosition,this.backdropClass=e.backdropClass,this.overlapTrigger=e.overlapTrigger,this.hasBackdrop=e.hasBackdrop;}ngOnInit(){this.setPositionClasses();}ngAfterContentInit(){this._updateDirectDescendants(),this._keyManager=new Bt(this._directDescendantItems).withWrap().withTypeAhead().withHomeAndEnd(),this._keyManager.tabOut.subscribe(()=>this.closed.emit("tab")),this._directDescendantItems.changes.pipe(bd(this._directDescendantItems),ma(e=>Yy(...e.map(t=>t._focused)))).subscribe(e=>this._keyManager.updateActiveItem(e)),this._directDescendantItems.changes.subscribe(e=>{let t=this._keyManager;if(this._panelAnimationState==="enter"&&t.activeItem?._hasFocus()){let o=e.toArray(),a=Math.max(0,Math.min(o.length-1,t.activeItemIndex||0));o[a]&&!o[a].disabled?t.setActiveItem(a):t.setNextItemActive();}});}ngOnDestroy(){this._keyManager?.destroy(),this._directDescendantItems.destroy(),this.closed.complete(),this._firstItemFocusRef?.destroy(),clearTimeout(this._exitFallbackTimeout);}_hovered(){return this._directDescendantItems.changes.pipe(bd(this._directDescendantItems),ma(t=>Yy(...t.map(o=>o._hovered))))}addItem(e){}removeItem(e){}_handleKeydown(e){let t=e.keyCode,o=this._keyManager;switch(t){case 27:Ve(e)||(e.preventDefault(),this.closed.emit("keydown"));break;case 37:this.parentMenu&&this.direction==="ltr"&&this.closed.emit("keydown");break;case 39:this.parentMenu&&this.direction==="rtl"&&this.closed.emit("keydown");break;default:(t===38||t===40)&&o.setFocusOrigin("keyboard"),o.onKeydown(e);return}}focusFirstItem(e="program"){this._firstItemFocusRef?.destroy(),this._firstItemFocusRef=ME(()=>{let t=this._resolvePanel();if(!t||!t.contains(document.activeElement)){let o=this._keyManager;o.setFocusOrigin(e).setFirstItemActive(),!o.activeItem&&t&&t.focus();}},{injector:this._injector});}resetActiveItem(){this._keyManager.setActiveItem(-1);}setElevation(e){}setPositionClasses(e=this.xPosition,t=this.yPosition){this._classList=z$1(P({},this._classList),{"mat-menu-before":e==="before","mat-menu-after":e==="after","mat-menu-above":t==="above","mat-menu-below":t==="below"}),this._changeDetectorRef.markForCheck();}_onAnimationDone(e){let t=e===et;(t||e===mt)&&(t&&(clearTimeout(this._exitFallbackTimeout),this._exitFallbackTimeout=void 0),this._animationDone.next(t?"void":"enter"),this._isAnimating.set(false));}_onAnimationStart(e){(e===mt||e===et)&&this._isAnimating.set(true);}_setIsOpen(e){if(this._panelAnimationState=e?"enter":"void",e){if(this._keyManager.activeItemIndex===0){let t=this._resolvePanel();t&&(t.scrollTop=0);}}else this._animationsDisabled||(this._exitFallbackTimeout=setTimeout(()=>this._onAnimationDone(et),200));this._animationsDisabled&&setTimeout(()=>{this._onAnimationDone(e?mt:et);}),this._changeDetectorRef.markForCheck();}_updateDirectDescendants(){this._allItems.changes.pipe(bd(this._allItems)).subscribe(e=>{this._directDescendantItems.reset(e.filter(t=>t._parentMenu===this)),this._directDescendantItems.notifyOnChanges();});}_resolvePanel(){let e=null;return this._directDescendantItems.length&&(e=this._directDescendantItems.first._getHostElement().closest('[role="menu"]')),e}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=Aw({type:n,selectors:[["mat-menu"]],contentQueries:function(t,o,a){if(t&1&&kg(a,Sn,5)(a,Be,5)(a,Be,4),t&2){let m;IC(m=wC())&&(o.lazyContent=m.first),IC(m=wC())&&(o._allItems=m),IC(m=wC())&&(o.items=m);}},viewQuery:function(t,o){if(t&1&&Fg(dr,5),t&2){let a;IC(a=wC())&&(o.templateRef=a.first);}},hostVars:3,hostBindings:function(t,o){t&2&&Cg("aria-label",null)("aria-labelledby",null)("aria-describedby",null);},inputs:{backdropClass:"backdropClass",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],xPosition:"xPosition",yPosition:"yPosition",overlapTrigger:[2,"overlapTrigger","overlapTrigger",YT],hasBackdrop:[2,"hasBackdrop","hasBackdrop",e=>e==null?null:YT(e)],panelClass:[0,"class","panelClass"],classList:"classList"},outputs:{closed:"closed",close:"close"},exportAs:["matMenu"],features:[nT([{provide:pt,useExisting:n}])],ngContentSelectors:ri,decls:1,vars:0,consts:[["tabindex","-1","role","menu",1,"mat-mdc-menu-panel",3,"click","animationstart","animationend","animationcancel","id"],[1,"mat-mdc-menu-content"]],template:function(t,o){t&1&&(vC(),Eg(0,si,3,12,"ng-template"));},styles:[`mat-menu {
|
|
2
2
|
display: none;
|
|
3
3
|
}
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {n}from'./chunk-CfgXrte_.js';import {O}from'./chunk-
|
|
1
|
+
import {n}from'./chunk-CfgXrte_.js';import {O}from'./chunk-TxtSVoMY.js';import {S}from'./chunk-DbmrZGxd.js';import {v}from'./chunk-BPt7wScV.js';import {g,ao as V,G,w as we,H as Hi,u as ue,b as U$1,bS as ma,S as ha,A as Aw,aK as Nb,v as vs,bf as aT,k as Ag,j as fl,af as Dg,T as TC,r as Tg,bg as uT,ah as rT,n as eC,ac as mC,t as tC,W as WC,X as XE,a8 as Zg,a9 as dC,aa as If,ab as wf,ag as fT}from'./main-MX6O2FH4.js';import'./chunk-BDkp40LI.js';import {W as Wn,S as Se}from'./chunk-LlG18Htx.js';import'./chunk-CUmZcEGx.js';import'./chunk-CJdqLI4x.js';import'./chunk-CmUHL9Tg.js';import'./chunk-BkVtgsRG.js';var z=()=>[];function W(r,e){if(r&1&&(vs(0,"p",3),WC(1),fl()),r&2){let t=mC().$implicit;XE(),Zg(t.name);}}function U(r,e){if(r&1){let t=dC();vs(0,"agentos-ai-provider-item",5),Ag("editRequested",function(){let o=If(t),a=mC(2);return wf(a.onEdit(o))})("deleteRequested",function(){let o=If(t),a=mC(2);return wf(a.onDelete(o))})("duplicateRequested",function(){let o=If(t),a=mC(2);return wf(a.onDuplicate(o))}),fl();}if(r&2){let t=e,i=mC(2);Tg("config",t.config)("scope",t.scope)("readOnly",t.scope==="platform"||t.scope==="namespace"&&!i.isAdmin());}}function X(r,e){if(r&1&&eC(0,W,2,1,"p",3)(1,U,1,3,"agentos-ai-provider-item",4),r&2){let t,i=e.$implicit,o=mC();tC(o.isEmptyPlaceholder(i.id)?0:(t=o.resolve(i.id))?1:-1,t);}}var k=Object.freeze({platform:"Platform (read-only)",namespace:"AI Providers du namespace",userOnNs:"Mes overrides sur ce namespace",userGlobal:"Mes overrides globaux"}),F="__empty__",j=class r{route=g(V);router=g(G);destroyRef=g(we);state=g(O);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=Hi(false);listItems$=this.state.vm$.pipe(ue(e=>this.toListItems(e)));isLoading=Hi(true);resolved=new Map;ngOnInit(){this.route.paramMap.pipe(U$1(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t);}),this.route.paramMap.pipe(ue(e=>e.get("namespaceId")??""),ma(e=>e?this.namespaceRole.isAdminOfNamespace$(e):ha(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe(e=>{this.isLoading.set(false);let t=new Map;e.platform.forEach(i=>{i.id&&t.set(this.itemKey("platform",i.id),{config:i,scope:"platform"});}),e.namespace.forEach(i=>{i.id&&t.set(this.itemKey("namespace",i.id),{config:i,scope:"namespace"});}),e.userOnNs.forEach(i=>{i.id&&t.set(this.itemKey("userOnNs",i.id),{config:i,scope:"userOnNs"});}),e.userGlobal.forEach(i=>{i.id&&t.set(this.itemKey("userGlobal",i.id),{config:i,scope:"userGlobal"});}),this.resolved=t;});}isEmptyPlaceholder(e){return e.startsWith(F)}resolve(e){return this.resolved.get(e)??null}itemKey(e,t){return `${e}:${t}`}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:n(this.isAdmin())}});}onEdit(e){let t=e.config.id;t&&this.router.navigate(["/agentos",this.namespaceId,"ai-providers",t,"edit"],{queryParams:{scope:e.scope}});}onDelete(e){let t=e.config.id;t&&this.state.delete(t,e.scope).pipe(U$1(this.destroyRef)).subscribe({error:i=>{console.error(`[AiProvidersAllScopes] Delete failed for ${e.scope}:${t}:`,i);}});}onDuplicate(e){if(!e.config.id)return;let t=e.scope==="namespace"&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:t,template:e.config.id,templateScope:e.scope}});}toListItems(e){let t=[];return t.push(...this.sectionItems("platform",e.platform)),t.push(...this.sectionItems("namespace",e.namespace)),t.push(...this.sectionItems("userOnNs",e.userOnNs)),t.push(...this.sectionItems("userGlobal",e.userGlobal)),t}sectionItems(e,t){return t.length===0?[{id:`${F}${e}`,name:"Aucun AI Provider",groupKey:e,groupLabel:k[e]}]:t.filter(i=>!!i.id).map(i=>({id:this.itemKey(e,i.id),name:i.name,description:i.apiType,groupKey:e,groupLabel:k[e]}))}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=Aw({type:r,selectors:[["agentos-ai-providers-all-scopes"]],decls:5,vars:7,consts:[["aiProviderItemTpl",""],["title","AI Providers","emptyMessage","No AI providers available.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[1,"ai-providers-all-scopes__empty"],[3,"config","scope","readOnly"],[3,"editRequested","deleteRequested","duplicateRequested","config","scope","readOnly"]],template:function(t,i){if(t&1&&(vs(0,"ds-entity-list",1),aT(1,"async"),Ag("createRequested",function(){return i.openCreateForm()}),vs(2,"ds-icon-button",2),Ag("action",function(){return i.goBack()}),fl()(),Dg(3,X,2,1,"ng-template",null,0,fT)),t&2){let o=TC(4);Tg("items",uT(1,4,i.listItems$)??rT(6,z))("loading",i.isLoading())("showCreate",true)("itemTemplate",o);}},dependencies:[Wn,S,Se,Nb],styles:[".ai-providers-all-scopes__empty[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);padding:.5rem .25rem;margin:0;font-style:italic}"]})};export{j as AiProvidersAllScopesComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {O}from'./chunk-hsFrAldX.js';import {v}from'./chunk-wQ_oBBPt.js';import {g,ao as V,G,w as we,H as Hi,F as F$1,dc as he,cd as Hf,b as U,A as Aw,v as vs,k as Ag,W as WC,j as fl,n as eC,X as XE,a8 as Zg,t as tC,a9 as dC,q as oC,a4 as rC,a3 as HI,o as bg,bo as nC,ac as mC,r as Tg,a6 as $I,x as iC,a5 as yl,cH as Xw,aa as If,ab as wf}from'./main-IVH4VEHC.js';import'./chunk-un-hRvRu.js';import {o as z,z as ze,k as _t,b as _e$1,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,A as At,m as mn,Z as Zn,l as Xn,C as Cn,E as En,p as An,q as Ct,V as Vt}from'./chunk-CxGE3g5u.js';import'./chunk-D4MXjzi7.js';import'./chunk-Dme7pjfi.js';import'./chunk-CAbLeq_f.js';import'./chunk-nl8QJQnq.js';function ce(a,r){a&1&&(vs(0,"p",5),WC(1,"Loading\u2026"),fl());}function me(a,r){if(a&1&&(vs(0,"label",30),bg(1,"input",31),HI(),vs(2,"span"),WC(3),fl()()),a&2){let e=r.$implicit,l=mC(3);XE(),Tg("formControl",l.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!l.isAdmin()),$I(),XE(2),Zg(e.label);}}function ue(a,r){if(a&1&&(vs(0,"fieldset",8)(1,"legend",24),WC(2,"Port\xE9e de la configuration"),fl(),oC(3,me,4,4,"label",30,Xw().trackByScope,true),fl()),a&2){let e=mC(2);Tg("disabled",e.isEditMode()),XE(3),iC(e.scopeOptions);}}function ve(a,r){if(a&1&&(vs(0,"option",13),WC(1),fl()),a&2){let e=r.$implicit;Tg("value",e),XE(),Zg(e);}}function fe(a,r){if(a&1){let e=dC();vs(0,"div",26),bg(1,"input",32),HI(),bg(2,"input",33),HI(),vs(3,"button",34),Ag("click",function(){let s=If(e).$index,f=mC(2);return wf(f.removeHeader(s))}),WC(4," \xD7 "),fl()();}if(a&2){let e=r.$index;Tg("formGroupName",e),XE(),$I(),XE(),$I();}}function _e(a,r){if(a&1){let e=dC();vs(0,"form",7),Ag("ngSubmit",function(){If(e);let s=mC();return wf(s.submit())}),eC(1,ue,5,1,"fieldset",8),vs(2,"div",9)(3,"label",10),WC(4,"API type "),vs(5,"span",11),WC(6,"*"),fl()(),vs(7,"select",12),oC(8,ve,2,2,"option",13,rC),fl(),HI(),fl(),vs(10,"div",9)(11,"label",14),WC(12,"Name "),vs(13,"span",11),WC(14,"*"),fl()(),bg(15,"input",15),HI(),fl(),vs(16,"div",9)(17,"label",16),WC(18,"Description"),fl(),bg(19,"input",17),HI(),fl(),vs(20,"div",9)(21,"label",18),WC(22,"Base URL"),fl(),bg(23,"input",19),HI(),fl(),vs(24,"div",9)(25,"label",20),WC(26,"API key"),fl(),bg(27,"input",21),HI(),fl(),vs(28,"div",22)(29,"div",23)(30,"span",24),WC(31,"Custom headers"),fl(),vs(32,"button",25),Ag("click",function(){If(e);let s=mC();return wf(s.addHeader())}),WC(33,"+ Add header"),fl()(),oC(34,fe,5,1,"div",26,nC),fl(),vs(36,"div",27)(37,"button",28),WC(38),fl(),vs(39,"button",29),Ag("click",function(){If(e);let s=mC();return wf(s.cancel())}),WC(40,"Cancel"),fl()()();}if(a&2){let e=mC();Tg("formGroup",e.form),XE(),tC(e.isPlatformMode?-1:1),XE(6),Tg("formControl",e.apiTypeControl),$I(),XE(),iC(e.apiTypeOptions),XE(7),Tg("formControl",e.nameControl),$I(),XE(4),Tg("formControl",e.descriptionControl),$I(),XE(4),Tg("formControl",e.baseUrlControl),$I(),XE(4),Tg("formControl",e.apiKeyControl),$I(),XE(),Tg("formArrayName","headers"),XE(6),iC(e.headersArray.controls),XE(3),Tg("disabled",e.form.invalid||e.isSubmitting()),XE(),yl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var ge=new Set(["namespace","userOnNs","userGlobal"]),F=Object.freeze({platform:"Configuration de niveau plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),se=class a{route=g(V);router=g(G);destroyRef=g(we);state=g(O);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?Hi(true):F$1(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});apiTypeOptions=Object.values(he);scopeOptions=[{value:"namespace",label:F.namespace},{value:"userOnNs",label:F.userOnNs},{value:"userGlobal",label:F.userGlobal}];form=new z({name:new _t("",{nonNullable:true,validators:[_e$1.required,_e$1.minLength(1)]}),description:new _t(null),apiType:new _t("OpenAI",{nonNullable:true,validators:[_e$1.required]}),baseUrl:new _t("",{nonNullable:true}),apiKey:new _t("",{nonNullable:true}),scope:new _t("namespace",{nonNullable:true}),headers:new ze([],{validators:[]})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get apiTypeControl(){return this.form.controls.apiType}get baseUrlControl(){return this.form.controls.baseUrl}get apiKeyControl(){return this.form.controls.apiKey}get scopeControl(){return this.form.controls.scope}get headersArray(){return this.form.controls.headers}addHeader(){this.headersArray.push(new z({key:new _t("",{nonNullable:true,validators:[_e$1.required]}),value:new _t("",{nonNullable:true})}));}removeHeader(r){this.headersArray.removeAt(r);}isEditMode=Hi(false);isSubmitting=Hi(false);isLoading=Hi(false);existingConfig=null;initialApiKey="";constructor(){this.isPlatformMode||Hf(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let r=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,l=r.get("aiProviderId"),s=this.isPlatformMode?"namespace":this.parseScope(e.get("scope"));if(l){this.isEditMode.set(true),this.scopeControl.disable(),this.apiTypeControl.disable(),this.loadConfig(l);return}this.scopeControl.setValue(s);let f=e.get("template");f&&this.hydrateFromTemplate(f);}parseScope(r){return r&&ge.has(r)?r:"namespace"}deriveScopeFromConfig(r){return !r.userId?"namespace":r.namespaceId?"userOnNs":"userGlobal"}loadConfig(r){this.isLoading.set(true),this.state.getById(r).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AiProviderForm] Could not load provider '${r}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(r){this.isLoading.set(true),this.state.getById(r).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.apiTypeControl.setValue(e.apiType),this.baseUrlControl.setValue(e.baseUrl??""),this.apiKeyControl.setValue(""),this.initialApiKey="",this.apiKeyControl.markAsTouched(),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AiProviderForm] Could not hydrate from template ${r}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(r){this.nameControl.setValue(r.name),this.descriptionControl.setValue(r.description??null),this.apiTypeControl.setValue(r.apiType),this.baseUrlControl.setValue(r.baseUrl??"");let e=r.apiKey??"";this.apiKeyControl.setValue(e),this.initialApiKey=e,this.headersArray.clear();for(let[l,s]of Object.entries(r.headers??{}))this.headersArray.push(new z({key:new _t(l,{nonNullable:true,validators:[_e$1.required]}),value:new _t(s,{nonNullable:true})}));}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let r=this.descriptionControl.value?.trim(),e=this.baseUrlControl.value.trim(),l=this.apiKeyControl.value,s=this.isEditMode()&&l===this.initialApiKey?null:l,f=this.headersArray.controls.filter(x=>x.controls.key.value.trim()).map(x=>[x.controls.key.value.trim(),x.controls.value.value]),de=f.length>0?Object.fromEntries(f):null,N={name:this.nameControl.value.trim(),apiType:this.apiTypeControl.value,description:r||null,baseUrl:e||null,apiKey:s,headers:de},T=this.form.getRawValue().scope,pe=this.isPlatformMode?null:this.namespaceId??null;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,N,T,this.existingConfig):this.state.create(N,T,pe)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-providers"]):this.router.navigate(["/agentos",this.namespaceId,"ai-providers"]);}trackByScope(r,e){return e.value}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=Aw({type:a,selectors:[["agentos-ai-provider-form"]],decls:10,vars:2,consts:[[1,"ai-provider-form"],[1,"ai-provider-form__header"],["type","button","title","Back to AI providers",1,"ai-provider-form__back",3,"click"],[1,"ai-provider-form__back-icon"],[1,"ai-provider-form__title"],[1,"ai-provider-form__loading"],[1,"ai-provider-form__form",3,"formGroup"],[1,"ai-provider-form__form",3,"ngSubmit","formGroup"],[1,"ai-provider-form__scope",3,"disabled"],[1,"ai-provider-form__field"],["for","llm-api-type",1,"ai-provider-form__label"],["aria-hidden","true"],["id","llm-api-type",1,"ai-provider-form__select",3,"formControl"],[3,"value"],["for","llm-name",1,"ai-provider-form__label"],["id","llm-name","type","text","placeholder","e.g. OpenAI prod","autocomplete","off",1,"ai-provider-form__input",3,"formControl"],["for","llm-description",1,"ai-provider-form__label"],["id","llm-description","type","text","placeholder","Optional \u2014 short description of this provider","autocomplete","off",1,"ai-provider-form__input",3,"formControl"],["for","llm-base-url",1,"ai-provider-form__label"],["id","llm-base-url","type","url","placeholder","Optional \u2014 leave empty for default endpoint","autocomplete","off",1,"ai-provider-form__input",3,"formControl"],["for","llm-api-key",1,"ai-provider-form__label"],["id","llm-api-key","type","password","placeholder","sk-\u2026","autocomplete","new-password",1,"ai-provider-form__input","ai-provider-form__input--secret",3,"formControl"],[1,"ai-provider-form__headers",3,"formArrayName"],[1,"ai-provider-form__headers-title"],[1,"ai-provider-form__label"],["type","button",1,"ai-provider-form__headers-add",3,"click"],[1,"ai-provider-form__header-row",3,"formGroupName"],[1,"ai-provider-form__actions"],["type","submit",1,"ai-provider-form__btn","ai-provider-form__btn--primary",3,"disabled"],["type","button",1,"ai-provider-form__btn",3,"click"],[1,"ai-provider-form__scope-option"],["type","radio",3,"formControl","value","disabled"],["type","text","placeholder","Header name","formControlName","key","autocomplete","off",1,"ai-provider-form__input"],["type","text","placeholder","Value","formControlName","value","autocomplete","off",1,"ai-provider-form__input"],["type","button","title","Remove header","aria-label","Remove header",1,"ai-provider-form__header-remove",3,"click"]],template:function(e,l){e&1&&(vs(0,"div",0)(1,"header",1)(2,"button",2),Ag("click",function(){return l.cancel()}),vs(3,"span",3),WC(4,"\u2190"),fl(),WC(5," AI Providers "),fl(),vs(6,"h1",4),WC(7),fl()(),eC(8,ce,2,0,"p",5)(9,_e,41,10,"form",6),fl()),e&2&&(XE(7),Zg(l.isEditMode()?"Edit AI provider":"New AI provider"),XE(),tC(l.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,At,mn,Zn,Xn,Cn,En,An,Ct,Vt],styles:[".ai-provider-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:480px;margin:0 auto;padding:2rem 1rem}.ai-provider-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-divider);border-radius:0;padding:.75rem 1rem;margin:0}.ai-provider-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.ai-provider-form__scope-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;font-size:.85rem;color:var(--color-text);cursor:pointer}.ai-provider-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.ai-provider-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.ai-provider-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.ai-provider-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.ai-provider-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.ai-provider-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.ai-provider-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.ai-provider-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.ai-provider-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.ai-provider-form__input[_ngcontent-%COMP%], .ai-provider-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.ai-provider-form__input[_ngcontent-%COMP%]:focus, .ai-provider-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.ai-provider-form__input[_ngcontent-%COMP%]::placeholder, .ai-provider-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.ai-provider-form__input--secret[_ngcontent-%COMP%]{font-family:monospace;letter-spacing:.05em}.ai-provider-form__headers[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.ai-provider-form__headers-title[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}.ai-provider-form__headers-add[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.8125rem;color:var(--color-accent)}.ai-provider-form__headers-add[_ngcontent-%COMP%]:hover{text-decoration:underline}.ai-provider-form__header-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr auto;gap:.5rem;align-items:center}.ai-provider-form__header-remove[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;background:none;border:1px solid transparent;border-radius:0;cursor:pointer;font-size:1rem;color:var(--color-neutral-500);transition:background .15s ease,color .15s ease,border-color .15s ease;flex-shrink:0}.ai-provider-form__header-remove[_ngcontent-%COMP%]:hover{color:var(--red);background:color-mix(in srgb,var(--red) 10%,transparent);border-color:var(--red)}.ai-provider-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.ai-provider-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.ai-provider-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.ai-provider-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.ai-provider-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.ai-provider-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"]})};export{se as AiProviderFormComponent};
|
|
1
|
+
import {O}from'./chunk-TxtSVoMY.js';import {v}from'./chunk-BPt7wScV.js';import {g,ao as V,G,w as we,H as Hi,F as F$1,dc as he,cd as Hf,b as U,A as Aw,v as vs,k as Ag,W as WC,j as fl,n as eC,X as XE,a8 as Zg,t as tC,a9 as dC,q as oC,a4 as rC,a3 as HI,o as bg,bo as nC,ac as mC,r as Tg,a6 as $I,x as iC,a5 as yl,cH as Xw,aa as If,ab as wf}from'./main-MX6O2FH4.js';import'./chunk-BDkp40LI.js';import {o as z,z as ze,k as _t,b as _e$1,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,A as At,m as mn,Z as Zn,l as Xn,C as Cn,E as En,p as An,q as Ct,V as Vt}from'./chunk-CJdqLI4x.js';import'./chunk-CmUHL9Tg.js';import'./chunk-BkVtgsRG.js';import'./chunk-LlG18Htx.js';import'./chunk-CUmZcEGx.js';function ce(a,r){a&1&&(vs(0,"p",5),WC(1,"Loading\u2026"),fl());}function me(a,r){if(a&1&&(vs(0,"label",30),bg(1,"input",31),HI(),vs(2,"span"),WC(3),fl()()),a&2){let e=r.$implicit,l=mC(3);XE(),Tg("formControl",l.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!l.isAdmin()),$I(),XE(2),Zg(e.label);}}function ue(a,r){if(a&1&&(vs(0,"fieldset",8)(1,"legend",24),WC(2,"Port\xE9e de la configuration"),fl(),oC(3,me,4,4,"label",30,Xw().trackByScope,true),fl()),a&2){let e=mC(2);Tg("disabled",e.isEditMode()),XE(3),iC(e.scopeOptions);}}function ve(a,r){if(a&1&&(vs(0,"option",13),WC(1),fl()),a&2){let e=r.$implicit;Tg("value",e),XE(),Zg(e);}}function fe(a,r){if(a&1){let e=dC();vs(0,"div",26),bg(1,"input",32),HI(),bg(2,"input",33),HI(),vs(3,"button",34),Ag("click",function(){let s=If(e).$index,f=mC(2);return wf(f.removeHeader(s))}),WC(4," \xD7 "),fl()();}if(a&2){let e=r.$index;Tg("formGroupName",e),XE(),$I(),XE(),$I();}}function _e(a,r){if(a&1){let e=dC();vs(0,"form",7),Ag("ngSubmit",function(){If(e);let s=mC();return wf(s.submit())}),eC(1,ue,5,1,"fieldset",8),vs(2,"div",9)(3,"label",10),WC(4,"API type "),vs(5,"span",11),WC(6,"*"),fl()(),vs(7,"select",12),oC(8,ve,2,2,"option",13,rC),fl(),HI(),fl(),vs(10,"div",9)(11,"label",14),WC(12,"Name "),vs(13,"span",11),WC(14,"*"),fl()(),bg(15,"input",15),HI(),fl(),vs(16,"div",9)(17,"label",16),WC(18,"Description"),fl(),bg(19,"input",17),HI(),fl(),vs(20,"div",9)(21,"label",18),WC(22,"Base URL"),fl(),bg(23,"input",19),HI(),fl(),vs(24,"div",9)(25,"label",20),WC(26,"API key"),fl(),bg(27,"input",21),HI(),fl(),vs(28,"div",22)(29,"div",23)(30,"span",24),WC(31,"Custom headers"),fl(),vs(32,"button",25),Ag("click",function(){If(e);let s=mC();return wf(s.addHeader())}),WC(33,"+ Add header"),fl()(),oC(34,fe,5,1,"div",26,nC),fl(),vs(36,"div",27)(37,"button",28),WC(38),fl(),vs(39,"button",29),Ag("click",function(){If(e);let s=mC();return wf(s.cancel())}),WC(40,"Cancel"),fl()()();}if(a&2){let e=mC();Tg("formGroup",e.form),XE(),tC(e.isPlatformMode?-1:1),XE(6),Tg("formControl",e.apiTypeControl),$I(),XE(),iC(e.apiTypeOptions),XE(7),Tg("formControl",e.nameControl),$I(),XE(4),Tg("formControl",e.descriptionControl),$I(),XE(4),Tg("formControl",e.baseUrlControl),$I(),XE(4),Tg("formControl",e.apiKeyControl),$I(),XE(),Tg("formArrayName","headers"),XE(6),iC(e.headersArray.controls),XE(3),Tg("disabled",e.form.invalid||e.isSubmitting()),XE(),yl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var ge=new Set(["namespace","userOnNs","userGlobal"]),F=Object.freeze({platform:"Configuration de niveau plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),se=class a{route=g(V);router=g(G);destroyRef=g(we);state=g(O);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?Hi(true):F$1(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});apiTypeOptions=Object.values(he);scopeOptions=[{value:"namespace",label:F.namespace},{value:"userOnNs",label:F.userOnNs},{value:"userGlobal",label:F.userGlobal}];form=new z({name:new _t("",{nonNullable:true,validators:[_e$1.required,_e$1.minLength(1)]}),description:new _t(null),apiType:new _t("OpenAI",{nonNullable:true,validators:[_e$1.required]}),baseUrl:new _t("",{nonNullable:true}),apiKey:new _t("",{nonNullable:true}),scope:new _t("namespace",{nonNullable:true}),headers:new ze([],{validators:[]})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get apiTypeControl(){return this.form.controls.apiType}get baseUrlControl(){return this.form.controls.baseUrl}get apiKeyControl(){return this.form.controls.apiKey}get scopeControl(){return this.form.controls.scope}get headersArray(){return this.form.controls.headers}addHeader(){this.headersArray.push(new z({key:new _t("",{nonNullable:true,validators:[_e$1.required]}),value:new _t("",{nonNullable:true})}));}removeHeader(r){this.headersArray.removeAt(r);}isEditMode=Hi(false);isSubmitting=Hi(false);isLoading=Hi(false);existingConfig=null;initialApiKey="";constructor(){this.isPlatformMode||Hf(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let r=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,l=r.get("aiProviderId"),s=this.isPlatformMode?"namespace":this.parseScope(e.get("scope"));if(l){this.isEditMode.set(true),this.scopeControl.disable(),this.apiTypeControl.disable(),this.loadConfig(l);return}this.scopeControl.setValue(s);let f=e.get("template");f&&this.hydrateFromTemplate(f);}parseScope(r){return r&&ge.has(r)?r:"namespace"}deriveScopeFromConfig(r){return !r.userId?"namespace":r.namespaceId?"userOnNs":"userGlobal"}loadConfig(r){this.isLoading.set(true),this.state.getById(r).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AiProviderForm] Could not load provider '${r}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(r){this.isLoading.set(true),this.state.getById(r).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.apiTypeControl.setValue(e.apiType),this.baseUrlControl.setValue(e.baseUrl??""),this.apiKeyControl.setValue(""),this.initialApiKey="",this.apiKeyControl.markAsTouched(),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AiProviderForm] Could not hydrate from template ${r}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(r){this.nameControl.setValue(r.name),this.descriptionControl.setValue(r.description??null),this.apiTypeControl.setValue(r.apiType),this.baseUrlControl.setValue(r.baseUrl??"");let e=r.apiKey??"";this.apiKeyControl.setValue(e),this.initialApiKey=e,this.headersArray.clear();for(let[l,s]of Object.entries(r.headers??{}))this.headersArray.push(new z({key:new _t(l,{nonNullable:true,validators:[_e$1.required]}),value:new _t(s,{nonNullable:true})}));}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let r=this.descriptionControl.value?.trim(),e=this.baseUrlControl.value.trim(),l=this.apiKeyControl.value,s=this.isEditMode()&&l===this.initialApiKey?null:l,f=this.headersArray.controls.filter(x=>x.controls.key.value.trim()).map(x=>[x.controls.key.value.trim(),x.controls.value.value]),de=f.length>0?Object.fromEntries(f):null,N={name:this.nameControl.value.trim(),apiType:this.apiTypeControl.value,description:r||null,baseUrl:e||null,apiKey:s,headers:de},T=this.form.getRawValue().scope,pe=this.isPlatformMode?null:this.namespaceId??null;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,N,T,this.existingConfig):this.state.create(N,T,pe)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-providers"]):this.router.navigate(["/agentos",this.namespaceId,"ai-providers"]);}trackByScope(r,e){return e.value}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=Aw({type:a,selectors:[["agentos-ai-provider-form"]],decls:10,vars:2,consts:[[1,"ai-provider-form"],[1,"ai-provider-form__header"],["type","button","title","Back to AI providers",1,"ai-provider-form__back",3,"click"],[1,"ai-provider-form__back-icon"],[1,"ai-provider-form__title"],[1,"ai-provider-form__loading"],[1,"ai-provider-form__form",3,"formGroup"],[1,"ai-provider-form__form",3,"ngSubmit","formGroup"],[1,"ai-provider-form__scope",3,"disabled"],[1,"ai-provider-form__field"],["for","llm-api-type",1,"ai-provider-form__label"],["aria-hidden","true"],["id","llm-api-type",1,"ai-provider-form__select",3,"formControl"],[3,"value"],["for","llm-name",1,"ai-provider-form__label"],["id","llm-name","type","text","placeholder","e.g. OpenAI prod","autocomplete","off",1,"ai-provider-form__input",3,"formControl"],["for","llm-description",1,"ai-provider-form__label"],["id","llm-description","type","text","placeholder","Optional \u2014 short description of this provider","autocomplete","off",1,"ai-provider-form__input",3,"formControl"],["for","llm-base-url",1,"ai-provider-form__label"],["id","llm-base-url","type","url","placeholder","Optional \u2014 leave empty for default endpoint","autocomplete","off",1,"ai-provider-form__input",3,"formControl"],["for","llm-api-key",1,"ai-provider-form__label"],["id","llm-api-key","type","password","placeholder","sk-\u2026","autocomplete","new-password",1,"ai-provider-form__input","ai-provider-form__input--secret",3,"formControl"],[1,"ai-provider-form__headers",3,"formArrayName"],[1,"ai-provider-form__headers-title"],[1,"ai-provider-form__label"],["type","button",1,"ai-provider-form__headers-add",3,"click"],[1,"ai-provider-form__header-row",3,"formGroupName"],[1,"ai-provider-form__actions"],["type","submit",1,"ai-provider-form__btn","ai-provider-form__btn--primary",3,"disabled"],["type","button",1,"ai-provider-form__btn",3,"click"],[1,"ai-provider-form__scope-option"],["type","radio",3,"formControl","value","disabled"],["type","text","placeholder","Header name","formControlName","key","autocomplete","off",1,"ai-provider-form__input"],["type","text","placeholder","Value","formControlName","value","autocomplete","off",1,"ai-provider-form__input"],["type","button","title","Remove header","aria-label","Remove header",1,"ai-provider-form__header-remove",3,"click"]],template:function(e,l){e&1&&(vs(0,"div",0)(1,"header",1)(2,"button",2),Ag("click",function(){return l.cancel()}),vs(3,"span",3),WC(4,"\u2190"),fl(),WC(5," AI Providers "),fl(),vs(6,"h1",4),WC(7),fl()(),eC(8,ce,2,0,"p",5)(9,_e,41,10,"form",6),fl()),e&2&&(XE(7),Zg(l.isEditMode()?"Edit AI provider":"New AI provider"),XE(),tC(l.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,At,mn,Zn,Xn,Cn,En,An,Ct,Vt],styles:[".ai-provider-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:480px;margin:0 auto;padding:2rem 1rem}.ai-provider-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-divider);border-radius:0;padding:.75rem 1rem;margin:0}.ai-provider-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.ai-provider-form__scope-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;font-size:.85rem;color:var(--color-text);cursor:pointer}.ai-provider-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.ai-provider-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.ai-provider-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.ai-provider-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.ai-provider-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.ai-provider-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.ai-provider-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.ai-provider-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.ai-provider-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.ai-provider-form__input[_ngcontent-%COMP%], .ai-provider-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.ai-provider-form__input[_ngcontent-%COMP%]:focus, .ai-provider-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.ai-provider-form__input[_ngcontent-%COMP%]::placeholder, .ai-provider-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.ai-provider-form__input--secret[_ngcontent-%COMP%]{font-family:monospace;letter-spacing:.05em}.ai-provider-form__headers[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.ai-provider-form__headers-title[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}.ai-provider-form__headers-add[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.8125rem;color:var(--color-accent)}.ai-provider-form__headers-add[_ngcontent-%COMP%]:hover{text-decoration:underline}.ai-provider-form__header-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr auto;gap:.5rem;align-items:center}.ai-provider-form__header-remove[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;background:none;border:1px solid transparent;border-radius:0;cursor:pointer;font-size:1rem;color:var(--color-neutral-500);transition:background .15s ease,color .15s ease,border-color .15s ease;flex-shrink:0}.ai-provider-form__header-remove[_ngcontent-%COMP%]:hover{color:var(--red);background:color-mix(in srgb,var(--red) 10%,transparent);border-color:var(--red)}.ai-provider-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.ai-provider-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.ai-provider-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.ai-provider-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.ai-provider-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.ai-provider-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"]})};export{se as AiProviderFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {i}from'./chunk-
|
|
1
|
+
import {i}from'./chunk-CmUHL9Tg.js';import {l}from'./chunk-BDkp40LI.js';import {g as g$1,dd as $,aJ as Tr,aD as Ly,bS as ma,a7 as ga,S as ha,u as ue,cE as Rd,bU as Od,a as P,Y as x}from'./main-MX6O2FH4.js';var g="none",N="me",O=class p{nsController=g$1($);userState=g$1(l);refresh$=new Tr(void 0);namespaceId$=new Tr(null);vm$=Ly([this.namespaceId$,this.refresh$]).pipe(ma(([e])=>{let r=this.loadPlatformProviders().pipe(ga(()=>ha([])));return e?Ly([r,this.loadNamespaceProviders(e).pipe(ga(()=>ha([]))),this.loadUserProviders(e).pipe(ga(()=>ha([]))),this.loadUserProviders("global").pipe(ga(()=>ha([])))]).pipe(ue(([i,n,s,t])=>({platform:i,namespace:n,userOnNs:s,userGlobal:t}))):Ly([r,this.loadNamespaceProviders("").pipe(ga(()=>ha([]))),this.loadUserProviders("global").pipe(ga(()=>ha([])))]).pipe(ue(([i,n,s])=>({platform:i,namespace:n,userOnNs:[],userGlobal:s})))}),Rd({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadUserProviders(e){let r=e==="global"?g:e;return this.nsController.listAiProvider(r,N)}userGlobal$=i(this.refresh$,()=>this.loadUserProviders("global"),[]);loadPlatformProviders(){return this.nsController.listAiProvider(g)}loadNamespaceProviders(e){return e?this.nsController.listAiProvider(e):ha([])}getById(e,r){return this.nsController.getByIdAiProvider(e)}create(e,r,i){let s=this.userState.currentUser()?.id;if((r==="userOnNs"||r==="userGlobal")&&!s)throw new Error(`Cannot create ${r} provider before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(r==="namespace"){if(i===void 0||i==="")throw new Error("Cannot create namespace-scoped provider without a namespaceId");let S={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,namespaceId:i??void 0};return this.nsController.createAiProvider(S).pipe(Od(()=>this.refresh()))}if(r==="userOnNs"&&!i)throw new Error("Cannot create userOnNs provider without a namespaceId");let t={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,userId:s,namespaceId:r==="userOnNs"?i:void 0};return this.nsController.createAiProvider(t).pipe(Od(()=>this.refresh()))}update(e,r,i,n){let s=r.apiKey===null?{}:{apiKey:r.apiKey},t=P({name:r.name,apiType:r.apiType,description:r.description,baseUrl:r.baseUrl,headers:r.headers??void 0,namespaceId:n.namespaceId,userId:n.userId},s);return this.nsController.updateAiProvider(e,t).pipe(Od(()=>this.refresh()))}delete(e,r){return this.nsController.deleteAiProvider(e).pipe(Od(()=>this.refresh()))}static \u0275fac=function(r){return new(r||p)};static \u0275prov=x({token:p,factory:p.\u0275fac,providedIn:"root"})};export{O};
|