@whoz-oss/coday-client 0.249.3 → 0.249.4
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-Tnt17Uum.js → chunk-2TapTaXG.js} +1 -1
- package/browser/{chunk-otU95DGd.js → chunk-6tHPoek7.js} +1 -1
- package/browser/{chunk-DF9JuMSS.js → chunk-B-LBXHg-.js} +1 -1
- package/browser/{chunk-DATqkmXk.js → chunk-B0kyFx_y.js} +1 -1
- package/browser/{chunk-CSWaefpi.js → chunk-B4aBp6WW.js} +1 -1
- package/browser/{chunk-DIeUX6U7.js → chunk-B6DehsQ-.js} +1 -1
- package/browser/{chunk-rdNDu_G5.js → chunk-B6HBR6l3.js} +1 -1
- package/browser/{chunk-B0QeL_YS.js → chunk-BC_2TEa6.js} +1 -1
- package/browser/{chunk-Dh70Sw4n.js → chunk-BLwyktBH.js} +1 -1
- package/browser/{chunk-ZgaZX2Mw.js → chunk-BPTzJwdV.js} +1 -1
- package/browser/{chunk-B4ZxVpmQ.js → chunk-BRKM9jBe.js} +1 -1
- package/browser/{chunk-Bb8FM5N7.js → chunk-BTNW2iz6.js} +1 -1
- package/browser/{chunk-BXRE8Jnn.js → chunk-BT_iRqki.js} +1 -1
- package/browser/{chunk-Dv3y4cq8.js → chunk-BUF2p97y.js} +1 -1
- package/browser/{chunk-6uQvW5vO.js → chunk-BWdSq8vF.js} +1 -1
- package/browser/chunk-BY3C8HLz.js +276 -0
- package/browser/{chunk-D36CcRIa.js → chunk-BYD-ZEqa.js} +1 -1
- package/browser/{chunk-hivMYdms.js → chunk-BZZR3aP2.js} +1 -1
- package/browser/{chunk-BYobt-yL.js → chunk-B_crlzIY.js} +1 -1
- package/browser/{chunk-CyUSpM0s.js → chunk-BaP2JhEB.js} +1 -1
- package/browser/{chunk-8QCOKWfy.js → chunk-Bggbx31H.js} +1 -1
- package/browser/{chunk-BXeg32ej.js → chunk-BhlAZzwj.js} +1 -1
- package/browser/{chunk-Bo7V2O_x.js → chunk-Bi0_x9sA.js} +1 -1
- package/browser/{chunk-CMgbU-FY.js → chunk-BkD_xP5e.js} +1 -1
- package/browser/{chunk-CtCrz21E.js → chunk-BlR-g_sS.js} +1 -1
- package/browser/{chunk-ChlM0KaI.js → chunk-BtVK9hVG.js} +1 -1
- package/browser/{chunk-R1YuCBfk.js → chunk-BzkpZO0i.js} +1 -1
- package/browser/{chunk-Dc58xQxP.js → chunk-C4iXIN7X.js} +1 -1
- package/browser/{chunk-BHrJwQJY.js → chunk-C7zuPRu9.js} +1 -1
- package/browser/{chunk-B1T1lhxO.js → chunk-CBe69s-2.js} +1 -1
- package/browser/{chunk-cxvtBPGk.js → chunk-CFLyg-oC.js} +1 -1
- package/browser/{chunk-DrzUXE6a.js → chunk-CSzw8H2F.js} +1 -1
- package/browser/{chunk-DWXHIgAs.js → chunk-CTYiqe0l.js} +1 -1
- package/browser/{chunk-CRujMca4.js → chunk-CWFDInt7.js} +1 -1
- package/browser/{chunk-CI20rCP1.js → chunk-CgrWMGhT.js} +1 -1
- package/browser/{chunk-CEFRpdhC.js → chunk-Cr2mSoCg.js} +1 -1
- package/browser/{chunk-BGG8qTjD.js → chunk-CsOfELwl.js} +1 -1
- package/browser/{chunk-CoVKXwLW.js → chunk-CtWA9Wcw.js} +2 -2
- package/browser/{chunk-Ims5pjdx.js → chunk-CvL11Svz.js} +1 -1
- package/browser/{chunk-CESBNo1v.js → chunk-CwUIxEoO.js} +1 -1
- package/browser/{chunk-Js79q0Hk.js → chunk-Cxcbg8Y2.js} +1 -1
- package/browser/{chunk-hpkckHAH.js → chunk-D2yqDA1u.js} +1 -1
- package/browser/{chunk-D4O2SdR-.js → chunk-DITp7n6E.js} +1 -1
- package/browser/{chunk-CujZ5wxO.js → chunk-DLXkxUg9.js} +1 -1
- package/browser/{chunk-DVw6VVSF.js → chunk-DLsoHfhP.js} +1 -1
- package/browser/chunk-DVJHLBDM.js +1 -0
- package/browser/{chunk-sQ2hJaJy.js → chunk-DVQQW6km.js} +1 -1
- package/browser/{chunk-CSLsbjtc.js → chunk-DcWLC4S7.js} +1 -1
- package/browser/{chunk-Cl7N3gK-.js → chunk-De9hRkSc.js} +1 -1
- package/browser/{chunk-DqOy3vx6.js → chunk-Dlm3_p0t.js} +1 -1
- package/browser/{chunk-tiXMntK-.js → chunk-Dlx5Rt5V.js} +1 -1
- package/browser/{chunk-Df2NmKyO.js → chunk-DoYeTXOn.js} +1 -1
- package/browser/{chunk-BngP4FHh.js → chunk-DrMoRmsm.js} +1 -1
- package/browser/{chunk-C_hps2N_.js → chunk-DvXx9y4n.js} +1 -1
- package/browser/{chunk-BbkTgcYb.js → chunk-DwJCq7KC.js} +1 -1
- package/browser/{chunk-Cvmc37VM.js → chunk-NOr0w_o_.js} +1 -1
- package/browser/{chunk-D615HDbJ.js → chunk-Pl7edkoq.js} +1 -1
- package/browser/{chunk-DxyVrxwh.js → chunk-Sc506DO8.js} +1 -1
- package/browser/{chunk-DuetvIR9.js → chunk-ZXaT_xHg.js} +1 -1
- package/browser/{chunk-DW95Jf_o.js → chunk-ZrkAX8bu.js} +1 -1
- package/browser/{chunk-CawleOYk.js → chunk-anmUJQp9.js} +1 -1
- package/browser/{chunk-B9VW5ZdD.js → chunk-cHZU18W6.js} +1 -1
- package/browser/{chunk-D8jkRlhn.js → chunk-gI_QNDKB.js} +1 -1
- package/browser/{chunk-TsE9fL5L.js → chunk-nHbbuVx2.js} +1 -1
- package/browser/{chunk-D3bTMcOe.js → chunk-p1EUiu98.js} +1 -1
- package/browser/{chunk-NZ2JSd9Y.js → chunk-spSRZfqJ.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/{main-CERDHS7N.js → main-ZCJEGFW3.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-BWVGuXWV.js +0 -1
- package/browser/chunk-CeEsFGfn.js +0 -276
|
@@ -1 +1 @@
|
|
|
1
|
-
import {i}from'./chunk-
|
|
1
|
+
import {i}from'./chunk-DVJHLBDM.js';import {u}from'./chunk-CtWA9Wcw.js';import {g,d7 as F,df as se,aI as Tr,aD as Ly,bR as ga,a7 as ha,S as pa,u as ue,cD as Rd,bT as Od,Y as x}from'./main-ZCJEGFW3.js';var N="none",O="me",y=class f{nsController=g(F);exportService=g(se);userState=g(u);refresh$=new Tr(void 0);namespaceId$=new Tr(null);vm$=Ly([this.namespaceId$,this.refresh$]).pipe(ga(([e])=>{let n=this.loadPlatformConfigs().pipe(ha(()=>pa([]))),t=this.loadUserConfigs("global").pipe(ha(()=>pa([])));return e?Ly([n,this.loadNamespaceConfigs(e).pipe(ha(()=>pa([]))),this.loadUserConfigs(e).pipe(ha(()=>pa([]))),t]).pipe(ue(([i,r,c,s])=>({platform:i,namespace:r,userOnNs:c,userGlobal:s}))):Ly([n,t]).pipe(ue(([i,r])=>({platform:i,namespace:[],userOnNs:[],userGlobal:r})))}),Rd({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadPlatformConfigs(){return this.nsController.listIntegrationConfig()}loadUserConfigs(e){let n=e==="global"?N:e;return this.nsController.listIntegrationConfig(n,O)}userGlobal$=i(this.refresh$,()=>this.loadUserConfigs("global"),[]);loadNamespaceConfigs(e){return e?this.nsController.listIntegrationConfig(e):pa([])}getById(e,n){return this.nsController.getByIdIntegrationConfig(e)}create(e,n,t){let r=this.userState.currentUser()?.id;if((n==="userOnNs"||n==="userGlobal")&&!r)throw new Error(`Cannot create ${n} config before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(n==="platform"){let s={name:e.name,integrationType:e.integrationType,description:e.description,parameters:e.parameters,authSettingName:e.authSettingName??void 0};return this.nsController.createIntegrationConfig(s).pipe(Od(()=>this.refresh()))}if(n==="namespace"){if(!t)throw new Error("Cannot create namespace-scoped config without a namespaceId");let s={name:e.name,integrationType:e.integrationType,description:e.description,namespaceId:t,parameters:e.parameters,authSettingName:e.authSettingName??void 0};return this.nsController.createIntegrationConfig(s).pipe(Od(()=>this.refresh()))}if(n==="userOnNs"&&!t)throw new Error("Cannot create userOnNs config without a namespaceId");let c={name:e.name,integrationType:e.integrationType,description:e.description,userId:r,namespaceId:n==="userOnNs"?t:void 0,parameters:e.parameters,authSettingName:e.authSettingName??void 0};return this.nsController.createIntegrationConfig(c).pipe(Od(()=>this.refresh()))}update(e,n,t,i){let r={name:n.name,integrationType:n.integrationType,description:n.description,userId:i.userId,namespaceId:i.namespaceId,parameters:n.parameters,authSettingName:n.authSettingName??void 0};return this.nsController.updateIntegrationConfig(e,r).pipe(Od(()=>this.refresh()))}delete(e,n){return this.nsController.deleteIntegrationConfig(e).pipe(Od(()=>this.refresh()))}exportAsYaml(e){return this.exportService.exportAsYaml(e)}static \u0275fac=function(n){return new(n||f)};static \u0275prov=x({token:f,factory:f.\u0275fac,providedIn:"root"})};export{y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {d}from'./chunk-CoVKXwLW.js';import {g,ao as V,G as G$1,w as we,d8 as M,H as Hi,b as U$1,A as Aw,s as si,v as vs,l as Ag,W as WC,k as dl,n as eC,X as XE,r as Tg,t as tC,a8 as Zg,y as Hg,a5 as ml,a9 as dC,ac as mC,C as Cg,q as oC,x as iC,o as bg,be as aT,bf as uT,aa as If,ab as wf,bi as aE}from'./main-CERDHS7N.js';import'./chunk-rdNDu_G5.js';import'./chunk-Dh70Sw4n.js';import'./chunk-Dv3y4cq8.js';import'./chunk-D615HDbJ.js';var F=(n,o)=>o.name;function B(n,o){n&1&&(vs(0,"p",6),WC(1,"Loading\u2026"),dl());}function $(n,o){n&1&&(vs(0,"p",7),WC(1,"Failed to load agent definition."),dl());}function j(n,o){if(n&1&&(vs(0,"dt",12),WC(1,"User context"),dl(),vs(2,"dd",14),WC(3),dl()),n&2){let e=mC();XE(3),Zg(e.userId);}}function H(n,o){if(n&1&&(vs(0,"pre",21),WC(1),dl()),n&2){let e=mC(2);XE(),Zg(e.systemPrompt);}}function J(n,o){if(n&1){let e=dC();vs(0,"section",9)(1,"button",19),Ag("click",function(){If(e);let g=mC(2);return wf(g.toggleSystemPrompt())}),vs(2,"h2",10),WC(3,"System Prompt"),dl(),vs(4,"span",20),WC(5," \u25BC "),dl()(),eC(6,H,2,1,"pre",21),dl();}if(n&2){let e=mC(2);XE(),Cg("aria-expanded",!e.systemPromptCollapsed()),XE(3),Hg("agent-config-inspect__chevron--open",!e.systemPromptCollapsed()),XE(2),tC(e.systemPromptCollapsed()?-1:6);}}function U(n,o){if(n&1&&(vs(0,"pre",21),WC(1),dl()),n&2){let e=mC(2);XE(),Zg(e.instructions);}}function G(n,o){if(n&1){let e=dC();vs(0,"section",9)(1,"button",19),Ag("click",function(){If(e);let g=mC(2);return wf(g.toggleInstructions())}),vs(2,"h2",10),WC(3,"Instructions"),dl(),vs(4,"span",20),WC(5," \u25BC "),dl()(),eC(6,U,2,1,"pre",21),dl();}if(n&2){let e=mC(2);XE(),Cg("aria-expanded",!e.instructionsCollapsed()),XE(3),Hg("agent-config-inspect__chevron--open",!e.instructionsCollapsed()),XE(2),tC(e.instructionsCollapsed()?-1:6);}}function q(n,o){n&1&&(vs(0,"p",17),WC(1,"No tools available for this agent."),dl());}function K(n,o){if(n&1&&(bg(0,"div",26),aT(1,"agentosMarkdown")),n&2){let e=mC(2).$implicit;Tg("innerHTML",uT(1,1,e.description),aE);}}function Q(n,o){if(n&1&&(vs(0,"div",25),eC(1,K,2,3,"div",26),vs(2,"pre",27),WC(3),dl()()),n&2){let e=mC().$implicit,c=mC(3);XE(),tC(e.description?1:-1),XE(2),Zg(c.formatSchema(e.inputSchema));}}function W(n,o){if(n&1){let e=dC();vs(0,"li",22)(1,"button",23),Ag("click",function(){let g=If(e).$implicit,V=mC(3);return wf(V.toggleTool(g))}),vs(2,"span",24),WC(3),dl(),vs(4,"span",20),WC(5," \u25BC "),dl()(),eC(6,Q,4,2,"div",25),dl();}if(n&2){let e=o.$implicit,c=mC(3);XE(),Cg("aria-expanded",c.isToolExpanded(e)),XE(2),Zg(e.name),XE(),Hg("agent-config-inspect__chevron--open",c.isToolExpanded(e)),XE(2),tC(c.isToolExpanded(e)?6:-1);}}function X(n,o){if(n&1&&(vs(0,"ul",18),oC(1,W,7,5,"li",22,F),dl()),n&2){let e=mC();XE(),iC(e.tools);}}function Y(n,o){if(n&1&&(vs(0,"div",8)(1,"section",9)(2,"h2",10),WC(3,"General"),dl(),vs(4,"dl",11)(5,"dt",12),WC(6,"Name"),dl(),vs(7,"dd",13),WC(8),dl(),vs(9,"dt",12),WC(10,"Resolved model"),dl(),vs(11,"dd",14),WC(12),dl(),vs(13,"dt",12),WC(14,"Provider"),dl(),vs(15,"dd",13),WC(16),dl(),vs(17,"dt",12),WC(18,"Advanced execution"),dl(),vs(19,"dd",13)(20,"span",15),WC(21),dl()(),eC(22,j,4,1),dl()(),eC(23,J,7,4,"section",9),eC(24,G,7,4,"section",9),vs(25,"section",9)(26,"h2",10),WC(27," Tools "),vs(28,"span",16),WC(29),dl()(),eC(30,q,2,0,"p",17)(31,X,3,0,"ul",18),dl()()),n&2){let e=o;XE(8),Zg(e.name),XE(4),Zg(e.resolvedModelApiName),XE(4),Zg(e.resolvedProviderName),XE(4),Hg("agent-config-inspect__badge--active",e.advancedExecution),XE(),ml(" ",e.advancedExecution?"Enabled":"Disabled"," "),XE(),tC(e.userId?22:-1),XE(),tC(e.systemPrompt?23:-1),XE(),tC(e.instructions?24:-1),XE(5),ml("(",e.tools.length,")"),XE(),tC(e.tools.length===0?30:31);}}var R=class n{route=g(V);router=g(G$1);destroyRef=g(we);agentConfigController=g(M);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=Hi(true);hasError=Hi(false);definition=Hi(null);expandedTools=Hi(new Set);systemPromptCollapsed=Hi(true);instructionsCollapsed=Hi(true);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(U$1(this.destroyRef)).subscribe({next:o=>{this.definition.set(o),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}toggleTool(o){this.expandedTools.update(e=>{let c=new Set(e);return c.has(o.name)?c.delete(o.name):c.add(o.name),c});}isToolExpanded(o){return this.expandedTools().has(o.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(o=>!o);}toggleInstructions(){this.instructionsCollapsed.update(o=>!o);}formatSchema(o){try{return JSON.stringify(JSON.parse(o),null,2)}catch(e){return o}}editRoute(){return this.isPlatformMode?["/agentos","admin","agent-configs",this.agentConfigId,"edit"]:["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Aw({type:n,selectors:[["agentos-agent-config-inspect"]],decls:13,vars:2,consts:[[1,"agent-config-inspect"],[1,"agent-config-inspect__header"],["type","button","title","Back to agent configs",1,"agent-config-inspect__back",3,"click"],[1,"agent-config-inspect__back-icon"],[1,"agent-config-inspect__title"],[1,"agent-config-inspect__sibling-link",3,"routerLink"],[1,"agent-config-inspect__loading"],[1,"agent-config-inspect__error"],[1,"agent-config-inspect__content"],[1,"agent-config-inspect__section"],[1,"agent-config-inspect__section-title"],[1,"agent-config-inspect__dl"],[1,"agent-config-inspect__dt"],[1,"agent-config-inspect__dd"],[1,"agent-config-inspect__dd","agent-config-inspect__dd--mono"],[1,"agent-config-inspect__badge"],[1,"agent-config-inspect__count"],[1,"agent-config-inspect__empty"],[1,"agent-config-inspect__tools"],["type","button",1,"agent-config-inspect__collapsible",3,"click"],[1,"agent-config-inspect__chevron"],[1,"agent-config-inspect__instructions"],[1,"agent-config-inspect__tool"],["type","button",1,"agent-config-inspect__tool-header",3,"click"],[1,"agent-config-inspect__tool-name"],[1,"agent-config-inspect__tool-body"],[1,"agent-config-inspect__tool-description",3,"innerHTML"],[1,"agent-config-inspect__schema"]],template:function(e,c){if(e&1&&(vs(0,"div",0)(1,"header",1)(2,"button",2),Ag("click",function(){return c.back()}),vs(3,"span",3),WC(4,"\u2190"),dl(),WC(5," Agent Configs "),dl(),vs(6,"h1",4),WC(7,"Agent definition"),dl(),vs(8,"a",5),WC(9,"Edit config \u2192"),dl()(),eC(10,B,2,0,"p",6)(11,$,2,0,"p",7)(12,Y,32,11,"div",8),dl()),e&2){let g;XE(8),Tg("routerLink",c.editRoute()),XE(2),tC(c.isLoading()?10:c.hasError()?11:(g=c.definition())?12:-1,g);}},dependencies:[si,d],styles:[".agent-config-inspect[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.agent-config-inspect__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.agent-config-inspect__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-inspect__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-primary, #007aff);text-decoration:none}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__loading[_ngcontent-%COMP%], .agent-config-inspect__error[_ngcontent-%COMP%], .agent-config-inspect__empty[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__error[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.agent-config-inspect__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.agent-config-inspect__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1.25rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:10px}.agent-config-inspect__section-title[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f)}.agent-config-inspect__count[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;margin-left:.25rem}.agent-config-inspect__dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.5rem 1.25rem;margin:0}.agent-config-inspect__dt[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);align-self:center}.agent-config-inspect__dd[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);align-self:center;word-break:break-word}.agent-config-inspect__dd--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.875rem}.agent-config-inspect__badge[_ngcontent-%COMP%]{display:inline-block;padding:.2em .6em;border-radius:4px;font-size:.75rem;font-weight:500;background:var(--color-surface-muted, rgba(0, 0, 0, .06));color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__badge--active[_ngcontent-%COMP%]{background:var(--color-success-bg, #e3f5e1);color:var(--color-success, #34c759)}.agent-config-inspect__collapsible[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;background:none;border:none;padding:0;cursor:pointer;font-family:inherit;text-align:left}.agent-config-inspect__chevron[_ngcontent-%COMP%]{font-size:.7rem;color:var(--color-text-secondary, #6e6e73);transition:transform .15s ease;flex-shrink:0}.agent-config-inspect__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.agent-config-inspect__instructions[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;border-radius:6px;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.875rem;font-family:inherit;color:var(--color-text, #1d1d1f);white-space:pre-wrap;word-break:break-word;line-height:1.6;max-height:400px;overflow-y:auto}.agent-config-inspect__tools[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__tool[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .08));border-radius:6px;overflow:hidden}.agent-config-inspect__tool-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.75rem;width:100%;padding:.75rem 1rem;background:none;border:none;cursor:pointer;font-family:inherit;text-align:left;transition:background .1s ease}.agent-config-inspect__tool-header[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.agent-config-inspect__tool-name[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-config-inspect__tool-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:0 1rem .75rem;border-top:1px solid var(--color-border, rgba(0, 0, 0, .08))}.agent-config-inspect__tool-description[_ngcontent-%COMP%]{margin:0;padding-top:.75rem;font-size:.8125rem;line-height:1.5;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 .25rem}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:last-child{margin-bottom:0}.agent-config-inspect__tool-description[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:monospace;font-size:.8em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .3em;border-radius:3px}.agent-config-inspect__schema[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.8125rem;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:pre;overflow-x:auto;line-height:1.5;max-height:360px;overflow-y:auto}"]})};export{R as AgentConfigInspectComponent};
|
|
1
|
+
import {d}from'./chunk-CtWA9Wcw.js';import {g,ao as V,G as G$1,w as we,d8 as M,H as Hi,b as U$1,A as Aw,s as si,v as vs,l as Ag,W as WC,k as dl,n as eC,X as XE,r as Tg,t as tC,a8 as Zg,y as Hg,a5 as ml,a9 as dC,ac as mC,C as Cg,q as oC,x as iC,o as bg,be as aT,bf as uT,aa as If,ab as wf,bi as aE}from'./main-ZCJEGFW3.js';import'./chunk-B6HBR6l3.js';import'./chunk-BLwyktBH.js';import'./chunk-BUF2p97y.js';import'./chunk-Pl7edkoq.js';var F=(n,o)=>o.name;function B(n,o){n&1&&(vs(0,"p",6),WC(1,"Loading\u2026"),dl());}function $(n,o){n&1&&(vs(0,"p",7),WC(1,"Failed to load agent definition."),dl());}function j(n,o){if(n&1&&(vs(0,"dt",12),WC(1,"User context"),dl(),vs(2,"dd",14),WC(3),dl()),n&2){let e=mC();XE(3),Zg(e.userId);}}function H(n,o){if(n&1&&(vs(0,"pre",21),WC(1),dl()),n&2){let e=mC(2);XE(),Zg(e.systemPrompt);}}function J(n,o){if(n&1){let e=dC();vs(0,"section",9)(1,"button",19),Ag("click",function(){If(e);let g=mC(2);return wf(g.toggleSystemPrompt())}),vs(2,"h2",10),WC(3,"System Prompt"),dl(),vs(4,"span",20),WC(5," \u25BC "),dl()(),eC(6,H,2,1,"pre",21),dl();}if(n&2){let e=mC(2);XE(),Cg("aria-expanded",!e.systemPromptCollapsed()),XE(3),Hg("agent-config-inspect__chevron--open",!e.systemPromptCollapsed()),XE(2),tC(e.systemPromptCollapsed()?-1:6);}}function U(n,o){if(n&1&&(vs(0,"pre",21),WC(1),dl()),n&2){let e=mC(2);XE(),Zg(e.instructions);}}function G(n,o){if(n&1){let e=dC();vs(0,"section",9)(1,"button",19),Ag("click",function(){If(e);let g=mC(2);return wf(g.toggleInstructions())}),vs(2,"h2",10),WC(3,"Instructions"),dl(),vs(4,"span",20),WC(5," \u25BC "),dl()(),eC(6,U,2,1,"pre",21),dl();}if(n&2){let e=mC(2);XE(),Cg("aria-expanded",!e.instructionsCollapsed()),XE(3),Hg("agent-config-inspect__chevron--open",!e.instructionsCollapsed()),XE(2),tC(e.instructionsCollapsed()?-1:6);}}function q(n,o){n&1&&(vs(0,"p",17),WC(1,"No tools available for this agent."),dl());}function K(n,o){if(n&1&&(bg(0,"div",26),aT(1,"agentosMarkdown")),n&2){let e=mC(2).$implicit;Tg("innerHTML",uT(1,1,e.description),aE);}}function Q(n,o){if(n&1&&(vs(0,"div",25),eC(1,K,2,3,"div",26),vs(2,"pre",27),WC(3),dl()()),n&2){let e=mC().$implicit,c=mC(3);XE(),tC(e.description?1:-1),XE(2),Zg(c.formatSchema(e.inputSchema));}}function W(n,o){if(n&1){let e=dC();vs(0,"li",22)(1,"button",23),Ag("click",function(){let g=If(e).$implicit,V=mC(3);return wf(V.toggleTool(g))}),vs(2,"span",24),WC(3),dl(),vs(4,"span",20),WC(5," \u25BC "),dl()(),eC(6,Q,4,2,"div",25),dl();}if(n&2){let e=o.$implicit,c=mC(3);XE(),Cg("aria-expanded",c.isToolExpanded(e)),XE(2),Zg(e.name),XE(),Hg("agent-config-inspect__chevron--open",c.isToolExpanded(e)),XE(2),tC(c.isToolExpanded(e)?6:-1);}}function X(n,o){if(n&1&&(vs(0,"ul",18),oC(1,W,7,5,"li",22,F),dl()),n&2){let e=mC();XE(),iC(e.tools);}}function Y(n,o){if(n&1&&(vs(0,"div",8)(1,"section",9)(2,"h2",10),WC(3,"General"),dl(),vs(4,"dl",11)(5,"dt",12),WC(6,"Name"),dl(),vs(7,"dd",13),WC(8),dl(),vs(9,"dt",12),WC(10,"Resolved model"),dl(),vs(11,"dd",14),WC(12),dl(),vs(13,"dt",12),WC(14,"Provider"),dl(),vs(15,"dd",13),WC(16),dl(),vs(17,"dt",12),WC(18,"Advanced execution"),dl(),vs(19,"dd",13)(20,"span",15),WC(21),dl()(),eC(22,j,4,1),dl()(),eC(23,J,7,4,"section",9),eC(24,G,7,4,"section",9),vs(25,"section",9)(26,"h2",10),WC(27," Tools "),vs(28,"span",16),WC(29),dl()(),eC(30,q,2,0,"p",17)(31,X,3,0,"ul",18),dl()()),n&2){let e=o;XE(8),Zg(e.name),XE(4),Zg(e.resolvedModelApiName),XE(4),Zg(e.resolvedProviderName),XE(4),Hg("agent-config-inspect__badge--active",e.advancedExecution),XE(),ml(" ",e.advancedExecution?"Enabled":"Disabled"," "),XE(),tC(e.userId?22:-1),XE(),tC(e.systemPrompt?23:-1),XE(),tC(e.instructions?24:-1),XE(5),ml("(",e.tools.length,")"),XE(),tC(e.tools.length===0?30:31);}}var R=class n{route=g(V);router=g(G$1);destroyRef=g(we);agentConfigController=g(M);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=Hi(true);hasError=Hi(false);definition=Hi(null);expandedTools=Hi(new Set);systemPromptCollapsed=Hi(true);instructionsCollapsed=Hi(true);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(U$1(this.destroyRef)).subscribe({next:o=>{this.definition.set(o),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}toggleTool(o){this.expandedTools.update(e=>{let c=new Set(e);return c.has(o.name)?c.delete(o.name):c.add(o.name),c});}isToolExpanded(o){return this.expandedTools().has(o.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(o=>!o);}toggleInstructions(){this.instructionsCollapsed.update(o=>!o);}formatSchema(o){try{return JSON.stringify(JSON.parse(o),null,2)}catch(e){return o}}editRoute(){return this.isPlatformMode?["/agentos","admin","agent-configs",this.agentConfigId,"edit"]:["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Aw({type:n,selectors:[["agentos-agent-config-inspect"]],decls:13,vars:2,consts:[[1,"agent-config-inspect"],[1,"agent-config-inspect__header"],["type","button","title","Back to agent configs",1,"agent-config-inspect__back",3,"click"],[1,"agent-config-inspect__back-icon"],[1,"agent-config-inspect__title"],[1,"agent-config-inspect__sibling-link",3,"routerLink"],[1,"agent-config-inspect__loading"],[1,"agent-config-inspect__error"],[1,"agent-config-inspect__content"],[1,"agent-config-inspect__section"],[1,"agent-config-inspect__section-title"],[1,"agent-config-inspect__dl"],[1,"agent-config-inspect__dt"],[1,"agent-config-inspect__dd"],[1,"agent-config-inspect__dd","agent-config-inspect__dd--mono"],[1,"agent-config-inspect__badge"],[1,"agent-config-inspect__count"],[1,"agent-config-inspect__empty"],[1,"agent-config-inspect__tools"],["type","button",1,"agent-config-inspect__collapsible",3,"click"],[1,"agent-config-inspect__chevron"],[1,"agent-config-inspect__instructions"],[1,"agent-config-inspect__tool"],["type","button",1,"agent-config-inspect__tool-header",3,"click"],[1,"agent-config-inspect__tool-name"],[1,"agent-config-inspect__tool-body"],[1,"agent-config-inspect__tool-description",3,"innerHTML"],[1,"agent-config-inspect__schema"]],template:function(e,c){if(e&1&&(vs(0,"div",0)(1,"header",1)(2,"button",2),Ag("click",function(){return c.back()}),vs(3,"span",3),WC(4,"\u2190"),dl(),WC(5," Agent Configs "),dl(),vs(6,"h1",4),WC(7,"Agent definition"),dl(),vs(8,"a",5),WC(9,"Edit config \u2192"),dl()(),eC(10,B,2,0,"p",6)(11,$,2,0,"p",7)(12,Y,32,11,"div",8),dl()),e&2){let g;XE(8),Tg("routerLink",c.editRoute()),XE(2),tC(c.isLoading()?10:c.hasError()?11:(g=c.definition())?12:-1,g);}},dependencies:[si,d],styles:[".agent-config-inspect[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.agent-config-inspect__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.agent-config-inspect__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-inspect__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-primary, #007aff);text-decoration:none}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__loading[_ngcontent-%COMP%], .agent-config-inspect__error[_ngcontent-%COMP%], .agent-config-inspect__empty[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__error[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.agent-config-inspect__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.agent-config-inspect__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1.25rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:10px}.agent-config-inspect__section-title[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f)}.agent-config-inspect__count[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;margin-left:.25rem}.agent-config-inspect__dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.5rem 1.25rem;margin:0}.agent-config-inspect__dt[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);align-self:center}.agent-config-inspect__dd[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);align-self:center;word-break:break-word}.agent-config-inspect__dd--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.875rem}.agent-config-inspect__badge[_ngcontent-%COMP%]{display:inline-block;padding:.2em .6em;border-radius:4px;font-size:.75rem;font-weight:500;background:var(--color-surface-muted, rgba(0, 0, 0, .06));color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__badge--active[_ngcontent-%COMP%]{background:var(--color-success-bg, #e3f5e1);color:var(--color-success, #34c759)}.agent-config-inspect__collapsible[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;background:none;border:none;padding:0;cursor:pointer;font-family:inherit;text-align:left}.agent-config-inspect__chevron[_ngcontent-%COMP%]{font-size:.7rem;color:var(--color-text-secondary, #6e6e73);transition:transform .15s ease;flex-shrink:0}.agent-config-inspect__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.agent-config-inspect__instructions[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;border-radius:6px;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.875rem;font-family:inherit;color:var(--color-text, #1d1d1f);white-space:pre-wrap;word-break:break-word;line-height:1.6;max-height:400px;overflow-y:auto}.agent-config-inspect__tools[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__tool[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .08));border-radius:6px;overflow:hidden}.agent-config-inspect__tool-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.75rem;width:100%;padding:.75rem 1rem;background:none;border:none;cursor:pointer;font-family:inherit;text-align:left;transition:background .1s ease}.agent-config-inspect__tool-header[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.agent-config-inspect__tool-name[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-config-inspect__tool-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:0 1rem .75rem;border-top:1px solid var(--color-border, rgba(0, 0, 0, .08))}.agent-config-inspect__tool-description[_ngcontent-%COMP%]{margin:0;padding-top:.75rem;font-size:.8125rem;line-height:1.5;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 .25rem}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:last-child{margin-bottom:0}.agent-config-inspect__tool-description[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:monospace;font-size:.8em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .3em;border-radius:3px}.agent-config-inspect__schema[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.8125rem;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:pre;overflow-x:auto;line-height:1.5;max-height:360px;overflow-y:auto}"]})};export{R as AgentConfigInspectComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {g,G,ca as hB,cb as pB,H as Hi,A as Aw,v as vs,W as WC,k as dl,n as eC,y as Hg,X as XE,a8 as Zg,t as tC,ac as mC,a9 as dC,l as Ag,r as Tg,aa as If,ab as wf}from'./main-
|
|
1
|
+
import {g,G,ca as hB,cb as pB,H as Hi,A as Aw,v as vs,W as WC,k as dl,n as eC,y as Hg,X as XE,a8 as Zg,t as tC,ac as mC,a9 as dC,l as Ag,r as Tg,aa as If,ab as wf}from'./main-ZCJEGFW3.js';import {Z as Zn,D as De}from'./chunk-BLwyktBH.js';function k(t,r){if(t&1&&(vs(0,"span",3),WC(1),dl()),t&2){let e=mC();XE(),Zg(e.prompt().description);}}function S(t,r){if(t&1){let e=dC();vs(0,"span",6),WC(1,"Delete?"),dl(),vs(2,"ds-icon-button",7),Ag("action",function(){If(e);let m=mC();return wf(m.onDeleteConfirmed())}),dl(),vs(3,"ds-icon-button",8),Ag("action",function(){If(e);let m=mC();return wf(m.onDeleteCancelled())}),dl();}}function E(t,r){if(t&1){let e=dC();vs(0,"ds-kebab-menu",9),Ag("itemSelected",function(m){If(e);let O=mC();return wf(O.onMenuAction(m))}),dl();}if(t&2){let e=mC();Tg("items",e.menuItems);}}var I=class t{router=g(G);prompt=hB.required();namespaceId=hB(void 0);platformMode=hB(false);readOnly=hB(false);deleteRequested=pB();pendingDelete=Hi(false);menuItems=[{key:"edit",label:"Edit prompt",icon:"edit"},{key:"delete",label:"Delete prompt",icon:"delete",variant:"danger"}];onMenuAction(r){switch(r){case "edit":this.platformMode()?this.router.navigate(["/agentos","admin","prompts",this.prompt().id,"edit"]):this.router.navigate(["/agentos",this.namespaceId(),"prompts",this.prompt().id,"edit"]);break;case "delete":this.pendingDelete.set(true);break}}onDeleteConfirmed(){this.pendingDelete.set(false),this.deleteRequested.emit(this.prompt());}onDeleteCancelled(){this.pendingDelete.set(false);}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=Aw({type:t,selectors:[["agentos-prompt-item"]],inputs:{prompt:[1,"prompt"],namespaceId:[1,"namespaceId"],platformMode:[1,"platformMode"],readOnly:[1,"readOnly"]},outputs:{deleteRequested:"deleteRequested"},decls:8,vars:5,consts:[["role","listitem",1,"prompt-item"],[1,"prompt-item__body"],[1,"prompt-item__name"],[1,"prompt-item__description"],[1,"prompt-item__actions"],[3,"items"],[1,"prompt-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],[3,"itemSelected","items"]],template:function(e,o){e&1&&(vs(0,"div",0)(1,"div",1)(2,"span",2),WC(3),dl(),eC(4,k,2,1,"span",3),dl(),vs(5,"div",4),eC(6,S,4,0)(7,E,1,1,"ds-kebab-menu",5),dl()()),e&2&&(Hg("prompt-item--pending-delete",o.pendingDelete()),XE(3),Zg(o.prompt().name),XE(),tC(o.prompt().description?4:-1),XE(2),tC(o.pendingDelete()?6:o.readOnly()?-1:7));},dependencies:[Zn,De],styles:[".prompt-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:10px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));transition:background .15s ease,border-color .15s ease}.prompt-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.prompt-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.prompt-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.prompt-item__description[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.prompt-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.prompt-item[_ngcontent-%COMP%]:hover .prompt-item__actions[_ngcontent-%COMP%], .prompt-item[_ngcontent-%COMP%]:focus-within .prompt-item__actions[_ngcontent-%COMP%], .prompt-item--pending-delete[_ngcontent-%COMP%] .prompt-item__actions[_ngcontent-%COMP%]{opacity:1}.prompt-item__confirm-label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:500;color:var(--color-error, #ff3b30);margin-right:.25rem;white-space:nowrap}"]})};export{I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {g,di as te,Y as x}from'./main-
|
|
1
|
+
import {g,di as te,Y as x}from'./main-ZCJEGFW3.js';var c=class r{api=g(te);getById(e){return this.api.getByIdScheduledPrompt(e)}listPlatform(){return this.api.searchScheduledPrompt({namespaceId:null,userId:null})}listByNamespace(e){return this.api.searchScheduledPrompt({namespaceId:e,userId:null})}search(e){return this.api.searchScheduledPrompt(e)}listEffective(e){return this.api.resolveEffectiveScheduledPrompt(e)}create(e){return this.api.createScheduledPrompt(e)}update(e,t){return this.api.updateScheduledPrompt(e,t)}enable(e){return this.api.enableScheduledPrompt(e)}disable(e){return this.api.disableScheduledPrompt(e)}delete(e){return this.api.deleteScheduledPrompt(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=x({token:r,factory:r.\u0275fac,providedIn:"root"})};export{c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c}from'./chunk-DATqkmXk.js';import {g,ao as V,G,w as we$1,d8 as M,d9 as he$1,da as fe$1,H as Hi,db as ge$1,F,bQ as bd,m as mT,Q as By,b as U,a7 as ha,S as pa,z as z$1,a as P,A as Aw,v as vs,l as Ag,W as WC,k as dl,n as eC,X as XE,a5 as ml,t as tC,a9 as dC,o as bg,a3 as HI,q as oC,ac as mC,r as Tg,y as Hg,a6 as $I,x as iC,a8 as Zg,aa as If,ab as wf,bj as yh}from'./main-CERDHS7N.js';import {o as z,k as _t,b as _e$1,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,f as fn,a as wt,A as At,Z as Zn,l as Xn,$ as $t,C as Cn,E as En}from'./chunk-D615HDbJ.js';var A=(n,t)=>t.value,se=(n,t)=>t.id;function pe(n,t){n&1&&(vs(0,"p",5),WC(1,"Loading\u2026"),dl());}function ue(n,t){n&1&&(vs(0,"span",12),WC(1," Name is required. "),dl());}function fe(n,t){if(n&1&&(vs(0,"p",40),WC(1),dl(),vs(2,"span",13),WC(3,"Agent Config cannot be changed after creation."),dl()),n&2){let e=mC(2);XE(),Zg(e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function _e(n,t){if(n&1&&(vs(0,"a",41),WC(1,"Add an agent config"),dl(),WC(2," first. ")),n&2){let e=mC(3);Tg("href","/agentos/"+e.namespaceId+"/agent-configs/new",yh);}}function he(n,t){if(n&1&&(vs(0,"p",13),WC(1," No agent configs available in this scope yet. "),eC(2,_e,3,1),dl()),n&2){let e=mC(2);XE(2),tC(e.isPlatformMode?-1:2);}}function ge(n,t){if(n&1&&(vs(0,"option",23),WC(1),dl()),n&2){let e=t.$implicit;Tg("value",e.id),XE(),Zg(e.name);}}function Ce(n,t){n&1&&(vs(0,"span",12),WC(1,"Agent Config is required."),dl());}function ve(n,t){if(n&1&&(vs(0,"select",42)(1,"option",43),WC(2,"Select an agent config\u2026"),dl(),oC(3,ge,2,2,"option",23,se),dl(),HI(),eC(5,Ce,2,0,"span",12),vs(6,"span",13),WC(7,"Immutable after creation."),dl()),n&2){let e=mC(2);Tg("formControl",e.agentConfigIdControl),$I(),XE(3),iC(e.availableAgentConfigs()),XE(2),tC(e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?5:-1);}}function ye(n,t){n&1&&(vs(0,"span",12),WC(1,"Opening message is required."),dl());}function be(n,t){if(n&1&&(vs(0,"option",23),WC(1),dl()),n&2){let e=t.$implicit;Tg("value",e.value),XE(),Zg(e.label);}}function xe(n,t){if(n&1){let e=dC();vs(0,"label",46)(1,"input",47),Ag("change",function(){let h=If(e).$implicit,P=mC(3);return wf(P.toggleDay(h.value))}),dl(),vs(2,"span",48),WC(3),dl()();}if(n&2){let e=t.$implicit,l=mC(3);XE(),Tg("checked",l.isDaySelected(e.value)),XE(2),Zg(e.label);}}function Se(n,t){if(n&1&&(vs(0,"div",8)(1,"span",44),WC(2,"Days of week"),dl(),vs(3,"div",45),oC(4,xe,4,2,"label",46,A),dl(),vs(6,"span",13),WC(7,"Leave empty to run every day of the week."),dl()()),n&2){let e=mC(2);XE(4),iC(e.dayOptions);}}function Pe(n,t){n&1&&(vs(0,"span",12),WC(1,"Valid time is required (HH:mm)."),dl());}function Ee(n,t){n&1&&(vs(0,"span",12),WC(1,"Start date is required."),dl());}function Me(n,t){if(n&1&&(vs(0,"option",23),WC(1),dl()),n&2){let e=t.$implicit;Tg("value",e.value),XE(),Zg(e.label);}}function Oe(n,t){n&1&&(vs(0,"span",12),WC(1,"End date is required."),dl());}function De(n,t){if(n&1&&(vs(0,"div",8)(1,"label",49),WC(2," End date "),vs(3,"span",10),WC(4,"*"),dl()(),bg(5,"input",50),HI(),eC(6,Oe,2,0,"span",12),dl()),n&2){let e=mC(2);XE(5),Hg("scheduled-prompt-form__input--invalid",e.form.hasError("endDateRequired")&&e.endDateControl.touched),Tg("formControl",e.endDateControl),$I(),XE(),tC(e.form.hasError("endDateRequired")&&e.endDateControl.touched?6:-1);}}function Te(n,t){n&1&&(vs(0,"span",12),WC(1,"Must be at least 1."),dl());}function we(n,t){if(n&1&&(vs(0,"div",8)(1,"label",51),WC(2," Number of occurrences "),vs(3,"span",10),WC(4,"*"),dl()(),bg(5,"input",52),HI(),eC(6,Te,2,0,"span",12),dl()),n&2){let e=mC(2);XE(5),Hg("scheduled-prompt-form__input--invalid",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched),Tg("formControl",e.occurrenceCountControl),$I(),XE(),tC(e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?6:-1);}}function ke(n,t){if(n&1&&(vs(0,"p",36),WC(1),dl()),n&2){let e=mC(2);XE(),Zg(e.errorMessage());}}function Fe(n,t){if(n&1){let e=dC();vs(0,"form",7),Ag("ngSubmit",function(){If(e);let h=mC();return wf(h.submit())}),vs(1,"div",8)(2,"label",9),WC(3," Name "),vs(4,"span",10),WC(5,"*"),dl()(),bg(6,"input",11),HI(),eC(7,ue,2,0,"span",12),vs(8,"span",13),WC(9,'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.'),dl()(),vs(10,"div",8)(11,"label",14),WC(12,"Description"),dl(),bg(13,"input",15),HI(),dl(),vs(14,"div",8)(15,"label",16),WC(16," Agent Config "),vs(17,"span",10),WC(18,"*"),dl()(),eC(19,fe,4,1)(20,he,3,1,"p",13)(21,ve,8,2),dl(),vs(22,"div",8)(23,"label",17),WC(24," Opening message "),vs(25,"span",10),WC(26,"*"),dl()(),bg(27,"textarea",18),HI(),eC(28,ye,2,0,"span",12),vs(29,"span",13),WC(30," The message sent to the agent when the scheduled prompt fires. "),dl()(),vs(31,"fieldset",19)(32,"legend",20),WC(33,"Recurrence"),dl(),vs(34,"div",8)(35,"label",21),WC(36," Unit "),vs(37,"span",10),WC(38,"*"),dl()(),vs(39,"select",22),oC(40,be,2,2,"option",23,A),dl(),HI(),dl(),eC(42,Se,8,0,"div",8),vs(43,"div",8)(44,"label",24),WC(45," Time (UTC) "),vs(46,"span",10),WC(47,"*"),dl()(),vs(48,"div",25),bg(49,"input",26),HI(),vs(50,"span",27),WC(51,"UTC"),dl()(),eC(52,Pe,2,0,"span",12),dl()(),vs(53,"fieldset",19)(54,"legend",20),WC(55,"Planning"),dl(),vs(56,"div",8)(57,"label",28),WC(58," Start date "),vs(59,"span",10),WC(60,"*"),dl()(),bg(61,"input",29),HI(),eC(62,Ee,2,0,"span",12),dl(),vs(63,"div",8)(64,"label",30),WC(65," Ends "),vs(66,"span",10),WC(67,"*"),dl()(),vs(68,"select",31),oC(69,Me,2,2,"option",23,A),dl(),HI(),dl(),eC(71,De,7,4,"div",8),eC(72,we,7,4,"div",8),dl(),vs(73,"div",8)(74,"label",32),bg(75,"input",33),HI(),vs(76,"span",34),WC(77,"Enabled"),dl()(),vs(78,"p",35),WC(79," When disabled, the scheduled prompt is saved but will not run on schedule. "),dl()(),eC(80,ke,2,1,"p",36),vs(81,"div",37)(82,"button",38),WC(83),dl(),vs(84,"button",39),Ag("click",function(){If(e);let h=mC();return wf(h.cancel())}),WC(85,"Cancel"),dl()()();}if(n&2){let e=mC();Tg("formGroup",e.form),XE(6),Hg("scheduled-prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),Tg("formControl",e.nameControl),$I(),XE(),tC(e.nameControl.invalid&&e.nameControl.touched?7:-1),XE(6),Tg("formControl",e.descriptionControl),$I(),XE(6),tC(e.isEditMode()?19:e.availableAgentConfigs().length===0?20:21),XE(8),Hg("scheduled-prompt-form__textarea--invalid",e.promptContentControl.invalid&&e.promptContentControl.touched),Tg("formControl",e.promptContentControl),$I(),XE(),tC(e.promptContentControl.invalid&&e.promptContentControl.touched?28:-1),XE(11),Tg("formControl",e.unitControl),$I(),XE(),iC(e.schedulerUnits),XE(2),tC(e.showDayFilter()?42:-1),XE(7),Tg("formControl",e.timeUtcControl),$I(),XE(3),tC(e.timeUtcControl.invalid&&e.timeUtcControl.touched?52:-1),XE(9),Hg("scheduled-prompt-form__input--invalid",e.startDateControl.invalid&&e.startDateControl.touched),Tg("formControl",e.startDateControl),$I(),XE(),tC(e.startDateControl.invalid&&e.startDateControl.touched?62:-1),XE(6),Tg("formControl",e.endTypeControl),$I(),XE(),iC(e.endTypes),XE(2),tC(e.showEndDate()?71:-1),XE(),tC(e.showOccurrenceCount()?72:-1),XE(3),Tg("formControl",e.enabledControl),$I(),XE(5),tC(e.errorMessage()?80:-1),XE(2),Tg("disabled",e.form.invalid||e.isSubmitting()),XE(),ml(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var me=class n{route=g(V);router=g(G);destroyRef=g(we$1);state=g(c);agentConfigController=g(M);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new z({name:new _t("",{nonNullable:true,validators:[_e$1.required]}),description:new _t(null),agentConfigId:new _t("",{nonNullable:true,validators:[_e$1.required]}),promptContent:new _t("",{nonNullable:true,validators:[_e$1.required]}),unit:new _t(fe$1.WEEK,{nonNullable:true,validators:[_e$1.required]}),days:new _t([],{nonNullable:true}),timeUtc:new _t("09:00",{nonNullable:true,validators:[_e$1.required,_e$1.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new _t("",{nonNullable:true,validators:[_e$1.required]}),endType:new _t(he$1.NEVER,{nonNullable:true,validators:[_e$1.required]}),endDate:new _t(null),occurrenceCount:new _t(null),enabled:new _t(true,{nonNullable:true})},{validators:[Ne,Ie]});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get promptContentControl(){return this.form.controls.promptContent}get unitControl(){return this.form.controls.unit}get daysControl(){return this.form.controls.days}get timeUtcControl(){return this.form.controls.timeUtc}get startDateControl(){return this.form.controls.startDate}get endTypeControl(){return this.form.controls.endType}get endDateControl(){return this.form.controls.endDate}get occurrenceCountControl(){return this.form.controls.occurrenceCount}get enabledControl(){return this.form.controls.enabled}isEditMode=Hi(false);isSubmitting=Hi(false);isLoading=Hi(false);errorMessage=Hi(null);SchedulerUnit=fe$1;SchedulerEndType=he$1;schedulerUnits=[{value:fe$1.WEEK,label:"Week(s)"},{value:fe$1.MONTH,label:"Month(s)"}];endTypes=[{value:he$1.NEVER,label:"Never"},{value:he$1.ON_DATE,label:"On date"},{value:he$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(ge$1).map(([t,e])=>({value:t,label:e}));unitSignal=F(this.unitControl.valueChanges.pipe(bd(this.unitControl.value)));endTypeSignal=F(this.endTypeControl.valueChanges.pipe(bd(this.endTypeControl.value)));showDayFilter=mT(()=>this.unitSignal()===fe$1.WEEK);showEndDate=mT(()=>this.endTypeSignal()===he$1.ON_DATE);showOccurrenceCount=mT(()=>this.endTypeSignal()===he$1.OCCURRENCES);agentConfigs=Hi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Ve());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(true),this.loadPromptAndResources(t)):this.loadResources();}loadPromptAndResources(t){this.isLoading.set(true),By({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:l})=>{this.existingPrompt=e,this.agentConfigs.set(l),this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadResources(){this.agentConfigs$().pipe(U(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(ha(()=>pa([])))}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId),this.promptContentControl.setValue(t.promptContent),this.unitControl.setValue(t.recurrence.unit),this.daysControl.setValue(t.recurrence.days??[]),this.timeUtcControl.setValue(t.recurrence.timeUtc),this.startDateControl.setValue(t.planning.startDate),this.endTypeControl.setValue(t.planning.endType),this.endDateControl.setValue(t.planning.endDate??null),this.occurrenceCountControl.setValue(t.planning.maxOccurrenceCount??null),this.enabledControl.setValue(t.enabled);}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,l=e.includes(t)?e.filter(h=>h!==t):[...e,t];this.daysControl.setValue(l);}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=this.endTypeControl.value,l=z$1(P({},this.existingPrompt??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,agentConfigId:t?this.existingPrompt.agentConfigId:this.agentConfigIdControl.value,promptContent:this.promptContentControl.value.trim(),recurrence:{unit:this.unitControl.value,days:this.daysControl.value,timeUtc:this.timeUtcControl.value},planning:{startDate:this.startDateControl.value,endType:e,endDate:e===he$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===he$1.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value});(t?this.state.update(this.existingPrompt.id,l):this.state.create(l)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:P=>{this.isSubmitting.set(false),P.status===409?this.errorMessage.set(`A scheduled prompt named "${l.name}" already exists in this scope.`):P.status===400?this.errorMessage.set(P.error?.message??"Invalid scheduled prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","scheduled-prompts"]):this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Aw({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:10,vars:3,consts:[[1,"scheduled-prompt-form"],[1,"scheduled-prompt-form__header"],["type","button","title","Back to scheduled prompts",1,"scheduled-prompt-form__back",3,"click"],[1,"scheduled-prompt-form__back-icon"],[1,"scheduled-prompt-form__title"],[1,"scheduled-prompt-form__loading"],[1,"scheduled-prompt-form__form",3,"formGroup"],[1,"scheduled-prompt-form__form",3,"ngSubmit","formGroup"],[1,"scheduled-prompt-form__field"],["for","sp-name",1,"scheduled-prompt-form__label"],["aria-hidden","true"],["id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],[1,"scheduled-prompt-form__field-error"],[1,"scheduled-prompt-form__field-hint"],["for","sp-description",1,"scheduled-prompt-form__label"],["id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-agent-config",1,"scheduled-prompt-form__label"],["for","sp-prompt-content",1,"scheduled-prompt-form__label"],["id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",1,"scheduled-prompt-form__textarea",3,"formControl"],[1,"scheduled-prompt-form__fieldset"],[1,"scheduled-prompt-form__legend"],["for","sp-unit",1,"scheduled-prompt-form__label"],["id","sp-unit",1,"scheduled-prompt-form__select",3,"formControl"],[3,"value"],["for","sp-time",1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__time-wrapper"],["id","sp-time","type","time",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--time",3,"formControl"],[1,"scheduled-prompt-form__utc-badge"],["for","sp-start-date",1,"scheduled-prompt-form__label"],["id","sp-start-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-end-type",1,"scheduled-prompt-form__label"],["id","sp-end-type",1,"scheduled-prompt-form__select",3,"formControl"],[1,"scheduled-prompt-form__toggle-label"],["type","checkbox",1,"scheduled-prompt-form__toggle-checkbox",3,"formControl"],[1,"scheduled-prompt-form__toggle-text"],[1,"scheduled-prompt-form__toggle-hint"],[1,"scheduled-prompt-form__error"],[1,"scheduled-prompt-form__actions"],["type","submit",1,"scheduled-prompt-form__btn","scheduled-prompt-form__btn--primary",3,"disabled"],["type","button",1,"scheduled-prompt-form__btn",3,"click"],[1,"scheduled-prompt-form__readonly-value"],[3,"href"],["id","sp-agent-config",1,"scheduled-prompt-form__select",3,"formControl"],["value","","disabled",""],[1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__day-grid"],[1,"scheduled-prompt-form__day-label"],["type","checkbox",1,"scheduled-prompt-form__day-checkbox",3,"change","checked"],[1,"scheduled-prompt-form__day-text"],["for","sp-end-date",1,"scheduled-prompt-form__label"],["id","sp-end-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-occurrence-count",1,"scheduled-prompt-form__label"],["id","sp-occurrence-count","type","number","min","1",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--number",3,"formControl"]],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"),dl(),WC(5),dl(),vs(6,"h1",4),WC(7),dl()(),eC(8,pe,2,0,"p",5)(9,Fe,86,26,"form",6),dl()),e&2&&(XE(5),ml(" ",l.isPlatformMode?"Platform Scheduled Prompts":"Scheduled Prompts"," "),XE(2),ml(" ",l.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"," "),XE(),tC(l.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,fn,wt,At,Zn,Xn,$t,Cn,En],styles:[".scheduled-prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.scheduled-prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.scheduled-prompt-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.scheduled-prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.scheduled-prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.scheduled-prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.scheduled-prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.scheduled-prompt-form__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.scheduled-prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__input[_ngcontent-%COMP%], .scheduled-prompt-form__select[_ngcontent-%COMP%], .scheduled-prompt-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.scheduled-prompt-form__input[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__select[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.scheduled-prompt-form__input[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__select[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__select[_ngcontent-%COMP%]{cursor:pointer;appearance:auto}.scheduled-prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.scheduled-prompt-form__input--time[_ngcontent-%COMP%]{flex:1;min-width:0}.scheduled-prompt-form__input--number[_ngcontent-%COMP%]{max-width:120px}.scheduled-prompt-form__time-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.scheduled-prompt-form__utc-badge[_ngcontent-%COMP%]{flex-shrink:0;font-size:.75rem;font-weight:600;font-family:monospace;color:var(--color-text-secondary, #6e6e73);background:var(--color-surface, rgba(0, 0, 0, .05));padding:.25rem .5rem;border-radius:4px;text-transform:uppercase;letter-spacing:.06em}.scheduled-prompt-form__fieldset[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:8px;padding:1rem 1.25rem 1.25rem;margin:0;display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__legend[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--color-text-secondary, #6e6e73);padding:0 .375rem}.scheduled-prompt-form__day-grid[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}.scheduled-prompt-form__day-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__day-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__day-text[_ngcontent-%COMP%]{font-size:.875rem;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__hint[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30);margin:0}.scheduled-prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30)}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__readonly-value[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--color-surface, rgba(0, 0, 0, .03))}.scheduled-prompt-form__input--invalid[_ngcontent-%COMP%], .scheduled-prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.scheduled-prompt-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.scheduled-prompt-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"]})};function Ne(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===he$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ie(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===he$1.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function Ve(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),l=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${l}`}export{me as ScheduledPromptFormComponent};
|
|
1
|
+
import {c}from'./chunk-B0kyFx_y.js';import {g,ao as V,G,w as we$1,d8 as M,d9 as he$1,da as fe$1,H as Hi,db as ge$1,F,bQ as bd,m as mT,Q as By,b as U,a7 as ha,S as pa,z as z$1,a as P,A as Aw,v as vs,l as Ag,W as WC,k as dl,n as eC,X as XE,a5 as ml,t as tC,a9 as dC,o as bg,a3 as HI,q as oC,ac as mC,r as Tg,y as Hg,a6 as $I,x as iC,a8 as Zg,aa as If,ab as wf,bj as yh}from'./main-ZCJEGFW3.js';import {o as z,k as _t,b as _e$1,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,f as fn,a as wt,A as At,Z as Zn,l as Xn,$ as $t,C as Cn,E as En}from'./chunk-Pl7edkoq.js';var A=(n,t)=>t.value,se=(n,t)=>t.id;function pe(n,t){n&1&&(vs(0,"p",5),WC(1,"Loading\u2026"),dl());}function ue(n,t){n&1&&(vs(0,"span",12),WC(1," Name is required. "),dl());}function fe(n,t){if(n&1&&(vs(0,"p",40),WC(1),dl(),vs(2,"span",13),WC(3,"Agent Config cannot be changed after creation."),dl()),n&2){let e=mC(2);XE(),Zg(e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function _e(n,t){if(n&1&&(vs(0,"a",41),WC(1,"Add an agent config"),dl(),WC(2," first. ")),n&2){let e=mC(3);Tg("href","/agentos/"+e.namespaceId+"/agent-configs/new",yh);}}function he(n,t){if(n&1&&(vs(0,"p",13),WC(1," No agent configs available in this scope yet. "),eC(2,_e,3,1),dl()),n&2){let e=mC(2);XE(2),tC(e.isPlatformMode?-1:2);}}function ge(n,t){if(n&1&&(vs(0,"option",23),WC(1),dl()),n&2){let e=t.$implicit;Tg("value",e.id),XE(),Zg(e.name);}}function Ce(n,t){n&1&&(vs(0,"span",12),WC(1,"Agent Config is required."),dl());}function ve(n,t){if(n&1&&(vs(0,"select",42)(1,"option",43),WC(2,"Select an agent config\u2026"),dl(),oC(3,ge,2,2,"option",23,se),dl(),HI(),eC(5,Ce,2,0,"span",12),vs(6,"span",13),WC(7,"Immutable after creation."),dl()),n&2){let e=mC(2);Tg("formControl",e.agentConfigIdControl),$I(),XE(3),iC(e.availableAgentConfigs()),XE(2),tC(e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?5:-1);}}function ye(n,t){n&1&&(vs(0,"span",12),WC(1,"Opening message is required."),dl());}function be(n,t){if(n&1&&(vs(0,"option",23),WC(1),dl()),n&2){let e=t.$implicit;Tg("value",e.value),XE(),Zg(e.label);}}function xe(n,t){if(n&1){let e=dC();vs(0,"label",46)(1,"input",47),Ag("change",function(){let h=If(e).$implicit,P=mC(3);return wf(P.toggleDay(h.value))}),dl(),vs(2,"span",48),WC(3),dl()();}if(n&2){let e=t.$implicit,l=mC(3);XE(),Tg("checked",l.isDaySelected(e.value)),XE(2),Zg(e.label);}}function Se(n,t){if(n&1&&(vs(0,"div",8)(1,"span",44),WC(2,"Days of week"),dl(),vs(3,"div",45),oC(4,xe,4,2,"label",46,A),dl(),vs(6,"span",13),WC(7,"Leave empty to run every day of the week."),dl()()),n&2){let e=mC(2);XE(4),iC(e.dayOptions);}}function Pe(n,t){n&1&&(vs(0,"span",12),WC(1,"Valid time is required (HH:mm)."),dl());}function Ee(n,t){n&1&&(vs(0,"span",12),WC(1,"Start date is required."),dl());}function Me(n,t){if(n&1&&(vs(0,"option",23),WC(1),dl()),n&2){let e=t.$implicit;Tg("value",e.value),XE(),Zg(e.label);}}function Oe(n,t){n&1&&(vs(0,"span",12),WC(1,"End date is required."),dl());}function De(n,t){if(n&1&&(vs(0,"div",8)(1,"label",49),WC(2," End date "),vs(3,"span",10),WC(4,"*"),dl()(),bg(5,"input",50),HI(),eC(6,Oe,2,0,"span",12),dl()),n&2){let e=mC(2);XE(5),Hg("scheduled-prompt-form__input--invalid",e.form.hasError("endDateRequired")&&e.endDateControl.touched),Tg("formControl",e.endDateControl),$I(),XE(),tC(e.form.hasError("endDateRequired")&&e.endDateControl.touched?6:-1);}}function Te(n,t){n&1&&(vs(0,"span",12),WC(1,"Must be at least 1."),dl());}function we(n,t){if(n&1&&(vs(0,"div",8)(1,"label",51),WC(2," Number of occurrences "),vs(3,"span",10),WC(4,"*"),dl()(),bg(5,"input",52),HI(),eC(6,Te,2,0,"span",12),dl()),n&2){let e=mC(2);XE(5),Hg("scheduled-prompt-form__input--invalid",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched),Tg("formControl",e.occurrenceCountControl),$I(),XE(),tC(e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?6:-1);}}function ke(n,t){if(n&1&&(vs(0,"p",36),WC(1),dl()),n&2){let e=mC(2);XE(),Zg(e.errorMessage());}}function Fe(n,t){if(n&1){let e=dC();vs(0,"form",7),Ag("ngSubmit",function(){If(e);let h=mC();return wf(h.submit())}),vs(1,"div",8)(2,"label",9),WC(3," Name "),vs(4,"span",10),WC(5,"*"),dl()(),bg(6,"input",11),HI(),eC(7,ue,2,0,"span",12),vs(8,"span",13),WC(9,'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.'),dl()(),vs(10,"div",8)(11,"label",14),WC(12,"Description"),dl(),bg(13,"input",15),HI(),dl(),vs(14,"div",8)(15,"label",16),WC(16," Agent Config "),vs(17,"span",10),WC(18,"*"),dl()(),eC(19,fe,4,1)(20,he,3,1,"p",13)(21,ve,8,2),dl(),vs(22,"div",8)(23,"label",17),WC(24," Opening message "),vs(25,"span",10),WC(26,"*"),dl()(),bg(27,"textarea",18),HI(),eC(28,ye,2,0,"span",12),vs(29,"span",13),WC(30," The message sent to the agent when the scheduled prompt fires. "),dl()(),vs(31,"fieldset",19)(32,"legend",20),WC(33,"Recurrence"),dl(),vs(34,"div",8)(35,"label",21),WC(36," Unit "),vs(37,"span",10),WC(38,"*"),dl()(),vs(39,"select",22),oC(40,be,2,2,"option",23,A),dl(),HI(),dl(),eC(42,Se,8,0,"div",8),vs(43,"div",8)(44,"label",24),WC(45," Time (UTC) "),vs(46,"span",10),WC(47,"*"),dl()(),vs(48,"div",25),bg(49,"input",26),HI(),vs(50,"span",27),WC(51,"UTC"),dl()(),eC(52,Pe,2,0,"span",12),dl()(),vs(53,"fieldset",19)(54,"legend",20),WC(55,"Planning"),dl(),vs(56,"div",8)(57,"label",28),WC(58," Start date "),vs(59,"span",10),WC(60,"*"),dl()(),bg(61,"input",29),HI(),eC(62,Ee,2,0,"span",12),dl(),vs(63,"div",8)(64,"label",30),WC(65," Ends "),vs(66,"span",10),WC(67,"*"),dl()(),vs(68,"select",31),oC(69,Me,2,2,"option",23,A),dl(),HI(),dl(),eC(71,De,7,4,"div",8),eC(72,we,7,4,"div",8),dl(),vs(73,"div",8)(74,"label",32),bg(75,"input",33),HI(),vs(76,"span",34),WC(77,"Enabled"),dl()(),vs(78,"p",35),WC(79," When disabled, the scheduled prompt is saved but will not run on schedule. "),dl()(),eC(80,ke,2,1,"p",36),vs(81,"div",37)(82,"button",38),WC(83),dl(),vs(84,"button",39),Ag("click",function(){If(e);let h=mC();return wf(h.cancel())}),WC(85,"Cancel"),dl()()();}if(n&2){let e=mC();Tg("formGroup",e.form),XE(6),Hg("scheduled-prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),Tg("formControl",e.nameControl),$I(),XE(),tC(e.nameControl.invalid&&e.nameControl.touched?7:-1),XE(6),Tg("formControl",e.descriptionControl),$I(),XE(6),tC(e.isEditMode()?19:e.availableAgentConfigs().length===0?20:21),XE(8),Hg("scheduled-prompt-form__textarea--invalid",e.promptContentControl.invalid&&e.promptContentControl.touched),Tg("formControl",e.promptContentControl),$I(),XE(),tC(e.promptContentControl.invalid&&e.promptContentControl.touched?28:-1),XE(11),Tg("formControl",e.unitControl),$I(),XE(),iC(e.schedulerUnits),XE(2),tC(e.showDayFilter()?42:-1),XE(7),Tg("formControl",e.timeUtcControl),$I(),XE(3),tC(e.timeUtcControl.invalid&&e.timeUtcControl.touched?52:-1),XE(9),Hg("scheduled-prompt-form__input--invalid",e.startDateControl.invalid&&e.startDateControl.touched),Tg("formControl",e.startDateControl),$I(),XE(),tC(e.startDateControl.invalid&&e.startDateControl.touched?62:-1),XE(6),Tg("formControl",e.endTypeControl),$I(),XE(),iC(e.endTypes),XE(2),tC(e.showEndDate()?71:-1),XE(),tC(e.showOccurrenceCount()?72:-1),XE(3),Tg("formControl",e.enabledControl),$I(),XE(5),tC(e.errorMessage()?80:-1),XE(2),Tg("disabled",e.form.invalid||e.isSubmitting()),XE(),ml(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var me=class n{route=g(V);router=g(G);destroyRef=g(we$1);state=g(c);agentConfigController=g(M);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new z({name:new _t("",{nonNullable:true,validators:[_e$1.required]}),description:new _t(null),agentConfigId:new _t("",{nonNullable:true,validators:[_e$1.required]}),promptContent:new _t("",{nonNullable:true,validators:[_e$1.required]}),unit:new _t(fe$1.WEEK,{nonNullable:true,validators:[_e$1.required]}),days:new _t([],{nonNullable:true}),timeUtc:new _t("09:00",{nonNullable:true,validators:[_e$1.required,_e$1.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new _t("",{nonNullable:true,validators:[_e$1.required]}),endType:new _t(he$1.NEVER,{nonNullable:true,validators:[_e$1.required]}),endDate:new _t(null),occurrenceCount:new _t(null),enabled:new _t(true,{nonNullable:true})},{validators:[Ne,Ie]});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get promptContentControl(){return this.form.controls.promptContent}get unitControl(){return this.form.controls.unit}get daysControl(){return this.form.controls.days}get timeUtcControl(){return this.form.controls.timeUtc}get startDateControl(){return this.form.controls.startDate}get endTypeControl(){return this.form.controls.endType}get endDateControl(){return this.form.controls.endDate}get occurrenceCountControl(){return this.form.controls.occurrenceCount}get enabledControl(){return this.form.controls.enabled}isEditMode=Hi(false);isSubmitting=Hi(false);isLoading=Hi(false);errorMessage=Hi(null);SchedulerUnit=fe$1;SchedulerEndType=he$1;schedulerUnits=[{value:fe$1.WEEK,label:"Week(s)"},{value:fe$1.MONTH,label:"Month(s)"}];endTypes=[{value:he$1.NEVER,label:"Never"},{value:he$1.ON_DATE,label:"On date"},{value:he$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(ge$1).map(([t,e])=>({value:t,label:e}));unitSignal=F(this.unitControl.valueChanges.pipe(bd(this.unitControl.value)));endTypeSignal=F(this.endTypeControl.valueChanges.pipe(bd(this.endTypeControl.value)));showDayFilter=mT(()=>this.unitSignal()===fe$1.WEEK);showEndDate=mT(()=>this.endTypeSignal()===he$1.ON_DATE);showOccurrenceCount=mT(()=>this.endTypeSignal()===he$1.OCCURRENCES);agentConfigs=Hi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Ve());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(true),this.loadPromptAndResources(t)):this.loadResources();}loadPromptAndResources(t){this.isLoading.set(true),By({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:l})=>{this.existingPrompt=e,this.agentConfigs.set(l),this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadResources(){this.agentConfigs$().pipe(U(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(ha(()=>pa([])))}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId),this.promptContentControl.setValue(t.promptContent),this.unitControl.setValue(t.recurrence.unit),this.daysControl.setValue(t.recurrence.days??[]),this.timeUtcControl.setValue(t.recurrence.timeUtc),this.startDateControl.setValue(t.planning.startDate),this.endTypeControl.setValue(t.planning.endType),this.endDateControl.setValue(t.planning.endDate??null),this.occurrenceCountControl.setValue(t.planning.maxOccurrenceCount??null),this.enabledControl.setValue(t.enabled);}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,l=e.includes(t)?e.filter(h=>h!==t):[...e,t];this.daysControl.setValue(l);}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=this.endTypeControl.value,l=z$1(P({},this.existingPrompt??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,agentConfigId:t?this.existingPrompt.agentConfigId:this.agentConfigIdControl.value,promptContent:this.promptContentControl.value.trim(),recurrence:{unit:this.unitControl.value,days:this.daysControl.value,timeUtc:this.timeUtcControl.value},planning:{startDate:this.startDateControl.value,endType:e,endDate:e===he$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===he$1.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value});(t?this.state.update(this.existingPrompt.id,l):this.state.create(l)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:P=>{this.isSubmitting.set(false),P.status===409?this.errorMessage.set(`A scheduled prompt named "${l.name}" already exists in this scope.`):P.status===400?this.errorMessage.set(P.error?.message??"Invalid scheduled prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","scheduled-prompts"]):this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Aw({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:10,vars:3,consts:[[1,"scheduled-prompt-form"],[1,"scheduled-prompt-form__header"],["type","button","title","Back to scheduled prompts",1,"scheduled-prompt-form__back",3,"click"],[1,"scheduled-prompt-form__back-icon"],[1,"scheduled-prompt-form__title"],[1,"scheduled-prompt-form__loading"],[1,"scheduled-prompt-form__form",3,"formGroup"],[1,"scheduled-prompt-form__form",3,"ngSubmit","formGroup"],[1,"scheduled-prompt-form__field"],["for","sp-name",1,"scheduled-prompt-form__label"],["aria-hidden","true"],["id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],[1,"scheduled-prompt-form__field-error"],[1,"scheduled-prompt-form__field-hint"],["for","sp-description",1,"scheduled-prompt-form__label"],["id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-agent-config",1,"scheduled-prompt-form__label"],["for","sp-prompt-content",1,"scheduled-prompt-form__label"],["id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",1,"scheduled-prompt-form__textarea",3,"formControl"],[1,"scheduled-prompt-form__fieldset"],[1,"scheduled-prompt-form__legend"],["for","sp-unit",1,"scheduled-prompt-form__label"],["id","sp-unit",1,"scheduled-prompt-form__select",3,"formControl"],[3,"value"],["for","sp-time",1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__time-wrapper"],["id","sp-time","type","time",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--time",3,"formControl"],[1,"scheduled-prompt-form__utc-badge"],["for","sp-start-date",1,"scheduled-prompt-form__label"],["id","sp-start-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-end-type",1,"scheduled-prompt-form__label"],["id","sp-end-type",1,"scheduled-prompt-form__select",3,"formControl"],[1,"scheduled-prompt-form__toggle-label"],["type","checkbox",1,"scheduled-prompt-form__toggle-checkbox",3,"formControl"],[1,"scheduled-prompt-form__toggle-text"],[1,"scheduled-prompt-form__toggle-hint"],[1,"scheduled-prompt-form__error"],[1,"scheduled-prompt-form__actions"],["type","submit",1,"scheduled-prompt-form__btn","scheduled-prompt-form__btn--primary",3,"disabled"],["type","button",1,"scheduled-prompt-form__btn",3,"click"],[1,"scheduled-prompt-form__readonly-value"],[3,"href"],["id","sp-agent-config",1,"scheduled-prompt-form__select",3,"formControl"],["value","","disabled",""],[1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__day-grid"],[1,"scheduled-prompt-form__day-label"],["type","checkbox",1,"scheduled-prompt-form__day-checkbox",3,"change","checked"],[1,"scheduled-prompt-form__day-text"],["for","sp-end-date",1,"scheduled-prompt-form__label"],["id","sp-end-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-occurrence-count",1,"scheduled-prompt-form__label"],["id","sp-occurrence-count","type","number","min","1",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--number",3,"formControl"]],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"),dl(),WC(5),dl(),vs(6,"h1",4),WC(7),dl()(),eC(8,pe,2,0,"p",5)(9,Fe,86,26,"form",6),dl()),e&2&&(XE(5),ml(" ",l.isPlatformMode?"Platform Scheduled Prompts":"Scheduled Prompts"," "),XE(2),ml(" ",l.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"," "),XE(),tC(l.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,fn,wt,At,Zn,Xn,$t,Cn,En],styles:[".scheduled-prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.scheduled-prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.scheduled-prompt-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.scheduled-prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.scheduled-prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.scheduled-prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.scheduled-prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.scheduled-prompt-form__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.scheduled-prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__input[_ngcontent-%COMP%], .scheduled-prompt-form__select[_ngcontent-%COMP%], .scheduled-prompt-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.scheduled-prompt-form__input[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__select[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.scheduled-prompt-form__input[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__select[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__select[_ngcontent-%COMP%]{cursor:pointer;appearance:auto}.scheduled-prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.scheduled-prompt-form__input--time[_ngcontent-%COMP%]{flex:1;min-width:0}.scheduled-prompt-form__input--number[_ngcontent-%COMP%]{max-width:120px}.scheduled-prompt-form__time-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.scheduled-prompt-form__utc-badge[_ngcontent-%COMP%]{flex-shrink:0;font-size:.75rem;font-weight:600;font-family:monospace;color:var(--color-text-secondary, #6e6e73);background:var(--color-surface, rgba(0, 0, 0, .05));padding:.25rem .5rem;border-radius:4px;text-transform:uppercase;letter-spacing:.06em}.scheduled-prompt-form__fieldset[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:8px;padding:1rem 1.25rem 1.25rem;margin:0;display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__legend[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--color-text-secondary, #6e6e73);padding:0 .375rem}.scheduled-prompt-form__day-grid[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}.scheduled-prompt-form__day-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__day-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__day-text[_ngcontent-%COMP%]{font-size:.875rem;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__hint[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30);margin:0}.scheduled-prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30)}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__readonly-value[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--color-surface, rgba(0, 0, 0, .03))}.scheduled-prompt-form__input--invalid[_ngcontent-%COMP%], .scheduled-prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.scheduled-prompt-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.scheduled-prompt-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"]})};function Ne(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===he$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ie(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===he$1.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function Ve(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),l=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${l}`}export{me as ScheduledPromptFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {y}from'./chunk-Tnt17Uum.js';import {v}from'./chunk-BXeg32ej.js';import {g,ao as V,G,w as we,d5 as N$1,d6 as U,F,S as pa,H as Hi,m as mT,cc as Hf,b as U$1,A as Aw,v as vs,l as Ag,W as WC,k as dl,n as eC,X as XE,a8 as Zg,t as tC,a9 as dC,q as oC,cG as Xw,a3 as HI,o as bg,a4 as rC,ac as mC,r as Tg,x as iC,a6 as $I,a5 as ml,aa as If,ab as wf}from'./main-CERDHS7N.js';import'./chunk-CoVKXwLW.js';import {t as tt}from'./chunk-Dh70Sw4n.js';import'./chunk-Dv3y4cq8.js';import {o as z,k as _t,b as _e,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,A as At,m as mn,Z as Zn,l as Xn,C as Cn,E as En}from'./chunk-D615HDbJ.js';import'./chunk-BWVGuXWV.js';import'./chunk-rdNDu_G5.js';function ae(r,t){r&1&&(vs(0,"p",5),WC(1,"Loading\u2026"),dl());}function le(r,t){if(r&1&&(vs(0,"label",10),bg(1,"input",29),HI(),vs(2,"span"),WC(3),dl()()),r&2){let e=t.$implicit,n=mC(2);XE(),Tg("value",e.value)("formControl",n.scopeControl)("disabled",e.value==="namespace"&&!n.isAdmin()),$I(),XE(2),Zg(e.label);}}function se(r,t){if(r&1&&(vs(0,"option",16),WC(1),dl()),r&2){let e=t.$implicit;Tg("value",e.type),XE(),Zg(e.displayName);}}function ce(r,t){if(r&1&&(vs(0,"option",16),WC(1),dl()),r&2){let e=t.$implicit;Tg("value",e),XE(),Zg(e);}}function me(r,t){if(r&1){let e=dC();vs(0,"div",24)(1,"ds-json-schema-form",30),Ag("valueChange",function(s){If(e);let m=mC(2);return wf(m.onParamsChange(s))}),dl()();}if(r&2){let e=mC(2);XE(),Tg("schema",t)("value",e.initialParams());}}function de(r,t){if(r&1){let e=dC();vs(0,"button",31),Ag("click",function(){If(e);let s=mC(2);return wf(s.exportYaml())}),WC(1),dl();}if(r&2){let e=mC(2);Tg("disabled",e.isExporting()),XE(),ml(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function pe(r,t){if(r&1){let e=dC();vs(0,"form",7),Ag("ngSubmit",function(){If(e);let s=mC();return wf(s.submit())}),vs(1,"fieldset",8)(2,"legend",9),WC(3,"Scope"),dl(),oC(4,le,4,4,"label",10,Xw().trackByScope,true),dl(),vs(6,"div",11)(7,"label",12),WC(8,"Type "),vs(9,"span",13),WC(10,"*"),dl()(),vs(11,"select",14)(12,"option",15),WC(13,"Select type"),dl(),oC(14,se,2,2,"option",16,Xw().trackByType,true),dl(),HI(),dl(),vs(16,"div",11)(17,"label",17),WC(18,"Name "),vs(19,"span",13),WC(20,"*"),dl()(),bg(21,"input",18),HI(),dl(),vs(22,"div",11)(23,"label",19),WC(24,"Description"),dl(),bg(25,"textarea",20),HI(),dl(),vs(26,"div",11)(27,"label",21),WC(28,"Auth Setting"),dl(),vs(29,"select",22)(30,"option",23),WC(31,"None"),dl(),oC(32,ce,2,2,"option",16,rC),dl(),HI(),dl(),eC(34,me,2,2,"div",24),vs(35,"div",25)(36,"button",26),WC(37),dl(),eC(38,de,2,2,"button",27),vs(39,"button",28),Ag("click",function(){If(e);let s=mC();return wf(s.cancel())}),WC(40,"Cancel"),dl()()();}if(r&2){let e,n=mC();Tg("formGroup",n.form),XE(),Tg("disabled",n.isEditMode()),XE(3),iC(n.scopeOptions),XE(7),Tg("formControl",n.typeControl),$I(),XE(3),iC(n.integrationTypes()),XE(7),Tg("formControl",n.nameControl),$I(),XE(4),Tg("formControl",n.descriptionControl),$I(),XE(4),Tg("formControl",n.authSettingNameControl),$I(),XE(),Tg("ngValue",null),XE(2),iC(n.availableAuthSettings()),XE(2),tC((e=n.schema())?34:-1,e),XE(2),Tg("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),XE(),ml(" ",n.isEditMode()?"Save changes":"Create"," "),XE(),tC(n.isEditMode()?38:-1);}}var ge=new Set(["platform","namespace","userOnNs","userGlobal"]),N=Object.freeze({platform:"Configuration plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),ie=class r{route=g(V);router=g(G);destroyRef=g(we);state=g(y);integrationTypeController=g(N$1);authSettingController=g(U);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=F(this.isPlatformMode?pa(true):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new z({name:new _t("",{nonNullable:true,validators:[_e.required,_e.minLength(1)]}),description:new _t(null),type:new _t("",{nonNullable:true,validators:[_e.required]}),scope:new _t("namespace",{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}isEditMode=Hi(false);isSubmitting=Hi(false);isLoading=Hi(false);isExporting=Hi(false);scopeOptions=[{value:"platform",label:N.platform},{value:"namespace",label:N.namespace},{value:"userOnNs",label:N.userOnNs},{value:"userGlobal",label:N.userGlobal}];authSettingNameControl=new _t(null);availableAuthSettings=Hi([]);paramsValue=Hi(null);initialParams=Hi(null);integrationTypes=F(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=F(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});schema=mT(()=>{let t=this.selectedType();return t?this.integrationTypes().find(n=>n.type===t)?.configSchema??null:null});existingConfig=null;constructor(){Hf(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("integrationId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable(),this.loadAuthSettingsForScope("platform");return}let s=this.parseScope(e.get("scope"));this.scopeControl.setValue(s),this.loadAuthSettingsForScope(s),this.scopeControl.valueChanges.pipe(U$1(this.destroyRef)).subscribe(re=>{this.loadAuthSettingsForScope(re);});let m=e.get("template");m&&this.hydrateFromTemplate(m);}parseScope(t){return t&&ge.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e;let n=this.deriveScopeFromConfig(e);this.scopeControl.setValue(n),this.applyConfigToForm(e),this.loadAuthSettingsForScope(n),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[IntegrationForm] Could not load config '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.applyConfigToForm(e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[IntegrationForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.typeControl.setValue(t.integrationType),this.initialParams.set(t.parameters),this.paramsValue.set(t.parameters),this.authSettingNameControl.setValue(t.authSettingName??null);}loadAuthSettingsForScope(t){let e;switch(t){case "platform":e=this.authSettingController.listAuthSetting();break;case "namespace":e=this.authSettingController.listAuthSetting(this.namespaceId);break;case "userOnNs":e=this.authSettingController.listAuthSetting(this.namespaceId,"me");break;case "userGlobal":e=this.authSettingController.listAuthSetting("none","me");break}e.pipe(U$1(this.destroyRef)).subscribe({next:n=>{let s=n.map(m=>m.name).filter(Boolean);this.availableAuthSettings.set([...new Set(s)]);},error:()=>this.availableAuthSettings.set([])});}onParamsChange(t){this.paramsValue.set(t);}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.descriptionControl.value?.trim(),e={name:this.nameControl.value.trim(),description:t||null,integrationType:this.typeControl.value,parameters:this.paramsValue(),authSettingName:this.authSettingNameControl.value||null},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,e,n,this.existingConfig):this.state.create(e,n,this.namespaceId??null)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.state.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let n=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(n),m=document.createElement("a");m.href=s,m.download=`${this.existingConfig?.name??"integration"}.yaml`,m.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"]);}trackByType(t,e){return e.type}trackByScope(t,e){return e.value}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=Aw({type:r,selectors:[["agentos-integration-form"]],decls:10,vars:2,consts:[[1,"integration-form"],[1,"integration-form__header"],["type","button","title","Back to integrations",1,"integration-form__back",3,"click"],[1,"integration-form__back-icon"],[1,"integration-form__title"],[1,"integration-form__loading"],[1,"integration-form__form",3,"formGroup"],[1,"integration-form__form",3,"ngSubmit","formGroup"],[1,"integration-form__field","integration-form__scope",3,"disabled"],[1,"integration-form__label"],[1,"integration-form__scope-option"],[1,"integration-form__field"],["for","integration-type",1,"integration-form__label"],["aria-hidden","true"],["id","integration-type",1,"integration-form__select",3,"formControl"],["value","","disabled",""],[3,"value"],["for","integration-name",1,"integration-form__label"],["id","integration-name","type","text","placeholder","Integration name","autocomplete","off",1,"integration-form__input",3,"formControl"],["for","integration-description",1,"integration-form__label"],["id","integration-description","placeholder","Optional description","rows","3",1,"integration-form__textarea",3,"formControl"],["for","integration-auth-setting",1,"integration-form__label"],["id","integration-auth-setting",1,"integration-form__select",3,"formControl"],[3,"ngValue"],[1,"integration-form__schema-form"],[1,"integration-form__actions"],["type","submit",1,"integration-form__btn","integration-form__btn--primary",3,"disabled"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"disabled"],["type","button",1,"integration-form__btn",3,"click"],["type","radio",3,"value","formControl","disabled"],[3,"valueChange","schema","value"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"click","disabled"]],template:function(e,n){e&1&&(vs(0,"div",0)(1,"header",1)(2,"button",2),Ag("click",function(){return n.cancel()}),vs(3,"span",3),WC(4,"\u2190"),dl(),WC(5," Integrations "),dl(),vs(6,"h1",4),WC(7),dl()(),eC(8,ae,2,0,"p",5)(9,pe,41,11,"form",6),dl()),e&2&&(XE(7),Zg(n.isEditMode()?"Edit integration":"New integration"),XE(),tC(n.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,At,mn,Zn,Xn,Cn,En,tt],styles:[".integration-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.integration-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.integration-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.integration-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.integration-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.integration-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.integration-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.integration-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.integration-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-divider);border-radius:0;padding:.75rem 1rem;background:transparent;margin:0}.integration-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.integration-form__scope-option[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--color-text);cursor:pointer}.integration-form__scope-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin:0}.integration-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.integration-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.integration-form__input[_ngcontent-%COMP%], .integration-form__textarea[_ngcontent-%COMP%], .integration-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.integration-form__input[_ngcontent-%COMP%]:focus, .integration-form__textarea[_ngcontent-%COMP%]:focus, .integration-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.integration-form__input[_ngcontent-%COMP%]::placeholder, .integration-form__textarea[_ngcontent-%COMP%]::placeholder, .integration-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.integration-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:4.5rem;line-height:1.5}.integration-form__select[_ngcontent-%COMP%]{cursor:pointer}.integration-form__select[_ngcontent-%COMP%] option[disabled][_ngcontent-%COMP%]{color:var(--color-text-secondary)}.integration-form__schema-form[_ngcontent-%COMP%]{padding:1rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface)}.integration-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.integration-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.integration-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.integration-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.integration-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.integration-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}.integration-form__btn--export[_ngcontent-%COMP%]{border-color:var(--color-divider);color:var(--color-text-secondary)}.integration-form__btn--export[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--color-accent);color:var(--color-accent)}"]})};export{ie as IntegrationFormComponent};
|
|
1
|
+
import {y}from'./chunk-2TapTaXG.js';import {v}from'./chunk-BhlAZzwj.js';import {g,ao as V,G,w as we,d5 as N$1,d6 as U,F,S as pa,H as Hi,m as mT,cc as Hf,b as U$1,A as Aw,v as vs,l as Ag,W as WC,k as dl,n as eC,X as XE,a8 as Zg,t as tC,a9 as dC,q as oC,cG as Xw,a3 as HI,o as bg,a4 as rC,ac as mC,r as Tg,x as iC,a6 as $I,a5 as ml,aa as If,ab as wf}from'./main-ZCJEGFW3.js';import'./chunk-CtWA9Wcw.js';import {t as tt}from'./chunk-BLwyktBH.js';import'./chunk-BUF2p97y.js';import {o as z,k as _t,b as _e,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,A as At,m as mn,Z as Zn,l as Xn,C as Cn,E as En}from'./chunk-Pl7edkoq.js';import'./chunk-DVJHLBDM.js';import'./chunk-B6HBR6l3.js';function ae(r,t){r&1&&(vs(0,"p",5),WC(1,"Loading\u2026"),dl());}function le(r,t){if(r&1&&(vs(0,"label",10),bg(1,"input",29),HI(),vs(2,"span"),WC(3),dl()()),r&2){let e=t.$implicit,n=mC(2);XE(),Tg("value",e.value)("formControl",n.scopeControl)("disabled",e.value==="namespace"&&!n.isAdmin()),$I(),XE(2),Zg(e.label);}}function se(r,t){if(r&1&&(vs(0,"option",16),WC(1),dl()),r&2){let e=t.$implicit;Tg("value",e.type),XE(),Zg(e.displayName);}}function ce(r,t){if(r&1&&(vs(0,"option",16),WC(1),dl()),r&2){let e=t.$implicit;Tg("value",e),XE(),Zg(e);}}function me(r,t){if(r&1){let e=dC();vs(0,"div",24)(1,"ds-json-schema-form",30),Ag("valueChange",function(s){If(e);let m=mC(2);return wf(m.onParamsChange(s))}),dl()();}if(r&2){let e=mC(2);XE(),Tg("schema",t)("value",e.initialParams());}}function de(r,t){if(r&1){let e=dC();vs(0,"button",31),Ag("click",function(){If(e);let s=mC(2);return wf(s.exportYaml())}),WC(1),dl();}if(r&2){let e=mC(2);Tg("disabled",e.isExporting()),XE(),ml(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function pe(r,t){if(r&1){let e=dC();vs(0,"form",7),Ag("ngSubmit",function(){If(e);let s=mC();return wf(s.submit())}),vs(1,"fieldset",8)(2,"legend",9),WC(3,"Scope"),dl(),oC(4,le,4,4,"label",10,Xw().trackByScope,true),dl(),vs(6,"div",11)(7,"label",12),WC(8,"Type "),vs(9,"span",13),WC(10,"*"),dl()(),vs(11,"select",14)(12,"option",15),WC(13,"Select type"),dl(),oC(14,se,2,2,"option",16,Xw().trackByType,true),dl(),HI(),dl(),vs(16,"div",11)(17,"label",17),WC(18,"Name "),vs(19,"span",13),WC(20,"*"),dl()(),bg(21,"input",18),HI(),dl(),vs(22,"div",11)(23,"label",19),WC(24,"Description"),dl(),bg(25,"textarea",20),HI(),dl(),vs(26,"div",11)(27,"label",21),WC(28,"Auth Setting"),dl(),vs(29,"select",22)(30,"option",23),WC(31,"None"),dl(),oC(32,ce,2,2,"option",16,rC),dl(),HI(),dl(),eC(34,me,2,2,"div",24),vs(35,"div",25)(36,"button",26),WC(37),dl(),eC(38,de,2,2,"button",27),vs(39,"button",28),Ag("click",function(){If(e);let s=mC();return wf(s.cancel())}),WC(40,"Cancel"),dl()()();}if(r&2){let e,n=mC();Tg("formGroup",n.form),XE(),Tg("disabled",n.isEditMode()),XE(3),iC(n.scopeOptions),XE(7),Tg("formControl",n.typeControl),$I(),XE(3),iC(n.integrationTypes()),XE(7),Tg("formControl",n.nameControl),$I(),XE(4),Tg("formControl",n.descriptionControl),$I(),XE(4),Tg("formControl",n.authSettingNameControl),$I(),XE(),Tg("ngValue",null),XE(2),iC(n.availableAuthSettings()),XE(2),tC((e=n.schema())?34:-1,e),XE(2),Tg("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),XE(),ml(" ",n.isEditMode()?"Save changes":"Create"," "),XE(),tC(n.isEditMode()?38:-1);}}var ge=new Set(["platform","namespace","userOnNs","userGlobal"]),N=Object.freeze({platform:"Configuration plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),ie=class r{route=g(V);router=g(G);destroyRef=g(we);state=g(y);integrationTypeController=g(N$1);authSettingController=g(U);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=F(this.isPlatformMode?pa(true):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new z({name:new _t("",{nonNullable:true,validators:[_e.required,_e.minLength(1)]}),description:new _t(null),type:new _t("",{nonNullable:true,validators:[_e.required]}),scope:new _t("namespace",{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}isEditMode=Hi(false);isSubmitting=Hi(false);isLoading=Hi(false);isExporting=Hi(false);scopeOptions=[{value:"platform",label:N.platform},{value:"namespace",label:N.namespace},{value:"userOnNs",label:N.userOnNs},{value:"userGlobal",label:N.userGlobal}];authSettingNameControl=new _t(null);availableAuthSettings=Hi([]);paramsValue=Hi(null);initialParams=Hi(null);integrationTypes=F(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=F(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});schema=mT(()=>{let t=this.selectedType();return t?this.integrationTypes().find(n=>n.type===t)?.configSchema??null:null});existingConfig=null;constructor(){Hf(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("integrationId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable(),this.loadAuthSettingsForScope("platform");return}let s=this.parseScope(e.get("scope"));this.scopeControl.setValue(s),this.loadAuthSettingsForScope(s),this.scopeControl.valueChanges.pipe(U$1(this.destroyRef)).subscribe(re=>{this.loadAuthSettingsForScope(re);});let m=e.get("template");m&&this.hydrateFromTemplate(m);}parseScope(t){return t&&ge.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e;let n=this.deriveScopeFromConfig(e);this.scopeControl.setValue(n),this.applyConfigToForm(e),this.loadAuthSettingsForScope(n),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[IntegrationForm] Could not load config '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.applyConfigToForm(e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[IntegrationForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.typeControl.setValue(t.integrationType),this.initialParams.set(t.parameters),this.paramsValue.set(t.parameters),this.authSettingNameControl.setValue(t.authSettingName??null);}loadAuthSettingsForScope(t){let e;switch(t){case "platform":e=this.authSettingController.listAuthSetting();break;case "namespace":e=this.authSettingController.listAuthSetting(this.namespaceId);break;case "userOnNs":e=this.authSettingController.listAuthSetting(this.namespaceId,"me");break;case "userGlobal":e=this.authSettingController.listAuthSetting("none","me");break}e.pipe(U$1(this.destroyRef)).subscribe({next:n=>{let s=n.map(m=>m.name).filter(Boolean);this.availableAuthSettings.set([...new Set(s)]);},error:()=>this.availableAuthSettings.set([])});}onParamsChange(t){this.paramsValue.set(t);}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.descriptionControl.value?.trim(),e={name:this.nameControl.value.trim(),description:t||null,integrationType:this.typeControl.value,parameters:this.paramsValue(),authSettingName:this.authSettingNameControl.value||null},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,e,n,this.existingConfig):this.state.create(e,n,this.namespaceId??null)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.state.exportAsYaml(t).pipe(U$1(this.destroyRef)).subscribe({next:e=>{let n=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(n),m=document.createElement("a");m.href=s,m.download=`${this.existingConfig?.name??"integration"}.yaml`,m.click(),URL.revokeObjectURL(s),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"]);}trackByType(t,e){return e.type}trackByScope(t,e){return e.value}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=Aw({type:r,selectors:[["agentos-integration-form"]],decls:10,vars:2,consts:[[1,"integration-form"],[1,"integration-form__header"],["type","button","title","Back to integrations",1,"integration-form__back",3,"click"],[1,"integration-form__back-icon"],[1,"integration-form__title"],[1,"integration-form__loading"],[1,"integration-form__form",3,"formGroup"],[1,"integration-form__form",3,"ngSubmit","formGroup"],[1,"integration-form__field","integration-form__scope",3,"disabled"],[1,"integration-form__label"],[1,"integration-form__scope-option"],[1,"integration-form__field"],["for","integration-type",1,"integration-form__label"],["aria-hidden","true"],["id","integration-type",1,"integration-form__select",3,"formControl"],["value","","disabled",""],[3,"value"],["for","integration-name",1,"integration-form__label"],["id","integration-name","type","text","placeholder","Integration name","autocomplete","off",1,"integration-form__input",3,"formControl"],["for","integration-description",1,"integration-form__label"],["id","integration-description","placeholder","Optional description","rows","3",1,"integration-form__textarea",3,"formControl"],["for","integration-auth-setting",1,"integration-form__label"],["id","integration-auth-setting",1,"integration-form__select",3,"formControl"],[3,"ngValue"],[1,"integration-form__schema-form"],[1,"integration-form__actions"],["type","submit",1,"integration-form__btn","integration-form__btn--primary",3,"disabled"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"disabled"],["type","button",1,"integration-form__btn",3,"click"],["type","radio",3,"value","formControl","disabled"],[3,"valueChange","schema","value"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"click","disabled"]],template:function(e,n){e&1&&(vs(0,"div",0)(1,"header",1)(2,"button",2),Ag("click",function(){return n.cancel()}),vs(3,"span",3),WC(4,"\u2190"),dl(),WC(5," Integrations "),dl(),vs(6,"h1",4),WC(7),dl()(),eC(8,ae,2,0,"p",5)(9,pe,41,11,"form",6),dl()),e&2&&(XE(7),Zg(n.isEditMode()?"Edit integration":"New integration"),XE(),tC(n.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,At,mn,Zn,Xn,Cn,En,tt],styles:[".integration-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.integration-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.integration-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.integration-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.integration-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.integration-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.integration-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.integration-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.integration-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-divider);border-radius:0;padding:.75rem 1rem;background:transparent;margin:0}.integration-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.integration-form__scope-option[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--color-text);cursor:pointer}.integration-form__scope-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin:0}.integration-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.integration-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.integration-form__input[_ngcontent-%COMP%], .integration-form__textarea[_ngcontent-%COMP%], .integration-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.integration-form__input[_ngcontent-%COMP%]:focus, .integration-form__textarea[_ngcontent-%COMP%]:focus, .integration-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.integration-form__input[_ngcontent-%COMP%]::placeholder, .integration-form__textarea[_ngcontent-%COMP%]::placeholder, .integration-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.integration-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:4.5rem;line-height:1.5}.integration-form__select[_ngcontent-%COMP%]{cursor:pointer}.integration-form__select[_ngcontent-%COMP%] option[disabled][_ngcontent-%COMP%]{color:var(--color-text-secondary)}.integration-form__schema-form[_ngcontent-%COMP%]{padding:1rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface)}.integration-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.integration-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.integration-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.integration-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.integration-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.integration-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}.integration-form__btn--export[_ngcontent-%COMP%]{border-color:var(--color-divider);color:var(--color-text-secondary)}.integration-form__btn--export[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--color-accent);color:var(--color-accent)}"]})};export{ie as IntegrationFormComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as P$1,av as dt$1,z as z$1}from'./main-
|
|
1
|
+
import {a as P$1,av as dt$1,z as z$1}from'./main-ZCJEGFW3.js';function ct(){return {async:false,breaks:false,extensions:null,gfm:true,hooks:null,pedantic:false,renderer:null,silent:false,tokenizer:null,walkTokens:null}}var re=ct();function rn(n){re=n;}var xe={exec:()=>null};function k(n,e=""){let r=typeof n=="string"?n:n.source,s={replace:(t,a)=>{let l=typeof a=="string"?a:a.source;return l=l.replace(D.caret,"$1"),r=r.replace(t,l),s},getRegex:()=>new RegExp(r,e)};return s}var D={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},Hn=/^(?:[ \t]*(?:\n|$))+/,Gn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Wn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Te=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,qn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,pt=/(?:[*+-]|\d{1,9}[.)])/,sn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ln=k(sn).replace(/bull/g,pt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Zn=k(sn).replace(/bull/g,pt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ut=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Yn=/^[^\n]+/,ht=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,jn=k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ht).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Xn=k(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,pt).getRegex(),Fe="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ft=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Qn=k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ft).replace("tag",Fe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),an=k(ut).replace("hr",Te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Fe).getRegex(),Vn=k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",an).getRegex(),gt={blockquote:Vn,code:Gn,def:jn,fences:Wn,heading:qn,hr:Te,html:Qn,lheading:ln,list:Xn,newline:Hn,paragraph:an,table:xe,text:Yn},Vt=k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Fe).getRegex(),Kn=z$1(P$1({},gt),{lheading:Zn,table:Vt,paragraph:k(ut).replace("hr",Te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Vt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Fe).getRegex()}),Jn=z$1(P$1({},gt),{html:k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ft).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:xe,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:k(ut).replace("hr",Te).replace("heading",` *#{1,6} *[^
|
|
2
2
|
]`).replace("lheading",ln).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),er=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,tr=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,on=/^( {2,}|\\)\n(?!\s*$)/,nr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Be=/[\p{P}\p{S}]/u,dt=/[\s\p{P}\p{S}]/u,cn=/[^\s\p{P}\p{S}]/u,rr=k(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,dt).getRegex(),pn=/(?!~)[\p{P}\p{S}]/u,sr=/(?!~)[\s\p{P}\p{S}]/u,ir=/(?:[^\s\p{P}\p{S}]|~)/u,lr=/\[(?:[^\[\]`]|`[^`]*?`)*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,un=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ar=k(un,"u").replace(/punct/g,Be).getRegex(),or=k(un,"u").replace(/punct/g,pn).getRegex(),hn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",cr=k(hn,"gu").replace(/notPunctSpace/g,cn).replace(/punctSpace/g,dt).replace(/punct/g,Be).getRegex(),pr=k(hn,"gu").replace(/notPunctSpace/g,ir).replace(/punctSpace/g,sr).replace(/punct/g,pn).getRegex(),ur=k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,cn).replace(/punctSpace/g,dt).replace(/punct/g,Be).getRegex(),hr=k(/\\(punct)/,"gu").replace(/punct/g,Be).getRegex(),fr=k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),gr=k(ft).replace("(?:-->|$)","-->").getRegex(),dr=k("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",gr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ze=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,mr=k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ze).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),fn=k(/^!?\[(label)\]\[(ref)\]/).replace("label",ze).replace("ref",ht).getRegex(),gn=k(/^!?\[(ref)\](?:\[\])?/).replace("ref",ht).getRegex(),kr=k("reflink|nolink(?!\\()","g").replace("reflink",fn).replace("nolink",gn).getRegex(),Kt=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,mt={_backpedal:xe,anyPunctuation:hr,autolink:fr,blockSkip:lr,br:on,code:tr,del:xe,emStrongLDelim:ar,emStrongRDelimAst:cr,emStrongRDelimUnd:ur,escape:er,link:mr,nolink:gn,punctuation:rr,reflink:fn,reflinkSearch:kr,tag:dr,text:nr,url:xe},br=z$1(P$1({},mt),{link:k(/^!?\[(label)\]\((.*?)\)/).replace("label",ze).getRegex(),reflink:k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ze).getRegex()}),lt=z$1(P$1({},mt),{emStrongRDelimAst:pr,emStrongLDelim:or,url:k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Kt).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:k(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Kt).getRegex()}),xr=z$1(P$1({},lt),{br:k(on).replace("{2,}","*").getRegex(),text:k(lt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),ve={normal:gt,gfm:Kn,pedantic:Jn},me={normal:mt,gfm:lt,breaks:xr,pedantic:br},Tr={"&":"&","<":"<",">":">",'"':""","'":"'"},Jt=n=>Tr[n];function q(n,e){if(e){if(D.escapeTest.test(n))return n.replace(D.escapeReplace,Jt)}else if(D.escapeTestNoEncode.test(n))return n.replace(D.escapeReplaceNoEncode,Jt);return n}function en(n){try{n=encodeURI(n).replace(D.percentDecode,"%");}catch(e){return null}return n}function tn(n,e){let r=n.replace(D.findPipe,(a,l,o)=>{let p=false,u=l;for(;--u>=0&&o[u]==="\\";)p=!p;return p?"|":" |"}),s=r.split(D.splitPipe),t=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;t<s.length;t++)s[t]=s[t].trim().replace(D.slashPipe,"|");return s}function ke(n,e,r){let s=n.length;if(s===0)return "";let t=0;for(;t<s;){let a=n.charAt(s-t-1);if(a===e&&true)t++;else break}return n.slice(0,s-t)}function wr(n,e){if(n.indexOf(e[1])===-1)return -1;let r=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])r++;else if(n[s]===e[1]&&(r--,r<0))return s;return r>0?-2:-1}function nn(n,e,r,s,t){let a=e.href,l=e.title||null,o=n[1].replace(t.other.outputLinkReplace,"$1");s.state.inLink=true;let p={type:n[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:l,text:o,tokens:s.inlineTokens(o)};return s.state.inLink=false,p}function Ar(n,e,r){let s=n.match(r.other.indentCodeCompensation);if(s===null)return e;let t=s[1];return e.split(`
|
|
3
3
|
`).map(a=>{let l=a.match(r.other.beginningSpace);if(l===null)return a;let[o]=l;return o.length>=t.length?a.slice(t.length):a}).join(`
|
|
4
4
|
`)}var $e=class{options;rules;lexer;constructor(n){this.options=n||re;}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return {type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return {type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:ke(r,`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {b as Qe}from'./chunk-
|
|
1
|
+
import {b as Qe}from'./chunk-BUF2p97y.js';import {D as D$1,i as y}from'./chunk-Pl7edkoq.js';import {aK as Do,aL as Wn,aN as wt,g as g$1,az as Qt,br as wl,aO as G,aR as K,aV as w,al as yt,aW as D,bw as on,bx as am,aS as Ut,H as Hi,A as Aw,by as Oi,aC as wu,aZ as YT,bz as vC,v as vs,l as Ag,k as dl,o as bg,c8 as kf,cj as Ff,bA as DC,T as TC,r as Tg,X as XE,y as Hg,C as Cg,b4 as nT,bB as Ii,c7 as QT,b$ as Ng,b_ as FC,D as Fg,I as IC,E as wC}from'./main-ZCJEGFW3.js';var W=["input"],Y=["label"],ee=["*"],f={color:"accent",clickAction:"check-indeterminate",disabledInteractive:false},ce=new w("mat-checkbox-default-options",{providedIn:"root",factory:()=>f}),a=(function(t){return t[t.Init=0]="Init",t[t.Checked=1]="Checked",t[t.Unchecked=2]="Unchecked",t[t.Indeterminate=3]="Indeterminate",t})(a||{}),g=class{source;checked},ne=(()=>{class t{_elementRef=g$1(Qt);_changeDetectorRef=g$1(wl);_ngZone=g$1(G);_animationsDisabled=K();_options=g$1(ce,{optional:true});focus(){this._inputElement.nativeElement.focus();}_createChangeEvent(e){let n=new g;return n.source=this,n.checked=e,n}_getAnimationTargetElement(){return this._inputElement?.nativeElement}_animationClasses={uncheckedToChecked:"mdc-checkbox--anim-unchecked-checked",uncheckedToIndeterminate:"mdc-checkbox--anim-unchecked-indeterminate",checkedToUnchecked:"mdc-checkbox--anim-checked-unchecked",checkedToIndeterminate:"mdc-checkbox--anim-checked-indeterminate",indeterminateToChecked:"mdc-checkbox--anim-indeterminate-checked",indeterminateToUnchecked:"mdc-checkbox--anim-indeterminate-unchecked"};ariaLabel="";ariaLabelledby=null;ariaDescribedby;ariaExpanded;ariaControls;ariaOwns;_uniqueId;id;get inputId(){return `${this.id||this._uniqueId}-input`}required=false;labelPosition="after";name=null;change=new yt;indeterminateChange=new yt;value;disableRipple=false;_inputElement;_labelElement;tabIndex;color;disabledInteractive;_onTouched=()=>{};_currentAnimationClass="";_currentCheckState=a.Init;_controlValueAccessorChangeFn=()=>{};_validatorChangeFn=()=>{};constructor(){g$1(D).load(on);let e=g$1(new am("tabindex"),{optional:true});this._options=this._options||f,this.color=this._options.color||f.color,this.tabIndex=e==null?0:parseInt(e)||0,this.id=this._uniqueId=g$1(Ut).getId("mat-mdc-checkbox-"),this.disabledInteractive=this._options?.disabledInteractive??false;}ngOnChanges(e){e.required&&this._validatorChangeFn();}ngAfterViewInit(){this._syncIndeterminate(this.indeterminate);}get checked(){return this._checked}set checked(e){e!=this.checked&&(this._checked=e,this._changeDetectorRef.markForCheck());}_checked=false;get disabled(){return this._disabled}set disabled(e){e!==this.disabled&&(this._disabled=e,this._changeDetectorRef.markForCheck());}_disabled=false;get indeterminate(){return this._indeterminate()}set indeterminate(e){let n=e!=this._indeterminate();this._indeterminate.set(e),n&&(e?this._transitionCheckState(a.Indeterminate):this._transitionCheckState(this.checked?a.Checked:a.Unchecked),this.indeterminateChange.emit(e)),this._syncIndeterminate(e);}_indeterminate=Hi(false);_isRippleDisabled(){return this.disableRipple||this.disabled}_onLabelTextChange(){this._changeDetectorRef.detectChanges();}writeValue(e){this.checked=!!e;}registerOnChange(e){this._controlValueAccessorChangeFn=e;}registerOnTouched(e){this._onTouched=e;}setDisabledState(e){this.disabled=e;}validate(e){return this.required&&e.value!==true?{required:true}:null}registerOnValidatorChange(e){this._validatorChangeFn=e;}_transitionCheckState(e){let n=this._currentCheckState,c=this._getAnimationTargetElement();if(!(n===e||!c)&&(this._currentAnimationClass&&c.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(n,e),this._currentCheckState=e,this._currentAnimationClass.length>0)){c.classList.add(this._currentAnimationClass);let o=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{c.classList.remove(o);},1e3);});}}_emitChangeEvent(){this._controlValueAccessorChangeFn(this.checked),this.change.emit(this._createChangeEvent(this.checked)),this._inputElement&&(this._inputElement.nativeElement.checked=this.checked);}toggle(){this.checked=!this.checked,this._controlValueAccessorChangeFn(this.checked);}_handleInputClick(){let e=this._options?.clickAction;!this.disabled&&e!=="noop"?(this.indeterminate&&e!=="check"&&Promise.resolve().then(()=>{this._indeterminate.set(false),this.indeterminateChange.emit(false);}),this._checked=!this._checked,this._transitionCheckState(this._checked?a.Checked:a.Unchecked),this._emitChangeEvent()):(this.disabled&&this.disabledInteractive||!this.disabled&&e==="noop")&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate);}_onInteractionEvent(e){e.stopPropagation();}_onBlur(){Promise.resolve().then(()=>{this._onTouched(),this._changeDetectorRef.markForCheck();});}_getAnimationClassForCheckStateTransition(e,n){if(this._animationsDisabled)return "";switch(e){case a.Init:if(n===a.Checked)return this._animationClasses.uncheckedToChecked;if(n==a.Indeterminate)return this._checked?this._animationClasses.checkedToIndeterminate:this._animationClasses.uncheckedToIndeterminate;break;case a.Unchecked:return n===a.Checked?this._animationClasses.uncheckedToChecked:this._animationClasses.uncheckedToIndeterminate;case a.Checked:return n===a.Unchecked?this._animationClasses.checkedToUnchecked:this._animationClasses.checkedToIndeterminate;case a.Indeterminate:return n===a.Checked?this._animationClasses.indeterminateToChecked:this._animationClasses.indeterminateToUnchecked}return ""}_syncIndeterminate(e){let n=this._inputElement;n&&(n.nativeElement.indeterminate=e);}_onInputClick(){this._handleInputClick();}_onTouchTargetClick(){this._handleInputClick(),this.disabled||this._inputElement.nativeElement.focus();}_preventBubblingFromLabel(e){e.target&&this._labelElement.nativeElement.contains(e.target)&&e.stopPropagation();}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Aw({type:t,selectors:[["mat-checkbox"]],viewQuery:function(n,c){if(n&1&&Fg(W,5)(Y,5),n&2){let o;IC(o=wC())&&(c._inputElement=o.first),IC(o=wC())&&(c._labelElement=o.first);}},hostAttrs:[1,"mat-mdc-checkbox"],hostVars:16,hostBindings:function(n,c){n&2&&(Ng("id",c.id),Cg("tabindex",null)("aria-label",null)("aria-labelledby",null),FC(c.color?"mat-"+c.color:"mat-accent"),Hg("_mat-animation-noopable",c._animationsDisabled)("mdc-checkbox--disabled",c.disabled)("mat-mdc-checkbox-disabled",c.disabled)("mat-mdc-checkbox-checked",c.checked)("mat-mdc-checkbox-disabled-interactive",c.disabledInteractive));},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],ariaExpanded:[2,"aria-expanded","ariaExpanded",YT],ariaControls:[0,"aria-controls","ariaControls"],ariaOwns:[0,"aria-owns","ariaOwns"],id:"id",required:[2,"required","required",YT],labelPosition:"labelPosition",name:"name",value:"value",disableRipple:[2,"disableRipple","disableRipple",YT],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?void 0:QT(e)],color:"color",disabledInteractive:[2,"disabledInteractive","disabledInteractive",YT],checked:[2,"checked","checked",YT],disabled:[2,"disabled","disabled",YT],indeterminate:[2,"indeterminate","indeterminate",YT]},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[nT([{provide:D$1,useExisting:Ii(()=>t),multi:true},{provide:y,useExisting:t,multi:true}]),wu],ngContentSelectors:ee,decls:15,vars:23,consts:[["checkbox",""],["input",""],["label",""],["mat-internal-form-field","",3,"click","labelPosition"],[1,"mdc-checkbox"],["aria-hidden","true",1,"mat-mdc-checkbox-touch-target",3,"click"],["type","checkbox",1,"mdc-checkbox__native-control",3,"blur","click","change","checked","indeterminate","disabled","id","required","tabIndex"],["aria-hidden","true",1,"mdc-checkbox__ripple"],["aria-hidden","true",1,"mdc-checkbox__background"],["focusable","false","viewBox","0 0 24 24",1,"mdc-checkbox__checkmark"],["fill","none","d","M1.73,12.91 8.1,19.28 22.79,4.59",1,"mdc-checkbox__checkmark-path"],[1,"mdc-checkbox__mixedmark"],["mat-ripple","","aria-hidden","true",1,"mat-mdc-checkbox-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-label",3,"for"]],template:function(n,c){if(n&1&&(vC(),vs(0,"div",3),Ag("click",function(k){return c._preventBubblingFromLabel(k)}),vs(1,"div",4,0)(3,"div",5),Ag("click",function(){return c._onTouchTargetClick()}),dl(),vs(4,"input",6,1),Ag("blur",function(){return c._onBlur()})("click",function(){return c._onInputClick()})("change",function(k){return c._onInteractionEvent(k)}),dl(),bg(6,"div",7),vs(7,"div",8),kf(),vs(8,"svg",9),bg(9,"path",10),dl(),Ff(),bg(10,"div",11),dl(),bg(11,"div",12),dl(),vs(12,"label",13,2),DC(14),dl()()),n&2){let o=TC(2);Tg("labelPosition",c.labelPosition),XE(4),Hg("mdc-checkbox--selected",c.checked),Tg("checked",c.checked)("indeterminate",c.indeterminate)("disabled",c.disabled&&!c.disabledInteractive)("id",c.inputId)("required",c.required)("tabIndex",c.disabled&&!c.disabledInteractive?-1:c.tabIndex),Cg("aria-label",c.ariaLabel||null)("aria-labelledby",c.ariaLabelledby)("aria-describedby",c.ariaDescribedby)("aria-checked",c.indeterminate?"mixed":null)("aria-controls",c.ariaControls)("aria-disabled",c.disabled&&c.disabledInteractive?true:null)("aria-expanded",c.ariaExpanded)("aria-owns",c.ariaOwns)("name",c.name)("value",c.value),XE(7),Tg("matRippleTrigger",o)("matRippleDisabled",c.disableRipple||c.disabled)("matRippleCentered",true),XE(),Tg("for",c.inputId);}},dependencies:[Oi,Qe],styles:[`.mdc-checkbox {
|
|
2
2
|
display: inline-block;
|
|
3
3
|
position: relative;
|
|
4
4
|
flex: 0 0 18px;
|
|
@@ -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-Dv3y4cq8.js';import {g,az as Qt,aQ as As,aY as ks,al as yt,A as Aw,o as bg,v as vs,q as oC,k as dl,T as TC,r as Tg,X as XE,x as iC,D as Fg,I as IC,E as wC,j as Gn$1,l as Ag,W as WC,b_ as FC,C as Cg,a8 as Zg,O as Ot,w as we$1,cJ as gB,ca as hB,H as Hi$1,m as mT,b as U,bz as vC,bA as DC,ad as Vg,y as Hg,aw as fl,b5 as Sg,ax as pl,n as eC,t as tC,cb as pB,cq as mB,cc as Hf,cu as Lg,cv as CC,cd as Sb,af as Dg,an as ce,cK as Id,cL as Nd,bR as ga$1,S as pa,cI as Rg,b$ as Ng,cM as An$1,aK as Do$1,aL as Wn$1,bq as sn,bC as ge,aN as wt$1,bD as vt,br as wl,bK as pe,aR as K,cN as is,a as P,aS as Ut,cO as Bt,bQ as bd,bO as Yy,bt as Ve,c1 as ME,z as z$1,aZ as YT,bH as Eg,b4 as nT,aV as w,bu as kg,aU as U$1,bv as St,aW as D,bw as on,by as Oi$1,bE as X,cP as q,cQ as X$1,ac as mC,a9 as dC,aa as If,ab as wf,a5 as ml,cR as Yt$1,cS as Gp,bL as gr,aO as G,ae as Ot$1,aA as sn$1,bV as Y,cT as pi,cU as yg,aC as wu,bx as am,cA as on$1,c7 as QT,ah as rT,a4 as rC,c8 as kf,bs as Qn$2,ap as Vy,bW as Pt,bY as X$2,bZ as xt,cV as YI,cC as Ce,a3 as HI,a6 as $I,bn as nC,c2 as kt,bI as lr,a_ as XC,b3 as oT,a$ as Yg,cg as Mg,cW as yr,cX as tt$1,aX as ft$1,cy as Xr,ag as fT}from'./main-CERDHS7N.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-D615HDbJ.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),dl());}var ri=["*"];function si(n,i){if(n&1){let e=dC();fl(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))}),fl(1,"div",1),DC(2),pl()();}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 mt=new w("MAT_MENU_PANEL"),Le=(()=>{class n{_elementRef=g(Qt);_document=g(U$1);_focusMonitor=g(St);_parentMenu=g(mt,{optional:true});_changeDetectorRef=g(wl);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),dl(),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"),ga=(()=>{class n{_template=g(lr);_appRef=g(yr);_injector=g(pe);_viewContainerRef=g(gr);_document=g(U$1);_changeDetectorRef=g(wl);_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"})}),dt="_mat-menu-enter",Ze="_mat-menu-exit",ke=(()=>{class n{_elementRef=g(Qt);_changeDetectorRef=g(wl);_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;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),ga$1(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),ga$1(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===Ze;(t||e===dt)&&(t&&(clearTimeout(this._exitFallbackTimeout),this._exitFallbackTimeout=void 0),this._animationDone.next(t?"void":"enter"),this._isAnimating.set(false));}_onAnimationStart(e){(e===dt||e===Ze)&&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(Ze),200));this._animationsDisabled&&setTimeout(()=>{this._onAnimationDone(e?dt:Ze);}),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,Le,5)(a,Le,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(lr,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:mt,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-BUF2p97y.js';import {g,az as Qt,aQ as As,aY as ks,al as yt,A as Aw,o as bg,v as vs,q as oC,k as dl,T as TC,r as Tg,X as XE,x as iC,D as Fg,I as IC,E as wC,j as Gn$1,l as Ag,W as WC,b_ as FC,C as Cg,a8 as Zg,O as Ot,w as we$1,cJ as gB,ca as hB,H as Hi$1,m as mT,b as U,bz as vC,bA as DC,ad as Vg,y as Hg,aw as fl,b5 as Sg,ax as pl,n as eC,t as tC,cb as pB,cq as mB,cc as Hf,cu as Lg,cv as CC,cd as Sb,af as Dg,an as ce,cK as Id,cL as Nd,bR as ga$1,S as pa,cI as Rg,b$ as Ng,cM as An$1,aK as Do$1,aL as Wn$1,bq as sn,bC as ge,aN as wt$1,bD as vt,br as wl,bK as pe,aR as K,cN as is,a as P,aS as Ut,cO as Bt,bQ as bd,bO as Yy,bt as Ve,c1 as ME,z as z$1,aZ as YT,bH as Eg,b4 as nT,aV as w,bu as kg,aU as U$1,bv as St,aW as D,bw as on,by as Oi$1,bE as X,cP as q,cQ as X$1,ac as mC,a9 as dC,aa as If,ab as wf,a5 as ml,cR as Yt$1,cS as Gp,bL as gr,aO as G,ae as Ot$1,aA as sn$1,bV as Y,cT as pi,cU as yg,aC as wu,bx as am,cA as on$1,c7 as QT,ah as rT,a4 as rC,c8 as kf,bs as Qn$2,ap as Vy,bW as Pt,bY as X$2,bZ as xt,cV as YI,cC as Ce,a3 as HI,a6 as $I,bn as nC,c2 as kt,bI as lr,a_ as XC,b3 as oT,a$ as Yg,cg as Mg,cW as yr,cX as tt$1,aX as ft$1,cy as Xr,ag as fT}from'./main-ZCJEGFW3.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-Pl7edkoq.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),dl());}var ri=["*"];function si(n,i){if(n&1){let e=dC();fl(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))}),fl(1,"div",1),DC(2),pl()();}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 mt=new w("MAT_MENU_PANEL"),Le=(()=>{class n{_elementRef=g(Qt);_document=g(U$1);_focusMonitor=g(St);_parentMenu=g(mt,{optional:true});_changeDetectorRef=g(wl);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),dl(),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"),ga=(()=>{class n{_template=g(lr);_appRef=g(yr);_injector=g(pe);_viewContainerRef=g(gr);_document=g(U$1);_changeDetectorRef=g(wl);_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"})}),dt="_mat-menu-enter",Ze="_mat-menu-exit",ke=(()=>{class n{_elementRef=g(Qt);_changeDetectorRef=g(wl);_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;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),ga$1(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),ga$1(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===Ze;(t||e===dt)&&(t&&(clearTimeout(this._exitFallbackTimeout),this._exitFallbackTimeout=void 0),this._animationDone.next(t?"void":"enter"),this._isAnimating.set(false));}_onAnimationStart(e){(e===dt||e===Ze)&&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(Ze),200));this._animationsDisabled&&setTimeout(()=>{this._onAnimationDone(e?dt:Ze);}),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,Le,5)(a,Le,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(lr,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:mt,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 {O}from'./chunk-
|
|
1
|
+
import {O}from'./chunk-C4iXIN7X.js';import {g,G,w as we,d7 as F$1,aI as Tr,bR as ga,u as ue,b as U,A as Aw,aJ as Nb,v as vs,be as aT,l as Ag,k as dl,af as Dg,T as TC,r as Tg,bf 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-ZCJEGFW3.js';import {W as Wn,D as De}from'./chunk-BLwyktBH.js';import'./chunk-BUF2p97y.js';import'./chunk-Pl7edkoq.js';var V=()=>[];function F(i,e){if(i&1){let t=dC();vs(0,"agentos-integration-config-item",4),Ag("editRequested",function(n){If(t);let f=mC(2);return wf(f.onEdit(n))})("deleteRequested",function(n){If(t);let f=mC(2);return wf(f.deleteConfig(n))}),dl();}i&2&&Tg("config",e);}function L(i,e){if(i&1&&eC(0,F,1,1,"agentos-integration-config-item",3),i&2){let t,o=e.$implicit,n=mC();tC((t=n.resolveConfig(o.id))?0:-1,t);}}var S=class i{router=g(G);destroyRef=g(we);integrationConfigController=g(F$1);refresh$=new Tr(void 0);configs$=this.refresh$.pipe(ga(()=>this.integrationConfigController.listIntegrationConfig()));configItems$=this.configs$.pipe(ue(e=>e.map(t=>({id:t.id??"",name:t.name,description:t.integrationType}))));configsById=new Map;constructor(){this.configs$.pipe(U(this.destroyRef)).subscribe(e=>{this.configsById=new Map(e.map(t=>[t.id??"",t]));});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","integration-configs","new"]);}deleteConfig(e){this.integrationConfigController.deleteIntegrationConfig(e.id??"").pipe(U(this.destroyRef)).subscribe(()=>this.refresh$.next());}onEdit(e){this.router.navigate(["/agentos","admin","integration-configs",e.id??"","edit"]);}resolveConfig(e){return this.configsById.get(e)??null}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=Aw({type:i,selectors:[["agentos-platform-integration-configs"]],decls:5,vars:6,consts:[["integrationConfigItemTpl",""],["title","Platform Integration Configs","emptyMessage","No platform integration configs defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],["scope","platform",3,"config"],["scope","platform",3,"editRequested","deleteRequested","config"]],template:function(t,o){if(t&1&&(vs(0,"ds-entity-list",1),aT(1,"async"),Ag("createRequested",function(){return o.openCreateForm()}),vs(2,"ds-icon-button",2),Ag("action",function(){return o.goBack()}),dl()(),Dg(3,L,1,1,"ng-template",null,0,fT)),t&2){let n=TC(4);Tg("items",uT(1,3,o.configItems$)??rT(5,V))("showCreate",true)("itemTemplate",n);}},dependencies:[Wn,O,De,Nb],styles:[".platform-integration-configs__back[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.platform-integration-configs__back[_ngcontent-%COMP%]:hover{text-decoration:underline}"]})};export{S as PlatformIntegrationConfigsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {O}from'./chunk-
|
|
1
|
+
import {O}from'./chunk-CTYiqe0l.js';import {g,ao as V$1,G as G$1,w as we,d8 as M,aI as Tr,bR as ga,Q as By,a7 as ha,S as pa,u as ue,b as U$1,A as Aw,aJ as Nb,v as vs,be as aT,l as Ag,W as WC,k as dl,af as Dg,T as TC,r as Tg,bf 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-ZCJEGFW3.js';import {W as Wn}from'./chunk-BLwyktBH.js';import'./chunk-BUF2p97y.js';import'./chunk-Pl7edkoq.js';var F=()=>[];function U(o,t){if(o&1){let n=dC();vs(0,"agentos-agent-config-item",4),Ag("deleteRequested",function(i){If(n);let D=mC(2);return wf(D.deleteConfig(i))}),dl();}if(o&2){let n=mC().$implicit,e=mC();Tg("config",t)("namespaceId",e.namespaceId)("readOnly",e.isPlatformConfig(n.id));}}function V(o,t){if(o&1&&eC(0,U,1,3,"agentos-agent-config-item",3),o&2){let n,e=t.$implicit,i=mC();tC((n=i.resolveConfig(e.id))?0:-1,n);}}var j="namespace",G="platform",q=class o{route=g(V$1);router=g(G$1);destroyRef=g(we);agentConfigController=g(M);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);allConfigs$=this.refresh$.pipe(ga(()=>By({namespace:this.agentConfigController.listByParentAgentConfig(this.namespaceId),platform:this.agentConfigController.listPlatformAgentsAgentConfig().pipe(ha(()=>pa([])))})));configItems$=this.allConfigs$.pipe(ue(({namespace:t,platform:n})=>[...n.map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:G,groupLabel:"Platform (read-only)"})),...t.map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:j,groupLabel:"Namespace"}))]));namespaceConfigsById=new Map;platformConfigsById=new Map;constructor(){this.allConfigs$.pipe(U$1(this.destroyRef)).subscribe(({namespace:t,platform:n})=>{this.namespaceConfigsById=new Map(t.map(e=>[e.id??"",e])),this.platformConfigsById=new Map(n.map(e=>[e.id??"",e]));});}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"agent-configs","new"]);}deleteConfig(t){this.agentConfigController.deleteAgentConfig(t.id??"").pipe(U$1(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolveConfig(t){return this.namespaceConfigsById.get(t)??this.platformConfigsById.get(t)??null}isPlatformConfig(t){return this.platformConfigsById.has(t)}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=Aw({type:o,selectors:[["agentos-namespace-agent-configs"]],decls:6,vars:6,consts:[["agentConfigItemTpl",""],["title","Agent Configs","emptyMessage","No agent configs defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","type","button",1,"namespace-agent-configs__back",3,"click"],[3,"config","namespaceId","readOnly"],[3,"deleteRequested","config","namespaceId","readOnly"]],template:function(n,e){if(n&1&&(vs(0,"ds-entity-list",1),aT(1,"async"),Ag("createRequested",function(){return e.openCreateForm()}),vs(2,"button",2),Ag("click",function(){return e.goBack()}),WC(3," \u2190 Namespaces "),dl()(),Dg(4,V,1,1,"ng-template",null,0,fT)),n&2){let i=TC(5);Tg("items",uT(1,3,e.configItems$)??rT(5,F))("showCreate",true)("itemTemplate",i);}},dependencies:[Wn,O,Nb],styles:[".namespace-agent-configs__back[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.namespace-agent-configs__back[_ngcontent-%COMP%]:hover{text-decoration:underline}"]})};export{q as NamespaceAgentConfigsComponent};
|