@whoz-oss/coday-client 0.85.0 → 0.87.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.
Files changed (36) hide show
  1. package/3rdpartylicenses.txt +2 -2
  2. package/browser/{chunk-TOMK63FE.js → chunk-6DFCBHHF.js} +1 -1
  3. package/browser/chunk-AYUFWSWZ.js +1 -0
  4. package/browser/chunk-E3T5JJR5.js +1 -0
  5. package/browser/chunk-GBTE3TIN.js +1 -0
  6. package/browser/chunk-KBLUNDHF.js +1 -0
  7. package/browser/{chunk-64ZRWATH.js → chunk-NFPIT5IF.js} +1 -1
  8. package/browser/chunk-NYZS626O.js +1 -0
  9. package/browser/chunk-ODM275WP.js +1 -0
  10. package/browser/chunk-P3BYIXZM.js +1 -0
  11. package/browser/chunk-QITHUHCN.js +1 -0
  12. package/browser/chunk-VEM5V6G6.js +1 -0
  13. package/browser/chunk-WEVA7DKF.js +1 -0
  14. package/browser/chunk-WG23DARU.js +5 -0
  15. package/browser/chunk-WSC62DRG.js +1 -0
  16. package/browser/chunk-XR7PEJ4F.js +1 -0
  17. package/browser/{chunk-TYN7G4PU.js → chunk-Y5DXUE3H.js} +1 -1
  18. package/browser/{chunk-LOONCJBU.js → chunk-ZWSN3GAA.js} +1 -1
  19. package/browser/index.html +2 -2
  20. package/browser/main-2PDLAJ3P.js +377 -0
  21. package/browser/styles-I3V5BO4R.css +1 -0
  22. package/package.json +1 -1
  23. package/browser/chunk-3I3KTCJW.js +0 -1
  24. package/browser/chunk-6U5IOML5.js +0 -1
  25. package/browser/chunk-75SUNMNL.js +0 -1
  26. package/browser/chunk-GNNRWNIY.js +0 -1
  27. package/browser/chunk-HV577N5Z.js +0 -1
  28. package/browser/chunk-J577MYXL.js +0 -1
  29. package/browser/chunk-JJVDNH6V.js +0 -1
  30. package/browser/chunk-LU3TJP27.js +0 -5
  31. package/browser/chunk-NLYUDEOW.js +0 -1
  32. package/browser/chunk-OXQ5NGLD.js +0 -1
  33. package/browser/chunk-WWXMC743.js +0 -1
  34. package/browser/chunk-YELZ433M.js +0 -1
  35. package/browser/main-JYZJSM5L.js +0 -377
  36. package/browser/styles-VBFEGZOM.css +0 -1
@@ -752,7 +752,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
752
752
  SOFTWARE.
753
753
 
754
754
  --------------------------------------------------------------------------------
755
- Package: @angular/forms
755
+ Package: @angular/core
756
756
  License: "MIT"
757
757
 
758
758
  The MIT License
@@ -778,7 +778,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
778
778
  THE SOFTWARE.
779
779
 
780
780
  --------------------------------------------------------------------------------
781
- Package: @angular/core
781
+ Package: @angular/forms
782
782
  License: "MIT"
783
783
 
784
784
  The MIT License
