@whoz-oss/coday-client 0.0.0-workstream-forge.328 → 0.0.0-workstream-forge.330

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/browser/{chunk-C_tG-O6X.js → chunk-B1PSn9Vo.js} +1 -1
  2. package/browser/{chunk-D6j56Kh6.js → chunk-B2L2kvLq.js} +1 -1
  3. package/browser/{chunk-DGvA9EMF.js → chunk-BJSkFaiH.js} +1 -1
  4. package/browser/{chunk-YwnuVV6j.js → chunk-BXy0XrJ7.js} +1 -1
  5. package/browser/{chunk-BiC6IJLJ.js → chunk-Bl1Jy9cH.js} +1 -1
  6. package/browser/{chunk-B6QDDnOW.js → chunk-BlRwzjFw.js} +1 -1
  7. package/browser/{chunk-mVP550cv.js → chunk-Bp_blBHP.js} +1 -1
  8. package/browser/{chunk-CZPehjGB.js → chunk-Br-wGpbZ.js} +1 -1
  9. package/browser/{chunk-d7qpGlVe.js → chunk-BrcOBDRd.js} +1 -1
  10. package/browser/{chunk-BNwyfYSr.js → chunk-BzLz9Mg9.js} +1 -1
  11. package/browser/chunk-C8HHjL6L.js +1 -0
  12. package/browser/{chunk-ChwyhN7l.js → chunk-CGWRFT9M.js} +1 -1
  13. package/browser/{chunk-B_HwXrtQ.js → chunk-CHPBPjc7.js} +1 -1
  14. package/browser/chunk-CUGm4nCg.js +1 -0
  15. package/browser/chunk-CYWAQOjO.js +1 -0
  16. package/browser/{chunk-Bmt85b9e.js → chunk-CZcM0Sjp.js} +1 -1
  17. package/browser/{chunk-CpC2V56W.js → chunk-Cpqn5pZ4.js} +1 -1
  18. package/browser/{chunk-GWxavAtB.js → chunk-Cql1YU1b.js} +1 -1
  19. package/browser/{chunk-BKQaiiDm.js → chunk-CsR6DO0s.js} +1 -1
  20. package/browser/{chunk-e5qg27G2.js → chunk-CunO3NfH.js} +1 -1
  21. package/browser/{chunk-C0Lw7VMt.js → chunk-CxV0A3YW.js} +1 -1
  22. package/browser/{chunk-DZp724cW.js → chunk-Cy7RQh_n.js} +1 -1
  23. package/browser/{chunk-BtllBdOZ.js → chunk-DF9MTUxe.js} +1 -1
  24. package/browser/{chunk-B4QJcXnP.js → chunk-DI1Ofx5C.js} +1 -1
  25. package/browser/{chunk-CoPRV7_K.js → chunk-DIb4BOjN.js} +1 -1
  26. package/browser/{chunk-BX0TCJGF.js → chunk-DLw7Yxnr.js} +1 -1
  27. package/browser/{chunk-BzCl7uMh.js → chunk-DRBlC7Dh.js} +1 -1
  28. package/browser/{chunk-JrGCfHkP.js → chunk-DTSUiMvP.js} +1 -1
  29. package/browser/{chunk-BJB2wYDC.js → chunk-DXEGVZ5g.js} +1 -1
  30. package/browser/{chunk-V5vAYMRr.js → chunk-DXif4PCM.js} +1 -1
  31. package/browser/{chunk-B6sYf1j_.js → chunk-DbPMcsRl.js} +1 -1
  32. package/browser/{chunk-Cdygrlhj.js → chunk-DbVcBI5h.js} +1 -1
  33. package/browser/{chunk-Dt0eIaud.js → chunk-DfkL0d-F.js} +1 -1
  34. package/browser/{chunk-DHPXIsXJ.js → chunk-DuXyP0Ap.js} +1 -1
  35. package/browser/{chunk-CzNxwmwF.js → chunk-EjwZJyua.js} +1 -1
  36. package/browser/chunk-P1kjpuYu.js +855 -0
  37. package/browser/{chunk-D0iMXAi6.js → chunk-TLD8l1O4.js} +1 -1
  38. package/browser/{chunk-rvd0XXmM.js → chunk-Vj6PaaqT.js} +1 -1
  39. package/browser/{chunk-NSyXB8Tu.js → chunk-W17CbVUg.js} +1 -1
  40. package/browser/{chunk-BQgwuEVI.js → chunk-Yv3pJ6Y8.js} +1 -1
  41. package/browser/{chunk-CDqiY5Rf.js → chunk-aH3HwIDf.js} +1 -1
  42. package/browser/{chunk-D0BRxefp.js → chunk-j1O2PWZu.js} +1 -1
  43. package/browser/{chunk-CjbU1hmS.js → chunk-lLZuYwL0.js} +1 -1
  44. package/browser/{chunk-DiQNvMeR.js → chunk-mg2KQsdS.js} +1 -1
  45. package/browser/{chunk-EZsHLrVl.js → chunk-tcVMGkY_.js} +1 -1
  46. package/browser/{chunk-NNFw4bVT.js → chunk-wJQDNmya.js} +1 -1
  47. package/browser/{chunk-Cp6XPrd_.js → chunk-wNQndqtu.js} +1 -1
  48. package/browser/index.html +1 -1
  49. package/browser/{main-6TWWBEJW.js → main-K3GOQJ4U.js} +13 -13
  50. package/package.json +1 -1
  51. package/browser/chunk-BNW_UB32.js +0 -1
  52. package/browser/chunk-CG27SgJm.js +0 -1
  53. package/browser/chunk-DQ809zoB.js +0 -1
  54. package/browser/chunk-VbI0SYDI.js +0 -855
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whoz-oss/coday-client",
3
- "version": "0.0.0-workstream-forge.328",
3
+ "version": "0.0.0-workstream-forge.330",
4
4
  "repository": "https://github.com/whoz-oss/coday",
