1import{a as it,b as Lt}from"./chunk-IVXFSS72.js";import{a as n,b as wt,c as A,d as tt}from"./chunk-JQXTJ3NB.js";import{a as et,b as Ft}from"./chunk-EWK2SSQC.js";import{a as Ne,b as vt}from"./chunk-Q24DMAVS.js";import{a as _e,b as Xe}from"./chunk-OPKYCR3Z.js";import{a as We,b as Ze,c as Ye}from"./chunk-7PMPKZBH.js";import{a as u,b as Ue,c as f,d as Be,e as Ke}from"./chunk-E74LZWZA.js";import{a as $,b as yt}from"./chunk-46OL7WOI.js";import{a as oe,b as xt}from"./chunk-LSI3ALCX.js";import{b as xe,d as Tt}from"./chunk-WA6CMZZT.js";import{d as ie,g as Pt}from"./chunk-WG5UC7GQ.js";import"./chunk-DKGLJWI4.js";import{d as Je,f as Mt}from"./chunk-H2IHNPAE.js";import"./chunk-YYQWPRWZ.js";import"./chunk-TBT3ZXV3.js";import{a as Qe,b as kt}from"./chunk-U5HMTXMF.js";import"./chunk-ETYUKCND.js";import{a as R,b as pe}from"./chunk-56T4BLNX.js";import{a as E,b as M,c as qe,d as F,g as w,i as N}from"./chunk-OKKXXE6U.js";import"./chunk-7RNOXEAC.js";import{I as Dt,u as Ce}from"./chunk-JZKSQYUK.js";import"./chunk-W4GMHQFP.js";import{a as Oe,b as ht}from"./chunk-LMEWIH4L.js";import{e as Z,f as Y,g as H}from"./chunk-53JIH2RP.js";import"./chunk-UCDH2FPD.js";import{a as B,b as K,i as W}from"./chunk-7GAYV3L3.js";import"./chunk-FWDKKLTJ.js";import"./chunk-SYSO6FKY.js";import"./chunk-SMHBTYZ5.js";import{F as Q,G as z,H as U,b as q,d as y,g as V,h as j,i as de,j as Ve,k as b,o as G,p as ue,r as je,u as fe,v as ge}from"./chunk-OKMJK5O3.js";import"./chunk-DBTIYNVI.js";import"./chunk-SEHASOTY.js";import{a as He,b as Et}from"./chunk-HKUBF5RU.js";import"./chunk-YE4K5QIV.js";import"./chunk-PZVXREA4.js";import{a as ze,b as St}from"./chunk-LFZS5KZ5.js";import{g as L,i as me}from"./chunk-UIBJVLO3.js";import"./chunk-VD4QE6ER.js";import"./chunk-7K34GDKE.js";import"./chunk-TS32VRUD.js";import{E as _t,g as Ae,i as Ie,q as te}from"./chunk-7L27BDPL.js";import"./chunk-BFTIQ2FP.js";import"./chunk-YXPM6B6U.js";import{e as Ge,f as bt}from"./chunk-IXAMAGTW.js";import"./chunk-5G6RYABW.js";import{n as $e,s as Ct}from"./chunk-FUM4WPNX.js";import{n as we,s as Le,w as Re}from"./chunk-NOMO3ERR.js";import"./chunk-X5ABTCX7.js";import"./chunk-2EX2QP7W.js";import"./chunk-R3HFPUDU.js";import"./chunk-FZGIOLLW.js";import"./chunk-MBNWJ725.js";import"./chunk-5PKUNPXF.js";import"./chunk-I7DFKFDU.js";import"./chunk-ES3I7JXJ.js";import"./chunk-5XA6NXWV.js";import"./chunk-MEDUJNMX.js";import"./chunk-HHBTWF3C.js";import{Ce as k,D as m,Ea as ft,Ic as p,Ja as Ee,Kc as d,Nc as ae,Oa as P,Oc as se,Pc as h,Qc as r,R as _,Rc as a,Sc as x,U as X,Vb as s,Xa as re,Ya as le,Zc as Pe,dc as ve,ed as C,gd as T,hb as Me,jb as Fe,kc as S,lb as gt,vd as l,wd as ee,x as ne,xa as g,xd as ce}from"./chunk-J4S5G7ZA.js";import{a as D,b as I,e as O}from"./chunk-RJZPLZKV.js";function Rt(t,c){t&1&&l(0," Link name is required ")}function $t(t,c){t&1&&l(0," Name should include non space characters. ")}function At(t,c){t&1&&(r(0,"mat-error",4)(1,"div",7),l(2," This configuration may lead to a resource shortage. If a task configuration parameter is missing, the connected pool may lack the resources required to support this profile. "),a()())}var rt,lt=O(()=>{k();U();pe();H();N();Mt();me();k();H();U();rt=(()=>{class t{constructor(){this.dialog=P(E),this.data=P(M),this.name=new b("",[y.required,y.pattern(Je)])}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=S({type:t,selectors:[["sm-create-link-dialog-dialog"]],decls:15,vars:5,consts:[["header","CONNECT PROFILE","iconClass","al-ico-link-plus",3,"xClicked"],[3,"submit"],["appearance","outline"],["matInput","",3,"formControl"],[1,"d-flex","mt-2"],["mat-stroked-button","","mat-dialog-close","","data-id","Cancel",3,"click"],["data-id","Save","mat-flat-button","",3,"click","disabled"],[1,"form-warning","warn"]],template:function(o,i){o&1&&(r(0,"sm-dialog-template",0),C("xClicked",function(){return i.dialog.close(null)}),r(1,"form",1),C("submit",function(){return i.name.value&&i.dialog.close(i.name.value)}),r(2,"mat-form-field",2)(3,"mat-label"),l(4,"Link Name"),a(),x(5,"input",3),r(6,"mat-error"),p(7,Rt,1,0),p(8,$t,1,0),a()(),p(9,At,3,0,"mat-error",4),a(),r(10,"mat-dialog-actions")(11,"button",5),C("click",function(){return i.dialog.close(null)}),l(12,"CANCEL"),a(),r(13,"button",6),C("click",function(){return i.dialog.close(i.name.value)}),l(14,"LINK"),a()()()),o&2&&(s(5),h("formControl",i.name),s(2),d(i.name.errors!=null&&i.name.errors.required?7:-1),s(),d(i.name.errors!=null&&i.name.errors.pattern?8:-1),s(),d(i.data.dynamicFallbackWarning?9:-1),s(4),h("disabled",i.name.invali
1d))},dependencies:[R,Y,Z,W,B,K,z,G,q,V,j,je,Q,Ve,w,L,F],styles:[".actions[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:32px}.actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{min-width:112px}mat-form-field[_ngcontent-%COMP%]{width:100%}.form-warning[_ngcontent-%COMP%]{text-align:justify;width:400px;margin-bottom:8px}.form-warning.warn[_ngcontent-%COMP%]{color:var(--color-warning)}"]})}}return t})()});function It(t,c){t&1&&l(0," Name is required ")}function Ot(t,c){t&1&&l(0," Name should be at least 3 characters long ")}function Nt(t,c){if(t&1&&(r(0,"mat-error"),p(1,It,1,0)(2,Ot,1,0),a()),t&2){let e=c;s(),d(e.required?1:e!=null&&e.minlength?2:-1)}}function qt(t,c){if(t&1&&l(0),t&2){let e=T();ce(" ",e.usage>1?"Number of resources should not be less than current usage":"Minimum number of resources should be 1"," ")}}function Vt(t,c){t&1&&l(0,"Resources number is required")}function jt(t,c){t&1&&(r(0,"mat-error",8)(1,"div",9),l(2," This configuration will cause an insufficient resources problem: Some of the profiles connected to this pool have resource allotments that exceeds this pool number of resources. Saving will disconnect them from this pool "),a()())}function Gt(t,c){t&1&&(r(0,"mat-error",8)(1,"div",10),l(2," This configuration may lead to a resource shortage. If a task configuration parameter is missing, some of the connected profiles to this pool will have resource allotments that exceeds this pool number of resources. "),a()())}function Qt(t,c){if(t&1&&p(0,jt,3,0,"mat-error",8)(1,Gt,3,0,"mat-error",8),t&2){let e=T();d(e.poolForm.get("resources").value<(e.maxProfileCost==null?null:e.maxProfileCost.profile_cost)?0:e.poolForm.get("resources").value<(e.maxProfileFallback==null?null:e.maxProfileFallback.profile_cost)?1:-1)}}function zt(t,c){t&1&&l(0," SAVE ")}function Ut(t,c){t&1&&l(0," CREATE ")}var Te,at=O(()=>{k();N();pe();U();H();me();Xe();k();U();H();Te=(()=>{class t{constructor(){this.dialog=P(E),this.data=P(M),this.edit=!!this.data,this.usage=this.data?.usage,this.profilePoolLinks=this.data?.profileLinks,this.maxProfileCost=this.profilePoolLinks?.filter(e=>!e.profileCostField).reduce((e,o)=>e&&e.profile_cost>o.profile_cost?e:o,{})??null,this.maxProfileFallback=this.profilePoolLinks?.filter(e=>e.profileCostField).reduce((e,o)=>e&&e.profile_cost>o.profile_cost?e:o,{})??null,this.poolForm=new de({name:new b(this.data?.name??"",[y.required,_e(3)]),resources:new b(this.data?.resources??null,[y.required,y.min(this.data?.usage>1?this.data.usage:1)]),description:new b(this.data?.description??null)})}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=S({type:t,selectors:[["sm-create-pool-dialog"]],decls:25,vars:8,consts:[["iconClass","al-ico-queues",3,"xClicked","header"],[1,"form",3,"submit","formGroup"],["appearance","outline"],["matInput","","formControlName","name","placeholder","Pool name","data-id","poolNameField"],["type","number","matInput","","formControlName","resources","placeholder","Number of resources available for this pool","data-id","noOfResourcesField"],["matInput","","formControlName","description","placeholder","Pool description","data-id","poolDescriptionField",1,"description"],["mat-stroked-button","","mat-dialog-close","","data-id","Cancel",3,"click"],["data-id","Save","mat-flat-button","",3,"click","disabled"],[1,"d-flex"],[1,"form-warning"],[1,"form-warning","warn"]],template:function(o,i){if(o&1&&(r(0,"sm-dialog-template",0),C("xClicked",function(){return i.dialog.close(null)}),r(1,"form",1),C("submit",function(){return i.dialog.close(i.poolForm.value)}),r(2,"mat-form-field",2)(3,"mat-label"),l(4,"Name"),a(),x(5,"input",3),p(6,Nt,3,1,"mat-error"),a(),r(7,"mat-form-field",2)(8,"mat-label"),l(9,"Number of Resources"),a(),x(10,"input",4),r(11,"mat-error"),p(12,qt,1,1),p(13,Vt,1,0),a()(),p(14,Qt,2,1),r(15,"mat-form-field",2)(16,"mat-label"),l(17,"Description"),a(),x(18,"textarea",5),a()(),r(19,"mat-dialog-actions")(20,"button",6),C("click",function(){return i.dialog.close(null)}),l(21,"CANCEL"),a(),r(22,"button",7),C("click",function(){return i.dialog.close(i.poolForm.value)}),p(23,zt,1,0)(24,Ut,1,0),a()()()),o&2){let v,J,ke,Se;h("header",i.edit?"EDIT POOL":"CREATE POOL"),s(),h("formGroup",i.poolForm),s(5),d((v=i.poolForm.get("name").errors)?6:-1,v),s(6),d((J=i.poolForm.get("resources").errors)!=null&&J.min?12:-1),s(),d((ke=i.poolForm.get("resources").errors)!=null&&ke.required?13:-1),s(),d((Se=i.poolForm.get("resources").errors)!=null&&Se.min?-1:14),s(8),h("disabled",i.poolForm.invali
1d),s(),d(i.edit?23:24)}},dependencies:[R,Q,G,q,ue,V,j,z,ge,fe,Y,Z,W,B,K,w,L,F],styles:[".form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;align-items:center}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:32px}.actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{min-width:112px}mat-form-field[_ngcontent-%COMP%]{width:100%}.form-warning[_ngcontent-%COMP%]{text-align:justify;width:100%;margin-bottom:8px}.form-warning.warn[_ngcontent-%COMP%]{color:var(--color-warning)}.description[_ngcontent-%COMP%]{min-height:80px;resize:none}"]})}}return t})()});function Bt(t,c){t&1&&l(0," Profile name is required ")}function Kt(t,c){t&1&&l(0," Profile name should be at least 3 characters long ")}function Wt(t,c){if(t&1&&(r(0,"mat-error"),p(1,Bt,1,0)(2,Kt,1,0),a()),t&2){let e=c;s(),d(e.required?1:e!=null&&e.minlength?2:-1)}}function Zt(t,c){t&1&&(r(0,"mat-error"),l(1,"Please enter a valid key path starting with 'runtime.', 'hyperparams.' or 'configuration.'"),a())}function Yt(t,c){if(t&1&&(r(0,"mat-form-field",6)(1,"mat-label"),l(2,"Task Configuration Parameter "),x(3,"span",11),r(4,"sm-multi-line-tooltip",5)(5,"span"),l(6," The task field the policy manager will look for the task's resource allotment. Supported Task fields: runtime properties "),r(7,"code"),l(8,"runtime"),a(),l(9,", hyperparameters "),r(10,"code"),l(11,"hyperparams"),a(),l(12," and configuration "),r(13,"code"),l(14,"configuration"),a(),l(15," e.g. "),r(16,"code"),l(17,"hyperparams.Args.cost"),a(),l(18,", "),r(19,"code"),l(20,"runtime.required_gpus"),a(),l(21," etc. "),a()()(),x(22,"input",12),p(23,Zt,2,0,"mat-error"),a()),t&2){let e=T();h("hideRequiredMarker",!0),s(4),h("smallIcon",!0),s(19),d(!(e.profileForm.controls.cost_field==null||e.profileForm.controls.cost_field.errors==null)&&e.profileForm.controls.cost_field.errors.pattern?23:-1)}}function Ht(t,c){t&1&&l(0," Resource allotment is required please enter a number bigger than zero ")}function Jt(t,c){t&1&&l(0," Resource allotment should be bigger than zero ")}function Xt(t,c){if(t&1&&(r(0,"mat-error"),p(1,Ht,1,0)(2,Jt,1,0),a()),t&2){let e=c;s(),d(e!=null&&e.required?1:e!=null&&e.min?2:-1)}}function ei(t,c){t&1&&(r(0,"div",13),l(1," This configuration may lead to a resource shortage. If a task configuration parameter is missing, some connected pools may lack the resources required to support this profile. "),a())}function ti(t,c){t&1&&(r(0,"div",14),l(1," This configuration will cause an insufficient resources problem: Some of the pools connected to this profile don't have enough resources to service this profile configuration. Saving will disconnect them from this profile. "),a())}function ii(t,c){if(t&1&&(r(0,"mat-error",8),p(1,ei,2,0,"div",13)(2,ti,2,0,"div",14),a()),t&2){let e=T();s(),d(e.useDynamicCapacity()?1:2)}}function oi(t,c){t&1&&l(0," SAVE ")}function ni(t,c){t&1&&l(0," CREATE ")}var ye,st=O(()=>{k();N();pe();U();H();me();Xe();Ye();Et();k();U();H();Ye();ye=(()=>{class t{constructor(){this.dialog=P(E),this.data=P(M),this.useDynamicCapacity=Me(!!this.data?.cost_field),this.profileForm=new de({name:new b(this.data?.name??null,[y.required,_e(3)]),profile_cost:new b(this.data?.profile_cost??null,[y.required,y.min(1e-4)]),cost_field:new b(this.data?.cost_field??null)}),this.edit=!!this.data,this.poolsLinks=this.data?.poolsLinks,this.minPoolResourcesNumber=this.poolsLinks?.reduce((e,o)=>e&&e.poolConfig?.resources<o.poolConfig?.resources?e:o,{})??null,Fe(()=>{this.useDynamicCapacity()?this.profileForm.controls.cost_field.setValidators([y.required,y.pattern(/^(runtime|hyperparams|configuration)\.[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*|\[\d+\])*$/)]):this.profileForm.controls.cost_field.setValidators([]),this.profileForm.controls.cost_field.updateValueAndValidity(),this.profileForm.updateValueAndValidity()})}toggleDynamicCapacity(){this.useDynamicCapacity.update(e=>!e),this.useDynamicCapacity()||this.profileForm.controls.cost_field.setValue(null)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=S({type:t,selectors:[["sm-create-profile-dialog"]],decls:29,vars:11,consts:[["iconClass","al-ico-queues",3,"xClicked","header"],[1,"form",3,"submit","formGroup"],["appearance","outline"],["matInput","","formControlName","name","placeholder","Profile name","data-id","profileNameField"],["data-id","dynamicResourceToggle",3,"change","checked"],[3,"smallIcon"],["appearance","outline",3,"hideRequiredMarker"],["type","number","matInput","","formControlName","profile_cost","placeholder","Resource allotment (number)","data-id","rersourceAllotmentField"],[1,"d-flex"],["mat-stroked-button","","mat-dialog-close","","data-id","Cancel",3,"click"],["data-id","Save","mat-flat-button","",3,"click","disabled"],[1,"mat-mdc-form-field-required-marker","mdc-floating-label--required"],["matInput","","formControlName","cost_field","placeholder","e.g. hyperparams.Args.required_gpus","data-id","keyPathField"],[1,"form-warning","warn"],[1,"form-warning"]],template:function(o,i){if(o&1&&(r(0,"sm-dialog-template",0),C("xClicked",function(){return i.dialog.close(null)}),r(1,"form",1),C("submit",function(){return i.dialog.close(i.profileForm.value)}),r(2,"mat-form-field",2)(3,"mat-label"),l(4,"Name"),a(),x(5,"input",3),p(6,Wt,3,1,"mat-error"),a(),r(7,"mat-slide-toggle",4),C("change",function(){return i.toggleDynamicCapacity()}),l(8," Dynamic Resource Capacity "),r(9,"sm-multi-line-tooltip",5)(10,"div"),l(11,"Dynamic resource capacity lets each task specify the number of resources it requires instead of a fixed resource allotment for all tasks executed through this profile."),a(),r(12,"div"),l(13,"The policy defines a custom configuration parameter where tasks should fill in their required resource allotment."),a(),r(14,"div"),l(15,"A default resource allotment is defined for tasks with
1no specification."),a()()(),p(16,Yt,24,3,"mat-form-field",6),r(17,"mat-form-field",2)(18,"mat-label"),l(19),a(),x(20,"input",7),p(21,Xt,3,1,"mat-error"),a(),p(22,ii,3,1,"mat-error",8),a(),r(23,"mat-dialog-actions")(24,"button",9),C("click",function(){return i.dialog.close(null)}),l(25,"CANCEL"),a(),r(26,"button",10),C("click",function(){return i.dialog.close(i.profileForm.value)}),p(27,oi,1,0)(28,ni,1,0),a()()()),o&2){let v,J;h("header",i.edit?"EDIT PROFILE":"CREATE PROFILE"),s(),h("formGroup",i.profileForm),s(5),d((v=i.profileForm.controls.name.errors)?6:-1,v),s(),h("checked",i.useDynamicCapacity()),s(2),h("smallIcon",!0),s(7),d(i.useDynamicCapacity()?16:-1),s(3),ce("",i.useDynamicCapacity()?"Default ":"","Resource Allotment"),s(2),d((J=i.profileForm.controls.profile_cost.errors)?21:-1,J),s(),d(i.minPoolResourcesNumber!=null&&i.minPoolResourcesNumber.poolConfig&&i.profileForm.controls.profile_cost.value>(i.minPoolResourcesNumber==null||i.minPoolResourcesNumber.poolConfig==null?null:i.minPoolResourcesNumber.poolConfig.resources)?22:-1),s(4),h("disabled",i.profileForm.invalid),s(),d(i.edit?27:28)}},dependencies:[R,Q,G,q,ue,V,j,z,ge,fe,Y,Z,W,B,K,w,L,F,Ze,We,He],styles:[".form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;align-items:center}mat-slide-toggle[_ngcontent-%COMP%]{width:400px;margin-bottom:12px}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:32px}.actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{min-width:112px}mat-form-field[_ngcontent-%COMP%]{width:400px;margin-bottom:12px}.form-warning[_ngcontent-%COMP%]{text-align:justify;width:400px;margin-bottom:8px}.form-warning.warn[_ngcontent-%COMP%]{color:var(--color-warning)}"]})}}return t})()});function ri(t,c){}function li(t,c){t&1&&x(0,"i",3)}function ai(t,c){if(t&1&&(r(0,"li"),l(1),a()),t&2){let e=c.$implicit;s(),ee(e.name)}}function si(t,c){if(t&1&&(r(0,"div")(1,"div",1),p(2,li,1,0,"i",3),r(3,"div")(4,"div",4),l(5,"The saved configuration is invalid and cannot be provisioned."),a(),r(6,"div",5),l(7,"The following profiles have no resource pool links:"),a(),r(8,"ul"),ae(9,ai,2,1,"li",null,De),a()()()()),t&2){let e=T();s(2),d((e.affectedPolicies==null?null:e.affectedPolicies.length)>0?2:-1),s(7),se(e.notLinkedProfiles)}}function ci(t,c){t&1&&x(0,"i",6)}function mi(t,c){if(t&1&&(r(0,"span",9),l(1),a(),r(2,"span"),l(3),a(),r(4,"span"),l(5),a()),t&2){let e=c.$implicit,o=T().$implicit;h("smTooltip",e.display_name||e.name),s(),ee(e.display_name||e.name),s(2),ee(e.tasks),s(2),ee(o.name)}}function pi(t,c){if(t&1&&ae(0,mi,6,4,null,null,De),t&2){let e=c.$implicit;se(e.queues_to_delete)}}function di(t,c){if(t&1&&(r(0,"div",1),p(1,ci,1,0,"i",6),r(2,"div")(3,"div",4),l(4,"The following queues will be removed (Any pending tasks will be set to Draft state):"),a(),r(5,"div",7)(6,"div",8),l(7,"Queue"),a(),r(8,"div",8),l(9,"Pending Tasks on queue"),a(),r(10,"div",8),l(11,"Policy"),a(),ae(12,pi,2,0,null,null,De),a()()()),t&2){let e=T();s(),d((e.notLinkedProfiles==null?null:e.notLinkedProfiles.length)>0?1:-1),s(11),se(e.affectedPolicies)}}function ui(t,c){if(t&1){let e=Pe();r(0,"button",10),C("click",function(){re(e);let i=T();return le(i.closeDialog(!1))}),l(1,"CANCEL"),a(),r(2,"button",11),C("click",function(){re(e);let i=T();return le(i.closeDialog(!0))}),l(3,"PROVISION"),a()}if(t&2){let e=T();s(2),h("disabled",(e.notLinkedProfiles==null?null:e.notLinkedProfiles.length)>0)}}function fi(t,c){if(t&1){let e=Pe();r(0,"button",12),C("click",function(){re(e);let i=T();return le(i.closeDialog(!1))}),l(1,"OK"),a()}}var De,be,ct=O(()=>{pe();N();St();kt();bt();me();k();N();De=(t,c)=>c.id;be=(()=>{class t{constructor(e,o){this.data=e,this.dialogRef=o,this.TestCases={invalid:{mainIcon:"al-ico-close-circle",mainTitle:"Invalid Configuration"},effectedQueuesTest:{mainIcon:"al-ico-alert",mainTitle:"Configuration change expected impact"},effectedQueuesProvisioning:{mainIcon:"al-ico-alert",mainTitle:"New configuration impact"},invalidAndEffectedQueues:{mainIcon:"al-ico-alert",mainTitle:"Configuration change expected impact"},valid:{mainIcon:"al-ico-completed",mainTitle:"Configuration valid"}},this.notLinkedProfiles=e.not_linked_profiles,this.affectedPolicies=e.affected_policies,this.isTest=e.test,this.isValid=this.notLinkedProfiles?.length===0,this.isTest?this.isValid?this.testRes=this.affectedPolicies.length===0?this.TestCases.valid:this.TestCases.effectedQueuesTest:this.testRes=this.affectedPolicies.length===0?this.TestCases.invalid:this.TestCases.invalidAndEffectedQueues:this.testRes=this.isValid?this.TestCases.effectedQueuesProvisioning:this.TestCases.invalid}closeDialog(e){e?this.dialogRef.close(!0):this.dialogRef.close(!1)}static{this.\u0275fac=function(o){return new(o||t)(ve(M),ve(E))}}static{this.\u0275cmp=S({type:t,selectors:[["sm-test-configuration-dialog"]],decls:7,vars:6,consts:[[3,"header","iconClass"],[1,"d-flex"],["mat-flat-button","","data-id","Ok"],[1,"al-icon","al-ico-status-failed","
1sm"],[1,"title"],[1,"mt-3"],[1,"al-icon","al-ico-alert-outline","sm"],[1,"policy-queues-list"],[1,"col-header"],["smShowTooltipIfEllipsis","","smClickStopPropagation","",1,"ellipsis","queue",3,"smTooltip"],["mat-stroked-button","","mat-dialog-close","","data-id","Cancel",3,"click"],["data-id","Save","mat-flat-button","",3,"click","disabled"],["mat-flat-button","","data-id","Ok",3,"click"]],template:function(o,i){o&1&&(r(0,"sm-dialog-template",0),p(1,ri,0,0),p(2,si,11,1,"div"),p(3,di,14,1,"div",1),r(4,"mat-dialog-actions"),p(5,ui,4,1)(6,fi,2,0,"button",2),a()()),o&2&&(h("header",i.testRes.mainTitle)("iconClass",i.testRes.mainIcon),s(),d((i.notLinkedProfiles==null?null:i.notLinkedProfiles.length)===0&&(i.affectedPolicies==null?null:i.affectedPolicies.length)===0?1:-1),s(),d((i.notLinkedProfiles==null?null:i.notLinkedProfiles.length)>0?2:-1),s(),d((i.isTest||!i.isTest&&i.isValid)&&i.affectedPolicies.length>0?3:-1),s(2),d(i.isTest?6:5))},dependencies:[R,ze,Qe,Ge,w,L,F],styles:[".title[_ngcontent-%COMP%]{color:var(--color-on-surface-variant);font-weight:500;margin-bottom:2px;display:flex;align-items:center;gap:6px}.al-ico-status-failed[_ngcontent-%COMP%]{color:var(--color-on-erorr);margin-right:6px}.al-ico-alert-outline[_ngcontent-%COMP%]{margin-right:6px}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;justify-content:center;margin-top:32px}.policy-queues-list[_ngcontent-%COMP%]{margin-bottom:32px;margin-top:6px;display:grid;grid-template-columns:minmax(100px,auto) auto auto;align-items:center;gap:8px 0}.policy-queues-list[_ngcontent-%COMP%] .col-header[_ngcontent-%COMP%]{padding:4px 8px;color:var(--color-on-surface-variant);background:var(--color-surface-container-highest);border-right:1px solid var(--color-on-surface);font-size:11px;font-weight:500;text-transform:uppercase;white-space:nowrap}.policy-queues-list[_ngcontent-%COMP%] .col-header[_ngcontent-%COMP%]:nth-child(1){border-radius:4px 0 0 4px}.policy-queues-list[_ngcontent-%COMP%] .col-header[_ngcontent-%COMP%]:nth-child(3){border-radius:0 4px 4px 0;border-right:0}.policy-queues-list[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{padding:0 8px;font-size:14px;color:var(--color-on-surface-variant)}.policy-queues-list[_ngcontent-%COMP%] > span.queue[_ngcontent-%COMP%]{font-weight:500}"]})}}return t})()});var mt,pt=O(()=>{k();Pt();Ke();Re();xt();gt();Lt();tt();wt();Tt();N();lt();at();_t();st();yt();Ft();ct();Ct();ft();Dt();k();mt=(()=>{class t{constructor(){this.actions$=P(Ue),this.store=P(we),this.dialog=P(qe),this.resourceService=P(it),this.queuesApiService=P(et),this.activateLoader=u(()=>this.actions$.pipe(f(n.getResources,n.provisionCall,n.setEditMode,n.save),_(e=>!e.autoRefresh),m(()=>Ae("resources")))),this.deactivateLoader=u(()=>this.actions$.pipe(f(n.setResources,n.provisionSuccess,n.setDataSaved,n.saveFailed),m(()=>Ie("resources")))),this.getResources=u(()=>this.actions$.pipe(f(n.getResources,n.setEditMode),oe(()=>this.store.select(A.selectEditMode)),g(([e,o])=>this.resourceService.resourcesGetResourceConfiguration({edit:e.edit??o})),m(e=>n.setResources(e)))),this.checkEditConfigurationForNonProvisioned=u(()=>this.actions$.pipe(f(n.getResources,n.setDataSaved,n.provisionSuccess),g(()=>this.resourceService.resourcesCheckEditConfiguration({})),m(e=>n.setUnprovisioned(e)))),this.testConfiguration=u(()=>this.actions$.pipe(f(n.testConfiguration),g(()=>this.resourceService.resourcesTestConfigurationPublishing({})),g(e=>this.dialog.open(be,{data:I(D({},e),{test:!0})}).afterClosed().pipe(m(()=>$e()))))),this.resetToProvisioned=u(()=>this.actions$.pipe(f(n.resetToProvisioned),g(()=>this.dialog.open($,{data:{title:"Reset Configuration",body:`Are you sure you want to Reset Configuration to currently provisioned values?<br> 2 This will delete all unprovisioned changes you made (saved & unsaved).`,centerText:!0,yes:"Reset",no:"Cancel",iconClass:"al-ico-reset"},panelClass:"dialog-md"}).afterClosed().pipe(_(e=>!!e),g(()=>this.resourceService.resourcesResetResourceConfiguration({})),m(()=>n.getResources({edit:!1})))))),this.createPool$=u(()=>this.actions$.pipe(f(n.createPool),g(()=>this.dialog.open(Te,{panelClass:"dialog-md"}).afterClosed().pipe(_(e=>!!e),m(e=>({id:xe(),name:e.name,resources:e.resources,description:e.description,links:[]})),m(e=>n.addPool({pool:e})))))),this.updatePool$=u(()=>this.actions$.pipe(f(n.updatePools),m(e=>n.updatePoolsSuccess({pool:e.pool})))),this.editPool$=u(()=>this.actions$.pipe(f(n.editPool),g(e=>this.dialog.open(Te,{data:{name:e.pool.name,resources:e.pool.resources,usage:e.pool.usage,profileLinks:e.profileLinks,description:e.pool.description},panelClass:"dialog-md"}).afterClosed().pipe(_(o=>!!o),m(o=>n.editPoolSuccess({pool:D(D({},e.pool),o),profileLinks:e.profileLinks})))))),this.editPoolSuccess$=u(()=>this.actions$.pipe(f(n.editPoolSuccess),_(e=>!e.profileLinks.find(o=>!o.profileCostField&&o.profile_cost>e.pool.resources)),m(e=>n.updatePools({pool:e.pool})))),this.disconnectLinksAfterEditPools$=u(()=>this.actions$.pipe(f(n.editPoolSuccess),_(e=>!!e.profileLinks.find(o=>!o.profileCostField&&o.profile_cost>e.pool.resources)),g(e=>{let o=e.profileLinks.filter(i=>!i.profileCostField&&i.profile_cost>e.pool.resources).map(i=>i.profileName);return this.dialog.open($,{data:{title:"DISCONNECT LINKS",body:`INSUFFICIENT RESOURCES: ${o.join(" & ")} resource allotments exceeds this pool number of resources. Saving will disconnect ${o.length>1?"these profiles":"this profile"} from this pool`,centerText:!0,yes:"Disconnect",no:"Cancel",iconClass:"al-ico-link-off"},panelClass:"dialog-md"}).afterClosed().pipe(_(i=>i),m(()=>n.disconnectProfileSuccess({queueIds:e.profileLinks.filter(i=>!i.profileCostField&&i.profile_cost>e.pool.resources).map(i=>i.id),pool:e.pool})))}))),this.updatePoolAfterLinkDisconnection$=u(()=>this.actions$.pipe(f(n.disconnectProfileSuccess),_(e=>!!e.pool),oe(()=>[this.store.select(A.selectPools)]),m(([e,o])=>n.updatePools({pool:I(D({},e.pool),{links:o.find(i=>i.id===e.pool.id).links})})))),this.deletePool$=u(()=>this.actions$.pipe(f(n.deletePool),g(e=>this.dialog.open($,{data:{title:"DELETE POOL",body:`Are you sure you want to delete pool <b>${Ce(e.pool.name,200)}</b>?`,centerText:!0,yes:"DELETE",no:"Cancel",iconClass:"al-ico-trash"},panelClass:"dialog-md"}).afterClosed().pipe(_(o=>!!o),m(()=>n.removePool({pool:e.pool})))))),this.createProfile$=u(()=>this.actions$.pipe(f(n.createProfile),g(()=>this.dialog.open(ye).afterClosed().pipe(_(e=>!!e),m(e=>({id:xe(),name:e.name,queued_jobs:0,running_jobs:0,profile_cost:e.profile_cost,cost_field:e.cost_field,pool_links:[],policy_connections:[]})),m(e=>n.addProfile({profile:e})))))),this.editProfile$=u(()=>this.actions$.pipe(f(n.editProfile),g(e=>this.dialog.open(ye,{data:{name:e.profile.name,profile_cost:e.profile.profile_cost,cost_field:e.profile.cost_field,poolsLinks:e.poolsLinks}}).afterClosed().pipe(_(o=>!!o),m(o=>n.editProfileSuccess({profile:D(D({},e.profile),o),poolsLinks:e.poolsLinks})))))),this.editProfileSuccess$=u(()=>this.actions$.pipe(f(n.editProfileSuccess),_(e=>!!e.profile.cost_field||!e.poolsLinks.find(o=>o?.poolConfig?.resources<e.profile.profile_cost)),m(e=>n.updateProfile({profile:e.profile})))),this.disconnectLinksAfterEditProfile$=u(()=>this.actions$.pipe(f(n.editProfileSuccess),_(e=>!!e.poolsLinks.find(o=>!e.profile.cost_field&&o?.poolConfig?.resources<e.profile.profile_cost)),g(e=>{let o=e.poolsLinks.filter(i=>i?.poolConfig?.resources<e.profile.profile_cost).map(i=>i.poolConfig.name);return this.dialog.open($,{data:{title:"DISCONNECT LINKS",body:`INSUFFICIENT RESOURCES: This profile resource allotments exceeds ${o.join(" & ")} pool${o.length>
21?"s":""} number of resources. Saving will disconnect ${o.length>1?"these pools":"this pool"} from this profile`,centerText:!0,yes:"Disconnect",no:"Cancel",iconClass:"al-ico-link-off"},panelClass:"dialog-md"}).afterClosed().pipe(_(i=>i),m(()=>n.disconnectProfileSuccess({queueIds:e.poolsLinks.filter(i=>i.poolConfig.resources<e.profile.profile_cost).map(i=>i.id),profile:e.profile})))}))),this.updateProfileAfterLinkDisconnection$=u(()=>this.actions$.pipe(f(n.disconnectProfileSuccess),_(e=>!!e.profile),oe(()=>[this.store.select(A.selectProfiles)]),m(([e,o])=>n.updateProfile({profile:I(D({},e.profile),{pool_links:o.find(i=>i.id===e.profile.id).pool_links})})))),this.activatePolicy$=u(()=>this.actions$.pipe(f(n.activatePolicy),g(e=>this.queuesApiService.queuesGetAllEx({only_fields:["name","profile_connection.policy"],order_by:["name"],system_tags:["profile-connection"]}).pipe(X(()=>ne({queues:[]})),g(o=>this.dialog.open($,{data:{title:`${e.active?"Enable":"Disable"} resource management`,body:(e.active?"Enabling resource management will service the policy queues according to the provisioned resource assignment":"Disabling resource management will stop servicing the policy queues. <br>Tasks on these queues will remain pending until resource management is re-enabled")+`<br><br>${o.queues?.length>0?"Affected queues:":""} ${o.queues?.map(i=>this.getQueueLink(i)).join(", ")??""} 3 `,yes:`${e.active?"Enable":"Disable"}`,no:"Cancel",iconClass:"al-ico-alert",iconColor:"var(--color-warning)"},panelClass:"dialog-md"}).afterClosed().pipe(m(i=>i?n.saveActivatePolicy({active:e.active}):n.getResources({})))))))),this.saveActivatePolicy$=u(()=>this.actions$.pipe(f(n.saveActivatePolicy),g(e=>this.resourceService.resourcesEnablePolicyManager({enable:e.active}).pipe(m(()=>n.getResources({})),X(()=>ne(te(ie.ERROR,"Failed to save configuration"))))))),this.deleteProfile$=u(()=>this.actions$.pipe(f(n.deleteProfile),g(e=>this.dialog.open($,{data:{title:"DELETE PROFILE",body:`Are you sure you want to delete profile <b>${Ce(e.profile.name,200)}</b>?`,centerText:!0,yes:"DELETE",no:"Cancel",iconClass:"al-ico-trash"},panelClass:"dialog-md"}).afterClosed().pipe(_(o=>!!o),m(()=>n.removeProfile({profile:e.profile})))))),this.updateProfile$=u(()=>this.actions$.pipe(f(n.updateProfile),m(e=>n.updateProfileSuccess({profile:e.profile})))),this.connectProfile$=u(()=>this.actions$.pipe(f(n.connectProfile),g(e=>this.dialog.open(rt,{data:{dynamicFallbackWarning:e.profile.cost_field&&e.profile.profile_cost>e.pool.resources},panelClass:"dialog-sm"}).afterClosed().pipe(_(o=>typeof o=="string"&&o.length>0),m(o=>({id:e.profile.id.slice(0,16)+e.pool.id.slice(16),name:o,pool:e.pool.id})),m(o=>n.connectProfileSuccess({profile:I(D({},e.profile),{pool_links:[...e.profile.pool_links??[],o]}),Pool:I(D({},e.pool),{links:[...e.pool.links??[],o.id]})})))))),this.disconnectProfile$=u(()=>this.actions$.pipe(f(n.disconnectProfile),g(e=>this.dialog.open($,{data:{title:"DISCONNECT PROFILE",body:`Are you sure you want to disconnect <b>${Ce(e.profileName,200)}</b> profile from pool?`,centerText:!0,yes:"Disconnect",no:"Cancel",iconClass:"al-ico-link-off"},panelClass:"dialog-md"}).afterClosed().pipe(_(o=>o),m(()=>n.disconnectProfileSuccess({queueIds:[e.queueId]})))))),this.saveConfiguration$=u(()=>this.actions$.pipe(f(n.save),oe(()=>[this.store.select(A.selectPools),this.store.select(A.selectProfiles)]),g(([,e,o])=>this.resourceService.resourcesSetResourceConfiguration({pools:e,profiles:o}).pipe(m(()=>n.setDataSaved()),X(()=>[n.saveFailed(),te(ie.ERROR,"Failed to save configuration")]))))),this.provision$=u(()=>this.actions$.pipe(f(n.provision),g(()=>this.resourceService.resourcesTestConfigurationPublishing({})),g(e=>e.affected_policies?.length===0&&e.not_linked_profiles?.length===0?ne(n.provisionCall()):this.dialog.open(be,{data:I(D({},e),{test:!1})}).afterClosed().pipe(m(o=>o?n.provisionCall():n.provisionFailed()))))),this.provisionCall$=u(()=>this.actions$.pipe(f(n.provisionCall),g(()=>this.resourceService.resourcesPublishResourceConfiguration({}).pipe(m(()=>n.provisionSuccess()),X(()=>[n.provisionFailed(),te(ie.ERROR,"Failed to provision configuration")]))))),this.provisionSuccess$=u(()=>this.actions$.pipe(f(n.provisionSuccess),m(()=>te(ie.SUCCESS,"Successfully provisioned configuration"))))}
3getQueueLink(e){return`<a href='../workers-and-queues/queues?id=${e.id}' target='_blank'>${e.display_name||e.name}</a>`}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=Ee({token:t,factory:t.\u0275fac})}}return t})()});var dt,ut=O(()=>{Re();Ke();tt();pt();dt=[Le(A),Be([mt])]});var Ro,gi=O(()=>{ht();vt();ut();Ro=[{path:"",loadComponent:()=>import("./chunk-Y2SJHOAP.js").then(t=>t.ResourceConfigComponent),canActivate:[Ne],data:{workspaceNeutral:!0,features:Oe.UserManagement},providers:[dt]}]});gi();export{Ro as resourceConfigRoutes};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.