@@ -1 +1 @@
1
- import{Aa as t,Ya as o,lc as r}from"./chunk-LU3TJP27.js";var s=class n{static \u0275fac=function(e){return new(e||n)};static \u0275cmp=t({type:n,selectors:[["agentos-shell"]],decls:1,vars:0,template:function(e,i){e&1&&o(0,"router-outlet")},dependencies:[r],styles:[".shell-loader[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100vh;gap:1rem;color:var(--color-text-secondary, #6e6e73);font-size:.9rem}.shell-loader[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.spinner[_ngcontent-%COMP%]{width:32px;height:32px;border:3px solid var(--color-border, rgba(0, 0, 0, .1));border-top-color:var(--color-primary, #007aff);border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}"]})};export{s as a};
1
+ import{Aa as t,Ya as o,mc as r}from"./chunk-WG23DARU.js";var s=class n{static \u0275fac=function(e){return new(e||n)};static \u0275cmp=t({type:n,selectors:[["agentos-shell"]],decls:1,vars:0,template:function(e,i){e&1&&o(0,"router-outlet")},dependencies:[r],styles:[".shell-loader[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100vh;gap:1rem;color:var(--color-text-secondary, #6e6e73);font-size:.9rem}.shell-loader[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.spinner[_ngcontent-%COMP%]{width:32px;height:32px;border:3px solid var(--color-border, rgba(0, 0, 0, .1));border-top-color:var(--color-primary, #007aff);border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}"]})};export{s as a};
@@ -0,0 +1 @@
1
+ import{b as a}from"./chunk-E3T5JJR5.js";import"./chunk-QITHUHCN.js";import"./chunk-Y5DXUE3H.js";import"./chunk-GBTE3TIN.js";import"./chunk-WG23DARU.js";export{a as NamespaceListComponent};
@@ -0,0 +1 @@
1
+ import{B as J,a as S,e as A,g as v,i as j,j as G,l as h,n as U,r as H}from"./chunk-QITHUHCN.js";import{S as E}from"./chunk-Y5DXUE3H.js";import{c as B}from"./chunk-GBTE3TIN.js";import{Aa as y,Db as q,Eb as F,Ha as w,J as k,Oa as I,Pa as u,Qa as C,T as N,Ta as L,Ua as R,Va as f,Wa as o,X as l,Xa as r,Y as m,Ya as V,_b as z,a as D,b as P,ba as T,bb as b,db as d,fa as g,fb as s,h as O,nc as $,sa as c,tb as p,ub as x}from"./chunk-WG23DARU.js";function X(i,t){if(i&1&&(o(0,"span",3),p(1),r()),i&2){let e=s();c(),x(e.namespace.description)}}function Y(i,t){if(i&1){let e=b();o(0,"span",5),p(1,"Delete?"),r(),o(2,"ds-icon-button",6),d("action",function(){l(e);let n=s();return m(n.onDeleteConfirmed())}),r(),o(3,"ds-icon-button",7),d("action",function(){l(e);let n=s();return m(n.onDeleteCancelled())}),r()}}function Z(i,t){if(i&1){let e=b();o(0,"ds-icon-button",8),d("action",function(){l(e);let n=s();return m(n.onEdit())}),r(),o(1,"ds-icon-button",9),d("action",function(){l(e);let n=s();return m(n.onDeleteArmed())}),r()}}var M=class i{namespace;selected=new w;editRequested=new w;deleteRequested=new w;pendingDelete=g(!1);onSelect(){this.selected.emit(this.namespace)}onEdit(){this.editRequested.emit(this.namespace)}onDeleteArmed(){this.pendingDelete.set(!0)}onDeleteConfirmed(){this.pendingDelete.set(!1),this.deleteRequested.emit(this.namespace)}onDeleteCancelled(){this.pendingDelete.set(!1)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=y({type:i,selectors:[["agentos-namespace-item"]],inputs:{namespace:"namespace"},outputs:{selected:"selected",editRequested:"editRequested",deleteRequested:"deleteRequested"},decls:8,vars:3,consts:[["role","listitem",1,"namespace-item"],["type","button",1,"namespace-item__body",3,"click"],[1,"namespace-item__name"],[1,"namespace-item__desc"],[1,"namespace-item__actions"],[1,"namespace-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],["icon","edit","title","Edit namespace",3,"action"],["icon","delete","variant","danger","title","Delete namespace",3,"action"]],template:function(e,a){e&1&&(o(0,"div",0)(1,"button",1),d("click",function(){return a.onSelect()}),o(2,"span",2),p(3),r(),u(4,X,2,1,"span",3),r(),o(5,"div",4),u(6,Y,4,0)(7,Z,2,0),r()()),e&2&&(c(3),x(a.namespace.name),c(),C(a.namespace.description?4:-1),c(2),C(a.pendingDelete()?6:7))},dependencies:[E],styles:[".namespace-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:10px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));transition:background .15s ease,border-color .15s ease}.namespace-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.namespace-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;align-items:flex-start;gap:.2rem;background:none;border:none;padding:0;cursor:pointer;text-align:left;min-width:0}.namespace-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.namespace-item__desc[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.namespace-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.namespace-item[_ngcontent-%COMP%]:hover .namespace-item__actions[_ngcontent-%COMP%], .namespace-item[_ngcontent-%COMP%]:focus-within .namespace-item__actions[_ngcontent-%COMP%]{opacity:1}.namespace-item__confirm-label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:500;color:var(--color-error, #ff3b30);margin-right:.25rem;white-space:nowrap}"],changeDetection:0})};function ee(i,t){if(i&1){let e=b();o(0,"form",5),d("ngSubmit",function(){l(e);let n=s();return m(n.submitCreate())}),V(1,"input",6)(2,"input",7),o(3,"div",8)(4,"ds-icon-button",9),d("action",function(){l(e);let n=s();return m(n.submitCreate())}),r(),o(5,"ds-icon-button",10),d("action",function(){l(e);let n=s();return m(n.cancelCreate())}),r()()()}if(i&2){let e=s();c(),f("formControl",e.nameControl),c(),f("formControl",e.descriptionControl),c(2),f("disabled",e.nameControl.invalid||e.isSubmitting())}}function te(i,t){if(i&1){let e=b();o(0,"form",11),d("ngSubmit",function(){l(e);let n=s();return m(n.submitEdit())}),o(1,"p",12),p(2," Editing: "),o(3,"strong"),p(4),r()(),V(5,"input",6)(6,"input",7),o(7,"div",8)(8,"ds-icon-button",13),d("action",function(){l(e);let n=s();return m(n.submitEdit())}),r(),o(9,"ds-icon-button",10),d("action",function(){l(e);let n=s();return m(n.cancelEdit())}),r()()()}if(i&2){let e=s();c(4),x(t.name),c(),f("formControl",e.editNameControl),c(),f("formControl",e.editDescriptionControl),c(2),f("disabled",e.editNameControl.invalid||e.isEditSubmitting())}}function ne(i,t){i&1&&(o(0,"div",14)(1,"p"),p(2,"No namespaces yet. Create one above."),r()())}function ie(i,t){if(i&1){let e=b();o(0,"agentos-namespace-item",17),d("selected",function(n){l(e);let _=s(3);return m(_.select(n))})("editRequested",function(n){l(e);let _=s(3);return m(_.openEditForm(n))})("deleteRequested",function(n){l(e);let _=s(3);return m(_.deleteNamespace(n))}),r()}if(i&2){let e=t.$implicit;f("namespace",e)}}function oe(i,t){if(i&1&&(o(0,"ul",15),L(1,ie,1,1,"agentos-namespace-item",16,I().trackById,!0),r()),i&2){let e=s();c(),R(e)}}function ae(i,t){i&1&&u(0,ne,3,0,"div",14)(1,oe,3,0,"ul",15),i&2&&C(t.length===0?0:1)}var K=class i{router=N($);namespaceController=N(B);destroyRef=N(T);refresh$=new O(void 0);namespaces$=this.refresh$.pipe(k(()=>this.namespaceController.listAll()));nameControl=new h("",{nonNullable:!0,validators:[v.required,v.minLength(1)]});descriptionControl=new h("",{nonNullable:!0});isCreating=g(!1);isSubmitting=g(!1);editNameControl=new h("",{nonNullable:!0,validators:[v.required,v.minLength(1)]});editDescriptionControl=new h("",{nonNullable:!0});editingNamespace=g(null);isEditSubmitting=g(!1);select(t){this.router.navigate(["/agentos",t.id,"cases"])}openCreateForm(){this.nameControl.reset(),this.descriptionControl.reset(),this.isCreating.set(!0),this.editingNamespace.set(null)}cancelCreate(){this.isCreating.set(!1)}submitCreate(){if(this.nameControl.invalid||this.isSubmitting())return;let t=D({name:this.nameControl.value.trim()},this.descriptionControl.value.trim()?{description:this.descriptionControl.value.trim()}:{});this.isSubmitting.set(!0),this.namespaceController.create(t).pipe(S(this.destroyRef)).subscribe({next:()=>{this.isCreating.set(!1),this.isSubmitting.set(!1),this.refresh$.next()},error:()=>this.isSubmitting.set(!1)})}openEditForm(t){this.editNameControl.setValue(t.name),this.editDescriptionControl.setValue(t.description??""),this.editingNamespace.set(t),this.isCreating.set(!1)}cancelEdit(){this.editingNamespace.set(null)}submitEdit(){let t=this.editingNamespace();if(!t||this.editNameControl.invalid||this.isEditSubmitting())return;let e=P(D({},t),{name:this.editNameControl.value.trim(),description:this.editDescriptionControl.value.trim()||void 0});this.isEditSubmitting.set(!0),this.namespaceController.update(t.id,e).pipe(S(this.destroyRef)).subscribe({next:()=>{this.editingNamespace.set(null),this.isEditSubmitting.set(!1),this.refresh$.next()},error:()=>this.isEditSubmitting.set(!1)})}deleteNamespace(t){this.namespaceController._delete(t.id).pipe(S(this.destroyRef)).subscribe(()=>this.refresh$.next())}trackById(t,e){return e.id}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=y({type:i,selectors:[["agentos-namespace-list"]],decls:9,vars:5,consts:[[1,"namespace-list"],[1,"namespace-list__header"],["icon","add","variant","primary","title","Create namespace",3,"action"],[1,"namespace-list__create-form"],[1,"namespace-list__create-form","namespace-list__edit-form"],[1,"namespace-list__create-form",3,"ngSubmit"],["type","text","placeholder","Namespace name *",1,"namespace-list__input",3,"formControl"],["type","text","placeholder","Description (optional)",1,"namespace-list__input",3,"formControl"],[1,"namespace-list__create-actions"],["icon","check","variant","primary","title","Confirm",3,"action","disabled"],["icon","close","title","Cancel",3,"action"],[1,"namespace-list__create-form","namespace-list__edit-form",3,"ngSubmit"],[1,"namespace-list__edit-label"],["icon","check","variant","primary","title","Save changes",3,"action","disabled"],[1,"namespace-list__empty"],["role","list",1,"namespace-list__items"],[3,"namespace"],[3,"selected","editRequested","deleteRequested","namespace"]],template:function(e,a){if(e&1&&(o(0,"div",0)(1,"header",1)(2,"h2"),p(3,"Namespaces"),r(),o(4,"ds-icon-button",2),d("action",function(){return a.openCreateForm()}),r()(),u(5,ee,6,3,"form",3),u(6,te,10,4,"form",4),u(7,ae,2,1),q(8,"async"),r()),e&2){let n,_;c(5),C(a.isCreating()?5:-1),c(),C((n=a.editingNamespace())?6:-1,n),c(),C((_=F(8,3,a.namespaces$))?7:-1,_)}},dependencies:[J,U,A,j,G,H,E,M,z],styles:[".namespace-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:2rem;gap:1.5rem;max-width:640px;margin:0 auto}.namespace-list__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}.namespace-list__header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.namespace-list__create-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1rem;border-radius:12px;border:1px solid var(--color-primary, #007aff);background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px))}.namespace-list__input[_ngcontent-%COMP%]{width:100%;padding:.6rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.namespace-list__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.namespace-list__input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.namespace-list__create-actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;justify-content:flex-end}.namespace-list__items[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.namespace-list__edit-form[_ngcontent-%COMP%]{border-color:var(--color-text-secondary, #6e6e73)}.namespace-list__edit-label[_ngcontent-%COMP%]{margin:0 0 .25rem;font-size:.8rem;color:var(--color-text-secondary, #6e6e73)}.namespace-list__edit-label[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--color-text, #1d1d1f)}.namespace-list__empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}"]})};export{M as a,K as b};
@@ -0,0 +1 @@
1
+ import{Ia as G,P as m,R as F,S as C,T as O,U as W,a as u,b as f,f as N,fc as k,hc as h,ic as E}from"./chunk-WG23DARU.js";var x=class{apiKeys;username;password;accessToken;basePath;withCredentials;encoder;encodeParam;credentials;constructor({accessToken:b,apiKeys:t,basePath:r,credentials:s,encodeParam:o,encoder:n,password:e,username:l,withCredentials:p}={}){t&&(this.apiKeys=t),l!==void 0&&(this.username=l),e!==void 0&&(this.password=e),b!==void 0&&(this.accessToken=b),r!==void 0&&(this.basePath=r),p!==void 0&&(this.withCredentials=p),n&&(this.encoder=n),this.encodeParam=o??(a=>this.defaultEncodeParam(a)),this.credentials=s??{}}selectHeaderContentType(b){if(b.length===0)return;let t=b.find(r=>this.isJsonMime(r));return t===void 0?b[0]:t}selectHeaderAccept(b){if(b.length===0)return;let t=b.find(r=>this.isJsonMime(r));return t===void 0?b[0]:t}isJsonMime(b){let t=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return b!==null&&(t.test(b)||b.toLowerCase()==="application/json-patch+json")}lookupCredential(b){let t=this.credentials[b];return typeof t=="function"?t():t}addCredentialToHeaders(b,t,r,s){let o=this.lookupCredential(b);return o?r.set(t,(s??"")+o):r}addCredentialToQuery(b,t,r){let s=this.lookupCredential(b);return s?r.set(t,s):r}defaultEncodeParam(b){let t=b.dataFormat==="date-time"&&b.value instanceof Date?b.value.toISOString():b.value;return encodeURIComponent(String(t))}};var A=new F("basePath");var R=class{encodeKey(b){return encodeURIComponent(b)}encodeValue(b){return encodeURIComponent(b)}decodeKey(b){return decodeURIComponent(b)}decodeValue(b){return decodeURIComponent(b)}};var P=class{basePath="http://localhost:8123";defaultHeaders=new k;configuration;encoder;constructor(b,t){if(this.configuration=t||new x,typeof this.configuration.basePath!="string"){let r=Array.isArray(b)?b[0]:void 0;r!=null&&(b=r),typeof b!="string"&&(b=this.basePath),this.configuration.basePath=b}this.encoder=this.configuration.encoder||new R}canConsumeForm(b){return b.indexOf("multipart/form-data")!==-1}addToHttpParams(b,t,r,s=!1){return typeof t=="object"&&!(t instanceof Date)?this.addToHttpParamsRecursive(b,t,s?r:void 0,s):this.addToHttpParamsRecursive(b,t,r)}addToHttpParamsRecursive(b,t,r,s=!1){if(t==null)return b;if(typeof t=="object"){if(r!=null)return s?Object.keys(t).reduce((o,n)=>o.append(`${r}[${n}]`,t[n]),b):b.append(r,JSON.stringify(t));if(Array.isArray(t))t.forEach(o=>b=this.addToHttpParamsRecursive(b,o,r));else if(t instanceof Date)if(r!=null)b=b.append(r,t.toISOString());else throw Error("key may not be null if value is Date");else Object.keys(t).forEach(o=>{let n=r?`${r}.${o}`:o;b=this.addToHttpParamsRecursive(b,t[o],n)});return b}else if(r!=null)return b.append(r,t);throw Error("key may not be null if value is not object or array")}};var V=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}addMessage(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter caseId was null or undefined when calling addMessage.");if(r==null)throw new Error("Required parameter addMessageRequest was null or undefined when calling addMessage.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/messages`,{basePath:H,withCredentials:y}=this.configuration;return this.httpClient.request("post",`${H}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}create1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter _case was null or undefined when calling create1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/cases",{basePath:v,withCredentials:H}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},H?{withCredentials:H}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}delete1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling delete1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getById1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling getById1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getByIds1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIds1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/cases/by-ids",{basePath:v,withCredentials:H}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},H?{withCredentials:H}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}killCase(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter caseId was null or undefined when calling killCase.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/kill`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}listByParent1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter parentId was null or undefined when calling listByParent1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/by-parentId/${this.configuration.encodeParam({name:"parentId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}stopCase(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter caseId was null or undefined when calling stopCase.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/stop`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}update1(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter id was null or undefined when calling update1.");if(r==null)throw new Error("Required parameter _case was null or undefined when calling update1.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/cases/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:H,withCredentials:y}=this.configuration;return this.httpClient.request("put",`${H}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||g)(C(E),C(A,8),C(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var I=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}_delete(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling _delete.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}create(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter namespace was null or undefined when calling create.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/namespaces",{basePath:v,withCredentials:H}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},H?{withCredentials:H}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getById(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling getById.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getByIds(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIds.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/namespaces/by-ids",{basePath:v,withCredentials:H}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},H?{withCredentials:H}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}listAll(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/namespaces",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}listByParent(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter parentId was null or undefined when calling listByParent.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/namespaces/by-parentId/${this.configuration.encodeParam({name:"parentId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}update(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter id was null or undefined when calling update.");if(r==null)throw new Error("Required parameter namespace was null or undefined when calling update.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:H,withCredentials:y}=this.configuration;return this.httpClient.request("put",`${H}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||g)(C(E),C(A,8),C(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var S=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}create2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter agentFinishedEventAgentRunningEventAgentSelectedEventAnswerEventCaseStatusEventIntentionGeneratedEventMessageEventQuestionEventTextChunkEventThinkingEventToolRequestEventToolResponseEventToolSelectedEventWarnEvent was null or undefined when calling create2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/case-events",{basePath:v,withCredentials:H}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},H?{withCredentials:H}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}delete2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling delete2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/case-events/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getById2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling getById2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/case-events/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getByIds2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIds2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/case-events/by-ids",{basePath:v,withCredentials:H}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},H?{withCredentials:H}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}listByParent2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter parentId was null or undefined when calling listByParent2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/case-events/by-parentId/${this.configuration.encodeParam({name:"parentId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}update2(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter id was null or undefined when calling update2.");if(r==null)throw new Error("Required parameter agentFinishedEventAgentRunningEventAgentSelectedEventAnswerEventCaseStatusEventIntentionGeneratedEventMessageEventQuestionEventTextChunkEventThinkingEventToolRequestEventToolResponseEventToolSelectedEventWarnEvent was null or undefined when calling update2.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/case-events/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:H,withCredentials:y}=this.configuration;return this.httpClient.request("put",`${H}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||g)(C(E),C(A,8),C(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var $=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}debugAllPlugins(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/plugins/debug",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}debugPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling debugPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/debug`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getAllPlugins(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/plugins",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}getPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling getPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}reloadAllAgents(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/plugins/reload-agents",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("post",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}reloadPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling reloadPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/reload`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}startPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling startPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/start`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}stopPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling stopPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/stop`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}unloadPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling unloadPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}uploadPlugin(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/plugins/upload",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("post",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}static \u0275fac=function(r){return new(r||g)(C(E),C(A,8),C(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var q=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}streamEvents(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter caseId was null or undefined when calling streamEvents.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["text/event-stream"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/events`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}static \u0275fac=function(r){return new(r||g)(C(E),C(A,8),C(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var B=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}executeTool(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter toolName was null or undefined when calling executeTool.");if(r==null)throw new Error("Required parameter requestBody was null or undefined when calling executeTool.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/tools/${this.configuration.encodeParam({name:"toolName",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/execute`,{basePath:H,withCredentials:y}=this.configuration;return this.httpClient.request("post",`${H}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}getTool(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter toolName was null or undefined when calling getTool.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/tools/${this.configuration.encodeParam({name:"toolName",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}listTools(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/tools",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}static \u0275fac=function(r){return new(r||g)(C(E),C(A,8),C(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};function Lt(g){return W([typeof g=="string"?{provide:A,useValue:g}:{provide:x,useValue:new x(u({},g))}])}var M=class g{config=O(x);zone=O(G);connect(b){let t=`${this.config.basePath}/api/cases/${b}/events`;return new N(r=>{let s=this.zone.runOutsideAngular(()=>new EventSource(t));return s.onmessage=o=>{try{let n=JSON.parse(o.data);this.zone.run(()=>r.next(n))}catch(n){this.zone.run(()=>r.error(new Error(`Failed to parse SSE event: ${n}`)))}},s.onerror=o=>{s.readyState===EventSource.CLOSED?this.zone.run(()=>r.complete()):this.zone.run(()=>r.error(new Error(`SSE connection error for case ${b}`))),s.close()},()=>s.close()})}static \u0275fac=function(t){return new(t||g)};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};export{x as a,V as b,I as c,$ as d,Lt as e};
@@ -0,0 +1 @@
1
+ import{b as ue}from"./chunk-ODM275WP.js";import{A as Ce,a as _e,e as he,i as fe,m as be,t as ve,u as xe,v as ye}from"./chunk-QITHUHCN.js";import{$a as k,Aa as L,Da as Q,Db as y,Fb as w,Gb as j,Kb as p,Na as b,Oa as se,P as H,Pa as v,Qa as x,T,Ta as N,Ua as U,Va as S,Wa as s,X as $,Xa as r,Y as V,Ya as Z,Z as O,Za as m,_ as ae,_a as _,a as R,ac as D,b as A,ba as re,bb as de,db as P,eb as ce,fa as h,fb as g,gc as ee,ic as pe,nc as ge,qa as le,qb as me,s as ie,sa as l,tb as i,ub as c,vb as E}from"./chunk-WG23DARU.js";var Ie=(o,t)=>t.date,Be=(o,t)=>t.x,Fe=(o,t)=>t.label;function Re(o,t){o&1&&(m(0,"div",0),i(1,"No daily data points for this period."),_())}function Ae(o,t){if(o&1&&(O(),k(0,"rect",18)),o&2){let e=g().$implicit,n=g(2);b("x",e.w+6)("y",n.yBase-e.tokensStubH)("width",e.w)("height",e.tokensStubH)}}function He(o,t){if(o&1&&(O(),k(0,"rect",19)(1,"rect",20)),o&2){let e=g().$implicit,n=g(2);b("x",e.w+6)("y",n.yBase-(e.promptH??0))("width",e.w)("height",e.promptH??0),l(),b("x",e.w+6)("y",n.yBase-((e.promptH??0)+(e.completionH??0)))("width",e.w)("height",e.completionH??0)}}function $e(o,t){if(o&1){let e=de();O(),m(0,"g",15),ce("mouseenter",function(a){let d=$(e).$implicit,u=g(2);return V(u.showTooltip(a,d.point))})("mousemove",function(a){let d=$(e).$implicit,u=g(2);return V(u.showTooltip(a,d.point))})("mouseleave",function(){$(e);let a=g(2);return V(a.hideTooltip())}),k(1,"rect",16)(2,"rect",17),v(3,Ae,1,4,":svg:rect",18)(4,He,2,8),_()}if(o&2){let e=t.$implicit,n=g(2);b("transform","translate("+e.xGroup+",0)"),l(),b("y",n.yTop)("width",e.groupW)("height",n.yBase-n.yTop),l(),b("y",n.yBase-e.costH)("width",e.w)("height",e.costH),l(),x(e.tokensStubH!==null?3:4)}}function Ve(o,t){if(o&1&&(O(),m(0,"text",5),i(1),_()),o&2){let e=t.$implicit,n=g(2);b("x",e.x)("y",n.yAxis),l(),c(e.label)}}function Le(o,t){if(o&1&&(m(0,"div",24),i(1),_(),m(2,"div",25),i(3),_()),o&2){let e=t.$implicit;l(),c(e.label),l(2),c(e.value)}}function je(o,t){if(o&1&&(m(0,"div",21)(1,"div",22),i(2),_(),m(3,"div",23),N(4,Le,4,2,null,null,Fe),_()()),o&2){let e=g(2);me("left",e.tooltip().x+12,"px")("top",e.tooltip().y+12,"px"),l(2),c(e.tooltip().data.date),l(2),U(e.tooltipLines())}}function Ge(o,t){if(o&1&&(m(0,"div",8)(1,"span",10),i(2),_()()),o&2){let e=g(2);l(2),c(e.tokenCoverageLabel())}}function Ye(o,t){if(o&1&&(m(0,"div",1),O(),m(1,"svg",2),k(2,"line",3)(3,"line",3),N(4,$e,5,8,":svg:g",4,Ie),N(6,Ve,2,3,":svg:text",5,Be),_(),v(8,je,6,5,"div",6),ae(),m(9,"div",7)(10,"div",8),k(11,"span",9),m(12,"span",10),i(13,"Cost (per day)"),_(),m(14,"span",11),i(15),_()(),m(16,"div",8),k(17,"span",12),m(18,"span",10),i(19,"Prompt tokens"),_()(),m(20,"div",8),k(21,"span",13),m(22,"span",10),i(23,"Completion tokens"),_()(),m(24,"div",8),k(25,"span",14),m(26,"span",10),i(27,"Tokens missing"),_()(),m(28,"div",8)(29,"span",10),i(30,"Tokens scale"),_(),m(31,"span",11),i(32),_()(),v(33,Ge,3,1,"div",8),_()()),o&2){let e=g();l(),b("viewBox",e.viewBox),l(),b("y1",e.yTop)("x2",720)("y2",e.yTop),l(),b("y1",e.yBase)("x2",720)("y2",e.yBase),l(),U(e.bars()),l(2),U(e.axisLabels()),l(2),x(e.tooltip().visible&&e.tooltip().data?8:-1),l(7),E("max ",e.maxCostLabel()),l(17),E("max ",e.maxTokensLabel()),l(),x(e.tokenCoverageLabel()?33:-1)}}var G=class o{points=[];width=720;height=240;paddingX=12;paddingY=16;bottomAxisH=48;viewBox=`0 0 ${this.width} ${this.height}`;innerW=this.width-this.paddingX*2;innerH=this.height-this.paddingY*2-this.bottomAxisH;barGap=6;groupGap=14;safePoints=p(()=>(this.points??[]).filter(t=>!!t.date));maxCost=p(()=>Math.max(0,...this.safePoints().map(t=>t.cost??0)));maxTokens=p(()=>{let t=this.safePoints().map(e=>{let n=e.promptTokens??null,a=e.completionTokens??null;return n===null&&a===null?null:(n??0)+(a??0)}).filter(e=>e!==null);return Math.max(0,...t)});tokenCoverageLabel=p(()=>{let t=this.safePoints();return t.length===0?"":`Tokens available for ${t.filter(n=>n.promptTokens!==null||n.completionTokens!==null).length}/${t.length} days`});maxCostLabel=p(()=>"$"+(new D("en-US").transform(this.maxCost(),"1.2-2")??"0.00"));maxTokensLabel=p(()=>new D("en-US").transform(this.maxTokens(),"1.0-2")??"0");tooltip=h({visible:!1,x:0,y:0,data:null});toTooltipData(t){let e=t.promptTokens,n=t.completionTokens,a=e===null&&n===null?null:(e??0)+(n??0);return{date:t.date,cost:t.cost??0,promptTokens:e,completionTokens:n,totalTokens:a,callCount:t.callCount??0}}showTooltip(t,e){let a=t.currentTarget?.closest(".chart")?.getBoundingClientRect(),d=a?t.clientX-a.left:t.clientX,u=a?t.clientY-a.top:t.clientY,f=320,M=170,I=12,C=a?Math.max(0,a.width-f-I):d,B=a?Math.max(0,a.height-M-I):u,F=a?Math.min(Math.max(0,d),C):d,te=a?Math.min(Math.max(0,u),B):u;this.tooltip.set({visible:!0,x:F,y:te,data:this.toTooltipData(e)})}hideTooltip(){this.tooltip.update(t=>A(R({},t),{visible:!1}))}formatTokens(t){return t===null?"\u2014":new D("en-US").transform(t,"1.0-2")??"0"}formatCost(t){return"$"+(new D("en-US").transform(t??0,"1.2-2")??"0.00")}tooltipLines=p(()=>{let t=this.tooltip(),e=t.data;return!t.visible||!e?[]:[{label:"Cost",value:this.formatCost(e.cost)},{label:"Prompt tokens",value:this.formatTokens(e.promptTokens)},{label:"Completion tokens",value:this.formatTokens(e.completionTokens)},{label:"Total tokens",value:this.formatTokens(e.totalTokens)},{label:"Calls",value:`${e.callCount}`}]});bars=p(()=>{let t=this.safePoints(),e=t.length;if(e===0)return[];let n=(this.innerW-(e-1)*this.groupGap)/e,a=Math.max(2,n),d=(a-this.barGap)/2,u=Math.max(1,d),f=this.maxCost()||1,M=this.maxTokens()||1,I=45;return t.map((C,B)=>{let F=this.paddingX+B*(a+this.groupGap),we=(C.cost??0)/f*this.innerH,ne=C.promptTokens,oe=C.completionTokens,K=ne!==null||oe!==null,De=ne??0,Ee=oe??0,Oe=K?De/M*this.innerH:null,Ne=K?Ee/M*this.innerH:null;return{date:C.date,point:C,xGroup:F,groupW:a,xCost:F,w:u,costH:we,xTokens:F+u+this.barGap,promptH:Oe,completionH:Ne,tokensStubH:K?null:I}})});axisLabels=p(()=>{let t=this.safePoints(),e=t.length;if(e===0)return[];let a=Math.max(1,Math.ceil(e/8)),d=(this.innerW-(e-1)*this.groupGap)/e,u=Math.max(2,d);return t.map((f,M)=>({p:f,i:M})).filter(({i:f})=>f%a===0||f===e-1).map(({p:f,i:M})=>{let C=this.paddingX+M*(u+this.groupGap)+u/2,B=f.date.slice(5);return{x:C,label:B}})});yTop=this.paddingY;yBase=this.paddingY+this.innerH;yAxis=this.yBase+28;static \u0275fac=function(e){return new(e||o)};static \u0275cmp=L({type:o,selectors:[["app-daily-series-chart"]],inputs:{points:"points"},decls:2,vars:1,consts:[[1,"muted"],[1,"chart"],["preserveAspectRatio","none","role","img","aria-label","Daily token and cost usage",1,"chart__svg"],["x1","0",1,"chart__grid"],[1,"chart__day"],["text-anchor","middle",1,"chart__axis-label"],[1,"chart__tooltip",3,"left","top"],[1,"chart__legend"],[1,"chart__legend-item"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--cost"],[1,"chart__legend-label"],[1,"chart__legend-value"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--prompt"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--completion"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--tokens-missing"],[1,"chart__day",3,"mouseenter","mousemove","mouseleave"],["x","0",1,"chart__hover"],["x","0",1,"chart__bar","chart__bar--cost"],[1,"chart__bar","chart__bar--tokens-missing"],[1,"chart__bar","chart__bar--prompt"],[1,"chart__bar","chart__bar--completion"],[1,"chart__tooltip"],[1,"chart__tooltip-title"],[1,"chart__tooltip-grid"],[1,"chart__tooltip-label"],[1,"chart__tooltip-value"]],template:function(e,n){e&1&&v(0,Re,2,0,"div",0)(1,Ye,34,11,"div",1),e&2&&x(n.safePoints().length===0?0:1)},styles:[".chart[_ngcontent-%COMP%]{display:grid;gap:.5rem;position:relative}.chart__svg[_ngcontent-%COMP%]{width:100%;height:260px;display:block;border-radius:12px;background:var(--color-bg-secondary, rgba(255, 255, 255, .72));border:1px solid var(--color-border-light, rgba(0, 0, 0, .08))}.chart__grid[_ngcontent-%COMP%]{stroke:var(--color-border-light, rgba(0, 0, 0, .08));stroke-width:1}.chart__day[_ngcontent-%COMP%]{cursor:default}.chart__hover[_ngcontent-%COMP%]{fill:transparent}.chart__day[_ngcontent-%COMP%]:hover .chart__hover[_ngcontent-%COMP%]{fill:var(--color-bg-hover, rgba(0, 0, 0, .03))}.chart__tooltip[_ngcontent-%COMP%]{position:absolute;z-index:2;min-width:220px;max-width:320px;padding:10px 12px;border-radius:12px;background:rgb(var(--color-bg-secondary-rgb, 255 255 255)/1);border:1px solid var(--color-border-light, rgba(0, 0, 0, .08));box-shadow:var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, .12));pointer-events:none}.chart__tooltip-title[_ngcontent-%COMP%]{font-weight:650;margin-bottom:6px}.chart__tooltip-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr auto;column-gap:10px;row-gap:4px}.chart__tooltip-label[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.85rem}.chart__tooltip-value[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums;text-align:right}.chart__bar[_ngcontent-%COMP%]{shape-rendering:geometricPrecision;rx:2;ry:2}.chart__bar--cost[_ngcontent-%COMP%]{fill:var(--color-primary, #007aff);opacity:.85}.chart__bar--prompt[_ngcontent-%COMP%]{fill:var(--color-success, #34c759);opacity:.85}.chart__bar--completion[_ngcontent-%COMP%]{fill:var(--color-warning, #ff9500);opacity:.85}.chart__bar--tokens-missing[_ngcontent-%COMP%]{fill:transparent;stroke:var(--color-text-secondary, rgba(29, 29, 31, .55));stroke-width:1.5;stroke-dasharray:4 3}.chart__axis-label[_ngcontent-%COMP%]{fill:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:12px;font-variant-numeric:tabular-nums}.chart__legend[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:.75rem;flex-wrap:wrap}.chart__legend-item[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:baseline}.chart__legend-swatch[_ngcontent-%COMP%]{width:10px;height:10px;border-radius:3px;align-self:center}.chart__legend-swatch--cost[_ngcontent-%COMP%]{background:var(--color-primary, #007aff)}.chart__legend-swatch--prompt[_ngcontent-%COMP%]{background:var(--color-success, #34c759)}.chart__legend-swatch--completion[_ngcontent-%COMP%]{background:var(--color-warning, #ff9500)}.chart__legend-swatch--tokens-missing[_ngcontent-%COMP%]{background:transparent;border:1px dashed var(--color-text-secondary, rgba(29, 29, 31, .55))}.chart__legend-label[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.85rem}.chart__legend-value[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums}.muted[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7))}"],changeDetection:0})};var z=class o{http=T(pe);getTokenUsage(t){let e=new ee;return t.from&&(e=e.set("from",t.from)),t.to&&(e=e.set("to",t.to)),this.http.get("/api/token-usage",{params:e})}getTokenUsageSeries(t){let e=new ee;return t.from&&(e=e.set("from",t.from)),t.to&&(e=e.set("to",t.to)),this.http.get("/api/token-usage/series",{params:e})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=H({token:o,factory:o.\u0275fac,providedIn:"root"})};function Te(o){return`${o}`.padStart(2,"0")}function ke(o){return`${o.getUTCFullYear()}-${Te(o.getUTCMonth()+1)}-${Te(o.getUTCDate())}`}function ze(o=new Date){return new Date(Date.UTC(o.getUTCFullYear(),o.getUTCMonth(),1))}function We(o=new Date){return new Date(Date.UTC(o.getUTCFullYear(),o.getUTCMonth()+1,1))}var W=class o{api=T(z);destroyRef=T(re);defaultFrom=ke(ze());defaultTo=ke(We());draftFilters=h({from:this.defaultFrom,to:this.defaultTo});appliedFilters=h({from:this.defaultFrom,to:this.defaultTo});loading=h(!1);error=h(null);aggregation=h(null);seriesResponse=h(null);series=h(null);tokenDataPartial=h(!1);aggregationByModelId=h(null);seriesByModelId=h(null);init(){this.reload()}setDraftFrom(t){this.draftFilters.update(e=>A(R({},e),{from:t}))}setDraftTo(t){this.draftFilters.update(e=>A(R({},e),{to:t}))}clearDraftFrom(){this.setDraftFrom(null)}clearDraftTo(){this.setDraftTo(null)}apply(){this.appliedFilters.set(this.draftFilters()),this.reload()}addNullableTokens(t,e){return t===null&&e===null?null:(t??0)+(e??0)}aggregateByModelId(t){let e=new Map;for(let n of t){let a=n.modelId,d=e.get(a);d?(d.promptTokens=this.addNullableTokens(d.promptTokens,n.promptTokens),d.completionTokens=this.addNullableTokens(d.completionTokens,n.completionTokens),d.totalTokens=this.addNullableTokens(d.totalTokens,n.totalTokens),d.callCount+=n.callCount??0,d.cost=(d.cost??0)+(n.cost??0)):e.set(a,{agentName:"All agents",providerName:"all",modelId:n.modelId,promptTokens:n.promptTokens,completionTokens:n.completionTokens,totalTokens:n.totalTokens,callCount:n.callCount??0,cost:n.cost??0})}return[...e.values()].sort((n,a)=>(a.totalTokens??0)-(n.totalTokens??0))}aggregateSeriesByModelId(t){let e=new Map;for(let n of t){let a=`${n.date}|${n.modelId}`,d=e.get(a);d?(d.promptTokens=this.addNullableTokens(d.promptTokens,n.promptTokens),d.completionTokens=this.addNullableTokens(d.completionTokens,n.completionTokens),d.totalTokens=this.addNullableTokens(d.totalTokens,n.totalTokens),d.callCount+=n.callCount??0,d.cost=(d.cost??0)+(n.cost??0)):e.set(a,{date:n.date,agentName:"All agents",providerName:"all",modelId:n.modelId,promptTokens:n.promptTokens,completionTokens:n.completionTokens,totalTokens:n.totalTokens,callCount:n.callCount??0,cost:n.cost??0})}return[...e.values()].sort((n,a)=>n.date<a.date?-1:1)}reload(){let{from:t,to:e}=this.appliedFilters();this.loading.set(!0),this.error.set(null),ie({aggregation:this.api.getTokenUsage({from:t,to:e}),series:this.api.getTokenUsageSeries({from:t,to:e})}).pipe(_e(this.destroyRef)).subscribe({next:({aggregation:n,series:a})=>{this.aggregation.set(n),this.seriesResponse.set(a);let d=a.points??[];this.series.set(d),this.tokenDataPartial.set(n.tokenDataPartial||a.tokenDataPartial);let u=this.aggregateByModelId(n.models??[]);this.aggregationByModelId.set(u),this.seriesByModelId.set(this.aggregateSeriesByModelId(d)),this.loading.set(!1)},error:n=>{this.loading.set(!1),this.aggregation.set(null),this.seriesResponse.set(null),this.series.set(null),this.tokenDataPartial.set(!1),this.aggregationByModelId.set(null),this.seriesByModelId.set(null),this.error.set(n instanceof Error?n.message:"Failed to load token usage")}})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=H({token:o,factory:o.\u0275fac,providedIn:"root"})};var X=function(){throw new Error("DON'T USE this INSIDE A FUNCTION CALLED BY | call OR | apply IT MUST BE A PURE FUNCTION!")},Me=typeof Proxy!="function"?Object.seal({}):new Proxy({},{get:X,set:X,deleteProperty:X,has:X}),J=class o{transform(t,e){if(typeof e!="function")throw new TypeError("You must pass a PURE function to | call");return e?.call(Me,t)}static \u0275fac=function(e){return new(e||o)};static \u0275pipe=Q({name:"call",type:o,pure:!0})},q=class o{transform(t,...e){if(typeof t!="function")throw new TypeError("You must use | apply on a PURE function");return t.apply(Me,e)}static \u0275fac=function(e){return new(e||o)};static \u0275pipe=Q({name:"apply",type:o,pure:!0})};function Xe(o,t){o&1&&(s(0,"div",24),i(1," Partial data \u2014 token counts may not cover the full period "),r())}function Je(o,t){o&1&&(s(0,"div",25),i(1," No token data collected for this period "),r())}function qe(o,t){if(o&1&&(s(0,"div",20)(1,"div",21)(2,"div",22),i(3,"Total tokens"),r(),s(4,"div",23),i(5),y(6,"call"),r()(),s(7,"div",21)(8,"div",22),i(9,"Total calls"),r(),s(10,"div",23),i(11),r()(),s(12,"div",21)(13,"div",22),i(14,"Total cost"),r(),s(15,"div",23),i(16),y(17,"apply"),r()()(),v(18,Xe,2,0,"div",24),v(19,Je,2,0,"div",25)),o&2){let e=g();l(5),c(w(6,5,e.totalRow().totalTokens,e.formatTokenValue)),l(6),c(e.totalRow().callCount),l(5),c(j(17,8,e.formatCostValue,e.isMissingPeriod(),e.totalRow().cost)),l(2),x(e.isPartialPeriod()?18:-1),l(),x(e.isMissingPeriod()?19:-1)}}function Ke(o,t){o&1&&(s(0,"div",17)(1,"div",26),i(2,"Loading token usage\u2026"),r()())}function Qe(o,t){if(o&1&&(s(0,"div",18)(1,"div",27),i(2,"Failed to load"),r(),s(3,"div",26),i(4),r()()),o&2){let e=g();l(4),c(e.state.error())}}function Ze(o,t){o&1&&(s(0,"div",17)(1,"div",27),i(2,"No data"),r(),s(3,"div",26),i(4,"No token usage recorded yet for this period."),r()())}function et(o,t){if(o&1&&(s(0,"div",33)(1,"div",30),i(2),r(),s(3,"div",30),i(4),r(),s(5,"div",30),i(6),r(),s(7,"div",31),i(8),y(9,"call"),r(),s(10,"div",31),i(11),y(12,"call"),r(),s(13,"div",31),i(14),y(15,"call"),r(),s(16,"div",31),i(17),r(),s(18,"div",31),i(19),y(20,"apply"),r()()),o&2){let e=t.$implicit,n=g(2);l(2),c(e.agentName),l(2),c(e.providerName),l(2),c(e.modelId),l(2),c(w(9,8,e.promptTokens,n.formatTokenValue)),l(3),c(w(12,11,e.completionTokens,n.formatTokenValue)),l(3),c(w(15,14,e.totalTokens,n.formatTokenValue)),l(3),c(e.callCount),l(2),E(" ",j(20,17,n.formatCostValue,n.isMissingPeriod(),e.cost)," ")}}function tt(o,t){if(o&1&&(s(0,"div",34)(1,"div",30),i(2),r(),s(3,"div",30),i(4),r(),s(5,"div",30),i(6),r(),s(7,"div",31),i(8),y(9,"call"),r(),s(10,"div",31),i(11),y(12,"call"),r(),s(13,"div",31),i(14),y(15,"call"),r(),s(16,"div",31),i(17),r(),s(18,"div",31),i(19),y(20,"apply"),r()()),o&2){let e=g(2);l(2),c(e.totalRow().agentName),l(2),c(e.totalRow().providerName),l(2),c(e.totalRow().modelId),l(2),c(w(9,8,e.totalRow().promptTokens,e.formatTokenValue)),l(3),E(" ",w(12,11,e.totalRow().completionTokens,e.formatTokenValue)," "),l(3),c(w(15,14,e.totalRow().totalTokens,e.formatTokenValue)),l(3),c(e.totalRow().callCount),l(2),E(" ",j(20,17,e.formatCostValue,e.isMissingPeriod(),e.totalRow().cost)," ")}}function nt(o,t){if(o&1&&(s(0,"div",19)(1,"section",17)(2,"div",27),i(3,"Summary"),r(),s(4,"div",28)(5,"div",29)(6,"div",30),i(7,"agentName"),r(),s(8,"div",30),i(9,"providerName"),r(),s(10,"div",30),i(11,"modelId"),r(),s(12,"div",31),i(13,"promptTokens"),r(),s(14,"div",31),i(15,"completionTokens"),r(),s(16,"div",31),i(17,"totalTokens"),r(),s(18,"div",31),i(19,"callCount"),r(),s(20,"div",31),i(21,"cost"),r()(),s(22,"div",32),N(23,et,21,21,"div",33,se().trackRow,!0),v(25,tt,21,21,"div",34),r()()(),s(26,"section",17)(27,"div",27),i(28,"Daily series"),r(),Z(29,"app-daily-series-chart",35),r()()),o&2){let e=g();l(23),U(e.rows()),l(2),x(e.totalRow()?25:-1),l(4),S("points",e.chartPoints())}}var Se="\u2014",Pe=class o{router=T(ge);projectState=T(ue);state=T(W);view=h("byModel");rowsByAgent=p(()=>this.state.aggregation()?.models??[]);totalRow=p(()=>this.state.aggregation()?.total??null);rowsByModel=p(()=>this.state.aggregationByModelId()??[]);chartPointsByAgent=p(()=>{let t=this.state.series()??[];return this.aggregateDailyPoints(t)});chartPointsByModel=p(()=>{let t=this.state.seriesByModelId()??[];return this.aggregateDailyPoints(t)});chartPoints=p(()=>this.view()==="byAgent"?this.chartPointsByAgent():this.chartPointsByModel());rows=p(()=>this.view()==="byAgent"?this.rowsByAgent():this.rowsByModel());isEmpty=p(()=>{let t=this.state.aggregation();return t?(t.models?.length??0)===0&&(t.total?.callCount??0)===0:!1});ngOnInit(){this.state.init()}onFromChange(t){this.state.setDraftFrom(t||null)}onToChange(t){this.state.setDraftTo(t||null)}clearFrom(){this.state.clearDraftFrom()}clearTo(){this.state.clearDraftTo()}apply(){this.state.apply()}aggregateDailyPoints(t){let e=new Map;for(let n of t){let a=e.get(n.date);if(!a)e.set(n.date,{date:n.date,promptTokens:n.promptTokens,completionTokens:n.completionTokens,cost:n.cost??0,callCount:n.callCount??0});else{let d=(u,f)=>u===null&&f===null?null:(u??0)+(f??0);a.promptTokens=d(a.promptTokens,n.promptTokens),a.completionTokens=d(a.completionTokens,n.completionTokens),a.cost=(a.cost??0)+(n.cost??0),a.callCount=(a.callCount??0)+(n.callCount??0)}}return[...e.values()].sort((n,a)=>n.date<a.date?-1:1)}trackRow(t,e){return`${e.agentName}|${e.providerName}|${e.modelId}`}isMissingPeriod=p(()=>{if(this.state.loading())return!1;let t=this.state.aggregation()?.total;return t?t.totalTokens===null&&(t.cost===null||t.cost===void 0):!1});isPartialPeriod=p(()=>!this.isMissingPeriod()&&this.state.tokenDataPartial());navigateBackToProject(){let t=this.projectState.getSelectedProjectId();this.router.navigate(t?["project",t]:["/"])}formatTokenValue(t){return t===null?Se:new D("en-US").transform(t,"1.0-2")??"0"}formatCostValue(t,e){return t?Se:"$"+(new D("en-US").transform(e??0,"1.2-2")??"0.00")}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=L({type:o,selectors:[["app-token-usage"]],decls:40,vars:9,consts:[[1,"page"],[1,"page__header"],[1,"page__title-block"],["type","button","title","Back to project",1,"page__logo-btn",3,"click"],["alt","Coday",1,"page__logo"],[1,"page__title"],[1,"page__subtitle"],[1,"filters"],[1,"filters__field"],[1,"filters__label"],[1,"filters__control"],["type","date",1,"filters__input",3,"ngModelChange","ngModel"],["type","button",1,"filters__clear",3,"click","disabled"],[1,"filters__select",3,"ngModelChange","ngModel"],["value","byModel"],["value","byAgent"],["type","button",1,"filters__apply",3,"click","disabled"],[1,"card"],[1,"card","card--error"],[1,"grid"],[1,"kpis"],[1,"kpi"],[1,"kpi__label"],[1,"kpi__value"],["title","Some calls in this period were recorded before token tracking was enabled. Token counts reflect only the portion where data was collected.",1,"hint"],["title","No token usage data was collected for this period.",1,"hint"],[1,"muted"],[1,"card__title"],[1,"table"],[1,"table__head"],[1,"table__cell"],[1,"table__cell","table__cell--num"],[1,"table__body"],[1,"table__row"],[1,"table__row","table__row--total"],[3,"points"]],template:function(e,n){e&1&&(s(0,"section",0)(1,"header",1)(2,"div",2)(3,"button",3),P("click",function(){return n.navigateBackToProject()}),Z(4,"img",4),r(),s(5,"div")(6,"h1",5),i(7,"Token Usage"),r(),s(8,"p",6),i(9,"Track prompt and completion token usage by agent and model."),r()()(),s(10,"div",7)(11,"label",8)(12,"span",9),i(13,"From"),r(),s(14,"div",10)(15,"input",11),P("ngModelChange",function(d){return n.onFromChange(d)}),r(),s(16,"button",12),P("click",function(){return n.clearFrom()}),i(17," Clear "),r()()(),s(18,"label",8)(19,"span",9),i(20,"To"),r(),s(21,"div",10)(22,"input",11),P("ngModelChange",function(d){return n.onToChange(d)}),r(),s(23,"button",12),P("click",function(){return n.clearTo()}),i(24," Clear "),r()()(),s(25,"label",8)(26,"span",9),i(27,"View"),r(),s(28,"select",13),P("ngModelChange",function(d){return n.view.set(d)}),s(29,"option",14),i(30,"By model"),r(),s(31,"option",15),i(32,"By agent"),r()()(),s(33,"button",16),P("click",function(){return n.apply()}),i(34,"Apply"),r()()(),v(35,qe,20,12),v(36,Ke,3,0,"div",17)(37,Qe,5,1,"div",18)(38,Ze,5,0,"div",17)(39,nt,30,2,"div",19),r()),e&2&&(l(4),b("src","CODAY-Logo.png",le),l(11),S("ngModel",n.state.draftFilters().from),l(),S("disabled",!n.state.draftFilters().from),l(6),S("ngModel",n.state.draftFilters().to),l(),S("disabled",!n.state.draftFilters().to),l(5),S("ngModel",n.view()),l(5),S("disabled",n.state.loading()),l(2),x(n.totalRow()?35:-1),l(),x(n.state.loading()?36:n.state.error()?37:n.isEmpty()?38:39))},dependencies:[Ce,xe,ye,he,ve,fe,be,G,J,q],styles:[".page[_ngcontent-%COMP%]{padding:1.5rem;color:var(--color-text, #1d1d1f)}.page__header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:1.5rem;margin-bottom:1rem}.page__title-block[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.75rem}.page__logo-btn[_ngcontent-%COMP%]{flex:0 0 auto;width:40px;height:40px;padding:0;border-radius:12px;border:1px solid var(--glass-border, rgba(255, 255, 255, .18));background:var(--glass-bg, rgba(255, 255, 255, .72));box-shadow:var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, .08));cursor:pointer}.page__logo-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .03))}.page__logo[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:contain;padding:6px}.page__title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:650}.page__subtitle[_ngcontent-%COMP%]{margin:.25rem 0 0;color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.95rem}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:flex-end;gap:.75rem}.filters__field[_ngcontent-%COMP%]{display:grid;gap:.25rem}.filters__label[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7))}.filters__control[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.filters__input[_ngcontent-%COMP%], .filters__select[_ngcontent-%COMP%]{height:34px;padding:0 .5rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:var(--color-bg-secondary, rgba(255, 255, 255, .72));color:var(--color-text, #1d1d1f)}.filters__apply[_ngcontent-%COMP%], .filters__clear[_ngcontent-%COMP%]{height:34px;padding:0 .75rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:var(--color-bg-secondary, rgba(255, 255, 255, .72));color:var(--color-text, #1d1d1f);cursor:pointer}.kpis[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem;margin:.75rem 0 1rem}@media (max-width: 900px){.kpis[_ngcontent-%COMP%]{grid-template-columns:1fr}}.kpi[_ngcontent-%COMP%]{border-radius:14px;padding:.75rem 1rem;background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));box-shadow:var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, .08))}.kpi__label[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7))}.kpi__value[_ngcontent-%COMP%]{margin-top:.25rem;font-size:1.2rem;font-weight:650;font-variant-numeric:tabular-nums}.filters__apply[_ngcontent-%COMP%]{border-color:var(--color-primary, #007aff);background:var(--color-primary, #007aff);color:var(--color-text-inverse, #ffffff)}.filters__apply[_ngcontent-%COMP%]:disabled, .filters__clear[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1.5fr 1fr;gap:1rem;align-items:start}@media (max-width: 1100px){.grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.card[_ngcontent-%COMP%]{border-radius:14px;padding:1rem;background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));box-shadow:var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, .08))}.card--error[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.card__title[_ngcontent-%COMP%]{font-weight:650;margin-bottom:.75rem}.muted[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7))}.table[_ngcontent-%COMP%]{overflow-x:auto}.table__head[_ngcontent-%COMP%], .table__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr 2fr 1fr 1fr 1fr .7fr 1fr;gap:.5rem;align-items:center}.table__head[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7));padding:.25rem 0;border-bottom:1px solid var(--color-border-light, rgba(0, 0, 0, .08))}.table__row[_ngcontent-%COMP%]{padding:.5rem 0;border-bottom:1px solid var(--color-border-light, rgba(0, 0, 0, .08))}.table__row--total[_ngcontent-%COMP%]{font-weight:650;background:var(--color-bg-hover, rgba(0, 0, 0, .03));border-radius:10px;padding:.6rem .5rem;border-bottom:none;margin-top:.5rem}.table__cell[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.table__cell--num[_ngcontent-%COMP%]{text-align:right;font-variant-numeric:tabular-nums}.hint[_ngcontent-%COMP%]{margin:.25rem 0 1rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.85rem}"]})};export{Pe as TokenUsageComponent};
@@ -1 +1 @@
1
- import{d as v}from"./chunk-HV577N5Z.js";import{$a as l,Aa as a,Pa as f,Qa as b,T as p,Wa as o,Xa as s,Ya as i,Za as _,_a as C,fa as g,lc as h,sa as u,tb as y}from"./chunk-LU3TJP27.js";function O(e,n){e&1&&l(0,"span",1)}function P(e,n){e&1&&l(0,"span",2)}function S(e,n){e&1&&l(0,"span",3)}var r=class e{pluginService=p(v);online=g(null);ngOnInit(){this.pluginService.getAllPlugins().subscribe({next:()=>this.online.set(!0),error:()=>this.online.set(!1)})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=a({type:e,selectors:[["agentos-backend-status"]],decls:4,vars:1,consts:[[1,"backend-status"],["title","AgentOS online",1,"dot","dot--online"],["title","AgentOS offline",1,"dot","dot--offline"],["title","Checking\u2026",1,"dot","dot--checking"]],template:function(t,d){if(t&1&&(_(0,"div",0),f(1,O,1,0,"span",1)(2,P,1,0,"span",2)(3,S,1,0,"span",3),C()),t&2){let m;u(),b((m=d.online())===!0?1:m===!1?2:3)}},styles:[".backend-status[_ngcontent-%COMP%]{display:flex;align-items:center}.dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;flex-shrink:0}.dot--online[_ngcontent-%COMP%]{background:var(--color-success, #34c759)}.dot--offline[_ngcontent-%COMP%]{background:var(--color-error, #ff3b30)}.dot--checking[_ngcontent-%COMP%]{background:var(--color-text-secondary, #6e6e73);opacity:.5;animation:_ngcontent-%COMP%_pulse 1.2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:.5}50%{opacity:1}}"]})};var c=class e{static \u0275fac=function(t){return new(t||e)};static \u0275cmp=a({type:e,selectors:[["agentos-header"]],decls:7,vars:0,consts:[[1,"header"],[1,"header__brand"],["src","CODAY-Logo.png","alt","Coday",1,"header__logo-img"],[1,"header__logo-text"],[1,"header__nav"]],template:function(t,d){t&1&&(o(0,"header",0)(1,"div",1),i(2,"img",2),o(3,"span",3),y(4,"Coday"),s()(),o(5,"nav",4),i(6,"agentos-backend-status"),s()())},dependencies:[r],styles:[".header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:0 1.5rem;height:56px;background:var(--glass-bg, rgba(255, 255, 255, .72));border-bottom:1px solid var(--glass-border, rgba(255, 255, 255, .18));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));position:sticky;top:0;z-index:100}.header__brand[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.header__logo-img[_ngcontent-%COMP%]{width:24px;height:24px;object-fit:contain}.header__logo-text[_ngcontent-%COMP%]{font-size:1rem;font-weight:600;letter-spacing:-.02em;color:var(--color-text, #1d1d1f)}.header__nav[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}"]})};var M=class e{static \u0275fac=function(t){return new(t||e)};static \u0275cmp=a({type:e,selectors:[["agentos-layout"]],decls:4,vars:0,consts:[[1,"layout"],[1,"layout__content"]],template:function(t,d){t&1&&(o(0,"div",0),i(1,"agentos-header"),o(2,"main",1),i(3,"router-outlet"),s()())},dependencies:[h,c],styles:[".layout[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-height:100vh}.layout__content[_ngcontent-%COMP%]{flex:1;overflow-y:auto}"]})};export{r as a,c as b,M as c};
1
+ import{d as v}from"./chunk-GBTE3TIN.js";import{$a as l,Aa as a,Pa as f,Qa as b,T as p,Wa as o,Xa as s,Ya as i,Za as _,_a as C,fa as g,mc as h,sa as u,tb as y}from"./chunk-WG23DARU.js";function O(e,n){e&1&&l(0,"span",1)}function P(e,n){e&1&&l(0,"span",2)}function S(e,n){e&1&&l(0,"span",3)}var r=class e{pluginService=p(v);online=g(null);ngOnInit(){this.pluginService.getAllPlugins().subscribe({next:()=>this.online.set(!0),error:()=>this.online.set(!1)})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=a({type:e,selectors:[["agentos-backend-status"]],decls:4,vars:1,consts:[[1,"backend-status"],["title","AgentOS online",1,"dot","dot--online"],["title","AgentOS offline",1,"dot","dot--offline"],["title","Checking\u2026",1,"dot","dot--checking"]],template:function(t,d){if(t&1&&(_(0,"div",0),f(1,O,1,0,"span",1)(2,P,1,0,"span",2)(3,S,1,0,"span",3),C()),t&2){let m;u(),b((m=d.online())===!0?1:m===!1?2:3)}},styles:[".backend-status[_ngcontent-%COMP%]{display:flex;align-items:center}.dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;flex-shrink:0}.dot--online[_ngcontent-%COMP%]{background:var(--color-success, #34c759)}.dot--offline[_ngcontent-%COMP%]{background:var(--color-error, #ff3b30)}.dot--checking[_ngcontent-%COMP%]{background:var(--color-text-secondary, #6e6e73);opacity:.5;animation:_ngcontent-%COMP%_pulse 1.2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:.5}50%{opacity:1}}"]})};var c=class e{static \u0275fac=function(t){return new(t||e)};static \u0275cmp=a({type:e,selectors:[["agentos-header"]],decls:7,vars:0,consts:[[1,"header"],[1,"header__brand"],["src","CODAY-Logo.png","alt","Coday",1,"header__logo-img"],[1,"header__logo-text"],[1,"header__nav"]],template:function(t,d){t&1&&(o(0,"header",0)(1,"div",1),i(2,"img",2),o(3,"span",3),y(4,"Coday"),s()(),o(5,"nav",4),i(6,"agentos-backend-status"),s()())},dependencies:[r],styles:[".header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:0 1.5rem;height:56px;background:var(--glass-bg, rgba(255, 255, 255, .72));border-bottom:1px solid var(--glass-border, rgba(255, 255, 255, .18));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));position:sticky;top:0;z-index:100}.header__brand[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.header__logo-img[_ngcontent-%COMP%]{width:24px;height:24px;object-fit:contain}.header__logo-text[_ngcontent-%COMP%]{font-size:1rem;font-weight:600;letter-spacing:-.02em;color:var(--color-text, #1d1d1f)}.header__nav[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}"]})};var M=class e{static \u0275fac=function(t){return new(t||e)};static \u0275cmp=a({type:e,selectors:[["agentos-layout"]],decls:4,vars:0,consts:[[1,"layout"],[1,"layout__content"]],template:function(t,d){t&1&&(o(0,"div",0),i(1,"agentos-header"),o(2,"main",1),i(3,"router-outlet"),s()())},dependencies:[h,c],styles:[".layout[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-height:100vh}.layout__content[_ngcontent-%COMP%]{flex:1;overflow-y:auto}"]})};export{r as a,c as b,M as c};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-6DFCBHHF.js";import"./chunk-WG23DARU.js";export{a as AgentosShellComponent};
@@ -0,0 +1 @@
1
+ import{G as p,J as j,M as d,P as s,T as c,d as u,h as o,ic as P,k as f,o as a,p as g,z as l}from"./chunk-WG23DARU.js";var n=class r{baseUrl="/api/projects";http=c(P);listProjects(){return this.http.get(this.baseUrl)}getProject(e){return this.http.get(`${this.baseUrl}/${e}`)}getProjectConfig(e){return this.http.get(`${this.baseUrl}/${e}/config`)}updateProjectConfig(e,t){return this.http.put(`${this.baseUrl}/${e}/config`,t)}createProject(e,t){return this.http.post(this.baseUrl,{name:e,path:t})}static \u0275fac=function(t){return new(t||r)};static \u0275prov=s({token:r,factory:r.\u0275fac,providedIn:"root"})};var b=class r{selectedProjectIdSubject=new o(null);isLoadingSubject=new o(!1);refreshTriggerSubject=new o(void 0);hasInitialized=!1;isLoading$=this.isLoadingSubject.asObservable();projectApi=c(n);projectListCall=this.refreshTriggerSubject.pipe(j(()=>this.projectApi.listProjects()),p({bufferSize:1,refCount:!0}));projectList$=this.projectListCall.pipe(a(e=>e.projects));forcedProject$=this.projectListCall.pipe(a(e=>e.forcedProject));selectedProject$=g([this.selectedProjectIdSubject,this.forcedProject$]).pipe(j(([e,t])=>{let i=t??e;return i?this.projectApi.getProject(i):f(null)}),d(e=>{e&&e.name!==this.selectedProjectIdSubject.value&&(console.log("[PROJECT-STATE] Backend returned different project name:",e.name),this.selectedProjectIdSubject.next(e.name))}),p({bufferSize:1,refCount:!0}));selectProject(e){console.log("[PROJECT-STATE] Explicit project selection:",e),this.forcedProject$.pipe(l(1)).subscribe(t=>this.selectedProjectIdSubject.next(t??e))}getSelectedProjectId(){return this.selectedProjectIdSubject.value}getSelectedProjectIdOrThrow(){let e=this.selectedProjectIdSubject.value;if(!e)throw new Error("[PROJECT_STATE] No project selected");return e}clearSelection(){console.log("[PROJECT-STATE] Clearing project selection"),this.selectedProjectIdSubject.next(null)}initializeDefaultProject(){return u(this,null,function*(){if(this.hasInitialized){console.log("[PROJECT-STATE] Already initialized, skipping");return}this.hasInitialized=!0;let e=yield this.projectApi.listProjects().pipe(l(1)).toPromise();if(!e){console.log("[PROJECT-STATE] No response from project API");return}let{defaultProject:t,forcedProject:i}=e;t&&!i?(console.log("[PROJECT-STATE] Initializing with default project:",t),this.selectedProjectIdSubject.next(t)):i?(console.log("[PROJECT-STATE] Initializing with forced project:",i),this.selectedProjectIdSubject.next(i)):console.log("[PROJECT-STATE] No default project, staying on selection page")})}createProject(e,t){return this.isLoadingSubject.next(!0),this.projectApi.createProject(e,t).pipe(d(()=>{this.isLoadingSubject.next(!1),this.refreshTriggerSubject.next()}))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=s({token:r,factory:r.\u0275fac,providedIn:"root"})};export{n as a,b};
@@ -0,0 +1 @@
1
+ import{c as a}from"./chunk-NFPIT5IF.js";import"./chunk-GBTE3TIN.js";import"./chunk-WG23DARU.js";export{a as LayoutComponent};
@@ -0,0 +1 @@
1
+ import{$ as ce,Ba as z,Bb as c,Ca as l,Ea as u,Ha as I,Ja as Ie,Jb as _,K as Ee,Ka as Se,Kb as D,Ma as Ne,N as E,Na as T,O as d,P as Fe,Pb as fe,Q as q,Qb as ge,R as F,T as V,Ub as pe,a as h,b as p,ba as O,db as v,f as De,fa as y,g as be,ga as j,ha as m,ia as x,j as Me,o as Ae,rb as he,s as we,va as R,wa as a}from"./chunk-WG23DARU.js";function Fn(n){n||(n=V(O));let t=new De(e=>{if(n.destroyed){e.next();return}return n.onDestroy(e.next.bind(e))});return e=>e.pipe(Ee(t))}function In(n,t){let i=!t?.manualCleanup?t?.injector?.get(O)??V(O):null,r=pt(t?.equal),o;t?.requireSync?o=y({kind:0},{equal:r}):o=y({kind:1,value:t?.initialValue},{equal:r});let s,f=n.subscribe({next:g=>o.set({kind:1,value:g}),error:g=>{o.set({kind:2,error:g}),s?.()},complete:()=>{s?.()}});if(t?.requireSync&&o().kind===0)throw new E(601,!1);return s=i?.onDestroy(f.unsubscribe.bind(f)),D(()=>{let g=o();switch(g.kind){case 1:return g.value;case 2:throw g.error;case 0:throw new E(601,!1)}},{equal:t?.equal})}function pt(n=Object.is){return(t,e)=>t.kind===1&&e.kind===1&&n(t.value,e.value)}var Ue=(()=>{class n{_renderer;_elementRef;onChange=e=>{};onTouched=()=>{};constructor(e,i){this._renderer=e,this._elementRef=i}setProperty(e,i){this._renderer.setProperty(this._elementRef.nativeElement,e,i)}registerOnTouched(e){this.onTouched=e}registerOnChange(e){this.onChange=e}setDisabledState(e){this.setProperty("disabled",e)}static \u0275fac=function(i){return new(i||n)(a(R),a(x))};static \u0275dir=l({type:n})}return n})(),S=(()=>{class n extends Ue{static \u0275fac=(()=>{let e;return function(r){return(e||(e=m(n)))(r||n)}})();static \u0275dir=l({type:n,features:[u]})}return n})(),C=new F(""),mt={provide:C,useExisting:d(()=>vt),multi:!0},vt=(()=>{class n extends S{writeValue(e){this.setProperty("checked",e)}static \u0275fac=(()=>{let e;return function(r){return(e||(e=m(n)))(r||n)}})();static \u0275dir=l({type:n,selectors:[["input","type","checkbox","formControlName",""],["input","type","checkbox","formControl",""],["input","type","checkbox","ngModel",""]],hostBindings:function(i,r){i&1&&v("change",function(s){return r.onChange(s.target.checked)})("blur",function(){return r.onTouched()})},standalone:!1,features:[c([mt]),u]})}return n})(),_t={provide:C,useExisting:d(()=>Be),multi:!0};function yt(){let n=pe()?pe().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}var Ct=new F(""),Be=(()=>{class n extends Ue{_compositionMode;_composing=!1;constructor(e,i,r){super(e,i),this._compositionMode=r,this._compositionMode==null&&(this._compositionMode=!yt())}writeValue(e){let i=e??"";this.setProperty("value",i)}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}static \u0275fac=function(i){return new(i||n)(a(R),a(x),a(Ct,8))};static \u0275dir=l({type:n,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(i,r){i&1&&v("input",function(s){return r._handleInput(s.target.value)})("blur",function(){return r.onTouched()})("compositionstart",function(){return r._compositionStart()})("compositionend",function(s){return r._compositionEnd(s.target.value)})},standalone:!1,features:[c([_t]),u]})}return n})();function ve(n){return n==null||_e(n)===0}function _e(n){return n==null?null:Array.isArray(n)||typeof n=="string"?n.length:n instanceof Set?n.size:null}var w=new F(""),ae=new F(""),Vt=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Oe=class{static min(t){return He(t)}static max(t){return Le(t)}static required(t){return $e(t)}static requiredTrue(t){return Dt(t)}static email(t){return bt(t)}static minLength(t){return Mt(t)}static maxLength(t){return We(t)}static pattern(t){return At(t)}static nullValidator(t){return X()}static compose(t){return Ke(t)}static composeAsync(t){return Je(t)}};function He(n){return t=>{if(t.value==null||n==null)return null;let e=parseFloat(t.value);return!isNaN(e)&&e<n?{min:{min:n,actual:t.value}}:null}}function Le(n){return t=>{if(t.value==null||n==null)return null;let e=parseFloat(t.value);return!isNaN(e)&&e>n?{max:{max:n,actual:t.value}}:null}}function $e(n){return ve(n.value)?{required:!0}:null}function Dt(n){return n.value===!0?null:{required:!0}}function bt(n){return ve(n.value)||Vt.test(n.value)?null:{email:!0}}function Mt(n){return t=>{let e=t.value?.length??_e(t.value);return e===null||e===0?null:e<n?{minlength:{requiredLength:n,actualLength:e}}:null}}function We(n){return t=>{let e=t.value?.length??_e(t.value);return e!==null&&e>n?{maxlength:{requiredLength:n,actualLength:e}}:null}}function At(n){if(!n)return X;let t,e;return typeof n=="string"?(e="",n.charAt(0)!=="^"&&(e+="^"),e+=n,n.charAt(n.length-1)!=="$"&&(e+="$"),t=new RegExp(e)):(e=n.toString(),t=n),i=>{if(ve(i.value))return null;let r=i.value;return t.test(r)?null:{pattern:{requiredPattern:e,actualValue:r}}}}function X(n){return null}function qe(n){return n!=null}function ze(n){return Se(n)?Me(n):n}function Ze(n){let t={};return n.forEach(e=>{t=e!=null?h(h({},t),e):t}),Object.keys(t).length===0?null:t}function Xe(n,t){return t.map(e=>e(n))}function wt(n){return!n.validate}function Ye(n){return n.map(t=>wt(t)?t:e=>t.validate(e))}function Ke(n){if(!n)return null;let t=n.filter(qe);return t.length==0?null:function(e){return Ze(Xe(e,t))}}function ye(n){return n!=null?Ke(Ye(n)):null}function Je(n){if(!n)return null;let t=n.filter(qe);return t.length==0?null:function(e){let i=Xe(e,t).map(ze);return we(i).pipe(Ae(Ze))}}function Ce(n){return n!=null?Je(Ye(n)):null}function xe(n,t){return n===null?[t]:Array.isArray(n)?[...n,t]:[n,t]}function Qe(n){return n._rawValidators}function et(n){return n._rawAsyncValidators}function me(n){return n?Array.isArray(n)?n:[n]:[]}function Y(n,t){return Array.isArray(n)?n.includes(t):n===t}function Re(n,t){let e=me(t);return me(n).forEach(r=>{Y(e,r)||e.push(r)}),e}function ke(n,t){return me(t).filter(e=>!Y(n,e))}var K=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=ye(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=Ce(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t=void 0){this.control&&this.control.reset(t)}hasError(t,e){return this.control?this.control.hasError(t,e):!1}getError(t,e){return this.control?this.control.getError(t,e):null}},b=class extends K{name;get formDirective(){return null}get path(){return null}},M=class extends K{_parent=null;name=null;valueAccessor=null},J=class{_cd;constructor(t){this._cd=t}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}},Et={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},Xn=p(h({},Et),{"[class.ng-submitted]":"isSubmitted"}),Yn=(()=>{class n extends J{constructor(e){super(e)}static \u0275fac=function(i){return new(i||n)(a(M,2))};static \u0275dir=l({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(i,r){i&2&&he("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)},standalone:!1,features:[u]})}return n})(),Kn=(()=>{class n extends J{constructor(e){super(e)}static \u0275fac=function(i){return new(i||n)(a(b,10))};static \u0275dir=l({type:n,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(i,r){i&2&&he("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)("ng-submitted",r.isSubmitted)},standalone:!1,features:[u]})}return n})();var G="VALID",Z="INVALID",k="PENDING",U="DISABLED",A=class{},Q=class extends A{value;source;constructor(t,e){super(),this.value=t,this.source=e}},H=class extends A{pristine;source;constructor(t,e){super(),this.pristine=t,this.source=e}},L=class extends A{touched;source;constructor(t,e){super(),this.touched=t,this.source=e}},P=class extends A{status;source;constructor(t,e){super(),this.status=t,this.source=e}},ee=class extends A{source;constructor(t){super(),this.source=t}},te=class extends A{source;constructor(t){super(),this.source=t}};function tt(n){return(le(n)?n.validators:n)||null}function Ft(n){return Array.isArray(n)?ye(n):n||null}function nt(n,t){return(le(t)?t.asyncValidators:n)||null}function It(n){return Array.isArray(n)?Ce(n):n||null}function le(n){return n!=null&&!Array.isArray(n)&&typeof n=="object"}function St(n,t,e){let i=n.controls;if(!(t?Object.keys(i):i).length)throw new E(1e3,"");if(!i[e])throw new E(1001,"")}function Nt(n,t,e){n._forEachChild((i,r)=>{if(e[r]===void 0)throw new E(1002,"")})}var ne=class{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(t,e){this._assignValidators(t),this._assignAsyncValidators(e)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get status(){return _(this.statusReactive)}set status(t){_(()=>this.statusReactive.set(t))}_status=D(()=>this.statusReactive());statusReactive=y(void 0);get valid(){return this.status===G}get invalid(){return this.status===Z}get pending(){return this.status==k}get disabled(){return this.status===U}get enabled(){return this.status!==U}errors;get pristine(){return _(this.pristineReactive)}set pristine(t){_(()=>this.pristineReactive.set(t))}_pristine=D(()=>this.pristineReactive());pristineReactive=y(!0);get dirty(){return!this.pristine}get touched(){return _(this.touchedReactive)}set touched(t){_(()=>this.touchedReactive.set(t))}_touched=D(()=>this.touchedReactive());touchedReactive=y(!1);get untouched(){return!this.touched}_events=new be;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._assignValidators(t)}setAsyncValidators(t){this._assignAsyncValidators(t)}addValidators(t){this.setValidators(Re(t,this._rawValidators))}addAsyncValidators(t){this.setAsyncValidators(Re(t,this._rawAsyncValidators))}removeValidators(t){this.setValidators(ke(t,this._rawValidators))}removeAsyncValidators(t){this.setAsyncValidators(ke(t,this._rawAsyncValidators))}hasValidator(t){return Y(this._rawValidators,t)}hasAsyncValidator(t){return Y(this._rawAsyncValidators,t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){let e=this.touched===!1;this.touched=!0;let i=t.sourceControl??this;this._parent&&!t.onlySelf&&this._parent.markAsTouched(p(h({},t),{sourceControl:i})),e&&t.emitEvent!==!1&&this._events.next(new L(!0,i))}markAllAsDirty(t={}){this.markAsDirty({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsDirty(t))}markAllAsTouched(t={}){this.markAsTouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsTouched(t))}markAsUntouched(t={}){let e=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let i=t.sourceControl??this;this._forEachChild(r=>{r.markAsUntouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:i})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t,i),e&&t.emitEvent!==!1&&this._events.next(new L(!1,i))}markAsDirty(t={}){let e=this.pristine===!0;this.pristine=!1;let i=t.sourceControl??this;this._parent&&!t.onlySelf&&this._parent.markAsDirty(p(h({},t),{sourceControl:i})),e&&t.emitEvent!==!1&&this._events.next(new H(!1,i))}markAsPristine(t={}){let e=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let i=t.sourceControl??this;this._forEachChild(r=>{r.markAsPristine({onlySelf:!0,emitEvent:t.emitEvent})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t,i),e&&t.emitEvent!==!1&&this._events.next(new H(!0,i))}markAsPending(t={}){this.status=k;let e=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new P(this.status,e)),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.markAsPending(p(h({},t),{sourceControl:e}))}disable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=U,this.errors=null,this._forEachChild(r=>{r.disable(p(h({},t),{onlySelf:!0}))}),this._updateValue();let i=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new Q(this.value,i)),this._events.next(new P(this.status,i)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(p(h({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(r=>r(!0))}enable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=G,this._forEachChild(i=>{i.enable(p(h({},t),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(p(h({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(t,e){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),t.skipPristineCheck||this._parent._updatePristine({},e),this._parent._updateTouched({},e))}setParent(t){this._parent=t}getRawValue(){return this.value}updateValueAndValidity(t={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let i=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===G||this.status===k)&&this._runAsyncValidator(i,t.emitEvent)}let e=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new Q(this.value,e)),this._events.next(new P(this.status,e)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity(p(h({},t),{sourceControl:e}))}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?U:G}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t,e){if(this.asyncValidator){this.status=k,this._hasOwnPendingAsyncValidator={emitEvent:e!==!1,shouldHaveEmitted:t!==!1};let i=ze(this.asyncValidator(this));this._asyncValidationSubscription=i.subscribe(r=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(r,{emitEvent:e,shouldHaveEmitted:t})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let t=(this._hasOwnPendingAsyncValidator?.emitEvent||this._hasOwnPendingAsyncValidator?.shouldHaveEmitted)??!1;return this._hasOwnPendingAsyncValidator=null,t}return!1}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(e.emitEvent!==!1,this,e.shouldHaveEmitted)}get(t){let e=t;return e==null||(Array.isArray(e)||(e=e.split(".")),e.length===0)?null:e.reduce((i,r)=>i&&i._find(r),this)}getError(t,e){let i=e?this.get(e):this;return i&&i.errors?i.errors[t]:null}hasError(t,e){return!!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t,e,i){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),(t||i)&&this._events.next(new P(this.status,e)),this._parent&&this._parent._updateControlsErrors(t,e,i)}_initObservables(){this.valueChanges=new I,this.statusChanges=new I}_calculateStatus(){return this._allControlsDisabled()?U:this.errors?Z:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(k)?k:this._anyControlsHaveStatus(Z)?Z:G}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t,e){let i=!this._anyControlsDirty(),r=this.pristine!==i;this.pristine=i,this._parent&&!t.onlySelf&&this._parent._updatePristine(t,e),r&&this._events.next(new H(this.pristine,e))}_updateTouched(t={},e){this.touched=this._anyControlsTouched(),this._events.next(new L(this.touched,e)),this._parent&&!t.onlySelf&&this._parent._updateTouched(t,e)}_onDisabledChange=[];_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){le(t)&&t.updateOn!=null&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){let e=this._parent&&this._parent.dirty;return!t&&!!e&&!this._parent._anyControlsDirty()}_find(t){return null}_assignValidators(t){this._rawValidators=Array.isArray(t)?t.slice():t,this._composedValidatorFn=Ft(this._rawValidators)}_assignAsyncValidators(t){this._rawAsyncValidators=Array.isArray(t)?t.slice():t,this._composedAsyncValidatorFn=It(this._rawAsyncValidators)}},ie=class extends ne{constructor(t,e,i){super(tt(e),nt(i,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;registerControl(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(t,e,i={}){this.registerControl(t,e),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(t,e={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}setControl(t,e,i={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,e={}){Nt(this,!0,t),Object.keys(t).forEach(i=>{St(this,!0,i),this.controls[i].setValue(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){t!=null&&(Object.keys(t).forEach(i=>{let r=this.controls[i];r&&r.patchValue(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(t={},e={}){this._forEachChild((i,r)=>{i.reset(t?t[r]:null,{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e,this),this._updateTouched(e,this),this.updateValueAndValidity(e),e?.emitEvent!==!1&&this._events.next(new te(this))}getRawValue(){return this._reduceChildren({},(t,e,i)=>(t[i]=e.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(e,i)=>i._syncPendingControls()?!0:e);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_forEachChild(t){Object.keys(this.controls).forEach(e=>{let i=this.controls[e];i&&t(i,e)})}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(let[e,i]of Object.entries(this.controls))if(this.contains(e)&&t(i))return!0;return!1}_reduceValue(){let t={};return this._reduceChildren(t,(e,i,r)=>((i.enabled||this.disabled)&&(e[r]=i.value),e))}_reduceChildren(t,e){let i=t;return this._forEachChild((r,o)=>{i=e(i,r,o)}),i}_allControlsDisabled(){for(let t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(t){return this.controls.hasOwnProperty(t)?this.controls[t]:null}};var N=new F("",{providedIn:"root",factory:()=>W}),W="always";function Ot(n,t){return[...t.path,n]}function $(n,t,e=W){Ve(n,t),t.valueAccessor.writeValue(n.value),(n.disabled||e==="always")&&t.valueAccessor.setDisabledState?.(n.disabled),Rt(n,t),Pt(n,t),kt(n,t),xt(n,t)}function re(n,t,e=!0){let i=()=>{};t.valueAccessor&&(t.valueAccessor.registerOnChange(i),t.valueAccessor.registerOnTouched(i)),se(n,t),n&&(t._invokeOnDestroyCallbacks(),n._registerOnCollectionChange(()=>{}))}function oe(n,t){n.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(t)})}function xt(n,t){if(t.valueAccessor.setDisabledState){let e=i=>{t.valueAccessor.setDisabledState(i)};n.registerOnDisabledChange(e),t._registerOnDestroy(()=>{n._unregisterOnDisabledChange(e)})}}function Ve(n,t){let e=Qe(n);t.validator!==null?n.setValidators(xe(e,t.validator)):typeof e=="function"&&n.setValidators([e]);let i=et(n);t.asyncValidator!==null?n.setAsyncValidators(xe(i,t.asyncValidator)):typeof i=="function"&&n.setAsyncValidators([i]);let r=()=>n.updateValueAndValidity();oe(t._rawValidators,r),oe(t._rawAsyncValidators,r)}function se(n,t){let e=!1;if(n!==null){if(t.validator!==null){let r=Qe(n);if(Array.isArray(r)&&r.length>0){let o=r.filter(s=>s!==t.validator);o.length!==r.length&&(e=!0,n.setValidators(o))}}if(t.asyncValidator!==null){let r=et(n);if(Array.isArray(r)&&r.length>0){let o=r.filter(s=>s!==t.asyncValidator);o.length!==r.length&&(e=!0,n.setAsyncValidators(o))}}}let i=()=>{};return oe(t._rawValidators,i),oe(t._rawAsyncValidators,i),e}function Rt(n,t){t.valueAccessor.registerOnChange(e=>{n._pendingValue=e,n._pendingChange=!0,n._pendingDirty=!0,n.updateOn==="change"&&it(n,t)})}function kt(n,t){t.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,n.updateOn==="blur"&&n._pendingChange&&it(n,t),n.updateOn!=="submit"&&n.markAsTouched()})}function it(n,t){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function Pt(n,t){let e=(i,r)=>{t.valueAccessor.writeValue(i),r&&t.viewToModelUpdate(i)};n.registerOnChange(e),t._registerOnDestroy(()=>{n._unregisterOnChange(e)})}function rt(n,t){n==null,Ve(n,t)}function jt(n,t){return se(n,t)}function ot(n,t){if(!n.hasOwnProperty("model"))return!1;let e=n.model;return e.isFirstChange()?!0:!Object.is(t,e.currentValue)}function Tt(n){return Object.getPrototypeOf(n.constructor)===S}function st(n,t){n._syncPendingControls(),t.forEach(e=>{let i=e.control;i.updateOn==="submit"&&i._pendingChange&&(e.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function at(n,t){if(!t)return null;Array.isArray(t);let e,i,r;return t.forEach(o=>{o.constructor===Be?e=o:Tt(o)?i=o:r=o}),r||i||e||null}function Gt(n,t){let e=n.indexOf(t);e>-1&&n.splice(e,1)}var Ut={provide:b,useExisting:d(()=>Bt)},B=Promise.resolve(),Bt=(()=>{class n extends b{callSetDisabledState;get submitted(){return _(this.submittedReactive)}_submitted=D(()=>this.submittedReactive());submittedReactive=y(!1);_directives=new Set;form;ngSubmit=new I;options;constructor(e,i,r){super(),this.callSetDisabledState=r,this.form=new ie({},ye(e),Ce(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(e){B.then(()=>{let i=this._findContainer(e.path);e.control=i.registerControl(e.name,e.control),$(e.control,e,this.callSetDisabledState),e.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(e)})}getControl(e){return this.form.get(e.path)}removeControl(e){B.then(()=>{let i=this._findContainer(e.path);i&&i.removeControl(e.name),this._directives.delete(e)})}addFormGroup(e){B.then(()=>{let i=this._findContainer(e.path),r=new ie({});rt(r,e),i.registerControl(e.name,r),r.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(e){B.then(()=>{let i=this._findContainer(e.path);i&&i.removeControl(e.name)})}getFormGroup(e){return this.form.get(e.path)}updateModel(e,i){B.then(()=>{this.form.get(e.path).setValue(i)})}setValue(e){this.control.setValue(e)}onSubmit(e){return this.submittedReactive.set(!0),st(this.form,this._directives),this.ngSubmit.emit(e),this.form._events.next(new ee(this.control)),e?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(e=void 0){this.form.reset(e),this.submittedReactive.set(!1)}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.form._updateOn=this.options.updateOn)}_findContainer(e){return e.pop(),e.length?this.form.get(e):this.form}static \u0275fac=function(i){return new(i||n)(a(w,10),a(ae,10),a(N,8))};static \u0275dir=l({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(i,r){i&1&&v("submit",function(s){return r.onSubmit(s)})("reset",function(){return r.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[c([Ut]),u]})}return n})();function Pe(n,t){let e=n.indexOf(t);e>-1&&n.splice(e,1)}function je(n){return typeof n=="object"&&n!==null&&Object.keys(n).length===2&&"value"in n&&"disabled"in n}var lt=class extends ne{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(t=null,e,i){super(tt(e),nt(i,e)),this._applyFormState(t),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),le(e)&&(e.nonNullable||e.initialValueIsDefault)&&(je(t)?this.defaultValue=t.value:this.defaultValue=t)}setValue(t,e={}){this.value=this._pendingValue=t,this._onChange.length&&e.emitModelToViewChange!==!1&&this._onChange.forEach(i=>i(this.value,e.emitViewToModelChange!==!1)),this.updateValueAndValidity(e)}patchValue(t,e={}){this.setValue(t,e)}reset(t=this.defaultValue,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1,e?.emitEvent!==!1&&this._events.next(new te(this))}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_unregisterOnChange(t){Pe(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){Pe(this._onDisabledChange,t)}_forEachChild(t){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(t){je(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}};var Ht=n=>n instanceof lt;var Lt={provide:M,useExisting:d(()=>$t)},Te=Promise.resolve(),$t=(()=>{class n extends M{_changeDetectorRef;callSetDisabledState;control=new lt;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new I;constructor(e,i,r,o,s,f){super(),this._changeDetectorRef=s,this.callSetDisabledState=f,this._parent=e,this._setValidators(i),this._setAsyncValidators(r),this.valueAccessor=at(this,o)}ngOnChanges(e){if(this._checkForErrors(),!this._registered||"name"in e){if(this._registered&&(this._checkName(),this.formDirective)){let i=e.name.previousValue;this.formDirective.removeControl({name:i,path:this._getPath(i)})}this._setUpControl()}"isDisabled"in e&&this._updateDisabled(e),ot(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){$(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(e){Te.then(()=>{this.control.setValue(e,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(e){let i=e.isDisabled.currentValue,r=i!==0&&ge(i);Te.then(()=>{r&&!this.control.disabled?this.control.disable():!r&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(e){return this._parent?Ot(e,this._parent):[e]}static \u0275fac=function(i){return new(i||n)(a(b,9),a(w,10),a(ae,10),a(C,10),a(fe,8),a(N,8))};static \u0275dir=l({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[c([Lt]),u,j]})}return n})();var Qn=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=l({type:n,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""],standalone:!1})}return n})(),Wt={provide:C,useExisting:d(()=>qt),multi:!0},qt=(()=>{class n extends S{writeValue(e){let i=e??"";this.setProperty("value",i)}registerOnChange(e){this.onChange=i=>{e(i==""?null:parseFloat(i))}}static \u0275fac=(()=>{let e;return function(r){return(e||(e=m(n)))(r||n)}})();static \u0275dir=l({type:n,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(i,r){i&1&&v("input",function(s){return r.onChange(s.target.value)})("blur",function(){return r.onTouched()})},standalone:!1,features:[c([Wt]),u]})}return n})(),zt={provide:C,useExisting:d(()=>Xt),multi:!0};var Zt=(()=>{class n{_accessors=[];add(e,i){this._accessors.push([e,i])}remove(e){for(let i=this._accessors.length-1;i>=0;--i)if(this._accessors[i][1]===e){this._accessors.splice(i,1);return}}select(e){this._accessors.forEach(i=>{this._isSameGroup(i,e)&&i[1]!==e&&i[1].fireUncheck(e.value)})}_isSameGroup(e,i){return e[0].control?e[0]._parent===i._control._parent&&e[1].name===i.name:!1}static \u0275fac=function(i){return new(i||n)};static \u0275prov=Fe({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Xt=(()=>{class n extends S{_registry;_injector;_state;_control;_fn;setDisabledStateFired=!1;onChange=()=>{};name;formControlName;value;callSetDisabledState=V(N,{optional:!0})??W;constructor(e,i,r,o){super(e,i),this._registry=r,this._injector=o}ngOnInit(){this._control=this._injector.get(M),this._checkName(),this._registry.add(this._control,this)}ngOnDestroy(){this._registry.remove(this)}writeValue(e){this._state=e===this.value,this.setProperty("checked",this._state)}registerOnChange(e){this._fn=e,this.onChange=()=>{e(this.value),this._registry.select(this)}}setDisabledState(e){(this.setDisabledStateFired||e||this.callSetDisabledState==="whenDisabledForLegacyCode")&&this.setProperty("disabled",e),this.setDisabledStateFired=!0}fireUncheck(e){this.writeValue(e)}_checkName(){this.name&&this.formControlName&&(this.name,this.formControlName),!this.name&&this.formControlName&&(this.name=this.formControlName)}static \u0275fac=function(i){return new(i||n)(a(R),a(x),a(Zt),a(ce))};static \u0275dir=l({type:n,selectors:[["input","type","radio","formControlName",""],["input","type","radio","formControl",""],["input","type","radio","ngModel",""]],hostBindings:function(i,r){i&1&&v("change",function(){return r.onChange()})("blur",function(){return r.onTouched()})},inputs:{name:"name",formControlName:"formControlName",value:"value"},standalone:!1,features:[c([zt]),u]})}return n})(),Yt={provide:C,useExisting:d(()=>Kt),multi:!0},Kt=(()=>{class n extends S{writeValue(e){this.setProperty("value",parseFloat(e))}registerOnChange(e){this.onChange=i=>{e(i==""?null:parseFloat(i))}}static \u0275fac=(()=>{let e;return function(r){return(e||(e=m(n)))(r||n)}})();static \u0275dir=l({type:n,selectors:[["input","type","range","formControlName",""],["input","type","range","formControl",""],["input","type","range","ngModel",""]],hostBindings:function(i,r){i&1&&v("change",function(s){return r.onChange(s.target.value)})("input",function(s){return r.onChange(s.target.value)})("blur",function(){return r.onTouched()})},standalone:!1,features:[c([Yt]),u]})}return n})(),ut=new F(""),Jt={provide:M,useExisting:d(()=>Qt)},Qt=(()=>{class n extends M{_ngModelWarningConfig;callSetDisabledState;viewModel;form;set isDisabled(e){}model;update=new I;static _ngModelWarningSentOnce=!1;_ngModelWarningSent=!1;constructor(e,i,r,o,s){super(),this._ngModelWarningConfig=o,this.callSetDisabledState=s,this._setValidators(e),this._setAsyncValidators(i),this.valueAccessor=at(this,r)}ngOnChanges(e){if(this._isControlChanged(e)){let i=e.form.previousValue;i&&re(i,this,!1),$(this.form,this,this.callSetDisabledState),this.form.updateValueAndValidity({emitEvent:!1})}ot(e,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.form&&re(this.form,this,!1)}get path(){return[]}get control(){return this.form}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_isControlChanged(e){return e.hasOwnProperty("form")}static \u0275fac=function(i){return new(i||n)(a(w,10),a(ae,10),a(C,10),a(ut,8),a(N,8))};static \u0275dir=l({type:n,selectors:[["","formControl",""]],inputs:{form:[0,"formControl","form"],isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],standalone:!1,features:[c([Jt]),u,j]})}return n})(),en={provide:b,useExisting:d(()=>tn)},tn=(()=>{class n extends b{callSetDisabledState;get submitted(){return _(this._submittedReactive)}set submitted(e){this._submittedReactive.set(e)}_submitted=D(()=>this._submittedReactive());_submittedReactive=y(!1);_oldForm;_onCollectionChange=()=>this._updateDomValue();directives=[];form=null;ngSubmit=new I;constructor(e,i,r){super(),this.callSetDisabledState=r,this._setValidators(e),this._setAsyncValidators(i)}ngOnChanges(e){e.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(se(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(e){let i=this.form.get(e.path);return $(i,e,this.callSetDisabledState),i.updateValueAndValidity({emitEvent:!1}),this.directives.push(e),i}getControl(e){return this.form.get(e.path)}removeControl(e){re(e.control||null,e,!1),Gt(this.directives,e)}addFormGroup(e){this._setUpFormContainer(e)}removeFormGroup(e){this._cleanUpFormContainer(e)}getFormGroup(e){return this.form.get(e.path)}addFormArray(e){this._setUpFormContainer(e)}removeFormArray(e){this._cleanUpFormContainer(e)}getFormArray(e){return this.form.get(e.path)}updateModel(e,i){this.form.get(e.path).setValue(i)}onSubmit(e){return this._submittedReactive.set(!0),st(this.form,this.directives),this.ngSubmit.emit(e),this.form._events.next(new ee(this.control)),e?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(e=void 0,i={}){this.form.reset(e,i),this._submittedReactive.set(!1)}_updateDomValue(){this.directives.forEach(e=>{let i=e.control,r=this.form.get(e.path);i!==r&&(re(i||null,e),Ht(r)&&($(r,e,this.callSetDisabledState),e.control=r))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(e){let i=this.form.get(e.path);rt(i,e),i.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(e){if(this.form){let i=this.form.get(e.path);i&&jt(i,e)&&i.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){Ve(this.form,this),this._oldForm&&se(this._oldForm,this)}static \u0275fac=function(i){return new(i||n)(a(w,10),a(ae,10),a(N,8))};static \u0275dir=l({type:n,selectors:[["","formGroup",""]],hostBindings:function(i,r){i&1&&v("submit",function(s){return r.onSubmit(s)})("reset",function(){return r.onReset()})},inputs:{form:[0,"formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[c([en]),u,j]})}return n})();var nn={provide:C,useExisting:d(()=>ct),multi:!0};function dt(n,t){return n==null?`${t}`:(t&&typeof t=="object"&&(t="Object"),`${n}: ${t}`.slice(0,50))}function rn(n){return n.split(":")[0]}var ct=(()=>{class n extends S{value;_optionMap=new Map;_idCounter=0;set compareWith(e){this._compareWith=e}_compareWith=Object.is;appRefInjector=V(Ne).injector;destroyRef=V(O);cdr=V(fe);_queuedWrite=!1;_writeValueAfterRender(){this._queuedWrite||this.appRefInjector.destroyed||(this._queuedWrite=!0,Ie({write:()=>{this.destroyRef.destroyed||(this._queuedWrite=!1,this.writeValue(this.value))}},{injector:this.appRefInjector}))}writeValue(e){this.cdr.markForCheck(),this.value=e;let i=this._getOptionId(e),r=dt(i,e);this.setProperty("value",r)}registerOnChange(e){this.onChange=i=>{this.value=this._getOptionValue(i),e(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(e){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i),e))return i;return null}_getOptionValue(e){let i=rn(e);return this._optionMap.has(i)?this._optionMap.get(i):e}static \u0275fac=(()=>{let e;return function(r){return(e||(e=m(n)))(r||n)}})();static \u0275dir=l({type:n,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(i,r){i&1&&v("change",function(s){return r.onChange(s.target.value)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[c([nn]),u]})}return n})(),ei=(()=>{class n{_element;_renderer;_select;id;constructor(e,i,r){this._element=e,this._renderer=i,this._select=r,this._select&&(this.id=this._select._registerOption())}set ngValue(e){this._select!=null&&(this._select._optionMap.set(this.id,e),this._setElementValue(dt(this.id,e)),this._select._writeValueAfterRender())}set value(e){this._setElementValue(e),this._select&&this._select._writeValueAfterRender()}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select._writeValueAfterRender())}static \u0275fac=function(i){return new(i||n)(a(x),a(R),a(ct,9))};static \u0275dir=l({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return n})(),on={provide:C,useExisting:d(()=>ht),multi:!0};function Ge(n,t){return n==null?`${t}`:(typeof t=="string"&&(t=`'${t}'`),t&&typeof t=="object"&&(t="Object"),`${n}: ${t}`.slice(0,50))}function sn(n){return n.split(":")[0]}var ht=(()=>{class n extends S{value;_optionMap=new Map;_idCounter=0;set compareWith(e){this._compareWith=e}_compareWith=Object.is;writeValue(e){this.value=e;let i;if(Array.isArray(e)){let r=e.map(o=>this._getOptionId(o));i=(o,s)=>{o._setSelected(r.indexOf(s.toString())>-1)}}else i=(r,o)=>{r._setSelected(!1)};this._optionMap.forEach(i)}registerOnChange(e){this.onChange=i=>{let r=[],o=i.selectedOptions;if(o!==void 0){let s=o;for(let f=0;f<s.length;f++){let g=s[f],de=this._getOptionValue(g.value);r.push(de)}}else{let s=i.options;for(let f=0;f<s.length;f++){let g=s[f];if(g.selected){let de=this._getOptionValue(g.value);r.push(de)}}}this.value=r,e(r)}}_registerOption(e){let i=(this._idCounter++).toString();return this._optionMap.set(i,e),i}_getOptionId(e){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i)._value,e))return i;return null}_getOptionValue(e){let i=sn(e);return this._optionMap.has(i)?this._optionMap.get(i)._value:e}static \u0275fac=(()=>{let e;return function(r){return(e||(e=m(n)))(r||n)}})();static \u0275dir=l({type:n,selectors:[["select","multiple","","formControlName",""],["select","multiple","","formControl",""],["select","multiple","","ngModel",""]],hostBindings:function(i,r){i&1&&v("change",function(s){return r.onChange(s.target)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[c([on]),u]})}return n})(),ti=(()=>{class n{_element;_renderer;_select;id;_value;constructor(e,i,r){this._element=e,this._renderer=i,this._select=r,this._select&&(this.id=this._select._registerOption(this))}set ngValue(e){this._select!=null&&(this._value=e,this._setElementValue(Ge(this.id,e)),this._select.writeValue(this._select.value))}set value(e){this._select?(this._value=e,this._setElementValue(Ge(this.id,e)),this._select.writeValue(this._select.value)):this._setElementValue(e)}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}_setSelected(e){this._renderer.setProperty(this._element.nativeElement,"selected",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}static \u0275fac=function(i){return new(i||n)(a(x),a(R),a(ht,9))};static \u0275dir=l({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return n})();function an(n){return typeof n=="number"?n:parseInt(n,10)}function ft(n){return typeof n=="number"?n:parseFloat(n)}var ue=(()=>{class n{_validator=X;_onChange;_enabled;ngOnChanges(e){if(this.inputName in e){let i=this.normalizeInput(e[this.inputName].currentValue);this._enabled=this.enabled(i),this._validator=this._enabled?this.createValidator(i):X,this._onChange&&this._onChange()}}validate(e){return this._validator(e)}registerOnValidatorChange(e){this._onChange=e}enabled(e){return e!=null}static \u0275fac=function(i){return new(i||n)};static \u0275dir=l({type:n,features:[j]})}return n})(),ln={provide:w,useExisting:d(()=>un),multi:!0},un=(()=>{class n extends ue{max;inputName="max";normalizeInput=e=>ft(e);createValidator=e=>Le(e);static \u0275fac=(()=>{let e;return function(r){return(e||(e=m(n)))(r||n)}})();static \u0275dir=l({type:n,selectors:[["input","type","number","max","","formControlName",""],["input","type","number","max","","formControl",""],["input","type","number","max","","ngModel",""]],hostVars:1,hostBindings:function(i,r){i&2&&T("max",r._enabled?r.max:null)},inputs:{max:"max"},standalone:!1,features:[c([ln]),u]})}return n})(),dn={provide:w,useExisting:d(()=>cn),multi:!0},cn=(()=>{class n extends ue{min;inputName="min";normalizeInput=e=>ft(e);createValidator=e=>He(e);static \u0275fac=(()=>{let e;return function(r){return(e||(e=m(n)))(r||n)}})();static \u0275dir=l({type:n,selectors:[["input","type","number","min","","formControlName",""],["input","type","number","min","","formControl",""],["input","type","number","min","","ngModel",""]],hostVars:1,hostBindings:function(i,r){i&2&&T("min",r._enabled?r.min:null)},inputs:{min:"min"},standalone:!1,features:[c([dn]),u]})}return n})(),hn={provide:w,useExisting:d(()=>fn),multi:!0};var fn=(()=>{class n extends ue{required;inputName="required";normalizeInput=ge;createValidator=e=>$e;enabled(e){return e}static \u0275fac=(()=>{let e;return function(r){return(e||(e=m(n)))(r||n)}})();static \u0275dir=l({type:n,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(i,r){i&2&&T("required",r._enabled?"":null)},inputs:{required:"required"},standalone:!1,features:[c([hn]),u]})}return n})();var gn={provide:w,useExisting:d(()=>pn),multi:!0},pn=(()=>{class n extends ue{maxlength;inputName="maxlength";normalizeInput=e=>an(e);createValidator=e=>We(e);static \u0275fac=(()=>{let e;return function(r){return(e||(e=m(n)))(r||n)}})();static \u0275dir=l({type:n,selectors:[["","maxlength","","formControlName",""],["","maxlength","","formControl",""],["","maxlength","","ngModel",""]],hostVars:1,hostBindings:function(i,r){i&2&&T("maxlength",r._enabled?r.maxlength:null)},inputs:{maxlength:"maxlength"},standalone:!1,features:[c([gn]),u]})}return n})();var gt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=z({type:n});static \u0275inj=q({})}return n})();var ni=(()=>{class n{static withConfig(e){return{ngModule:n,providers:[{provide:N,useValue:e.callSetDisabledState??W}]}}static \u0275fac=function(i){return new(i||n)};static \u0275mod=z({type:n});static \u0275inj=q({imports:[gt]})}return n})(),ii=(()=>{class n{static withConfig(e){return{ngModule:n,providers:[{provide:ut,useValue:e.warnOnNgModelWithFormControl??"always"},{provide:N,useValue:e.callSetDisabledState??W}]}}static \u0275fac=function(i){return new(i||n)};static \u0275mod=z({type:n});static \u0275inj=q({imports:[gt]})}return n})();export{Fn as a,In as b,C as c,vt as d,Be as e,w as f,Oe as g,M as h,Yn as i,Kn as j,Bt as k,lt as l,$t as m,Qn as n,qt as o,Xt as p,Kt as q,Qt as r,tn as s,ct as t,ei as u,ti as v,un as w,cn as x,fn as y,pn as z,ni as A,ii as B};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-WEVA7DKF.js";import"./chunk-GBTE3TIN.js";import"./chunk-WG23DARU.js";export{a as CaseListComponent};
@@ -0,0 +1 @@
1
+ import{a as k,b as O}from"./chunk-GBTE3TIN.js";import{Aa as f,Db as x,Eb as E,Oa as C,Pa as p,Qa as m,T as a,Ta as g,Ua as v,Za as i,_a as o,_b as P,cb as b,eb as h,fa as u,fb as y,ic as w,lc as I,nc as M,sa as r,tb as s,ub as _}from"./chunk-WG23DARU.js";function S(t,e){t&1&&(i(0,"p",6),s(1,"No cases yet. Start one below."),o())}function T(t,e){if(t&1&&(i(0,"div",7)(1,"span",8),s(2),o(),i(3,"span",9),s(4),o()()),t&2){let n=e.$implicit;r(2),_(n.id),r(2),_(n.status)}}function z(t,e){if(t&1&&g(0,T,5,2,"div",7,C().trackById,!0),t&2){let n=y();v(n)}}function V(t,e){t&1&&p(0,S,2,0,"p",6)(1,z,2,0),t&2&&m(e.length===0?0:1)}var L=class t{http=a(w);router=a(M);route=a(I);config=a(k);caseController=a(O);namespaceId=this.route.snapshot.params.namespaceId;cases$=this.caseController.listByParent1(this.namespaceId);inputValue=u("");onInput(e){this.inputValue.set(e.target.value)}onKeydown(e){e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),this.submit())}submit(){this.inputValue().trim()&&this.http.post(`${this.config.basePath}/api/cases`,{namespaceId:this.namespaceId,metadata:{}}).subscribe(n=>{this.inputValue.set(""),this.router.navigate(["/agentos",this.namespaceId,"cases",n.id])})}trackById(e,n){return n.id}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=f({type:t,selectors:[["agentos-case-list"]],decls:11,vars:4,consts:[[1,"case-list"],[1,"case-list__header"],[1,"case-list__items"],[1,"case-list__composer"],["placeholder","Start a new case\u2026","rows","3",1,"case-list__input",3,"input","keydown","value"],[1,"case-list__hint"],[1,"case-list__empty"],[1,"case-list__item"],[1,"case-list__item-id"],[1,"case-list__item-status"]],template:function(n,l){if(n&1&&(i(0,"div",0)(1,"header",1)(2,"h2"),s(3,"Cases"),o()(),i(4,"div",2),p(5,V,2,1),x(6,"async"),o(),i(7,"div",3)(8,"textarea",4),h("input",function(d){return l.onInput(d)})("keydown",function(d){return l.onKeydown(d)}),o(),i(9,"p",5),s(10,"Press Enter to send, Shift+Enter for new line"),o()()()),n&2){let c;r(5),m((c=E(6,2,l.cases$))?5:-1,c),r(3),b("value",l.inputValue())}},dependencies:[P],styles:[".case-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;max-width:720px;margin:0 auto;padding:2rem;gap:1.5rem}.case-list__header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.case-list__items[_ngcontent-%COMP%]{flex:1;overflow-y:auto}.case-list__empty[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.case-list__composer[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.case-list__input[_ngcontent-%COMP%]{width:100%;resize:none;padding:.75rem 1rem;border-radius:12px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));color:var(--color-text, #1d1d1f);font-size:.95rem;font-family:inherit;line-height:1.5;outline:none;box-sizing:border-box;transition:border-color .15s ease}.case-list__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.case-list__input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.case-list__hint[_ngcontent-%COMP%]{margin:0;font-size:.75rem;color:var(--color-text-secondary, #6e6e73);opacity:.7}"]})};export{L as a};