5
5
  "type": "module",
6
6
  "dependencies": {
@@ -1 +0,0 @@
1
- import {c}from'./chunk-mVP550cv.js';import {p as pt,T as Te$1,b as bn,K as Kt,a as fd,M as Mo,D as Do,U as Ut,P as Pn,o as Mn,Q as Qt,c as fo,g as go,t as ta,N as Nn,R as Rn,v as vn,d as yn,e as fn,l as pn,h as hn,_ as _n,i as at,u as un,n as cn}from'./chunk-VbI0SYDI.js';import {g,W,F,J as we$1,ai as U,aj as Ge,ak as We,z as zi,al as _e$1,ab as F$1,am as Dd,k as yT,ae as Ny,M as U$1,a2 as ga,ac as _r,P as x,O as w,x as xw,I as Is,S as Eg,U as UC,m as ml,Q as Qw,K as KE,R as pg,q as Il,b as Kw,s as aC,a as hg,T as VI,l as eC,r as fC,X as UI,t as tC,L as Lg,u as mf,w as yf,C as ch}from'./main-6TWWBEJW.js';var V=(n,t)=>t.value,ve=(n,t)=>t.id;function be(n,t){n&1&&(Is(0,"p",2),UC(1,"Loading\u2026"),ml());}function _e(n,t){if(n&1&&(Is(0,"ds-form-field",9),hg(1,"input",38),ml()),n&2){let e=fC(2);KE(),pg("value",e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function Se(n,t){if(n&1&&(Is(0,"a",39),UC(1,"Add an agent config"),ml(),UC(2," first. ")),n&2){let e=fC(3);pg("href","/agentos/"+e.namespaceId+"/agent-configs/new",ch);}}function xe(n,t){if(n&1&&(Is(0,"ds-form-field",10)(1,"p",2),UC(2," No agent configs available in this scope yet. "),Qw(3,Se,3,1),ml()()),n&2){let e=fC(2);KE(3),Kw(e.isPlatformMode?-1:3);}}function Ee(n,t){if(n&1&&(Is(0,"option",17),UC(1),ml()),n&2){let e=t.$implicit;pg("value",e.id),KE(),Lg(e.name);}}function De(n,t){if(n&1&&(Is(0,"ds-form-field",11)(1,"select",40)(2,"option",41),UC(3,"Select an agent config\u2026"),ml(),eC(4,Ee,2,2,"option",17,ve),ml(),VI(),ml()),n&2){let e=fC(2);pg("error",e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?"Agent Config is required.":null),KE(),pg("formControl",e.agentConfigIdControl),UI(),KE(3),tC(e.availableAgentConfigs());}}function Te(n,t){if(n&1&&(Is(0,"option",17),UC(1),ml()),n&2){let e=t.$implicit;pg("value",e.value),KE(),Lg(e.label);}}function Ne(n,t){if(n&1){let e=aC();Is(0,"label",31)(1,"input",43),Eg("change",function(){let f=mf(e).$implicit,h=fC(3);return yf(h.toggleDay(f.value))}),ml(),UC(2),ml();}if(n&2){let e=t.$implicit,l=fC(3);KE(),pg("checked",l.isDaySelected(e.value)),KE(),Il(" ",e.label," ");}}function Ie(n,t){if(n&1&&(Is(0,"ds-form-field",18)(1,"div",42),eC(2,Ne,3,2,"label",31,V),ml()()),n&2){let e=fC(2);KE(2),tC(e.dayOptions);}}function Me(n,t){if(n&1&&(Is(0,"option",17),UC(1),ml()),n&2){let e=t.$implicit;pg("value",e.value),KE(),Lg(e.label);}}function Pe(n,t){if(n&1&&(Is(0,"ds-form-field",28),hg(1,"input",44),VI(),ml()),n&2){let e=fC(2);pg("error",e.form.hasError("endDateRequired")&&e.endDateControl.touched?"End date is required.":null),KE(),pg("formControl",e.endDateControl),UI();}}function we(n,t){if(n&1&&(Is(0,"ds-form-field",29),hg(1,"input",45),VI(),ml()),n&2){let e=fC(2);pg("error",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?"Must be at least 1.":null),KE(),pg("formControl",e.occurrenceCountControl),UI();}}function Fe(n,t){if(n&1&&(Is(0,"ds-notice"),UC(1),ml()),n&2){let e=fC(2);KE(),Lg(e.errorMessage());}}function Oe(n,t){if(n&1){let e=aC();Is(0,"form",4),Eg("ngSubmit",function(){mf(e);let f=fC();return yf(f.submit())}),Is(1,"ds-form-field",5),hg(2,"input",6),VI(),ml(),Is(3,"ds-form-field",7),hg(4,"input",8),VI(),ml(),Qw(5,_e,2,1,"ds-form-field",9)(6,xe,4,1,"ds-form-field",10)(7,De,6,2,"ds-form-field",11),Is(8,"ds-form-field",12),hg(9,"textarea",13),VI(),ml(),Is(10,"ds-fieldset",14)(11,"ds-form-field",15)(12,"select",16),eC(13,Te,2,2,"option",17,V),ml(),VI(),ml(),Qw(15,Ie,4,0,"ds-form-field",18),Is(16,"ds-form-field",19)(17,"div",20),hg(18,"input",21),VI(),Is(19,"span",22),UC(20,"UTC"),ml()()()(),Is(21,"ds-fieldset",23)(22,"ds-form-field",24),hg(23,"input",25),VI(),ml(),Is(24,"ds-form-field",26)(25,"select",27),eC(26,Me,2,2,"option",17,V),ml(),VI(),ml(),Qw(28,Pe,2,2,"ds-form-field",28),Qw(29,we,2,2,"ds-form-field",29),ml(),Is(30,"div",30)(31,"label",31),hg(32,"input",32),VI(),UC(33," Enabled "),ml(),Is(34,"p",33),UC(35,"When disabled, the scheduled prompt is saved but will not run on schedule."),ml()(),Is(36,"ds-form-field",34),hg(37,"textarea",35),VI(),ml(),Qw(38,Fe,2,1,"ds-notice"),Is(39,"ds-form-actions")(40,"button",36),UC(41),ml(),Is(42,"button",37),Eg("click",function(){mf(e);let f=fC();return yf(f.cancel())}),UC(43,"Cancel"),ml()()();}if(n&2){let e=fC();pg("formGroup",e.form),KE(),pg("error",e.nameControl.invalid&&e.nameControl.touched?"Name is required.":null),KE(),pg("formControl",e.nameControl),UI(),KE(2),pg("formControl",e.descriptionControl),UI(),KE(),Kw(e.isEditMode()?5:e.availableAgentConfigs().length===0?6:7),KE(3),pg("error",e.promptContentControl.invalid&&e.promptContentControl.touched?"Opening message is required.":null),KE(),pg("formControl",e.promptContentControl),UI(),KE(3),pg("formControl",e.unitControl),UI(),KE(),tC(e.schedulerUnits),KE(2),Kw(e.showDayFilter()?15:-1),KE(),pg("error",e.timeUtcControl.invalid&&e.timeUtcControl.touched?"Valid time is required (HH:mm).":null),KE(2),pg("formControl",e.timeUtcControl),UI(),KE(4),pg("error",e.startDateControl.invalid&&e.startDateControl.touched?"Start date is required.":null),KE(),pg("formControl",e.startDateControl),UI(),KE(2),pg("formControl",e.endTypeControl),UI(),KE(),tC(e.endTypes),KE(2),Kw(e.showEndDate()?28:-1),KE(),Kw(e.showOccurrenceCount()?29:-1),KE(3),pg("formControl",e.enabledControl),UI(),KE(4),pg("error",e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?"Invalid JSON.":null),KE(),pg("formControl",e.externalMetadataJsonControl),UI(),KE(),Kw(e.errorMessage()?38:-1),KE(2),pg("disabled",e.form.invalid||e.isSubmitting()),KE(),Il(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var ye=class n{route=g(W);router=g(F);destroyRef=g(we$1);state=g(c);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new pt({name:new Te$1("",{nonNullable:true,validators:[bn.required]}),description:new Te$1(null),agentConfigId:new Te$1("",{nonNullable:true,validators:[bn.required]}),promptContent:new Te$1("",{nonNullable:true,validators:[bn.required]}),unit:new Te$1(We.WEEK,{nonNullable:true,validators:[bn.required]}),days:new Te$1([],{nonNullable:true}),timeUtc:new Te$1("09:00",{nonNullable:true,validators:[bn.required,bn.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new Te$1("",{nonNullable:true,validators:[bn.required]}),endType:new Te$1(Ge.NEVER,{nonNullable:true,validators:[bn.required]}),endDate:new Te$1(null),occurrenceCount:new Te$1(null),enabled:new Te$1(true,{nonNullable:true}),externalMetadataJson:new Te$1("",{nonNullable:true,validators:[ke]})},{validators:[Ae,Ve]});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}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);errorMessage=zi(null);SchedulerUnit=We;SchedulerEndType=Ge;schedulerUnits=[{value:We.WEEK,label:"Week(s)"},{value:We.MONTH,label:"Month(s)"}];endTypes=[{value:Ge.NEVER,label:"Never"},{value:Ge.ON_DATE,label:"On date"},{value:Ge.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(_e$1).map(([t,e])=>({value:t,label:e}));unitSignal=F$1(this.unitControl.valueChanges.pipe(Dd(this.unitControl.value)));endTypeSignal=F$1(this.endTypeControl.valueChanges.pipe(Dd(this.endTypeControl.value)));showDayFilter=yT(()=>this.unitSignal()===We.WEEK);showEndDate=yT(()=>this.endTypeSignal()===Ge.ON_DATE);showOccurrenceCount=yT(()=>this.endTypeSignal()===Ge.OCCURRENCES);agentConfigs=zi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Re());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(true),this.loadPromptAndResources(t)):this.loadResources();}loadPromptAndResources(t){this.isLoading.set(true),Ny({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U$1(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$1(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(ga(()=>_r([])))}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),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,l=e.includes(t)?e.filter(f=>f!==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=x(w({},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===Ge.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===Ge.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value,removed:this.existingPrompt?.removed??false,externalMetadata:(()=>{let h=this.externalMetadataJsonControl.value.trim();return h?JSON.parse(h):null})()});(t?this.state.update(this.existingPrompt.id,l):this.state.create(l)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:h=>{this.isSubmitting.set(false),h.status===409?this.errorMessage.set(`A scheduled prompt named "${l.name}" already exists in this scope.`):h.status===400?this.errorMessage.set(h.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=xw({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:6,vars:3,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to scheduled prompts",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","sp-name","required","","hint",'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.',3,"error"],["dsControl","","id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",3,"formControl"],["label","Description","controlId","sp-description"],["dsControl","","id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",3,"formControl"],["label","Agent Config","required","","hint","Agent Config cannot be changed after creation."],["label","Agent Config","required",""],["label","Agent Config","controlId","sp-agent-config","required","","hint","Immutable after creation.",3,"error"],["label","Opening message","controlId","sp-prompt-content","required","","hint","The message sent to the agent when the scheduled prompt fires.",3,"error"],["dsControl","","id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",3,"formControl"],["legend","Recurrence"],["label","Unit","controlId","sp-unit","required",""],["dsControl","","id","sp-unit",3,"formControl"],[3,"value"],["label","Days of week","hint","Leave empty to run every day of the week."],["label","Time (UTC)","controlId","sp-time","required","",3,"error"],[1,"ds-inline"],["dsControl","","id","sp-time","type","time",3,"formControl"],[1,"ds-meta"],["legend","Planning"],["label","Start date","controlId","sp-start-date","required","",3,"error"],["dsControl","","id","sp-start-date","type","date",3,"formControl"],["label","Ends","controlId","sp-end-type","required",""],["dsControl","","id","sp-end-type",3,"formControl"],["label","End date","controlId","sp-end-date","required","",3,"error"],["label","Number of occurrences","controlId","sp-occurrence-count","required","",3,"error"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox",3,"formControl"],[1,"ds-hint","ds-indent"],["label","External Metadata","controlId","sp-external-metadata","hint","Optional. Opaque JSON object stored as-is. Leave empty to clear.",3,"error"],["dsControl","","mono","","id","sp-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",3,"formControl"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"],["dsControl","","type","text","readonly","",3,"value"],[3,"href"],["dsControl","","id","sp-agent-config",3,"formControl"],["value","","disabled",""],[1,"ds-inline","ds-inline--wrap"],["type","checkbox",3,"change","checked"],["dsControl","","id","sp-end-date","type","date",3,"formControl"],["dsControl","","id","sp-occurrence-count","type","number","min","1",1,"ds-control--narrow",3,"formControl"]],template:function(e,l){e&1&&(Is(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),Eg("click",function(){return l.cancel()}),UC(3),ml()(),Qw(4,be,2,0,"p",2)(5,Oe,44,22,"form",3),ml()),e&2&&(KE(),pg("title",l.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"),KE(2),Il(" \u2190 ",l.isPlatformMode?"Platform scheduled prompts":"Scheduled prompts"," "),KE(),Kw(l.isLoading()?4:5));},dependencies:[Kt,fd,Mo,Do,Ut,Pn,Mn,Qt,fo,go,ta,Nn,Rn,vn,yn,fn,pn,hn,_n,at,un,cn],encapsulation:2})};function Ae(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===Ge.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===Ge.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function ke(n){let t=n.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}function Re(){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{ye as ScheduledPromptFormComponent};
@@ -1 +0,0 @@
1
- import {a1 as ma,a2 as ga,ac as _r,aG as Jy}from'./main-6TWWBEJW.js';function i(t,o,p){return t.pipe(ma(()=>o().pipe(ga(()=>_r(p)))),Jy({bufferSize:1,refCount:true}))}export{i};
@@ -1 +0,0 @@
1
- import {i}from'./chunk-CG27SgJm.js';import {y}from'./chunk-VbI0SYDI.js';import {g,aF as Z,$ as Sr,au as _y,a1 as ma,a2 as ga,ac as _r,af as ne,aG as Jy,P as x,O as w$1,a7 as Ed,aH as an,aI as Ot,aJ as cn,a8 as A}from'./main-6TWWBEJW.js';var nt=["ApiKeyAuthSetting","BasicAuthAuthSetting","BearerTokenAuthSetting","OAuthDiscoverableAuthSetting","OAuthMcpDiscoverableAuthSetting","OAuthCustomAuthSetting","OAuthRegisteredAuthSetting"],it={ApiKeyAuthSetting:"API Key",BasicAuthAuthSetting:"Basic Auth (username / password)",BearerTokenAuthSetting:"Bearer Token",OAuthDiscoverableAuthSetting:"OAuth \u2014 Discovery URL",OAuthMcpDiscoverableAuthSetting:"OAuth \u2014 MCP Discoverable",OAuthCustomAuthSetting:"OAuth \u2014 Custom endpoints",OAuthRegisteredAuthSetting:"OAuth \u2014 Registered app"},R="none",w="me",b=2e3,M=15e4,P=3,L={ApiKeyAuthSetting:"API_KEY",BasicAuthAuthSetting:"BASIC_AUTH",BearerTokenAuthSetting:"BEARER_TOKEN",OAuthDiscoverableAuthSetting:"OAUTH_DISCOVERABLE",OAuthMcpDiscoverableAuthSetting:"OAUTH_MCP_DISCOVERABLE",OAuthCustomAuthSetting:"OAUTH_CUSTOM",OAuthRegisteredAuthSetting:"OAUTH_REGISTERED"},k={API_KEY:"ApiKeyAuthSetting",BASIC_AUTH:"BasicAuthAuthSetting",BEARER_TOKEN:"BearerTokenAuthSetting",OAUTH_DISCOVERABLE:"OAuthDiscoverableAuthSetting",OAUTH_MCP_DISCOVERABLE:"OAuthMcpDiscoverableAuthSetting",OAUTH_CUSTOM:"OAuthCustomAuthSetting",OAUTH_REGISTERED:"OAuthRegisteredAuthSetting"};function B(i){let t=L[i.authType];return t?x(w$1({},i),{authType:t}):i}function m(i){return U(i)}function f(i){return i.map(U)}function U(i){let t=i;if(typeof t.authType=="string"){let e=k[t.authType];if(e)return x(w$1({},t),{authType:e})}return i}function H(i,t){return t===null?true:i!==void 0&&Date.parse(i)>Date.parse(t)}var I=class i$1{controller=g(Z);userState=g(y);refresh$=new Sr(void 0);namespaceId$=new Sr(null);vm$=_y([this.namespaceId$,this.refresh$]).pipe(ma(([t])=>{let e=this.loadPlatformSettings().pipe(ga(()=>_r([])));return t?_y([e,this.loadNamespaceSettings(t).pipe(ga(()=>_r([]))),this.loadUserSettings(t).pipe(ga(()=>_r([]))),this.loadUserSettings("global").pipe(ga(()=>_r([])))]).pipe(ne(([n,o,r,h])=>({platform:n,namespace:o,userOnNs:r,userGlobal:h}))):_y([e,this.loadNamespaceSettings("").pipe(ga(()=>_r([]))),this.loadUserSettings("global").pipe(ga(()=>_r([])))]).pipe(ne(([n,o,r])=>({platform:n,namespace:o,userOnNs:[],userGlobal:r})))}),Jy({bufferSize:1,refCount:true}));setNamespace(t){this.namespaceId$.value!==t&&this.namespaceId$.next(t);}refresh(){this.refresh$.next();}loadUserSettings(t){let e=t==="global"?R:t;return this.controller.listAuthSetting(e,w).pipe(ne(n=>f(n)))}userGlobal$=i(this.refresh$,()=>this.loadUserSettings("global"),[]);loadPlatformSettings(){return this.controller.listAuthSetting(R).pipe(ne(t=>f(t)))}loadNamespaceSettings(t){return t?this.controller.listAuthSetting(t).pipe(ne(e=>f(e))):_r([])}getById(t,e){return this.controller.getByIdAuthSetting(t).pipe(ne(n=>m(n)))}create(t,e,n){let r=this.userState.currentUser()?.id;if((e==="userOnNs"||e==="userGlobal")&&!r)throw new Error(`Cannot create ${e} auth setting before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(e==="namespace"&&(n===void 0||n===""))throw new Error("Cannot create namespace-scoped auth setting without a namespaceId");if(e==="userOnNs"&&!n)throw new Error("Cannot create userOnNs auth setting without a namespaceId");let h=B(x(w$1({},t),{namespaceId:e==="namespace"||e==="userOnNs"?n??void 0:void 0,userId:e==="userOnNs"||e==="userGlobal"?r:void 0}));return this.controller.createAuthSetting(h).pipe(ne(A=>m(A)),Ed(()=>this.refresh()))}update(t,e,n){let o=B(x(w$1({},e),{namespaceId:n.namespaceId,userId:n.userId,authType:n.authType}));return this.controller.updateAuthSetting(t,o).pipe(ne(r=>m(r)),Ed(()=>this.refresh()))}delete(t,e){return this.controller.deleteAuthSetting(t).pipe(Ed(()=>this.refresh()))}getConnection(t,e){return this.controller.getConnectionAuthSetting(t,e)}resetCredential(t,e){return this.controller.resetMyCredentialAuthSetting(t,e)}connect(t,e,n,o){return this.getConnection(t,e).pipe(ma(r=>this.controller.connectAuthSetting(t,e).pipe(Ed(h=>n(h.authorizationUrl)),ma(()=>this.awaitNewConnection(t,e,r.connected?r.connectedAt??null:null,o)))))}awaitNewConnection(t,e,n,o){let r=0,h=0;return an(b,b).pipe(ma(()=>this.getConnection(t,e).pipe(ga(()=>_r(null)))),ne(A=>(r++,A?.connected&&H(A.connectedAt,n)?"connected":r*b>=M?"timeout":o()&&++h>=P?"abandoned":null)),Ot(A=>A!==null),cn(1))}static \u0275fac=function(e){return new(e||i$1)};static \u0275prov=A({token:i$1,factory:i$1.\u0275fac,providedIn:"root"})};export{I,it as i,nt as n};