@whoz-oss/coday-client 3.10.1 → 3.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{chunk-538NlE7s.js → chunk-2R-L-8TB.js} +1 -1
- package/browser/{chunk-BTvzcZ1s.js → chunk-B64oBHQ_.js} +1 -1
- package/browser/{chunk-CE3CVQYJ.js → chunk-B6GXI9z-.js} +1 -1
- package/browser/{chunk-C2fhkSx5.js → chunk-B9IQiMog.js} +1 -1
- package/browser/{chunk-LlG18Htx.js → chunk-BESIk8ll.js} +6 -6
- package/browser/{chunk-B5rsaW2b.js → chunk-BM9I1k6S.js} +1 -1
- package/browser/{chunk-C2rlLV-W.js → chunk-BOq6QumJ.js} +5 -5
- package/browser/{chunk-DhYK3aRa.js → chunk-BQ7Z34pK.js} +1 -1
- package/browser/{chunk-DxhQHX1Y.js → chunk-BR4Pl8xo.js} +1 -1
- package/browser/{chunk-CUmZcEGx.js → chunk-BSY9MBD-.js} +6 -6
- package/browser/{chunk-TngDHyxp.js → chunk-BUALjXbx.js} +1 -1
- package/browser/{chunk-BuSLhs6I.js → chunk-BUJvZgLu.js} +1 -1
- package/browser/{chunk-CFU4PT4-.js → chunk-BUpmxKd8.js} +1 -1
- package/browser/{chunk-DkFy_8tW.js → chunk-BWqySSd7.js} +1 -1
- package/browser/chunk-Bf1Bttqy.js +9 -0
- package/browser/chunk-Bsv9CCXL.js +1 -0
- package/browser/{chunk-BkVtgsRG.js → chunk-BxnUTBZC.js} +1 -1
- package/browser/{chunk-B8YsdH5W.js → chunk-Bz081WAa.js} +3 -3
- package/browser/{chunk-zmM38Yul.js → chunk-BzcZylVP.js} +3 -3
- package/browser/{chunk-CFQpQly7.js → chunk-CCFtehVS.js} +2 -2
- package/browser/{chunk-DbmrZGxd.js → chunk-CCQglZL5.js} +1 -1
- package/browser/{chunk-BA23pyYd.js → chunk-CGJJDRqH.js} +1 -1
- package/browser/{chunk-BM08gUt6.js → chunk-CJIcHr4L.js} +1 -1
- package/browser/{chunk-TxtSVoMY.js → chunk-CNRDeQvk.js} +1 -1
- package/browser/{chunk-CaZlpLSd.js → chunk-CS_CmKL0.js} +1 -1
- package/browser/{chunk-Dk3h998A.js → chunk-CSa65gP2.js} +1 -1
- package/browser/{chunk-1LsZyzCe.js → chunk-CZutweoy.js} +2 -2
- package/browser/{chunk-7IDkwdi0.js → chunk-CaAK8DtC.js} +1 -1
- package/browser/{chunk-CbXRaZ5e.js → chunk-CfO-PCnU.js} +1 -1
- package/browser/{chunk-CkfpO0Ui.js → chunk-CkXXby9d.js} +2 -2
- package/browser/{chunk-3cJY-y-K.js → chunk-CkwB4YzM.js} +1 -1
- package/browser/{chunk-Ct1RBakr.js → chunk-CnFhM0Nt.js} +1 -1
- package/browser/{chunk-CRoK_gKa.js → chunk-Co3aK_ug.js} +1 -1
- package/browser/chunk-Cqva3eF5.js +2 -0
- package/browser/{chunk-Dx68TWlI.js → chunk-Cqy-kSp8.js} +1 -1
- package/browser/{chunk-BsaBLbYE.js → chunk-D2wlWOWp.js} +1 -1
- package/browser/{chunk-DfnvTJ7R.js → chunk-DEr2MMdQ.js} +1 -1
- package/browser/{chunk-BJ4jWcd_.js → chunk-DGbegOkt.js} +1 -1
- package/browser/{chunk-C1xOKACR.js → chunk-DJtRPrJe.js} +1 -1
- package/browser/{chunk-DAOnyJ7c.js → chunk-DKfZ0J0-.js} +1 -1
- package/browser/{chunk-D73z8OGT.js → chunk-DMo8nEUq.js} +1 -1
- package/browser/{chunk-B1Tv2Ebu.js → chunk-DQj9SXnH.js} +1 -1
- package/browser/chunk-DfyXf4Lw.js +1 -0
- package/browser/{chunk-C2OedcEU.js → chunk-Di5brgj6.js} +1 -1
- package/browser/{chunk-CX02zIUT.js → chunk-DoW9c054.js} +1 -1
- package/browser/{chunk-DzZlI93U.js → chunk-Duz7aHYs.js} +2 -2
- package/browser/chunk-DzSHyN8O.js +1 -0
- package/browser/chunk-DzXp5mWz.js +1 -0
- package/browser/{chunk-O1wALPze.js → chunk-E-XRHTIB.js} +1 -1
- package/browser/{chunk-b_e1R_FV.js → chunk-GHUL_MFq.js} +1 -1
- package/browser/{chunk-BWbwxWKa.js → chunk-HHbcGqdi.js} +1 -1
- package/browser/{chunk-CgurnF00.js → chunk-Hhxvnnlp.js} +1 -1
- package/browser/{chunk-CJdqLI4x.js → chunk-LgALnta4.js} +2 -2
- package/browser/{chunk-Db48BeGH.js → chunk-Lt-5ZOWn.js} +1 -1
- package/browser/{chunk-CeTOubPL.js → chunk-MtaKFhdm.js} +1 -1
- package/browser/{chunk-_aUM9QLW.js → chunk-N-tYgqQC.js} +1 -1
- package/browser/{chunk-DDdQkLim.js → chunk-NLyO0ldw.js} +1 -1
- package/browser/{chunk-BGILLpeT.js → chunk-QDqqdtZx.js} +1 -1
- package/browser/{chunk-ZtJnIW3b.js → chunk-RPuzC8Su.js} +1 -1
- package/browser/{chunk-DqfT0kg4.js → chunk-UX95uV76.js} +1 -1
- package/browser/{chunk-CqkMIKRg.js → chunk-Wd2dgg4g.js} +4 -4
- package/browser/chunk-b9_We0yK.js +1 -0
- package/browser/{chunk-DB97l2cM.js → chunk-iUyWeEFy.js} +1 -1
- package/browser/{chunk-DngVvVw1.js → chunk-iamu8zs_.js} +1 -1
- package/browser/{chunk-CPUMKiuB.js → chunk-nRV2u7bW.js} +2 -2
- package/browser/{chunk-Bpth0xKt.js → chunk-rjkvu4Y6.js} +3 -3
- package/browser/index.html +1 -1
- package/browser/main-4SCUMPDY.js +1811 -0
- package/package.json +1 -1
- package/browser/chunk-B3QJ8PhL.js +0 -1
- package/browser/chunk-BDkp40LI.js +0 -9
- package/browser/chunk-BPt7wScV.js +0 -1
- package/browser/chunk-CQXNmLda.js +0 -1
- package/browser/chunk-CmUHL9Tg.js +0 -1
- package/browser/chunk-DAEEDI2g.js +0 -1
- package/browser/chunk-IM1UfDv7.js +0 -2
- package/browser/main-MX6O2FH4.js +0 -1811
|
@@ -1 +1 @@
|
|
|
1
|
-
import {d}from'./chunk-BDkp40LI.js';import {g,ao as V,G as G$1,w as we,d8 as B$1,H as Hi,b as U$1,A as Aw,s as si,v as vs,k as Ag,W as WC,j as fl,n as eC,X as XE,r as Tg,t as tC,a8 as Zg,y as Hg,a5 as yl,a9 as dC,ac as mC,C as Cg,q as oC,x as iC,o as bg,bf as aT,bg as uT,aa as If,ab as wf,bj as aE}from'./main-MX6O2FH4.js';import'./chunk-BkVtgsRG.js';import'./chunk-LlG18Htx.js';import'./chunk-CUmZcEGx.js';import'./chunk-CJdqLI4x.js';var F=(n,o)=>o.name;function B(n,o){n&1&&(vs(0,"p",6),WC(1,"Loading\u2026"),fl());}function $(n,o){n&1&&(vs(0,"p",7),WC(1,"Failed to load agent definition."),fl());}function j(n,o){if(n&1&&(vs(0,"dt",12),WC(1,"User context"),fl(),vs(2,"dd",14),WC(3),fl()),n&2){let e=mC();XE(3),Zg(e.userId);}}function H(n,o){if(n&1&&(vs(0,"pre",21),WC(1),fl()),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"),fl(),vs(4,"span",20),WC(5," \u25BC "),fl()(),eC(6,H,2,1,"pre",21),fl();}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),fl()),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"),fl(),vs(4,"span",20),WC(5," \u25BC "),fl()(),eC(6,U,2,1,"pre",21),fl();}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."),fl());}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),fl()()),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),fl(),vs(4,"span",20),WC(5," \u25BC "),fl()(),eC(6,Q,4,2,"div",25),fl();}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),fl()),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"),fl(),vs(4,"dl",11)(5,"dt",12),WC(6,"Name"),fl(),vs(7,"dd",13),WC(8),fl(),vs(9,"dt",12),WC(10,"Resolved model"),fl(),vs(11,"dd",14),WC(12),fl(),vs(13,"dt",12),WC(14,"Provider"),fl(),vs(15,"dd",13),WC(16),fl(),vs(17,"dt",12),WC(18,"Advanced execution"),fl(),vs(19,"dd",13)(20,"span",15),WC(21),fl()(),eC(22,j,4,1),fl()(),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),fl()(),eC(30,q,2,0,"p",17)(31,X,3,0,"ul",18),fl()()),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(),yl(" ",e.advancedExecution?"Enabled":"Disabled"," "),XE(),tC(e.userId?22:-1),XE(),tC(e.systemPrompt?23:-1),XE(),tC(e.instructions?24:-1),XE(5),yl("(",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(B$1);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"),fl(),WC(5," Agent Configs "),fl(),vs(6,"h1",4),WC(7,"Agent definition"),fl(),vs(8,"a",5),WC(9,"Edit config \u2192"),fl()(),eC(10,B,2,0,"p",6)(11,$,2,0,"p",7)(12,Y,32,11,"div",8),fl()),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-Bf1Bttqy.js';import {g,ao as V,G as G$1,w as we,d8 as B$1,z as zi,c as U$1,h as Rw,s as si,I as Is,A as Ag,q as qC,m as pl,t as tC,J as JE,T as Tg,v as nC,a8 as Zg,H as Hg,a5 as vl,a9 as fC,ac as yC,C as Cg,o as iC,x as sC,n as bg,bf as cT,bg as lT,aa as If,ab as wf,bj as cE}from'./main-4SCUMPDY.js';import'./chunk-BxnUTBZC.js';import'./chunk-BESIk8ll.js';import'./chunk-BSY9MBD-.js';import'./chunk-LgALnta4.js';var F=(n,o)=>o.name;function B(n,o){n&1&&(Is(0,"p",6),qC(1,"Loading\u2026"),pl());}function $(n,o){n&1&&(Is(0,"p",7),qC(1,"Failed to load agent definition."),pl());}function j(n,o){if(n&1&&(Is(0,"dt",12),qC(1,"User context"),pl(),Is(2,"dd",14),qC(3),pl()),n&2){let e=yC();JE(3),Zg(e.userId);}}function H(n,o){if(n&1&&(Is(0,"pre",21),qC(1),pl()),n&2){let e=yC(2);JE(),Zg(e.systemPrompt);}}function J(n,o){if(n&1){let e=fC();Is(0,"section",9)(1,"button",19),Ag("click",function(){If(e);let g=yC(2);return wf(g.toggleSystemPrompt())}),Is(2,"h2",10),qC(3,"System Prompt"),pl(),Is(4,"span",20),qC(5," \u25BC "),pl()(),tC(6,H,2,1,"pre",21),pl();}if(n&2){let e=yC(2);JE(),Cg("aria-expanded",!e.systemPromptCollapsed()),JE(3),Hg("agent-config-inspect__chevron--open",!e.systemPromptCollapsed()),JE(2),nC(e.systemPromptCollapsed()?-1:6);}}function U(n,o){if(n&1&&(Is(0,"pre",21),qC(1),pl()),n&2){let e=yC(2);JE(),Zg(e.instructions);}}function G(n,o){if(n&1){let e=fC();Is(0,"section",9)(1,"button",19),Ag("click",function(){If(e);let g=yC(2);return wf(g.toggleInstructions())}),Is(2,"h2",10),qC(3,"Instructions"),pl(),Is(4,"span",20),qC(5," \u25BC "),pl()(),tC(6,U,2,1,"pre",21),pl();}if(n&2){let e=yC(2);JE(),Cg("aria-expanded",!e.instructionsCollapsed()),JE(3),Hg("agent-config-inspect__chevron--open",!e.instructionsCollapsed()),JE(2),nC(e.instructionsCollapsed()?-1:6);}}function q(n,o){n&1&&(Is(0,"p",17),qC(1,"No tools available for this agent."),pl());}function K(n,o){if(n&1&&(bg(0,"div",26),cT(1,"agentosMarkdown")),n&2){let e=yC(2).$implicit;Tg("innerHTML",lT(1,1,e.description),cE);}}function Q(n,o){if(n&1&&(Is(0,"div",25),tC(1,K,2,3,"div",26),Is(2,"pre",27),qC(3),pl()()),n&2){let e=yC().$implicit,c=yC(3);JE(),nC(e.description?1:-1),JE(2),Zg(c.formatSchema(e.inputSchema));}}function W(n,o){if(n&1){let e=fC();Is(0,"li",22)(1,"button",23),Ag("click",function(){let g=If(e).$implicit,V=yC(3);return wf(V.toggleTool(g))}),Is(2,"span",24),qC(3),pl(),Is(4,"span",20),qC(5," \u25BC "),pl()(),tC(6,Q,4,2,"div",25),pl();}if(n&2){let e=o.$implicit,c=yC(3);JE(),Cg("aria-expanded",c.isToolExpanded(e)),JE(2),Zg(e.name),JE(),Hg("agent-config-inspect__chevron--open",c.isToolExpanded(e)),JE(2),nC(c.isToolExpanded(e)?6:-1);}}function X(n,o){if(n&1&&(Is(0,"ul",18),iC(1,W,7,5,"li",22,F),pl()),n&2){let e=yC();JE(),sC(e.tools);}}function Y(n,o){if(n&1&&(Is(0,"div",8)(1,"section",9)(2,"h2",10),qC(3,"General"),pl(),Is(4,"dl",11)(5,"dt",12),qC(6,"Name"),pl(),Is(7,"dd",13),qC(8),pl(),Is(9,"dt",12),qC(10,"Resolved model"),pl(),Is(11,"dd",14),qC(12),pl(),Is(13,"dt",12),qC(14,"Provider"),pl(),Is(15,"dd",13),qC(16),pl(),Is(17,"dt",12),qC(18,"Advanced execution"),pl(),Is(19,"dd",13)(20,"span",15),qC(21),pl()(),tC(22,j,4,1),pl()(),tC(23,J,7,4,"section",9),tC(24,G,7,4,"section",9),Is(25,"section",9)(26,"h2",10),qC(27," Tools "),Is(28,"span",16),qC(29),pl()(),tC(30,q,2,0,"p",17)(31,X,3,0,"ul",18),pl()()),n&2){let e=o;JE(8),Zg(e.name),JE(4),Zg(e.resolvedModelApiName),JE(4),Zg(e.resolvedProviderName),JE(4),Hg("agent-config-inspect__badge--active",e.advancedExecution),JE(),vl(" ",e.advancedExecution?"Enabled":"Disabled"," "),JE(),nC(e.userId?22:-1),JE(),nC(e.systemPrompt?23:-1),JE(),nC(e.instructions?24:-1),JE(5),vl("(",e.tools.length,")"),JE(),nC(e.tools.length===0?30:31);}}var R=class n{route=g(V);router=g(G$1);destroyRef=g(we);agentConfigController=g(B$1);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=zi(true);hasError=zi(false);definition=zi(null);expandedTools=zi(new Set);systemPromptCollapsed=zi(true);instructionsCollapsed=zi(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=Rw({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&&(Is(0,"div",0)(1,"header",1)(2,"button",2),Ag("click",function(){return c.back()}),Is(3,"span",3),qC(4,"\u2190"),pl(),qC(5," Agent Configs "),pl(),Is(6,"h1",4),qC(7,"Agent definition"),pl(),Is(8,"a",5),qC(9,"Edit config \u2192"),pl()(),tC(10,B,2,0,"p",6)(11,$,2,0,"p",7)(12,Y,32,11,"div",8),pl()),e&2){let g;JE(8),Tg("routerLink",c.editRoute()),JE(2),nC(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 {K as Kn,Z as Zn,S as Se}from'./chunk-
|
|
1
|
+
import {K as Kn,Z as Zn,S as Se}from'./chunk-BESIk8ll.js';import {cb as TB,cc as CB,z as zi,h as Rw,I as Is,q as qC,m as pl,t as tC,J as JE,a8 as Zg,a5 as vl,v as nC,a9 as fC,A as Ag,ac as yC,T as Tg,aa as If,ab as wf}from'./main-4SCUMPDY.js';function A(o,a){if(o&1){let e=fC();Is(0,"span",7),qC(1,"Delete?"),pl(),Is(2,"ds-icon-button",8),Ag("action",function(){If(e);let l=yC();return wf(l.onDeleteConfirmed())}),pl(),Is(3,"ds-icon-button",9),Ag("action",function(){If(e);let l=yC();return wf(l.onDeleteCancelled())}),pl();}}function P(o,a){if(o&1){let e=fC();Is(0,"ds-kebab-menu",10),Ag("itemSelected",function(l){If(e);let O=yC();return wf(O.onMenuAction(l))}),pl();}if(o&2){let e=yC();Tg("items",e.menuItems);}}var I=class o{model=TB.required();namespaceId=TB(void 0);readOnly=TB(false);deleteRequested=CB();editRequested=CB();pendingDelete=zi(false);menuItems=[{key:"edit",label:"Edit model",icon:"edit"},{key:"delete",label:"Delete model",icon:"delete",variant:"danger"}];get displayTitle(){return this.model().alias??this.model().apiModelName}onMenuAction(a){switch(a){case "edit":this.editRequested.emit(this.model());break;case "delete":this.pendingDelete.set(true);break}}onDeleteConfirmed(){this.pendingDelete.set(false),this.deleteRequested.emit(this.model());}onDeleteCancelled(){this.pendingDelete.set(false);}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=Rw({type:o,selectors:[["agentos-ai-model-item"]],inputs:{model:[1,"model"],namespaceId:[1,"namespaceId"],readOnly:[1,"readOnly"]},outputs:{deleteRequested:"deleteRequested",editRequested:"editRequested"},decls:12,vars:4,consts:[["role","listitem","dsBlueprint","",1,"ai-model-item"],[1,"ai-model-item__body"],[1,"ai-model-item__name"],[1,"ai-model-item__api-name"],[1,"ai-model-item__params"],[1,"ai-model-item__actions"],[3,"items"],[1,"ai-model-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,i){e&1&&(Is(0,"div",0)(1,"div",1)(2,"span",2),qC(3),pl(),Is(4,"span",3),qC(5),pl(),Is(6,"span",4)(7,"span"),qC(8),pl()()(),Is(9,"div",5),tC(10,A,4,0)(11,P,1,1,"ds-kebab-menu",6),pl()()),e&2&&(JE(3),Zg(i.displayTitle),JE(2),Zg(i.model().apiModelName),JE(3),vl("priority: ",i.model().priority),JE(2),nC(i.pendingDelete()?10:i.readOnly()?-1:11));},dependencies:[Kn,Zn,Se],styles:[".ai-model-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:14px 16px;position:relative;border-radius:0;border:1px solid var(--color-divider);background:var(--color-bg);box-shadow:var(--shadow-sm);overflow:visible;transition:border-color .15s ease}.ai-model-item[_ngcontent-%COMP%]:hover{border-color:var(--color-accent)}.ai-model-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.ai-model-item__name[_ngcontent-%COMP%]{font-size:15px;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-model-item__api-name[_ngcontent-%COMP%]{font-size:13px;color:var(--color-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-model-item__params[_ngcontent-%COMP%]{display:flex;gap:.75rem;font-size:13px;color:var(--color-text-secondary)}.ai-model-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.ai-model-item[_ngcontent-%COMP%]:hover .ai-model-item__actions[_ngcontent-%COMP%], .ai-model-item[_ngcontent-%COMP%]:focus-within .ai-model-item__actions[_ngcontent-%COMP%]{opacity:1}.ai-model-item__confirm-label[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--red-deep);margin-right:.25rem;white-space:nowrap}"]})};export{I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {I}from'./chunk-
|
|
1
|
+
import {I}from'./chunk-B64oBHQ_.js';import {g,ao as V$1,G as G$1,w as we,de as M,dd as $,aJ as Tr,z as zi,bS as va,S as By,a7 as ya,X as br,u as ue,c as U$1,h as Rw,aK as xb,I as Is,bf as cT,A as Ag,m as pl,af as Dg,r as bC,T as Tg,bg as lT,ah as oT,t as tC,ac as yC,v as nC,a9 as fC,aa as If,ab as wf,ag as pT}from'./main-4SCUMPDY.js';import {W as Wn,S as Se}from'./chunk-BESIk8ll.js';import'./chunk-BSY9MBD-.js';import'./chunk-LgALnta4.js';var K=()=>[];function U(n,o){if(n&1){let i=fC();Is(0,"agentos-ai-model-item",4),Ag("deleteRequested",function(a){If(i);let t=yC(2);return wf(t.deleteModel(a))})("editRequested",function(a){If(i);let t=yC(2);return wf(t.editModel(a))}),pl();}if(n&2){let i=yC().$implicit,e=yC();Tg("model",o)("namespaceId",e.namespaceId)("readOnly",e.isPlatformModel(i.id));}}function j(n,o){if(n&1&&tC(0,U,1,3,"agentos-ai-model-item",3),n&2){let i,e=o.$implicit,a=yC();nC((i=a.resolveModel(e.id))?0:-1,i);}}var G="__platform__",J="Platform (read-only)",V=class n{route=g(V$1);router=g(G$1);destroyRef=g(we);aiModelController=g(M);aiProviderController=g($);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);isLoading=zi(true);data$=this.refresh$.pipe(va(()=>(this.isLoading.set(true),By({namespace:this.aiModelController.listByNamespaceIdAiModel(this.namespaceId),platform:this.aiModelController.listPlatformLevelAiModel().pipe(ya(()=>br([]))),providers:this.aiProviderController.listAiProvider(this.namespaceId)}))));modelItems$=this.data$.pipe(ue(({namespace:o,platform:i,providers:e})=>{let a=new Map(e.map(t=>[t.id??"",t.name]));return [...i.map(t=>({id:t.id??"",name:t.alias??t.apiModelName,description:t.apiModelName,groupKey:G,groupLabel:J})),...o.map(t=>({id:t.id??"",name:t.alias??t.apiModelName,description:t.apiModelName,groupKey:t.aiProviderId,groupLabel:a.get(t.aiProviderId)??t.aiProviderId}))]}));namespaceModelsById=new Map;platformModelsById=new Map;constructor(){this.data$.pipe(U$1(this.destroyRef)).subscribe({next:({namespace:o,platform:i})=>{this.namespaceModelsById=new Map(o.map(e=>[e.id??"",e])),this.platformModelsById=new Map(i.map(e=>[e.id??"",e])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-models","new"]);}editModel(o){this.router.navigate(["/agentos",this.namespaceId,"ai-models",o.id,"edit"]);}deleteModel(o){this.aiModelController.deleteAiModel(o.id??"").pipe(U$1(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolveModel(o){return this.namespaceModelsById.get(o)??this.platformModelsById.get(o)??null}isPlatformModel(o){return this.platformModelsById.has(o)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=Rw({type:n,selectors:[["agentos-namespace-ai-models"]],decls:5,vars:7,consts:[["aiModelItemTpl",""],["title","AI models","emptyMessage","No AI models configured yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"model","namespaceId","readOnly"],[3,"deleteRequested","editRequested","model","namespaceId","readOnly"]],template:function(i,e){if(i&1&&(Is(0,"ds-entity-list",1),cT(1,"async"),Ag("createRequested",function(){return e.openCreateForm()}),Is(2,"ds-icon-button",2),Ag("action",function(){return e.goBack()}),pl()(),Dg(3,j,1,1,"ng-template",null,0,pT)),i&2){let a=bC(4);Tg("items",lT(1,4,e.modelItems$)??oT(6,K))("loading",e.isLoading())("showCreate",true)("itemTemplate",a);}},dependencies:[Wn,I,Se,xb],encapsulation:2})};export{V as NamespaceAiModelsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c}from'./chunk-C2OedcEU.js';import {g,ao as V,G,w as we$1,d8 as B,d9 as Ce$1,da as ge$1,H as Hi,db as He,F,bR as bd,m as mT,Q as By,b as U,a7 as ga,S as ha,z as z$1,a as P,A as Aw,v as vs,k as Ag,W as WC,j as fl,n as eC,X as XE,a5 as yl,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,bk as yh}from'./main-MX6O2FH4.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-CJdqLI4x.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"),fl());}function ue(n,t){n&1&&(vs(0,"span",12),WC(1," Name is required. "),fl());}function fe(n,t){if(n&1&&(vs(0,"p",40),WC(1),fl(),vs(2,"span",13),WC(3,"Agent Config cannot be changed after creation."),fl()),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"),fl(),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),fl()),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),fl()),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."),fl());}function ve(n,t){if(n&1&&(vs(0,"select",42)(1,"option",43),WC(2,"Select an agent config\u2026"),fl(),oC(3,ge,2,2,"option",23,se),fl(),HI(),eC(5,Ce,2,0,"span",12),vs(6,"span",13),WC(7,"Immutable after creation."),fl()),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."),fl());}function be(n,t){if(n&1&&(vs(0,"option",23),WC(1),fl()),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))}),fl(),vs(2,"span",48),WC(3),fl()();}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"),fl(),vs(3,"div",45),oC(4,xe,4,2,"label",46,A),fl(),vs(6,"span",13),WC(7,"Leave empty to run every day of the week."),fl()()),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)."),fl());}function Ee(n,t){n&1&&(vs(0,"span",12),WC(1,"Start date is required."),fl());}function Me(n,t){if(n&1&&(vs(0,"option",23),WC(1),fl()),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."),fl());}function De(n,t){if(n&1&&(vs(0,"div",8)(1,"label",49),WC(2," End date "),vs(3,"span",10),WC(4,"*"),fl()(),bg(5,"input",50),HI(),eC(6,Oe,2,0,"span",12),fl()),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."),fl());}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,"*"),fl()(),bg(5,"input",52),HI(),eC(6,Te,2,0,"span",12),fl()),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),fl()),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,"*"),fl()(),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.'),fl()(),vs(10,"div",8)(11,"label",14),WC(12,"Description"),fl(),bg(13,"input",15),HI(),fl(),vs(14,"div",8)(15,"label",16),WC(16," Agent Config "),vs(17,"span",10),WC(18,"*"),fl()(),eC(19,fe,4,1)(20,he,3,1,"p",13)(21,ve,8,2),fl(),vs(22,"div",8)(23,"label",17),WC(24," Opening message "),vs(25,"span",10),WC(26,"*"),fl()(),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. "),fl()(),vs(31,"fieldset",19)(32,"legend",20),WC(33,"Recurrence"),fl(),vs(34,"div",8)(35,"label",21),WC(36," Unit "),vs(37,"span",10),WC(38,"*"),fl()(),vs(39,"select",22),oC(40,be,2,2,"option",23,A),fl(),HI(),fl(),eC(42,Se,8,0,"div",8),vs(43,"div",8)(44,"label",24),WC(45," Time (UTC) "),vs(46,"span",10),WC(47,"*"),fl()(),vs(48,"div",25),bg(49,"input",26),HI(),vs(50,"span",27),WC(51,"UTC"),fl()(),eC(52,Pe,2,0,"span",12),fl()(),vs(53,"fieldset",19)(54,"legend",20),WC(55,"Planning"),fl(),vs(56,"div",8)(57,"label",28),WC(58," Start date "),vs(59,"span",10),WC(60,"*"),fl()(),bg(61,"input",29),HI(),eC(62,Ee,2,0,"span",12),fl(),vs(63,"div",8)(64,"label",30),WC(65," Ends "),vs(66,"span",10),WC(67,"*"),fl()(),vs(68,"select",31),oC(69,Me,2,2,"option",23,A),fl(),HI(),fl(),eC(71,De,7,4,"div",8),eC(72,we,7,4,"div",8),fl(),vs(73,"div",8)(74,"label",32),bg(75,"input",33),HI(),vs(76,"span",34),WC(77,"Enabled"),fl()(),vs(78,"p",35),WC(79," When disabled, the scheduled prompt is saved but will not run on schedule. "),fl()(),eC(80,ke,2,1,"p",36),vs(81,"div",37)(82,"button",38),WC(83),fl(),vs(84,"button",39),Ag("click",function(){If(e);let h=mC();return wf(h.cancel())}),WC(85,"Cancel"),fl()()();}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(),yl(" ",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(B);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(ge$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(Ce$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=ge$1;SchedulerEndType=Ce$1;schedulerUnits=[{value:ge$1.WEEK,label:"Week(s)"},{value:ge$1.MONTH,label:"Month(s)"}];endTypes=[{value:Ce$1.NEVER,label:"Never"},{value:Ce$1.ON_DATE,label:"On date"},{value:Ce$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(He).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()===ge$1.WEEK);showEndDate=mT(()=>this.endTypeSignal()===Ce$1.ON_DATE);showOccurrenceCount=mT(()=>this.endTypeSignal()===Ce$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(ga(()=>ha([])))}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===Ce$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===Ce$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"),fl(),WC(5),fl(),vs(6,"h1",4),WC(7),fl()(),eC(8,pe,2,0,"p",5)(9,Fe,86,26,"form",6),fl()),e&2&&(XE(5),yl(" ",l.isPlatformMode?"Platform Scheduled Prompts":"Scheduled Prompts"," "),XE(2),yl(" ",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===Ce$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ie(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===Ce$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-Di5brgj6.js';import {g,ao as V,G,w as we$1,d8 as B,d9 as Ce$1,da as ge$1,z as zi,db as He,F,bR as Sd,y as yT,S as By,c as U,a7 as ya,X as br,a as z$1,b as P,h as Rw,I as Is,A as Ag,q as qC,m as pl,t as tC,J as JE,a5 as vl,v as nC,a9 as fC,n as bg,a3 as UI,o as iC,ac as yC,T as Tg,H as Hg,a6 as zI,x as sC,a8 as Zg,aa as If,ab as wf,bk as yh}from'./main-4SCUMPDY.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-LgALnta4.js';var A=(n,t)=>t.value,se=(n,t)=>t.id;function pe(n,t){n&1&&(Is(0,"p",5),qC(1,"Loading\u2026"),pl());}function ue(n,t){n&1&&(Is(0,"span",12),qC(1," Name is required. "),pl());}function fe(n,t){if(n&1&&(Is(0,"p",40),qC(1),pl(),Is(2,"span",13),qC(3,"Agent Config cannot be changed after creation."),pl()),n&2){let e=yC(2);JE(),Zg(e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function _e(n,t){if(n&1&&(Is(0,"a",41),qC(1,"Add an agent config"),pl(),qC(2," first. ")),n&2){let e=yC(3);Tg("href","/agentos/"+e.namespaceId+"/agent-configs/new",yh);}}function he(n,t){if(n&1&&(Is(0,"p",13),qC(1," No agent configs available in this scope yet. "),tC(2,_e,3,1),pl()),n&2){let e=yC(2);JE(2),nC(e.isPlatformMode?-1:2);}}function ge(n,t){if(n&1&&(Is(0,"option",23),qC(1),pl()),n&2){let e=t.$implicit;Tg("value",e.id),JE(),Zg(e.name);}}function Ce(n,t){n&1&&(Is(0,"span",12),qC(1,"Agent Config is required."),pl());}function ve(n,t){if(n&1&&(Is(0,"select",42)(1,"option",43),qC(2,"Select an agent config\u2026"),pl(),iC(3,ge,2,2,"option",23,se),pl(),UI(),tC(5,Ce,2,0,"span",12),Is(6,"span",13),qC(7,"Immutable after creation."),pl()),n&2){let e=yC(2);Tg("formControl",e.agentConfigIdControl),zI(),JE(3),sC(e.availableAgentConfigs()),JE(2),nC(e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?5:-1);}}function ye(n,t){n&1&&(Is(0,"span",12),qC(1,"Opening message is required."),pl());}function be(n,t){if(n&1&&(Is(0,"option",23),qC(1),pl()),n&2){let e=t.$implicit;Tg("value",e.value),JE(),Zg(e.label);}}function xe(n,t){if(n&1){let e=fC();Is(0,"label",46)(1,"input",47),Ag("change",function(){let h=If(e).$implicit,P=yC(3);return wf(P.toggleDay(h.value))}),pl(),Is(2,"span",48),qC(3),pl()();}if(n&2){let e=t.$implicit,l=yC(3);JE(),Tg("checked",l.isDaySelected(e.value)),JE(2),Zg(e.label);}}function Se(n,t){if(n&1&&(Is(0,"div",8)(1,"span",44),qC(2,"Days of week"),pl(),Is(3,"div",45),iC(4,xe,4,2,"label",46,A),pl(),Is(6,"span",13),qC(7,"Leave empty to run every day of the week."),pl()()),n&2){let e=yC(2);JE(4),sC(e.dayOptions);}}function Pe(n,t){n&1&&(Is(0,"span",12),qC(1,"Valid time is required (HH:mm)."),pl());}function Ee(n,t){n&1&&(Is(0,"span",12),qC(1,"Start date is required."),pl());}function Me(n,t){if(n&1&&(Is(0,"option",23),qC(1),pl()),n&2){let e=t.$implicit;Tg("value",e.value),JE(),Zg(e.label);}}function Oe(n,t){n&1&&(Is(0,"span",12),qC(1,"End date is required."),pl());}function De(n,t){if(n&1&&(Is(0,"div",8)(1,"label",49),qC(2," End date "),Is(3,"span",10),qC(4,"*"),pl()(),bg(5,"input",50),UI(),tC(6,Oe,2,0,"span",12),pl()),n&2){let e=yC(2);JE(5),Hg("scheduled-prompt-form__input--invalid",e.form.hasError("endDateRequired")&&e.endDateControl.touched),Tg("formControl",e.endDateControl),zI(),JE(),nC(e.form.hasError("endDateRequired")&&e.endDateControl.touched?6:-1);}}function Te(n,t){n&1&&(Is(0,"span",12),qC(1,"Must be at least 1."),pl());}function we(n,t){if(n&1&&(Is(0,"div",8)(1,"label",51),qC(2," Number of occurrences "),Is(3,"span",10),qC(4,"*"),pl()(),bg(5,"input",52),UI(),tC(6,Te,2,0,"span",12),pl()),n&2){let e=yC(2);JE(5),Hg("scheduled-prompt-form__input--invalid",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched),Tg("formControl",e.occurrenceCountControl),zI(),JE(),nC(e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?6:-1);}}function ke(n,t){if(n&1&&(Is(0,"p",36),qC(1),pl()),n&2){let e=yC(2);JE(),Zg(e.errorMessage());}}function Fe(n,t){if(n&1){let e=fC();Is(0,"form",7),Ag("ngSubmit",function(){If(e);let h=yC();return wf(h.submit())}),Is(1,"div",8)(2,"label",9),qC(3," Name "),Is(4,"span",10),qC(5,"*"),pl()(),bg(6,"input",11),UI(),tC(7,ue,2,0,"span",12),Is(8,"span",13),qC(9,'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.'),pl()(),Is(10,"div",8)(11,"label",14),qC(12,"Description"),pl(),bg(13,"input",15),UI(),pl(),Is(14,"div",8)(15,"label",16),qC(16," Agent Config "),Is(17,"span",10),qC(18,"*"),pl()(),tC(19,fe,4,1)(20,he,3,1,"p",13)(21,ve,8,2),pl(),Is(22,"div",8)(23,"label",17),qC(24," Opening message "),Is(25,"span",10),qC(26,"*"),pl()(),bg(27,"textarea",18),UI(),tC(28,ye,2,0,"span",12),Is(29,"span",13),qC(30," The message sent to the agent when the scheduled prompt fires. "),pl()(),Is(31,"fieldset",19)(32,"legend",20),qC(33,"Recurrence"),pl(),Is(34,"div",8)(35,"label",21),qC(36," Unit "),Is(37,"span",10),qC(38,"*"),pl()(),Is(39,"select",22),iC(40,be,2,2,"option",23,A),pl(),UI(),pl(),tC(42,Se,8,0,"div",8),Is(43,"div",8)(44,"label",24),qC(45," Time (UTC) "),Is(46,"span",10),qC(47,"*"),pl()(),Is(48,"div",25),bg(49,"input",26),UI(),Is(50,"span",27),qC(51,"UTC"),pl()(),tC(52,Pe,2,0,"span",12),pl()(),Is(53,"fieldset",19)(54,"legend",20),qC(55,"Planning"),pl(),Is(56,"div",8)(57,"label",28),qC(58," Start date "),Is(59,"span",10),qC(60,"*"),pl()(),bg(61,"input",29),UI(),tC(62,Ee,2,0,"span",12),pl(),Is(63,"div",8)(64,"label",30),qC(65," Ends "),Is(66,"span",10),qC(67,"*"),pl()(),Is(68,"select",31),iC(69,Me,2,2,"option",23,A),pl(),UI(),pl(),tC(71,De,7,4,"div",8),tC(72,we,7,4,"div",8),pl(),Is(73,"div",8)(74,"label",32),bg(75,"input",33),UI(),Is(76,"span",34),qC(77,"Enabled"),pl()(),Is(78,"p",35),qC(79," When disabled, the scheduled prompt is saved but will not run on schedule. "),pl()(),tC(80,ke,2,1,"p",36),Is(81,"div",37)(82,"button",38),qC(83),pl(),Is(84,"button",39),Ag("click",function(){If(e);let h=yC();return wf(h.cancel())}),qC(85,"Cancel"),pl()()();}if(n&2){let e=yC();Tg("formGroup",e.form),JE(6),Hg("scheduled-prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),Tg("formControl",e.nameControl),zI(),JE(),nC(e.nameControl.invalid&&e.nameControl.touched?7:-1),JE(6),Tg("formControl",e.descriptionControl),zI(),JE(6),nC(e.isEditMode()?19:e.availableAgentConfigs().length===0?20:21),JE(8),Hg("scheduled-prompt-form__textarea--invalid",e.promptContentControl.invalid&&e.promptContentControl.touched),Tg("formControl",e.promptContentControl),zI(),JE(),nC(e.promptContentControl.invalid&&e.promptContentControl.touched?28:-1),JE(11),Tg("formControl",e.unitControl),zI(),JE(),sC(e.schedulerUnits),JE(2),nC(e.showDayFilter()?42:-1),JE(7),Tg("formControl",e.timeUtcControl),zI(),JE(3),nC(e.timeUtcControl.invalid&&e.timeUtcControl.touched?52:-1),JE(9),Hg("scheduled-prompt-form__input--invalid",e.startDateControl.invalid&&e.startDateControl.touched),Tg("formControl",e.startDateControl),zI(),JE(),nC(e.startDateControl.invalid&&e.startDateControl.touched?62:-1),JE(6),Tg("formControl",e.endTypeControl),zI(),JE(),sC(e.endTypes),JE(2),nC(e.showEndDate()?71:-1),JE(),nC(e.showOccurrenceCount()?72:-1),JE(3),Tg("formControl",e.enabledControl),zI(),JE(5),nC(e.errorMessage()?80:-1),JE(2),Tg("disabled",e.form.invalid||e.isSubmitting()),JE(),vl(" ",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(B);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(ge$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(Ce$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=zi(false);isSubmitting=zi(false);isLoading=zi(false);errorMessage=zi(null);SchedulerUnit=ge$1;SchedulerEndType=Ce$1;schedulerUnits=[{value:ge$1.WEEK,label:"Week(s)"},{value:ge$1.MONTH,label:"Month(s)"}];endTypes=[{value:Ce$1.NEVER,label:"Never"},{value:Ce$1.ON_DATE,label:"On date"},{value:Ce$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(He).map(([t,e])=>({value:t,label:e}));unitSignal=F(this.unitControl.valueChanges.pipe(Sd(this.unitControl.value)));endTypeSignal=F(this.endTypeControl.valueChanges.pipe(Sd(this.endTypeControl.value)));showDayFilter=yT(()=>this.unitSignal()===ge$1.WEEK);showEndDate=yT(()=>this.endTypeSignal()===Ce$1.ON_DATE);showOccurrenceCount=yT(()=>this.endTypeSignal()===Ce$1.OCCURRENCES);agentConfigs=zi([]);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(ya(()=>br([])))}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===Ce$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===Ce$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=Rw({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&&(Is(0,"div",0)(1,"header",1)(2,"button",2),Ag("click",function(){return l.cancel()}),Is(3,"span",3),qC(4,"\u2190"),pl(),qC(5),pl(),Is(6,"h1",4),qC(7),pl()(),tC(8,pe,2,0,"p",5)(9,Fe,86,26,"form",6),pl()),e&2&&(JE(5),vl(" ",l.isPlatformMode?"Platform Scheduled Prompts":"Scheduled Prompts"," "),JE(2),vl(" ",l.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"," "),JE(),nC(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===Ce$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ie(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===Ce$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};
|